@lcap/nasl 1.0.1 → 2.12.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/index.d.ts +1 -0
- package/out/automate/engine/index.js +34 -12
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/operators.d.ts +10 -2
- package/out/automate/engine/operators.js +105 -7
- package/out/automate/engine/operators.js.map +1 -1
- package/out/automate/engine/uniqueName.d.ts +8 -2
- package/out/automate/engine/uniqueName.js +72 -4
- package/out/automate/engine/uniqueName.js.map +1 -1
- package/out/automate/engine/utils.d.ts +1 -0
- package/out/automate/engine/utils.js +108 -67
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/process.d.ts +9 -0
- package/out/automate/template/process.js +10976 -0
- package/out/automate/template/process.js.map +1 -0
- package/out/bak/translator.js +1 -0
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +6 -1
- package/out/common/BaseNode.js +37 -6
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +52 -49
- package/out/concepts/App__.js +89 -53
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +11 -0
- package/out/concepts/Assignee__.js +34 -0
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +2 -2
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +10 -3
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +15 -6
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +4 -0
- package/out/concepts/BooleanLiteral__.js +11 -0
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js +9 -4
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.js +48 -30
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +34 -4
- package/out/concepts/CallQueryComponent__.js +340 -95
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +1 -0
- package/out/concepts/ConfigGroup__.js +7 -0
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +1 -0
- package/out/concepts/ConfigProperty__.js +3 -0
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +1 -0
- package/out/concepts/Configuration__.js +3 -0
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js +6 -6
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +143 -0
- package/out/concepts/DataSource__.js +318 -0
- package/out/concepts/DataSource__.js.map +1 -0
- package/out/concepts/Destination__.js +22 -8
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +2 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +5 -0
- package/out/concepts/EntityIndex__.js +10 -2
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +9 -0
- package/out/concepts/EntityProperty__.js +22 -7
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +6 -0
- package/out/concepts/Entity__.js +27 -11
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +1 -0
- package/out/concepts/Enum__.js +14 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +2 -2
- 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 +5 -14
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +8 -8
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +9 -4
- 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 +3 -5
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/Logic__.js +44 -44
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Module__.d.ts +116 -194
- package/out/concepts/Module__.js +31 -114
- 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/Param__.d.ts +3 -2
- package/out/concepts/Param__.js +15 -8
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +38 -12
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Process__.d.ts +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__.d.ts +1 -0
- package/out/concepts/QueryFieldExpression__.js +11 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +4 -0
- package/out/concepts/QueryFromExpression__.js +13 -2
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +3 -0
- package/out/concepts/QueryGroupByExpression__.js +20 -0
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +4 -0
- package/out/concepts/QueryJoinExpression__.js +14 -3
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +16 -11
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +10 -3
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +14 -0
- package/out/concepts/SqlQueryComponent__.js +48 -5
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -9
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +11 -10
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +19 -12
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +1 -1
- package/out/concepts/SwitchCase__.js +23 -25
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +1 -6
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -0
- package/out/concepts/TypeAnnotation__.js +53 -3
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -1
- package/out/concepts/Variable__.js +16 -11
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.js +25 -20
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -3
- package/out/concepts/View__.js +42 -36
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +4 -4
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +20 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.interface.d.ts +2 -0
- package/out/concepts/basics/stdlib/nasl.interface.js +4 -4
- package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.d.ts +4 -0
- package/out/concepts/basics/stdlib/nasl.process.js +410 -0
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +1 -11
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +270 -8
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +2 -0
- package/out/concepts/basics/types/index.js +6 -1
- package/out/concepts/basics/types/index.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/enums/KEYWORDS.js +0 -7
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +3 -1
- package/out/generator/genBundleFiles.js +23 -5
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +1 -0
- package/out/generator/genMetaData.js +20 -12
- package/out/generator/genMetaData.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.js +2 -1
- package/out/index.js.map +1 -1
- package/out/manager/diagnostic.d.ts +1 -1
- package/out/server/createUiTs.js +1 -0
- package/out/server/createUiTs.js.map +1 -1
- package/out/{test/integration/connect-file copy.d.ts → server/extendBaseNode.d.ts} +0 -0
- package/out/server/extendBaseNode.js +323 -0
- package/out/server/extendBaseNode.js.map +1 -0
- package/out/server/getLogics.js +49 -2
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +52 -2
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +8 -2
- package/out/server/getProcesses.js +228 -20
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getScope.d.ts +1 -0
- package/out/server/getScope.js +4 -0
- package/out/server/getScope.js.map +1 -1
- package/out/server/index.d.ts +1 -0
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +8 -5
- package/out/server/naslServer.js +314 -383
- 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.d.ts +1 -1
- package/out/server/translator.js +40 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -0
- package/out/service/storage/init.js +113 -94
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +34 -24
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +28 -18
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +45 -29
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +15 -13
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +1 -1
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +29 -24
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +7 -5
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +31 -29
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.js +13 -22
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +31 -21
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +35 -25
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +5 -3
- package/out/templator/utils.js +2 -1
- 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 +5 -0
- package/out/utils/index.js +50 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +1 -2
- package/src/automate/engine/index.js +33 -8
- package/src/automate/engine/operators.js +114 -17
- package/src/automate/engine/uniqueName.js +77 -9
- package/src/automate/engine/utils.js +110 -69
- package/src/automate/template/process.js +10999 -0
- package/src/bak/translator.js +1 -0
- package/src/common/BaseNode.ts +35 -7
- package/src/concepts/App__.ts +132 -131
- package/src/concepts/Assignee__.ts +30 -0
- package/src/concepts/BindAttribute__.ts +2 -2
- package/src/concepts/BindDirective__.ts +9 -7
- package/src/concepts/BindEvent__.ts +14 -6
- package/src/concepts/BooleanLiteral__.ts +12 -0
- package/src/concepts/CallFunction__.ts +7 -4
- package/src/concepts/CallLogic__.ts +47 -32
- package/src/concepts/CallQueryComponent__.ts +352 -101
- package/src/concepts/Comment__.ts +1 -1
- package/src/concepts/ConfigGroup__.ts +3 -1
- package/src/concepts/ConfigProperty__.ts +4 -0
- package/src/concepts/Configuration__.ts +3 -0
- package/src/concepts/Constant__.ts +6 -6
- package/src/concepts/DataSource__.ts +391 -0
- package/src/concepts/Destination__.ts +22 -8
- package/src/concepts/End__.ts +2 -2
- package/src/concepts/EntityIndex__.ts +11 -2
- package/src/concepts/EntityProperty__.ts +23 -7
- package/src/concepts/Entity__.ts +38 -14
- package/src/concepts/Enum__.ts +15 -4
- package/src/concepts/ForEachStatement__.ts +2 -2
- package/src/concepts/Function__.ts +95 -1
- package/src/concepts/Identifier__.ts +5 -14
- package/src/concepts/IfStatement__.ts +9 -9
- package/src/concepts/InterfaceParam__.ts +9 -4
- package/src/concepts/Interface__.ts +20 -12
- package/src/concepts/JSBlock__.ts +3 -12
- package/src/concepts/Logic__.ts +45 -79
- package/src/concepts/Module__.ts +141 -342
- package/src/concepts/Namespace__.ts +1 -204
- package/src/concepts/Param__.ts +17 -9
- package/src/concepts/ProcessElement__.ts +42 -15
- package/src/concepts/Process__.ts +18 -12
- package/src/concepts/QueryAggregateExpression__.ts +1 -1
- package/src/concepts/QueryFieldExpression__.ts +13 -1
- package/src/concepts/QueryFromExpression__.ts +13 -2
- package/src/concepts/QueryGroupByExpression__.ts +23 -0
- package/src/concepts/QueryJoinExpression__.ts +14 -3
- package/src/concepts/Return__.ts +16 -11
- package/src/concepts/Role__.ts +10 -4
- package/src/concepts/SqlQueryComponent__.ts +47 -11
- package/src/concepts/StringLiteral__.ts +2 -9
- package/src/concepts/StructureProperty__.ts +11 -14
- package/src/concepts/Structure__.ts +19 -11
- package/src/concepts/SwitchCase__.ts +23 -27
- package/src/concepts/SwitchStatement__.ts +1 -5
- package/src/concepts/TypeAnnotation__.ts +52 -3
- package/src/concepts/Variable__.ts +16 -11
- package/src/concepts/ViewElement__.ts +26 -39
- package/src/concepts/View__.ts +45 -38
- package/src/concepts/WhileStatement__.ts +4 -4
- package/src/concepts/basics/stdlib/nasl.auth.ts +20 -0
- package/src/concepts/basics/stdlib/nasl.configuration.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.interface.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.process.ts +406 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +1 -11
- package/src/concepts/basics/stdlib/nasl.util.ts +271 -8
- package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
- package/src/concepts/basics/types/index.ts +2 -0
- package/src/concepts/index__.ts +1 -0
- package/src/enums/KEYWORDS.ts +0 -7
- package/src/generator/genBundleFiles.ts +28 -7
- package/src/generator/genMetaData.ts +22 -13
- package/src/index.ts +1 -1
- package/src/manager/diagnostic.ts +1 -1
- package/src/server/createUiTs.ts +1 -0
- package/src/server/extendBaseNode.ts +318 -0
- package/src/server/getLogics.ts +51 -5
- package/src/server/getMemberIdentifier.ts +53 -2
- package/src/server/getProcesses.ts +238 -21
- package/src/server/getScope.ts +5 -0
- package/src/server/index.ts +1 -0
- package/src/server/naslServer.ts +322 -380
- package/src/server/process2LogicNamespace.ts +29 -19
- package/src/server/translator.ts +42 -2
- package/src/service/creator/errHandles.js +6 -0
- package/src/service/storage/init.ts +115 -97
- package/src/templator/genCreateBlock.ts +35 -26
- package/src/templator/genCurdEditMultipleKeyBlock.ts +29 -21
- package/src/templator/genCurdMultipleKeyBlock.ts +46 -31
- package/src/templator/genEditTableBlock.ts +17 -14
- package/src/templator/genEnumSelectBlock.ts +1 -1
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genGridViewBlock.ts +30 -25
- package/src/templator/genListViewBlock.ts +10 -7
- package/src/templator/genQueryComponent.ts +34 -30
- package/src/templator/genSelectBlock.ts +14 -23
- package/src/templator/genTableBlock.ts +32 -23
- package/src/templator/genUpdateBlock.ts +36 -26
- package/src/templator/utils.ts +5 -2
- package/src/test/integration/connect-file.ts +6 -6
- package/src/translator/index.ts +1 -1
- package/src/utils/index.ts +51 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.d.ts +0 -3
- package/out/concepts/basics/stdlib/nasl.browser copy.js +0 -70
- package/out/concepts/basics/stdlib/nasl.browser copy.js.map +0 -1
- package/out/terms/LEVEL_NAME_MAP.d.ts +0 -26
- package/out/terms/LEVEL_NAME_MAP.js +0 -30
- package/out/terms/LEVEL_NAME_MAP.js.map +0 -1
- package/out/test/integration/connect-file copy.js +0 -50
- package/out/test/integration/connect-file copy.js.map +0 -1
- package/out/test/integration/node-nasl-server.d.ts +0 -1
- package/out/test/integration/node-nasl-server.js +0 -41
- package/out/test/integration/node-nasl-server.js.map +0 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
declare type PropertyType = 'structures' | 'enums' | 'entities' | 'interfaces' | 'processes' | 'views';
|
|
2
2
|
import { Params } from '../common/EventEmitter';
|
|
3
3
|
import BaseNode from '../common/BaseNode';
|
|
4
|
-
import Entity from './Entity__';
|
|
5
4
|
import Structure from './Structure__';
|
|
6
5
|
import Enum from './Enum__';
|
|
7
6
|
import Logic from './Logic__';
|
|
@@ -48,10 +47,6 @@ export declare class Module extends BaseNode {
|
|
|
48
47
|
version: string;
|
|
49
48
|
}>;
|
|
50
49
|
};
|
|
51
|
-
/**
|
|
52
|
-
* 实体列表
|
|
53
|
-
*/
|
|
54
|
-
entities: Array<Entity>;
|
|
55
50
|
/**
|
|
56
51
|
* 数据结构列表
|
|
57
52
|
*/
|
|
@@ -94,94 +89,25 @@ export declare class Module extends BaseNode {
|
|
|
94
89
|
* @internal
|
|
95
90
|
*/
|
|
96
91
|
_delete(): Params;
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* 插入实体
|
|
101
|
-
* @internal
|
|
102
|
-
* @param name 实体名称,如果不填会自动生成一个唯一名称
|
|
103
|
-
*/
|
|
104
|
-
_insertEntityAt(name: string, index: number): Entity;
|
|
105
|
-
/**
|
|
106
|
-
* 插入实体
|
|
107
|
-
* @internal
|
|
108
|
-
* @param entityOptions 实体参数
|
|
109
|
-
*/
|
|
110
|
-
_insertEntityAt(entityOptions: Partial<Entity>, index: number): Entity;
|
|
111
|
-
/**
|
|
112
|
-
* 插入实体
|
|
113
|
-
* @internal
|
|
114
|
-
* @param entity 已有的实体实例
|
|
115
|
-
*/
|
|
116
|
-
_insertEntityAt(entity: Entity, index: number): Entity;
|
|
117
|
-
/**
|
|
118
|
-
* 插入实体
|
|
119
|
-
* @param name 实体名称,如果不填会自动生成一个唯一名称
|
|
120
|
-
*/
|
|
121
|
-
insertEntityAt(name: string, index: number): Entity;
|
|
122
|
-
/**
|
|
123
|
-
* 插入实体
|
|
124
|
-
* @param entityOptions 实体参数
|
|
125
|
-
*/
|
|
126
|
-
insertEntityAt(entityOptions: Partial<Entity>, index: number): Entity;
|
|
127
|
-
/**
|
|
128
|
-
* 插入实体
|
|
129
|
-
* @param entity 已有的实体实例
|
|
130
|
-
*/
|
|
131
|
-
insertEntityAt(entity: Entity, index: number): Entity;
|
|
132
|
-
/**
|
|
133
|
-
* 添加实体
|
|
134
|
-
* @internal
|
|
135
|
-
* @param name 实体名称,如果不填会自动生成一个唯一名称
|
|
136
|
-
*/
|
|
137
|
-
_addEntity(name?: string): Entity;
|
|
92
|
+
getStructureExistingNames(excludedList?: Array<Structure>): string[];
|
|
93
|
+
getStructureUniqueName(name?: string): string;
|
|
138
94
|
/**
|
|
139
|
-
*
|
|
95
|
+
* 插入数据结构
|
|
140
96
|
* @internal
|
|
141
|
-
* @param
|
|
97
|
+
* @param name 数据结构名称,如果不填会自动生成一个唯一名称
|
|
142
98
|
*/
|
|
143
|
-
|
|
99
|
+
_insertStructureAt(name: string, index: number): Structure;
|
|
144
100
|
/**
|
|
145
|
-
*
|
|
101
|
+
* 插入数据结构
|
|
146
102
|
* @internal
|
|
147
|
-
* @param
|
|
103
|
+
* @param structureOptions 数据结构参数
|
|
148
104
|
*/
|
|
149
|
-
|
|
105
|
+
_insertStructureAt(structureOptions: Partial<Structure>, index: number): Structure;
|
|
150
106
|
/**
|
|
151
|
-
*
|
|
107
|
+
* 插入数据结构
|
|
152
108
|
* @internal
|
|
153
|
-
* @param
|
|
154
|
-
*/
|
|
155
|
-
addEntity(name?: string): Entity;
|
|
156
|
-
/**
|
|
157
|
-
* 添加实体
|
|
158
|
-
* @param entityOptions 实体参数
|
|
159
|
-
*/
|
|
160
|
-
addEntity(entityOptions: Partial<Entity>): Entity;
|
|
161
|
-
/**
|
|
162
|
-
* 添加实体
|
|
163
|
-
* @param entity 已有的实体实例
|
|
109
|
+
* @param structure 已有的数据结构实例
|
|
164
110
|
*/
|
|
165
|
-
addEntity(entity: Entity): Entity;
|
|
166
|
-
getStructureExistingNames(excludedList?: Array<Structure>): string[];
|
|
167
|
-
getStructureUniqueName(name?: string): string;
|
|
168
|
-
/**
|
|
169
|
-
* 插入数据结构
|
|
170
|
-
* @internal
|
|
171
|
-
* @param name 数据结构名称,如果不填会自动生成一个唯一名称
|
|
172
|
-
*/
|
|
173
|
-
_insertStructureAt(name: string, index: number): Structure;
|
|
174
|
-
/**
|
|
175
|
-
* 插入数据结构
|
|
176
|
-
* @internal
|
|
177
|
-
* @param structureOptions 数据结构参数
|
|
178
|
-
*/
|
|
179
|
-
_insertStructureAt(structureOptions: Partial<Structure>, index: number): Structure;
|
|
180
|
-
/**
|
|
181
|
-
* 插入数据结构
|
|
182
|
-
* @internal
|
|
183
|
-
* @param structure 已有的数据结构实例
|
|
184
|
-
*/
|
|
185
111
|
_insertStructureAt(structure: Structure, index: number): Structure;
|
|
186
112
|
/**
|
|
187
113
|
* 插入数据结构
|
|
@@ -235,22 +161,22 @@ export declare class Module extends BaseNode {
|
|
|
235
161
|
getEnumExistingNames(excludedList?: Array<Enum>): string[];
|
|
236
162
|
getEnumUniqueName(name?: string): string;
|
|
237
163
|
/**
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
164
|
+
* 插入枚举
|
|
165
|
+
* @internal
|
|
166
|
+
* @param name 枚举名称,如果不填会自动生成一个唯一名称
|
|
167
|
+
*/
|
|
242
168
|
_insertEnumAt(name: string, index: number): Enum;
|
|
243
169
|
/**
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
170
|
+
* 插入枚举
|
|
171
|
+
* @internal
|
|
172
|
+
* @param enumerationOptions 枚举参数
|
|
173
|
+
*/
|
|
248
174
|
_insertEnumAt(enumerationOptions: Partial<Enum>, index: number): Enum;
|
|
249
175
|
/**
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
176
|
+
* 插入枚举
|
|
177
|
+
* @internal
|
|
178
|
+
* @param enumeration 已有的枚举实例
|
|
179
|
+
*/
|
|
254
180
|
_insertEnumAt(enumeration: Enum, index: number): Enum;
|
|
255
181
|
/**
|
|
256
182
|
* 插入枚举
|
|
@@ -304,22 +230,22 @@ export declare class Module extends BaseNode {
|
|
|
304
230
|
getLogicExistingNames(excludedList?: Array<Logic>): string[];
|
|
305
231
|
getLogicUniqueName(name?: string): string;
|
|
306
232
|
/**
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
233
|
+
* 插入逻辑
|
|
234
|
+
* @internal
|
|
235
|
+
* @param name 逻辑名称,如果不填会自动生成一个唯一名称
|
|
236
|
+
*/
|
|
311
237
|
_insertLogicAt(name: string, index: number): Logic;
|
|
312
238
|
/**
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
239
|
+
* 插入逻辑
|
|
240
|
+
* @internal
|
|
241
|
+
* @param logicOptions 逻辑参数
|
|
242
|
+
*/
|
|
317
243
|
_insertLogicAt(logicOptions: Partial<Logic>, index: number): Logic;
|
|
318
244
|
/**
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
245
|
+
* 插入逻辑
|
|
246
|
+
* @internal
|
|
247
|
+
* @param logic 已有的逻辑实例
|
|
248
|
+
*/
|
|
323
249
|
_insertLogicAt(logic: Logic, index: number): Logic;
|
|
324
250
|
/**
|
|
325
251
|
* 插入逻辑
|
|
@@ -373,22 +299,22 @@ export declare class Module extends BaseNode {
|
|
|
373
299
|
getInterfaceExistingNames(excludedList?: Array<Interface>): string[];
|
|
374
300
|
getInterfaceUniqueName(name?: string): string;
|
|
375
301
|
/**
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
302
|
+
* 插入接口
|
|
303
|
+
* @internal
|
|
304
|
+
* @param name 接口名称,如果不填会自动生成一个唯一名称
|
|
305
|
+
*/
|
|
380
306
|
_insertInterfaceAt(name: string, index: number): Interface;
|
|
381
307
|
/**
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
308
|
+
* 插入接口
|
|
309
|
+
* @internal
|
|
310
|
+
* @param itfaceOptions 接口参数
|
|
311
|
+
*/
|
|
386
312
|
_insertInterfaceAt(itfaceOptions: Partial<Interface>, index: number): Interface;
|
|
387
313
|
/**
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
314
|
+
* 插入接口
|
|
315
|
+
* @internal
|
|
316
|
+
* @param itface 已有的接口实例
|
|
317
|
+
*/
|
|
392
318
|
_insertInterfaceAt(itface: Interface, index: number): Interface;
|
|
393
319
|
/**
|
|
394
320
|
* 插入接口
|
|
@@ -442,22 +368,22 @@ export declare class Module extends BaseNode {
|
|
|
442
368
|
getViewExistingNames(excludedList?: Array<View>): string[];
|
|
443
369
|
getViewUniqueName(name?: string): string;
|
|
444
370
|
/**
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
371
|
+
* 插入页面
|
|
372
|
+
* @internal
|
|
373
|
+
* @param name 页面名称,如果不填会自动生成一个唯一名称
|
|
374
|
+
*/
|
|
449
375
|
_insertViewAt(name: string, index: number): View;
|
|
450
376
|
/**
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
377
|
+
* 插入页面
|
|
378
|
+
* @internal
|
|
379
|
+
* @param viewOptions 页面参数
|
|
380
|
+
*/
|
|
455
381
|
_insertViewAt(viewOptions: Partial<View>, index: number): View;
|
|
456
382
|
/**
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
383
|
+
* 插入页面
|
|
384
|
+
* @internal
|
|
385
|
+
* @param view 已有的页面实例
|
|
386
|
+
*/
|
|
461
387
|
_insertViewAt(view: View, index: number): View;
|
|
462
388
|
/**
|
|
463
389
|
* 插入页面
|
|
@@ -511,22 +437,22 @@ export declare class Module extends BaseNode {
|
|
|
511
437
|
getProcessExistingNames(excludedList?: Array<Process>): string[];
|
|
512
438
|
getProcessUniqueName(name?: string): string;
|
|
513
439
|
/**
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
440
|
+
* 插入流程
|
|
441
|
+
* @internal
|
|
442
|
+
* @param name 流程名称,如果不填会自动生成一个唯一名称
|
|
443
|
+
*/
|
|
518
444
|
_insertProcessAt(name: string, index: number): Process;
|
|
519
445
|
/**
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
446
|
+
* 插入流程
|
|
447
|
+
* @internal
|
|
448
|
+
* @param processOptions 流程参数
|
|
449
|
+
*/
|
|
524
450
|
_insertProcessAt(processOptions: Partial<Process>, index: number): Process;
|
|
525
451
|
/**
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
452
|
+
* 插入流程
|
|
453
|
+
* @internal
|
|
454
|
+
* @param process 已有的流程实例
|
|
455
|
+
*/
|
|
530
456
|
_insertProcessAt(process: Process, index: number): Process;
|
|
531
457
|
/**
|
|
532
458
|
* 插入流程
|
|
@@ -580,22 +506,22 @@ export declare class Module extends BaseNode {
|
|
|
580
506
|
getViewComponentExistingNames(excludedList?: Array<ViewComponent>): string[];
|
|
581
507
|
getViewComponentUniqueName(name?: string): string;
|
|
582
508
|
/**
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
509
|
+
* 插入页面组件
|
|
510
|
+
* @internal
|
|
511
|
+
* @param name 页面组件名称,如果不填会自动生成一个唯一名称
|
|
512
|
+
*/
|
|
587
513
|
_insertViewComponentAt(name: string, index: number): ViewComponent;
|
|
588
514
|
/**
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
515
|
+
* 插入页面组件
|
|
516
|
+
* @internal
|
|
517
|
+
* @param viewComponentOptions 页面组件参数
|
|
518
|
+
*/
|
|
593
519
|
_insertViewComponentAt(viewComponentOptions: Partial<ViewComponent>, index: number): ViewComponent;
|
|
594
520
|
/**
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
521
|
+
* 插入页面组件
|
|
522
|
+
* @internal
|
|
523
|
+
* @param viewComponent 已有的页面组件实例
|
|
524
|
+
*/
|
|
599
525
|
_insertViewComponentAt(viewComponent: ViewComponent, index: number): ViewComponent;
|
|
600
526
|
/**
|
|
601
527
|
* 插入页面组件
|
|
@@ -647,20 +573,9 @@ export declare class Module extends BaseNode {
|
|
|
647
573
|
*/
|
|
648
574
|
addViewComponent(viewComponent: ViewComponent): ViewComponent;
|
|
649
575
|
/**
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
*/
|
|
653
|
-
removeEntity(name: string): void;
|
|
654
|
-
/**
|
|
655
|
-
* 删除实体
|
|
656
|
-
* @param entity 已有的实体实例
|
|
576
|
+
* 删除数据结构
|
|
577
|
+
* @param name 数据结构名称
|
|
657
578
|
*/
|
|
658
|
-
removeEntity(entity: Entity): void;
|
|
659
|
-
__removeEntity(entity: Entity): Params;
|
|
660
|
-
/**
|
|
661
|
-
* 删除数据结构
|
|
662
|
-
* @param name 数据结构名称
|
|
663
|
-
*/
|
|
664
579
|
removeStructure(name: string): void;
|
|
665
580
|
/**
|
|
666
581
|
* 删除数据结构
|
|
@@ -669,9 +584,9 @@ export declare class Module extends BaseNode {
|
|
|
669
584
|
removeStructure(structure: Structure): void;
|
|
670
585
|
__removeStructure(structure: Structure): Params;
|
|
671
586
|
/**
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
587
|
+
* 删除枚举
|
|
588
|
+
* @param name 枚举名称
|
|
589
|
+
*/
|
|
675
590
|
removeEnum(name: string): void;
|
|
676
591
|
/**
|
|
677
592
|
* 删除枚举
|
|
@@ -680,9 +595,9 @@ export declare class Module extends BaseNode {
|
|
|
680
595
|
removeEnum(enumeration: Enum): void;
|
|
681
596
|
__removeEnum(enumeration: Enum): Params;
|
|
682
597
|
/**
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
598
|
+
* 删除逻辑
|
|
599
|
+
* @param name 逻辑名称
|
|
600
|
+
*/
|
|
686
601
|
removeLogic(name: string): void;
|
|
687
602
|
/**
|
|
688
603
|
* 删除逻辑
|
|
@@ -691,9 +606,9 @@ export declare class Module extends BaseNode {
|
|
|
691
606
|
removeLogic(logic: Logic): void;
|
|
692
607
|
__removeLogic(logic: Logic): Params;
|
|
693
608
|
/**
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
609
|
+
* 删除接口
|
|
610
|
+
* @param name 接口名称
|
|
611
|
+
*/
|
|
697
612
|
removeInterface(name: string): void;
|
|
698
613
|
/**
|
|
699
614
|
* 删除接口
|
|
@@ -702,9 +617,9 @@ export declare class Module extends BaseNode {
|
|
|
702
617
|
removeInterface(itface: Interface): void;
|
|
703
618
|
__removeInterface(itface: Interface): Params;
|
|
704
619
|
/**
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
620
|
+
* 删除页面
|
|
621
|
+
* @param name 页面名称
|
|
622
|
+
*/
|
|
708
623
|
removeView(name: string): void;
|
|
709
624
|
/**
|
|
710
625
|
* 删除页面
|
|
@@ -713,9 +628,9 @@ export declare class Module extends BaseNode {
|
|
|
713
628
|
removeView(view: View): void;
|
|
714
629
|
__removeView(view: View): Params;
|
|
715
630
|
/**
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
631
|
+
* 删除流程
|
|
632
|
+
* @param name 流程名称
|
|
633
|
+
*/
|
|
719
634
|
removeProcess(name: string): void;
|
|
720
635
|
/**
|
|
721
636
|
* 删除流程
|
|
@@ -724,9 +639,9 @@ export declare class Module extends BaseNode {
|
|
|
724
639
|
removeProcess(process: Process): void;
|
|
725
640
|
__removeProcess(process: Process): Params;
|
|
726
641
|
/**
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
642
|
+
* 删除页面组件
|
|
643
|
+
* @param name 页面组件名称
|
|
644
|
+
*/
|
|
730
645
|
removeViewComponent(name: string): void;
|
|
731
646
|
/**
|
|
732
647
|
* 删除页面组件
|
|
@@ -735,19 +650,26 @@ export declare class Module extends BaseNode {
|
|
|
735
650
|
removeViewComponent(viewComponent: ViewComponent): void;
|
|
736
651
|
__removeViewComponent(viewComponent: ViewComponent): Params;
|
|
737
652
|
/**
|
|
738
|
-
*
|
|
739
|
-
* @param name 一般不用传,用于 rename
|
|
653
|
+
* 用于区分存量应用新导入模块,存量应用替换数据结构使用
|
|
740
654
|
*/
|
|
655
|
+
isAdd: boolean;
|
|
656
|
+
setIsAdd(isAdd: boolean): void;
|
|
657
|
+
/**
|
|
658
|
+
* 生成宿主语言的文件路径
|
|
659
|
+
* @param name 一般不用传,用于 rename
|
|
660
|
+
*/
|
|
741
661
|
getEmbeddedFilePath(name?: string): string;
|
|
742
662
|
/**
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
663
|
+
* 获取命名空间和
|
|
664
|
+
* 暂时不考虑 Module 嵌套的情况
|
|
665
|
+
*/
|
|
746
666
|
getNamespace(): string;
|
|
747
667
|
getTsNamespace(): string;
|
|
668
|
+
getTsNamespaceAndName(): string;
|
|
669
|
+
findEnumByName(name: string): Enum;
|
|
748
670
|
/**
|
|
749
|
-
|
|
750
|
-
|
|
671
|
+
* 获取属性节点是否存在
|
|
672
|
+
*/
|
|
751
673
|
findProperty(name: string, propertyType: PropertyType): any;
|
|
752
674
|
}
|
|
753
675
|
export default Module;
|
package/out/concepts/Module__.js
CHANGED
|
@@ -43,7 +43,6 @@ const decorators_1 = require("../decorators");
|
|
|
43
43
|
const utils = __importStar(require("../utils"));
|
|
44
44
|
const BaseNode_1 = __importDefault(require("../common/BaseNode"));
|
|
45
45
|
const classMap_1 = __importDefault(require("../common/classMap"));
|
|
46
|
-
const Entity__1 = __importDefault(require("./Entity__"));
|
|
47
46
|
const Structure__1 = __importDefault(require("./Structure__"));
|
|
48
47
|
const Enum__1 = __importDefault(require("./Enum__"));
|
|
49
48
|
const Logic__1 = __importDefault(require("./Logic__"));
|
|
@@ -83,10 +82,6 @@ let Module = Module_1 = class Module extends BaseNode_1.default {
|
|
|
83
82
|
* 外部语言依赖
|
|
84
83
|
*/
|
|
85
84
|
externalDependencyMap = undefined;
|
|
86
|
-
/**
|
|
87
|
-
* 实体列表
|
|
88
|
-
*/
|
|
89
|
-
entities = [];
|
|
90
85
|
/**
|
|
91
86
|
* 数据结构列表
|
|
92
87
|
*/
|
|
@@ -143,66 +138,6 @@ let Module = Module_1 = class Module extends BaseNode_1.default {
|
|
|
143
138
|
}
|
|
144
139
|
return params;
|
|
145
140
|
}
|
|
146
|
-
getEntityExistingNames(excludedList = []) {
|
|
147
|
-
const excludedSet = new Set(excludedList);
|
|
148
|
-
return (this.entities || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
149
|
-
}
|
|
150
|
-
getEntityUniqueName(name = 'Entity1') {
|
|
151
|
-
return utils.unique(name, this.getEntityExistingNames(), undefined, false);
|
|
152
|
-
}
|
|
153
|
-
_insertEntityAt(options, index) {
|
|
154
|
-
const entityOptions = {};
|
|
155
|
-
const relationOptions = { parentNode: this, parentKey: 'entities' };
|
|
156
|
-
let entity;
|
|
157
|
-
if (!options) {
|
|
158
|
-
entity = Entity__1.default.from({
|
|
159
|
-
...entityOptions,
|
|
160
|
-
name: this.getEntityUniqueName(),
|
|
161
|
-
}, this, 'entities');
|
|
162
|
-
}
|
|
163
|
-
else if (typeof options === 'string') {
|
|
164
|
-
entity = Entity__1.default.from({
|
|
165
|
-
...entityOptions,
|
|
166
|
-
name: options,
|
|
167
|
-
}, this, 'entities');
|
|
168
|
-
}
|
|
169
|
-
else if (options instanceof Entity__1.default) {
|
|
170
|
-
options.ensureDelete(); // 同一实例不支持多处存在
|
|
171
|
-
entity = options;
|
|
172
|
-
Object.assign(entity, relationOptions);
|
|
173
|
-
}
|
|
174
|
-
else {
|
|
175
|
-
entity = Entity__1.default.from({
|
|
176
|
-
...entityOptions,
|
|
177
|
-
...options,
|
|
178
|
-
}, this, 'entities');
|
|
179
|
-
}
|
|
180
|
-
this.entities.splice(index, 0, entity);
|
|
181
|
-
return entity;
|
|
182
|
-
}
|
|
183
|
-
insertEntityAt(options, index) {
|
|
184
|
-
const node = this._insertEntityAt(options, index);
|
|
185
|
-
node.create({
|
|
186
|
-
index,
|
|
187
|
-
parentNode: this,
|
|
188
|
-
parentKey: 'entities',
|
|
189
|
-
});
|
|
190
|
-
return node;
|
|
191
|
-
}
|
|
192
|
-
_addEntity(options) {
|
|
193
|
-
const index = 0;
|
|
194
|
-
return this._insertEntityAt(options, index);
|
|
195
|
-
}
|
|
196
|
-
addEntity(options) {
|
|
197
|
-
const node = this._addEntity(options);
|
|
198
|
-
const index = this.entities.indexOf(node);
|
|
199
|
-
node.create({
|
|
200
|
-
index,
|
|
201
|
-
parentNode: this,
|
|
202
|
-
parentKey: 'entities',
|
|
203
|
-
});
|
|
204
|
-
return node;
|
|
205
|
-
}
|
|
206
141
|
getStructureExistingNames(excludedList = []) {
|
|
207
142
|
const excludedSet = new Set(excludedList);
|
|
208
143
|
return (this.structures || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -623,42 +558,6 @@ let Module = Module_1 = class Module extends BaseNode_1.default {
|
|
|
623
558
|
});
|
|
624
559
|
return node;
|
|
625
560
|
}
|
|
626
|
-
removeEntity(options) {
|
|
627
|
-
let entity;
|
|
628
|
-
if (typeof options === 'string') {
|
|
629
|
-
entity = this.entities.find((item) => item.name === options);
|
|
630
|
-
if (!entity) {
|
|
631
|
-
throw new Error('找不到实体 ' + options);
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
else {
|
|
635
|
-
entity = options;
|
|
636
|
-
}
|
|
637
|
-
return entity.delete();
|
|
638
|
-
}
|
|
639
|
-
__removeEntity(entity) {
|
|
640
|
-
const parentKey = entity.parentKey;
|
|
641
|
-
const params = {
|
|
642
|
-
parentNode: this,
|
|
643
|
-
parentKey,
|
|
644
|
-
index: -1,
|
|
645
|
-
object: null,
|
|
646
|
-
oldObject: entity,
|
|
647
|
-
};
|
|
648
|
-
if (parentKey) {
|
|
649
|
-
params.parentKey = parentKey;
|
|
650
|
-
if (Array.isArray(this[parentKey])) {
|
|
651
|
-
const index = this[parentKey].indexOf(entity);
|
|
652
|
-
~index && this[parentKey].splice(index, 1);
|
|
653
|
-
params.index = index;
|
|
654
|
-
}
|
|
655
|
-
else if (this[parentKey] === entity) {
|
|
656
|
-
params.index = 0;
|
|
657
|
-
this[parentKey] = undefined;
|
|
658
|
-
}
|
|
659
|
-
}
|
|
660
|
-
return params;
|
|
661
|
-
}
|
|
662
561
|
removeStructure(options) {
|
|
663
562
|
let structure;
|
|
664
563
|
if (typeof options === 'string') {
|
|
@@ -916,25 +815,43 @@ let Module = Module_1 = class Module extends BaseNode_1.default {
|
|
|
916
815
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
917
816
|
//================================================================================
|
|
918
817
|
/**
|
|
919
|
-
*
|
|
920
|
-
* @param name 一般不用传,用于 rename
|
|
818
|
+
* 用于区分存量应用新导入模块,存量应用替换数据结构使用
|
|
921
819
|
*/
|
|
820
|
+
isAdd;
|
|
821
|
+
setIsAdd(isAdd) {
|
|
822
|
+
const object = {
|
|
823
|
+
isAdd,
|
|
824
|
+
};
|
|
825
|
+
this.update({
|
|
826
|
+
...object,
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* 生成宿主语言的文件路径
|
|
831
|
+
* @param name 一般不用传,用于 rename
|
|
832
|
+
*/
|
|
922
833
|
getEmbeddedFilePath(name = this.name) {
|
|
923
834
|
return `/embedded/${this.app.name}/${this.parentKey}/${this.name}`;
|
|
924
835
|
}
|
|
925
836
|
/**
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
837
|
+
* 获取命名空间和
|
|
838
|
+
* 暂时不考虑 Module 嵌套的情况
|
|
839
|
+
*/
|
|
929
840
|
getNamespace() {
|
|
930
|
-
return `${moduleNameSpace[this.parentKey]}
|
|
841
|
+
return `${moduleNameSpace[this.parentKey]}`;
|
|
931
842
|
}
|
|
932
843
|
getTsNamespace() {
|
|
933
|
-
return `${moduleNameSpace[this.parentKey]}
|
|
844
|
+
return `${moduleNameSpace[this.parentKey]}`;
|
|
845
|
+
}
|
|
846
|
+
getTsNamespaceAndName() {
|
|
847
|
+
return `${moduleNameSpace[this.parentKey]}.${this.name}`;
|
|
848
|
+
}
|
|
849
|
+
findEnumByName(name) {
|
|
850
|
+
return this.enums.find((enumItem) => enumItem.name === name);
|
|
934
851
|
}
|
|
935
852
|
/**
|
|
936
|
-
|
|
937
|
-
|
|
853
|
+
* 获取属性节点是否存在
|
|
854
|
+
*/
|
|
938
855
|
findProperty(name, propertyType) {
|
|
939
856
|
return this[propertyType].find((item) => item.name === name);
|
|
940
857
|
}
|
|
@@ -960,9 +877,6 @@ __decorate([
|
|
|
960
877
|
__decorate([
|
|
961
878
|
(0, decorators_1.property)()
|
|
962
879
|
], Module.prototype, "externalDependencyMap", void 0);
|
|
963
|
-
__decorate([
|
|
964
|
-
(0, decorators_1.property)('Entity')
|
|
965
|
-
], Module.prototype, "entities", void 0);
|
|
966
880
|
__decorate([
|
|
967
881
|
(0, decorators_1.property)('Structure')
|
|
968
882
|
], Module.prototype, "structures", void 0);
|
|
@@ -984,11 +898,14 @@ __decorate([
|
|
|
984
898
|
__decorate([
|
|
985
899
|
(0, decorators_1.property)('ViewComponent')
|
|
986
900
|
], Module.prototype, "viewComponents", void 0);
|
|
901
|
+
__decorate([
|
|
902
|
+
(0, decorators_1.property)()
|
|
903
|
+
], Module.prototype, "isAdd", void 0);
|
|
987
904
|
Module = Module_1 = __decorate([
|
|
988
905
|
(0, decorators_1.concept)('模块')
|
|
989
906
|
], Module);
|
|
990
907
|
exports.Module = Module;
|
|
991
|
-
classMap_1.default
|
|
908
|
+
classMap_1.default.Module = Module;
|
|
992
909
|
exports.default = Module;
|
|
993
910
|
//================================================================================
|
|
994
911
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|