@lcap/nasl 1.0.2 → 2.12.0-beta
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 +11 -0
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/uniqueName.js +1 -1
- package/out/automate/engine/uniqueName.js.map +1 -1
- package/out/automate/engine/utils.d.ts +1 -0
- package/out/automate/engine/utils.js +89 -67
- package/out/automate/engine/utils.js.map +1 -1
- package/out/concepts/App__.d.ts +51 -49
- package/out/concepts/App__.js +86 -54
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/Assignment__.js +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +3 -3
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +11 -6
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js +8 -3
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +1 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +23 -21
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +9 -8
- package/out/concepts/CallQueryComponent__.js +89 -79
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +2 -2
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +1 -0
- package/out/concepts/ConfigGroup__.js +8 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +1 -0
- package/out/concepts/ConfigProperty__.js +4 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +1 -0
- package/out/concepts/Configuration__.js +4 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +143 -0
- package/out/concepts/DataSource__.js +316 -0
- package/out/concepts/DataSource__.js.map +1 -0
- package/out/concepts/Destination__.js +8 -8
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +3 -3
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +5 -0
- package/out/concepts/EntityIndex__.js +7 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +9 -0
- package/out/concepts/EntityProperty__.js +20 -3
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +5 -0
- package/out/concepts/Entity__.js +21 -11
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +11 -5
- 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 +3 -3
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.d.ts +18 -0
- package/out/concepts/Function__.js +96 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +3 -13
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +9 -9
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +1 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +19 -12
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.js +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +41 -42
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +1 -85
- package/out/concepts/Module__.js +6 -107
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +0 -86
- package/out/concepts/Namespace__.js +1 -108
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.d.ts +2 -1
- package/out/concepts/Param__.js +1 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +26 -11
- 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 +17 -10
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +9 -2
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +4 -0
- package/out/concepts/QueryFromExpression__.js +14 -3
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +4 -0
- package/out/concepts/QueryJoinExpression__.js +15 -4
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js +1 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +11 -4
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +10 -0
- package/out/concepts/SqlQueryComponent__.js +32 -5
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.js +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +20 -13
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +6 -6
- 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/Theme__.js +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -0
- package/out/concepts/TypeAnnotation__.js +46 -4
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +1 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +1 -1
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +18 -18
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +25 -23
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +5 -5
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +278 -0
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +1 -0
- package/out/concepts/index__.js +1 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/generator/genBundleFiles.js +8 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.js +13 -12
- package/out/generator/genMetaData.js.map +1 -1
- package/out/server/createUiTs.js +1 -0
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/getLogics.js +9 -1
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getProcesses.d.ts +3 -0
- package/out/server/getProcesses.js +61 -1
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.js +128 -6
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.js +10 -1
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.js +19 -1
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +2 -2
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +15 -11
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +15 -12
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +25 -21
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +12 -12
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +21 -20
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +6 -3
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +5 -5
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.js +8 -7
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +17 -15
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +15 -11
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +2 -2
- package/out/templator/utils.js.map +1 -1
- package/out/test/integration/connect-file.js +6 -6
- package/out/test/integration/connect-file.js.map +1 -1
- package/out/translator/index.js +1 -1
- package/out/translator/index.js.map +1 -1
- package/out/utils/index.d.ts +4 -0
- package/out/utils/index.js +32 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/automate/engine/index.js +12 -1
- package/src/automate/engine/uniqueName.js +1 -1
- package/src/automate/engine/utils.js +92 -67
- package/src/concepts/App__.ts +165 -95
- package/src/concepts/Argument__.ts +1 -1
- package/src/concepts/Assignee__.ts +1 -1
- package/src/concepts/Assignment__.ts +1 -1
- package/src/concepts/Attribute__.ts +1 -1
- package/src/concepts/BinaryExpression__.ts +1 -1
- package/src/concepts/BindAttribute__.ts +3 -3
- package/src/concepts/BindDirective__.ts +1 -1
- package/src/concepts/BindEvent__.ts +10 -6
- package/src/concepts/BooleanLiteral__.ts +1 -1
- package/src/concepts/CallFunction__.ts +19 -16
- package/src/concepts/CallInterface__.ts +1 -1
- package/src/concepts/CallLogic__.ts +23 -23
- package/src/concepts/CallQueryComponent__.ts +96 -113
- package/src/concepts/Comment__.ts +2 -2
- package/src/concepts/CompletionProperty__.ts +1 -1
- package/src/concepts/ConfigGroup__.ts +4 -2
- package/src/concepts/ConfigPropertyValue__.ts +1 -1
- package/src/concepts/ConfigProperty__.ts +5 -1
- package/src/concepts/Configuration__.ts +4 -1
- package/src/concepts/Constant__.ts +1 -1
- package/src/concepts/DataElement__.ts +1 -1
- package/src/concepts/DataSource__.ts +389 -0
- package/src/concepts/Destination__.ts +24 -8
- package/src/concepts/End__.ts +3 -3
- package/src/concepts/EntityIndex__.ts +8 -1
- package/src/concepts/EntityProperty__.ts +21 -3
- package/src/concepts/Entity__.ts +24 -12
- package/src/concepts/EnumItem__.ts +1 -1
- package/src/concepts/Enum__.ts +24 -5
- package/src/concepts/Event__.ts +1 -1
- package/src/concepts/ForEachStatement__.ts +3 -3
- package/src/concepts/Function__.ts +97 -3
- package/src/concepts/Identifier__.ts +12 -13
- package/src/concepts/IfStatement__.ts +10 -10
- package/src/concepts/InterfaceParam__.ts +1 -1
- package/src/concepts/Interface__.ts +20 -12
- package/src/concepts/JSBlock__.ts +1 -1
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +41 -39
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/Module__.ts +9 -204
- package/src/concepts/Namespace__.ts +1 -204
- package/src/concepts/NullLiteral__.ts +1 -1
- package/src/concepts/NumericLiteral__.ts +1 -1
- package/src/concepts/Param__.ts +3 -2
- package/src/concepts/Point__.ts +1 -1
- package/src/concepts/ProcessComponent__.ts +1 -1
- package/src/concepts/ProcessElement__.ts +29 -13
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/Process__.ts +17 -11
- package/src/concepts/QueryAggregateExpression__.ts +1 -1
- package/src/concepts/QueryFieldExpression__.ts +10 -2
- package/src/concepts/QueryFromExpression__.ts +14 -3
- package/src/concepts/QueryGroupByExpression__.ts +1 -1
- package/src/concepts/QueryJoinExpression__.ts +15 -4
- package/src/concepts/QueryLimitExpression__.ts +1 -1
- package/src/concepts/QueryOrderByExpression__.ts +1 -1
- package/src/concepts/QuerySelectExpression__.ts +1 -1
- package/src/concepts/Rect__.ts +1 -1
- package/src/concepts/Return__.ts +1 -1
- package/src/concepts/Role__.ts +11 -5
- package/src/concepts/Slot__.ts +1 -1
- package/src/concepts/SqlQueryComponent__.ts +30 -11
- package/src/concepts/Start__.ts +1 -1
- package/src/concepts/StringLiteral__.ts +1 -1
- package/src/concepts/StructureProperty__.ts +1 -1
- package/src/concepts/Structure__.ts +20 -12
- package/src/concepts/SwitchCase__.ts +6 -6
- package/src/concepts/SwitchStatement__.ts +1 -1
- package/src/concepts/Theme__.ts +1 -1
- package/src/concepts/Transactional__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +45 -23
- package/src/concepts/TypeParam__.ts +1 -1
- package/src/concepts/UnaryExpression__.ts +1 -1
- package/src/concepts/Unparsed__.ts +1 -1
- package/src/concepts/UseComponent__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +1 -1
- package/src/concepts/Variable__.ts +1 -1
- package/src/concepts/ViewComponent__.ts +1 -1
- package/src/concepts/ViewElement__.ts +19 -19
- package/src/concepts/View__.ts +25 -23
- package/src/concepts/WhileStatement__.ts +5 -5
- package/src/concepts/basics/stdlib/nasl.util.ts +279 -0
- package/src/concepts/index__.ts +1 -0
- package/src/generator/genBundleFiles.ts +8 -3
- package/src/generator/genMetaData.ts +13 -13
- package/src/server/createUiTs.ts +1 -0
- package/src/server/getLogics.ts +11 -3
- package/src/server/getProcesses.ts +61 -0
- package/src/server/naslServer.ts +124 -6
- package/src/server/process2LogicNamespace.ts +29 -19
- package/src/server/translator.ts +22 -1
- package/src/service/storage/init.ts +2 -2
- package/src/templator/genCreateBlock.ts +16 -13
- package/src/templator/genCurdEditMultipleKeyBlock.ts +16 -13
- package/src/templator/genCurdMultipleKeyBlock.ts +26 -22
- package/src/templator/genEditTableBlock.ts +14 -13
- package/src/templator/genGridViewBlock.ts +22 -21
- package/src/templator/genListViewBlock.ts +9 -5
- package/src/templator/genQueryComponent.ts +6 -6
- package/src/templator/genSelectBlock.ts +9 -8
- package/src/templator/genTableBlock.ts +18 -16
- package/src/templator/genUpdateBlock.ts +16 -12
- package/src/templator/utils.ts +2 -2
- package/src/test/integration/connect-file.ts +6 -6
- package/src/translator/index.ts +1 -1
- package/src/utils/index.ts +32 -0
package/src/concepts/Entity__.ts
CHANGED
|
@@ -15,6 +15,7 @@ import classMap from '../common/classMap';
|
|
|
15
15
|
import EntityProperty from './EntityProperty__';
|
|
16
16
|
import EntityIndex from './EntityIndex__';
|
|
17
17
|
import Module from './Module__';
|
|
18
|
+
import DataSource from './DataSource__';
|
|
18
19
|
import App from './App__';
|
|
19
20
|
|
|
20
21
|
/**
|
|
@@ -82,6 +83,12 @@ export class Entity extends BaseNode {
|
|
|
82
83
|
get app() {
|
|
83
84
|
return this.getAncestor('App') as App;
|
|
84
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* 祖先 DataSource
|
|
88
|
+
*/
|
|
89
|
+
get dataSource() {
|
|
90
|
+
return this.getAncestor('DataSource') as DataSource;
|
|
91
|
+
}
|
|
85
92
|
|
|
86
93
|
/**
|
|
87
94
|
* @param source 需要合并的部分参数
|
|
@@ -644,40 +651,45 @@ export class Entity extends BaseNode {
|
|
|
644
651
|
@withSourceMap()
|
|
645
652
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
646
653
|
let code = `export class ${this.name} {\n`;
|
|
647
|
-
code += indent(state
|
|
654
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
648
655
|
code += `__name: '${this.getNamespace()}.${this.name}';\n`;
|
|
649
656
|
this.properties.forEach((property) => {
|
|
650
|
-
code += indent(state
|
|
657
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
651
658
|
code += property.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
652
659
|
code += ';\n';
|
|
653
660
|
});
|
|
654
661
|
if (this.indexes && this.indexes.length) {
|
|
655
|
-
code += indent(state
|
|
662
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
656
663
|
code += `__IndexList() {\n`;
|
|
657
664
|
code += ` return [`;
|
|
658
665
|
this.indexes.forEach((entityIndex) => {
|
|
659
|
-
code += indent(state
|
|
666
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
660
667
|
code += '\n ';
|
|
661
668
|
code += entityIndex.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
662
669
|
});
|
|
663
|
-
code += indent(state
|
|
670
|
+
code += indent((state?.tabSize || 0)) + `\n ];\n }\n`;
|
|
664
671
|
}
|
|
665
672
|
|
|
666
673
|
const ns = this.ns;
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* 8个函数的总行数
|
|
677
|
+
* 如果修改这里,可能会影响到dataSource的重命名, 在naslserver中,可能要一起修改
|
|
678
|
+
*/
|
|
667
679
|
code += `\nstatic logics = {\n`;
|
|
668
680
|
ns.logics.forEach((logic) => {
|
|
669
|
-
code += indent(state
|
|
681
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
670
682
|
code += logic.toEmbeddedTS(shiftState(state, code), 'inObject');
|
|
671
683
|
});
|
|
672
684
|
code += '}\n';
|
|
673
|
-
code += indent(state
|
|
685
|
+
code += indent((state?.tabSize || 0)) + '}\n';
|
|
674
686
|
|
|
675
687
|
return code;
|
|
676
688
|
}
|
|
677
689
|
|
|
678
690
|
getNamespace() {
|
|
679
|
-
if (this.parentNode && (this.parentNode as
|
|
680
|
-
return `${(this.parentNode as
|
|
691
|
+
if (this.parentNode && (this.parentNode as DataSource).getNamespace)
|
|
692
|
+
return `${(this.parentNode as DataSource).getNamespace()}.${this.parentNode.name}.entities`;
|
|
681
693
|
else
|
|
682
694
|
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
683
695
|
}
|
|
@@ -687,12 +699,12 @@ export class Entity extends BaseNode {
|
|
|
687
699
|
* @param name 一般不用传,用于 rename
|
|
688
700
|
*/
|
|
689
701
|
getEmbeddedFilePath(name = this.name) {
|
|
690
|
-
return `/embedded/${this.app.name}/entities/${name}.ts`;
|
|
702
|
+
return `/embedded/${this.app.name}/datasources/${this.parentNode.name}/entities/${name}.ts`;
|
|
691
703
|
}
|
|
692
704
|
|
|
693
705
|
get ns() {
|
|
694
706
|
const ns: Namespace = entity2LogicNamespace(this);
|
|
695
|
-
ns.path = this.getNamespace()
|
|
707
|
+
ns.path = this.getNamespace();
|
|
696
708
|
return ns;
|
|
697
709
|
}
|
|
698
710
|
// @excludedInJSON()
|
|
@@ -728,7 +740,7 @@ export class Entity extends BaseNode {
|
|
|
728
740
|
//================================================================================
|
|
729
741
|
}
|
|
730
742
|
|
|
731
|
-
classMap
|
|
743
|
+
classMap.Entity = Entity;
|
|
732
744
|
export default Entity;
|
|
733
745
|
//================================================================================
|
|
734
746
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -132,7 +132,7 @@ export class EnumItem extends BaseNode {
|
|
|
132
132
|
//================================================================================
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
classMap
|
|
135
|
+
classMap.EnumItem = EnumItem;
|
|
136
136
|
export default EnumItem;
|
|
137
137
|
//================================================================================
|
|
138
138
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
package/src/concepts/Enum__.ts
CHANGED
|
@@ -125,6 +125,10 @@ export class Enum extends BaseNode {
|
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
128
132
|
/**
|
|
129
133
|
* 插入枚举项
|
|
130
134
|
* @internal
|
|
@@ -157,6 +161,8 @@ export class Enum extends BaseNode {
|
|
|
157
161
|
return enumItem;
|
|
158
162
|
}
|
|
159
163
|
|
|
164
|
+
|
|
165
|
+
|
|
160
166
|
/**
|
|
161
167
|
* 插入枚举项
|
|
162
168
|
* @param enumItemOptions 枚举项参数
|
|
@@ -179,6 +185,8 @@ export class Enum extends BaseNode {
|
|
|
179
185
|
return node;
|
|
180
186
|
}
|
|
181
187
|
|
|
188
|
+
|
|
189
|
+
|
|
182
190
|
/**
|
|
183
191
|
* 添加枚举项
|
|
184
192
|
* @internal
|
|
@@ -198,6 +206,8 @@ export class Enum extends BaseNode {
|
|
|
198
206
|
return this._insertEnumItemAt(options as any, index);
|
|
199
207
|
}
|
|
200
208
|
|
|
209
|
+
|
|
210
|
+
|
|
201
211
|
/**
|
|
202
212
|
* 添加枚举项
|
|
203
213
|
* @param enumItemOptions 枚举项参数
|
|
@@ -221,6 +231,9 @@ export class Enum extends BaseNode {
|
|
|
221
231
|
return node;
|
|
222
232
|
}
|
|
223
233
|
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
|
|
224
237
|
/**
|
|
225
238
|
* 删除枚举项
|
|
226
239
|
* @param enumItem 已有的枚举项实例
|
|
@@ -228,7 +241,7 @@ export class Enum extends BaseNode {
|
|
|
228
241
|
removeEnumItem(enumItem: EnumItem): void;
|
|
229
242
|
|
|
230
243
|
removeEnumItem(options: EnumItem) {
|
|
231
|
-
|
|
244
|
+
let enumItem: EnumItem = options;
|
|
232
245
|
return enumItem.delete();
|
|
233
246
|
}
|
|
234
247
|
|
|
@@ -282,9 +295,9 @@ export class Enum extends BaseNode {
|
|
|
282
295
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
283
296
|
let code = `export class ${this.name} extends nasl.core.Enums {\n`;
|
|
284
297
|
// 增加一个单独的标签
|
|
285
|
-
code += indent(state
|
|
298
|
+
code += indent((state?.tabSize || 0) + 1) + `__name: '${this.getNamespace()}.${this.name}';\n`;
|
|
286
299
|
this.enumItems.forEach((property) => {
|
|
287
|
-
code += indent(state
|
|
300
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
288
301
|
code += property.toEmbeddedTS(shiftState(state, code, { tabSize: 0 }));
|
|
289
302
|
code += ';\n';
|
|
290
303
|
});
|
|
@@ -298,14 +311,20 @@ export class Enum extends BaseNode {
|
|
|
298
311
|
return str;
|
|
299
312
|
}
|
|
300
313
|
`;
|
|
301
|
-
code += indent(state
|
|
314
|
+
code += indent((state?.tabSize || 0)) + '}\n';
|
|
302
315
|
|
|
303
316
|
return code;
|
|
304
317
|
}
|
|
305
318
|
|
|
306
319
|
getNamespace() {
|
|
307
320
|
if (this.parentNode && (this.parentNode as Namespace).getNamespace) {
|
|
308
|
-
|
|
321
|
+
const parentNamespace = (this.parentNode as Namespace).getNamespace();
|
|
322
|
+
const parentName = this.parentNode.name;
|
|
323
|
+
const arr = [parentNamespace];
|
|
324
|
+
if (this.parentNode.concept !== 'App' && parentName) {
|
|
325
|
+
arr.push(parentName);
|
|
326
|
+
}
|
|
327
|
+
return `${arr.join('.')}.enums`;
|
|
309
328
|
} else
|
|
310
329
|
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
311
330
|
}
|
package/src/concepts/Event__.ts
CHANGED
|
@@ -309,7 +309,7 @@ export class Event extends BaseNode {
|
|
|
309
309
|
//================================================================================
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
-
classMap
|
|
312
|
+
classMap.Event = Event;
|
|
313
313
|
export default Event;
|
|
314
314
|
//================================================================================
|
|
315
315
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -548,11 +548,11 @@ export class ForEachStatement extends LogicItem {
|
|
|
548
548
|
this.body.forEach((logicItem) => {
|
|
549
549
|
code
|
|
550
550
|
+= logicItem.toEmbeddedTS(shiftState(state, code, {
|
|
551
|
-
tabSize: state
|
|
551
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
552
552
|
})) + '\n';
|
|
553
553
|
});
|
|
554
554
|
}
|
|
555
|
-
code += indent(state
|
|
555
|
+
code += indent((state?.tabSize || 0)) + '})\n';
|
|
556
556
|
|
|
557
557
|
return code;
|
|
558
558
|
}
|
|
@@ -562,7 +562,7 @@ export class ForEachStatement extends LogicItem {
|
|
|
562
562
|
//================================================================================
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
-
classMap
|
|
565
|
+
classMap.ForEachStatement = ForEachStatement;
|
|
566
566
|
export default ForEachStatement;
|
|
567
567
|
//================================================================================
|
|
568
568
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import Namespace from './Namespace__';
|
|
2
|
+
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
3
|
+
import LogicItem from './LogicItem__';
|
|
4
|
+
|
|
2
5
|
//================================================================================
|
|
3
6
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
7
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -682,7 +685,7 @@ export class Function extends BaseNode {
|
|
|
682
685
|
}
|
|
683
686
|
|
|
684
687
|
|
|
685
|
-
|
|
688
|
+
|
|
686
689
|
|
|
687
690
|
/**
|
|
688
691
|
* 删除类型参数
|
|
@@ -886,7 +889,72 @@ export class Function extends BaseNode {
|
|
|
886
889
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
887
890
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
888
891
|
//================================================================================
|
|
892
|
+
/**
|
|
893
|
+
* returnExpression 输出的Lambda 表达式
|
|
894
|
+
*/
|
|
895
|
+
@property('LogicItem')
|
|
896
|
+
returnExpression: LogicItem = undefined;
|
|
889
897
|
|
|
898
|
+
/**
|
|
899
|
+
* 设置returnExpression 输出的Lambda 表达式
|
|
900
|
+
*/
|
|
901
|
+
setReturnExpression(expression: LogicItem) {
|
|
902
|
+
expression._delete();
|
|
903
|
+
const relationOptions = { parentNode: this, parentKey: 'returnExpression' };
|
|
904
|
+
Object.assign(expression, relationOptions);
|
|
905
|
+
const object = {
|
|
906
|
+
returnExpression: expression,
|
|
907
|
+
};
|
|
908
|
+
this.update({
|
|
909
|
+
...object,
|
|
910
|
+
});
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
toJS(state?: TranslatorState): String {
|
|
914
|
+
let code = '';
|
|
915
|
+
code += '(';
|
|
916
|
+
this.params.forEach((param, index) => {
|
|
917
|
+
code += param.toJS(shiftState(state, code));
|
|
918
|
+
if (index !== this.params.length - 1) {
|
|
919
|
+
code += ',';
|
|
920
|
+
}
|
|
921
|
+
});
|
|
922
|
+
code += ')';
|
|
923
|
+
code += ' => (';
|
|
924
|
+
if (this.returnExpression) {
|
|
925
|
+
code += this.returnExpression.toJS(shiftState(state, code));
|
|
926
|
+
}
|
|
927
|
+
code += ')';
|
|
928
|
+
return code;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
/**
|
|
932
|
+
* 刪除LogicItem
|
|
933
|
+
* @param logicItem
|
|
934
|
+
* @returns
|
|
935
|
+
*/
|
|
936
|
+
__removeLogicItem(logicItem: LogicItem) {
|
|
937
|
+
const parentKey = logicItem.parentKey;
|
|
938
|
+
const params: Params = {
|
|
939
|
+
parentNode: this,
|
|
940
|
+
parentKey,
|
|
941
|
+
index: -1,
|
|
942
|
+
object: null,
|
|
943
|
+
oldObject: logicItem,
|
|
944
|
+
};
|
|
945
|
+
if (parentKey) {
|
|
946
|
+
params.parentKey = parentKey;
|
|
947
|
+
if (Array.isArray((this as any)[parentKey])) {
|
|
948
|
+
const index = (this as any)[parentKey].indexOf(logicItem);
|
|
949
|
+
~index && (this as any)[parentKey].splice(index, 1);
|
|
950
|
+
params.index = index;
|
|
951
|
+
} else if ((this as any)[parentKey] === logicItem) {
|
|
952
|
+
params.index = 0;
|
|
953
|
+
(this as any)[parentKey] = undefined;
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
return params;
|
|
957
|
+
}
|
|
890
958
|
getVarExistingNames(excludedList: Array<Param | Return | Variable> = []) {
|
|
891
959
|
const excludedSet = new Set(excludedList);
|
|
892
960
|
return [...this.params, ...this.returns, ...this.variables].filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -901,7 +969,33 @@ export class Function extends BaseNode {
|
|
|
901
969
|
} else
|
|
902
970
|
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
903
971
|
}
|
|
904
|
-
|
|
972
|
+
@withSourceMap()
|
|
973
|
+
toEmbeddedTS(state?: TranslatorState): string {
|
|
974
|
+
let code = '';
|
|
975
|
+
if (this.returnExpression) {
|
|
976
|
+
code += `(`;
|
|
977
|
+
this.params.forEach((param, index) => {
|
|
978
|
+
code += param.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
979
|
+
if (index !== this.params.length - 1)
|
|
980
|
+
code += ', ';
|
|
981
|
+
});
|
|
982
|
+
code += `)`;
|
|
983
|
+
if (this.returns.length) {
|
|
984
|
+
code += ': ';
|
|
985
|
+
code += this.returns[0].typeAnnotation.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
986
|
+
}
|
|
987
|
+
code += ` => (`;
|
|
988
|
+
|
|
989
|
+
if (this.returnExpression) {
|
|
990
|
+
code += this.returnExpression.toEmbeddedTS && this.returnExpression.toEmbeddedTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
991
|
+
}
|
|
992
|
+
code += indent(state.tabSize) + ')';
|
|
993
|
+
} else {
|
|
994
|
+
code += '__IDENTIFIER__';
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
return code;
|
|
998
|
+
}
|
|
905
999
|
get calleeKey() {
|
|
906
1000
|
const calleeNamespace = this.getNamespace();
|
|
907
1001
|
const calleeName = this.name;
|
|
@@ -914,7 +1008,7 @@ export class Function extends BaseNode {
|
|
|
914
1008
|
//================================================================================
|
|
915
1009
|
}
|
|
916
1010
|
|
|
917
|
-
classMap
|
|
1011
|
+
classMap.Function = Function;
|
|
918
1012
|
export default Function;
|
|
919
1013
|
//================================================================================
|
|
920
1014
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
2
2
|
import { BindAttribute, CallFunction, CallLogic, Argument, MemberExpression, TypeAnnotation } from '..';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
|
+
import { findConceptKeyWordByNamespace } from '../utils';
|
|
4
5
|
|
|
5
6
|
//================================================================================
|
|
6
7
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -38,6 +39,8 @@ export class Identifier extends LogicItem {
|
|
|
38
39
|
@property()
|
|
39
40
|
name: string = undefined;
|
|
40
41
|
|
|
42
|
+
|
|
43
|
+
|
|
41
44
|
/**
|
|
42
45
|
* @param source 需要合并的部分参数
|
|
43
46
|
*/
|
|
@@ -51,6 +54,13 @@ export class Identifier extends LogicItem {
|
|
|
51
54
|
return super.from(source, parentNode, parentKey) as Identifier;
|
|
52
55
|
}
|
|
53
56
|
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
54
64
|
//================================================================================
|
|
55
65
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
56
66
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
@@ -68,18 +78,7 @@ export class Identifier extends LogicItem {
|
|
|
68
78
|
};
|
|
69
79
|
|
|
70
80
|
isEnum() {
|
|
71
|
-
|
|
72
|
-
if (namespace) {
|
|
73
|
-
const namespaceArr = namespace.split('.');
|
|
74
|
-
const start = namespaceArr.shift();
|
|
75
|
-
if (start === 'app' || start === 'extensions') {
|
|
76
|
-
const mod = start === 'app' ? 0 : 1;
|
|
77
|
-
const keywordViews = namespaceArr.filter((namespaceItem, index) => index % 2 === mod);
|
|
78
|
-
const last = keywordViews.pop();
|
|
79
|
-
return last === 'enums';
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return false;
|
|
81
|
+
return findConceptKeyWordByNamespace(this.namespace) === 'enums';
|
|
83
82
|
}
|
|
84
83
|
|
|
85
84
|
toVue(options?: ElementToVueOptions): string {
|
|
@@ -215,7 +214,7 @@ export class Identifier extends LogicItem {
|
|
|
215
214
|
//================================================================================
|
|
216
215
|
}
|
|
217
216
|
|
|
218
|
-
classMap
|
|
217
|
+
classMap['Identifier'] = Identifier;
|
|
219
218
|
export default Identifier;
|
|
220
219
|
//================================================================================
|
|
221
220
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -367,13 +367,13 @@ export class IfStatement extends LogicItem {
|
|
|
367
367
|
public static getDefaultOptions() {
|
|
368
368
|
return {
|
|
369
369
|
label: '条件分支',
|
|
370
|
-
}
|
|
370
|
+
};
|
|
371
371
|
}
|
|
372
372
|
toJS(state?: TranslatorState) {
|
|
373
373
|
let code = '';
|
|
374
374
|
code += 'if (';
|
|
375
375
|
code += this.test ? this.test.toJS(shiftState(state, code, {
|
|
376
|
-
tabSize: state
|
|
376
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
377
377
|
})) : '';
|
|
378
378
|
|
|
379
379
|
code += ') {\n';
|
|
@@ -382,17 +382,17 @@ export class IfStatement extends LogicItem {
|
|
|
382
382
|
this.consequent.forEach((logicItem) => {
|
|
383
383
|
code
|
|
384
384
|
+= logicItem.toJS(shiftState(state, code, {
|
|
385
|
-
tabSize: state
|
|
385
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
386
386
|
})) + '\n';
|
|
387
387
|
});
|
|
388
388
|
}
|
|
389
389
|
code += '}';
|
|
390
390
|
if (Array.isArray(this.alternate)) {
|
|
391
|
-
code += indent(state
|
|
391
|
+
code += indent((state?.tabSize || 0)) + ' else {\n';
|
|
392
392
|
this.alternate.forEach((logicItem) => {
|
|
393
393
|
code
|
|
394
394
|
+= logicItem.toJS(shiftState(state, code, {
|
|
395
|
-
tabSize: state
|
|
395
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
396
396
|
})) + '\n';
|
|
397
397
|
});
|
|
398
398
|
code += '}\n';
|
|
@@ -414,21 +414,21 @@ export class IfStatement extends LogicItem {
|
|
|
414
414
|
this.consequent.forEach((logicItem) => {
|
|
415
415
|
code
|
|
416
416
|
+= logicItem.toEmbeddedTS(shiftState(state, code, {
|
|
417
|
-
tabSize: state
|
|
417
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
418
418
|
})) + '\n';
|
|
419
419
|
});
|
|
420
420
|
}
|
|
421
421
|
|
|
422
|
-
code += indent(state
|
|
422
|
+
code += indent((state?.tabSize || 0)) + '}';
|
|
423
423
|
if (Array.isArray(this.alternate)) {
|
|
424
424
|
code += ' else {\n';
|
|
425
425
|
this.alternate.forEach((logicItem) => {
|
|
426
426
|
code
|
|
427
427
|
+= logicItem.toEmbeddedTS(shiftState(state, code, {
|
|
428
|
-
tabSize: state
|
|
428
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
429
429
|
})) + '\n';
|
|
430
430
|
});
|
|
431
|
-
code += indent(state
|
|
431
|
+
code += indent((state?.tabSize || 0)) + '}\n';
|
|
432
432
|
}
|
|
433
433
|
return code;
|
|
434
434
|
}
|
|
@@ -438,7 +438,7 @@ export class IfStatement extends LogicItem {
|
|
|
438
438
|
//================================================================================
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
classMap
|
|
441
|
+
classMap.IfStatement = IfStatement;
|
|
442
442
|
export default IfStatement;
|
|
443
443
|
//================================================================================
|
|
444
444
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -333,7 +333,7 @@ export class InterfaceParam extends BaseNode {
|
|
|
333
333
|
//================================================================================
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
-
classMap
|
|
336
|
+
classMap.InterfaceParam = InterfaceParam;
|
|
337
337
|
export default InterfaceParam;
|
|
338
338
|
//================================================================================
|
|
339
339
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -726,21 +726,29 @@ export class Interface extends BaseNode {
|
|
|
726
726
|
}
|
|
727
727
|
|
|
728
728
|
getNamespace() {
|
|
729
|
-
if (this.parentNode && (this.parentNode as Namespace).getNamespace)
|
|
730
|
-
|
|
731
|
-
|
|
729
|
+
if (this.parentNode && (this.parentNode as Namespace).getNamespace) {
|
|
730
|
+
const parentNamespace = (this.parentNode as Namespace).getNamespace();
|
|
731
|
+
const parentName = this.parentNode.name;
|
|
732
|
+
const arr = [parentNamespace];
|
|
733
|
+
if (this.parentNode.concept !== 'App' && parentName) {
|
|
734
|
+
arr.push(parentName);
|
|
735
|
+
}
|
|
736
|
+
return `${arr.join('.')}.interfaces`;
|
|
737
|
+
} else
|
|
732
738
|
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
733
739
|
}
|
|
740
|
+
|
|
734
741
|
getTsNamespace() {
|
|
735
|
-
if (this.parentNode.
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
742
|
+
if (this.parentNode && (this.parentNode as Namespace).getTsNamespace) {
|
|
743
|
+
const parentNamespace = (this.parentNode as Namespace).getTsNamespace();
|
|
744
|
+
const parentName = this.parentNode.tsName || this.parentNode.name;
|
|
745
|
+
const arr = [parentNamespace];
|
|
746
|
+
if (this.parentNode.concept !== 'App' && parentName) {
|
|
747
|
+
arr.push(parentName);
|
|
742
748
|
}
|
|
743
|
-
|
|
749
|
+
return `${arr.join('.')}.interfaces`;
|
|
750
|
+
} else
|
|
751
|
+
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
744
752
|
}
|
|
745
753
|
|
|
746
754
|
getVarExistingNames(excludedList: Array<InterfaceParam | Return> = []) {
|
|
@@ -754,7 +762,7 @@ export class Interface extends BaseNode {
|
|
|
754
762
|
//================================================================================
|
|
755
763
|
}
|
|
756
764
|
|
|
757
|
-
classMap
|
|
765
|
+
classMap.Interface = Interface;
|
|
758
766
|
export default Interface;
|
|
759
767
|
//================================================================================
|
|
760
768
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -93,7 +93,7 @@ export class JSBlock extends LogicItem {
|
|
|
93
93
|
//================================================================================
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
classMap
|
|
96
|
+
classMap.JSBlock = JSBlock;
|
|
97
97
|
export default JSBlock;
|
|
98
98
|
//================================================================================
|
|
99
99
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -245,7 +245,7 @@ export class LogicItem extends BaseNode {
|
|
|
245
245
|
//================================================================================
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
classMap
|
|
248
|
+
classMap.LogicItem = LogicItem;
|
|
249
249
|
export default LogicItem;
|
|
250
250
|
//================================================================================
|
|
251
251
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|