@lcap/nasl 1.0.1 → 2.12.0-beta.1
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 -0
- package/out/automate/engine/index.js +34 -12
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/operators.d.ts +10 -2
- package/out/automate/engine/operators.js +105 -7
- package/out/automate/engine/operators.js.map +1 -1
- package/out/automate/engine/uniqueName.d.ts +8 -2
- package/out/automate/engine/uniqueName.js +72 -4
- package/out/automate/engine/uniqueName.js.map +1 -1
- package/out/automate/engine/utils.d.ts +1 -0
- package/out/automate/engine/utils.js +108 -67
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/process.d.ts +9 -0
- package/out/automate/template/process.js +10976 -0
- package/out/automate/template/process.js.map +1 -0
- package/out/bak/translator.js +1 -0
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +6 -1
- package/out/common/BaseNode.js +37 -6
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +52 -49
- package/out/concepts/App__.js +89 -53
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +11 -0
- package/out/concepts/Assignee__.js +34 -0
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +2 -2
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +10 -3
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +15 -6
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +4 -0
- package/out/concepts/BooleanLiteral__.js +11 -0
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js +9 -4
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.js +48 -30
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +34 -4
- package/out/concepts/CallQueryComponent__.js +340 -95
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +1 -0
- package/out/concepts/ConfigGroup__.js +7 -0
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +1 -0
- package/out/concepts/ConfigProperty__.js +3 -0
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +1 -0
- package/out/concepts/Configuration__.js +3 -0
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js +6 -6
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +143 -0
- package/out/concepts/DataSource__.js +318 -0
- package/out/concepts/DataSource__.js.map +1 -0
- package/out/concepts/Destination__.js +22 -8
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +2 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +5 -0
- package/out/concepts/EntityIndex__.js +10 -2
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +9 -0
- package/out/concepts/EntityProperty__.js +22 -7
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +6 -0
- package/out/concepts/Entity__.js +27 -11
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +1 -0
- package/out/concepts/Enum__.js +14 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +2 -2
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.d.ts +18 -0
- package/out/concepts/Function__.js +96 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +5 -14
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +8 -8
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +9 -4
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +19 -12
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +3 -5
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/Logic__.js +44 -44
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Module__.d.ts +116 -194
- package/out/concepts/Module__.js +31 -114
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +0 -86
- package/out/concepts/Namespace__.js +1 -108
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/Param__.d.ts +3 -2
- package/out/concepts/Param__.js +15 -8
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +38 -12
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Process__.d.ts +1 -1
- package/out/concepts/Process__.js +17 -10
- 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/QueryFieldExpression__.d.ts +1 -0
- package/out/concepts/QueryFieldExpression__.js +11 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +4 -0
- package/out/concepts/QueryFromExpression__.js +13 -2
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +3 -0
- package/out/concepts/QueryGroupByExpression__.js +20 -0
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +4 -0
- package/out/concepts/QueryJoinExpression__.js +14 -3
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +16 -11
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +10 -3
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +14 -0
- package/out/concepts/SqlQueryComponent__.js +48 -5
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -9
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +11 -10
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +19 -12
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +1 -1
- package/out/concepts/SwitchCase__.js +23 -25
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +1 -6
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +8 -0
- package/out/concepts/TypeAnnotation__.js +53 -3
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -1
- package/out/concepts/Variable__.js +16 -11
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.js +25 -20
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -3
- package/out/concepts/View__.js +42 -36
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +4 -4
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +20 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.interface.d.ts +2 -0
- package/out/concepts/basics/stdlib/nasl.interface.js +4 -4
- package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.d.ts +4 -0
- package/out/concepts/basics/stdlib/nasl.process.js +410 -0
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +1 -11
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +270 -8
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +2 -0
- package/out/concepts/basics/types/index.js +6 -1
- package/out/concepts/basics/types/index.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 +0 -7
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +3 -1
- package/out/generator/genBundleFiles.js +23 -5
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +1 -0
- package/out/generator/genMetaData.js +20 -12
- package/out/generator/genMetaData.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.js +2 -1
- package/out/index.js.map +1 -1
- package/out/manager/diagnostic.d.ts +1 -1
- package/out/server/createUiTs.js +1 -0
- package/out/server/createUiTs.js.map +1 -1
- package/out/{test/integration/connect-file copy.d.ts → server/extendBaseNode.d.ts} +0 -0
- package/out/server/extendBaseNode.js +323 -0
- package/out/server/extendBaseNode.js.map +1 -0
- package/out/server/getLogics.js +49 -2
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +52 -2
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +8 -2
- package/out/server/getProcesses.js +228 -20
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getScope.d.ts +1 -0
- package/out/server/getScope.js +4 -0
- package/out/server/getScope.js.map +1 -1
- package/out/server/index.d.ts +1 -0
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +8 -5
- package/out/server/naslServer.js +314 -383
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.js +10 -1
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.d.ts +1 -1
- package/out/server/translator.js +40 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -0
- package/out/service/storage/init.js +113 -94
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +34 -24
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +28 -18
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +45 -29
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +15 -13
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genEnumSelectBlock.js +1 -1
- package/out/templator/genEnumSelectBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +29 -24
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +7 -5
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +31 -29
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.js +13 -22
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +31 -21
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +35 -25
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +5 -3
- package/out/templator/utils.js +2 -1
- package/out/templator/utils.js.map +1 -1
- package/out/test/integration/connect-file.js +6 -6
- package/out/test/integration/connect-file.js.map +1 -1
- package/out/translator/index.js +1 -1
- package/out/translator/index.js.map +1 -1
- package/out/utils/index.d.ts +5 -0
- package/out/utils/index.js +50 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +1 -2
- package/src/automate/engine/index.js +33 -8
- package/src/automate/engine/operators.js +114 -17
- package/src/automate/engine/uniqueName.js +77 -9
- package/src/automate/engine/utils.js +110 -69
- package/src/automate/template/process.js +10999 -0
- package/src/bak/translator.js +1 -0
- package/src/common/BaseNode.ts +35 -7
- package/src/concepts/App__.ts +132 -131
- package/src/concepts/Assignee__.ts +30 -0
- package/src/concepts/BindAttribute__.ts +2 -2
- package/src/concepts/BindDirective__.ts +9 -7
- package/src/concepts/BindEvent__.ts +14 -6
- package/src/concepts/BooleanLiteral__.ts +12 -0
- package/src/concepts/CallFunction__.ts +7 -4
- package/src/concepts/CallLogic__.ts +47 -32
- package/src/concepts/CallQueryComponent__.ts +352 -101
- package/src/concepts/Comment__.ts +1 -1
- package/src/concepts/ConfigGroup__.ts +3 -1
- package/src/concepts/ConfigProperty__.ts +4 -0
- package/src/concepts/Configuration__.ts +3 -0
- package/src/concepts/Constant__.ts +6 -6
- package/src/concepts/DataSource__.ts +391 -0
- package/src/concepts/Destination__.ts +22 -8
- package/src/concepts/End__.ts +2 -2
- package/src/concepts/EntityIndex__.ts +11 -2
- package/src/concepts/EntityProperty__.ts +23 -7
- package/src/concepts/Entity__.ts +38 -14
- package/src/concepts/Enum__.ts +15 -4
- package/src/concepts/ForEachStatement__.ts +2 -2
- package/src/concepts/Function__.ts +95 -1
- package/src/concepts/Identifier__.ts +5 -14
- package/src/concepts/IfStatement__.ts +9 -9
- package/src/concepts/InterfaceParam__.ts +9 -4
- package/src/concepts/Interface__.ts +20 -12
- package/src/concepts/JSBlock__.ts +3 -12
- package/src/concepts/Logic__.ts +45 -79
- package/src/concepts/Module__.ts +141 -342
- package/src/concepts/Namespace__.ts +1 -204
- package/src/concepts/Param__.ts +17 -9
- package/src/concepts/ProcessElement__.ts +42 -15
- package/src/concepts/Process__.ts +18 -12
- package/src/concepts/QueryAggregateExpression__.ts +1 -1
- package/src/concepts/QueryFieldExpression__.ts +13 -1
- package/src/concepts/QueryFromExpression__.ts +13 -2
- package/src/concepts/QueryGroupByExpression__.ts +23 -0
- package/src/concepts/QueryJoinExpression__.ts +14 -3
- package/src/concepts/Return__.ts +16 -11
- package/src/concepts/Role__.ts +10 -4
- package/src/concepts/SqlQueryComponent__.ts +47 -11
- package/src/concepts/StringLiteral__.ts +2 -9
- package/src/concepts/StructureProperty__.ts +11 -14
- package/src/concepts/Structure__.ts +19 -11
- package/src/concepts/SwitchCase__.ts +23 -27
- package/src/concepts/SwitchStatement__.ts +1 -5
- package/src/concepts/TypeAnnotation__.ts +52 -3
- package/src/concepts/Variable__.ts +16 -11
- package/src/concepts/ViewElement__.ts +26 -39
- package/src/concepts/View__.ts +45 -38
- package/src/concepts/WhileStatement__.ts +4 -4
- package/src/concepts/basics/stdlib/nasl.auth.ts +20 -0
- package/src/concepts/basics/stdlib/nasl.configuration.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.interface.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.process.ts +406 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +1 -11
- package/src/concepts/basics/stdlib/nasl.util.ts +271 -8
- package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
- package/src/concepts/basics/types/index.ts +2 -0
- package/src/concepts/index__.ts +1 -0
- package/src/enums/KEYWORDS.ts +0 -7
- package/src/generator/genBundleFiles.ts +28 -7
- package/src/generator/genMetaData.ts +22 -13
- package/src/index.ts +1 -1
- package/src/manager/diagnostic.ts +1 -1
- package/src/server/createUiTs.ts +1 -0
- package/src/server/extendBaseNode.ts +318 -0
- package/src/server/getLogics.ts +51 -5
- package/src/server/getMemberIdentifier.ts +53 -2
- package/src/server/getProcesses.ts +238 -21
- package/src/server/getScope.ts +5 -0
- package/src/server/index.ts +1 -0
- package/src/server/naslServer.ts +322 -380
- package/src/server/process2LogicNamespace.ts +29 -19
- package/src/server/translator.ts +42 -2
- package/src/service/creator/errHandles.js +6 -0
- package/src/service/storage/init.ts +115 -97
- package/src/templator/genCreateBlock.ts +35 -26
- package/src/templator/genCurdEditMultipleKeyBlock.ts +29 -21
- package/src/templator/genCurdMultipleKeyBlock.ts +46 -31
- package/src/templator/genEditTableBlock.ts +17 -14
- package/src/templator/genEnumSelectBlock.ts +1 -1
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genGridViewBlock.ts +30 -25
- package/src/templator/genListViewBlock.ts +10 -7
- package/src/templator/genQueryComponent.ts +34 -30
- package/src/templator/genSelectBlock.ts +14 -23
- package/src/templator/genTableBlock.ts +32 -23
- package/src/templator/genUpdateBlock.ts +36 -26
- package/src/templator/utils.ts +5 -2
- package/src/test/integration/connect-file.ts +6 -6
- package/src/translator/index.ts +1 -1
- package/src/utils/index.ts +51 -0
- package/out/concepts/basics/stdlib/nasl.browser copy.d.ts +0 -3
- package/out/concepts/basics/stdlib/nasl.browser copy.js +0 -70
- package/out/concepts/basics/stdlib/nasl.browser copy.js.map +0 -1
- package/out/terms/LEVEL_NAME_MAP.d.ts +0 -26
- package/out/terms/LEVEL_NAME_MAP.js +0 -30
- package/out/terms/LEVEL_NAME_MAP.js.map +0 -1
- package/out/test/integration/connect-file copy.js +0 -50
- package/out/test/integration/connect-file copy.js.map +0 -1
- package/out/test/integration/node-nasl-server.d.ts +0 -1
- package/out/test/integration/node-nasl-server.js +0 -41
- package/out/test/integration/node-nasl-server.js.map +0 -1
|
@@ -262,8 +262,6 @@ export class ViewElement extends BaseNode {
|
|
|
262
262
|
super.subConstructor(source);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
|
|
266
|
-
|
|
267
265
|
/**
|
|
268
266
|
* 从父级删除该节点
|
|
269
267
|
* @internal
|
|
@@ -300,7 +298,7 @@ export class ViewElement extends BaseNode {
|
|
|
300
298
|
});
|
|
301
299
|
}
|
|
302
300
|
|
|
303
|
-
|
|
301
|
+
getBindAttributeExistingNames(excludedList: Array<BindAttribute> = []) {
|
|
304
302
|
const excludedSet = new Set(excludedList);
|
|
305
303
|
return (this.bindAttrs || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
306
304
|
}
|
|
@@ -441,7 +439,6 @@ export class ViewElement extends BaseNode {
|
|
|
441
439
|
return node;
|
|
442
440
|
}
|
|
443
441
|
|
|
444
|
-
|
|
445
442
|
getBindEventExistingNames(excludedList: Array<BindEvent> = []) {
|
|
446
443
|
const excludedSet = new Set(excludedList);
|
|
447
444
|
return (this.bindEvents || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -583,7 +580,6 @@ export class ViewElement extends BaseNode {
|
|
|
583
580
|
return node;
|
|
584
581
|
}
|
|
585
582
|
|
|
586
|
-
|
|
587
583
|
getBindDirectiveExistingNames(excludedList: Array<BindDirective> = []) {
|
|
588
584
|
const excludedSet = new Set(excludedList);
|
|
589
585
|
return (this.bindDirectives || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -725,11 +721,6 @@ export class ViewElement extends BaseNode {
|
|
|
725
721
|
return node;
|
|
726
722
|
}
|
|
727
723
|
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
724
|
/**
|
|
734
725
|
* 插入页面元素
|
|
735
726
|
* @internal
|
|
@@ -863,9 +854,6 @@ export class ViewElement extends BaseNode {
|
|
|
863
854
|
return node;
|
|
864
855
|
}
|
|
865
856
|
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
857
|
/**
|
|
870
858
|
* 删除元素绑定属性
|
|
871
859
|
* @param name 元素绑定属性名称
|
|
@@ -914,8 +902,6 @@ export class ViewElement extends BaseNode {
|
|
|
914
902
|
return params;
|
|
915
903
|
}
|
|
916
904
|
|
|
917
|
-
|
|
918
|
-
|
|
919
905
|
/**
|
|
920
906
|
* 删除元素绑定事件
|
|
921
907
|
* @param name 元素绑定事件名称
|
|
@@ -964,8 +950,6 @@ export class ViewElement extends BaseNode {
|
|
|
964
950
|
return params;
|
|
965
951
|
}
|
|
966
952
|
|
|
967
|
-
|
|
968
|
-
|
|
969
953
|
/**
|
|
970
954
|
* 删除元素指令
|
|
971
955
|
* @param name 元素指令名称
|
|
@@ -1014,8 +998,6 @@ export class ViewElement extends BaseNode {
|
|
|
1014
998
|
return params;
|
|
1015
999
|
}
|
|
1016
1000
|
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
1001
|
/**
|
|
1020
1002
|
* 删除页面元素
|
|
1021
1003
|
* @param name 页面元素名称
|
|
@@ -1120,7 +1102,7 @@ export class ViewElement extends BaseNode {
|
|
|
1120
1102
|
|
|
1121
1103
|
haveScope(node: ViewElement): boolean {
|
|
1122
1104
|
// uGallery 没有子集不需要scope
|
|
1123
|
-
const dataSourcePcList = ['uTableView', 'uListView', 'uGridView', 'uCalendarView', 'uListComponents', 'uSelect'];
|
|
1105
|
+
const dataSourcePcList = ['uTableView', 'uListView', 'uGridView', 'uCalendarView', 'uListComponents', 'uSelect', 'devopsDragTable', 'uTreeViewNew', 'uTreeSelectNew'];
|
|
1124
1106
|
const dataSourceH5List = ['vanRadioGroup', 'vanCheckboxGroup', 'vanListView', 'vanGridView', 'vanForComponents', 'lcapEchartsLine', 'lcapEchartsBar', 'lcapEchartsPie'];
|
|
1125
1107
|
const dataSourceList = [...dataSourcePcList, ...dataSourceH5List];
|
|
1126
1108
|
return dataSourceList.includes(node.toHump(node.tag));
|
|
@@ -1132,7 +1114,7 @@ export class ViewElement extends BaseNode {
|
|
|
1132
1114
|
let code = '';
|
|
1133
1115
|
// formItem的单独处理
|
|
1134
1116
|
if (this.tag === 'u-form-item') {
|
|
1135
|
-
code = indent(state
|
|
1117
|
+
code = indent((state?.tabSize || 0)) + `${this.name}: nasl.ui.${this.toHump(this.tag)}`;
|
|
1136
1118
|
if (Array.isArray(this.children) && this.children.length) {
|
|
1137
1119
|
const tag = this.children[0].tag;
|
|
1138
1120
|
if (tag === 'u-input') {
|
|
@@ -1185,9 +1167,9 @@ export class ViewElement extends BaseNode {
|
|
|
1185
1167
|
}
|
|
1186
1168
|
}
|
|
1187
1169
|
}
|
|
1188
|
-
code += indent(state
|
|
1170
|
+
code += indent((state?.tabSize || 0)) + `${this.name}: nasl.ui.${this.toHump(this.tag)}<${genericType}>;\n`;
|
|
1189
1171
|
} else {
|
|
1190
|
-
code = indent(state
|
|
1172
|
+
code = indent((state?.tabSize || 0)) + `${this.name}: nasl.ui.${this.toHump(this.tag)}<any>;\n`;
|
|
1191
1173
|
}
|
|
1192
1174
|
if (Array.isArray(this.children)) {
|
|
1193
1175
|
this.children.forEach((element) => {
|
|
@@ -1217,14 +1199,14 @@ export class ViewElement extends BaseNode {
|
|
|
1217
1199
|
}
|
|
1218
1200
|
// 角色
|
|
1219
1201
|
if (Array.isArray(this.bindRoles) && this.bindRoles.length) {
|
|
1220
|
-
code += indent(state
|
|
1202
|
+
code += indent((state?.tabSize || 0) + 2);
|
|
1221
1203
|
code += 'roles = [\n';
|
|
1222
1204
|
this.bindRoles.forEach((role) => {
|
|
1223
|
-
code += indent(state
|
|
1205
|
+
code += indent((state?.tabSize || 0) + 3);
|
|
1224
1206
|
code += `${this.app.getNamespace()}.roles.${chineseTsName(role)}.${chineseTsName(role)},`;
|
|
1225
1207
|
code += '\n';
|
|
1226
1208
|
});
|
|
1227
|
-
code += indent(state
|
|
1209
|
+
code += indent((state?.tabSize || 0) + 2);
|
|
1228
1210
|
code += '],\n';
|
|
1229
1211
|
}
|
|
1230
1212
|
// 绑定属性
|
|
@@ -1233,7 +1215,7 @@ export class ViewElement extends BaseNode {
|
|
|
1233
1215
|
// 跳转页面
|
|
1234
1216
|
if (attr.destination) {
|
|
1235
1217
|
code += attr.destination.toEmbeddedTS(shiftState(state, code, {
|
|
1236
|
-
tabSize: state
|
|
1218
|
+
tabSize: (state?.tabSize || 0),
|
|
1237
1219
|
}));
|
|
1238
1220
|
}
|
|
1239
1221
|
});
|
|
@@ -1244,7 +1226,7 @@ export class ViewElement extends BaseNode {
|
|
|
1244
1226
|
if (Array.isArray(this.bindEvents)) {
|
|
1245
1227
|
this.bindEvents.forEach((event) => {
|
|
1246
1228
|
code += event.toEmbeddedTS(shiftState(state, code, {
|
|
1247
|
-
tabSize: state
|
|
1229
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
1248
1230
|
}));
|
|
1249
1231
|
code += '\n';
|
|
1250
1232
|
});
|
|
@@ -1252,7 +1234,7 @@ export class ViewElement extends BaseNode {
|
|
|
1252
1234
|
|
|
1253
1235
|
// 子元素
|
|
1254
1236
|
if (Array.isArray(this.children)) {
|
|
1255
|
-
code += indent(state
|
|
1237
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
1256
1238
|
|
|
1257
1239
|
if (Array.isArray(this.bindAttrs)) {
|
|
1258
1240
|
code += `bindAttr: () => [\n`;
|
|
@@ -1260,7 +1242,7 @@ export class ViewElement extends BaseNode {
|
|
|
1260
1242
|
if (attr.expression) {
|
|
1261
1243
|
code
|
|
1262
1244
|
+= attr.expression.toEmbeddedTS(shiftState(state, code, {
|
|
1263
|
-
tabSize: state
|
|
1245
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
1264
1246
|
})) + ',\n';
|
|
1265
1247
|
}
|
|
1266
1248
|
if (Array.isArray(attr.rules) && attr.rules.length) {
|
|
@@ -1273,11 +1255,11 @@ export class ViewElement extends BaseNode {
|
|
|
1273
1255
|
if (directive.expression) {
|
|
1274
1256
|
code
|
|
1275
1257
|
+= directive.expression.toEmbeddedTS(shiftState(state, code, {
|
|
1276
|
-
tabSize: state
|
|
1258
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
1277
1259
|
})) + ',\n';
|
|
1278
1260
|
}
|
|
1279
1261
|
});
|
|
1280
|
-
code += indent(state
|
|
1262
|
+
code += indent((state?.tabSize || 0) + 2) + '],\n';
|
|
1281
1263
|
}
|
|
1282
1264
|
|
|
1283
1265
|
let levelIndex = parentLevel || 0;
|
|
@@ -1290,15 +1272,15 @@ export class ViewElement extends BaseNode {
|
|
|
1290
1272
|
|
|
1291
1273
|
this.children.forEach((element) => {
|
|
1292
1274
|
code += element.toEmbeddedTS(shiftState(state, code, {
|
|
1293
|
-
tabSize: state
|
|
1275
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
1294
1276
|
}), levelIndex);
|
|
1295
1277
|
code += '\n';
|
|
1296
1278
|
});
|
|
1297
|
-
code += indent(state
|
|
1279
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
1298
1280
|
code += ']\n';
|
|
1299
1281
|
}
|
|
1300
1282
|
|
|
1301
|
-
code += indent(state
|
|
1283
|
+
code += indent((state?.tabSize || 0)) + '}),\n';
|
|
1302
1284
|
|
|
1303
1285
|
return code;
|
|
1304
1286
|
}
|
|
@@ -1550,7 +1532,7 @@ export class ViewElement extends BaseNode {
|
|
|
1550
1532
|
tag: tagName,
|
|
1551
1533
|
name: view.getViewElementUniqueName(`${baseName}1`),
|
|
1552
1534
|
});
|
|
1553
|
-
const value = astNode.text
|
|
1535
|
+
const value = astNode.text?.match(/{{(.*?)}}/)[1].trim();
|
|
1554
1536
|
const expression = <any> this._parseExpression(value);
|
|
1555
1537
|
element.addBindAttribute(new BindAttribute({
|
|
1556
1538
|
type: 'dynamic',
|
|
@@ -1568,7 +1550,7 @@ export class ViewElement extends BaseNode {
|
|
|
1568
1550
|
element.addBindAttribute(new BindAttribute({
|
|
1569
1551
|
name: 'text',
|
|
1570
1552
|
type: 'string',
|
|
1571
|
-
value: astNode.text,
|
|
1553
|
+
value: astNode.text?.trim(),
|
|
1572
1554
|
}));
|
|
1573
1555
|
}
|
|
1574
1556
|
return element;
|
|
@@ -1615,6 +1597,11 @@ export class ViewElement extends BaseNode {
|
|
|
1615
1597
|
const apiOfAttr = api && api.attrs && api.attrs.find((_attr) => _attr.name === attr.name);
|
|
1616
1598
|
if (apiOfAttr && apiOfAttr['designer-value'] !== undefined) {
|
|
1617
1599
|
let designerValue = apiOfAttr['designer-value'];
|
|
1600
|
+
//对流程模板拖拽进行特判
|
|
1601
|
+
element.bindAttrs.forEach((property) => {
|
|
1602
|
+
if (property.name === 'repeat' && property.value === '1')
|
|
1603
|
+
designerValue = '[{}, {}]';
|
|
1604
|
+
});
|
|
1618
1605
|
if (typeof designerValue === 'string') {
|
|
1619
1606
|
designerValue = designerValue.replace(/"/g, "'");
|
|
1620
1607
|
}
|
|
@@ -1673,7 +1660,7 @@ export class ViewElement extends BaseNode {
|
|
|
1673
1660
|
if (hasAuto)
|
|
1674
1661
|
addEmpty = false;
|
|
1675
1662
|
}
|
|
1676
|
-
if (['u-select', 'u-dropdown', 'u-panel'].includes(el.tag)) {
|
|
1663
|
+
if (['u-select', 'u-dropdown', 'u-panel', 'u-toc', 'u-toc-item', 'u-tree-view-new', 'u-tree-view-node-new', 'u-tree-select', 'u-tree-select-new', 'u-anchor'].includes(el.tag)) {
|
|
1677
1664
|
addEmpty = false;
|
|
1678
1665
|
}
|
|
1679
1666
|
const background = (emptySlot && emptySlot['empty-background']) || (hasSupport ? 'add-sub' : '');
|
|
@@ -1801,7 +1788,7 @@ export class ViewElement extends BaseNode {
|
|
|
1801
1788
|
//================================================================================
|
|
1802
1789
|
}
|
|
1803
1790
|
|
|
1804
|
-
classMap
|
|
1791
|
+
classMap.ViewElement = ViewElement;
|
|
1805
1792
|
export default ViewElement;
|
|
1806
1793
|
//================================================================================
|
|
1807
1794
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
package/src/concepts/View__.ts
CHANGED
|
@@ -234,7 +234,7 @@ export class View extends BaseNode {
|
|
|
234
234
|
});
|
|
235
235
|
}
|
|
236
236
|
|
|
237
|
-
|
|
237
|
+
|
|
238
238
|
|
|
239
239
|
/**
|
|
240
240
|
* 插入页面元素
|
|
@@ -370,12 +370,8 @@ export class View extends BaseNode {
|
|
|
370
370
|
}
|
|
371
371
|
|
|
372
372
|
|
|
373
|
-
getParamExistingNames(excludedList: Array<Param> = []) {
|
|
374
|
-
const excludedSet = new Set(excludedList);
|
|
375
|
-
return (this.params || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
376
|
-
}
|
|
377
373
|
getParamUniqueName(name = 'param1') {
|
|
378
|
-
return utils.unique(name, this.
|
|
374
|
+
return utils.unique(name, this.getVarExistingNames(), undefined, false);
|
|
379
375
|
}
|
|
380
376
|
|
|
381
377
|
/**
|
|
@@ -512,12 +508,8 @@ export class View extends BaseNode {
|
|
|
512
508
|
}
|
|
513
509
|
|
|
514
510
|
|
|
515
|
-
getVariableExistingNames(excludedList: Array<Variable> = []) {
|
|
516
|
-
const excludedSet = new Set(excludedList);
|
|
517
|
-
return (this.variables || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
518
|
-
}
|
|
519
511
|
getVariableUniqueName(name = 'variable1') {
|
|
520
|
-
return utils.unique(name, this.
|
|
512
|
+
return utils.unique(name, this.getVarExistingNames(), undefined, false);
|
|
521
513
|
}
|
|
522
514
|
|
|
523
515
|
/**
|
|
@@ -654,10 +646,6 @@ export class View extends BaseNode {
|
|
|
654
646
|
}
|
|
655
647
|
|
|
656
648
|
|
|
657
|
-
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
658
|
-
const excludedSet = new Set(excludedList);
|
|
659
|
-
return (this.logics || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
660
|
-
}
|
|
661
649
|
getLogicUniqueName(name = 'logic1') {
|
|
662
650
|
return utils.unique(name, this.getLogicExistingNames(), undefined, false);
|
|
663
651
|
}
|
|
@@ -1082,7 +1070,7 @@ export class View extends BaseNode {
|
|
|
1082
1070
|
}
|
|
1083
1071
|
|
|
1084
1072
|
|
|
1085
|
-
|
|
1073
|
+
|
|
1086
1074
|
|
|
1087
1075
|
/**
|
|
1088
1076
|
* 删除页面元素
|
|
@@ -1545,6 +1533,21 @@ export class View extends BaseNode {
|
|
|
1545
1533
|
this.emit('change', $event);
|
|
1546
1534
|
}
|
|
1547
1535
|
|
|
1536
|
+
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
1537
|
+
const excludedSet = new Set(excludedList);
|
|
1538
|
+
const varList: any[] = [];
|
|
1539
|
+
if (Array.isArray(this.params)) {
|
|
1540
|
+
varList.push(...this.params);
|
|
1541
|
+
}
|
|
1542
|
+
if (Array.isArray(this.variables)) {
|
|
1543
|
+
varList.push(...this.variables);
|
|
1544
|
+
}
|
|
1545
|
+
if (Array.isArray(this.logics)) {
|
|
1546
|
+
varList.push(...this.logics);
|
|
1547
|
+
}
|
|
1548
|
+
return varList.filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
1549
|
+
}
|
|
1550
|
+
|
|
1548
1551
|
getVarExistingNames(excludedList: Array<Param | Variable> = []) {
|
|
1549
1552
|
const excludedSet = new Set(excludedList);
|
|
1550
1553
|
const varList: any[] = [];
|
|
@@ -1556,6 +1559,7 @@ export class View extends BaseNode {
|
|
|
1556
1559
|
}
|
|
1557
1560
|
if (Array.isArray(this.logics)) {
|
|
1558
1561
|
this.logics.forEach((logic) => {
|
|
1562
|
+
varList.push(logic);
|
|
1559
1563
|
if (Array.isArray(logic.params)) {
|
|
1560
1564
|
varList.push(...logic.params);
|
|
1561
1565
|
}
|
|
@@ -1587,6 +1591,7 @@ export class View extends BaseNode {
|
|
|
1587
1591
|
title: this.title,
|
|
1588
1592
|
crumb: this.crumb,
|
|
1589
1593
|
first: this.children.find((child) => child.isIndex)?.name,
|
|
1594
|
+
auth: this.auth ? 'loginAuth' : undefined,
|
|
1590
1595
|
};
|
|
1591
1596
|
return `${componentOptions}
|
|
1592
1597
|
${translator(definition)}
|
|
@@ -1647,12 +1652,14 @@ export class View extends BaseNode {
|
|
|
1647
1652
|
}
|
|
1648
1653
|
|
|
1649
1654
|
getNamespace(): string {
|
|
1650
|
-
if (this.parentNode) {
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1655
|
+
if (this.parentNode && (this.parentNode as Namespace).getNamespace) {
|
|
1656
|
+
const parentNamespace = (this.parentNode as Namespace).getNamespace();
|
|
1657
|
+
const parentName = this.parentNode.name;
|
|
1658
|
+
const arr = [parentNamespace];
|
|
1659
|
+
if (this.parentNode.concept !== 'App' && parentName) {
|
|
1660
|
+
arr.push(parentName);
|
|
1654
1661
|
}
|
|
1655
|
-
return `${
|
|
1662
|
+
return `${arr.join('.')}.views`;
|
|
1656
1663
|
} else
|
|
1657
1664
|
throw new Error('无法获取命名空间,请设置 parentNode!');
|
|
1658
1665
|
}
|
|
@@ -1688,27 +1695,27 @@ export class View extends BaseNode {
|
|
|
1688
1695
|
let code = `export namespace ${this.tsName} {\n`;
|
|
1689
1696
|
// 角色
|
|
1690
1697
|
if (Array.isArray(this.bindRoles) && this.bindRoles.length) {
|
|
1691
|
-
code += indent(state
|
|
1698
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
1692
1699
|
code += 'export let __bindRoles = [\n';
|
|
1693
1700
|
this.bindRoles.forEach((role) => {
|
|
1694
|
-
code += indent(state
|
|
1701
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
1695
1702
|
code += `${this.app.getNamespace()}.roles.${chineseTsName(role)}.${chineseTsName(role)},`;
|
|
1696
1703
|
code += '\n';
|
|
1697
1704
|
});
|
|
1698
1705
|
code += '\n';
|
|
1699
|
-
code += indent(state
|
|
1706
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
1700
1707
|
code += '];\n';
|
|
1701
1708
|
}
|
|
1702
1709
|
if (Array.isArray(this.params)) {
|
|
1703
1710
|
this.params.forEach((param) => {
|
|
1704
|
-
code += indent(state
|
|
1711
|
+
code += indent((state?.tabSize || 0) + 1) + 'let ';
|
|
1705
1712
|
code += param.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1706
1713
|
code += ';\n';
|
|
1707
1714
|
});
|
|
1708
1715
|
}
|
|
1709
1716
|
if (Array.isArray(this.variables)) {
|
|
1710
1717
|
this.variables.forEach((variable) => {
|
|
1711
|
-
code += indent(state
|
|
1718
|
+
code += indent((state?.tabSize || 0) + 1) + 'let ';
|
|
1712
1719
|
code += variable.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1713
1720
|
code += ';\n';
|
|
1714
1721
|
});
|
|
@@ -1719,53 +1726,53 @@ export class View extends BaseNode {
|
|
|
1719
1726
|
// 生成所有的name和类型定义
|
|
1720
1727
|
this.elements.forEach((element) => {
|
|
1721
1728
|
code += element.toEmbeddedTSDefinition(shiftState(state, code, {
|
|
1722
|
-
tabSize: state
|
|
1729
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
1723
1730
|
}));
|
|
1724
1731
|
});
|
|
1725
|
-
code += indent(state
|
|
1732
|
+
code += indent((state?.tabSize || 0) + 1) + '}\n';
|
|
1726
1733
|
code += `let __elements: __elements;\n`;
|
|
1727
1734
|
// 逻辑
|
|
1728
1735
|
if (Array.isArray(this.logics) && this.logics.length) {
|
|
1729
|
-
code += indent(state
|
|
1736
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
1730
1737
|
this.logics.forEach((logic) => {
|
|
1731
1738
|
code += logic.toEmbeddedTS(shiftState(state, code, {
|
|
1732
|
-
tabSize: state
|
|
1739
|
+
tabSize: (state?.tabSize || 0) + 2,
|
|
1733
1740
|
}), 'noExport');
|
|
1734
1741
|
code += '\n';
|
|
1735
1742
|
});
|
|
1736
|
-
code += indent(state
|
|
1743
|
+
code += indent((state?.tabSize || 0) + 1);
|
|
1737
1744
|
}
|
|
1738
1745
|
// 事件
|
|
1739
1746
|
if (Array.isArray(this.bindEvents)) {
|
|
1740
1747
|
this.bindEvents.forEach((event) => {
|
|
1741
1748
|
code += event.toEmbeddedTS(shiftState(state, code, {
|
|
1742
|
-
tabSize: state
|
|
1749
|
+
tabSize: (state?.tabSize || 0),
|
|
1743
1750
|
}), true);
|
|
1744
1751
|
code += '\n';
|
|
1745
1752
|
});
|
|
1746
1753
|
}
|
|
1747
1754
|
|
|
1748
1755
|
// render函数
|
|
1749
|
-
code += '\n' + indent(state
|
|
1756
|
+
code += '\n' + indent((state?.tabSize || 0) + 1);
|
|
1750
1757
|
code += `export function __render(`;
|
|
1751
1758
|
code += `){\n`;
|
|
1752
|
-
code += indent(state
|
|
1759
|
+
code += indent((state?.tabSize || 0));
|
|
1753
1760
|
|
|
1754
1761
|
// elements 元素
|
|
1755
1762
|
if (Array.isArray(this.elements)) {
|
|
1756
1763
|
// 生成嵌套式的内容
|
|
1757
1764
|
this.elements.forEach((element) => {
|
|
1758
1765
|
code += element.toEmbeddedTS(shiftState(state, code, {
|
|
1759
|
-
tabSize: state
|
|
1766
|
+
tabSize: (state?.tabSize || 0) + 3,
|
|
1760
1767
|
}));
|
|
1761
1768
|
code += '\n';
|
|
1762
1769
|
});
|
|
1763
1770
|
}
|
|
1764
1771
|
|
|
1765
|
-
code += '\n' + indent(state
|
|
1772
|
+
code += '\n' + indent((state?.tabSize || 0) + 1) + '}\n';
|
|
1766
1773
|
|
|
1767
1774
|
if (Array.isArray(this.params)) {
|
|
1768
|
-
code += indent(state
|
|
1775
|
+
code += indent((state?.tabSize || 0) + 1) + `export function $destination(options: {`;
|
|
1769
1776
|
this.params.forEach((param, index) => {
|
|
1770
1777
|
code += param.name + '?: ';
|
|
1771
1778
|
code += param.typeAnnotation.toEmbeddedTS(shiftState(state, code));
|
|
@@ -1774,7 +1781,7 @@ export class View extends BaseNode {
|
|
|
1774
1781
|
});
|
|
1775
1782
|
code += '}){}\n';
|
|
1776
1783
|
}
|
|
1777
|
-
code += indent(state
|
|
1784
|
+
code += indent((state?.tabSize || 0)) + '}\n';
|
|
1778
1785
|
return code;
|
|
1779
1786
|
}
|
|
1780
1787
|
|
|
@@ -257,12 +257,12 @@ export class WhileStatement extends LogicItem {
|
|
|
257
257
|
this.body.forEach((logicItem) => {
|
|
258
258
|
code
|
|
259
259
|
+= logicItem.toJS(shiftState(state, code, {
|
|
260
|
-
tabSize: state
|
|
260
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
261
261
|
})) + '\n';
|
|
262
262
|
});
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
-
code += indent(state
|
|
265
|
+
code += indent((state?.tabSize || 0)) + '}\n';
|
|
266
266
|
return code;
|
|
267
267
|
}
|
|
268
268
|
|
|
@@ -279,12 +279,12 @@ export class WhileStatement extends LogicItem {
|
|
|
279
279
|
this.body.forEach((logicItem) => {
|
|
280
280
|
code
|
|
281
281
|
+= logicItem.toEmbeddedTS(shiftState(state, code, {
|
|
282
|
-
tabSize: state
|
|
282
|
+
tabSize: (state?.tabSize || 0) + 1,
|
|
283
283
|
})) + '\n';
|
|
284
284
|
});
|
|
285
285
|
}
|
|
286
286
|
|
|
287
|
-
code += indent(state
|
|
287
|
+
code += indent((state?.tabSize || 0)) + '}\n';
|
|
288
288
|
return code;
|
|
289
289
|
}
|
|
290
290
|
//================================================================================
|
|
@@ -22,5 +22,25 @@ export default new Namespace({
|
|
|
22
22
|
params: [],
|
|
23
23
|
returns: [],
|
|
24
24
|
}),
|
|
25
|
+
new Logic({
|
|
26
|
+
name: 'encryptByAES',
|
|
27
|
+
params: [
|
|
28
|
+
new Param({
|
|
29
|
+
name: 'string',
|
|
30
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
31
|
+
}),
|
|
32
|
+
],
|
|
33
|
+
returns: [],
|
|
34
|
+
}),
|
|
35
|
+
new Logic({
|
|
36
|
+
name: 'decryptByAES',
|
|
37
|
+
params: [
|
|
38
|
+
new Param({
|
|
39
|
+
name: 'string',
|
|
40
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
41
|
+
}),
|
|
42
|
+
],
|
|
43
|
+
returns: [],
|
|
44
|
+
}),
|
|
25
45
|
],
|
|
26
46
|
});
|
|
@@ -10,7 +10,7 @@ import { primitiveTypeList } from '../types/coreTypeList';
|
|
|
10
10
|
import { reference2TypeAnnotationList } from './reference2TypeAnnotationList';
|
|
11
11
|
import TypeParam from '../../TypeParam__';
|
|
12
12
|
|
|
13
|
-
const interfaceStructures = [
|
|
13
|
+
export const interfaceStructures = [
|
|
14
14
|
new Structure({
|
|
15
15
|
name: 'ApiReturnOf',
|
|
16
16
|
typeParams: [
|