@lcap/nasl 1.0.0-alpha.2 → 1.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/docs/assets/search.js +1 -1
- package/docs/classes/Entity.html +2832 -204
- package/docs/classes/View.html +4567 -365
- package/out/common/BaseNode.js +23 -16
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +77 -15
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +2 -1
- package/out/concepts/Argument__.js +2 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +2 -1
- package/out/concepts/Assignment__.js +3 -8
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +2 -1
- package/out/concepts/BinaryExpression__.js +5 -5
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +2 -1
- package/out/concepts/BindAttribute__.js +9 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +2 -1
- package/out/concepts/BindDirective__.js +2 -2
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +2 -1
- package/out/concepts/BindEvent__.js +4 -3
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +2 -1
- package/out/concepts/BooleanLiteral__.js +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +57 -1
- package/out/concepts/CallFunction__.js +119 -11
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -1
- package/out/concepts/CallInterface__.js +2 -2
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +57 -1
- package/out/concepts/CallLogic__.js +117 -10
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +1 -1
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +120 -0
- package/out/concepts/ConfigGroup__.js +214 -0
- package/out/concepts/ConfigGroup__.js.map +1 -0
- package/out/concepts/ConfigPropertyValue__.d.ts +43 -0
- package/out/concepts/ConfigPropertyValue__.js +103 -0
- package/out/concepts/ConfigPropertyValue__.js.map +1 -0
- package/out/concepts/ConfigProperty__.d.ts +128 -0
- package/out/concepts/ConfigProperty__.js +236 -0
- package/out/concepts/ConfigProperty__.js.map +1 -0
- package/out/concepts/Configuration__.d.ts +120 -0
- package/out/concepts/Configuration__.js +210 -0
- package/out/concepts/Configuration__.js.map +1 -0
- package/out/concepts/Constant__.d.ts +2 -1
- package/out/concepts/Constant__.js +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +2 -1
- package/out/concepts/Destination__.js +4 -3
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +8 -0
- package/out/concepts/EntityIndex__.js +18 -0
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +5 -5
- package/out/concepts/EntityProperty__.js +10 -9
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +30 -26
- package/out/concepts/Entity__.js +44 -36
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +8 -8
- package/out/concepts/Enum__.js +10 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +35 -33
- package/out/concepts/ForEachStatement__.js +103 -36
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Function__.js +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -1
- package/out/concepts/Identifier__.js +15 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +1 -1
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +5 -1
- package/out/concepts/Interface__.js +19 -5
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -1
- package/out/concepts/LogicItem__.js +2 -2
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +9 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +2 -5
- package/out/concepts/MemberExpression__.js +12 -18
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +121 -126
- package/out/concepts/Module__.js +10 -17
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +12 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +2 -1
- package/out/concepts/NullLiteral__.js +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +2 -1
- package/out/concepts/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -1
- package/out/concepts/Param__.js +2 -2
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +2 -2
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +82 -81
- package/out/concepts/ProcessElement__.js +19 -6
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/Process__.d.ts +1 -0
- package/out/concepts/Process__.js +10 -4
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +1 -1
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +2 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +5 -0
- package/out/concepts/Role__.js +19 -2
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +2 -0
- package/out/concepts/SqlQueryComponent__.js +16 -0
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +2 -1
- package/out/concepts/StringLiteral__.js +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +1 -1
- package/out/concepts/StructureProperty__.js +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -1
- package/out/concepts/Structure__.js +4 -4
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +3 -0
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +2 -1
- package/out/concepts/UnaryExpression__.js +3 -3
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +2 -1
- package/out/concepts/Unparsed__.js +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +2 -1
- package/out/concepts/ValidationRule__.js +2 -2
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +6 -5
- package/out/concepts/Variable__.js +3 -3
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +5 -5
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +5 -4
- package/out/concepts/ViewElement__.js +109 -65
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +97 -90
- package/out/concepts/View__.js +153 -118
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +2 -2
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +3 -137
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +21 -5
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.d.ts +3 -0
- package/out/concepts/basics/stdlib/nasl.validation.js +527 -0
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -0
- package/out/concepts/index__.d.ts +4 -0
- package/out/concepts/index__.js +4 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/data/Module.d.ts +34 -0
- package/out/data/Module.js +53 -0
- package/out/data/Module.js.map +1 -0
- package/out/generator/compileComponent.d.ts +1 -1
- package/out/generator/genBundleFiles.d.ts +0 -1
- package/out/generator/genBundleFiles.js +1 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +35 -0
- package/out/generator/genMetaData.js +78 -0
- package/out/generator/genMetaData.js.map +1 -0
- package/out/generator/index.d.ts +1 -0
- package/out/generator/index.js +1 -0
- package/out/generator/index.js.map +1 -1
- package/out/index.d.ts +2 -2
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/server/createUiTs.d.ts +7 -0
- package/out/server/createUiTs.js +157 -0
- package/out/server/createUiTs.js.map +1 -0
- package/out/server/entity2LogicNamespace.d.ts +9 -1
- package/out/server/entity2LogicNamespace.js +11 -1
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/getExtensionModules.d.ts +3 -0
- package/out/server/getExtensionModules.js +18 -0
- package/out/server/getExtensionModules.js.map +1 -0
- package/out/server/getLogics.js +18 -15
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +3 -2
- package/out/server/getMemberIdentifier.js +47 -15
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +4 -1
- package/out/server/getProcesses.js +16 -7
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/getValidates.js +1 -1
- package/out/server/getValidates.js.map +1 -1
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +23 -5
- package/out/server/naslServer.js +199 -25
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.d.ts +15 -1
- package/out/server/process2LogicNamespace.js +30 -3
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.js +28 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +5 -0
- package/out/service/storage/init.js +60 -52
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCallComponentLogic.js +2 -2
- package/out/templator/genCallComponentLogic.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -8
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +3 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -4
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -3
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +1 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +2 -2
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genSelectBlock.js +1 -1
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +8 -12
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +20 -20
- package/out/templator/utils.js +22 -22
- package/out/templator/utils.js.map +1 -1
- package/package.json +2 -1
- package/src/automate/engine/index.js +37 -3
- package/src/automate/engine/utils.js +68 -64
- package/src/common/BaseNode.ts +24 -17
- package/src/concepts/App__.ts +93 -17
- package/src/concepts/Argument__.ts +4 -2
- package/src/concepts/Assignment__.ts +5 -7
- package/src/concepts/Attribute__.ts +1 -0
- package/src/concepts/BinaryExpression__.ts +7 -5
- package/src/concepts/BindAttribute__.ts +9 -4
- package/src/concepts/BindDirective__.ts +4 -2
- package/src/concepts/BindEvent__.ts +6 -4
- package/src/concepts/BooleanLiteral__.ts +3 -1
- package/src/concepts/CallFunction__.ts +195 -11
- package/src/concepts/CallInterface__.ts +4 -2
- package/src/concepts/CallLogic__.ts +211 -12
- package/src/concepts/CallQueryComponent__.ts +2 -1
- package/src/concepts/Comment__.ts +1 -0
- package/src/concepts/CompletionProperty__.ts +1 -0
- package/src/concepts/ConfigGroup__.ts +290 -0
- package/src/concepts/ConfigPropertyValue__.ts +112 -0
- package/src/concepts/ConfigProperty__.ts +306 -0
- package/src/concepts/Configuration__.ts +286 -0
- package/src/concepts/Constant__.ts +3 -1
- package/src/concepts/DataElement__.ts +1 -0
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/EntityIndex__.ts +19 -0
- package/src/concepts/EntityProperty__.ts +9 -8
- package/src/concepts/Entity__.ts +66 -59
- package/src/concepts/EnumItem__.ts +1 -0
- package/src/concepts/Enum__.ts +32 -12
- package/src/concepts/Event__.ts +2 -1
- package/src/concepts/ForEachStatement__.ts +115 -69
- package/src/concepts/Function__.ts +2 -1
- package/src/concepts/Identifier__.ts +18 -1
- package/src/concepts/IfStatement__.ts +1 -0
- package/src/concepts/InterfaceParam__.ts +2 -1
- package/src/concepts/Interface__.ts +21 -5
- package/src/concepts/JSBlock__.ts +1 -0
- package/src/concepts/LogicItem__.ts +9 -40
- package/src/concepts/Logic__.ts +48 -9
- package/src/concepts/MemberExpression__.ts +14 -17
- package/src/concepts/Module__.ts +158 -139
- package/src/concepts/Namespace__.ts +13 -12
- package/src/concepts/NullLiteral__.ts +3 -1
- package/src/concepts/NumericLiteral__.ts +3 -1
- package/src/concepts/Param__.ts +3 -2
- package/src/concepts/Point__.ts +1 -0
- package/src/concepts/ProcessComponent__.ts +3 -2
- package/src/concepts/ProcessElement__.ts +102 -107
- package/src/concepts/ProcessOutcome__.ts +1 -0
- package/src/concepts/Process__.ts +12 -4
- package/src/concepts/QueryAggregateExpression__.ts +1 -0
- package/src/concepts/QueryFieldExpression__.ts +2 -1
- package/src/concepts/QueryFromExpression__.ts +1 -0
- package/src/concepts/QueryGroupByExpression__.ts +1 -0
- package/src/concepts/QueryJoinExpression__.ts +2 -1
- package/src/concepts/QueryLimitExpression__.ts +1 -0
- package/src/concepts/QueryOrderByExpression__.ts +1 -0
- package/src/concepts/QuerySelectExpression__.ts +2 -1
- package/src/concepts/Rect__.ts +1 -0
- package/src/concepts/Return__.ts +3 -2
- package/src/concepts/Role__.ts +19 -2
- package/src/concepts/Slot__.ts +1 -0
- package/src/concepts/SqlQueryComponent__.ts +11 -1
- package/src/concepts/Start__.ts +1 -0
- package/src/concepts/StringLiteral__.ts +3 -1
- package/src/concepts/StructureProperty__.ts +2 -1
- package/src/concepts/Structure__.ts +5 -4
- package/src/concepts/SwitchCase__.ts +1 -0
- package/src/concepts/SwitchStatement__.ts +1 -0
- package/src/concepts/Theme__.ts +1 -0
- package/src/concepts/Transactional__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +4 -0
- package/src/concepts/TypeParam__.ts +1 -0
- package/src/concepts/UnaryExpression__.ts +6 -3
- package/src/concepts/Unparsed__.ts +3 -1
- package/src/concepts/UseComponent__.ts +1 -0
- package/src/concepts/ValidationRule__.ts +5 -2
- package/src/concepts/Variable__.ts +12 -6
- package/src/concepts/ViewComponent__.ts +6 -5
- package/src/concepts/ViewElement__.ts +109 -80
- package/src/concepts/View__.ts +245 -206
- package/src/concepts/WhileStatement__.ts +1 -0
- package/src/concepts/basics/stdlib/index.ts +2 -2
- package/src/concepts/basics/stdlib/nasl.ui.ts +3 -137
- package/src/concepts/basics/stdlib/nasl.util.ts +21 -5
- package/src/concepts/basics/stdlib/{nasl.validate.ts → nasl.validation.ts} +28 -28
- package/src/concepts/index__.ts +4 -0
- package/src/generator/compileComponent.ts +1 -1
- package/src/generator/genBundleFiles.ts +1 -2
- package/src/generator/genMetaData.ts +111 -0
- package/src/generator/index.ts +1 -0
- package/src/index.ts +2 -2
- package/src/server/createUiTs.ts +153 -0
- package/src/server/entity2LogicNamespace.ts +17 -1
- package/src/server/getExtensionModules.ts +13 -0
- package/src/server/getLogics.ts +19 -18
- package/src/server/getMemberIdentifier.ts +60 -19
- package/src/server/getProcesses.ts +15 -8
- package/src/server/getValidates.ts +1 -1
- package/src/server/index.ts +2 -1
- package/src/server/naslServer.ts +204 -24
- package/src/server/process2LogicNamespace.ts +44 -3
- package/src/server/translator.ts +121 -97
- package/src/service/config/api.js +32 -0
- package/src/service/config/index.js +6 -0
- package/src/service/creator/index.js +2 -2
- package/src/service/logic/checktypeSocket.js +49 -0
- package/src/service/modules/api.js +20 -0
- package/src/service/modules/index.js +6 -0
- package/src/service/storage/init.ts +62 -54
- package/src/templator/genCallComponentLogic.ts +2 -2
- package/src/templator/genCreateBlock.ts +19 -25
- package/src/templator/genCurdEditMultipleKeyBlock.ts +3 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -4
- package/src/templator/genEditTableBlock.ts +3 -3
- package/src/templator/genGetBlock.ts +1 -1
- package/src/templator/genListViewBlock.ts +2 -2
- package/src/templator/genSelectBlock.ts +1 -1
- package/src/templator/genUpdateBlock.ts +19 -25
- package/src/templator/utils.ts +25 -153
|
@@ -39,7 +39,7 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
39
39
|
const relationEntity = parentNode?.findEntityByName(property.relationEntity);
|
|
40
40
|
if (relationEntity) {
|
|
41
41
|
const relationProperty = relationEntity.properties.find((prop) => prop.name === property.relationProperty);
|
|
42
|
-
const displayedProperty = getFirstDisplayedProperty(relationEntity
|
|
42
|
+
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
43
43
|
if (displayedProperty) {
|
|
44
44
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
45
45
|
const selectNameGroup = selectNameGroupMap.get(relationEntity.name);
|
|
@@ -132,7 +132,7 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
132
132
|
const relationEntity = parentNode?.findEntityByName(property.relationEntity);
|
|
133
133
|
if (relationEntity) {
|
|
134
134
|
const relationProperty = relationEntity.properties.find((prop) => prop.name === property.relationProperty);
|
|
135
|
-
const displayedProperty = getFirstDisplayedProperty(relationEntity
|
|
135
|
+
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
136
136
|
if (displayedProperty) {
|
|
137
137
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
138
138
|
const selectNameGroup = selectNameGroupMap.get(relationEntity.name);
|
|
@@ -511,7 +511,7 @@ export function genCurdMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
511
511
|
"concept": "BindEvent",
|
|
512
512
|
"arguments": [],
|
|
513
513
|
"name": "created",
|
|
514
|
-
"calleeNamespace": "${view.getNamespace()}.views
|
|
514
|
+
"calleeNamespace": "${view.getNamespace()}.views.${view.name}.logics",
|
|
515
515
|
"calleeName": "${nameGroup.viewLogicInit}"
|
|
516
516
|
}
|
|
517
517
|
],
|
|
@@ -633,7 +633,7 @@ export function genGridViewMultipleKeyBlock(entity: Entity, view: View) {
|
|
|
633
633
|
"concept": "BindEvent",
|
|
634
634
|
"arguments": [],
|
|
635
635
|
"name": "created",
|
|
636
|
-
"calleeNamespace": "${view.getNamespace()}.views
|
|
636
|
+
"calleeNamespace": "${view.getNamespace()}.views.${view.name}.logics",
|
|
637
637
|
"calleeName": "${nameGroup.viewLogicInit}"
|
|
638
638
|
}
|
|
639
639
|
],
|
|
@@ -22,7 +22,7 @@ export function genEditTableColumnTemplate(entity: Entity, property: EntityPrope
|
|
|
22
22
|
|
|
23
23
|
const expression = getExpression(property, `scope.item.${lowerEntityName}.${property.name}`);
|
|
24
24
|
|
|
25
|
-
const canEditable = (property: EntityProperty) => property.
|
|
25
|
+
const canEditable = (property: EntityProperty) => !property.readonly;
|
|
26
26
|
|
|
27
27
|
const getText = (property: EntityProperty) => {
|
|
28
28
|
const propertyTypeName = property.typeAnnotation.typeName;
|
|
@@ -37,7 +37,7 @@ export function genEditTableColumnTemplate(entity: Entity, property: EntityPrope
|
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
const genEditComponent = (property: EntityProperty) => {
|
|
40
|
-
if (
|
|
40
|
+
if (property.readonly)
|
|
41
41
|
return '';
|
|
42
42
|
const label = property.label || property.name;
|
|
43
43
|
let formItem = '';
|
|
@@ -48,7 +48,7 @@ export function genEditTableColumnTemplate(entity: Entity, property: EntityPrope
|
|
|
48
48
|
const relationEntity = parentNode?.findEntityByName(property.relationEntity);
|
|
49
49
|
if (relationEntity) {
|
|
50
50
|
const relationProperty = relationEntity.properties.find((prop) => prop.name === property.relationProperty);
|
|
51
|
-
const displayedProperty = getFirstDisplayedProperty(relationEntity
|
|
51
|
+
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
52
52
|
if (displayedProperty) {
|
|
53
53
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
54
54
|
const selectNameGroup = selectNameGroupMap.get(relationEntity.name);
|
|
@@ -109,7 +109,7 @@ export function genGetBlock(entity: Entity, view: View) {
|
|
|
109
109
|
"concept": "BindEvent",
|
|
110
110
|
"arguments": [],
|
|
111
111
|
"name": "created",
|
|
112
|
-
"calleeNamespace": "${view.getNamespace()}
|
|
112
|
+
"calleeNamespace": "${view.getNamespace()}.${view.name}.logics",
|
|
113
113
|
"calleeName": "${nameGroup.viewLogicLoad}"
|
|
114
114
|
}
|
|
115
115
|
]
|
|
@@ -77,7 +77,7 @@ export function genLoadListViewLogic(entity: Entity, nameGroup: NameGroup, newSt
|
|
|
77
77
|
calleeName: entityLogic.name,
|
|
78
78
|
arguments: [
|
|
79
79
|
genLogicParam(`${entityLogic.params[0].name}`, 'params.page'),
|
|
80
|
-
genLogicParam(`${entityLogic.params[
|
|
80
|
+
genLogicParam(`${entityLogic.params[1].name}`, 'params.size'),
|
|
81
81
|
],
|
|
82
82
|
}),
|
|
83
83
|
}),
|
|
@@ -97,7 +97,7 @@ export function genListViewBlock(entity: Entity, view: View, property: EntityPro
|
|
|
97
97
|
nameGroup.viewElementMainView = viewElementMainView;
|
|
98
98
|
nameGroup.viewVariableEntity = view.getVariableUniqueName(utils.firstLowerCase(entity.name));
|
|
99
99
|
|
|
100
|
-
const displayedProperty = property || getFirstDisplayedProperty(entity
|
|
100
|
+
const displayedProperty = property || getFirstDisplayedProperty(entity);
|
|
101
101
|
|
|
102
102
|
const newStructures: Array<any> = [];
|
|
103
103
|
const newLogics: Array<any> = [];
|
|
@@ -91,7 +91,7 @@ export function genSelectBlock(entity: Entity, view: View) {
|
|
|
91
91
|
nameGroup.viewElementMainView = viewElementMainView;
|
|
92
92
|
nameGroup.viewVariableEntity = view.getVariableUniqueName(utils.firstLowerCase(entity.name));
|
|
93
93
|
|
|
94
|
-
const displayedProperty = getFirstDisplayedProperty(entity
|
|
94
|
+
const displayedProperty = getFirstDisplayedProperty(entity);
|
|
95
95
|
|
|
96
96
|
const allEntities = [
|
|
97
97
|
entity,
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { config } from '../config';
|
|
2
2
|
import * as utils from '../utils';
|
|
3
3
|
import { App, Namespace, Entity, Logic, View, Enum } from '../concepts';
|
|
4
|
+
import { NaslCoreTypeAnnotation, NaslUITypeAnnotation, NaslTypeAnnotation, NaslLogicItem, NaslNode } from './utils';
|
|
4
5
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
NameGroup,
|
|
7
|
+
filterProperty,
|
|
8
|
+
getFirstDisplayedProperty,
|
|
9
|
+
genUniqueQueryNameGroup,
|
|
10
|
+
genLogicParam,
|
|
11
|
+
genCallComponentLogic,
|
|
12
|
+
genLoadSelectLogic,
|
|
13
|
+
genQueryStructure,
|
|
14
|
+
genQueryLogic,
|
|
15
|
+
genEnumSelectBlock,
|
|
12
16
|
} from '.';
|
|
13
17
|
|
|
14
18
|
export function genUpdateFormTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroupMap: Map<string, NameGroup>) {
|
|
@@ -32,16 +36,13 @@ export function genUpdateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
32
36
|
let formItem = ` <u-form-item label="${label}"${required ? ' required' : ''}${rulesStr.length ? ` rules="${rulesStr}"` : ''}>\n`;
|
|
33
37
|
|
|
34
38
|
const { typeAnnotation } = property || {};
|
|
35
|
-
const {
|
|
36
|
-
typeName: propertyTypeName,
|
|
37
|
-
typeNamespace: propertyTypeNamespace,
|
|
38
|
-
} = typeAnnotation || {};
|
|
39
|
+
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
39
40
|
if (property.relationEntity) {
|
|
40
41
|
// 有外键关联
|
|
41
42
|
const relationEntity = parentNode?.findEntityByName(property.relationEntity);
|
|
42
43
|
if (relationEntity) {
|
|
43
44
|
const relationProperty = relationEntity.properties.find((prop) => prop.name === property.relationProperty);
|
|
44
|
-
const displayedProperty = getFirstDisplayedProperty(relationEntity
|
|
45
|
+
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
45
46
|
if (displayedProperty) {
|
|
46
47
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
47
48
|
const selectNameGroup = selectNameGroupMap.get(relationEntity.name);
|
|
@@ -109,16 +110,13 @@ export function genH5UpdateFormTemplate(entity: Entity, nameGroup: NameGroup, se
|
|
|
109
110
|
let formItem = ` <van-field drole="other" label="${label}"${required ? ' required' : ''}${rulesStr.length ? ` rules="${rulesStr}"` : ''}>\n`;
|
|
110
111
|
|
|
111
112
|
const { typeAnnotation } = property || {};
|
|
112
|
-
const {
|
|
113
|
-
typeName: propertyTypeName,
|
|
114
|
-
typeNamespace: propertyTypeNamespace,
|
|
115
|
-
} = typeAnnotation || {};
|
|
113
|
+
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
116
114
|
if (property.relationEntity) {
|
|
117
115
|
// 有外键关联
|
|
118
116
|
const relationEntity = parentNode?.findEntityByName(property.relationEntity);
|
|
119
117
|
if (relationEntity) {
|
|
120
118
|
const relationProperty = relationEntity.properties.find((prop) => prop.name === property.relationProperty);
|
|
121
|
-
const displayedProperty = getFirstDisplayedProperty(relationEntity
|
|
119
|
+
const displayedProperty = getFirstDisplayedProperty(relationEntity);
|
|
122
120
|
if (displayedProperty) {
|
|
123
121
|
const lowerEntityName = utils.firstLowerCase(relationEntity.name);
|
|
124
122
|
const selectNameGroup = selectNameGroupMap.get(relationEntity.name);
|
|
@@ -173,9 +171,7 @@ export function genH5UpdateFormTemplate(entity: Entity, nameGroup: NameGroup, se
|
|
|
173
171
|
}
|
|
174
172
|
|
|
175
173
|
function genSubmitLogic(updateLogic: Logic, nameGroup: NameGroup) {
|
|
176
|
-
const params = [
|
|
177
|
-
genLogicParam(`${updateLogic.params[0].name}`, nameGroup.viewVariableEntity),
|
|
178
|
-
];
|
|
174
|
+
const params = [genLogicParam(`${updateLogic.params[0].name}`, nameGroup.viewVariableEntity)];
|
|
179
175
|
return NaslNode.Logic({
|
|
180
176
|
name: nameGroup.viewLogicSubmit,
|
|
181
177
|
params: [] as any,
|
|
@@ -212,7 +208,7 @@ function genSubmitLogic(updateLogic: Logic, nameGroup: NameGroup) {
|
|
|
212
208
|
NaslLogicItem.CallLogic({
|
|
213
209
|
label: '弹出消息',
|
|
214
210
|
shortcut: true,
|
|
215
|
-
calleeNamespace: 'nasl.ui
|
|
211
|
+
calleeNamespace: 'nasl.ui',
|
|
216
212
|
calleeName: 'showMessage',
|
|
217
213
|
arguments: [
|
|
218
214
|
NaslLogicItem.Argument({
|
|
@@ -232,9 +228,7 @@ function genSubmitLogic(updateLogic: Logic, nameGroup: NameGroup) {
|
|
|
232
228
|
}
|
|
233
229
|
|
|
234
230
|
function genLoadLogic(getLogic: Logic, nameGroup: NameGroup) {
|
|
235
|
-
const params = [
|
|
236
|
-
genLogicParam(`${getLogic.params[0].name}`, 'id'),
|
|
237
|
-
];
|
|
231
|
+
const params = [genLogicParam(`${getLogic.params[0].name}`, 'id')];
|
|
238
232
|
return NaslNode.Logic({
|
|
239
233
|
name: nameGroup.viewLogicLoad,
|
|
240
234
|
description: '',
|
|
@@ -330,7 +324,7 @@ export function genUpdateBlock(entity: Entity, view: View) {
|
|
|
330
324
|
"concept": "BindEvent",
|
|
331
325
|
"arguments": [],
|
|
332
326
|
"name": "created",
|
|
333
|
-
"calleeNamespace": "${view.getNamespace()}.views
|
|
327
|
+
"calleeNamespace": "${view.getNamespace()}.views.${view.name}.logics",
|
|
334
328
|
"calleeName": "${nameGroup.viewLogicLoad}"
|
|
335
329
|
}
|
|
336
330
|
],
|
package/src/templator/utils.ts
CHANGED
|
@@ -15,10 +15,7 @@ export const filterProperty = (key: 'inTable' | 'inFilter' | 'inForm' | 'inDetai
|
|
|
15
15
|
*/
|
|
16
16
|
export function getExpression(property: EntityProperty, expression: string) {
|
|
17
17
|
const { typeAnnotation } = property || {};
|
|
18
|
-
const {
|
|
19
|
-
typeName: propertyTypeName,
|
|
20
|
-
typeNamespace: propertyTypeNamespace,
|
|
21
|
-
} = typeAnnotation || {};
|
|
18
|
+
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
22
19
|
if (propertyTypeName === 'DateTime')
|
|
23
20
|
return `$utils['FormatDate'](${expression}, 'YYYY-MM-DD HH:mm:ss')`;
|
|
24
21
|
else if (propertyTypeName === 'Date')
|
|
@@ -44,8 +41,8 @@ export function getParamFromLogic(logic: Logic, paramName: string) {
|
|
|
44
41
|
return params.find((item) => item.name === paramName);
|
|
45
42
|
}
|
|
46
43
|
|
|
47
|
-
export function getFirstDisplayedProperty(entity: Entity
|
|
48
|
-
let property = entity.properties.find((property) => property.
|
|
44
|
+
export function getFirstDisplayedProperty(entity: Entity) {
|
|
45
|
+
let property = entity.properties.find((property) => !property.readonly);
|
|
49
46
|
if (!property)
|
|
50
47
|
property = entity.properties[0];
|
|
51
48
|
return property;
|
|
@@ -60,7 +57,6 @@ function genArgumentMemberExpression(arr: string[]) {
|
|
|
60
57
|
property: NaslLogicItem.Identifier({
|
|
61
58
|
name: propertyName,
|
|
62
59
|
}),
|
|
63
|
-
|
|
64
60
|
});
|
|
65
61
|
} else {
|
|
66
62
|
return NaslLogicItem.Identifier({
|
|
@@ -232,13 +228,7 @@ export const NaslUITypeAnnotation = {
|
|
|
232
228
|
};
|
|
233
229
|
|
|
234
230
|
export const NaslTypeAnnotation = {
|
|
235
|
-
Reference: ({
|
|
236
|
-
typeNamespace,
|
|
237
|
-
typeName,
|
|
238
|
-
}: {
|
|
239
|
-
typeNamespace: string;
|
|
240
|
-
typeName: string;
|
|
241
|
-
}) => ({
|
|
231
|
+
Reference: ({ typeNamespace, typeName }: { typeNamespace: string; typeName: string }) => ({
|
|
242
232
|
concept: 'TypeAnnotation',
|
|
243
233
|
name: '',
|
|
244
234
|
typeKind: 'reference',
|
|
@@ -313,13 +303,7 @@ export const NaslLogicItem = {
|
|
|
313
303
|
arguments: args,
|
|
314
304
|
}),
|
|
315
305
|
// 参数
|
|
316
|
-
Argument: ({
|
|
317
|
-
keyword,
|
|
318
|
-
expression,
|
|
319
|
-
}: {
|
|
320
|
-
keyword: string;
|
|
321
|
-
expression: any;
|
|
322
|
-
}) => ({
|
|
306
|
+
Argument: ({ keyword, expression }: { keyword: string; expression: any }) => ({
|
|
323
307
|
concept: 'Argument',
|
|
324
308
|
name: '',
|
|
325
309
|
kind: 'Statement',
|
|
@@ -327,47 +311,27 @@ export const NaslLogicItem = {
|
|
|
327
311
|
expression,
|
|
328
312
|
}),
|
|
329
313
|
// 成员表达式
|
|
330
|
-
MemberExpression: ({
|
|
331
|
-
object,
|
|
332
|
-
property,
|
|
333
|
-
}: {
|
|
334
|
-
object: any;
|
|
335
|
-
property: any;
|
|
336
|
-
}) => ({
|
|
314
|
+
MemberExpression: ({ object, property }: { object: any; property: any }) => ({
|
|
337
315
|
concept: 'MemberExpression',
|
|
338
316
|
name: '',
|
|
339
317
|
kind: 'Expression',
|
|
340
|
-
|
|
318
|
+
object,
|
|
341
319
|
property,
|
|
342
320
|
}),
|
|
343
321
|
// 变量
|
|
344
|
-
Identifier: ({
|
|
345
|
-
name,
|
|
346
|
-
}: {
|
|
347
|
-
name: string;
|
|
348
|
-
}) => ({
|
|
322
|
+
Identifier: ({ name }: { name: string }) => ({
|
|
349
323
|
concept: 'Identifier',
|
|
350
324
|
kind: 'Expression',
|
|
351
325
|
name,
|
|
352
326
|
}),
|
|
353
327
|
// 字面量
|
|
354
|
-
StringLiteral: ({
|
|
355
|
-
value,
|
|
356
|
-
}: {
|
|
357
|
-
value: string;
|
|
358
|
-
}) => ({
|
|
328
|
+
StringLiteral: ({ value }: { value: string }) => ({
|
|
359
329
|
concept: 'StringLiteral',
|
|
360
330
|
name: '',
|
|
361
331
|
kind: 'Expression',
|
|
362
332
|
value,
|
|
363
333
|
}),
|
|
364
|
-
Assignment: ({
|
|
365
|
-
left,
|
|
366
|
-
right,
|
|
367
|
-
}: {
|
|
368
|
-
left: any;
|
|
369
|
-
right: any;
|
|
370
|
-
}) => ({
|
|
334
|
+
Assignment: ({ left, right }: { left: any; right: any }) => ({
|
|
371
335
|
concept: 'Assignment',
|
|
372
336
|
name: '',
|
|
373
337
|
label: '赋值',
|
|
@@ -375,15 +339,7 @@ export const NaslLogicItem = {
|
|
|
375
339
|
left,
|
|
376
340
|
right,
|
|
377
341
|
}),
|
|
378
|
-
IfStatement: ({
|
|
379
|
-
test,
|
|
380
|
-
consequent,
|
|
381
|
-
alternate,
|
|
382
|
-
}: {
|
|
383
|
-
test: any;
|
|
384
|
-
consequent: any[];
|
|
385
|
-
alternate: any[]
|
|
386
|
-
}) => ({
|
|
342
|
+
IfStatement: ({ test, consequent, alternate }: { test: any; consequent: any[]; alternate: any[] }) => ({
|
|
387
343
|
concept: 'IfStatement',
|
|
388
344
|
name: '',
|
|
389
345
|
kind: 'Statement',
|
|
@@ -393,17 +349,7 @@ export const NaslLogicItem = {
|
|
|
393
349
|
}),
|
|
394
350
|
|
|
395
351
|
// 二元
|
|
396
|
-
BinaryExpression: ({
|
|
397
|
-
operator,
|
|
398
|
-
left,
|
|
399
|
-
label = '算术运算',
|
|
400
|
-
right,
|
|
401
|
-
}: {
|
|
402
|
-
operator: string;
|
|
403
|
-
left?: any;
|
|
404
|
-
right?: any;
|
|
405
|
-
label?: string;
|
|
406
|
-
}) => ({
|
|
352
|
+
BinaryExpression: ({ operator, left, label = '算术运算', right }: { operator: string; left?: any; right?: any; label?: string }) => ({
|
|
407
353
|
concept: 'BinaryExpression',
|
|
408
354
|
name: '',
|
|
409
355
|
kind: 'Expression',
|
|
@@ -415,17 +361,7 @@ export const NaslLogicItem = {
|
|
|
415
361
|
};
|
|
416
362
|
|
|
417
363
|
export const NaslQueryExpression = {
|
|
418
|
-
QueryFieldExpression: ({
|
|
419
|
-
label,
|
|
420
|
-
isDotStar,
|
|
421
|
-
entityAsName,
|
|
422
|
-
propertyName,
|
|
423
|
-
}: {
|
|
424
|
-
label: string;
|
|
425
|
-
isDotStar: boolean;
|
|
426
|
-
entityAsName: string;
|
|
427
|
-
propertyName: string;
|
|
428
|
-
}) => ({
|
|
364
|
+
QueryFieldExpression: ({ label, isDotStar, entityAsName, propertyName }: { label: string; isDotStar: boolean; entityAsName: string; propertyName: string }) => ({
|
|
429
365
|
concept: 'QueryFieldExpression',
|
|
430
366
|
name: '',
|
|
431
367
|
label,
|
|
@@ -434,15 +370,7 @@ export const NaslQueryExpression = {
|
|
|
434
370
|
entityAsName,
|
|
435
371
|
propertyName,
|
|
436
372
|
}),
|
|
437
|
-
QueryFromExpression: ({
|
|
438
|
-
entityNamespace,
|
|
439
|
-
entityName,
|
|
440
|
-
joinParts,
|
|
441
|
-
}: {
|
|
442
|
-
entityNamespace: string;
|
|
443
|
-
entityName: string;
|
|
444
|
-
joinParts: any[];
|
|
445
|
-
}) => ({
|
|
373
|
+
QueryFromExpression: ({ entityNamespace, entityName, joinParts }: { entityNamespace: string; entityName: string; joinParts: any[] }) => ({
|
|
446
374
|
concept: 'QueryFromExpression',
|
|
447
375
|
name: '',
|
|
448
376
|
kind: 'Expression',
|
|
@@ -475,17 +403,7 @@ export const NaslQueryExpression = {
|
|
|
475
403
|
onExpressions,
|
|
476
404
|
joinParts,
|
|
477
405
|
}),
|
|
478
|
-
QuerySelectExpression: ({
|
|
479
|
-
label,
|
|
480
|
-
distinct,
|
|
481
|
-
star,
|
|
482
|
-
selectElements,
|
|
483
|
-
}: {
|
|
484
|
-
label?: string;
|
|
485
|
-
distinct?: boolean;
|
|
486
|
-
star?: boolean;
|
|
487
|
-
selectElements: any[],
|
|
488
|
-
}) => ({
|
|
406
|
+
QuerySelectExpression: ({ label, distinct, star, selectElements }: { label?: string; distinct?: boolean; star?: boolean; selectElements: any[] }) => ({
|
|
489
407
|
concept: 'QuerySelectExpression',
|
|
490
408
|
name: '',
|
|
491
409
|
kind: 'Expression',
|
|
@@ -494,29 +412,13 @@ export const NaslQueryExpression = {
|
|
|
494
412
|
star,
|
|
495
413
|
selectElements,
|
|
496
414
|
}),
|
|
497
|
-
QueryOrderByExpression: ({
|
|
498
|
-
label,
|
|
499
|
-
order,
|
|
500
|
-
orderElement,
|
|
501
|
-
}: {
|
|
502
|
-
label?: string;
|
|
503
|
-
order: any;
|
|
504
|
-
orderElement: any;
|
|
505
|
-
}) => ({
|
|
415
|
+
QueryOrderByExpression: ({ label, order, orderElement }: { label?: string; order: any; orderElement: any }) => ({
|
|
506
416
|
concept: 'QueryOrderByExpression',
|
|
507
417
|
label,
|
|
508
418
|
order,
|
|
509
419
|
orderElement,
|
|
510
420
|
}),
|
|
511
|
-
QueryLimitExpression: ({
|
|
512
|
-
label,
|
|
513
|
-
pageElement,
|
|
514
|
-
pageSizeElement,
|
|
515
|
-
}: {
|
|
516
|
-
label?: string,
|
|
517
|
-
pageElement: any;
|
|
518
|
-
pageSizeElement: any;
|
|
519
|
-
}) => ({
|
|
421
|
+
QueryLimitExpression: ({ label, pageElement, pageSizeElement }: { label?: string; pageElement: any; pageSizeElement: any }) => ({
|
|
520
422
|
concept: 'QueryLimitExpression',
|
|
521
423
|
name: '',
|
|
522
424
|
kind: 'Expression',
|
|
@@ -546,8 +448,8 @@ export const NaslQueryExpression = {
|
|
|
546
448
|
groupBy: any[];
|
|
547
449
|
having: any[];
|
|
548
450
|
orderBy: any[];
|
|
549
|
-
logicName
|
|
550
|
-
structureName
|
|
451
|
+
logicName: string;
|
|
452
|
+
structureName: string;
|
|
551
453
|
}) => ({
|
|
552
454
|
concept: 'CallQueryComponent',
|
|
553
455
|
name: '',
|
|
@@ -582,7 +484,7 @@ export const NaslNode = {
|
|
|
582
484
|
variables?: any[];
|
|
583
485
|
body?: any[];
|
|
584
486
|
description?: string;
|
|
585
|
-
playground?: any[]
|
|
487
|
+
playground?: any[];
|
|
586
488
|
}) => ({
|
|
587
489
|
concept: 'Logic',
|
|
588
490
|
name,
|
|
@@ -593,57 +495,27 @@ export const NaslNode = {
|
|
|
593
495
|
description,
|
|
594
496
|
playground,
|
|
595
497
|
}),
|
|
596
|
-
Structure: ({
|
|
597
|
-
name,
|
|
598
|
-
properties,
|
|
599
|
-
}: {
|
|
600
|
-
name: string;
|
|
601
|
-
properties?: any[]
|
|
602
|
-
}) => ({
|
|
498
|
+
Structure: ({ name, properties }: { name: string; properties?: any[] }) => ({
|
|
603
499
|
concept: 'Structure',
|
|
604
500
|
name,
|
|
605
501
|
properties,
|
|
606
502
|
}),
|
|
607
|
-
StructureProperty: ({
|
|
608
|
-
name,
|
|
609
|
-
typeAnnotation,
|
|
610
|
-
}: {
|
|
611
|
-
name: string;
|
|
612
|
-
typeAnnotation?: any
|
|
613
|
-
}) => ({
|
|
503
|
+
StructureProperty: ({ name, typeAnnotation }: { name: string; typeAnnotation?: any }) => ({
|
|
614
504
|
concept: 'StructureProperty',
|
|
615
505
|
name,
|
|
616
506
|
typeAnnotation,
|
|
617
507
|
}),
|
|
618
|
-
Variable: ({
|
|
619
|
-
name,
|
|
620
|
-
typeAnnotation,
|
|
621
|
-
}: {
|
|
622
|
-
name: string;
|
|
623
|
-
typeAnnotation?: any
|
|
624
|
-
}) => ({
|
|
508
|
+
Variable: ({ name, typeAnnotation }: { name: string; typeAnnotation?: any }) => ({
|
|
625
509
|
concept: 'Variable',
|
|
626
510
|
name,
|
|
627
511
|
typeAnnotation,
|
|
628
512
|
}),
|
|
629
|
-
Param: ({
|
|
630
|
-
name,
|
|
631
|
-
typeAnnotation,
|
|
632
|
-
}: {
|
|
633
|
-
name: string;
|
|
634
|
-
typeAnnotation?: any
|
|
635
|
-
}) => ({
|
|
513
|
+
Param: ({ name, typeAnnotation }: { name: string; typeAnnotation?: any }) => ({
|
|
636
514
|
concept: 'Param',
|
|
637
515
|
name,
|
|
638
516
|
typeAnnotation,
|
|
639
517
|
}),
|
|
640
|
-
Return: ({
|
|
641
|
-
name,
|
|
642
|
-
typeAnnotation,
|
|
643
|
-
}: {
|
|
644
|
-
name: string;
|
|
645
|
-
typeAnnotation?: any
|
|
646
|
-
}) => ({
|
|
518
|
+
Return: ({ name, typeAnnotation }: { name: string; typeAnnotation?: any }) => ({
|
|
647
519
|
concept: 'Return',
|
|
648
520
|
name,
|
|
649
521
|
typeAnnotation,
|