@lcap/nasl 3.7.1-beta.1 → 3.7.2-alpha.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/common/BaseNode.js +3 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +9 -27
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +1 -1
- package/out/concepts/Argument__.js +2 -6
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/AssigneeV2__.js +0 -2
- package/out/concepts/AssigneeV2__.js.map +1 -1
- package/out/concepts/Assignee__.js +0 -2
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js +0 -2
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js +2 -4
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +1 -1
- package/out/concepts/Attribute__.js +7 -23
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthInterface__.js +1 -3
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +7 -7
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.js +1 -3
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +2 -2
- package/out/concepts/BackendVariable__.js +3 -9
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.js +1 -3
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +1 -3
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +4 -4
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +6 -58
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +6 -6
- package/out/concepts/BindDirective__.js +7 -21
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +3 -3
- package/out/concepts/BindEvent__.js +3 -13
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +1 -3
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js +1 -3
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/BusinessComponent__.js +11 -19
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/BusinessLogic__.js +8 -10
- package/out/concepts/BusinessLogic__.js.map +1 -1
- package/out/concepts/CallConnector__.js +2 -6
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallEvent__.js +2 -6
- package/out/concepts/CallEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +1 -1
- package/out/concepts/CallFunction__.js +4 -14
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +1 -1
- package/out/concepts/CallInterface__.js +3 -9
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +4 -4
- package/out/concepts/CallLogic__.js +10 -25
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +2 -2
- package/out/concepts/CallQueryComponent__.js +2 -13
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +1 -3
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +5 -15
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +1 -3
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.d.ts +0 -1
- package/out/concepts/ConfigPropertyValue__.js +2 -13
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +3 -9
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.js +3 -9
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorLogic__.js +1 -3
- package/out/concepts/ConnectorLogic__.js.map +1 -1
- package/out/concepts/ConnectorTriggerLauncher__.js +6 -9
- package/out/concepts/ConnectorTriggerLauncher__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.js +2 -6
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.js +3 -9
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.js +2 -6
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/CountersignPolicyV2__.js +1 -3
- package/out/concepts/CountersignPolicyV2__.js.map +1 -1
- package/out/concepts/CountersignPolicy__.js +1 -3
- package/out/concepts/CountersignPolicy__.js.map +1 -1
- package/out/concepts/DataSource__.js +6 -12
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js +6 -6
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.js +3 -9
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +2 -2
- package/out/concepts/EntityIndex__.js +4 -13
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +10 -12
- package/out/concepts/EntityProperty__.js +27 -44
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +2 -2
- package/out/concepts/Entity__.js +11 -18
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +1 -1
- package/out/concepts/EnumItem__.js +6 -8
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +7 -10
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/EventDeclaration__.js +4 -16
- package/out/concepts/EventDeclaration__.js.map +1 -1
- package/out/concepts/Event__.js +5 -15
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +1 -1
- package/out/concepts/ExternalDestination__.js +1 -3
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/FieldPermissionV2__.js +2 -6
- package/out/concepts/FieldPermissionV2__.js.map +1 -1
- package/out/concepts/FlowConditionV2__.js +1 -3
- package/out/concepts/FlowConditionV2__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +1 -1
- package/out/concepts/ForEachStatement__.js +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js +2 -6
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/FrontendType__.d.ts +0 -4
- package/out/concepts/FrontendType__.js +2 -15
- package/out/concepts/FrontendType__.js.map +1 -1
- package/out/concepts/FrontendVariable__.js +1 -3
- package/out/concepts/FrontendVariable__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +0 -2
- package/out/concepts/Frontend__.js +8 -31
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +2 -6
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/HistoryProcessV2__.js +4 -12
- package/out/concepts/HistoryProcessV2__.js.map +1 -1
- package/out/concepts/I18nInfo__.d.ts +1 -1
- package/out/concepts/I18nInfo__.js +5 -9
- package/out/concepts/I18nInfo__.js.map +1 -1
- package/out/concepts/IconSetter__.js +1 -7
- package/out/concepts/IconSetter__.js.map +1 -1
- package/out/concepts/Identifier__.js +7 -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/ImportedInterface__.d.ts +1 -1
- package/out/concepts/ImportedInterface__.js +1 -3
- package/out/concepts/ImportedInterface__.js.map +1 -1
- package/out/concepts/InputSetter__.js +1 -7
- package/out/concepts/InputSetter__.js.map +1 -1
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +4 -12
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +12 -19
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +1 -3
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.js +3 -9
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicDeclaration__.js +3 -13
- package/out/concepts/LogicDeclaration__.js.map +1 -1
- package/out/concepts/LogicItem__.js +5 -31
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +6 -6
- package/out/concepts/Logic__.js +27 -36
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +2 -2
- package/out/concepts/MatchCase__.js +11 -11
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +1 -3
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +6 -2
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +1 -1
- package/out/concepts/MetadataType__.js +4 -12
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/MicroApp__.js +7 -21
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.d.ts +2 -2
- package/out/concepts/Module__.js +8 -24
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js +4 -12
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.js +6 -10
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +1 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +1 -1
- package/out/concepts/NewMap__.js +5 -2
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/NumberInputSetter__.js +5 -35
- package/out/concepts/NumberInputSetter__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -3
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OperatePermissionV2__.js +4 -12
- package/out/concepts/OperatePermissionV2__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +1 -1
- package/out/concepts/OqlQueryComponent__.js +2 -6
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +12 -26
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/ParamWithGroup__.js +2 -6
- package/out/concepts/ParamWithGroup__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -1
- package/out/concepts/Param__.js +2 -14
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +2 -6
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessBindV2__.js +2 -6
- package/out/concepts/ProcessBindV2__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +4 -12
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElementV2__.js +8 -24
- package/out/concepts/ProcessElementV2__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +10 -22
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -3
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js +0 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/ProcessV2__.js +6 -18
- package/out/concepts/ProcessV2__.js.map +1 -1
- package/out/concepts/Process__.js +3 -9
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/PropDeclaration__.d.ts +4 -0
- package/out/concepts/PropDeclaration__.js +19 -84
- package/out/concepts/PropDeclaration__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +2 -6
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +4 -12
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +5 -11
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +6 -14
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +12 -4
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +6 -2
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +5 -7
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js +4 -12
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +1 -1
- package/out/concepts/Return__.js +2 -10
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +4 -4
- package/out/concepts/Role__.js +6 -14
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +1 -3
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/SetterOption__.js +6 -34
- package/out/concepts/SetterOption__.js.map +1 -1
- package/out/concepts/SlotDeclaration__.js +5 -23
- package/out/concepts/SlotDeclaration__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +4 -12
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StaticString__.d.ts +1 -1
- package/out/concepts/StaticString__.js +6 -10
- package/out/concepts/StaticString__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -1
- package/out/concepts/StringLiteral__.js +2 -6
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +5 -5
- package/out/concepts/StructureProperty__.js +9 -14
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +0 -4
- package/out/concepts/Structure__.js +17 -20
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +1 -1
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/ThemeVariable__.js +1 -3
- package/out/concepts/ThemeVariable__.js.map +1 -1
- package/out/concepts/Theme__.js +2 -6
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +2 -2
- package/out/concepts/Transactional__.js +6 -12
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TriggerEvent__.js +1 -3
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.js +3 -9
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +2 -2
- package/out/concepts/TypeAnnotation__.js +24 -31
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +1 -3
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +1 -3
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js +1 -3
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +2 -6
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +1 -6
- package/out/concepts/ValidationRule__.js +4 -23
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +1 -1
- package/out/concepts/Variable__.js +2 -10
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlockWithImage__.js +2 -6
- package/out/concepts/ViewBlockWithImage__.js.map +1 -1
- package/out/concepts/ViewBlock__.js +3 -13
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponentDeclaration__.d.ts +1 -1
- package/out/concepts/ViewComponentDeclaration__.js +8 -36
- package/out/concepts/ViewComponentDeclaration__.js.map +1 -1
- package/out/concepts/ViewElement__.js +92 -83
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +22 -40
- package/out/concepts/View__.js.map +1 -1
- package/out/generator/genBundleFiles.js +1 -0
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/release-body/utils.js +2 -1
- package/out/generator/release-body/utils.js.map +1 -1
- package/out/natural/genNaturalTS.d.ts +44 -1
- package/out/natural/genNaturalTS.js +61 -5
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/getContext/index.js +3 -0
- package/out/natural/getContext/index.js.map +1 -1
- package/out/server/naslServer.js +24 -10
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +47 -0
- package/out/server/translator.js.map +1 -1
- package/out/translator/types.d.ts +4 -0
- package/out/translator/utils.d.ts +1 -0
- package/out/translator/utils.js +6 -1
- package/out/translator/utils.js.map +1 -1
- package/out/utils/env.d.ts +2 -0
- package/out/utils/env.js +3 -1
- package/out/utils/env.js.map +1 -1
- package/package.json +1 -1
- package/src/common/BaseNode.ts +3 -1
- package/src/concepts/AnonymousFunction__.ts +1 -1
- package/src/concepts/App__.ts +9 -27
- package/src/concepts/Argument__.ts +3 -7
- package/src/concepts/AssigneeV2__.ts +0 -2
- package/src/concepts/Assignee__.ts +0 -2
- package/src/concepts/AssignmentLine__.ts +0 -2
- package/src/concepts/Assignment__.ts +2 -4
- package/src/concepts/Attribute__.ts +9 -21
- package/src/concepts/AuthInterface__.ts +1 -3
- package/src/concepts/AuthLogicForCallInterface__.ts +4 -5
- package/src/concepts/AuthLogic__.ts +1 -3
- package/src/concepts/BackendVariable__.ts +5 -11
- package/src/concepts/Backend__.ts +1 -3
- package/src/concepts/BatchAssignment__.ts +4 -4
- package/src/concepts/BinaryExpression__.ts +9 -7
- package/src/concepts/BindAttribute__.ts +26 -38
- package/src/concepts/BindDirective__.ts +13 -27
- package/src/concepts/BindEvent__.ts +7 -13
- package/src/concepts/BindStyle__.ts +1 -3
- package/src/concepts/BooleanLiteral__.ts +1 -3
- package/src/concepts/BusinessComponent__.ts +16 -20
- package/src/concepts/BusinessLogic__.ts +7 -10
- package/src/concepts/CallConnector__.ts +3 -7
- package/src/concepts/CallEvent__.ts +2 -6
- package/src/concepts/CallFunction__.ts +7 -14
- package/src/concepts/CallInterface__.ts +8 -15
- package/src/concepts/CallLogic__.ts +39 -46
- package/src/concepts/CallQueryComponent__.ts +9 -22
- package/src/concepts/Comment__.ts +1 -3
- package/src/concepts/CompletionProperty__.ts +5 -15
- package/src/concepts/ConfigGroup__.ts +2 -7
- package/src/concepts/ConfigPropertyValue__.ts +3 -15
- package/src/concepts/ConfigProperty__.ts +3 -9
- package/src/concepts/Configuration__.ts +1 -4
- package/src/concepts/Connection__.ts +3 -9
- package/src/concepts/ConnectorLogic__.ts +2 -4
- package/src/concepts/ConnectorTriggerLauncher__.ts +13 -11
- package/src/concepts/ConnectorTrigger__.ts +12 -12
- package/src/concepts/Connector__.ts +3 -9
- package/src/concepts/Constant__.ts +2 -6
- package/src/concepts/CountersignPolicyV2__.ts +1 -3
- package/src/concepts/CountersignPolicy__.ts +1 -3
- package/src/concepts/DataSource__.ts +16 -18
- package/src/concepts/DatabaseTypeAnnotation__.ts +6 -11
- package/src/concepts/Destination__.ts +3 -9
- package/src/concepts/EntityIndex__.ts +6 -15
- package/src/concepts/EntityProperty__.ts +40 -56
- package/src/concepts/Entity__.ts +13 -18
- package/src/concepts/EnumItem__.ts +15 -10
- package/src/concepts/Enum__.ts +9 -10
- package/src/concepts/EventDeclaration__.ts +5 -13
- package/src/concepts/Event__.ts +5 -15
- package/src/concepts/ExternalDestination__.ts +2 -4
- package/src/concepts/FieldPermissionV2__.ts +2 -6
- package/src/concepts/FlowConditionV2__.ts +1 -3
- package/src/concepts/ForEachStatement__.ts +2 -2
- package/src/concepts/FrontendLibrary__.ts +2 -6
- package/src/concepts/FrontendType__.ts +2 -14
- package/src/concepts/FrontendVariable__.ts +1 -3
- package/src/concepts/Frontend__.ts +11 -35
- package/src/concepts/Function__.ts +2 -6
- package/src/concepts/HistoryProcessV2__.ts +4 -12
- package/src/concepts/I18nInfo__.ts +8 -15
- package/src/concepts/IconSetter__.ts +2 -4
- package/src/concepts/Identifier__.ts +9 -10
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/ImportedInterface__.ts +2 -4
- package/src/concepts/InputSetter__.ts +2 -4
- package/src/concepts/Integration__.ts +0 -1
- package/src/concepts/InterfaceParam__.ts +4 -12
- package/src/concepts/InterfaceTriggerEvent__.ts +1 -1
- package/src/concepts/Interface__.ts +16 -22
- package/src/concepts/JSBlock__.ts +1 -3
- package/src/concepts/JavaLogic__.ts +3 -9
- package/src/concepts/LogicDeclaration__.ts +4 -10
- package/src/concepts/LogicItem__.ts +9 -19
- package/src/concepts/Logic__.ts +46 -47
- package/src/concepts/MatchCase__.ts +12 -12
- package/src/concepts/Match__.ts +11 -8
- package/src/concepts/MemberExpression__.ts +8 -2
- package/src/concepts/MetadataType__.ts +9 -16
- package/src/concepts/MicroApp__.ts +7 -21
- package/src/concepts/Module__.ts +10 -26
- package/src/concepts/Namespace__.ts +4 -12
- package/src/concepts/NewComposite__.ts +18 -16
- package/src/concepts/NewList__.ts +1 -1
- package/src/concepts/NewMap__.ts +15 -6
- package/src/concepts/NumberInputSetter__.ts +10 -20
- package/src/concepts/NumericLiteral__.ts +1 -3
- package/src/concepts/OperatePermissionV2__.ts +4 -12
- package/src/concepts/OqlQueryComponent__.ts +3 -7
- package/src/concepts/OverriddenLogic__.ts +15 -25
- package/src/concepts/ParamWithGroup__.ts +2 -6
- package/src/concepts/Param__.ts +5 -9
- package/src/concepts/Point__.ts +2 -6
- package/src/concepts/ProcessBindV2__.ts +2 -6
- package/src/concepts/ProcessComponent__.ts +4 -12
- package/src/concepts/ProcessElementV2__.ts +11 -27
- package/src/concepts/ProcessElement__.ts +13 -23
- package/src/concepts/ProcessOutcome__.ts +1 -3
- package/src/concepts/ProcessOutcomes__.ts +0 -1
- package/src/concepts/ProcessV2__.ts +11 -19
- package/src/concepts/Process__.ts +3 -9
- package/src/concepts/PropDeclaration__.ts +31 -57
- package/src/concepts/QueryAggregateExpression__.ts +3 -8
- package/src/concepts/QueryFieldExpression__.ts +23 -30
- package/src/concepts/QueryFromExpression__.ts +5 -11
- package/src/concepts/QueryJoinExpression__.ts +7 -16
- package/src/concepts/QueryLimitExpression__.ts +16 -4
- package/src/concepts/QueryOrderByExpression__.ts +22 -13
- package/src/concepts/QuerySelectExpression__.ts +8 -13
- package/src/concepts/Rect__.ts +4 -12
- package/src/concepts/Return__.ts +4 -8
- package/src/concepts/Role__.ts +8 -16
- package/src/concepts/SelectMembers__.ts +1 -3
- package/src/concepts/SetterOption__.ts +10 -22
- package/src/concepts/SlotDeclaration__.ts +7 -17
- package/src/concepts/SqlQueryComponent__.ts +5 -13
- package/src/concepts/StaticString__.ts +9 -16
- package/src/concepts/StringLiteral__.ts +5 -11
- package/src/concepts/StructureProperty__.ts +16 -19
- package/src/concepts/Structure__.ts +20 -20
- package/src/concepts/SwitchCase__.ts +1 -1
- package/src/concepts/SwitchStatement__.ts +1 -1
- package/src/concepts/ThemeVariable__.ts +1 -3
- package/src/concepts/Theme__.ts +2 -6
- package/src/concepts/Transactional__.ts +10 -19
- package/src/concepts/TriggerEvent__.ts +1 -3
- package/src/concepts/TriggerLauncher__.ts +11 -15
- package/src/concepts/TypeAnnotation__.ts +50 -41
- package/src/concepts/TypeParam__.ts +1 -3
- package/src/concepts/UnaryExpression__.ts +1 -3
- package/src/concepts/Unparsed__.ts +1 -3
- package/src/concepts/UseComponent__.ts +2 -6
- package/src/concepts/ValidationRule__.ts +6 -17
- package/src/concepts/Variable__.ts +4 -8
- package/src/concepts/ViewBlockWithImage__.ts +2 -6
- package/src/concepts/ViewBlock__.ts +4 -10
- package/src/concepts/ViewComponentDeclaration__.ts +11 -27
- package/src/concepts/ViewElement__.ts +232 -157
- package/src/concepts/View__.ts +40 -54
- package/src/generator/genBundleFiles.ts +2 -1
- package/src/generator/release-body/utils.ts +3 -2
- package/src/natural/genNaturalTS.ts +91 -12
- package/src/natural/getContext/index.ts +3 -0
- package/src/server/naslServer.ts +24 -10
- package/src/server/translator.ts +49 -0
- package/src/translator/types.ts +4 -0
- package/src/translator/utils.ts +6 -0
- package/src/utils/env.ts +2 -0
- package/test/concepts/validation-rule/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -2
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
withGenerator,
|
|
11
11
|
TranslatorGenerator,
|
|
12
12
|
createDecoratorCode,
|
|
13
|
+
createDescriptionComment,
|
|
13
14
|
} from '../translator';
|
|
14
15
|
import type Namespace from './Namespace__';
|
|
15
16
|
import { CUSTOM_CONNECTOR_EDITABLE_SUFFIX } from './basics/constants';
|
|
@@ -54,27 +55,15 @@ export class Structure extends BaseNode {
|
|
|
54
55
|
/**
|
|
55
56
|
* 数据结构名称
|
|
56
57
|
*/
|
|
57
|
-
@property(
|
|
58
|
-
objectRef: '',
|
|
59
|
-
})
|
|
58
|
+
@property()
|
|
60
59
|
name: string = '';
|
|
61
60
|
|
|
62
61
|
/**
|
|
63
62
|
* 数据结构描述
|
|
64
63
|
*/
|
|
65
|
-
@property(
|
|
66
|
-
objectRef: '',
|
|
67
|
-
})
|
|
64
|
+
@property()
|
|
68
65
|
description: string;
|
|
69
66
|
|
|
70
|
-
/**
|
|
71
|
-
* 数据结构来源
|
|
72
|
-
*/
|
|
73
|
-
@property({
|
|
74
|
-
objectRef: '',
|
|
75
|
-
})
|
|
76
|
-
origin: 'CallQueryComponent';
|
|
77
|
-
|
|
78
67
|
/**
|
|
79
68
|
* 类型参数列表
|
|
80
69
|
*/
|
|
@@ -83,7 +72,7 @@ export class Structure extends BaseNode {
|
|
|
83
72
|
isArray: true,
|
|
84
73
|
defaultValue: null,
|
|
85
74
|
})
|
|
86
|
-
typeParams?: Array<TypeParam
|
|
75
|
+
typeParams?: Array<TypeParam>;
|
|
87
76
|
|
|
88
77
|
/**
|
|
89
78
|
* 数据结构属性列表
|
|
@@ -528,7 +517,7 @@ export class Structure extends BaseNode {
|
|
|
528
517
|
* 是否可编辑
|
|
529
518
|
* */
|
|
530
519
|
get readonly() {
|
|
531
|
-
return !!this.module || this.
|
|
520
|
+
return !!this.module || this.isConnector;
|
|
532
521
|
}
|
|
533
522
|
|
|
534
523
|
/* 删除空数据模块 */
|
|
@@ -566,13 +555,22 @@ export class Structure extends BaseNode {
|
|
|
566
555
|
|
|
567
556
|
@withSourceMap()
|
|
568
557
|
toNaturalTS(state = createCompilerState()): string {
|
|
569
|
-
let code =
|
|
558
|
+
let code = '';
|
|
559
|
+
if (state.descriptionComment)
|
|
560
|
+
code += createDescriptionComment(state, this, ['description']);
|
|
561
|
+
code = `class ${this.name}`;
|
|
570
562
|
|
|
571
563
|
if (this.typeParams?.length) {
|
|
572
|
-
code += `<${this.typeParams
|
|
564
|
+
code += `<${this.typeParams
|
|
565
|
+
.map((item) => item.toNaturalTS(shiftState(state, code, { inline: true })))
|
|
566
|
+
.join(', ')}>`;
|
|
573
567
|
}
|
|
574
568
|
|
|
575
|
-
code += ` {
|
|
569
|
+
code += ` {`;
|
|
570
|
+
if (state.descriptionComment && this.description)
|
|
571
|
+
code += `/* ${this.description} */`;
|
|
572
|
+
code += '\n';
|
|
573
|
+
|
|
576
574
|
// code += `${indent(state.tabSize + 1)}__name: '${this.getNamespace()}.${this.name}';\n`;
|
|
577
575
|
this.properties.forEach((property) => {
|
|
578
576
|
code += indent(state.tabSize + 1);
|
|
@@ -591,7 +589,9 @@ export class Structure extends BaseNode {
|
|
|
591
589
|
|
|
592
590
|
code += `struct ${this.name}`;
|
|
593
591
|
if (this.typeParams?.length) {
|
|
594
|
-
code += `<${this.typeParams
|
|
592
|
+
code += `<${this.typeParams
|
|
593
|
+
.map((item) => item.toNaturalTS(shiftState(state, code, { inline: true })))
|
|
594
|
+
.join(', ')}>`;
|
|
595
595
|
}
|
|
596
596
|
|
|
597
597
|
code += ` {\n`;
|
|
@@ -256,7 +256,7 @@ export class SwitchStatement extends LogicItem {
|
|
|
256
256
|
toTextualNASL(state = createCompilerState()): string {
|
|
257
257
|
let code = 'switch {\n';
|
|
258
258
|
this.cases.forEach((item, index) => {
|
|
259
|
-
|
|
259
|
+
code += item.toTextualNASL(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
260
260
|
});
|
|
261
261
|
code += `${indent(state.tabSize)}}\n`;
|
|
262
262
|
return code;
|
package/src/concepts/Theme__.ts
CHANGED
|
@@ -35,17 +35,13 @@ export class Theme extends BaseNode {
|
|
|
35
35
|
/**
|
|
36
36
|
* 主题标题
|
|
37
37
|
*/
|
|
38
|
-
@property(
|
|
39
|
-
objectRef: '',
|
|
40
|
-
})
|
|
38
|
+
@property()
|
|
41
39
|
title: string = '默认主题样式';
|
|
42
40
|
|
|
43
41
|
/**
|
|
44
42
|
* 主题变量 Map
|
|
45
43
|
*/
|
|
46
|
-
@property(
|
|
47
|
-
objectRef: '',
|
|
48
|
-
})
|
|
44
|
+
@property()
|
|
49
45
|
variableMap: {
|
|
50
46
|
[name: string]: string;
|
|
51
47
|
} = {};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
withSourceMap,
|
|
3
|
-
createCompilerState,
|
|
4
|
-
} from '../translator';
|
|
1
|
+
import { withSourceMap, createCompilerState } from '../translator';
|
|
5
2
|
import Logic from './Logic__';
|
|
6
3
|
import Module from './Module__';
|
|
7
4
|
import Connector from './Connector__';
|
|
@@ -46,26 +43,20 @@ export class Transactional extends BaseNode {
|
|
|
46
43
|
/**
|
|
47
44
|
* 事务是否生效
|
|
48
45
|
*/
|
|
49
|
-
@property(
|
|
50
|
-
objectRef: '',
|
|
51
|
-
})
|
|
46
|
+
@property()
|
|
52
47
|
enabled: boolean;
|
|
53
48
|
|
|
54
49
|
/**
|
|
55
50
|
* 事务的传播机制
|
|
56
51
|
*/
|
|
57
|
-
@property(
|
|
58
|
-
|
|
59
|
-
})
|
|
60
|
-
propagation: 'REQUIRED' | 'REQUIRES_NEW' | 'SUPPORTS' | 'NOT_SUPPORTED' | 'MANDATORY' | 'NEVER';
|
|
52
|
+
@property()
|
|
53
|
+
propagation?: 'REQUIRED' | 'REQUIRES_NEW' | 'SUPPORTS' | 'NOT_SUPPORTED' | 'MANDATORY' | 'NEVER';
|
|
61
54
|
|
|
62
55
|
/**
|
|
63
56
|
* 事务的隔离级别
|
|
64
57
|
*/
|
|
65
|
-
@property(
|
|
66
|
-
|
|
67
|
-
})
|
|
68
|
-
isolation: 'DEFAULT' | 'READ_UNCOMMITTED' | 'READ_COMMITTED' | 'REPEATABLE_READ' | 'SERIALIZABLE';
|
|
58
|
+
@property()
|
|
59
|
+
isolation?: 'DEFAULT' | 'READ_UNCOMMITTED' | 'READ_COMMITTED' | 'REPEATABLE_READ' | 'SERIALIZABLE';
|
|
69
60
|
|
|
70
61
|
/**
|
|
71
62
|
* @param source 需要合并的部分参数
|
|
@@ -116,15 +107,15 @@ export class Transactional extends BaseNode {
|
|
|
116
107
|
});
|
|
117
108
|
}
|
|
118
109
|
|
|
110
|
+
//================================================================================
|
|
111
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
112
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
113
|
+
//================================================================================
|
|
119
114
|
@withSourceMap()
|
|
120
115
|
toNaturalTS(state = createCompilerState()): string {
|
|
121
116
|
return '';
|
|
122
117
|
}
|
|
123
118
|
|
|
124
|
-
//================================================================================
|
|
125
|
-
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
126
|
-
// 自动生成的代码已结束。下面可以手动编写。
|
|
127
|
-
//================================================================================
|
|
128
119
|
/**
|
|
129
120
|
* 祖先 Logic
|
|
130
121
|
*/
|
|
@@ -13,6 +13,7 @@ import LogicItem from './LogicItem__';
|
|
|
13
13
|
|
|
14
14
|
import App from './App__';
|
|
15
15
|
import Module from './Module__';
|
|
16
|
+
import ConnectorTriggerLauncher from './ConnectorTriggerLauncher__';
|
|
16
17
|
//================================================================================
|
|
17
18
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
18
19
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -26,7 +27,6 @@ import * as types from './utils/types';
|
|
|
26
27
|
import * as asserts from './utils/asserts';
|
|
27
28
|
import BaseNode from '../common/BaseNode';
|
|
28
29
|
import Identifier from './Identifier__';
|
|
29
|
-
import ConnectorTriggerLauncher from './ConnectorTriggerLauncher__';
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
32
|
* 触发器启动器
|
|
@@ -52,25 +52,19 @@ export class TriggerLauncher extends BaseNode {
|
|
|
52
52
|
/**
|
|
53
53
|
* 触发器启动器名称
|
|
54
54
|
*/
|
|
55
|
-
@property(
|
|
56
|
-
objectRef: '',
|
|
57
|
-
})
|
|
55
|
+
@property()
|
|
58
56
|
name: string = '';
|
|
59
57
|
|
|
60
58
|
/**
|
|
61
59
|
* calleeNamespace
|
|
62
60
|
*/
|
|
63
|
-
@property(
|
|
64
|
-
objectRef: '',
|
|
65
|
-
})
|
|
61
|
+
@property()
|
|
66
62
|
calleeNamespace: string;
|
|
67
63
|
|
|
68
64
|
/**
|
|
69
65
|
* calleeName
|
|
70
66
|
*/
|
|
71
|
-
@property(
|
|
72
|
-
objectRef: '',
|
|
73
|
-
})
|
|
67
|
+
@property()
|
|
74
68
|
calleeName: string;
|
|
75
69
|
|
|
76
70
|
/**
|
|
@@ -166,12 +160,14 @@ export class TriggerLauncher extends BaseNode {
|
|
|
166
160
|
// console.log('test', self.connectorTrigger?.triggerEvent.callBackLogic.typeArguments[0])
|
|
167
161
|
// 仅仅作引用查找不需要入参校验
|
|
168
162
|
if (self.concept === 'ConnectorTriggerLauncher') {
|
|
169
|
-
const connectorTrigger = (self as unknown as ConnectorTriggerLauncher).connectorTrigger
|
|
170
|
-
code += `let trigger = connector.${(self as unknown as ConnectorTriggerLauncher).connector.name}.triggers.${
|
|
171
|
-
|
|
172
|
-
|
|
163
|
+
const connectorTrigger = (self as unknown as ConnectorTriggerLauncher).connectorTrigger;
|
|
164
|
+
code += `let trigger = connector.${(self as unknown as ConnectorTriggerLauncher).connector.name}.triggers.${
|
|
165
|
+
connectorTrigger.tsName
|
|
166
|
+
}();\n`;
|
|
167
|
+
let stashParams = '';
|
|
168
|
+
code += `let params: typeof trigger.params\n`;
|
|
173
169
|
if (connectorTrigger?.triggerEvent?.callBackLogic?.typeArguments?.[0]) {
|
|
174
|
-
stashParams = 'params'
|
|
170
|
+
stashParams = 'params';
|
|
175
171
|
}
|
|
176
172
|
code += `let result: typeof trigger.result`;
|
|
177
173
|
code += ` = ${self.callBackLogicKey}(${stashParams})`;
|
|
@@ -137,25 +137,19 @@ export class TypeAnnotation extends BaseNode {
|
|
|
137
137
|
/**
|
|
138
138
|
* 类型种类
|
|
139
139
|
*/
|
|
140
|
-
@property(
|
|
141
|
-
objectRef: '',
|
|
142
|
-
})
|
|
140
|
+
@property()
|
|
143
141
|
typeKind: 'primitive' | 'reference' | 'generic' | 'typeParam' | 'function' | 'union' | 'anonymousStructure';
|
|
144
142
|
|
|
145
143
|
/**
|
|
146
144
|
* 类型命名空间
|
|
147
145
|
*/
|
|
148
|
-
@property(
|
|
149
|
-
objectRef: '',
|
|
150
|
-
})
|
|
146
|
+
@property()
|
|
151
147
|
typeNamespace: string;
|
|
152
148
|
|
|
153
149
|
/**
|
|
154
150
|
* 类型名称
|
|
155
151
|
*/
|
|
156
|
-
@property(
|
|
157
|
-
objectRef: '',
|
|
158
|
-
})
|
|
152
|
+
@property()
|
|
159
153
|
typeName: string;
|
|
160
154
|
|
|
161
155
|
/**
|
|
@@ -166,7 +160,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
166
160
|
isArray: true,
|
|
167
161
|
defaultValue: null,
|
|
168
162
|
})
|
|
169
|
-
typeArguments?: Array<TypeAnnotation
|
|
163
|
+
typeArguments?: Array<TypeAnnotation>;
|
|
170
164
|
|
|
171
165
|
/**
|
|
172
166
|
* 返回类型
|
|
@@ -176,14 +170,12 @@ export class TypeAnnotation extends BaseNode {
|
|
|
176
170
|
isArray: true,
|
|
177
171
|
defaultValue: null,
|
|
178
172
|
})
|
|
179
|
-
returnType?: Array<TypeAnnotation
|
|
173
|
+
returnType?: Array<TypeAnnotation>;
|
|
180
174
|
|
|
181
175
|
/**
|
|
182
176
|
* 是否是推断出来的
|
|
183
177
|
*/
|
|
184
|
-
@property(
|
|
185
|
-
objectRef: '',
|
|
186
|
-
})
|
|
178
|
+
@property()
|
|
187
179
|
inferred: boolean;
|
|
188
180
|
|
|
189
181
|
/**
|
|
@@ -194,15 +186,13 @@ export class TypeAnnotation extends BaseNode {
|
|
|
194
186
|
isArray: true,
|
|
195
187
|
defaultValue: null,
|
|
196
188
|
})
|
|
197
|
-
properties?: Array<StructureProperty
|
|
189
|
+
properties?: Array<StructureProperty>;
|
|
198
190
|
|
|
199
191
|
/**
|
|
200
192
|
* 规则对象
|
|
201
193
|
*/
|
|
202
|
-
@property(
|
|
203
|
-
|
|
204
|
-
})
|
|
205
|
-
ruleMap: Map<string, number>;
|
|
194
|
+
@property()
|
|
195
|
+
ruleMap: Record<string, number>;
|
|
206
196
|
|
|
207
197
|
/**
|
|
208
198
|
* @param source 需要合并的部分参数
|
|
@@ -220,7 +210,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
220
210
|
/**
|
|
221
211
|
* 设置规则对象
|
|
222
212
|
*/
|
|
223
|
-
setRuleMap(ruleMap:
|
|
213
|
+
setRuleMap(ruleMap: Record<string, number>) {
|
|
224
214
|
const object = {
|
|
225
215
|
ruleMap,
|
|
226
216
|
};
|
|
@@ -713,10 +703,11 @@ export class TypeAnnotation extends BaseNode {
|
|
|
713
703
|
} else if (this.typeKind === 'reference') {
|
|
714
704
|
return this.typeName;
|
|
715
705
|
} else if (this.typeKind === 'generic') {
|
|
716
|
-
return `${this.typeName}<${
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
706
|
+
return `${this.typeName}<${
|
|
707
|
+
!this.typeArguments?.length
|
|
708
|
+
? 'T'
|
|
709
|
+
: this.typeArguments.map((arg) => arg?.typeTitle || arg?.name || 'T').join(', ')
|
|
710
|
+
}>`;
|
|
720
711
|
} else if (this.typeKind === 'anonymousStructure') {
|
|
721
712
|
return `{ ${this.properties
|
|
722
713
|
?.map(({ name, typeAnnotation }) => `${name}: ${typeAnnotation ? typeAnnotation?.typeTitle : '未知'}`)
|
|
@@ -740,10 +731,11 @@ export class TypeAnnotation extends BaseNode {
|
|
|
740
731
|
} else if (this.typeKind === 'reference') {
|
|
741
732
|
return this.typeName;
|
|
742
733
|
} else if (this.typeKind === 'generic') {
|
|
743
|
-
return `${this.typeName}<${
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
734
|
+
return `${this.typeName}<${
|
|
735
|
+
!this?.typeArguments?.length
|
|
736
|
+
? 'T'
|
|
737
|
+
: this.typeArguments.map((arg) => arg?.typeInlineTitle || arg?.name || 'T').join(', ')
|
|
738
|
+
}>`;
|
|
747
739
|
} else if (this.typeKind === 'anonymousStructure') {
|
|
748
740
|
return `{ ${this.properties
|
|
749
741
|
?.map(({ name, typeAnnotation }) => `${name}: ${typeAnnotation ? typeAnnotation?.typeInlineTitle : '未知'}`)
|
|
@@ -961,12 +953,13 @@ export class TypeAnnotation extends BaseNode {
|
|
|
961
953
|
let code = `{ `;
|
|
962
954
|
yield* wrapForEach(self.properties || [], function* warpForEachGenerator(property, i) {
|
|
963
955
|
code += `${property.name}: `;
|
|
964
|
-
code += `${
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
956
|
+
code += `${
|
|
957
|
+
property.typeAnnotation
|
|
958
|
+
? yield* property.typeAnnotation.toEmbeddedTS(
|
|
959
|
+
shiftState(state, code, { inline: true, tabSize: (state?.tabSize || 0) + 1 }),
|
|
960
|
+
)
|
|
961
|
+
: '`未知`'
|
|
962
|
+
}`;
|
|
970
963
|
code += ', ';
|
|
971
964
|
});
|
|
972
965
|
code += `__name: "AStructure_${self.hash}" `;
|
|
@@ -986,7 +979,11 @@ export class TypeAnnotation extends BaseNode {
|
|
|
986
979
|
@withSourceMap()
|
|
987
980
|
toNaturalTS(state = createCompilerState()): string {
|
|
988
981
|
if (this.typeKind === 'primitive' || this.typeKind === 'reference') {
|
|
989
|
-
if (
|
|
982
|
+
if (
|
|
983
|
+
this.typeKind === 'reference' &&
|
|
984
|
+
this.typeNamespace &&
|
|
985
|
+
this.typeNamespace.match(/\.(enums|entities|structures)$/)
|
|
986
|
+
) {
|
|
990
987
|
if (this.tsCalleeNamespace.startsWith('nasl.ui')) {
|
|
991
988
|
return `${this.tsCalleeNamespace}.${this.typeName}`;
|
|
992
989
|
}
|
|
@@ -1036,8 +1033,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
1036
1033
|
@withSourceMap()
|
|
1037
1034
|
toTextualNASL(state = createCompilerState()): string {
|
|
1038
1035
|
if (this.typeKind === 'primitive') {
|
|
1039
|
-
if (this.typeName === 'Long')
|
|
1040
|
-
return 'Integer';
|
|
1036
|
+
if (this.typeName === 'Long') return 'Integer';
|
|
1041
1037
|
return this.typeName;
|
|
1042
1038
|
} else if (this.typeKind === 'reference') {
|
|
1043
1039
|
return textualNamespace(`${this.typeNamespace}.${this.typeName}`);
|
|
@@ -1228,9 +1224,22 @@ export class TypeAnnotation extends BaseNode {
|
|
|
1228
1224
|
// 由于 序列化 出来的 TypeAnnotation 会有很多多余的属性
|
|
1229
1225
|
// 因此增加白名单,只有这些值才会被比较,其他均会被忽略
|
|
1230
1226
|
const whiteList = [
|
|
1231
|
-
'concept',
|
|
1232
|
-
'
|
|
1233
|
-
'
|
|
1227
|
+
'concept',
|
|
1228
|
+
'typeKind',
|
|
1229
|
+
'typeNamespace',
|
|
1230
|
+
'typeName',
|
|
1231
|
+
'typeArguments',
|
|
1232
|
+
'returnType',
|
|
1233
|
+
'inferred',
|
|
1234
|
+
'ruleMap',
|
|
1235
|
+
'properties',
|
|
1236
|
+
'name',
|
|
1237
|
+
'label',
|
|
1238
|
+
'description',
|
|
1239
|
+
'typeAnnotation',
|
|
1240
|
+
'required',
|
|
1241
|
+
'defaultValue',
|
|
1242
|
+
'jsonName',
|
|
1234
1243
|
];
|
|
1235
1244
|
const typeAnnotation1 = this.toJSON();
|
|
1236
1245
|
const typeAnnotation2 = typeAnnotation.toJSON();
|
|
@@ -1355,7 +1364,7 @@ export class TypeAnnotation extends BaseNode {
|
|
|
1355
1364
|
this.properties.splice(index, 0, property);
|
|
1356
1365
|
return property;
|
|
1357
1366
|
}
|
|
1358
|
-
|
|
1367
|
+
|
|
1359
1368
|
_addProperty(options?: string | Partial<StructureProperty> | StructureProperty) {
|
|
1360
1369
|
const index = this.properties.length;
|
|
1361
1370
|
return this._insertPropertyAt(options as any, index);
|
|
@@ -35,17 +35,13 @@ export class UseComponent extends BaseNode {
|
|
|
35
35
|
/**
|
|
36
36
|
* type
|
|
37
37
|
*/
|
|
38
|
-
@property(
|
|
39
|
-
objectRef: '',
|
|
40
|
-
})
|
|
38
|
+
@property()
|
|
41
39
|
type: string;
|
|
42
40
|
|
|
43
41
|
/**
|
|
44
42
|
* 需要传入的属性
|
|
45
43
|
*/
|
|
46
|
-
@property(
|
|
47
|
-
objectRef: '',
|
|
48
|
-
})
|
|
44
|
+
@property()
|
|
49
45
|
attrs: string;
|
|
50
46
|
|
|
51
47
|
/**
|
|
@@ -56,17 +56,13 @@ export class ValidationRule extends LogicItem {
|
|
|
56
56
|
/**
|
|
57
57
|
* calleeNamespace
|
|
58
58
|
*/
|
|
59
|
-
@property(
|
|
60
|
-
objectRef: '',
|
|
61
|
-
})
|
|
59
|
+
@property()
|
|
62
60
|
calleeNamespace: string;
|
|
63
61
|
|
|
64
62
|
/**
|
|
65
63
|
* calleeName
|
|
66
64
|
*/
|
|
67
|
-
@property(
|
|
68
|
-
objectRef: '',
|
|
69
|
-
})
|
|
65
|
+
@property()
|
|
70
66
|
calleeName: string;
|
|
71
67
|
|
|
72
68
|
/**
|
|
@@ -85,7 +81,7 @@ export class ValidationRule extends LogicItem {
|
|
|
85
81
|
@property({
|
|
86
82
|
objectRef: 'LogicItem',
|
|
87
83
|
})
|
|
88
|
-
errorMessage?: LogicItem
|
|
84
|
+
errorMessage?: LogicItem;
|
|
89
85
|
|
|
90
86
|
/**
|
|
91
87
|
* 验证对象
|
|
@@ -93,14 +89,12 @@ export class ValidationRule extends LogicItem {
|
|
|
93
89
|
@property({
|
|
94
90
|
objectRef: 'LogicItem',
|
|
95
91
|
})
|
|
96
|
-
target?: LogicItem
|
|
92
|
+
target?: LogicItem;
|
|
97
93
|
|
|
98
94
|
/**
|
|
99
95
|
* 是否启用服务端验证
|
|
100
96
|
*/
|
|
101
|
-
@property(
|
|
102
|
-
objectRef: '',
|
|
103
|
-
})
|
|
97
|
+
@property()
|
|
104
98
|
enableServerValidation?: boolean = true;
|
|
105
99
|
|
|
106
100
|
/**
|
|
@@ -276,12 +270,7 @@ export class ValidationRule extends LogicItem {
|
|
|
276
270
|
//================================================================================
|
|
277
271
|
|
|
278
272
|
public static getDefaultOptions() {
|
|
279
|
-
return {
|
|
280
|
-
target: {
|
|
281
|
-
concept: 'Identifier',
|
|
282
|
-
name: '',
|
|
283
|
-
},
|
|
284
|
-
};
|
|
273
|
+
return {};
|
|
285
274
|
}
|
|
286
275
|
|
|
287
276
|
toInViewMethod() {
|
|
@@ -76,18 +76,14 @@ export class Variable extends BaseNode {
|
|
|
76
76
|
/**
|
|
77
77
|
* 变量名称
|
|
78
78
|
*/
|
|
79
|
-
@property(
|
|
80
|
-
objectRef: '',
|
|
81
|
-
})
|
|
79
|
+
@property()
|
|
82
80
|
name: string = '';
|
|
83
81
|
|
|
84
82
|
/**
|
|
85
83
|
* 变量描述
|
|
86
84
|
*/
|
|
87
|
-
@property(
|
|
88
|
-
|
|
89
|
-
})
|
|
90
|
-
description: string;
|
|
85
|
+
@property()
|
|
86
|
+
description?: string;
|
|
91
87
|
|
|
92
88
|
/**
|
|
93
89
|
* 类型
|
|
@@ -103,7 +99,7 @@ export class Variable extends BaseNode {
|
|
|
103
99
|
@property({
|
|
104
100
|
objectRef: 'DefaultValue',
|
|
105
101
|
})
|
|
106
|
-
defaultValue?: DefaultValue
|
|
102
|
+
defaultValue?: DefaultValue;
|
|
107
103
|
|
|
108
104
|
/**
|
|
109
105
|
* @param source 需要合并的部分参数
|
|
@@ -36,17 +36,13 @@ export class ViewBlockWithImage extends ViewBlock {
|
|
|
36
36
|
/**
|
|
37
37
|
* 截图
|
|
38
38
|
*/
|
|
39
|
-
@property(
|
|
40
|
-
objectRef: '',
|
|
41
|
-
})
|
|
39
|
+
@property()
|
|
42
40
|
screenshot: string;
|
|
43
41
|
|
|
44
42
|
/**
|
|
45
43
|
* 手绘
|
|
46
44
|
*/
|
|
47
|
-
@property(
|
|
48
|
-
objectRef: '',
|
|
49
|
-
})
|
|
45
|
+
@property()
|
|
50
46
|
drawing: string;
|
|
51
47
|
|
|
52
48
|
/**
|
|
@@ -35,26 +35,20 @@ export class ViewBlock extends BaseNode {
|
|
|
35
35
|
/**
|
|
36
36
|
* 标题
|
|
37
37
|
*/
|
|
38
|
-
@property(
|
|
39
|
-
objectRef: '',
|
|
40
|
-
})
|
|
38
|
+
@property()
|
|
41
39
|
title: string;
|
|
42
40
|
|
|
43
41
|
/**
|
|
44
42
|
* 代码
|
|
45
43
|
*/
|
|
46
|
-
@property(
|
|
47
|
-
objectRef: '',
|
|
48
|
-
})
|
|
44
|
+
@property()
|
|
49
45
|
code: string;
|
|
50
46
|
|
|
51
47
|
/**
|
|
52
48
|
* 描述
|
|
53
49
|
*/
|
|
54
|
-
@property(
|
|
55
|
-
|
|
56
|
-
})
|
|
57
|
-
description?: string = null;
|
|
50
|
+
@property()
|
|
51
|
+
description?: string;
|
|
58
52
|
|
|
59
53
|
/**
|
|
60
54
|
* @param source 需要合并的部分参数
|