@lcap/nasl 1.0.0-alpha.13 → 1.0.0-alpha.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/automate/engine/index.d.ts +1 -1
- package/out/automate/engine/index.js +73 -25
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/utils.js +7 -6
- package/out/automate/engine/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +5 -4
- package/out/common/BaseNode.js +48 -41
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +18 -1
- package/out/concepts/App__.js +64 -24
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +2 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +190 -0
- package/out/concepts/Assignee__.js +264 -0
- package/out/concepts/Assignee__.js.map +1 -0
- package/out/concepts/BinaryExpression__.js +6 -6
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +19 -0
- package/out/concepts/BindAttribute__.js +36 -2
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +21 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +1 -0
- package/out/concepts/BindEvent__.js +38 -14
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.js +20 -7
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +11 -8
- package/out/concepts/CallInterface__.js +160 -23
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +1 -0
- package/out/concepts/CallLogic__.js +17 -7
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +5 -1
- package/out/concepts/CallQueryComponent__.js +15 -11
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +6 -2
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +1 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +11 -0
- package/out/concepts/Destination__.js +59 -19
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +10 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +7 -0
- package/out/concepts/EntityProperty__.js +60 -3
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +4 -1
- package/out/concepts/Entity__.js +29 -12
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +4 -0
- package/out/concepts/Enum__.js +9 -6
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +8 -12
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +5 -5
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +26 -24
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +2 -0
- package/out/concepts/InterfaceParam__.js +41 -21
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +3 -0
- package/out/concepts/Interface__.js +105 -9
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -1
- package/out/concepts/LogicItem__.js +14 -0
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +3 -0
- package/out/concepts/Logic__.js +57 -16
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +13 -6
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +6 -0
- package/out/concepts/Module__.js +18 -8
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +4 -0
- package/out/concepts/Namespace__.js +23 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/Param__.d.ts +2 -1
- package/out/concepts/Param__.js +35 -22
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +2 -2
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +20 -18
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.d.ts +6 -1
- package/out/concepts/Process__.js +18 -14
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +2 -2
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -0
- package/out/concepts/Return__.js +38 -25
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +1 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -2
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +5 -4
- package/out/concepts/StructureProperty__.js +54 -31
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -0
- package/out/concepts/Structure__.js +18 -5
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +3 -3
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +3 -5
- package/out/concepts/TypeAnnotation__.js +36 -14
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +4 -2
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +1 -0
- package/out/concepts/ValidationRule__.js +27 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -0
- package/out/concepts/Variable__.js +38 -25
- 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 +7 -1
- package/out/concepts/ViewElement__.js +154 -117
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +4 -0
- package/out/concepts/View__.js +38 -25
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +3 -1
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.auth.js +30 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.js +70 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.browser.js +6 -35
- package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js +25 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.util.js +49 -41
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.js +26 -20
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
- package/out/concepts/basics/types/coreTypeList.js +11 -11
- package/out/concepts/basics/types/coreTypeList.js.map +1 -1
- package/out/concepts/index__.d.ts +1 -0
- package/out/concepts/index__.js +1 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/enums/KEYWORDS.js +1 -1
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +1 -0
- package/out/generator/genBundleFiles.js +122 -93
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/manager/diagnostic.d.ts +1 -1
- package/out/server/createUiTs.d.ts +1 -0
- package/out/server/createUiTs.js +19 -2
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +24 -9
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/getExtensionModules.js +2 -0
- package/out/server/getExtensionModules.js.map +1 -1
- package/out/server/getLogics.js +40 -56
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +4 -0
- package/out/server/getMemberIdentifier.js +90 -48
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +2 -2
- package/out/server/getProcesses.js +34 -11
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/index.js +4 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +11 -30
- package/out/server/naslServer.js +410 -199
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.d.ts +10 -0
- package/out/server/process2LogicNamespace.js +16 -0
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.d.ts +22 -3
- package/out/server/translator.js +336 -130
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +29 -15
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +5 -5
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +9 -13
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +7 -7
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +2 -2
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +4 -2
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.d.ts +1 -1
- package/out/templator/genGridViewBlock.js +3 -3
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.d.ts +2 -0
- package/out/templator/genQueryComponent.js +1 -0
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +1 -1
- package/out/templator/genTableBlock.js +3 -3
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +7 -7
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +3 -1
- package/out/templator/utils.js +2 -1
- package/out/templator/utils.js.map +1 -1
- package/out/utils/index.d.ts +6 -0
- package/out/utils/index.js +20 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +2 -1
- package/src/automate/engine/index.js +73 -25
- package/src/automate/engine/utils.js +7 -6
- package/src/common/BaseNode.ts +51 -42
- package/src/concepts/App__.ts +104 -26
- package/src/concepts/Argument__.ts +3 -2
- package/src/concepts/Assignee__.ts +437 -0
- package/src/concepts/BinaryExpression__.ts +7 -6
- package/src/concepts/BindAttribute__.ts +51 -2
- package/src/concepts/BindDirective__.ts +20 -1
- package/src/concepts/BindEvent__.ts +39 -16
- package/src/concepts/CallFunction__.ts +21 -8
- package/src/concepts/CallInterface__.ts +161 -42
- package/src/concepts/CallLogic__.ts +21 -9
- package/src/concepts/CallQueryComponent__.ts +15 -13
- package/src/concepts/Comment__.ts +6 -2
- package/src/concepts/ConfigGroup__.ts +1 -1
- package/src/concepts/ConfigProperty__.ts +1 -1
- package/src/concepts/Configuration__.ts +1 -1
- package/src/concepts/Destination__.ts +57 -19
- package/src/concepts/End__.ts +9 -11
- package/src/concepts/EntityProperty__.ts +56 -3
- package/src/concepts/Entity__.ts +33 -20
- package/src/concepts/Enum__.ts +8 -7
- package/src/concepts/Event__.ts +1 -1
- package/src/concepts/ForEachStatement__.ts +8 -13
- package/src/concepts/Function__.ts +5 -5
- package/src/concepts/Identifier__.ts +31 -26
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/InterfaceParam__.ts +39 -20
- package/src/concepts/Interface__.ts +103 -9
- package/src/concepts/LogicItem__.ts +16 -1
- package/src/concepts/Logic__.ts +60 -18
- package/src/concepts/MemberExpression__.ts +18 -6
- package/src/concepts/Module__.ts +19 -8
- package/src/concepts/Namespace__.ts +24 -12
- package/src/concepts/Param__.ts +34 -23
- package/src/concepts/ProcessComponent__.ts +2 -2
- package/src/concepts/ProcessElement__.ts +51 -50
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/Process__.ts +32 -28
- package/src/concepts/QueryAggregateExpression__.ts +1 -1
- package/src/concepts/QueryFromExpression__.ts +1 -1
- package/src/concepts/QueryJoinExpression__.ts +2 -2
- package/src/concepts/QuerySelectExpression__.ts +1 -1
- package/src/concepts/Return__.ts +35 -25
- package/src/concepts/SqlQueryComponent__.ts +1 -1
- package/src/concepts/StringLiteral__.ts +2 -2
- package/src/concepts/StructureProperty__.ts +49 -29
- package/src/concepts/Structure__.ts +17 -5
- package/src/concepts/SwitchCase__.ts +3 -3
- package/src/concepts/SwitchStatement__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +34 -12
- package/src/concepts/UnaryExpression__.ts +4 -2
- package/src/concepts/ValidationRule__.ts +24 -1
- package/src/concepts/Variable__.ts +35 -24
- package/src/concepts/ViewComponent__.ts +5 -5
- package/src/concepts/ViewElement__.ts +168 -113
- package/src/concepts/View__.ts +44 -25
- package/src/concepts/WhileStatement__.ts +1 -1
- package/src/concepts/basics/stdlib/index.ts +3 -1
- package/src/concepts/basics/stdlib/nasl.auth.ts +26 -0
- package/src/concepts/basics/stdlib/nasl.browser.ts +7 -41
- package/src/concepts/basics/stdlib/nasl.configuration.ts +21 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +49 -41
- package/src/concepts/basics/stdlib/nasl.validation.ts +17 -11
- package/src/concepts/basics/types/coreTypeList.ts +11 -11
- package/src/concepts/index__.ts +1 -0
- package/src/enums/KEYWORDS.ts +1 -1
- package/src/generator/genBundleFiles.ts +131 -112
- package/src/manager/diagnostic.ts +1 -1
- package/src/server/createUiTs.ts +22 -4
- package/src/server/entity2LogicNamespace.ts +25 -9
- package/src/server/getExtensionModules.ts +2 -0
- package/src/server/getLogics.ts +42 -58
- package/src/server/getMemberIdentifier.ts +88 -46
- package/src/server/getProcesses.ts +32 -9
- package/src/server/index.ts +12 -1
- package/src/server/naslServer.ts +422 -215
- package/src/server/process2LogicNamespace.ts +17 -1
- package/src/server/translator.ts +392 -134
- package/src/service/storage/init.ts +27 -16
- package/src/templator/genCreateBlock.ts +5 -5
- package/src/templator/genCurdEditMultipleKeyBlock.ts +25 -26
- package/src/templator/genCurdMultipleKeyBlock.ts +7 -7
- package/src/templator/genEditTableBlock.ts +2 -2
- package/src/templator/genGetBlock.ts +5 -7
- package/src/templator/genGridViewBlock.ts +4 -7
- package/src/templator/genQueryComponent.ts +1 -0
- package/src/templator/genTableBlock.ts +4 -7
- package/src/templator/genUpdateBlock.ts +7 -8
- package/src/templator/utils.ts +2 -1
- package/src/utils/index.ts +19 -0
|
@@ -200,7 +200,7 @@ export class Namespace extends BaseNode {
|
|
|
200
200
|
name: options,
|
|
201
201
|
}, this, 'children');
|
|
202
202
|
} else if (options instanceof Namespace) {
|
|
203
|
-
options.
|
|
203
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
204
204
|
namespace = options;
|
|
205
205
|
Object.assign(namespace, relationOptions);
|
|
206
206
|
} else {
|
|
@@ -342,7 +342,7 @@ export class Namespace extends BaseNode {
|
|
|
342
342
|
name: options,
|
|
343
343
|
}, this, 'processes');
|
|
344
344
|
} else if (options instanceof Process) {
|
|
345
|
-
options.
|
|
345
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
346
346
|
process = options;
|
|
347
347
|
Object.assign(process, relationOptions);
|
|
348
348
|
} else {
|
|
@@ -484,7 +484,7 @@ export class Namespace extends BaseNode {
|
|
|
484
484
|
name: options,
|
|
485
485
|
}, this, 'entities');
|
|
486
486
|
} else if (options instanceof Entity) {
|
|
487
|
-
options.
|
|
487
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
488
488
|
entity = options;
|
|
489
489
|
Object.assign(entity, relationOptions);
|
|
490
490
|
} else {
|
|
@@ -626,7 +626,7 @@ export class Namespace extends BaseNode {
|
|
|
626
626
|
name: options,
|
|
627
627
|
}, this, 'structures');
|
|
628
628
|
} else if (options instanceof Structure) {
|
|
629
|
-
options.
|
|
629
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
630
630
|
structure = options;
|
|
631
631
|
Object.assign(structure, relationOptions);
|
|
632
632
|
} else {
|
|
@@ -768,7 +768,7 @@ export class Namespace extends BaseNode {
|
|
|
768
768
|
name: options,
|
|
769
769
|
}, this, 'enums');
|
|
770
770
|
} else if (options instanceof Enum) {
|
|
771
|
-
options.
|
|
771
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
772
772
|
enumeration = options;
|
|
773
773
|
Object.assign(enumeration, relationOptions);
|
|
774
774
|
} else {
|
|
@@ -910,7 +910,7 @@ export class Namespace extends BaseNode {
|
|
|
910
910
|
name: options,
|
|
911
911
|
}, this, 'logics');
|
|
912
912
|
} else if (options instanceof Logic) {
|
|
913
|
-
options.
|
|
913
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
914
914
|
logic = options;
|
|
915
915
|
Object.assign(logic, relationOptions);
|
|
916
916
|
} else {
|
|
@@ -1052,7 +1052,7 @@ export class Namespace extends BaseNode {
|
|
|
1052
1052
|
name: options,
|
|
1053
1053
|
}, this, 'functions');
|
|
1054
1054
|
} else if (options instanceof Function) {
|
|
1055
|
-
options.
|
|
1055
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1056
1056
|
func = options;
|
|
1057
1057
|
Object.assign(func, relationOptions);
|
|
1058
1058
|
} else {
|
|
@@ -1194,7 +1194,7 @@ export class Namespace extends BaseNode {
|
|
|
1194
1194
|
name: options,
|
|
1195
1195
|
}, this, 'interfaces');
|
|
1196
1196
|
} else if (options instanceof Interface) {
|
|
1197
|
-
options.
|
|
1197
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1198
1198
|
itface = options;
|
|
1199
1199
|
Object.assign(itface, relationOptions);
|
|
1200
1200
|
} else {
|
|
@@ -1336,7 +1336,7 @@ export class Namespace extends BaseNode {
|
|
|
1336
1336
|
name: options,
|
|
1337
1337
|
}, this, 'views');
|
|
1338
1338
|
} else if (options instanceof View) {
|
|
1339
|
-
options.
|
|
1339
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1340
1340
|
view = options;
|
|
1341
1341
|
Object.assign(view, relationOptions);
|
|
1342
1342
|
} else {
|
|
@@ -1478,7 +1478,7 @@ export class Namespace extends BaseNode {
|
|
|
1478
1478
|
name: options,
|
|
1479
1479
|
}, this, 'variables');
|
|
1480
1480
|
} else if (options instanceof Variable) {
|
|
1481
|
-
options.
|
|
1481
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1482
1482
|
variable = options;
|
|
1483
1483
|
Object.assign(variable, relationOptions);
|
|
1484
1484
|
} else {
|
|
@@ -1620,7 +1620,7 @@ export class Namespace extends BaseNode {
|
|
|
1620
1620
|
name: options,
|
|
1621
1621
|
}, this, 'viewComponents');
|
|
1622
1622
|
} else if (options instanceof ViewComponent) {
|
|
1623
|
-
options.
|
|
1623
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1624
1624
|
viewComponent = options;
|
|
1625
1625
|
Object.assign(viewComponent, relationOptions);
|
|
1626
1626
|
} else {
|
|
@@ -1762,7 +1762,7 @@ export class Namespace extends BaseNode {
|
|
|
1762
1762
|
name: options,
|
|
1763
1763
|
}, this, 'processComponents');
|
|
1764
1764
|
} else if (options instanceof ProcessComponent) {
|
|
1765
|
-
options.
|
|
1765
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
1766
1766
|
processComponent = options;
|
|
1767
1767
|
Object.assign(processComponent, relationOptions);
|
|
1768
1768
|
} else {
|
|
@@ -2496,6 +2496,18 @@ export class Namespace extends BaseNode {
|
|
|
2496
2496
|
throw new Error('无法获取命名空间,请设置 parentNode 或临时的 path!');
|
|
2497
2497
|
}
|
|
2498
2498
|
|
|
2499
|
+
/**
|
|
2500
|
+
* 获取命名空间
|
|
2501
|
+
*/
|
|
2502
|
+
getTsNamespace(): string {
|
|
2503
|
+
if (this.path)
|
|
2504
|
+
return this.path;
|
|
2505
|
+
else if (this.parentNode && (this.parentNode as Namespace).getNamespace)
|
|
2506
|
+
return `${(this.parentNode as Namespace).getNamespace()}.${this.tsName}`;
|
|
2507
|
+
else
|
|
2508
|
+
throw new Error('无法获取命名空间,请设置 parentNode 或临时的 path!');
|
|
2509
|
+
}
|
|
2510
|
+
|
|
2499
2511
|
findChild(name: string) {
|
|
2500
2512
|
return this.children.find((child) => child.name === name);
|
|
2501
2513
|
}
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -244,7 +244,7 @@ export class Param extends BaseNode {
|
|
|
244
244
|
@excludedInJSON()
|
|
245
245
|
@property()
|
|
246
246
|
useComponent: {
|
|
247
|
-
type: 's-member-identifier-select' | 's-enum-select' | 's-schema-select' | 's-datatype-select' | 's-options-select';
|
|
247
|
+
type: 's-member-identifier-select' | 's-enum-select' | 's-schema-select' | 's-datatype-select' | 's-config-select' | 's-options-select';
|
|
248
248
|
attrs?: any;
|
|
249
249
|
} = undefined;
|
|
250
250
|
|
|
@@ -297,7 +297,7 @@ export class Param extends BaseNode {
|
|
|
297
297
|
// eslint-disable-next-line prefer-rest-params
|
|
298
298
|
throw new Error('找不到类型:' + arguments[0]);
|
|
299
299
|
} else {
|
|
300
|
-
typeAnnotation._delete();
|
|
300
|
+
typeAnnotation._delete?.();
|
|
301
301
|
const relationOptions = { parentId: this.id, parentConcept: this.concept, parentNode: this };
|
|
302
302
|
Object.assign(typeAnnotation, relationOptions);
|
|
303
303
|
}
|
|
@@ -327,7 +327,7 @@ export class Param extends BaseNode {
|
|
|
327
327
|
};
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
-
_readonly: boolean = false
|
|
330
|
+
_readonly: boolean = false;
|
|
331
331
|
/**
|
|
332
332
|
* 是否可编辑
|
|
333
333
|
* */
|
|
@@ -339,35 +339,46 @@ export class Param extends BaseNode {
|
|
|
339
339
|
this._readonly = val;
|
|
340
340
|
}
|
|
341
341
|
get hasChildren() {
|
|
342
|
-
const { typeKind } = this.typeAnnotation;
|
|
342
|
+
const { typeKind, typeNamespace } = this.typeAnnotation;
|
|
343
343
|
if (typeKind === 'reference' || typeKind === 'generic') {
|
|
344
|
+
if (typeNamespace.endsWith('.enums'))
|
|
345
|
+
return null;
|
|
344
346
|
return [{}];
|
|
345
347
|
}
|
|
346
348
|
return null;
|
|
347
349
|
}
|
|
350
|
+
get isTreeLeaf() {
|
|
351
|
+
return !this.hasChildren;
|
|
352
|
+
}
|
|
348
353
|
getSelectRef() {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
if (
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
354
|
+
try {
|
|
355
|
+
const { typeName, typeKind, typeNamespace } = this.typeAnnotation;
|
|
356
|
+
let completionChildren;
|
|
357
|
+
if (typeKind === 'reference') {
|
|
358
|
+
if (typeNamespace === 'nasl.ui') {
|
|
359
|
+
const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
|
|
360
|
+
const properties = node.properties || [];
|
|
361
|
+
completionChildren = properties;
|
|
362
|
+
} else if (typeNamespace.endsWith('.enums')) {
|
|
363
|
+
completionChildren = undefined;
|
|
364
|
+
} else {
|
|
365
|
+
const node = getNodeByNodeCallee(this.app, typeNamespace + '.' + typeName);
|
|
366
|
+
const properties = node.properties || [];
|
|
367
|
+
completionChildren = properties;
|
|
368
|
+
}
|
|
369
|
+
} else if (typeKind === 'generic') {
|
|
370
|
+
if (typeNamespace === 'nasl.collection') {
|
|
371
|
+
const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
|
|
372
|
+
const properties = node.properties || [];
|
|
373
|
+
completionChildren = properties;
|
|
374
|
+
}
|
|
356
375
|
} else {
|
|
357
|
-
|
|
358
|
-
const properties = node.properties || [];
|
|
359
|
-
completionChildren = properties;
|
|
360
|
-
}
|
|
361
|
-
} else if (typeKind === 'generic') {
|
|
362
|
-
if (typeNamespace === 'nasl.collection') {
|
|
363
|
-
const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
|
|
364
|
-
const properties = node.properties || [];
|
|
365
|
-
completionChildren = properties;
|
|
376
|
+
completionChildren = undefined;
|
|
366
377
|
}
|
|
367
|
-
|
|
368
|
-
|
|
378
|
+
return completionChildren;
|
|
379
|
+
} catch (err) {
|
|
380
|
+
console.log(err);
|
|
369
381
|
}
|
|
370
|
-
return completionChildren;
|
|
371
382
|
}
|
|
372
383
|
//================================================================================
|
|
373
384
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -144,7 +144,7 @@ export class ProcessComponent extends BaseNode {
|
|
|
144
144
|
name: options,
|
|
145
145
|
}, this, 'attrs');
|
|
146
146
|
} else if (options instanceof Attribute) {
|
|
147
|
-
options.
|
|
147
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
148
148
|
attribute = options;
|
|
149
149
|
Object.assign(attribute, relationOptions);
|
|
150
150
|
} else {
|
|
@@ -286,7 +286,7 @@ export class ProcessComponent extends BaseNode {
|
|
|
286
286
|
name: options,
|
|
287
287
|
}, this, 'logics');
|
|
288
288
|
} else if (options instanceof Logic) {
|
|
289
|
-
options.
|
|
289
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
290
290
|
logic = options;
|
|
291
291
|
Object.assign(logic, relationOptions);
|
|
292
292
|
} else {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, embeddedTSEmitter } from '../translator';
|
|
2
|
-
import { constantToParam, genUserTaskLogic, returnToParam,
|
|
2
|
+
import { constantToParam, genUserTaskLogic, returnToParam, getPreviousTask, syncMemberExpression } from '../server/getProcesses';
|
|
3
3
|
//================================================================================
|
|
4
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
5
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -292,7 +292,7 @@ export class ProcessElement extends BaseNode {
|
|
|
292
292
|
name: options,
|
|
293
293
|
}, this, 'waypoints');
|
|
294
294
|
} else if (options instanceof Point) {
|
|
295
|
-
options.
|
|
295
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
296
296
|
point = options;
|
|
297
297
|
Object.assign(point, relationOptions);
|
|
298
298
|
} else {
|
|
@@ -434,7 +434,7 @@ export class ProcessElement extends BaseNode {
|
|
|
434
434
|
name: options,
|
|
435
435
|
}, this, 'variables');
|
|
436
436
|
} else if (options instanceof Variable) {
|
|
437
|
-
options.
|
|
437
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
438
438
|
variable = options;
|
|
439
439
|
Object.assign(variable, relationOptions);
|
|
440
440
|
} else {
|
|
@@ -576,7 +576,7 @@ export class ProcessElement extends BaseNode {
|
|
|
576
576
|
name: options,
|
|
577
577
|
}, this, 'returns');
|
|
578
578
|
} else if (options instanceof Return) {
|
|
579
|
-
options.
|
|
579
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
580
580
|
ret = options;
|
|
581
581
|
Object.assign(ret, relationOptions);
|
|
582
582
|
} else {
|
|
@@ -718,7 +718,7 @@ export class ProcessElement extends BaseNode {
|
|
|
718
718
|
name: options,
|
|
719
719
|
}, this, 'constants');
|
|
720
720
|
} else if (options instanceof Constant) {
|
|
721
|
-
options.
|
|
721
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
722
722
|
constant = options;
|
|
723
723
|
Object.assign(constant, relationOptions);
|
|
724
724
|
} else {
|
|
@@ -860,7 +860,7 @@ export class ProcessElement extends BaseNode {
|
|
|
860
860
|
name: options,
|
|
861
861
|
}, this, 'bindAttrs');
|
|
862
862
|
} else if (options instanceof BindAttribute) {
|
|
863
|
-
options.
|
|
863
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
864
864
|
bindAttribute = options;
|
|
865
865
|
Object.assign(bindAttribute, relationOptions);
|
|
866
866
|
} else {
|
|
@@ -1334,59 +1334,60 @@ export class ProcessElement extends BaseNode {
|
|
|
1334
1334
|
const tab5 = indent(state.tabSize + 4);
|
|
1335
1335
|
const tab6 = indent(state.tabSize + 5);
|
|
1336
1336
|
let code = `${this.name}: {\n`;
|
|
1337
|
-
this.variables.forEach(property => {
|
|
1338
|
-
code += `${tab1}${property.toEmbeddedTSInProcess(shiftState(state, code, { inline: true }))},\n
|
|
1339
|
-
})
|
|
1340
|
-
this.returns.forEach(property => {
|
|
1341
|
-
code += `${tab1}${property.toEmbeddedTSInProcess(shiftState(state, code, { inline: true }))},\n
|
|
1342
|
-
})
|
|
1343
|
-
this.constants.forEach(property => {
|
|
1344
|
-
code += `${tab1}${property.toEmbeddedTSInProcess(shiftState(state, code, { inline: true }))},\n
|
|
1345
|
-
})
|
|
1346
|
-
|
|
1347
|
-
if(this.type === 'UserTask'
|
|
1348
|
-
|
|
1349
|
-
|
|
1337
|
+
this.variables.forEach((property) => {
|
|
1338
|
+
code += `${tab1}${property.toEmbeddedTSInProcess(shiftState(state, code, { inline: true }))},\n`;
|
|
1339
|
+
});
|
|
1340
|
+
this.returns.forEach((property) => {
|
|
1341
|
+
code += `${tab1}${property.toEmbeddedTSInProcess(shiftState(state, code, { inline: true }))},\n`;
|
|
1342
|
+
});
|
|
1343
|
+
this.constants.forEach((property) => {
|
|
1344
|
+
code += `${tab1}${property.toEmbeddedTSInProcess(shiftState(state, code, { inline: true }))},\n`;
|
|
1345
|
+
});
|
|
1346
|
+
|
|
1347
|
+
if (this.type === 'UserTask'
|
|
1348
|
+
|| this.type === 'ExclusiveGateway') {
|
|
1349
|
+
const prevTasks = getPreviousTask(this);
|
|
1350
|
+
let prevCode = `${tab3}const ${this.process.name} = {\n`;
|
|
1350
1351
|
const processName = this.process.name;
|
|
1351
|
-
this.process.params.forEach(p => {
|
|
1352
|
-
prevCode += `${tab5}${p.name}: app.processes.${processName}.${p.name},\n
|
|
1353
|
-
})
|
|
1354
|
-
this.process.returns.forEach(p => {
|
|
1355
|
-
prevCode += `${tab5}${p.name}: app.processes.${processName}.${p.name},\n
|
|
1356
|
-
})
|
|
1357
|
-
this.process.constants.forEach(p => {
|
|
1358
|
-
prevCode += `${tab5}${p.name}: app.processes.${processName}.${p.name},\n
|
|
1359
|
-
})
|
|
1352
|
+
this.process.params.forEach((p) => {
|
|
1353
|
+
prevCode += `${tab5}${p.name}: app.processes.${processName}.${p.name},\n`;
|
|
1354
|
+
});
|
|
1355
|
+
this.process.returns.forEach((p) => {
|
|
1356
|
+
prevCode += `${tab5}${p.name}: app.processes.${processName}.${p.name},\n`;
|
|
1357
|
+
});
|
|
1358
|
+
this.process.constants.forEach((p) => {
|
|
1359
|
+
prevCode += `${tab5}${p.name}: app.processes.${processName}.${p.name},\n`;
|
|
1360
|
+
});
|
|
1360
1361
|
// prevCode += `${tab4}elements: {\n`
|
|
1361
|
-
prevCode +=
|
|
1362
|
-
|
|
1362
|
+
prevCode += prevTasks.map((t) => `${tab5}${t.name}: elements.${t.name},\n`).join(``);
|
|
1363
|
+
|
|
1363
1364
|
// prevCode += `${tab4}}\n`
|
|
1364
|
-
|
|
1365
1365
|
|
|
1366
|
-
if(this.type === 'UserTask') {
|
|
1367
|
-
prevCode += `\n${tab5}${this.name}: { \n${this.constants.map(c => `${tab6}${c.name}: "",`
|
|
1366
|
+
if (this.type === 'UserTask') {
|
|
1367
|
+
prevCode += `\n${tab5}${this.name}: { \n${this.constants.map((c) => `${tab6}${c.name}: "",`).join('\n')} }\n`;
|
|
1368
1368
|
prevCode += `${tab3}}\n`;
|
|
1369
|
-
code += `${tab1}logics: {\n
|
|
1369
|
+
code += `${tab1}logics: {\n`;
|
|
1370
1370
|
this.bindAttrs.forEach((attr) => {
|
|
1371
|
-
if(attr.name === 'destination') {
|
|
1371
|
+
if (attr.name === 'destination') {
|
|
1372
1372
|
code += `${attr.destination.toEmbeddedTSInProcess(shiftState(state, code, { tabSize: state.tabSize + 3 }), prevCode)},\n`;
|
|
1373
1373
|
}
|
|
1374
|
-
});
|
|
1374
|
+
});
|
|
1375
1375
|
const logic = genUserTaskLogic(this);
|
|
1376
|
+
// sourceMap 映射
|
|
1377
|
+
logic.parentNode = this.process;
|
|
1378
|
+
|
|
1376
1379
|
code += logic.toEmbeddedTSInProcess(shiftState(state, code, { tabSize: state.tabSize + 3 }));
|
|
1377
|
-
code += ',\n'
|
|
1380
|
+
code += ',\n';
|
|
1378
1381
|
code += `${tab1}}`;
|
|
1379
1382
|
}
|
|
1380
1383
|
|
|
1381
|
-
if(this.type === 'ExclusiveGateway') {
|
|
1382
|
-
prevCode += `\n${tab5}${this.name}: elements.${this.name},\n
|
|
1384
|
+
if (this.type === 'ExclusiveGateway') {
|
|
1385
|
+
prevCode += `\n${tab5}${this.name}: elements.${this.name},\n`;
|
|
1383
1386
|
prevCode += `${tab3}}\n`;
|
|
1384
|
-
code += `${tab1}logic: ${this.logic.toEmbeddedTSInProcess(shiftState(state, code, { tabSize: state.tabSize + 3 }), prevCode, true)}
|
|
1387
|
+
code += `${tab1}logic: ${this.logic.toEmbeddedTSInProcess(shiftState(state, code, { tabSize: state.tabSize + 3 }), prevCode, true)},`;
|
|
1385
1388
|
}
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
1389
|
}
|
|
1389
|
-
code += `${tab0}\n}
|
|
1390
|
+
code += `${tab0}\n},`;
|
|
1390
1391
|
// let code = '';
|
|
1391
1392
|
// this.variables.forEach((property) => {
|
|
1392
1393
|
// code += `${tab0}export let `;
|
|
@@ -1450,19 +1451,19 @@ export default ProcessElement;
|
|
|
1450
1451
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1451
1452
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
1452
1453
|
//================================================================================
|
|
1453
|
-
ProcessElement.prototype.setName = function(name: string) {
|
|
1454
|
+
ProcessElement.prototype.setName = function (name: string) {
|
|
1454
1455
|
const App = this.rootNode;
|
|
1455
1456
|
const oldName = this.name;
|
|
1456
1457
|
const processName = this.parentNode.name;
|
|
1457
|
-
|
|
1458
|
+
|
|
1458
1459
|
App.emit('collect:start', {
|
|
1459
|
-
actionMsg: '设置名称'
|
|
1460
|
+
actionMsg: '设置名称',
|
|
1460
1461
|
});
|
|
1461
1462
|
syncMemberExpression(this, (node) => {
|
|
1462
|
-
if(node.object.name === processName && node.property.name === oldName) {
|
|
1463
|
+
if (node.object.name === processName && node.property.name === oldName) {
|
|
1463
1464
|
node.property.update({
|
|
1464
1465
|
name,
|
|
1465
|
-
})
|
|
1466
|
+
});
|
|
1466
1467
|
}
|
|
1467
1468
|
});
|
|
1468
1469
|
const process = this.process;
|
|
@@ -1474,7 +1475,7 @@ ProcessElement.prototype.setName = function(name: string) {
|
|
|
1474
1475
|
el.setTargetRef(name);
|
|
1475
1476
|
}
|
|
1476
1477
|
});
|
|
1477
|
-
if(this.logic) {
|
|
1478
|
+
if (this.logic) {
|
|
1478
1479
|
this.logic.setName(name);
|
|
1479
1480
|
}
|
|
1480
1481
|
const object = {
|
|
@@ -1485,4 +1486,4 @@ ProcessElement.prototype.setName = function(name: string) {
|
|
|
1485
1486
|
field: 'name',
|
|
1486
1487
|
});
|
|
1487
1488
|
App.emit('collect:end');
|
|
1488
|
-
}
|
|
1489
|
+
};
|
|
@@ -74,7 +74,7 @@ export class ProcessOutcome extends LogicItem {
|
|
|
74
74
|
//================================================================================
|
|
75
75
|
@withSourceMap()
|
|
76
76
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
77
|
-
const code = `return () => ${this.flowRef ? this.flowRef : '__IDENTIFIER__'}`;
|
|
77
|
+
const code = `return () => ${this.flowRef ? `"${this.flowRef}"` : '__IDENTIFIER__'}`;
|
|
78
78
|
return code;
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -194,7 +194,7 @@ export class Process extends BaseNode {
|
|
|
194
194
|
name: options,
|
|
195
195
|
}, this, 'params');
|
|
196
196
|
} else if (options instanceof Param) {
|
|
197
|
-
options.
|
|
197
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
198
198
|
param = options;
|
|
199
199
|
Object.assign(param, relationOptions);
|
|
200
200
|
} else {
|
|
@@ -336,7 +336,7 @@ export class Process extends BaseNode {
|
|
|
336
336
|
name: options,
|
|
337
337
|
}, this, 'returns');
|
|
338
338
|
} else if (options instanceof Return) {
|
|
339
|
-
options.
|
|
339
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
340
340
|
ret = options;
|
|
341
341
|
Object.assign(ret, relationOptions);
|
|
342
342
|
} else {
|
|
@@ -478,7 +478,7 @@ export class Process extends BaseNode {
|
|
|
478
478
|
name: options,
|
|
479
479
|
}, this, 'constants');
|
|
480
480
|
} else if (options instanceof Constant) {
|
|
481
|
-
options.
|
|
481
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
482
482
|
constant = options;
|
|
483
483
|
Object.assign(constant, relationOptions);
|
|
484
484
|
} else {
|
|
@@ -620,7 +620,7 @@ export class Process extends BaseNode {
|
|
|
620
620
|
name: options,
|
|
621
621
|
}, this, 'elements');
|
|
622
622
|
} else if (options instanceof ProcessElement) {
|
|
623
|
-
options.
|
|
623
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
624
624
|
element = options;
|
|
625
625
|
Object.assign(element, relationOptions);
|
|
626
626
|
} else {
|
|
@@ -986,18 +986,18 @@ export class Process extends BaseNode {
|
|
|
986
986
|
// ];
|
|
987
987
|
const ns = process2LogicNamespace(this);
|
|
988
988
|
let logics: Logic[] = [];
|
|
989
|
-
ns.children.map(subns => {
|
|
990
|
-
logics = logics.concat(subns.logics)
|
|
991
|
-
})
|
|
989
|
+
ns.children.map((subns) => {
|
|
990
|
+
logics = logics.concat(subns.logics);
|
|
991
|
+
});
|
|
992
992
|
|
|
993
993
|
return [
|
|
994
994
|
...ns.logics,
|
|
995
995
|
...logics,
|
|
996
|
-
]
|
|
996
|
+
];
|
|
997
997
|
}
|
|
998
998
|
|
|
999
999
|
toUserTaskPropertyGetterTS(userTask: ProcessElement) {
|
|
1000
|
-
return `let ${userTask.name} = elements.${userTask.name}
|
|
1000
|
+
return `let ${userTask.name} = elements.${userTask.name};`;
|
|
1001
1001
|
}
|
|
1002
1002
|
|
|
1003
1003
|
@withSourceMap()
|
|
@@ -1027,18 +1027,21 @@ export class Process extends BaseNode {
|
|
|
1027
1027
|
});
|
|
1028
1028
|
code += `${tab1}export namespace logics {\n`;
|
|
1029
1029
|
const logic = genLaunchProcess(this);
|
|
1030
|
+
// sourceMap 映射
|
|
1031
|
+
logic.parentNode = this;
|
|
1030
1032
|
code += logic.toEmbeddedTS(shiftState(state, code, { tabSize: state.tabSize + 2 }));
|
|
1031
1033
|
code += `${tab1}}\n`;
|
|
1032
|
-
|
|
1033
|
-
code += `${tab1}export const elements = {\n`
|
|
1034
1034
|
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1035
|
+
code += `${tab1}export const elements = {\n`;
|
|
1036
|
+
|
|
1037
|
+
this.elements.forEach((ele) => {
|
|
1038
|
+
code += '\n';
|
|
1039
|
+
if (ele.type === 'UserTask' || ele.type === 'ExclusiveGateway' || ele.type === 'AutoTask') {
|
|
1040
|
+
code += ele.toEmbeddedTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
1038
1041
|
}
|
|
1039
|
-
})
|
|
1040
|
-
code += `${tab1}}\n
|
|
1041
|
-
code += `}\n
|
|
1042
|
+
});
|
|
1043
|
+
code += `${tab1}}\n`;
|
|
1044
|
+
code += `}\n`;
|
|
1042
1045
|
return code;
|
|
1043
1046
|
}
|
|
1044
1047
|
|
|
@@ -1081,8 +1084,8 @@ export class Process extends BaseNode {
|
|
|
1081
1084
|
type: 'StartNoneEvent',
|
|
1082
1085
|
bounds: {
|
|
1083
1086
|
concept: 'Rect',
|
|
1084
|
-
x: 0, y: 0
|
|
1085
|
-
}
|
|
1087
|
+
x: 0, y: 0,
|
|
1088
|
+
},
|
|
1086
1089
|
},
|
|
1087
1090
|
{
|
|
1088
1091
|
concept: 'ProcessElement',
|
|
@@ -1090,16 +1093,18 @@ export class Process extends BaseNode {
|
|
|
1090
1093
|
type: 'EndNoneEvent',
|
|
1091
1094
|
bounds: {
|
|
1092
1095
|
concept: 'Rect',
|
|
1093
|
-
x: 0, y: 180
|
|
1094
|
-
}
|
|
1096
|
+
x: 0, y: 180,
|
|
1097
|
+
},
|
|
1095
1098
|
},
|
|
1096
1099
|
{
|
|
1097
1100
|
concept: 'ProcessElement',
|
|
1101
|
+
name: 'SequenceFlow',
|
|
1098
1102
|
type: 'SequenceFlow',
|
|
1099
1103
|
sourceRef: 'Start',
|
|
1100
1104
|
targetRef: 'End',
|
|
1105
|
+
waypoints: [{ x: 0, y: 0 }, { x: 100, y: 100 }],
|
|
1101
1106
|
},
|
|
1102
|
-
]
|
|
1107
|
+
],
|
|
1103
1108
|
};
|
|
1104
1109
|
}
|
|
1105
1110
|
//================================================================================
|
|
@@ -1114,18 +1119,17 @@ export default Process;
|
|
|
1114
1119
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1115
1120
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
1116
1121
|
//================================================================================
|
|
1117
|
-
Process.prototype.setName = function(name: string) {
|
|
1122
|
+
Process.prototype.setName = function (name: string) {
|
|
1118
1123
|
const App = this.rootNode;
|
|
1119
1124
|
const oldName = this.name;
|
|
1120
|
-
console.log(oldName);
|
|
1121
1125
|
App.emit('collect:start', {
|
|
1122
|
-
actionMsg: '设置名称'
|
|
1126
|
+
actionMsg: '设置名称',
|
|
1123
1127
|
});
|
|
1124
1128
|
syncMemberExpression(this, (node) => {
|
|
1125
|
-
if(node.object instanceof Identifier &&
|
|
1129
|
+
if (node.object instanceof Identifier && node.object.name === oldName) {
|
|
1126
1130
|
node.object.update({
|
|
1127
1131
|
name,
|
|
1128
|
-
})
|
|
1132
|
+
});
|
|
1129
1133
|
}
|
|
1130
1134
|
});
|
|
1131
1135
|
this.update({
|
|
@@ -1133,4 +1137,4 @@ Process.prototype.setName = function(name: string) {
|
|
|
1133
1137
|
field: 'name',
|
|
1134
1138
|
});
|
|
1135
1139
|
App.emit('collect:end');
|
|
1136
|
-
}
|
|
1140
|
+
};
|
|
@@ -138,7 +138,7 @@ export class QueryAggregateExpression extends LogicItem {
|
|
|
138
138
|
// code += `[__EMPTY_AGGREGATE_NAME__, '']`;
|
|
139
139
|
|
|
140
140
|
// return code;
|
|
141
|
-
return
|
|
141
|
+
return `__${this.asName || '__EMPTY_AGGREGATE_ALIAS__'}`;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
setName(asName: string) {
|
|
@@ -99,7 +99,7 @@ export class QueryFromExpression extends LogicItem {
|
|
|
99
99
|
const relationOptions = { parentNode: this, parentKey: 'joinParts' };
|
|
100
100
|
let queryJoinExpression: QueryJoinExpression;
|
|
101
101
|
if (options instanceof QueryJoinExpression) {
|
|
102
|
-
options.
|
|
102
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
103
103
|
queryJoinExpression = options;
|
|
104
104
|
Object.assign(queryJoinExpression, relationOptions);
|
|
105
105
|
} else {
|
|
@@ -132,7 +132,7 @@ export class QueryJoinExpression extends LogicItem {
|
|
|
132
132
|
name: options,
|
|
133
133
|
}, this, 'onExpressions');
|
|
134
134
|
} else if (options instanceof BinaryExpression) {
|
|
135
|
-
options.
|
|
135
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
136
136
|
binaryExpression = options;
|
|
137
137
|
Object.assign(binaryExpression, relationOptions);
|
|
138
138
|
} else {
|
|
@@ -250,7 +250,7 @@ export class QueryJoinExpression extends LogicItem {
|
|
|
250
250
|
const relationOptions = { parentNode: this, parentKey: 'joinParts' };
|
|
251
251
|
let queryJoinExpression: QueryJoinExpression;
|
|
252
252
|
if (options instanceof QueryJoinExpression) {
|
|
253
|
-
options.
|
|
253
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
254
254
|
queryJoinExpression = options;
|
|
255
255
|
Object.assign(queryJoinExpression, relationOptions);
|
|
256
256
|
} else {
|
|
@@ -113,7 +113,7 @@ export class QuerySelectExpression extends LogicItem {
|
|
|
113
113
|
name: options,
|
|
114
114
|
}, this, 'selectElements');
|
|
115
115
|
} else if (options instanceof QueryAggregateExpression) {
|
|
116
|
-
options.
|
|
116
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
117
117
|
queryAggregateExpression = options;
|
|
118
118
|
Object.assign(queryAggregateExpression, relationOptions);
|
|
119
119
|
} else {
|