@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
package/src/concepts/View__.ts
CHANGED
|
@@ -86,33 +86,25 @@ export class View extends BaseNode {
|
|
|
86
86
|
/**
|
|
87
87
|
* 页面模板 Id
|
|
88
88
|
*/
|
|
89
|
-
@property(
|
|
90
|
-
objectRef: '',
|
|
91
|
-
})
|
|
89
|
+
@property()
|
|
92
90
|
pageTemplateId: string;
|
|
93
91
|
|
|
94
92
|
/**
|
|
95
93
|
* 页面名称
|
|
96
94
|
*/
|
|
97
|
-
@property(
|
|
98
|
-
objectRef: '',
|
|
99
|
-
})
|
|
95
|
+
@property()
|
|
100
96
|
name: string = '';
|
|
101
97
|
|
|
102
98
|
/**
|
|
103
99
|
* 唯一标识
|
|
104
100
|
*/
|
|
105
|
-
@property(
|
|
106
|
-
objectRef: '',
|
|
107
|
-
})
|
|
101
|
+
@property()
|
|
108
102
|
uuid: string;
|
|
109
103
|
|
|
110
104
|
/**
|
|
111
105
|
* 页面标题
|
|
112
106
|
*/
|
|
113
|
-
@property(
|
|
114
|
-
objectRef: '',
|
|
115
|
-
})
|
|
107
|
+
@property()
|
|
116
108
|
title: string;
|
|
117
109
|
|
|
118
110
|
/**
|
|
@@ -126,49 +118,37 @@ export class View extends BaseNode {
|
|
|
126
118
|
/**
|
|
127
119
|
* 权限控制
|
|
128
120
|
*/
|
|
129
|
-
@property(
|
|
130
|
-
objectRef: '',
|
|
131
|
-
})
|
|
121
|
+
@property()
|
|
132
122
|
auth: boolean;
|
|
133
123
|
|
|
134
124
|
/**
|
|
135
125
|
* 权限资源描述
|
|
136
126
|
*/
|
|
137
|
-
@property(
|
|
138
|
-
objectRef: '',
|
|
139
|
-
})
|
|
127
|
+
@property()
|
|
140
128
|
authDescription: string;
|
|
141
129
|
|
|
142
130
|
/**
|
|
143
131
|
* 是否是默认跳转的页面
|
|
144
132
|
*/
|
|
145
|
-
@property(
|
|
146
|
-
objectRef: '',
|
|
147
|
-
})
|
|
133
|
+
@property()
|
|
148
134
|
isIndex: boolean;
|
|
149
135
|
|
|
150
136
|
/**
|
|
151
137
|
* 未解析的模板代码
|
|
152
138
|
*/
|
|
153
|
-
@property(
|
|
154
|
-
objectRef: '',
|
|
155
|
-
})
|
|
139
|
+
@property()
|
|
156
140
|
template: string;
|
|
157
141
|
|
|
158
142
|
/**
|
|
159
143
|
* 未解析的逻辑代码
|
|
160
144
|
*/
|
|
161
|
-
@property(
|
|
162
|
-
objectRef: '',
|
|
163
|
-
})
|
|
145
|
+
@property()
|
|
164
146
|
script: string;
|
|
165
147
|
|
|
166
148
|
/**
|
|
167
149
|
* 未解析的样式代码
|
|
168
150
|
*/
|
|
169
|
-
@property(
|
|
170
|
-
objectRef: '',
|
|
171
|
-
})
|
|
151
|
+
@property()
|
|
172
152
|
style: string;
|
|
173
153
|
|
|
174
154
|
/**
|
|
@@ -225,7 +205,6 @@ export class View extends BaseNode {
|
|
|
225
205
|
* 绑定的角色
|
|
226
206
|
*/
|
|
227
207
|
@property({
|
|
228
|
-
objectRef: '',
|
|
229
208
|
isArray: true,
|
|
230
209
|
defaultValue: [],
|
|
231
210
|
})
|
|
@@ -1792,26 +1771,30 @@ export class View extends BaseNode {
|
|
|
1792
1771
|
methods: {
|
|
1793
1772
|
async onKeyDown(e) {
|
|
1794
1773
|
${this.bindEvents
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1774
|
+
.filter((event) => ['keydown'].includes(event.name))
|
|
1775
|
+
.map((event) => `await this.${event.view.name}_${event.name}(e);`)
|
|
1776
|
+
.join('\n')}
|
|
1798
1777
|
},
|
|
1799
1778
|
async onKeyUp(e) {
|
|
1800
1779
|
${this.bindEvents
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1780
|
+
.filter((event) => ['keyup'].includes(event.name))
|
|
1781
|
+
.map((event) => `await this.${event.view.name}_${event.name}(e);`)
|
|
1782
|
+
.join('\n')}
|
|
1804
1783
|
}
|
|
1805
1784
|
}
|
|
1806
1785
|
};\n`;
|
|
1807
1786
|
code += keyboardEventMixinCode;
|
|
1808
1787
|
const processDetailFrom: ViewElement = this.getViewProcessForm(),
|
|
1809
|
-
hasProcessDetailFrom = !!processDetailFrom
|
|
1788
|
+
hasProcessDetailFrom = !!processDetailFrom,
|
|
1789
|
+
processV2 = this.getDestinationProcessV2();
|
|
1810
1790
|
if (hasProcessDetailFrom) {
|
|
1811
1791
|
const processDetailFromMixinCode = `const processDetailFromMixin = {
|
|
1812
1792
|
data() {
|
|
1813
1793
|
return {
|
|
1814
1794
|
processDetailFormData: {},
|
|
1795
|
+
${processV2.name} : {
|
|
1796
|
+
data: {},
|
|
1797
|
+
},
|
|
1815
1798
|
${processDetailFrom.getBindAttribute('processPrefix')?.value} : {
|
|
1816
1799
|
data: {},
|
|
1817
1800
|
}
|
|
@@ -1986,8 +1969,9 @@ export class View extends BaseNode {
|
|
|
1986
1969
|
parent = parent.parentNode;
|
|
1987
1970
|
}
|
|
1988
1971
|
}
|
|
1989
|
-
return `/embedded/${this.getAncestor('App')?.name}/frontendTypes/${
|
|
1990
|
-
|
|
1972
|
+
return `/embedded/${this.getAncestor('App')?.name}/frontendTypes/${
|
|
1973
|
+
this.getAncestor('FrontendType')?.name
|
|
1974
|
+
}/frontends/${this.getAncestor('Frontend')?.name}/views/${pathName}.ts`;
|
|
1991
1975
|
}
|
|
1992
1976
|
|
|
1993
1977
|
getNamespace(): string {
|
|
@@ -2033,10 +2017,15 @@ export class View extends BaseNode {
|
|
|
2033
2017
|
}
|
|
2034
2018
|
|
|
2035
2019
|
// 获取当前element,铺平
|
|
2036
|
-
elementsAttrs(
|
|
2020
|
+
elementsAttrs(
|
|
2021
|
+
elements: Array<ViewElement>,
|
|
2022
|
+
componentList: Array<ViewElement>,
|
|
2023
|
+
allComponentList: Array<ViewElement & { currentIndex: number }>,
|
|
2024
|
+
currentIndex: number,
|
|
2025
|
+
) {
|
|
2037
2026
|
if (elements) {
|
|
2038
2027
|
elements.forEach((item: ViewElement & { currentIndex: number }) => {
|
|
2039
|
-
let index = currentIndex ?? -1
|
|
2028
|
+
let index = currentIndex ?? -1;
|
|
2040
2029
|
if (item.tag === 'template' && item.haveScope()) {
|
|
2041
2030
|
index += 1;
|
|
2042
2031
|
}
|
|
@@ -2044,7 +2033,7 @@ export class View extends BaseNode {
|
|
|
2044
2033
|
componentList.push(item);
|
|
2045
2034
|
}
|
|
2046
2035
|
item.currentIndex = index;
|
|
2047
|
-
allComponentList.push(item)
|
|
2036
|
+
allComponentList.push(item);
|
|
2048
2037
|
if (item.children.length > 0) {
|
|
2049
2038
|
this.elementsAttrs(item.children, componentList, allComponentList, index);
|
|
2050
2039
|
}
|
|
@@ -2092,8 +2081,6 @@ export class View extends BaseNode {
|
|
|
2092
2081
|
return res;
|
|
2093
2082
|
}
|
|
2094
2083
|
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
2084
|
@withSourceMapGenerator
|
|
2098
2085
|
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
2099
2086
|
const self = this;
|
|
@@ -2125,14 +2112,13 @@ export class View extends BaseNode {
|
|
|
2125
2112
|
const callFunctionAdvanceMap: Map<Variable, CallFunction> = new Map();
|
|
2126
2113
|
yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
|
|
2127
2114
|
if (
|
|
2128
|
-
el &&
|
|
2129
|
-
|
|
2130
|
-
|
|
2115
|
+
el &&
|
|
2116
|
+
// 批量赋值
|
|
2117
|
+
(asserts.isBatchAssignment(el) ||
|
|
2131
2118
|
// 赋值
|
|
2132
2119
|
(asserts.isAssignment(el) && el.left?.name) ||
|
|
2133
2120
|
// 内置函数对集合类型的推导
|
|
2134
|
-
(asserts.isCallFunction(el) && el.derivablecollection?.name)
|
|
2135
|
-
)
|
|
2121
|
+
(asserts.isCallFunction(el) && el.derivablecollection?.name))
|
|
2136
2122
|
) {
|
|
2137
2123
|
// 子页面内部逻辑过滤
|
|
2138
2124
|
if (el.view !== self) return;
|
|
@@ -2159,9 +2145,9 @@ export class View extends BaseNode {
|
|
|
2159
2145
|
const leftCode =
|
|
2160
2146
|
leftIndex.length === 1
|
|
2161
2147
|
? yield* el.left?.expression?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
2162
|
-
|
|
2148
|
+
returnOrigin('')
|
|
2163
2149
|
: yield* el.left?.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
2164
|
-
|
|
2150
|
+
returnOrigin('');
|
|
2165
2151
|
const advanceVar = self.variables?.find(
|
|
2166
2152
|
(variable) => !variable.typeAnnotation && leftCode === variable.name,
|
|
2167
2153
|
);
|
|
@@ -2216,7 +2202,7 @@ export class View extends BaseNode {
|
|
|
2216
2202
|
leftIndex.length === 1
|
|
2217
2203
|
? yield* assignment.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
2218
2204
|
: yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ??
|
|
2219
|
-
|
|
2205
|
+
returnOrigin('');
|
|
2220
2206
|
if (leftCode === variable.name) {
|
|
2221
2207
|
const rightNode =
|
|
2222
2208
|
rightIndex.length === 1
|
|
@@ -2249,7 +2235,7 @@ export class View extends BaseNode {
|
|
|
2249
2235
|
});
|
|
2250
2236
|
|
|
2251
2237
|
yield* wrapIterator(callFunctionAdvanceMap.entries(), function* warpForEachGenerator([node, assignment]) {
|
|
2252
|
-
//
|
|
2238
|
+
//
|
|
2253
2239
|
if (advanceMap.get(node)) {
|
|
2254
2240
|
return;
|
|
2255
2241
|
}
|
|
@@ -56,6 +56,7 @@ function stringifyMetaData(obj: any) {
|
|
|
56
56
|
const properties: string[] = [];
|
|
57
57
|
if (obj instanceof FrontendVariable) {
|
|
58
58
|
newObj= obj.toJSON() || {};
|
|
59
|
+
newObj.defaultCode = obj.defaultCode;
|
|
59
60
|
const defaultValueFn = obj.defaultValue?.toJS({ getVuePrototype: true });
|
|
60
61
|
if (obj.defaultCode.executeCode && defaultValueFn) {
|
|
61
62
|
properties.push(`"defaultValueFn": (Vue) => {
|
|
@@ -372,7 +373,7 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
372
373
|
);
|
|
373
374
|
const metaData = genMetaData(app, frontend, config);
|
|
374
375
|
const metaDataStr = stringifyMetaData(metaData);
|
|
375
|
-
|
|
376
|
+
|
|
376
377
|
const assetsInfo = app.genAllAssetsInfo(STATIC_URL, frontend.type);
|
|
377
378
|
const customNames = JSON5.stringify(assetsInfo.custom.names);
|
|
378
379
|
|
|
@@ -242,7 +242,7 @@ export async function getVersionDetail(axios: AxiosInstance, app: any) {
|
|
|
242
242
|
export async function getValidationRules(axios: AxiosInstance, ideVersion: string, frontends: FrontendType[]) {
|
|
243
243
|
const formData = new FormData();
|
|
244
244
|
formData.append('file', new Blob([JSON.stringify(frontends.map((view) => view.toJSON()))], { type: 'application/json' }));
|
|
245
|
-
const validations = await axios
|
|
245
|
+
const validations = await axios({
|
|
246
246
|
method: 'post',
|
|
247
247
|
url: `/api/v1/ide/nasl/frontend/call-logic/validations/batch`,
|
|
248
248
|
headers: {
|
|
@@ -327,7 +327,8 @@ export function getProcessFormDefinitions(app: App) {
|
|
|
327
327
|
if (!item.content && form) {
|
|
328
328
|
formDefinition = form.toVue();
|
|
329
329
|
const processPrefix = form.getBindAttribute('processPrefix')?.value;
|
|
330
|
-
formDefinition = formDefinition.replaceAll(processPrefix
|
|
330
|
+
formDefinition = formDefinition.replaceAll(`${processPrefix}.`, 'processDetailFormData.');
|
|
331
|
+
formDefinition = formDefinition.replaceAll(`${process.name}.`, 'processDetailFormData.');
|
|
331
332
|
formDefinition = formDefinition.replace(/:ref="([^"]+)"/g, (match: any, p1: string) => {
|
|
332
333
|
// ref-name加上方便制品找表单
|
|
333
334
|
return `:ref="${p1}" ref-name="${p1.replace(/^`+|`+$/g, "")}" `;
|
|
@@ -1,20 +1,44 @@
|
|
|
1
1
|
import { App, Logic, BaseNode, Frontend } from '../concepts';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
getNaslCore,
|
|
4
|
+
getNaslUtil,
|
|
5
|
+
getNaslUI,
|
|
6
|
+
getNaslOQL,
|
|
7
|
+
getEnums,
|
|
8
|
+
getEntities,
|
|
9
|
+
getStructures,
|
|
10
|
+
getLogics,
|
|
11
|
+
getModuleInterfaces,
|
|
12
|
+
getConnectors,
|
|
13
|
+
getDependencies,
|
|
14
|
+
getFrontendVariables,
|
|
15
|
+
getFrontendViews,
|
|
16
|
+
getCurrentNodeContext,
|
|
17
|
+
getCurrentNodeContextForUI,
|
|
18
|
+
getNaslUIOld,
|
|
19
|
+
} from './getContext';
|
|
3
20
|
import { createCompilerState } from '../translator';
|
|
4
21
|
|
|
5
22
|
export function genNaturalTS(app: App, currentNode?: BaseNode, focusedNodePath?: string) {
|
|
6
23
|
if (currentNode?.concept === 'Logic') {
|
|
7
24
|
const logic = currentNode as Logic;
|
|
8
|
-
const code = logic?.toNaturalTS(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
25
|
+
const code = logic?.toNaturalTS(
|
|
26
|
+
createCompilerState(undefined, {
|
|
27
|
+
focusedNodePath,
|
|
28
|
+
autoPrefixName: true,
|
|
29
|
+
})
|
|
30
|
+
);
|
|
12
31
|
return code;
|
|
13
32
|
}
|
|
14
33
|
return getCurrentNodeContextForUI(currentNode).code;
|
|
15
34
|
}
|
|
16
35
|
|
|
17
|
-
export function genNaturalTSContextForLogic(
|
|
36
|
+
export function genNaturalTSContextForLogic(
|
|
37
|
+
app: App,
|
|
38
|
+
currentNode?: BaseNode,
|
|
39
|
+
focusedNodePath?: string,
|
|
40
|
+
requiredIndexes?: string[]
|
|
41
|
+
) {
|
|
18
42
|
const frontend = currentNode?.getAncestor('Frontend') as Frontend;
|
|
19
43
|
const logicType = currentNode?.parentNode?.concept === 'App' ? 'global_logic' : 'view_logic';
|
|
20
44
|
const state = createCompilerState();
|
|
@@ -73,14 +97,22 @@ export function genNaturalTSContextForLogic(app: App, currentNode?: BaseNode, fo
|
|
|
73
97
|
code += getFrontendViews(frontend, state, currentNode, true).code;
|
|
74
98
|
}
|
|
75
99
|
|
|
76
|
-
|
|
77
|
-
|
|
100
|
+
if (focusedNodePath) {
|
|
101
|
+
code += '\n### 当前逻辑上下文\n';
|
|
102
|
+
code += getCurrentNodeContext(currentNode, focusedNodePath).code;
|
|
103
|
+
}
|
|
78
104
|
return code;
|
|
79
105
|
}
|
|
80
106
|
|
|
81
107
|
export const genNaturalTSContext = genNaturalTSContextForLogic;
|
|
82
108
|
|
|
83
|
-
export function genNaturalTSContextForUI(
|
|
109
|
+
export function genNaturalTSContextForUI(
|
|
110
|
+
app: App,
|
|
111
|
+
currentNode: BaseNode,
|
|
112
|
+
focusedNodePath?: string,
|
|
113
|
+
requiredIndexes?: string[],
|
|
114
|
+
material?: { json: any; tsDeclaration: string; }
|
|
115
|
+
) {
|
|
84
116
|
const frontend = currentNode.getAncestor('Frontend') as Frontend;
|
|
85
117
|
const state = createCompilerState();
|
|
86
118
|
|
|
@@ -134,7 +166,11 @@ export function genNaturalTSContextForUI(app: App, currentNode: BaseNode, _?: st
|
|
|
134
166
|
return code;
|
|
135
167
|
}
|
|
136
168
|
|
|
137
|
-
export function genNaturalTSContextJSONForLogic(
|
|
169
|
+
export function genNaturalTSContextJSONForLogic(
|
|
170
|
+
app: App,
|
|
171
|
+
currentNode?: BaseNode,
|
|
172
|
+
focusedNodePath?: string
|
|
173
|
+
) {
|
|
138
174
|
const frontend = currentNode?.getAncestor('Frontend') as Frontend;
|
|
139
175
|
const logicType = currentNode?.parentNode?.concept === 'App' ? 'global_logic' : 'view_logic';
|
|
140
176
|
const state = createCompilerState();
|
|
@@ -150,7 +186,10 @@ export function genNaturalTSContextJSONForLogic(app: App, currentNode?: BaseNode
|
|
|
150
186
|
const { interfaceDependencies } = getModuleInterfaces(app, state, []);
|
|
151
187
|
const { connections } = getConnectors(app, state, []);
|
|
152
188
|
const { dependencies } = getDependencies(app, state, []);
|
|
153
|
-
const { frontendVar, frontendVariables } = getFrontendVariables(
|
|
189
|
+
const { frontendVar, frontendVariables } = getFrontendVariables(
|
|
190
|
+
currentNode?.getAncestor('Frontend') as Frontend,
|
|
191
|
+
state
|
|
192
|
+
);
|
|
154
193
|
const { views } = getFrontendViews(frontend, state, currentNode, false);
|
|
155
194
|
const { currentLogic } = getCurrentNodeContext(currentNode, focusedNodePath);
|
|
156
195
|
|
|
@@ -171,6 +210,46 @@ export function genNaturalTSContextJSONForLogic(app: App, currentNode?: BaseNode
|
|
|
171
210
|
views,
|
|
172
211
|
currentLogic,
|
|
173
212
|
};
|
|
174
|
-
}
|
|
213
|
+
}
|
|
175
214
|
|
|
176
215
|
export const genNaturalTsContextJson = genNaturalTSContextJSONForLogic;
|
|
216
|
+
|
|
217
|
+
export function genNaturalTSContextJSONForUI(
|
|
218
|
+
app: App,
|
|
219
|
+
currentNode: BaseNode,
|
|
220
|
+
material?: { json: any; tsDeclaration: string; },
|
|
221
|
+
requiredIndexes?: string[],
|
|
222
|
+
) {
|
|
223
|
+
const frontend = currentNode.getAncestor('Frontend') as Frontend;
|
|
224
|
+
const state = createCompilerState();
|
|
225
|
+
|
|
226
|
+
const { naslCore } = getNaslCore('view_logic');
|
|
227
|
+
const { naslUtil } = getNaslUtil();
|
|
228
|
+
const { naslUI } = getNaslUI(material || frontend.type, requiredIndexes);
|
|
229
|
+
const { enums } = getEnums(app, state, requiredIndexes);
|
|
230
|
+
const { entities } = getEntities(app, state, requiredIndexes);
|
|
231
|
+
const { structures } = getStructures(app, state, requiredIndexes);
|
|
232
|
+
const { appLogics } = getLogics(app, currentNode, requiredIndexes);
|
|
233
|
+
const { interfaceDependencies } = getModuleInterfaces(app, state, requiredIndexes);
|
|
234
|
+
const { dependencies } = getDependencies(app, state, requiredIndexes);
|
|
235
|
+
const { frontendVariables } = getFrontendVariables(frontend, state);
|
|
236
|
+
const { views } = getFrontendViews(frontend, state, currentNode, true);
|
|
237
|
+
const { currentLogic } = getCurrentNodeContextForUI(currentNode);
|
|
238
|
+
|
|
239
|
+
return {
|
|
240
|
+
naslCore,
|
|
241
|
+
naslUtil,
|
|
242
|
+
naslUI,
|
|
243
|
+
enums,
|
|
244
|
+
entities,
|
|
245
|
+
structures,
|
|
246
|
+
appLogics,
|
|
247
|
+
interfaceDependencies,
|
|
248
|
+
dependencies,
|
|
249
|
+
frontendVariables,
|
|
250
|
+
views,
|
|
251
|
+
currentPage: currentLogic,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
export * as getNaturalContext from './getContext';
|
|
@@ -103,6 +103,7 @@ export const getNaslUI = (material: { json: any, tsDeclaration: string; } | stri
|
|
|
103
103
|
const naslUI = uiLib.filter(
|
|
104
104
|
(item, index) =>
|
|
105
105
|
requiredIndexes.includes(`3-${index}`) ||
|
|
106
|
+
requiredIndexes.includes(item.name) ||
|
|
106
107
|
item.name.endsWith('LinearLayout') ||
|
|
107
108
|
item.name.endsWith('Text') ||
|
|
108
109
|
item.name.endsWith('Link') ||
|
|
@@ -423,6 +424,8 @@ export function getFrontendViews(frontend: Frontend, state: TranslatorState, cur
|
|
|
423
424
|
rename,
|
|
424
425
|
});
|
|
425
426
|
code += tempCode;
|
|
427
|
+
if (state.descriptionComment)
|
|
428
|
+
code += `/* ${description} */`;
|
|
426
429
|
code += `\n`;
|
|
427
430
|
data.push({ description, code: tempCode });
|
|
428
431
|
const prefix = `${namespace}.${view?.name}_view`;
|
package/src/server/naslServer.ts
CHANGED
|
@@ -481,7 +481,7 @@ class NaslServer {
|
|
|
481
481
|
node.sourceMap = result.sourceMap;
|
|
482
482
|
self.file2NodeMap.set(result.filePath, node);
|
|
483
483
|
} catch (err) {
|
|
484
|
-
if (
|
|
484
|
+
if (utils.isDebugMode) {
|
|
485
485
|
self.logger.warn(node.nodePath ? node.nodePath : name, '代码转换失败', err);
|
|
486
486
|
}
|
|
487
487
|
}
|
|
@@ -747,7 +747,9 @@ class NaslServer {
|
|
|
747
747
|
try {
|
|
748
748
|
await Promise.all(openFiles.map(async (file) => fs.outputFile(path.join(__dirname, '../debug/apps', app.id, file.file), file.fileContent)));
|
|
749
749
|
} catch (e) {
|
|
750
|
-
|
|
750
|
+
if (utils.isDebugMode) {
|
|
751
|
+
this.logger.error(e);
|
|
752
|
+
}
|
|
751
753
|
}
|
|
752
754
|
}
|
|
753
755
|
/// #endif
|
|
@@ -1808,7 +1810,9 @@ class NaslServer {
|
|
|
1808
1810
|
try {
|
|
1809
1811
|
jsCode = nodeIn.toJS();
|
|
1810
1812
|
} catch (err) {
|
|
1811
|
-
|
|
1813
|
+
if (utils.isDebugMode) {
|
|
1814
|
+
self.logger.error(err);
|
|
1815
|
+
}
|
|
1812
1816
|
}
|
|
1813
1817
|
if (!jsCode.startsWith(`${node.name} = `)) return;
|
|
1814
1818
|
// 页面局部变量
|
|
@@ -3185,7 +3189,9 @@ class NaslServer {
|
|
|
3185
3189
|
}
|
|
3186
3190
|
}
|
|
3187
3191
|
} catch (e) {
|
|
3188
|
-
|
|
3192
|
+
if (utils.isDebugMode) {
|
|
3193
|
+
this.logger.error('naslServer实体引用', e);
|
|
3194
|
+
}
|
|
3189
3195
|
}
|
|
3190
3196
|
}
|
|
3191
3197
|
}
|
|
@@ -3612,7 +3618,9 @@ class NaslServer {
|
|
|
3612
3618
|
minRange.setTypeMethods = 'setValue';
|
|
3613
3619
|
}
|
|
3614
3620
|
} catch (error) {
|
|
3615
|
-
|
|
3621
|
+
if (utils.isDebugMode) {
|
|
3622
|
+
this.logger.error(error);
|
|
3623
|
+
}
|
|
3616
3624
|
}
|
|
3617
3625
|
} else if (minRange.node instanceof Identifier) {
|
|
3618
3626
|
minRange.newValue = utils.firstLowerCase(newValue);
|
|
@@ -3996,7 +4004,9 @@ class NaslServer {
|
|
|
3996
4004
|
result = this.handleTreeMap(resMap);
|
|
3997
4005
|
}
|
|
3998
4006
|
} catch (err) {
|
|
3999
|
-
|
|
4007
|
+
if (utils.isDebugMode) {
|
|
4008
|
+
this.logger.error(err);
|
|
4009
|
+
}
|
|
4000
4010
|
}
|
|
4001
4011
|
return result;
|
|
4002
4012
|
}
|
|
@@ -4022,7 +4032,9 @@ class NaslServer {
|
|
|
4022
4032
|
result.add(minRange.node);
|
|
4023
4033
|
});
|
|
4024
4034
|
} catch (err) {
|
|
4025
|
-
|
|
4035
|
+
if (utils.isDebugMode) {
|
|
4036
|
+
this.logger.error(err);
|
|
4037
|
+
}
|
|
4026
4038
|
}
|
|
4027
4039
|
return [...result];
|
|
4028
4040
|
}
|
|
@@ -4562,8 +4574,8 @@ class NaslServer {
|
|
|
4562
4574
|
|
|
4563
4575
|
this.logger.timeEnd('全量标注');
|
|
4564
4576
|
|
|
4565
|
-
//
|
|
4566
|
-
if (utils.isTestBrowser) {
|
|
4577
|
+
// 测试环境或者是调试模式打印数据
|
|
4578
|
+
if (utils.isDebugMode || utils.isTestBrowser) {
|
|
4567
4579
|
this.logger.info('全量标注数据', json);
|
|
4568
4580
|
}
|
|
4569
4581
|
|
|
@@ -4799,7 +4811,9 @@ class NaslServer {
|
|
|
4799
4811
|
}
|
|
4800
4812
|
return new Promise((resolve, reject) => {
|
|
4801
4813
|
const myTimer = setTimeout(() => {
|
|
4802
|
-
|
|
4814
|
+
if (utils.isDebugMode) {
|
|
4815
|
+
this.logger.warn(node, '没有获取到类型');
|
|
4816
|
+
}
|
|
4803
4817
|
clearTimeout(myTimer);
|
|
4804
4818
|
clearInterval(mySetInterval);
|
|
4805
4819
|
if (node.__isCorrectTypeAnnotation) {
|
package/src/server/translator.ts
CHANGED
|
@@ -54,11 +54,17 @@ import {
|
|
|
54
54
|
NewComposite,
|
|
55
55
|
ValidationRule,
|
|
56
56
|
Paginate,
|
|
57
|
+
Connector,
|
|
58
|
+
Namespace,
|
|
59
|
+
AuthLogic,
|
|
60
|
+
AuthLogicForCallInterface,
|
|
61
|
+
ConnectorLogic,
|
|
57
62
|
} from '../concepts';
|
|
58
63
|
import { SourceMapItem } from '../translator';
|
|
59
64
|
import { Diagnostic } from '../manager/diagnostic';
|
|
60
65
|
import { sortTsString } from '../utils/sortTsString';
|
|
61
66
|
import { getNodeByNodeCallee } from '../automate/engine/utils.js';
|
|
67
|
+
import { isAuthInterface, isAuthLogicForCallInterface, isConnectorLogic, isLogic } from '../concepts/utils/asserts';
|
|
62
68
|
export interface MinRange {
|
|
63
69
|
node: BaseNode;
|
|
64
70
|
item: SourceMapItem;
|
|
@@ -890,6 +896,49 @@ export function naslNodeTranslateMessage(minRange: MinRange, tsErrorDetail: Diag
|
|
|
890
896
|
node.tsErrorDetail = tsErrorDetail;
|
|
891
897
|
}
|
|
892
898
|
|
|
899
|
+
// 如果是来自于 编辑态的自定义连接器 的节点,报错信息需要特殊处理
|
|
900
|
+
const isFromConnector = node?.getAncestor('Connector');
|
|
901
|
+
const isFromIntegration = node?.getAncestor('Integration');
|
|
902
|
+
if (isFromConnector && isFromIntegration) {
|
|
903
|
+
return getConnectorErrorDetail(node, tsErrorDetail);
|
|
904
|
+
}
|
|
905
|
+
return {
|
|
906
|
+
node,
|
|
907
|
+
...tsErrorDetail,
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
/**
|
|
912
|
+
* 获取自定义连接器的报错信息
|
|
913
|
+
* @param node
|
|
914
|
+
* @param tsErrorDetail
|
|
915
|
+
*/
|
|
916
|
+
function getConnectorErrorDetail(node: BaseNode, tsErrorDetail: Diagnostic) {
|
|
917
|
+
const connector = node.getAncestor('Connector') as Connector;
|
|
918
|
+
let targetNode = node;
|
|
919
|
+
let msgPrefix = '';
|
|
920
|
+
const authLogic = node.getAncestor('AuthLogic') as AuthLogic;
|
|
921
|
+
const authLogicForCallInterface = node.getAncestor('AuthLogicForCallInterface') as AuthLogicForCallInterface;
|
|
922
|
+
const connectorLogic = node.getAncestor('ConnectorLogic') as ConnectorLogic;
|
|
923
|
+
if (authLogicForCallInterface) {
|
|
924
|
+
targetNode = authLogicForCallInterface;
|
|
925
|
+
msgPrefix = `${connector.title} 连接器 ${targetNode.name} 操作鉴权方式:`;
|
|
926
|
+
} else if (authLogic) {
|
|
927
|
+
targetNode = authLogic;
|
|
928
|
+
msgPrefix = `${connector.title} 连接器 ${targetNode?.name} 触发鉴权方式:`;
|
|
929
|
+
} else if (connectorLogic) {
|
|
930
|
+
targetNode = connectorLogic;
|
|
931
|
+
const namespace = node.getAncestor('Namespace') as Namespace;
|
|
932
|
+
msgPrefix = `连接器(${connector.title})分组(${namespace.title}) 操作(${(targetNode as ConnectorLogic)?.title}) 中:`;
|
|
933
|
+
} else if (isConnectorLogic(node)) {
|
|
934
|
+
targetNode = node;
|
|
935
|
+
const namespace = node.getAncestor('Namespace') as Namespace;
|
|
936
|
+
msgPrefix = `连接器(${connector.title})分组(${namespace.title}) 操作(${(targetNode as ConnectorLogic)?.title}) 中:`;
|
|
937
|
+
} else {
|
|
938
|
+
// 本身就是 AuthLogic、AuthLogicForCallInterface
|
|
939
|
+
msgPrefix = `${connector.title} 连接器 ${targetNode.name} 操作中:`;
|
|
940
|
+
}
|
|
941
|
+
tsErrorDetail.message = msgPrefix + tsErrorDetail.message;
|
|
893
942
|
return {
|
|
894
943
|
node,
|
|
895
944
|
...tsErrorDetail,
|
package/src/translator/types.ts
CHANGED
package/src/translator/utils.ts
CHANGED
|
@@ -255,6 +255,12 @@ export function transfromUnionTypeAnnotation(expTypeAnnotation: TypeAnnotation,
|
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
257
|
|
|
258
|
+
export function createDescriptionComment<T extends BaseNode>(state: TranslatorState, node: T, properties: Array<keyof T>) {
|
|
259
|
+
const content = properties.map((prop) => node[prop]).filter((value) => !!value).join(' ');
|
|
260
|
+
|
|
261
|
+
return content.trim() ? `/** ${content} */\n${indent(state.tabSize)}` : '';
|
|
262
|
+
}
|
|
263
|
+
|
|
258
264
|
export function createDecoratorCode<T extends BaseNode>(state: TranslatorState, node: T, properties: Array<keyof T>, options?: {
|
|
259
265
|
'@'?: boolean;
|
|
260
266
|
concept?: boolean;
|
package/src/utils/env.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
export const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
|
|
3
3
|
/** Node 环境 */
|
|
4
4
|
export const isNode = process.env.BUILD_TARGET === 'node' || !globalThis.window;
|
|
5
|
+
/** 调试模式 */
|
|
6
|
+
export const isDebugMode = isBrowser && /[?&]debug=true/.test(window.location.search);
|
|
5
7
|
/** 是否是浏览器测试环境 */
|
|
6
8
|
export const isTestBrowser = isBrowser && (
|
|
7
9
|
/codewave-(test|dev)\.163yun\.com$/.test(location.hostname) ||
|