@lcap/nasl 1.0.0-alpha.2 → 1.0.0-alpha.5
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/README.md +3 -3
- package/docs/assets/search.js +1 -1
- package/docs/classes/Entity.html +2832 -204
- package/docs/classes/View.html +4567 -365
- package/out/common/BaseNode.d.ts +1 -1
- package/out/common/BaseNode.js +38 -23
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +77 -15
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +2 -1
- package/out/concepts/Argument__.js +2 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +2 -1
- package/out/concepts/Assignment__.js +3 -8
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +2 -1
- package/out/concepts/BinaryExpression__.js +5 -5
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +2 -1
- package/out/concepts/BindAttribute__.js +9 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +2 -1
- package/out/concepts/BindDirective__.js +2 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +2 -1
- package/out/concepts/BindEvent__.js +4 -3
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +2 -1
- package/out/concepts/BooleanLiteral__.js +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +57 -1
- package/out/concepts/CallFunction__.js +119 -11
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -1
- package/out/concepts/CallInterface__.js +2 -2
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +57 -1
- package/out/concepts/CallLogic__.js +117 -10
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +1 -1
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +120 -0
- package/out/concepts/ConfigGroup__.js +214 -0
- package/out/concepts/ConfigGroup__.js.map +1 -0
- package/out/concepts/ConfigPropertyValue__.d.ts +43 -0
- package/out/concepts/ConfigPropertyValue__.js +103 -0
- package/out/concepts/ConfigPropertyValue__.js.map +1 -0
- package/out/concepts/ConfigProperty__.d.ts +128 -0
- package/out/concepts/ConfigProperty__.js +236 -0
- package/out/concepts/ConfigProperty__.js.map +1 -0
- package/out/concepts/Configuration__.d.ts +120 -0
- package/out/concepts/Configuration__.js +210 -0
- package/out/concepts/Configuration__.js.map +1 -0
- package/out/concepts/Constant__.d.ts +2 -1
- package/out/concepts/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +2 -1
- package/out/concepts/Destination__.js +4 -3
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +8 -0
- package/out/concepts/EntityIndex__.js +18 -0
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +5 -5
- package/out/concepts/EntityProperty__.js +10 -9
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +30 -26
- package/out/concepts/Entity__.js +44 -36
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +8 -8
- package/out/concepts/Enum__.js +10 -4
- 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__.d.ts +35 -33
- package/out/concepts/ForEachStatement__.js +103 -36
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -1
- package/out/concepts/Identifier__.js +15 -1
- package/out/concepts/Identifier__.js.map +1 -1
- 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__.d.ts +5 -1
- package/out/concepts/Interface__.js +19 -5
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -1
- package/out/concepts/LogicItem__.js +2 -2
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +9 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +2 -5
- package/out/concepts/MemberExpression__.js +12 -18
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +121 -126
- package/out/concepts/Module__.js +10 -17
- 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/NullLiteral__.d.ts +2 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +2 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -1
- package/out/concepts/Param__.js +2 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +2 -2
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +82 -81
- package/out/concepts/ProcessElement__.js +19 -6
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.d.ts +1 -0
- package/out/concepts/Process__.js +10 -4
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +2 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +5 -0
- package/out/concepts/Role__.js +19 -2
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +2 -0
- package/out/concepts/SqlQueryComponent__.js +16 -0
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +2 -1
- package/out/concepts/StringLiteral__.js +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +1 -1
- package/out/concepts/StructureProperty__.js +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -1
- package/out/concepts/Structure__.js +4 -4
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +3 -0
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +2 -1
- package/out/concepts/UnaryExpression__.js +3 -3
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +2 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +2 -1
- package/out/concepts/ValidationRule__.js +2 -2
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +6 -5
- package/out/concepts/Variable__.js +3 -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 +5 -4
- package/out/concepts/ViewElement__.js +109 -65
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +97 -90
- package/out/concepts/View__.js +153 -118
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +2 -2
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +3 -137
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +21 -5
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.validation.js +527 -0
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
- package/out/concepts/index__.d.ts +4 -0
- package/out/concepts/index__.js +4 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/data/Module.d.ts +34 -0
- package/out/data/Module.js +53 -0
- package/out/data/Module.js.map +1 -0
- package/out/generator/compileComponent.d.ts +1 -1
- package/out/generator/genBundleFiles.d.ts +0 -1
- package/out/generator/genBundleFiles.js +1 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +35 -0
- package/out/generator/genMetaData.js +78 -0
- package/out/generator/genMetaData.js.map +1 -0
- package/out/generator/index.d.ts +1 -0
- package/out/generator/index.js +1 -0
- package/out/generator/index.js.map +1 -1
- package/out/index.d.ts +2 -2
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/server/createUiTs.d.ts +7 -0
- package/out/server/createUiTs.js +157 -0
- package/out/server/createUiTs.js.map +1 -0
- package/out/server/entity2LogicNamespace.d.ts +9 -1
- package/out/server/entity2LogicNamespace.js +11 -1
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/getExtensionModules.d.ts +3 -0
- package/out/server/getExtensionModules.js +18 -0
- package/out/server/getExtensionModules.js.map +1 -0
- package/out/server/getLogics.js +18 -15
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +3 -2
- package/out/server/getMemberIdentifier.js +47 -15
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +4 -1
- package/out/server/getProcesses.js +16 -7
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getValidates.js +1 -1
- package/out/server/getValidates.js.map +1 -1
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +23 -5
- package/out/server/naslServer.js +199 -25
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.d.ts +15 -1
- package/out/server/process2LogicNamespace.js +30 -3
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.js +28 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +5 -0
- package/out/service/storage/init.js +60 -52
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCallComponentLogic.js +2 -2
- package/out/templator/genCallComponentLogic.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -8
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +3 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -4
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -3
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +2 -2
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +1 -1
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +8 -12
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +20 -20
- package/out/templator/utils.js +22 -22
- package/out/templator/utils.js.map +1 -1
- package/package.json +3 -1
- package/src/automate/engine/index.js +37 -3
- package/src/automate/engine/utils.js +68 -64
- package/src/common/BaseNode.ts +43 -28
- package/src/concepts/App__.ts +93 -17
- package/src/concepts/Argument__.ts +4 -2
- package/src/concepts/Assignment__.ts +5 -7
- package/src/concepts/Attribute__.ts +1 -0
- package/src/concepts/BinaryExpression__.ts +7 -5
- package/src/concepts/BindAttribute__.ts +9 -4
- package/src/concepts/BindDirective__.ts +4 -2
- package/src/concepts/BindEvent__.ts +6 -4
- package/src/concepts/BooleanLiteral__.ts +3 -1
- package/src/concepts/CallFunction__.ts +195 -11
- package/src/concepts/CallInterface__.ts +4 -2
- package/src/concepts/CallLogic__.ts +211 -12
- package/src/concepts/CallQueryComponent__.ts +2 -1
- package/src/concepts/Comment__.ts +1 -0
- package/src/concepts/CompletionProperty__.ts +1 -0
- package/src/concepts/ConfigGroup__.ts +290 -0
- package/src/concepts/ConfigPropertyValue__.ts +112 -0
- package/src/concepts/ConfigProperty__.ts +306 -0
- package/src/concepts/Configuration__.ts +286 -0
- package/src/concepts/Constant__.ts +3 -1
- package/src/concepts/DataElement__.ts +1 -0
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/EntityIndex__.ts +19 -0
- package/src/concepts/EntityProperty__.ts +9 -8
- package/src/concepts/Entity__.ts +66 -59
- package/src/concepts/EnumItem__.ts +1 -0
- package/src/concepts/Enum__.ts +32 -12
- package/src/concepts/Event__.ts +2 -1
- package/src/concepts/ForEachStatement__.ts +115 -69
- package/src/concepts/Function__.ts +2 -1
- package/src/concepts/Identifier__.ts +18 -1
- package/src/concepts/IfStatement__.ts +1 -0
- package/src/concepts/InterfaceParam__.ts +2 -1
- package/src/concepts/Interface__.ts +21 -5
- package/src/concepts/JSBlock__.ts +1 -0
- package/src/concepts/LogicItem__.ts +9 -40
- package/src/concepts/Logic__.ts +48 -9
- package/src/concepts/MemberExpression__.ts +14 -17
- package/src/concepts/Module__.ts +158 -139
- package/src/concepts/Namespace__.ts +13 -12
- package/src/concepts/NullLiteral__.ts +3 -1
- package/src/concepts/NumericLiteral__.ts +3 -1
- package/src/concepts/Param__.ts +3 -2
- package/src/concepts/Point__.ts +1 -0
- package/src/concepts/ProcessComponent__.ts +3 -2
- package/src/concepts/ProcessElement__.ts +102 -107
- package/src/concepts/ProcessOutcome__.ts +1 -0
- package/src/concepts/Process__.ts +12 -4
- package/src/concepts/QueryAggregateExpression__.ts +1 -0
- package/src/concepts/QueryFieldExpression__.ts +2 -1
- package/src/concepts/QueryFromExpression__.ts +1 -0
- package/src/concepts/QueryGroupByExpression__.ts +1 -0
- package/src/concepts/QueryJoinExpression__.ts +2 -1
- package/src/concepts/QueryLimitExpression__.ts +1 -0
- package/src/concepts/QueryOrderByExpression__.ts +1 -0
- package/src/concepts/QuerySelectExpression__.ts +2 -1
- package/src/concepts/Rect__.ts +1 -0
- package/src/concepts/Return__.ts +3 -2
- package/src/concepts/Role__.ts +19 -2
- package/src/concepts/Slot__.ts +1 -0
- package/src/concepts/SqlQueryComponent__.ts +11 -1
- package/src/concepts/Start__.ts +1 -0
- package/src/concepts/StringLiteral__.ts +3 -1
- package/src/concepts/StructureProperty__.ts +2 -1
- package/src/concepts/Structure__.ts +5 -4
- package/src/concepts/SwitchCase__.ts +1 -0
- package/src/concepts/SwitchStatement__.ts +1 -0
- package/src/concepts/Theme__.ts +1 -0
- package/src/concepts/Transactional__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +4 -0
- package/src/concepts/TypeParam__.ts +1 -0
- package/src/concepts/UnaryExpression__.ts +6 -3
- package/src/concepts/Unparsed__.ts +3 -1
- package/src/concepts/UseComponent__.ts +1 -0
- package/src/concepts/ValidationRule__.ts +5 -2
- package/src/concepts/Variable__.ts +12 -6
- package/src/concepts/ViewComponent__.ts +6 -5
- package/src/concepts/ViewElement__.ts +109 -80
- package/src/concepts/View__.ts +245 -206
- package/src/concepts/WhileStatement__.ts +1 -0
- package/src/concepts/basics/stdlib/index.ts +2 -2
- package/src/concepts/basics/stdlib/nasl.ui.ts +3 -137
- package/src/concepts/basics/stdlib/nasl.util.ts +21 -5
- package/src/concepts/basics/stdlib/{nasl.validate.ts → nasl.validation.ts} +28 -28
- package/src/concepts/index__.ts +4 -0
- package/src/generator/compileComponent.ts +1 -1
- package/src/generator/genBundleFiles.ts +1 -2
- package/src/generator/genMetaData.ts +111 -0
- package/src/generator/index.ts +1 -0
- package/src/index.ts +2 -2
- package/src/server/createUiTs.ts +153 -0
- package/src/server/entity2LogicNamespace.ts +17 -1
- package/src/server/getExtensionModules.ts +13 -0
- package/src/server/getLogics.ts +19 -18
- package/src/server/getMemberIdentifier.ts +60 -19
- package/src/server/getProcesses.ts +15 -8
- package/src/server/getValidates.ts +1 -1
- package/src/server/index.ts +2 -1
- package/src/server/naslServer.ts +204 -24
- package/src/server/process2LogicNamespace.ts +44 -3
- package/src/server/translator.ts +121 -97
- package/src/service/config/api.js +32 -0
- package/src/service/config/index.js +6 -0
- package/src/service/creator/index.js +2 -2
- package/src/service/logic/checktypeSocket.js +49 -0
- package/src/service/modules/api.js +20 -0
- package/src/service/modules/index.js +6 -0
- package/src/service/storage/init.ts +62 -54
- package/src/templator/genCallComponentLogic.ts +2 -2
- package/src/templator/genCreateBlock.ts +19 -25
- package/src/templator/genCurdEditMultipleKeyBlock.ts +3 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -4
- package/src/templator/genEditTableBlock.ts +3 -3
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genListViewBlock.ts +2 -2
- package/src/templator/genSelectBlock.ts +1 -1
- package/src/templator/genUpdateBlock.ts +19 -25
- package/src/templator/utils.ts +25 -153
|
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
6
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
7
|
|
|
8
8
|
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import BaseNode from '../common/BaseNode';
|
|
10
11
|
import classMap from '../common/classMap';
|
|
11
12
|
import QueryAggregateExpression from './QueryAggregateExpression__';
|
|
@@ -70,7 +71,7 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
70
71
|
|
|
71
72
|
getQueryAggregateExpressionExistingNames(excludedList: Array<QueryAggregateExpression> = []) {
|
|
72
73
|
const excludedSet = new Set(excludedList);
|
|
73
|
-
return this.selectElements.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
74
|
+
return (this.selectElements || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
74
75
|
}
|
|
75
76
|
getQueryAggregateExpressionUniqueName(name = 'queryAggregateExpression1') {
|
|
76
77
|
return utils.unique(name, this.getQueryAggregateExpressionExistingNames());
|
package/src/concepts/Rect__.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
6
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
7
|
|
|
8
8
|
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import BaseNode from '../common/BaseNode';
|
|
10
11
|
import classMap from '../common/classMap';
|
|
11
12
|
|
package/src/concepts/Return__.ts
CHANGED
|
@@ -14,6 +14,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
14
14
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
15
15
|
|
|
16
16
|
import * as utils from '../utils';
|
|
17
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
17
18
|
import BaseNode from '../common/BaseNode';
|
|
18
19
|
import classMap from '../common/classMap';
|
|
19
20
|
import TypeAnnotation from './TypeAnnotation__';
|
|
@@ -271,7 +272,7 @@ export class Return extends BaseNode {
|
|
|
271
272
|
const object = {
|
|
272
273
|
typeAnnotation,
|
|
273
274
|
// 处理下拉属性
|
|
274
|
-
completionChildren: this.getSelectRef(),
|
|
275
|
+
// completionChildren: this.getSelectRef(),
|
|
275
276
|
};
|
|
276
277
|
|
|
277
278
|
return this.update({
|
|
@@ -293,7 +294,7 @@ export class Return extends BaseNode {
|
|
|
293
294
|
/**
|
|
294
295
|
* 是否可编辑
|
|
295
296
|
* */
|
|
296
|
-
get
|
|
297
|
+
get readonly() {
|
|
297
298
|
return !!this.module;
|
|
298
299
|
}
|
|
299
300
|
|
package/src/concepts/Role__.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
8
8
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
9
9
|
|
|
10
10
|
import * as utils from '../utils';
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
12
|
import BaseNode from '../common/BaseNode';
|
|
12
13
|
import classMap from '../common/classMap';
|
|
13
14
|
import App from './App__';
|
|
@@ -29,6 +30,12 @@ export class Role extends BaseNode {
|
|
|
29
30
|
@property()
|
|
30
31
|
name: string = undefined;
|
|
31
32
|
|
|
33
|
+
/**
|
|
34
|
+
* 唯一标识
|
|
35
|
+
*/
|
|
36
|
+
@property()
|
|
37
|
+
uuid: string = uuidv4().replace(/-/g, '');
|
|
38
|
+
|
|
32
39
|
/**
|
|
33
40
|
* 角色描述
|
|
34
41
|
*/
|
|
@@ -89,13 +96,23 @@ export class Role extends BaseNode {
|
|
|
89
96
|
//================================================================================
|
|
90
97
|
@withSourceMap()
|
|
91
98
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
92
|
-
let code = `export enum ${this.
|
|
93
|
-
code += ` ${this.
|
|
99
|
+
let code = `export enum ${this.tsName} {\n`;
|
|
100
|
+
code += ` ${this.tsName}='${this.tsName}'\n`;
|
|
94
101
|
code += indent(state.tabSize) + '}\n';
|
|
95
102
|
|
|
96
103
|
return code;
|
|
97
104
|
}
|
|
98
105
|
|
|
106
|
+
get tsName() {
|
|
107
|
+
let tsName = this.name;
|
|
108
|
+
if (/^\d/.test(tsName)) {
|
|
109
|
+
tsName = '$' + tsName;
|
|
110
|
+
}
|
|
111
|
+
// 匹配所有特殊字符都转为_
|
|
112
|
+
tsName = tsName.replace(/[^\u4e00-\u9fa5a-zA-Z0-9]/g, '_');
|
|
113
|
+
return tsName;
|
|
114
|
+
}
|
|
115
|
+
|
|
99
116
|
getNamespace() {
|
|
100
117
|
if (this.parentNode && (this.parentNode as Namespace).getNamespace)
|
|
101
118
|
return `${(this.parentNode as Namespace).getNamespace()}.roles`;
|
package/src/concepts/Slot__.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
6
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
7
|
|
|
8
8
|
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import BaseNode from '../common/BaseNode';
|
|
10
11
|
import classMap from '../common/classMap';
|
|
11
12
|
import ViewComponent from './ViewComponent__';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
1
2
|
//================================================================================
|
|
2
3
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
4
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -6,6 +7,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
7
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
8
|
|
|
8
9
|
import * as utils from '../utils';
|
|
10
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
11
|
import BaseNode from '../common/BaseNode';
|
|
10
12
|
import classMap from '../common/classMap';
|
|
11
13
|
import TypeAnnotation from './TypeAnnotation__';
|
|
@@ -124,7 +126,15 @@ export class SqlQueryComponent extends LogicItem {
|
|
|
124
126
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
125
127
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
126
128
|
//================================================================================
|
|
127
|
-
|
|
129
|
+
@withSourceMap()
|
|
130
|
+
toEmbeddedTS(state?: TranslatorState): string {
|
|
131
|
+
let code = `(function(): nasl.collection.PageOf<`
|
|
132
|
+
code +=`${this.typeAnnotation ? this.typeAnnotation.toEmbeddedTS(shiftState(state, code)): 'unknown'}> {\n`;
|
|
133
|
+
code += '\n';
|
|
134
|
+
code += indent(state.tabSize + 1) + 'return;\n';
|
|
135
|
+
code += indent(state.tabSize) + '})();\n';
|
|
136
|
+
return code;
|
|
137
|
+
}
|
|
128
138
|
//================================================================================
|
|
129
139
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
130
140
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
package/src/concepts/Start__.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
7
7
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
8
8
|
|
|
9
9
|
import * as utils from '../utils';
|
|
10
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
11
|
import BaseNode from '../common/BaseNode';
|
|
11
12
|
import classMap from '../common/classMap';
|
|
12
13
|
import LogicItem from './LogicItem__';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
2
3
|
//================================================================================
|
|
3
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -7,6 +8,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
7
8
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
8
9
|
|
|
9
10
|
import * as utils from '../utils';
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
12
|
import BaseNode from '../common/BaseNode';
|
|
11
13
|
import classMap from '../common/classMap';
|
|
12
14
|
import LogicItem from './LogicItem__';
|
|
@@ -54,7 +56,7 @@ export class StringLiteral extends LogicItem {
|
|
|
54
56
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
55
57
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
56
58
|
//================================================================================
|
|
57
|
-
toVue(): string {
|
|
59
|
+
toVue(options?: ElementToVueOptions): string {
|
|
58
60
|
let code = '';
|
|
59
61
|
if (this.value) {
|
|
60
62
|
if (!this.value.includes("'"))
|
|
@@ -11,6 +11,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
11
11
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
12
12
|
|
|
13
13
|
import * as utils from '../utils';
|
|
14
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
14
15
|
import BaseNode from '../common/BaseNode';
|
|
15
16
|
import classMap from '../common/classMap';
|
|
16
17
|
import TypeAnnotation from './TypeAnnotation__';
|
|
@@ -288,7 +289,7 @@ export class StructureProperty extends BaseNode {
|
|
|
288
289
|
/**
|
|
289
290
|
* 是否可编辑
|
|
290
291
|
* */
|
|
291
|
-
get
|
|
292
|
+
get readonly() {
|
|
292
293
|
return !!this.module;
|
|
293
294
|
}
|
|
294
295
|
|
|
@@ -8,6 +8,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
8
8
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
9
9
|
|
|
10
10
|
import * as utils from '../utils';
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
12
|
import BaseNode from '../common/BaseNode';
|
|
12
13
|
import classMap from '../common/classMap';
|
|
13
14
|
import TypeParam from './TypeParam__';
|
|
@@ -114,7 +115,7 @@ export class Structure extends BaseNode {
|
|
|
114
115
|
|
|
115
116
|
getTypeParamExistingNames(excludedList: Array<TypeParam> = []) {
|
|
116
117
|
const excludedSet = new Set(excludedList);
|
|
117
|
-
return this.typeParams.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
118
|
+
return (this.typeParams || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
118
119
|
}
|
|
119
120
|
getTypeParamUniqueName(name = 'typeParam1') {
|
|
120
121
|
return utils.unique(name, this.getTypeParamExistingNames());
|
|
@@ -256,7 +257,7 @@ export class Structure extends BaseNode {
|
|
|
256
257
|
|
|
257
258
|
getPropertyExistingNames(excludedList: Array<StructureProperty> = []) {
|
|
258
259
|
const excludedSet = new Set(excludedList);
|
|
259
|
-
return this.properties.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
260
|
+
return (this.properties || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
260
261
|
}
|
|
261
262
|
getPropertyUniqueName(name = 'property1') {
|
|
262
263
|
return utils.unique(name, this.getPropertyExistingNames());
|
|
@@ -504,7 +505,7 @@ export class Structure extends BaseNode {
|
|
|
504
505
|
/**
|
|
505
506
|
* 是否可编辑
|
|
506
507
|
* */
|
|
507
|
-
get
|
|
508
|
+
get readonly() {
|
|
508
509
|
return !!this.module;
|
|
509
510
|
}
|
|
510
511
|
|
|
@@ -525,7 +526,7 @@ export class Structure extends BaseNode {
|
|
|
525
526
|
|
|
526
527
|
getNamespace() {
|
|
527
528
|
if (this.parentNode && (this.parentNode as Namespace).getNamespace) {
|
|
528
|
-
return
|
|
529
|
+
return `${(this.parentNode as Namespace).getNamespace()}.structures`;
|
|
529
530
|
} else
|
|
530
531
|
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
531
532
|
}
|
|
@@ -7,6 +7,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
7
7
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
8
8
|
|
|
9
9
|
import * as utils from '../utils';
|
|
10
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
11
|
import BaseNode from '../common/BaseNode';
|
|
11
12
|
import classMap from '../common/classMap';
|
|
12
13
|
import LogicItem from './LogicItem__';
|
|
@@ -8,6 +8,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
8
8
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
9
9
|
|
|
10
10
|
import * as utils from '../utils';
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
12
|
import BaseNode from '../common/BaseNode';
|
|
12
13
|
import classMap from '../common/classMap';
|
|
13
14
|
import SwitchCase from './SwitchCase__';
|
package/src/concepts/Theme__.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
6
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
7
|
|
|
8
8
|
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import BaseNode from '../common/BaseNode';
|
|
10
11
|
import classMap from '../common/classMap';
|
|
11
12
|
|
|
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
6
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
7
|
|
|
8
8
|
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import BaseNode from '../common/BaseNode';
|
|
10
11
|
import classMap from '../common/classMap';
|
|
11
12
|
import Logic from './Logic__';
|
|
@@ -22,6 +22,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
22
22
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
23
23
|
|
|
24
24
|
import * as utils from '../utils';
|
|
25
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
25
26
|
import BaseNode from '../common/BaseNode';
|
|
26
27
|
import classMap from '../common/classMap';
|
|
27
28
|
|
|
@@ -311,6 +312,9 @@ export class TypeAnnotation extends BaseNode {
|
|
|
311
312
|
@withSourceMap()
|
|
312
313
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
313
314
|
if (this.typeKind === 'primitive' || this.typeKind === 'reference') {
|
|
315
|
+
if (this.typeKind === 'reference' && this.typeNamespace.endsWith('enums')) {
|
|
316
|
+
return `ReturnType<typeof ${this.typeNamespace}.${this.typeName}.toList>`;
|
|
317
|
+
}
|
|
314
318
|
return `${this.typeNamespace}.${this.typeName}`;
|
|
315
319
|
} else if (this.typeKind === 'generic') {
|
|
316
320
|
let code = `${this.typeNamespace}.${this.typeName}<`;
|
|
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
6
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
7
|
|
|
8
8
|
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import BaseNode from '../common/BaseNode';
|
|
10
11
|
import classMap from '../common/classMap';
|
|
11
12
|
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
3
|
+
|
|
2
4
|
//================================================================================
|
|
3
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
6
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -7,6 +9,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
7
9
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
8
10
|
|
|
9
11
|
import * as utils from '../utils';
|
|
12
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
13
|
import BaseNode from '../common/BaseNode';
|
|
11
14
|
import classMap from '../common/classMap';
|
|
12
15
|
import LogicItem from './LogicItem__';
|
|
@@ -122,11 +125,11 @@ export class UnaryExpression extends LogicItem {
|
|
|
122
125
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
123
126
|
//================================================================================
|
|
124
127
|
|
|
125
|
-
toVue(
|
|
128
|
+
toVue(options?: ElementToVueOptions) {
|
|
126
129
|
if (this.operator === 'isNull') {
|
|
127
|
-
return this.argument.toVue(
|
|
130
|
+
return this.argument.toVue(options);
|
|
128
131
|
} else {
|
|
129
|
-
return '!' + this.argument.toVue(
|
|
132
|
+
return '!' + this.argument.toVue(options);
|
|
130
133
|
}
|
|
131
134
|
}
|
|
132
135
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
2
3
|
//================================================================================
|
|
3
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -7,6 +8,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
7
8
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
8
9
|
|
|
9
10
|
import * as utils from '../utils';
|
|
11
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
12
|
import BaseNode from '../common/BaseNode';
|
|
11
13
|
import classMap from '../common/classMap';
|
|
12
14
|
import LogicItem from './LogicItem__';
|
|
@@ -65,7 +67,7 @@ export class Unparsed extends LogicItem {
|
|
|
65
67
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
66
68
|
//================================================================================
|
|
67
69
|
|
|
68
|
-
toVue(): string {
|
|
70
|
+
toVue(options?: ElementToVueOptions): string {
|
|
69
71
|
return this.code ? ` ${this.code} ` : '';
|
|
70
72
|
}
|
|
71
73
|
|
|
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
6
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
7
|
|
|
8
8
|
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import BaseNode from '../common/BaseNode';
|
|
10
11
|
import classMap from '../common/classMap';
|
|
11
12
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
2
|
import Function from './Function__';
|
|
3
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
4
|
+
|
|
3
5
|
//================================================================================
|
|
4
6
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
7
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -8,6 +10,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
8
10
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
9
11
|
|
|
10
12
|
import * as utils from '../utils';
|
|
13
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
14
|
import BaseNode from '../common/BaseNode';
|
|
12
15
|
import classMap from '../common/classMap';
|
|
13
16
|
import Argument from './Argument__';
|
|
@@ -213,12 +216,12 @@ export class ValidationRule extends LogicItem {
|
|
|
213
216
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
214
217
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
215
218
|
//================================================================================
|
|
216
|
-
toVue(
|
|
219
|
+
toVue(options?: ElementToVueOptions) {
|
|
217
220
|
let code = this.calleeName;
|
|
218
221
|
if (this.arguments.length) {
|
|
219
222
|
code += '(';
|
|
220
223
|
this.arguments.forEach((arg, index) => {
|
|
221
|
-
code += arg.toVue(
|
|
224
|
+
code += arg.toVue(options);
|
|
222
225
|
if (index !== this.arguments.length - 1)
|
|
223
226
|
code += ', ';
|
|
224
227
|
});
|
|
@@ -2,6 +2,7 @@ import { dataTypesMap } from './basics/types';
|
|
|
2
2
|
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
3
3
|
import Entity from './Entity__';
|
|
4
4
|
import Structure from './Structure__';
|
|
5
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
5
6
|
//================================================================================
|
|
6
7
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
7
8
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -10,6 +11,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
10
11
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
11
12
|
|
|
12
13
|
import * as utils from '../utils';
|
|
14
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
13
15
|
import BaseNode from '../common/BaseNode';
|
|
14
16
|
import classMap from '../common/classMap';
|
|
15
17
|
import TypeAnnotation from './TypeAnnotation__';
|
|
@@ -153,10 +155,14 @@ export class Variable extends BaseNode {
|
|
|
153
155
|
});
|
|
154
156
|
}
|
|
155
157
|
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
156
162
|
/**
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
163
|
+
* 删除类型标注
|
|
164
|
+
* @param name 类型标注名称
|
|
165
|
+
*/
|
|
160
166
|
removeTypeAnnotation(name: string): void;
|
|
161
167
|
|
|
162
168
|
/**
|
|
@@ -205,7 +211,7 @@ export class Variable extends BaseNode {
|
|
|
205
211
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
206
212
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
207
213
|
//================================================================================
|
|
208
|
-
toVue(): string {
|
|
214
|
+
toVue(options?: ElementToVueOptions): string {
|
|
209
215
|
return this.name;
|
|
210
216
|
}
|
|
211
217
|
|
|
@@ -274,7 +280,7 @@ export class Variable extends BaseNode {
|
|
|
274
280
|
/**
|
|
275
281
|
* 是否可编辑
|
|
276
282
|
* */
|
|
277
|
-
get
|
|
283
|
+
get readonly() {
|
|
278
284
|
return !!this.module;
|
|
279
285
|
}
|
|
280
286
|
|
|
@@ -304,7 +310,7 @@ export class Variable extends BaseNode {
|
|
|
304
310
|
//================================================================================
|
|
305
311
|
}
|
|
306
312
|
|
|
307
|
-
classMap
|
|
313
|
+
classMap['Variable'] = Variable;
|
|
308
314
|
export default Variable;
|
|
309
315
|
//================================================================================
|
|
310
316
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -6,6 +6,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
6
6
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
7
|
|
|
8
8
|
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
9
10
|
import BaseNode from '../common/BaseNode';
|
|
10
11
|
import classMap from '../common/classMap';
|
|
11
12
|
import Attribute from './Attribute__';
|
|
@@ -121,7 +122,7 @@ export class ViewComponent extends BaseNode {
|
|
|
121
122
|
|
|
122
123
|
getAttributeExistingNames(excludedList: Array<Attribute> = []) {
|
|
123
124
|
const excludedSet = new Set(excludedList);
|
|
124
|
-
return this.attrs.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
125
|
+
return (this.attrs || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
125
126
|
}
|
|
126
127
|
getAttributeUniqueName(name = 'attribute1') {
|
|
127
128
|
return utils.unique(name, this.getAttributeExistingNames());
|
|
@@ -263,7 +264,7 @@ export class ViewComponent extends BaseNode {
|
|
|
263
264
|
|
|
264
265
|
getEventExistingNames(excludedList: Array<Event> = []) {
|
|
265
266
|
const excludedSet = new Set(excludedList);
|
|
266
|
-
return this.events.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
267
|
+
return (this.events || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
267
268
|
}
|
|
268
269
|
getEventUniqueName(name = 'event1') {
|
|
269
270
|
return utils.unique(name, this.getEventExistingNames());
|
|
@@ -405,7 +406,7 @@ export class ViewComponent extends BaseNode {
|
|
|
405
406
|
|
|
406
407
|
getSlotExistingNames(excludedList: Array<Slot> = []) {
|
|
407
408
|
const excludedSet = new Set(excludedList);
|
|
408
|
-
return this.slots.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
409
|
+
return (this.slots || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
409
410
|
}
|
|
410
411
|
getSlotUniqueName(name = 'slot1') {
|
|
411
412
|
return utils.unique(name, this.getSlotExistingNames());
|
|
@@ -547,7 +548,7 @@ export class ViewComponent extends BaseNode {
|
|
|
547
548
|
|
|
548
549
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
549
550
|
const excludedSet = new Set(excludedList);
|
|
550
|
-
return this.methods.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
551
|
+
return (this.methods || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
551
552
|
}
|
|
552
553
|
getLogicUniqueName(name = 'logic1') {
|
|
553
554
|
return utils.unique(name, this.getLogicExistingNames());
|
|
@@ -689,7 +690,7 @@ export class ViewComponent extends BaseNode {
|
|
|
689
690
|
|
|
690
691
|
getViewComponentExistingNames(excludedList: Array<ViewComponent> = []) {
|
|
691
692
|
const excludedSet = new Set(excludedList);
|
|
692
|
-
return this.children.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
693
|
+
return (this.children || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
693
694
|
}
|
|
694
695
|
getViewComponentUniqueName(name = 'viewComponent1') {
|
|
695
696
|
return utils.unique(name, this.getViewComponentExistingNames());
|