@lcap/nasl 1.0.0-alpha.2 → 1.0.0-alpha.3
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.js +23 -16
- 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 +2 -1
- package/src/automate/engine/index.js +37 -3
- package/src/automate/engine/utils.js +68 -64
- package/src/common/BaseNode.ts +24 -17
- 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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap, indent } from '../translator';
|
|
2
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
2
3
|
|
|
3
4
|
//================================================================================
|
|
4
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -8,6 +9,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
8
9
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
9
10
|
|
|
10
11
|
import * as utils from '../utils';
|
|
12
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
13
|
import BaseNode from '../common/BaseNode';
|
|
12
14
|
import classMap from '../common/classMap';
|
|
13
15
|
import LogicItem from './LogicItem__';
|
|
@@ -49,7 +51,7 @@ export class NullLiteral extends LogicItem {
|
|
|
49
51
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
50
52
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
51
53
|
//================================================================================
|
|
52
|
-
toVue(): string {
|
|
54
|
+
toVue(options?: ElementToVueOptions): string {
|
|
53
55
|
return 'null';
|
|
54
56
|
}
|
|
55
57
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap } from '../translator';
|
|
2
|
+
import { ElementToVueOptions } from './ViewElement__';
|
|
2
3
|
|
|
3
4
|
//================================================================================
|
|
4
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -8,6 +9,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
8
9
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
9
10
|
|
|
10
11
|
import * as utils from '../utils';
|
|
12
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
11
13
|
import BaseNode from '../common/BaseNode';
|
|
12
14
|
import classMap from '../common/classMap';
|
|
13
15
|
import TypeAnnotation from './TypeAnnotation__';
|
|
@@ -111,7 +113,7 @@ export class NumericLiteral extends LogicItem {
|
|
|
111
113
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
112
114
|
//================================================================================
|
|
113
115
|
|
|
114
|
-
toVue(): string {
|
|
116
|
+
toVue(options?: ElementToVueOptions): string {
|
|
115
117
|
const code = this.value ? String(this.value) : '';
|
|
116
118
|
return code;
|
|
117
119
|
}
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
15
15
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
16
16
|
|
|
17
17
|
import * as utils from '../utils';
|
|
18
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
18
19
|
import BaseNode from '../common/BaseNode';
|
|
19
20
|
import classMap from '../common/classMap';
|
|
20
21
|
import TypeAnnotation from './TypeAnnotation__';
|
|
@@ -296,7 +297,7 @@ export class Param extends BaseNode {
|
|
|
296
297
|
const object = {
|
|
297
298
|
typeAnnotation,
|
|
298
299
|
// 处理下拉属性
|
|
299
|
-
completionChildren: this.getSelectRef(),
|
|
300
|
+
// completionChildren: this.getSelectRef(),
|
|
300
301
|
};
|
|
301
302
|
return this.update({
|
|
302
303
|
...object,
|
|
@@ -317,7 +318,7 @@ export class Param extends BaseNode {
|
|
|
317
318
|
/**
|
|
318
319
|
* 是否可编辑
|
|
319
320
|
* */
|
|
320
|
-
get
|
|
321
|
+
get readonly() {
|
|
321
322
|
return !!this.module;
|
|
322
323
|
}
|
|
323
324
|
|
package/src/concepts/Point__.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 Attribute from './Attribute__';
|
|
@@ -101,7 +102,7 @@ export class ProcessComponent extends BaseNode {
|
|
|
101
102
|
|
|
102
103
|
getAttributeExistingNames(excludedList: Array<Attribute> = []) {
|
|
103
104
|
const excludedSet = new Set(excludedList);
|
|
104
|
-
return this.attrs.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
105
|
+
return (this.attrs || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
105
106
|
}
|
|
106
107
|
getAttributeUniqueName(name = 'attribute1') {
|
|
107
108
|
return utils.unique(name, this.getAttributeExistingNames());
|
|
@@ -243,7 +244,7 @@ export class ProcessComponent extends BaseNode {
|
|
|
243
244
|
|
|
244
245
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
245
246
|
const excludedSet = new Set(excludedList);
|
|
246
|
-
return this.logics.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
247
|
+
return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
247
248
|
}
|
|
248
249
|
getLogicUniqueName(name = 'logic1') {
|
|
249
250
|
return utils.unique(name, this.getLogicExistingNames());
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, embeddedTSEmitter } from '../translator';
|
|
2
|
+
import { constantToParam, returnToParam } from '../server/getProcesses';
|
|
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 Rect from './Rect__';
|
|
@@ -246,33 +248,33 @@ export class ProcessElement extends BaseNode {
|
|
|
246
248
|
});
|
|
247
249
|
}
|
|
248
250
|
|
|
249
|
-
|
|
251
|
+
getPointExistingNames(excludedList: Array<Point> = []) {
|
|
250
252
|
const excludedSet = new Set(excludedList);
|
|
251
|
-
return this.waypoints.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
253
|
+
return (this.waypoints || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
252
254
|
}
|
|
253
255
|
getPointUniqueName(name = 'point1') {
|
|
254
256
|
return utils.unique(name, this.getPointExistingNames());
|
|
255
257
|
}
|
|
256
258
|
|
|
257
259
|
/**
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
* 插入点信息
|
|
261
|
+
* @internal
|
|
262
|
+
* @param name 点信息名称,如果不填会自动生成一个唯一名称
|
|
263
|
+
*/
|
|
262
264
|
_insertPointAt(name: string, index: number): Point;
|
|
263
265
|
|
|
264
266
|
/**
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
* 插入点信息
|
|
268
|
+
* @internal
|
|
269
|
+
* @param pointOptions 点信息参数
|
|
270
|
+
*/
|
|
269
271
|
_insertPointAt(pointOptions: Partial<Point>, index: number): Point;
|
|
270
272
|
|
|
271
273
|
/**
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
274
|
+
* 插入点信息
|
|
275
|
+
* @internal
|
|
276
|
+
* @param point 已有的点信息实例
|
|
277
|
+
*/
|
|
276
278
|
_insertPointAt(point: Point, index: number): Point;
|
|
277
279
|
|
|
278
280
|
_insertPointAt(options: string | Partial<Point> | Point, index: number) {
|
|
@@ -387,34 +389,33 @@ export class ProcessElement extends BaseNode {
|
|
|
387
389
|
return node;
|
|
388
390
|
}
|
|
389
391
|
|
|
390
|
-
|
|
391
392
|
getVariableExistingNames(excludedList: Array<Variable> = []) {
|
|
392
393
|
const excludedSet = new Set(excludedList);
|
|
393
|
-
return this.variables.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
394
|
+
return (this.variables || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
394
395
|
}
|
|
395
396
|
getVariableUniqueName(name = 'variable1') {
|
|
396
397
|
return utils.unique(name, this.getVariableExistingNames());
|
|
397
398
|
}
|
|
398
399
|
|
|
399
400
|
/**
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
401
|
+
* 插入局部变量
|
|
402
|
+
* @internal
|
|
403
|
+
* @param name 局部变量名称,如果不填会自动生成一个唯一名称
|
|
404
|
+
*/
|
|
404
405
|
_insertVariableAt(name: string, index: number): Variable;
|
|
405
406
|
|
|
406
407
|
/**
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
408
|
+
* 插入局部变量
|
|
409
|
+
* @internal
|
|
410
|
+
* @param variableOptions 局部变量参数
|
|
411
|
+
*/
|
|
411
412
|
_insertVariableAt(variableOptions: Partial<Variable>, index: number): Variable;
|
|
412
413
|
|
|
413
414
|
/**
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
415
|
+
* 插入局部变量
|
|
416
|
+
* @internal
|
|
417
|
+
* @param variable 已有的局部变量实例
|
|
418
|
+
*/
|
|
418
419
|
_insertVariableAt(variable: Variable, index: number): Variable;
|
|
419
420
|
|
|
420
421
|
_insertVariableAt(options: string | Partial<Variable> | Variable, index: number) {
|
|
@@ -529,34 +530,33 @@ export class ProcessElement extends BaseNode {
|
|
|
529
530
|
return node;
|
|
530
531
|
}
|
|
531
532
|
|
|
532
|
-
|
|
533
533
|
getReturnExistingNames(excludedList: Array<Return> = []) {
|
|
534
534
|
const excludedSet = new Set(excludedList);
|
|
535
|
-
return this.returns.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
535
|
+
return (this.returns || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
536
536
|
}
|
|
537
537
|
getReturnUniqueName(name = 'ret1') {
|
|
538
538
|
return utils.unique(name, this.getReturnExistingNames());
|
|
539
539
|
}
|
|
540
540
|
|
|
541
541
|
/**
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
542
|
+
* 插入输出参数
|
|
543
|
+
* @internal
|
|
544
|
+
* @param name 输出参数名称,如果不填会自动生成一个唯一名称
|
|
545
|
+
*/
|
|
546
546
|
_insertReturnAt(name: string, index: number): Return;
|
|
547
547
|
|
|
548
548
|
/**
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
549
|
+
* 插入输出参数
|
|
550
|
+
* @internal
|
|
551
|
+
* @param retOptions 输出参数参数
|
|
552
|
+
*/
|
|
553
553
|
_insertReturnAt(retOptions: Partial<Return>, index: number): Return;
|
|
554
554
|
|
|
555
555
|
/**
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
556
|
+
* 插入输出参数
|
|
557
|
+
* @internal
|
|
558
|
+
* @param ret 已有的输出参数实例
|
|
559
|
+
*/
|
|
560
560
|
_insertReturnAt(ret: Return, index: number): Return;
|
|
561
561
|
|
|
562
562
|
_insertReturnAt(options: string | Partial<Return> | Return, index: number) {
|
|
@@ -671,34 +671,33 @@ export class ProcessElement extends BaseNode {
|
|
|
671
671
|
return node;
|
|
672
672
|
}
|
|
673
673
|
|
|
674
|
-
|
|
675
674
|
getConstantExistingNames(excludedList: Array<Constant> = []) {
|
|
676
675
|
const excludedSet = new Set(excludedList);
|
|
677
|
-
return this.constants.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
676
|
+
return (this.constants || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
678
677
|
}
|
|
679
678
|
getConstantUniqueName(name = 'constant1') {
|
|
680
679
|
return utils.unique(name, this.getConstantExistingNames());
|
|
681
680
|
}
|
|
682
681
|
|
|
683
682
|
/**
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
683
|
+
* 插入常量
|
|
684
|
+
* @internal
|
|
685
|
+
* @param name 常量名称,如果不填会自动生成一个唯一名称
|
|
686
|
+
*/
|
|
688
687
|
_insertConstantAt(name: string, index: number): Constant;
|
|
689
688
|
|
|
690
689
|
/**
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
690
|
+
* 插入常量
|
|
691
|
+
* @internal
|
|
692
|
+
* @param constantOptions 常量参数
|
|
693
|
+
*/
|
|
695
694
|
_insertConstantAt(constantOptions: Partial<Constant>, index: number): Constant;
|
|
696
695
|
|
|
697
696
|
/**
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
697
|
+
* 插入常量
|
|
698
|
+
* @internal
|
|
699
|
+
* @param constant 已有的常量实例
|
|
700
|
+
*/
|
|
702
701
|
_insertConstantAt(constant: Constant, index: number): Constant;
|
|
703
702
|
|
|
704
703
|
_insertConstantAt(options: string | Partial<Constant> | Constant, index: number) {
|
|
@@ -813,34 +812,33 @@ export class ProcessElement extends BaseNode {
|
|
|
813
812
|
return node;
|
|
814
813
|
}
|
|
815
814
|
|
|
816
|
-
|
|
817
815
|
getBindAttributeExistingNames(excludedList: Array<BindAttribute> = []) {
|
|
818
816
|
const excludedSet = new Set(excludedList);
|
|
819
|
-
return this.bindAttrs.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
817
|
+
return (this.bindAttrs || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
820
818
|
}
|
|
821
819
|
getBindAttributeUniqueName(name = 'bindAttribute1') {
|
|
822
820
|
return utils.unique(name, this.getBindAttributeExistingNames());
|
|
823
821
|
}
|
|
824
822
|
|
|
825
823
|
/**
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
824
|
+
* 插入元素绑定属性
|
|
825
|
+
* @internal
|
|
826
|
+
* @param name 元素绑定属性名称,如果不填会自动生成一个唯一名称
|
|
827
|
+
*/
|
|
830
828
|
_insertBindAttributeAt(name: string, index: number): BindAttribute;
|
|
831
829
|
|
|
832
830
|
/**
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
831
|
+
* 插入元素绑定属性
|
|
832
|
+
* @internal
|
|
833
|
+
* @param bindAttributeOptions 元素绑定属性参数
|
|
834
|
+
*/
|
|
837
835
|
_insertBindAttributeAt(bindAttributeOptions: Partial<BindAttribute>, index: number): BindAttribute;
|
|
838
836
|
|
|
839
837
|
/**
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
838
|
+
* 插入元素绑定属性
|
|
839
|
+
* @internal
|
|
840
|
+
* @param bindAttribute 已有的元素绑定属性实例
|
|
841
|
+
*/
|
|
844
842
|
_insertBindAttributeAt(bindAttribute: BindAttribute, index: number): BindAttribute;
|
|
845
843
|
|
|
846
844
|
_insertBindAttributeAt(options: string | Partial<BindAttribute> | BindAttribute, index: number) {
|
|
@@ -955,13 +953,10 @@ export class ProcessElement extends BaseNode {
|
|
|
955
953
|
return node;
|
|
956
954
|
}
|
|
957
955
|
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
956
|
/**
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
957
|
+
* 删除矩形信息
|
|
958
|
+
* @param name 矩形信息名称
|
|
959
|
+
*/
|
|
965
960
|
removeBounds(name: string): void;
|
|
966
961
|
|
|
967
962
|
/**
|
|
@@ -1006,12 +1001,10 @@ export class ProcessElement extends BaseNode {
|
|
|
1006
1001
|
return params;
|
|
1007
1002
|
}
|
|
1008
1003
|
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
1004
|
/**
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1005
|
+
* 删除点信息
|
|
1006
|
+
* @param name 点信息名称
|
|
1007
|
+
*/
|
|
1015
1008
|
removePoint(name: string): void;
|
|
1016
1009
|
|
|
1017
1010
|
/**
|
|
@@ -1056,12 +1049,10 @@ export class ProcessElement extends BaseNode {
|
|
|
1056
1049
|
return params;
|
|
1057
1050
|
}
|
|
1058
1051
|
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
1052
|
/**
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1053
|
+
* 删除逻辑
|
|
1054
|
+
* @param name 逻辑名称
|
|
1055
|
+
*/
|
|
1065
1056
|
removeLogic(name: string): void;
|
|
1066
1057
|
|
|
1067
1058
|
/**
|
|
@@ -1106,12 +1097,10 @@ export class ProcessElement extends BaseNode {
|
|
|
1106
1097
|
return params;
|
|
1107
1098
|
}
|
|
1108
1099
|
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
1100
|
/**
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1101
|
+
* 删除局部变量
|
|
1102
|
+
* @param name 局部变量名称
|
|
1103
|
+
*/
|
|
1115
1104
|
removeVariable(name: string): void;
|
|
1116
1105
|
|
|
1117
1106
|
/**
|
|
@@ -1156,12 +1145,10 @@ export class ProcessElement extends BaseNode {
|
|
|
1156
1145
|
return params;
|
|
1157
1146
|
}
|
|
1158
1147
|
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
1148
|
/**
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1149
|
+
* 删除输出参数
|
|
1150
|
+
* @param name 输出参数名称
|
|
1151
|
+
*/
|
|
1165
1152
|
removeReturn(name: string): void;
|
|
1166
1153
|
|
|
1167
1154
|
/**
|
|
@@ -1206,12 +1193,10 @@ export class ProcessElement extends BaseNode {
|
|
|
1206
1193
|
return params;
|
|
1207
1194
|
}
|
|
1208
1195
|
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
1196
|
/**
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1197
|
+
* 删除常量
|
|
1198
|
+
* @param name 常量名称
|
|
1199
|
+
*/
|
|
1215
1200
|
removeConstant(name: string): void;
|
|
1216
1201
|
|
|
1217
1202
|
/**
|
|
@@ -1256,12 +1241,10 @@ export class ProcessElement extends BaseNode {
|
|
|
1256
1241
|
return params;
|
|
1257
1242
|
}
|
|
1258
1243
|
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
1244
|
/**
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1245
|
+
* 删除元素绑定属性
|
|
1246
|
+
* @param name 元素绑定属性名称
|
|
1247
|
+
*/
|
|
1265
1248
|
removeBindAttribute(name: string): void;
|
|
1266
1249
|
|
|
1267
1250
|
/**
|
|
@@ -1317,6 +1300,7 @@ export class ProcessElement extends BaseNode {
|
|
|
1317
1300
|
|
|
1318
1301
|
@withSourceMap()
|
|
1319
1302
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
1303
|
+
this.syncLogic();
|
|
1320
1304
|
const tab0 = indent(state.tabSize);
|
|
1321
1305
|
let code = '';
|
|
1322
1306
|
this.variables.forEach((property) => {
|
|
@@ -1338,6 +1322,17 @@ export class ProcessElement extends BaseNode {
|
|
|
1338
1322
|
return code;
|
|
1339
1323
|
}
|
|
1340
1324
|
|
|
1325
|
+
syncLogic() {
|
|
1326
|
+
if (this.type === 'UserTask') {
|
|
1327
|
+
if (!this.logic) {
|
|
1328
|
+
this.logic = new Logic({
|
|
1329
|
+
name: `complete`,
|
|
1330
|
+
});
|
|
1331
|
+
}
|
|
1332
|
+
this.logic.params = [...this.constants.map(constantToParam), ...this.returns.map(returnToParam)];
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1341
1336
|
/**
|
|
1342
1337
|
* 设置流程元素名称
|
|
1343
1338
|
*/
|
|
@@ -1362,7 +1357,7 @@ export class ProcessElement extends BaseNode {
|
|
|
1362
1357
|
//================================================================================
|
|
1363
1358
|
}
|
|
1364
1359
|
|
|
1365
|
-
classMap
|
|
1360
|
+
classMap.ProcessElement = ProcessElement;
|
|
1366
1361
|
export default ProcessElement;
|
|
1367
1362
|
//================================================================================
|
|
1368
1363
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
@@ -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 LogicItem from './LogicItem__';
|
|
@@ -12,6 +12,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
12
12
|
import { concept, excludedInJSON, property } from '../decorators';
|
|
13
13
|
|
|
14
14
|
import * as utils from '../utils';
|
|
15
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
15
16
|
import BaseNode from '../common/BaseNode';
|
|
16
17
|
import classMap from '../common/classMap';
|
|
17
18
|
import Param from './Param__';
|
|
@@ -150,7 +151,7 @@ export class Process extends BaseNode {
|
|
|
150
151
|
|
|
151
152
|
getParamExistingNames(excludedList: Array<Param> = []) {
|
|
152
153
|
const excludedSet = new Set(excludedList);
|
|
153
|
-
return this.params.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
154
|
+
return (this.params || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
154
155
|
}
|
|
155
156
|
getParamUniqueName(name = 'param1') {
|
|
156
157
|
return utils.unique(name, this.getParamExistingNames());
|
|
@@ -292,7 +293,7 @@ export class Process extends BaseNode {
|
|
|
292
293
|
|
|
293
294
|
getReturnExistingNames(excludedList: Array<Return> = []) {
|
|
294
295
|
const excludedSet = new Set(excludedList);
|
|
295
|
-
return this.returns.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
296
|
+
return (this.returns || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
296
297
|
}
|
|
297
298
|
getReturnUniqueName(name = 'ret1') {
|
|
298
299
|
return utils.unique(name, this.getReturnExistingNames());
|
|
@@ -434,7 +435,7 @@ export class Process extends BaseNode {
|
|
|
434
435
|
|
|
435
436
|
getConstantExistingNames(excludedList: Array<Constant> = []) {
|
|
436
437
|
const excludedSet = new Set(excludedList);
|
|
437
|
-
return this.constants.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
438
|
+
return (this.constants || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
438
439
|
}
|
|
439
440
|
getConstantUniqueName(name = 'constant1') {
|
|
440
441
|
return utils.unique(name, this.getConstantExistingNames());
|
|
@@ -576,7 +577,7 @@ export class Process extends BaseNode {
|
|
|
576
577
|
|
|
577
578
|
getElementExistingNames(excludedList: Array<ProcessElement> = []) {
|
|
578
579
|
const excludedSet = new Set(excludedList);
|
|
579
|
-
return this.elements.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
580
|
+
return (this.elements || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
580
581
|
}
|
|
581
582
|
getElementUniqueName(name = 'element1') {
|
|
582
583
|
return utils.unique(name, this.getElementExistingNames());
|
|
@@ -972,6 +973,13 @@ export class Process extends BaseNode {
|
|
|
972
973
|
return l;
|
|
973
974
|
}
|
|
974
975
|
|
|
976
|
+
get logics() {
|
|
977
|
+
return [genLaunchProcess(this)];
|
|
978
|
+
// const ns = entity2LogicNamespace(this);
|
|
979
|
+
// ns.path = this.getNamespace() + '.' + ns.name;
|
|
980
|
+
// return ns;
|
|
981
|
+
}
|
|
982
|
+
|
|
975
983
|
@withSourceMap()
|
|
976
984
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
977
985
|
let code = `export namespace ${this.name} {\n`;
|
|
@@ -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 QueryFieldExpression from './QueryFieldExpression__';
|
|
@@ -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__';
|
|
@@ -110,7 +111,7 @@ export class QueryFieldExpression extends LogicItem {
|
|
|
110
111
|
@withSourceMap()
|
|
111
112
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
112
113
|
const { entityAsName, propertyName } = this;
|
|
113
|
-
return entityAsName && propertyName ? `new app
|
|
114
|
+
return entityAsName && propertyName ? `new app.entities.${entityAsName}().${propertyName}` : '__QueryFieldExpression__';
|
|
114
115
|
}
|
|
115
116
|
|
|
116
117
|
//================================================================================
|
|
@@ -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 QueryJoinExpression from './QueryJoinExpression__';
|
|
@@ -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 LogicItem from './LogicItem__';
|
|
@@ -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 BinaryExpression from './BinaryExpression__';
|
|
@@ -89,7 +90,7 @@ export class QueryJoinExpression extends LogicItem {
|
|
|
89
90
|
|
|
90
91
|
getBinaryExpressionExistingNames(excludedList: Array<BinaryExpression> = []) {
|
|
91
92
|
const excludedSet = new Set(excludedList);
|
|
92
|
-
return this.onExpressions.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
93
|
+
return (this.onExpressions || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
93
94
|
}
|
|
94
95
|
getBinaryExpressionUniqueName(name = 'binaryExpression1') {
|
|
95
96
|
return utils.unique(name, this.getBinaryExpressionExistingNames());
|
|
@@ -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__';
|
|
@@ -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__';
|