@lcap/nasl 1.0.0-alpha.13 → 1.0.0-alpha.14
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.js +1 -1
- package/out/automate/engine/index.js.map +1 -1
- package/out/common/BaseNode.d.ts +4 -4
- package/out/common/BaseNode.js +45 -41
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +17 -0
- package/out/concepts/App__.js +54 -12
- 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/BinaryExpression__.js +8 -6
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +21 -21
- package/out/concepts/BindAttribute__.js +4 -3
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +3 -3
- package/out/concepts/BindDirective__.js +22 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +9 -8
- package/out/concepts/BindEvent__.js +17 -7
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.js +10 -5
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +11 -1
- 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 +0 -1
- package/out/concepts/CallQueryComponent__.js +5 -8
- 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__.js +10 -7
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +3 -0
- package/out/concepts/EntityProperty__.js +38 -0
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +34 -31
- package/out/concepts/Entity__.js +29 -12
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.js +1 -1
- 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 +4 -4
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +13 -7
- 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 +10 -0
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +3 -3
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +1 -0
- package/out/concepts/LogicItem__.js +14 -0
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -0
- package/out/concepts/Logic__.js +16 -11
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Module__.js +8 -8
- 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/Param__.d.ts +1 -0
- package/out/concepts/Param__.js +3 -0
- 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 +5 -5
- 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__.js +4 -4
- package/out/concepts/Process__.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 +6 -3
- package/out/concepts/Return__.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 +3 -6
- package/out/concepts/StructureProperty__.js +38 -32
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +3 -3
- 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__.js +10 -2
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +1 -1
- 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 +6 -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 +63 -60
- package/out/concepts/ViewElement__.js +123 -88
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +4 -0
- package/out/concepts/View__.js +26 -10
- 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 +39 -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 +0 -29
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/enums/KEYWORDS.js +1 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.js +98 -72
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/server/createUiTs.d.ts +1 -0
- package/out/server/createUiTs.js +15 -1
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/getLogics.js +27 -45
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +3 -3
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +1 -1
- package/out/server/getProcesses.js +2 -2
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.d.ts +1 -3
- package/out/server/naslServer.js +73 -57
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.d.ts +0 -3
- package/out/server/translator.js +16 -7
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.js +21 -12
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +3 -3
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +6 -10
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +2 -2
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.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/genUpdateBlock.js +5 -5
- 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/package.json +1 -1
- package/src/automate/engine/index.js +1 -1
- package/src/common/BaseNode.ts +46 -42
- package/src/concepts/App__.ts +54 -12
- package/src/concepts/Argument__.ts +3 -2
- package/src/concepts/BinaryExpression__.ts +8 -6
- package/src/concepts/BindAttribute__.ts +26 -32
- package/src/concepts/BindDirective__.ts +24 -9
- package/src/concepts/BindEvent__.ts +25 -29
- package/src/concepts/CallFunction__.ts +11 -6
- package/src/concepts/CallInterface__.ts +11 -1
- package/src/concepts/CallLogic__.ts +21 -40
- package/src/concepts/CallQueryComponent__.ts +6 -10
- 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 +9 -7
- package/src/concepts/EntityProperty__.ts +36 -0
- package/src/concepts/Entity__.ts +63 -50
- package/src/concepts/Enum__.ts +1 -1
- package/src/concepts/Event__.ts +1 -1
- package/src/concepts/ForEachStatement__.ts +8 -13
- package/src/concepts/Function__.ts +4 -4
- package/src/concepts/Identifier__.ts +15 -18
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/InterfaceParam__.ts +11 -0
- package/src/concepts/Interface__.ts +3 -3
- package/src/concepts/LogicItem__.ts +15 -0
- package/src/concepts/Logic__.ts +34 -50
- package/src/concepts/Module__.ts +8 -8
- package/src/concepts/Namespace__.ts +12 -12
- package/src/concepts/Param__.ts +3 -0
- package/src/concepts/ProcessComponent__.ts +2 -2
- package/src/concepts/ProcessElement__.ts +5 -5
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/Process__.ts +4 -4
- 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 +6 -3
- package/src/concepts/StringLiteral__.ts +2 -2
- package/src/concepts/StructureProperty__.ts +36 -29
- package/src/concepts/Structure__.ts +3 -3
- package/src/concepts/SwitchCase__.ts +3 -3
- package/src/concepts/SwitchStatement__.ts +1 -1
- package/src/concepts/TypeAnnotation__.ts +8 -2
- package/src/concepts/UnaryExpression__.ts +1 -1
- package/src/concepts/ValidationRule__.ts +24 -1
- package/src/concepts/Variable__.ts +6 -3
- package/src/concepts/ViewComponent__.ts +5 -5
- package/src/concepts/ViewElement__.ts +183 -147
- package/src/concepts/View__.ts +30 -32
- package/src/concepts/WhileStatement__.ts +1 -1
- package/src/concepts/basics/stdlib/index.ts +3 -1
- package/src/concepts/basics/stdlib/nasl.auth.ts +35 -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 +0 -29
- package/src/enums/KEYWORDS.ts +1 -0
- package/src/generator/genBundleFiles.ts +102 -74
- package/src/server/createUiTs.ts +18 -3
- package/src/server/getLogics.ts +29 -47
- package/src/server/getMemberIdentifier.ts +3 -3
- package/src/server/getProcesses.ts +2 -2
- package/src/server/naslServer.ts +84 -62
- package/src/server/translator.ts +18 -6
- package/src/service/storage/init.ts +20 -13
- package/src/templator/genCreateBlock.ts +3 -3
- package/src/templator/genCurdEditMultipleKeyBlock.ts +22 -23
- package/src/templator/genCurdMultipleKeyBlock.ts +2 -2
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genQueryComponent.ts +1 -0
- package/src/templator/genUpdateBlock.ts +5 -6
- package/src/templator/utils.ts +2 -1
|
@@ -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 {
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -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 {
|
|
@@ -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 {
|
|
@@ -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 {
|
|
@@ -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 {
|
package/src/concepts/Return__.ts
CHANGED
|
@@ -240,9 +240,9 @@ export class Return extends BaseNode {
|
|
|
240
240
|
code += ': ';
|
|
241
241
|
code += this.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
242
242
|
}
|
|
243
|
-
if (this.defaultValue) {
|
|
244
|
-
|
|
245
|
-
}
|
|
243
|
+
// if (this.defaultValue) {
|
|
244
|
+
// code += ` = ${this.defaultValue}`;
|
|
245
|
+
// }
|
|
246
246
|
return code;
|
|
247
247
|
}
|
|
248
248
|
|
|
@@ -323,6 +323,9 @@ export class Return extends BaseNode {
|
|
|
323
323
|
}
|
|
324
324
|
return null;
|
|
325
325
|
}
|
|
326
|
+
get isTreeLeaf() {
|
|
327
|
+
return !this.hasChildren;
|
|
328
|
+
}
|
|
326
329
|
getSelectRef() {
|
|
327
330
|
const { typeName, typeKind, typeNamespace } = this.typeAnnotation;
|
|
328
331
|
let completionChildren;
|
|
@@ -101,7 +101,7 @@ export class StringLiteral extends LogicItem {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
@withSourceMap()
|
|
104
|
-
toEmbeddedTS(state?: TranslatorState): string {
|
|
104
|
+
toEmbeddedTS(state?: TranslatorState, isRequired?: boolean): string {
|
|
105
105
|
let code = '';
|
|
106
106
|
if (this.value) {
|
|
107
107
|
if (!this.value.includes("'"))
|
|
@@ -113,7 +113,7 @@ export class StringLiteral extends LogicItem {
|
|
|
113
113
|
else
|
|
114
114
|
code += `'${this.value.replace(/'/g, "\\'")}'`;
|
|
115
115
|
} else {
|
|
116
|
-
code += `''`;
|
|
116
|
+
code += isRequired ? '__IDENTIFIER__' : `''`;
|
|
117
117
|
}
|
|
118
118
|
return code;
|
|
119
119
|
}
|
|
@@ -227,10 +227,41 @@ export class StructureProperty extends BaseNode {
|
|
|
227
227
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
228
228
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
229
229
|
//================================================================================
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
230
|
+
|
|
231
|
+
get hasChildren() {
|
|
232
|
+
const { typeKind } = this.typeAnnotation;
|
|
233
|
+
if (typeKind === 'reference' || typeKind === 'generic') {
|
|
234
|
+
return [{}];
|
|
235
|
+
}
|
|
236
|
+
return null;
|
|
237
|
+
}
|
|
238
|
+
get isTreeLeaf() {
|
|
239
|
+
return !this.hasChildren;
|
|
240
|
+
}
|
|
241
|
+
getSelectRef() {
|
|
242
|
+
const { typeName, typeKind, typeNamespace } = this.typeAnnotation;
|
|
243
|
+
let completionChildren;
|
|
244
|
+
if (typeKind === 'reference') {
|
|
245
|
+
if (typeNamespace === 'nasl.ui') {
|
|
246
|
+
const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
|
|
247
|
+
const properties = node.properties || [];
|
|
248
|
+
completionChildren = properties;
|
|
249
|
+
} else {
|
|
250
|
+
const node = getNodeByNodeCallee(this.app, typeNamespace + '.' + typeName);
|
|
251
|
+
const properties = node.properties || [];
|
|
252
|
+
completionChildren = properties;
|
|
253
|
+
}
|
|
254
|
+
} else if (typeKind === 'generic') {
|
|
255
|
+
if (typeNamespace === 'nasl.collection') {
|
|
256
|
+
const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
|
|
257
|
+
const properties = node.properties || [];
|
|
258
|
+
completionChildren = properties;
|
|
259
|
+
}
|
|
260
|
+
} else {
|
|
261
|
+
completionChildren = undefined;
|
|
262
|
+
}
|
|
263
|
+
return completionChildren;
|
|
264
|
+
}
|
|
234
265
|
|
|
235
266
|
@withSourceMap()
|
|
236
267
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
@@ -291,33 +322,9 @@ export class StructureProperty extends BaseNode {
|
|
|
291
322
|
* 是否可编辑
|
|
292
323
|
* */
|
|
293
324
|
get readonly() {
|
|
294
|
-
return !!this.module;
|
|
325
|
+
return !!this.module || (this.parentNode as Structure).origin === 'CallQueryComponent';
|
|
295
326
|
}
|
|
296
327
|
|
|
297
|
-
getSelectRef() {
|
|
298
|
-
const { typeName, typeKind, typeNamespace } = this.typeAnnotation;
|
|
299
|
-
let completionChildren;
|
|
300
|
-
if (typeKind === 'reference') {
|
|
301
|
-
if (typeNamespace === 'nasl.ui') {
|
|
302
|
-
const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
|
|
303
|
-
const properties = node.properties || [];
|
|
304
|
-
completionChildren = properties;
|
|
305
|
-
} else {
|
|
306
|
-
const node = getNodeByNodeCallee(this.app, typeNamespace + '.' + typeName);
|
|
307
|
-
const properties = node.properties || [];
|
|
308
|
-
completionChildren = properties;
|
|
309
|
-
}
|
|
310
|
-
} else if (typeKind === 'generic') {
|
|
311
|
-
if (typeNamespace === 'nasl.collection') {
|
|
312
|
-
const node = getNaslNodeByNodeCallee(typeNamespace, typeName);
|
|
313
|
-
const properties = node.properties || [];
|
|
314
|
-
completionChildren = properties;
|
|
315
|
-
}
|
|
316
|
-
} else {
|
|
317
|
-
completionChildren = undefined;
|
|
318
|
-
}
|
|
319
|
-
return completionChildren;
|
|
320
|
-
}
|
|
321
328
|
|
|
322
329
|
//================================================================================
|
|
323
330
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -169,7 +169,7 @@ export class Structure extends BaseNode {
|
|
|
169
169
|
name: options,
|
|
170
170
|
}, this, 'typeParams');
|
|
171
171
|
} else if (options instanceof TypeParam) {
|
|
172
|
-
options.
|
|
172
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
173
173
|
typeParam = options;
|
|
174
174
|
Object.assign(typeParam, relationOptions);
|
|
175
175
|
} else {
|
|
@@ -311,7 +311,7 @@ export class Structure extends BaseNode {
|
|
|
311
311
|
name: options,
|
|
312
312
|
}, this, 'properties');
|
|
313
313
|
} else if (options instanceof StructureProperty) {
|
|
314
|
-
options.
|
|
314
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
315
315
|
property = options;
|
|
316
316
|
Object.assign(property, relationOptions);
|
|
317
317
|
} else {
|
|
@@ -518,7 +518,7 @@ export class Structure extends BaseNode {
|
|
|
518
518
|
* 是否可编辑
|
|
519
519
|
* */
|
|
520
520
|
get readonly() {
|
|
521
|
-
return !!this.module;
|
|
521
|
+
return !!this.module || this.origin === 'CallQueryComponent';
|
|
522
522
|
}
|
|
523
523
|
/* 删除空数据模块 */
|
|
524
524
|
deleteLogincAndModule() {
|
|
@@ -89,7 +89,7 @@ export class SwitchCase extends LogicItem {
|
|
|
89
89
|
const relationOptions = { parentNode: this, parentKey: 'consequent' };
|
|
90
90
|
let logicItem: LogicItem;
|
|
91
91
|
if (options instanceof LogicItem) {
|
|
92
|
-
options.
|
|
92
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
93
93
|
logicItem = options;
|
|
94
94
|
Object.assign(logicItem, relationOptions);
|
|
95
95
|
} else {
|
|
@@ -249,7 +249,7 @@ export class SwitchCase extends LogicItem {
|
|
|
249
249
|
tabSize: 0,
|
|
250
250
|
})) : '';
|
|
251
251
|
|
|
252
|
-
code += ')
|
|
252
|
+
code += ') {\n';
|
|
253
253
|
|
|
254
254
|
if (Array.isArray(this.consequent)) {
|
|
255
255
|
this.consequent.forEach((logicItem) => {
|
|
@@ -277,7 +277,7 @@ export class SwitchCase extends LogicItem {
|
|
|
277
277
|
|
|
278
278
|
@withSourceMap()
|
|
279
279
|
toEmbeddedTS(state?: TranslatorState, isLast?: boolean): string {
|
|
280
|
-
let code = '';
|
|
280
|
+
let code = '\n';
|
|
281
281
|
if (!isLast) {
|
|
282
282
|
code += 'if (nasl.core.ensureBoolean(';
|
|
283
283
|
code += this.test ? this.test.toEmbeddedTS(shiftState(state, code, {
|
|
@@ -72,7 +72,7 @@ export class SwitchStatement extends LogicItem {
|
|
|
72
72
|
const relationOptions = { parentNode: this, parentKey: 'cases' };
|
|
73
73
|
let switchCase: SwitchCase;
|
|
74
74
|
if (options instanceof SwitchCase) {
|
|
75
|
-
options.
|
|
75
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
76
76
|
switchCase = options;
|
|
77
77
|
Object.assign(switchCase, relationOptions);
|
|
78
78
|
} else {
|
|
@@ -116,7 +116,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
116
116
|
const relationOptions = { parentNode: this, parentKey: 'typeArguments' };
|
|
117
117
|
let typeAnnotation: TypeAnnotation;
|
|
118
118
|
if (options instanceof TypeAnnotation) {
|
|
119
|
-
options.
|
|
119
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
120
120
|
typeAnnotation = options;
|
|
121
121
|
Object.assign(typeAnnotation, relationOptions);
|
|
122
122
|
} else {
|
|
@@ -330,7 +330,13 @@ export class TypeAnnotation extends BaseNode {
|
|
|
330
330
|
let code = `${this.tsCalleeNamespace}.${this.typeName}<`;
|
|
331
331
|
return (code += `${(this.typeArguments || []).map((arg) => arg.toEmbeddedTS(shiftState(state, code, { inline: true })))}>`);
|
|
332
332
|
} else {
|
|
333
|
-
|
|
333
|
+
if (this.tsCalleeNamespace && this.typeName) {
|
|
334
|
+
return `${this.tsCalleeNamespace}.${this.typeName}`;
|
|
335
|
+
} else if (this.typeName) {
|
|
336
|
+
return this.typeName;
|
|
337
|
+
} else {
|
|
338
|
+
return '__IDENTIFIER__';
|
|
339
|
+
}
|
|
334
340
|
}
|
|
335
341
|
}
|
|
336
342
|
|
|
@@ -92,7 +92,7 @@ export class ValidationRule extends LogicItem {
|
|
|
92
92
|
const relationOptions = { parentNode: this, parentKey: 'arguments' };
|
|
93
93
|
let argument: Argument;
|
|
94
94
|
if (options instanceof Argument) {
|
|
95
|
-
options.
|
|
95
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
96
96
|
argument = options;
|
|
97
97
|
Object.assign(argument, relationOptions);
|
|
98
98
|
} else {
|
|
@@ -258,6 +258,29 @@ export class ValidationRule extends LogicItem {
|
|
|
258
258
|
return code;
|
|
259
259
|
}
|
|
260
260
|
|
|
261
|
+
@withSourceMap()
|
|
262
|
+
toEmbeddedTS(state?: TranslatorState): string {
|
|
263
|
+
let code = '';
|
|
264
|
+
if (this.calleeName) {
|
|
265
|
+
if (this.arguments.length) {
|
|
266
|
+
code += this.calleeKey;
|
|
267
|
+
code += '(';
|
|
268
|
+
this.arguments.forEach((arg, index) => {
|
|
269
|
+
code += arg.toEmbeddedTS(shiftState(state, code));
|
|
270
|
+
if (index !== this.arguments.length - 1)
|
|
271
|
+
code += ', ';
|
|
272
|
+
});
|
|
273
|
+
code += ')';
|
|
274
|
+
} else {
|
|
275
|
+
// 没有入参数的不需要校验
|
|
276
|
+
return 'null';
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
code += '__IDENTIFIER__';
|
|
280
|
+
}
|
|
281
|
+
return code;
|
|
282
|
+
}
|
|
283
|
+
|
|
261
284
|
get calleeKey(): string {
|
|
262
285
|
return `${this.calleeNamespace}.${this.calleeName}`;
|
|
263
286
|
}
|
|
@@ -240,9 +240,9 @@ export class Variable extends BaseNode {
|
|
|
240
240
|
code += ': ';
|
|
241
241
|
code += this.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
242
242
|
}
|
|
243
|
-
if (this.defaultValue) {
|
|
244
|
-
|
|
245
|
-
}
|
|
243
|
+
// if (this.defaultValue) {
|
|
244
|
+
// code += ` = ${this.defaultValue}`;
|
|
245
|
+
// }
|
|
246
246
|
return code;
|
|
247
247
|
}
|
|
248
248
|
|
|
@@ -319,6 +319,9 @@ export class Variable extends BaseNode {
|
|
|
319
319
|
}
|
|
320
320
|
return null;
|
|
321
321
|
}
|
|
322
|
+
get isTreeLeaf() {
|
|
323
|
+
return !this.hasChildren;
|
|
324
|
+
}
|
|
322
325
|
getSelectRef() {
|
|
323
326
|
const { typeName, typeKind, typeNamespace } = this.typeAnnotation;
|
|
324
327
|
let completionChildren;
|
|
@@ -164,7 +164,7 @@ export class ViewComponent extends BaseNode {
|
|
|
164
164
|
name: options,
|
|
165
165
|
}, this, 'attrs');
|
|
166
166
|
} else if (options instanceof Attribute) {
|
|
167
|
-
options.
|
|
167
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
168
168
|
attribute = options;
|
|
169
169
|
Object.assign(attribute, relationOptions);
|
|
170
170
|
} else {
|
|
@@ -306,7 +306,7 @@ export class ViewComponent extends BaseNode {
|
|
|
306
306
|
name: options,
|
|
307
307
|
}, this, 'events');
|
|
308
308
|
} else if (options instanceof Event) {
|
|
309
|
-
options.
|
|
309
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
310
310
|
event = options;
|
|
311
311
|
Object.assign(event, relationOptions);
|
|
312
312
|
} else {
|
|
@@ -448,7 +448,7 @@ export class ViewComponent extends BaseNode {
|
|
|
448
448
|
name: options,
|
|
449
449
|
}, this, 'slots');
|
|
450
450
|
} else if (options instanceof Slot) {
|
|
451
|
-
options.
|
|
451
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
452
452
|
slot = options;
|
|
453
453
|
Object.assign(slot, relationOptions);
|
|
454
454
|
} else {
|
|
@@ -590,7 +590,7 @@ export class ViewComponent extends BaseNode {
|
|
|
590
590
|
name: options,
|
|
591
591
|
}, this, 'methods');
|
|
592
592
|
} else if (options instanceof Logic) {
|
|
593
|
-
options.
|
|
593
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
594
594
|
logic = options;
|
|
595
595
|
Object.assign(logic, relationOptions);
|
|
596
596
|
} else {
|
|
@@ -732,7 +732,7 @@ export class ViewComponent extends BaseNode {
|
|
|
732
732
|
name: options,
|
|
733
733
|
}, this, 'children');
|
|
734
734
|
} else if (options instanceof ViewComponent) {
|
|
735
|
-
options.
|
|
735
|
+
options.ensureDelete(); // 同一实例不支持多处存在
|
|
736
736
|
viewComponent = options;
|
|
737
737
|
Object.assign(viewComponent, relationOptions);
|
|
738
738
|
} else {
|