@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
|
@@ -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 TypeAnnotation from './TypeAnnotation__';
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
//================================================================================
|
|
2
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
4
|
+
//================================================================================
|
|
5
|
+
import { EventPayload, Params } from '../common/EventEmitter';
|
|
6
|
+
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
|
+
|
|
8
|
+
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import BaseNode from '../common/BaseNode';
|
|
11
|
+
import classMap from '../common/classMap';
|
|
12
|
+
import ConfigProperty from './ConfigProperty__';
|
|
13
|
+
import App from './App__';
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* 配置组
|
|
17
|
+
*/
|
|
18
|
+
@concept
|
|
19
|
+
export class ConfigGroup extends BaseNode {
|
|
20
|
+
/**
|
|
21
|
+
* 产品概念
|
|
22
|
+
*/
|
|
23
|
+
@property()
|
|
24
|
+
concept: 'ConfigGroup' = 'ConfigGroup';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* 配置组名称
|
|
28
|
+
*/
|
|
29
|
+
@property()
|
|
30
|
+
name: string = undefined;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* 配置属性列表
|
|
34
|
+
*/
|
|
35
|
+
@property('ConfigProperty')
|
|
36
|
+
properties: Array<ConfigProperty> = [];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* 祖先 App
|
|
40
|
+
*/
|
|
41
|
+
get app() {
|
|
42
|
+
return this.getAncestor('App') as App;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @param source 需要合并的部分参数
|
|
47
|
+
*/
|
|
48
|
+
constructor(source?: Partial<ConfigGroup>) {
|
|
49
|
+
source = Object.assign({}, ConfigGroup.getDefaultOptions(), source);
|
|
50
|
+
super(source);
|
|
51
|
+
super.subConstructor(source);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static from(source: any, parentNode?: any, parentKey?: string): ConfigGroup {
|
|
55
|
+
return super.from(source, parentNode, parentKey) as ConfigGroup;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* 从父级删除该节点
|
|
60
|
+
* @internal
|
|
61
|
+
*/
|
|
62
|
+
_delete() {
|
|
63
|
+
let params: Params = null;
|
|
64
|
+
if (this.parentNode) {
|
|
65
|
+
params = (this.parentNode as any)?.__removeConfigGroup?.(this);
|
|
66
|
+
}
|
|
67
|
+
return params;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* 设置配置组名称
|
|
71
|
+
*/
|
|
72
|
+
setName(name: string) {
|
|
73
|
+
const object = {
|
|
74
|
+
name,
|
|
75
|
+
};
|
|
76
|
+
this.update({
|
|
77
|
+
...object,
|
|
78
|
+
field: 'name',
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
getConfigPropertyExistingNames(excludedList: Array<ConfigProperty> = []) {
|
|
83
|
+
const excludedSet = new Set(excludedList);
|
|
84
|
+
return (this.properties || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
85
|
+
}
|
|
86
|
+
getConfigPropertyUniqueName(name = 'configProperty1') {
|
|
87
|
+
return utils.unique(name, this.getConfigPropertyExistingNames());
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 插入配置属性
|
|
92
|
+
* @internal
|
|
93
|
+
* @param name 配置属性名称,如果不填会自动生成一个唯一名称
|
|
94
|
+
*/
|
|
95
|
+
_insertConfigPropertyAt(name: string, index: number): ConfigProperty;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* 插入配置属性
|
|
99
|
+
* @internal
|
|
100
|
+
* @param configPropertyOptions 配置属性参数
|
|
101
|
+
*/
|
|
102
|
+
_insertConfigPropertyAt(configPropertyOptions: Partial<ConfigProperty>, index: number): ConfigProperty;
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* 插入配置属性
|
|
106
|
+
* @internal
|
|
107
|
+
* @param configProperty 已有的配置属性实例
|
|
108
|
+
*/
|
|
109
|
+
_insertConfigPropertyAt(configProperty: ConfigProperty, index: number): ConfigProperty;
|
|
110
|
+
|
|
111
|
+
_insertConfigPropertyAt(options: string | Partial<ConfigProperty> | ConfigProperty, index: number) {
|
|
112
|
+
const configPropertyOptions: any = {};
|
|
113
|
+
const relationOptions = { parentNode: this, parentKey: 'properties' };
|
|
114
|
+
let configProperty: ConfigProperty;
|
|
115
|
+
if (!options) {
|
|
116
|
+
configProperty = ConfigProperty.from({
|
|
117
|
+
...configPropertyOptions,
|
|
118
|
+
name: this.getConfigPropertyUniqueName(),
|
|
119
|
+
}, this, 'properties');
|
|
120
|
+
} else if (typeof options === 'string') {
|
|
121
|
+
configProperty = ConfigProperty.from({
|
|
122
|
+
...configPropertyOptions,
|
|
123
|
+
name: options,
|
|
124
|
+
}, this, 'properties');
|
|
125
|
+
} else if (options instanceof ConfigProperty) {
|
|
126
|
+
options.delete(); // 同一实例不支持多处存在
|
|
127
|
+
configProperty = options;
|
|
128
|
+
Object.assign(configProperty, relationOptions);
|
|
129
|
+
} else {
|
|
130
|
+
configProperty = ConfigProperty.from({
|
|
131
|
+
...configPropertyOptions,
|
|
132
|
+
...options,
|
|
133
|
+
}, this, 'properties');
|
|
134
|
+
}
|
|
135
|
+
this.properties.splice(index, 0, configProperty);
|
|
136
|
+
return configProperty;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* 插入配置属性
|
|
141
|
+
* @param name 配置属性名称,如果不填会自动生成一个唯一名称
|
|
142
|
+
*/
|
|
143
|
+
insertConfigPropertyAt(name: string, index: number): ConfigProperty;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* 插入配置属性
|
|
147
|
+
* @param configPropertyOptions 配置属性参数
|
|
148
|
+
*/
|
|
149
|
+
insertConfigPropertyAt(configPropertyOptions: Partial<ConfigProperty>, index: number): ConfigProperty;
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 插入配置属性
|
|
153
|
+
* @param configProperty 已有的配置属性实例
|
|
154
|
+
*/
|
|
155
|
+
insertConfigPropertyAt(configProperty: ConfigProperty, index: number): ConfigProperty;
|
|
156
|
+
|
|
157
|
+
insertConfigPropertyAt(options: string | Partial<ConfigProperty> | ConfigProperty, index: number) {
|
|
158
|
+
const node = this._insertConfigPropertyAt(options as any, index);
|
|
159
|
+
node.create({
|
|
160
|
+
index,
|
|
161
|
+
parentNode: this,
|
|
162
|
+
parentKey: 'properties',
|
|
163
|
+
});
|
|
164
|
+
return node;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* 添加配置属性
|
|
169
|
+
* @internal
|
|
170
|
+
* @param name 配置属性名称,如果不填会自动生成一个唯一名称
|
|
171
|
+
*/
|
|
172
|
+
_addConfigProperty(name?: string): ConfigProperty;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* 添加配置属性
|
|
176
|
+
* @internal
|
|
177
|
+
* @param configPropertyOptions 配置属性参数
|
|
178
|
+
*/
|
|
179
|
+
_addConfigProperty(configPropertyOptions: Partial<ConfigProperty>): ConfigProperty;
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* 添加配置属性
|
|
183
|
+
* @internal
|
|
184
|
+
* @param configProperty 已有的配置属性实例
|
|
185
|
+
*/
|
|
186
|
+
_addConfigProperty(configProperty: ConfigProperty): ConfigProperty;
|
|
187
|
+
|
|
188
|
+
_addConfigProperty(options?: string | Partial<ConfigProperty> | ConfigProperty) {
|
|
189
|
+
const index = this.properties.length;
|
|
190
|
+
return this._insertConfigPropertyAt(options as any, index);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* 添加配置属性
|
|
195
|
+
* @internal
|
|
196
|
+
* @param name 配置属性名称,如果不填会自动生成一个唯一名称
|
|
197
|
+
*/
|
|
198
|
+
addConfigProperty(name?: string): ConfigProperty;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* 添加配置属性
|
|
202
|
+
* @param configPropertyOptions 配置属性参数
|
|
203
|
+
*/
|
|
204
|
+
addConfigProperty(configPropertyOptions: Partial<ConfigProperty>): ConfigProperty;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* 添加配置属性
|
|
208
|
+
* @param configProperty 已有的配置属性实例
|
|
209
|
+
*/
|
|
210
|
+
addConfigProperty(configProperty: ConfigProperty): ConfigProperty;
|
|
211
|
+
|
|
212
|
+
addConfigProperty(options?: string | Partial<ConfigProperty> | ConfigProperty) {
|
|
213
|
+
const node = this._addConfigProperty(options as any);
|
|
214
|
+
const index = this.properties.length;
|
|
215
|
+
node.create({
|
|
216
|
+
index,
|
|
217
|
+
parentNode: this,
|
|
218
|
+
parentKey: 'properties',
|
|
219
|
+
});
|
|
220
|
+
return node;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* 删除配置属性
|
|
228
|
+
* @param name 配置属性名称
|
|
229
|
+
*/
|
|
230
|
+
removeConfigProperty(name: string): void;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* 删除配置属性
|
|
234
|
+
* @param configProperty 已有的配置属性实例
|
|
235
|
+
*/
|
|
236
|
+
removeConfigProperty(configProperty: ConfigProperty): void;
|
|
237
|
+
|
|
238
|
+
removeConfigProperty(options: string | ConfigProperty) {
|
|
239
|
+
let configProperty: ConfigProperty;
|
|
240
|
+
if (typeof options === 'string') {
|
|
241
|
+
configProperty = this.properties.find((item) => item.name === options);
|
|
242
|
+
if (!configProperty) {
|
|
243
|
+
throw new Error('找不到配置属性 ' + options);
|
|
244
|
+
}
|
|
245
|
+
} else {
|
|
246
|
+
configProperty = options;
|
|
247
|
+
}
|
|
248
|
+
return configProperty.delete();
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
__removeConfigProperty(configProperty: ConfigProperty) {
|
|
252
|
+
const parentKey = configProperty.parentKey;
|
|
253
|
+
const params: Params = {
|
|
254
|
+
parentNode: this,
|
|
255
|
+
parentKey,
|
|
256
|
+
index: -1,
|
|
257
|
+
object: null,
|
|
258
|
+
oldObject: configProperty,
|
|
259
|
+
};
|
|
260
|
+
if (parentKey) {
|
|
261
|
+
params.parentKey = parentKey;
|
|
262
|
+
if (Array.isArray((this as any)[parentKey])) {
|
|
263
|
+
const index = (this as any)[parentKey].indexOf(configProperty);
|
|
264
|
+
~index && (this as any)[parentKey].splice(index, 1);
|
|
265
|
+
params.index = index;
|
|
266
|
+
} else if ((this as any)[parentKey] === configProperty) {
|
|
267
|
+
params.index = 0;
|
|
268
|
+
(this as any)[parentKey] = undefined;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return params;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
//================================================================================
|
|
275
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
276
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
277
|
+
//================================================================================
|
|
278
|
+
|
|
279
|
+
//================================================================================
|
|
280
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
281
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
282
|
+
//================================================================================
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
classMap['ConfigGroup'] = ConfigGroup;
|
|
286
|
+
export default ConfigGroup;
|
|
287
|
+
//================================================================================
|
|
288
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
289
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
290
|
+
//================================================================================
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
//================================================================================
|
|
2
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
4
|
+
//================================================================================
|
|
5
|
+
import { EventPayload, Params } from '../common/EventEmitter';
|
|
6
|
+
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
|
+
|
|
8
|
+
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import BaseNode from '../common/BaseNode';
|
|
11
|
+
import classMap from '../common/classMap';
|
|
12
|
+
import App from './App__';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* 配置属性值
|
|
16
|
+
*/
|
|
17
|
+
@concept
|
|
18
|
+
export class ConfigPropertyValue extends BaseNode {
|
|
19
|
+
/**
|
|
20
|
+
* 产品概念
|
|
21
|
+
*/
|
|
22
|
+
@property()
|
|
23
|
+
concept: 'ConfigPropertyValue' = 'ConfigPropertyValue';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* env
|
|
27
|
+
*/
|
|
28
|
+
@property()
|
|
29
|
+
env: string = undefined;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 配置属性值的值
|
|
33
|
+
*/
|
|
34
|
+
@property()
|
|
35
|
+
value: string = undefined;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 祖先 App
|
|
39
|
+
*/
|
|
40
|
+
get app() {
|
|
41
|
+
return this.getAncestor('App') as App;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* @param source 需要合并的部分参数
|
|
46
|
+
*/
|
|
47
|
+
constructor(source?: Partial<ConfigPropertyValue>) {
|
|
48
|
+
source = Object.assign({}, ConfigPropertyValue.getDefaultOptions(), source);
|
|
49
|
+
super(source);
|
|
50
|
+
super.subConstructor(source);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
static from(source: any, parentNode?: any, parentKey?: string): ConfigPropertyValue {
|
|
54
|
+
return super.from(source, parentNode, parentKey) as ConfigPropertyValue;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* 从父级删除该节点
|
|
59
|
+
* @internal
|
|
60
|
+
*/
|
|
61
|
+
_delete() {
|
|
62
|
+
let params: Params = null;
|
|
63
|
+
if (this.parentNode) {
|
|
64
|
+
params = (this.parentNode as any)?.__removeConfigPropertyValue?.(this);
|
|
65
|
+
}
|
|
66
|
+
return params;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* 设置env
|
|
70
|
+
*/
|
|
71
|
+
setEnv(env: string) {
|
|
72
|
+
const object = {
|
|
73
|
+
env,
|
|
74
|
+
};
|
|
75
|
+
this.update({
|
|
76
|
+
...object,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 设置配置属性值的值
|
|
82
|
+
*/
|
|
83
|
+
setValue(value: string) {
|
|
84
|
+
const object = {
|
|
85
|
+
value,
|
|
86
|
+
};
|
|
87
|
+
this.update({
|
|
88
|
+
...object,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
//================================================================================
|
|
97
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
98
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
99
|
+
//================================================================================
|
|
100
|
+
|
|
101
|
+
//================================================================================
|
|
102
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
103
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
104
|
+
//================================================================================
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
classMap['ConfigPropertyValue'] = ConfigPropertyValue;
|
|
108
|
+
export default ConfigPropertyValue;
|
|
109
|
+
//================================================================================
|
|
110
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
111
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
112
|
+
//================================================================================
|