@lcap/nasl 2.18.0 → 2.19.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/automate/engine/index.d.ts +2 -2
- package/out/automate/engine/index.js +6 -7
- package/out/automate/engine/index.js.map +1 -1
- package/out/automate/engine/operators.d.ts +2 -2
- package/out/automate/engine/operators.js +14 -5
- package/out/automate/engine/operators.js.map +1 -1
- package/out/automate/engine/uniqueName.d.ts +2 -2
- package/out/automate/engine/uniqueName.js +5 -5
- package/out/automate/engine/uniqueName.js.map +1 -1
- package/out/automate/engine/utils.js +4 -1
- package/out/automate/engine/utils.js.map +1 -1
- package/out/automate/template/myProcess.d.ts +1 -1
- package/out/automate/template/myProcess.js +9023 -9023
- package/out/automate/template/myProcess.js.map +1 -1
- package/out/bak/translator.js +18 -25
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +12 -0
- package/out/common/BaseNode.js +89 -14
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.d.ts +1 -0
- package/out/common/Command.js +5 -1
- package/out/common/Command.js.map +1 -1
- package/out/common/EventEmitter.d.ts +1 -0
- package/out/common/EventEmitter.js +3 -0
- package/out/common/EventEmitter.js.map +1 -1
- package/out/common/Messager.js +1 -0
- package/out/common/Messager.js.map +1 -1
- package/out/concepts/Abort__.d.ts +25 -0
- package/out/concepts/Abort__.js +80 -0
- package/out/concepts/Abort__.js.map +1 -0
- package/out/concepts/Anchor__.d.ts +1 -0
- package/out/concepts/Anchor__.js +3 -0
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +2 -0
- package/out/concepts/AnonymousFunction__.js +43 -2
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +109 -256
- package/out/concepts/App__.js +351 -392
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +1 -0
- package/out/concepts/Argument__.js +3 -0
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +1 -0
- package/out/concepts/Assignee__.js +7 -3
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.d.ts +1 -0
- package/out/concepts/AssignmentLine__.js +3 -0
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +1 -0
- package/out/concepts/Assignment__.js +3 -0
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.d.ts +10 -14
- package/out/concepts/Attribute__.js +15 -39
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +3 -0
- package/out/concepts/BatchAssignment__.js +111 -47
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +1 -0
- package/out/concepts/BinaryExpression__.js +3 -0
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +13 -0
- package/out/concepts/BindAttribute__.js +296 -31
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +13 -0
- package/out/concepts/BindDirective__.js +223 -15
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +6 -0
- package/out/concepts/BindEvent__.js +30 -22
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +13 -0
- package/out/concepts/BindStyle__.js +200 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +1 -0
- package/out/concepts/BooleanLiteral__.js +3 -0
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +1 -0
- package/out/concepts/CallFunction__.js +54 -18
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -0
- package/out/concepts/CallInterface__.js +55 -7
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +14 -1
- package/out/concepts/CallLogic__.js +244 -147
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +3 -0
- package/out/concepts/CallQueryComponent__.js +113 -39
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.d.ts +1 -0
- package/out/concepts/Comment__.js +3 -0
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts +2 -0
- package/out/concepts/CompletionProperty__.js +4 -0
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.d.ts +2 -0
- package/out/concepts/ConfigGroup__.js +16 -0
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.d.ts +1 -0
- package/out/concepts/ConfigPropertyValue__.js +3 -0
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +24 -0
- package/out/concepts/ConfigProperty__.js +83 -0
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.d.ts +2 -0
- package/out/concepts/Configuration__.js +16 -0
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +6 -0
- package/out/concepts/Constant__.js +9 -0
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.d.ts +1 -0
- package/out/concepts/DataElement__.js +3 -0
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +5 -0
- package/out/concepts/DataSource__.js +70 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.d.ts +31 -0
- package/out/concepts/DatabaseTypeAnnotation__.js +78 -0
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -0
- package/out/concepts/Destination__.d.ts +5 -1
- package/out/concepts/Destination__.js +183 -33
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +1 -0
- package/out/concepts/End__.js +4 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +1 -0
- package/out/concepts/EntityIndex__.js +3 -0
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +34 -5
- package/out/concepts/EntityProperty__.js +197 -56
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +3 -1
- package/out/concepts/Entity__.js +33 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +6 -5
- package/out/concepts/EnumItem__.js +9 -6
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +21 -19
- package/out/concepts/Enum__.js +31 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.d.ts +1 -0
- package/out/concepts/Event__.js +3 -0
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +2 -0
- package/out/concepts/ExternalDestination__.js +25 -4
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +1 -0
- package/out/concepts/ForEachStatement__.js +5 -0
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +213 -0
- package/out/concepts/FrontendLibrary__.js +352 -0
- package/out/concepts/FrontendLibrary__.js.map +1 -0
- package/out/concepts/Frontend__.d.ts +373 -0
- package/out/concepts/Frontend__.js +685 -0
- package/out/concepts/Frontend__.js.map +1 -0
- package/out/concepts/Function__.d.ts +1 -0
- package/out/concepts/Function__.js +3 -0
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -0
- package/out/concepts/Identifier__.js +43 -11
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +1 -0
- package/out/concepts/IfStatement__.js +5 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +53 -0
- package/out/concepts/Integration__.js +143 -0
- package/out/concepts/Integration__.js.map +1 -0
- package/out/concepts/InterfaceParam__.d.ts +1 -3
- package/out/concepts/InterfaceParam__.js +3 -56
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +14 -0
- package/out/concepts/Interface__.js +87 -0
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +1 -0
- package/out/concepts/JSBlock__.js +8 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +42 -0
- package/out/concepts/JavaLogic__.js +122 -0
- package/out/concepts/JavaLogic__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +7 -1
- package/out/concepts/LogicItem__.js +11 -0
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +8 -0
- package/out/concepts/Logic__.js +104 -35
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +1 -0
- package/out/concepts/MatchCase__.js +4 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +6 -3
- package/out/concepts/Match__.js +123 -22
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +1 -0
- package/out/concepts/MemberExpression__.js +14 -2
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +51 -0
- package/out/concepts/MicroApp__.js +113 -0
- package/out/concepts/MicroApp__.js.map +1 -0
- package/out/concepts/Module__.d.ts +96 -56
- package/out/concepts/Module__.js +169 -58
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +1 -0
- package/out/concepts/Namespace__.js +3 -0
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +345 -0
- package/out/concepts/NewComposite__.js +1084 -0
- package/out/concepts/NewComposite__.js.map +1 -0
- package/out/concepts/NewList__.d.ts +132 -0
- package/out/concepts/NewList__.js +378 -0
- package/out/concepts/NewList__.js.map +1 -0
- package/out/concepts/NewMap__.d.ts +223 -0
- package/out/concepts/NewMap__.js +522 -0
- package/out/concepts/NewMap__.js.map +1 -0
- package/out/concepts/New__.d.ts +20 -0
- package/out/concepts/New__.js +69 -0
- package/out/concepts/New__.js.map +1 -0
- package/out/concepts/NullLiteral__.d.ts +1 -0
- package/out/concepts/NullLiteral__.js +3 -0
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +1 -0
- package/out/concepts/NumericLiteral__.js +6 -9
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +1 -1
- package/out/concepts/OqlQueryComponent__.js +43 -58
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.d.ts +9 -3
- package/out/concepts/Param__.js +56 -62
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.d.ts +1 -0
- package/out/concepts/Point__.js +3 -0
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.d.ts +1 -0
- package/out/concepts/ProcessComponent__.js +3 -0
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +1 -0
- package/out/concepts/ProcessElement__.js +47 -14
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +1 -0
- package/out/concepts/ProcessOutcome__.js +4 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +31 -0
- package/out/concepts/{ConstructArgument__.js → ProcessOutcomes__.js} +30 -48
- package/out/concepts/ProcessOutcomes__.js.map +1 -0
- package/out/concepts/Process__.d.ts +5 -20
- package/out/concepts/Process__.js +4 -7
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.d.ts +1 -0
- package/out/concepts/QueryAggregateExpression__.js +3 -0
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +1 -0
- package/out/concepts/QueryFieldExpression__.js +7 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +1 -0
- package/out/concepts/QueryFromExpression__.js +3 -0
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +1 -0
- package/out/concepts/QueryGroupByExpression__.js +3 -0
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +1 -0
- package/out/concepts/QueryJoinExpression__.js +3 -0
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +1 -0
- package/out/concepts/QueryLimitExpression__.js +3 -0
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +1 -0
- package/out/concepts/QueryOrderByExpression__.js +3 -0
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +105 -16
- package/out/concepts/QuerySelectExpression__.js +102 -9
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.d.ts +1 -0
- package/out/concepts/Rect__.js +3 -0
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +6 -3
- package/out/concepts/Return__.js +15 -60
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +1 -0
- package/out/concepts/Role__.js +3 -0
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +1 -0
- package/out/concepts/SelectMembers__.js +6 -3
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.d.ts +17 -0
- package/out/concepts/Slot__.js +46 -0
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +1 -1
- package/out/concepts/SqlQueryComponent__.js +3 -46
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +1 -0
- package/out/concepts/Start__.js +3 -0
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +1 -0
- package/out/concepts/StringInterpolation__.js +17 -2
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +1 -0
- package/out/concepts/StringLiteral__.js +9 -6
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +9 -3
- package/out/concepts/StructureProperty__.js +21 -57
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +1 -0
- package/out/concepts/Structure__.js +3 -0
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +1 -0
- package/out/concepts/SwitchCase__.js +5 -2
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.d.ts +1 -0
- package/out/concepts/SwitchStatement__.js +3 -0
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.d.ts +1 -0
- package/out/concepts/Theme__.js +3 -0
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.d.ts +6 -0
- package/out/concepts/Transactional__.js +9 -0
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +13 -3
- package/out/concepts/TypeAnnotation__.js +160 -20
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +1 -0
- package/out/concepts/TypeParam__.js +3 -0
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +1 -0
- package/out/concepts/UnaryExpression__.js +3 -0
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +1 -0
- package/out/concepts/Unparsed__.js +3 -0
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.d.ts +1 -0
- package/out/concepts/UseComponent__.js +3 -0
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +2 -0
- package/out/concepts/ValidationRule__.js +57 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +6 -3
- package/out/concepts/Variable__.js +16 -61
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.d.ts +35 -0
- package/out/concepts/ViewBlock__.js +85 -0
- package/out/concepts/ViewBlock__.js.map +1 -0
- package/out/concepts/ViewComponent__.d.ts +93 -0
- package/out/concepts/ViewComponent__.js +114 -0
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +8 -0
- package/out/concepts/ViewElement__.js +79 -11
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +10 -3
- package/out/concepts/View__.js +77 -16
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +1 -0
- package/out/concepts/WhileStatement__.js +3 -0
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.collection.js +7 -2
- package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js +3 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.core.d.ts +2 -0
- package/out/concepts/basics/stdlib/nasl.core.js +34 -0
- package/out/concepts/basics/stdlib/nasl.core.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.interface.js +1 -1
- package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.logging.js +5 -0
- package/out/concepts/basics/stdlib/nasl.logging.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.js +6 -6
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +73 -43
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +293 -36
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.js +13 -13
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
- package/out/concepts/basics/types/coreTypeList.js +1 -5
- package/out/concepts/basics/types/coreTypeList.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +1 -0
- package/out/concepts/basics/types/index.js +3 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/concepts/index__.d.ts +13 -0
- package/out/concepts/index__.js +13 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/decorators/index.js +3 -3
- package/out/decorators/index.js.map +1 -1
- package/out/enums/KEYWORDS.d.ts +1 -0
- package/out/enums/KEYWORDS.js +17 -1
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +6 -3
- package/out/generator/genBundleFiles.js +96 -228
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +2 -11
- package/out/generator/genMetaData.js +185 -51
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +21 -4
- package/out/generator/genReleaseBody.js +173 -54
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/icestark.d.ts +2 -0
- package/out/generator/icestark.js +48 -0
- package/out/generator/icestark.js.map +1 -0
- package/out/generator/index.d.ts +1 -0
- package/out/generator/index.js +1 -0
- package/out/generator/index.js.map +1 -1
- package/out/generator/microApp.d.ts +2 -0
- package/out/generator/microApp.js +35 -0
- package/out/generator/microApp.js.map +1 -0
- package/out/generator/permission.d.ts +10 -0
- package/out/generator/permission.js +230 -0
- package/out/generator/permission.js.map +1 -0
- package/out/generator/qiankun.d.ts +2 -0
- package/out/generator/qiankun.js +52 -0
- package/out/generator/qiankun.js.map +1 -0
- package/out/index.d.ts +2 -1
- package/out/index.js +5 -1
- package/out/index.js.map +1 -1
- package/out/manager/stepRecorder.d.ts +20 -0
- package/out/manager/stepRecorder.js +110 -0
- package/out/manager/stepRecorder.js.map +1 -0
- package/out/sentry/index.d.ts +29 -0
- package/out/sentry/index.js +111 -0
- package/out/sentry/index.js.map +1 -0
- package/out/server/entity2LogicNamespace.js +72 -10
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/extendBaseNode.js +123 -22
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +3 -3
- package/out/server/formatTsUtils.js +195 -60
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.d.ts +3 -2
- package/out/server/getLogics.js +74 -17
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +1 -0
- package/out/server/getMemberIdentifier.js +35 -7
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.js +1 -1
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/index.js +1 -0
- package/out/server/index.js.map +1 -1
- package/out/server/naslServer.d.ts +17 -5
- package/out/server/naslServer.js +1323 -188
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.js +8 -0
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.js +166 -30
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/add.configs.js +6 -0
- package/out/service/creator/add.configs.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/creator/index.js +2 -0
- package/out/service/creator/index.js.map +1 -1
- package/out/service/datasource/api.d.ts +12 -0
- package/out/service/datasource/api.js +14 -0
- package/out/service/datasource/api.js.map +1 -0
- package/out/service/datasource/index.d.ts +2 -0
- package/out/service/datasource/index.js +10 -0
- package/out/service/datasource/index.js.map +1 -0
- package/out/service/storage/api.d.ts +27 -0
- package/out/service/storage/api.js +19 -0
- package/out/service/storage/api.js.map +1 -1
- package/out/service/storage/init.d.ts +44 -1
- package/out/service/storage/init.js +270 -38
- package/out/service/storage/init.js.map +1 -1
- package/out/service/storage/service.d.ts +12 -1
- package/out/service/storage/service.js +32 -1
- package/out/service/storage/service.js.map +1 -1
- package/out/templator/genCallComponentLogic.d.ts +1 -1
- package/out/templator/genCallComponentLogic.js.map +1 -1
- package/out/templator/genCreateBlock.js +7 -4
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.d.ts +7 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +122 -8
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +6 -8
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +52 -25
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +4 -3
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +18 -16
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +12 -6
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +23 -9
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.d.ts +12 -1
- package/out/templator/genSelectBlock.js +273 -2
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +10 -14
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +9 -4
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +19 -33
- package/out/templator/utils.js +11 -8
- package/out/templator/utils.js.map +1 -1
- package/out/translator/index.js +4 -1
- package/out/translator/index.js.map +1 -1
- package/out/utils/traverse.js +8 -2
- package/out/utils/traverse.js.map +1 -1
- package/package.json +2 -2
- package/sandbox/stdlib/nasl.auth.ts +1 -1
- package/sandbox/stdlib/nasl.core.ts +6 -0
- package/sandbox/stdlib/nasl.logging.ts +4 -4
- package/sandbox/stdlib/nasl.util.ts +16 -6
- package/src/automate/template/myProcess.js +1 -1
- package/src/bak/translator.js +4 -1
- package/src/common/BaseNode.ts +1 -0
- package/src/common/Command.ts +4 -0
- package/src/concepts/AnonymousFunction__.ts +48 -2
- package/src/concepts/App__.ts +140 -41
- package/src/concepts/Assignee__.ts +4 -3
- package/src/concepts/BatchAssignment__.ts +111 -51
- package/src/concepts/BindAttribute__.ts +9 -2
- package/src/concepts/CallFunction__.ts +65 -31
- package/src/concepts/CallInterface__.ts +6 -22
- package/src/concepts/CallLogic__.ts +90 -88
- package/src/concepts/CallQueryComponent__.ts +4 -1
- package/src/concepts/DataSource__.ts +56 -1
- package/src/concepts/Destination__.ts +92 -22
- package/src/concepts/ForEachStatement__.ts +2 -0
- package/src/concepts/Identifier__.ts +18 -7
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +54 -39
- package/src/concepts/Match__.ts +12 -8
- package/src/concepts/NewComposite__.ts +1354 -0
- package/src/concepts/NewList__.ts +445 -0
- package/src/concepts/NewMap__.ts +679 -0
- package/src/concepts/New__.ts +73 -0
- package/src/concepts/OqlQueryComponent__.ts +2 -0
- package/src/concepts/Param__.ts +238 -199
- package/src/concepts/ProcessElement__.ts +32 -10
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/ProcessOutcomes__.ts +90 -0
- package/src/concepts/Return__.ts +4 -1
- package/src/concepts/SelectMembers__.ts +3 -3
- package/src/concepts/StringInterpolation__.ts +21 -11
- package/src/concepts/TypeAnnotation__.ts +71 -50
- package/src/concepts/ValidationRule__.ts +19 -1
- package/src/concepts/Variable__.ts +4 -1
- package/src/concepts/ViewElement__.ts +24 -8
- package/src/concepts/View__.ts +16 -2
- package/src/concepts/basics/stdlib/nasl.auth.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.logging.ts +5 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +2 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +153 -17
- package/src/concepts/index__.ts +5 -0
- package/src/enums/KEYWORDS.ts +1 -0
- package/src/generator/genBundleFiles.ts +44 -220
- package/src/generator/genMetaData.ts +177 -77
- package/src/generator/genReleaseBody.ts +30 -5
- package/src/generator/index.ts +1 -0
- package/src/generator/permission.ts +271 -0
- package/src/index.ts +1 -1
- package/src/server/entity2LogicNamespace.ts +70 -10
- package/src/server/extendBaseNode.ts +10 -21
- package/src/server/formatTsUtils.ts +36 -46
- package/src/server/getLogics.ts +13 -1
- package/src/server/getMemberIdentifier.ts +1 -1
- package/src/server/getProcesses.ts +1 -1
- package/src/server/naslServer.ts +184 -42
- package/src/server/process2LogicNamespace.ts +8 -0
- package/src/server/translator.ts +93 -9
- package/src/service/creator/add.configs.js +4 -0
- package/src/service/datasource/api.js +11 -0
- package/src/service/datasource/index.js +6 -0
- package/src/service/storage/init.ts +9 -2
- package/src/service/video/VideoTranscribe.js +1 -0
- package/src/templator/genEditTableBlock.ts +8 -16
- package/src/templator/genGetBlock.ts +18 -19
- package/src/templator/genGridViewBlock.ts +18 -18
- package/src/templator/genListViewBlock.ts +8 -11
- package/src/templator/genTableBlock.ts +6 -10
- package/ts-worker/lib/tsserver.js +11 -1
- package/out/automate/engine/2.14-components.d.ts +0 -1115
- package/out/automate/engine/2.14-components.js +0 -1087
- package/out/automate/engine/2.14-components.js.map +0 -1
- package/out/concepts/ConstructArgument__.d.ts +0 -40
- package/out/concepts/ConstructArgument__.js.map +0 -1
- package/out/concepts/Construct__.d.ts +0 -189
- package/out/concepts/Construct__.js +0 -340
- package/out/concepts/Construct__.js.map +0 -1
- package/out/concepts/MatchExpression__.d.ts +0 -97
- package/out/concepts/MatchExpression__.js +0 -281
- package/out/concepts/MatchExpression__.js.map +0 -1
- package/out/templator/sql-parser/index.d.ts +0 -1
- package/out/templator/sql-parser/index.js +0 -228
- package/out/templator/sql-parser/index.js.map +0 -1
- package/out/templator/sql-parser/parser.js +0 -26664
- package/out/templator/sql-parser/parser.js.map +0 -1
- package/src/automate/engine/dist/index.dev.js +0 -517
- package/src/common/dist/BaseNode.js +0 -1101
- package/src/concepts/basics/stdlib/dist/reference2TypeAnnotationList.js +0 -24
- package/src/concepts/dist/Anchor__.js +0 -179
- package/src/concepts/dist/Assignment__.js +0 -301
- package/src/concepts/dist/CallFunction__.js +0 -473
- package/src/concepts/dist/CallInterface__.js +0 -533
- package/src/concepts/dist/CallLogic__.js +0 -864
- package/src/concepts/dist/ForEachStatement__.js +0 -426
- package/src/concepts/dist/MatchCase__.js +0 -587
- package/src/concepts/dist/MemberExpression__.js +0 -348
- package/src/concepts/dist/Param__.js +0 -537
- package/src/concepts/dist/Return__.js +0 -493
- package/src/generator/dist/genBundleFiles.js +0 -414
- package/src/server/dist/formatTsUtils.js +0 -683
- package/src/server/dist/naslServer.js +0 -3396
- package/src/service/storage/dist/init.js +0 -541
- package/ts-worker/dist/webpack.config.dev.js +0 -104
- package/ts-worker/lib/dist/tsserver.dev.js +0 -22953
- package/ts-worker/sources/lib/dist/tsserver.dev.js +0 -22912
|
@@ -247,13 +247,9 @@ function findNode(typeKey: string, node: BaseNode) {
|
|
|
247
247
|
* 获取下一级的节点进行递归
|
|
248
248
|
* @param typeKey 当前节点的类型,主要为了取出内部的 T中的实际类型
|
|
249
249
|
* @param item 当前节点的内容
|
|
250
|
-
* @param parent 父级节点的内容
|
|
251
250
|
* @param node 获取变量框的位置
|
|
252
251
|
*/
|
|
253
|
-
export function nextFindTypeChild(typeKey: string, item: any,
|
|
254
|
-
// 有一个当前树分支的全部节点的node map,用作防止数据无限递归,只保留3层
|
|
255
|
-
const nodeMap = parent ? parent.nodeMap : new Map();
|
|
256
|
-
item.nodeMap = nodeMap;
|
|
252
|
+
export function nextFindTypeChild(typeKey: string, item: any, node: BaseNode) {
|
|
257
253
|
const newType = findNode(typeKey, node);
|
|
258
254
|
if ((newType as Structure)?.properties && (newType as Structure).properties.length) {
|
|
259
255
|
// 处理泛型的内容要取到值
|
|
@@ -274,16 +270,7 @@ export function nextFindTypeChild(typeKey: string, item: any, parent: any, node:
|
|
|
274
270
|
});
|
|
275
271
|
}
|
|
276
272
|
});
|
|
277
|
-
|
|
278
|
-
if (index) {
|
|
279
|
-
nodeMap.set(newType, index + 1);
|
|
280
|
-
} else {
|
|
281
|
-
nodeMap.set(newType, 1);
|
|
282
|
-
}
|
|
283
|
-
// 最多保留3层
|
|
284
|
-
if (index < 3) {
|
|
285
|
-
item.children = formatVariableData(newStructure.properties, node, item);
|
|
286
|
-
}
|
|
273
|
+
item.children = formatVariableData(newStructure.properties, node, item);
|
|
287
274
|
}
|
|
288
275
|
}
|
|
289
276
|
|
|
@@ -359,7 +346,7 @@ function getAStructureScopeType(type: string, parent: any, node: BaseNode) {
|
|
|
359
346
|
newItem.concept = 'CompletionProperty';
|
|
360
347
|
// 如果有类型而且类型不是没有子集的类型,就把他当前的类型拿到
|
|
361
348
|
if (item.typeKey && !isNoChildType(item.typeKey)) {
|
|
362
|
-
newItem.children = nextObjectTypeChild(item.typeKey, newItem,
|
|
349
|
+
newItem.children = nextObjectTypeChild(item.typeKey, newItem, node);
|
|
363
350
|
}
|
|
364
351
|
const completionProperty = new CompletionProperty(newItem);
|
|
365
352
|
completionProperty.icon = 'refProperty';
|
|
@@ -395,9 +382,6 @@ function getAStructureScopeType(type: string, parent: any, node: BaseNode) {
|
|
|
395
382
|
function getAStructureObjectStringType(type: string, parent: any, node: BaseNode) {
|
|
396
383
|
let newType = type.replaceAll(' ', '').replaceAll('\n', '').replace(/__name:"AStructure_\w{8}";/g, '');
|
|
397
384
|
newType = newType.substring(1, newType.length - 1);
|
|
398
|
-
if (!parent.keyMap) {
|
|
399
|
-
parent.keyMap = new Map();
|
|
400
|
-
}
|
|
401
385
|
if (/\{([^()]+)\}/.exec(newType)) {
|
|
402
386
|
newType = newType.replace(/\{([^()]+)\}/, '');
|
|
403
387
|
}
|
|
@@ -437,7 +421,7 @@ function getAStructureObjectStringType(type: string, parent: any, node: BaseNode
|
|
|
437
421
|
newItem.concept = 'CompletionProperty';
|
|
438
422
|
// 如果有类型而且类型不是没有子集的类型,就把他当前的类型拿到
|
|
439
423
|
if (item.typeKey && !isNoChildType(item.typeKey)) {
|
|
440
|
-
newItem.children = nextObjectTypeChild(getPlatformType(item.typeKey), newItem,
|
|
424
|
+
newItem.children = nextObjectTypeChild(getPlatformType(item.typeKey), newItem, node);
|
|
441
425
|
}
|
|
442
426
|
const completionProperty = new CompletionProperty(newItem);
|
|
443
427
|
|
|
@@ -451,13 +435,7 @@ function getAStructureObjectStringType(type: string, parent: any, node: BaseNode
|
|
|
451
435
|
completionProperty.icon = getNodeiconFromLogic(completionProperty, node);
|
|
452
436
|
return completionProperty;
|
|
453
437
|
}
|
|
454
|
-
function nextObjectTypeChild(typeKey: string, item: any,
|
|
455
|
-
// 有一个当前树分支的全部节点的node map,用作防止数据无限递归,只保留3层
|
|
456
|
-
const nodeMap = parent.nodeMap || new Map();
|
|
457
|
-
item.nodeMap = nodeMap; // 有一个当前树分支的全部节点的node map,用作防止数据无限递归,只保留3层
|
|
458
|
-
|
|
459
|
-
const keyMap = parent.keyMap;
|
|
460
|
-
item.keyMap = keyMap;
|
|
438
|
+
function nextObjectTypeChild(typeKey: string, item: any, node: BaseNode) {
|
|
461
439
|
const newType = findNode(typeKey, node);
|
|
462
440
|
if ((newType as Structure)?.properties && (newType as Structure).properties.length) {
|
|
463
441
|
// 处理泛型的内容要取到值
|
|
@@ -478,16 +456,7 @@ function nextObjectTypeChild(typeKey: string, item: any, parent: any, node: Base
|
|
|
478
456
|
});
|
|
479
457
|
}
|
|
480
458
|
});
|
|
481
|
-
|
|
482
|
-
if (index) {
|
|
483
|
-
nodeMap.set(newType, index + 1);
|
|
484
|
-
} else {
|
|
485
|
-
nodeMap.set(newType, 1);
|
|
486
|
-
}
|
|
487
|
-
// 最多保留3层
|
|
488
|
-
if (index < 3) {
|
|
489
|
-
return formatVariableData(newStructure.properties, node, item);
|
|
490
|
-
}
|
|
459
|
+
return formatVariableData(newStructure.properties, node, item);
|
|
491
460
|
}
|
|
492
461
|
}
|
|
493
462
|
|
|
@@ -533,21 +502,42 @@ export function formatVariableData(data: unknown | variableItem[], node: BaseNod
|
|
|
533
502
|
item.name = item.text;
|
|
534
503
|
const identifier = new Identifier({ name: item.name });
|
|
535
504
|
item.expression = identifier;
|
|
505
|
+
item.typeKey = typeKey;
|
|
536
506
|
} else {
|
|
537
507
|
item.value = `${parent.value}.${item.name}`;
|
|
508
|
+
const object: any = BaseNode.from(parent.expression.toJSON());
|
|
538
509
|
const memberExpression = new MemberExpression({
|
|
539
|
-
object
|
|
510
|
+
object,
|
|
540
511
|
property: new Identifier({ name: item.name }),
|
|
541
512
|
});
|
|
542
513
|
item.expression = memberExpression;
|
|
514
|
+
item.variableParent = parent;
|
|
515
|
+
item.typeKey = typeKey;
|
|
516
|
+
// 标记实体属性是否是符合类型
|
|
517
|
+
item.isComplexType = item.typeAnnotation?.isComplexType();
|
|
543
518
|
}
|
|
544
519
|
// 如果有类型而且类型不是没有子集的类型,就把他当前的类型拿到
|
|
545
520
|
if (typeKey && !isNoChildType(typeKey)) {
|
|
546
|
-
|
|
521
|
+
let currentParent = item;
|
|
522
|
+
let typeKeyIndex = 0;
|
|
523
|
+
while (currentParent.variableParent) {
|
|
524
|
+
currentParent = currentParent.variableParent;
|
|
525
|
+
if (currentParent.typeKey === typeKey) {
|
|
526
|
+
typeKeyIndex++;
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
// 向上找到3次一样的就结束
|
|
530
|
+
if (typeKeyIndex < 3) {
|
|
531
|
+
nextFindTypeChild(typeKey, item, node);
|
|
532
|
+
}
|
|
547
533
|
}
|
|
548
534
|
// 如果是从实体或者数据结构取的属性,就需要重置一下类型
|
|
549
535
|
item.concept = 'CompletionProperty';
|
|
550
536
|
const completionProperty = new CompletionProperty(item);
|
|
537
|
+
// 标记实体属性是否是符合类型
|
|
538
|
+
if (typeof item.isComplexType === 'boolean') {
|
|
539
|
+
Object.assign(completionProperty, { isComplexType: item.isComplexType });
|
|
540
|
+
}
|
|
551
541
|
if (!parent) {
|
|
552
542
|
// 变量 param return 在这里添加图标
|
|
553
543
|
completionProperty.icon = getNodeiconFromLogic(completionProperty, node);
|
|
@@ -633,20 +623,20 @@ function sortFirstVariableData(result: CompletionProperty[], node: BaseNode) {
|
|
|
633
623
|
}
|
|
634
624
|
|
|
635
625
|
export function formatFrontEndVariables(frontEndVariables: Array<Variable>) {
|
|
636
|
-
const result = frontEndVariables.map((
|
|
637
|
-
const namespace =
|
|
626
|
+
const result = frontEndVariables.map((itemNode) => {
|
|
627
|
+
const namespace = itemNode.getNamespace();
|
|
638
628
|
const newItem: any = {
|
|
639
|
-
name:
|
|
640
|
-
value:
|
|
629
|
+
name: itemNode.name,
|
|
630
|
+
value: itemNode.name,
|
|
641
631
|
expression: new Identifier({
|
|
642
|
-
name:
|
|
632
|
+
name: itemNode.name,
|
|
643
633
|
namespace,
|
|
644
634
|
}),
|
|
645
635
|
};
|
|
646
|
-
const noChildType = isNoChildType(
|
|
636
|
+
const noChildType = isNoChildType(itemNode.typeAnnotation.typeKey);
|
|
647
637
|
|
|
648
638
|
if (!noChildType) {
|
|
649
|
-
nextFindTypeChild(
|
|
639
|
+
nextFindTypeChild(itemNode.typeAnnotation.typeKey, newItem, itemNode);
|
|
650
640
|
}
|
|
651
641
|
const completionProperty = new CompletionProperty(newItem);
|
|
652
642
|
completionProperty.icon = 'frontendVariable';
|
package/src/server/getLogics.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Identifier } from './../concepts/Identifier__';
|
|
1
2
|
import { CallLogic, BindEvent, App, Namespace, Entity, BaseNode, Logic, Param, TypeAnnotation, Return, Process, ViewElement, stdlibNamespace, EnumItem } from '..';
|
|
2
3
|
import { process2LogicNamespace } from './process2LogicNamespace';
|
|
3
4
|
import { moduleToLogicNamesapce } from './getExtensionModules';
|
|
@@ -56,7 +57,7 @@ function iterator(tree: FakeNode | FakeProcessNode, searchContent: string, fakeN
|
|
|
56
57
|
function toHump(name: string): string {
|
|
57
58
|
return name.replace(/\-(\w)/g, (all, letter) => letter.toUpperCase());
|
|
58
59
|
}
|
|
59
|
-
export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boolean = true) {
|
|
60
|
+
export async function getLogics(node: CallLogic | BindEvent| Identifier, needAllLogic: boolean = true) {
|
|
60
61
|
const app = node.rootNode as App;
|
|
61
62
|
if (node.concept === 'CallLogic' || node.concept === 'BindEvent') {
|
|
62
63
|
const result = [];
|
|
@@ -264,6 +265,17 @@ export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boole
|
|
|
264
265
|
result.push(systemTree);
|
|
265
266
|
}
|
|
266
267
|
return result;
|
|
268
|
+
} else if (node.concept === 'Identifier') {
|
|
269
|
+
const extensions = app.dependencies.map(moduleToLogicNamesapce).filter((item) => item.logics && item.logics.length);
|
|
270
|
+
const tree = new Namespace({
|
|
271
|
+
name: 'category`',
|
|
272
|
+
path: `${app.getNamespace()}.logics`,
|
|
273
|
+
title: '全局逻辑',
|
|
274
|
+
logics: app.logics,
|
|
275
|
+
children: [...extensions],
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
return [tree];
|
|
267
279
|
}
|
|
268
280
|
}
|
|
269
281
|
|
|
@@ -191,7 +191,7 @@ export async function getMemberIdentifier(node: BaseNode) {
|
|
|
191
191
|
|
|
192
192
|
// 这个可能需要自己算一下
|
|
193
193
|
const result = [
|
|
194
|
-
{ name: '
|
|
194
|
+
{ name: '常量', children: literals, expanded: true, icon: 'category' },
|
|
195
195
|
{ name: '枚举', children: newEnums, expanded: false, icon: 'category' },
|
|
196
196
|
{ name: '变量', children: completionData, expanded: true, icon: 'category' },
|
|
197
197
|
{ name: '公共变量', children: globalVariable, expanded: false, icon: 'category' },
|
|
@@ -283,7 +283,7 @@ export function genCompletionProperty(prefix: string[] = []):(v: Variable | Para
|
|
|
283
283
|
};
|
|
284
284
|
|
|
285
285
|
if (!noChildType) {
|
|
286
|
-
nextFindTypeChild(v.typeAnnotation.typeKey, item,
|
|
286
|
+
nextFindTypeChild(v.typeAnnotation.typeKey, item, v);
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
const cp = new CompletionProperty(item);
|
package/src/server/naslServer.ts
CHANGED
|
@@ -202,7 +202,34 @@ export class NaslServer {
|
|
|
202
202
|
// 收集到一个行为集合
|
|
203
203
|
const eventValue = $event.value;
|
|
204
204
|
eventValue.forEach(async (item: EventPayload) => {
|
|
205
|
-
|
|
205
|
+
/**
|
|
206
|
+
* 多个行为进行合并
|
|
207
|
+
* 合并规则是
|
|
208
|
+
* 1.[a,b,c,c] 在cc的时候,在已有一个c,又来一个c的时候,如果他们不都是file级别的节点
|
|
209
|
+
* 就可以前面的内容去掉,只保留最后一个
|
|
210
|
+
* 2.[a,b,c,b,c] 在bc已存在,又来了bc 这就都要保留,因为可能顺序有相关性,不能去掉
|
|
211
|
+
* 理论上只处理同时几个操作 合并,
|
|
212
|
+
* 3.有field的也直接保留
|
|
213
|
+
*/
|
|
214
|
+
try {
|
|
215
|
+
const changeEvent = item.originEvent;
|
|
216
|
+
const changeNode = changeEvent.target;
|
|
217
|
+
const { fileNode } = this.getCurrentSource(changeNode);
|
|
218
|
+
if (changeNode !== fileNode || !changeEvent.field) {
|
|
219
|
+
const findIndex = this.changeStackList.findIndex((changeStackItem: EventPayload) => {
|
|
220
|
+
const target = changeStackItem.target;
|
|
221
|
+
const { fileNode: targetFileNode } = this.getCurrentSource(target);
|
|
222
|
+
return targetFileNode === fileNode;
|
|
223
|
+
});
|
|
224
|
+
if (findIndex === this.changeStackList.length - 1) {
|
|
225
|
+
this.changeStackList.pop();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
this.changeStackList.push(item.originEvent);
|
|
229
|
+
} catch (err) {
|
|
230
|
+
console.log(err);
|
|
231
|
+
this.changeStackList.push(item.originEvent);
|
|
232
|
+
}
|
|
206
233
|
});
|
|
207
234
|
|
|
208
235
|
// 如果有长度开始执行状态机
|
|
@@ -615,7 +642,8 @@ export class NaslServer {
|
|
|
615
642
|
return '';
|
|
616
643
|
}
|
|
617
644
|
async getDataSchemaStructureOrTypeAnnotation(node: ViewElement) {
|
|
618
|
-
if (!(node instanceof ViewElement))
|
|
645
|
+
if (!(node instanceof ViewElement))
|
|
646
|
+
return;
|
|
619
647
|
|
|
620
648
|
const { currentSource, fileNode } = this.getCurrentSource(node);
|
|
621
649
|
const quickInfo = await this._getTypeQuickinfo({
|
|
@@ -626,16 +654,18 @@ export class NaslServer {
|
|
|
626
654
|
if (quickInfo.responseRequired) {
|
|
627
655
|
const displayString = quickInfo?.response?.displayString || '';
|
|
628
656
|
const flag = displayString.includes('<') && displayString.includes('>');
|
|
629
|
-
if(!flag)
|
|
657
|
+
if (!flag)
|
|
658
|
+
return;
|
|
630
659
|
|
|
631
660
|
const types = /\<([^()]+)\>/g.exec(displayString);
|
|
632
|
-
|
|
661
|
+
const typeStr = types && types[1];
|
|
633
662
|
const app = node.app;
|
|
634
663
|
if (typeStr.includes('__name: "AStructure_')) {
|
|
635
664
|
const properties: StructureProperty[] = [];
|
|
636
665
|
typeStr
|
|
637
666
|
.replace(/([^:\s]+):\s+([^;]+);/g, ($1, name, typeKey) => {
|
|
638
|
-
if(name === '__name')
|
|
667
|
+
if (name === '__name')
|
|
668
|
+
return;
|
|
639
669
|
|
|
640
670
|
typeKey = `app.${typeKey}`;
|
|
641
671
|
const keys = typeKey.split('.');
|
|
@@ -647,12 +677,12 @@ export class NaslServer {
|
|
|
647
677
|
typeKind: 'reference',
|
|
648
678
|
typeName,
|
|
649
679
|
typeNamespace,
|
|
650
|
-
})
|
|
651
|
-
}))
|
|
680
|
+
}),
|
|
681
|
+
}));
|
|
652
682
|
return '';
|
|
653
683
|
});
|
|
654
684
|
return TypeAnnotation.createTypeAnonymousStructure(properties);
|
|
655
|
-
} else if(typeStr.startsWith('structures'))
|
|
685
|
+
} else if (typeStr.startsWith('structures'))
|
|
656
686
|
return app.findNodeByCompleteName(`app.${typeStr}`);
|
|
657
687
|
}
|
|
658
688
|
}
|
|
@@ -814,7 +844,8 @@ export class NaslServer {
|
|
|
814
844
|
// record.suggestionDiagnostics = record.suggestionDiagnostics.filter((item) => !item.text.includes(`implicitly has an 'any' type, but a better type may be inferred from usage.`));
|
|
815
845
|
// }
|
|
816
846
|
record.suggestionDiagnostics = record.suggestionDiagnostics
|
|
817
|
-
.filter((item) => [`'__LogicEmpty' is declared but its value is never read.`, `'__destinationEmpty__' is declared but its value is never read.`
|
|
847
|
+
.filter((item) => [`'__LogicEmpty' is declared but its value is never read.`, `'__destinationEmpty__' is declared but its value is never read.`
|
|
848
|
+
, `'__UpdateNoProperty__' is declared but its value is never read.`].includes(item.text))
|
|
818
849
|
.map((diag) => this._resolveDiagnostic(diag as unknown as tsProtocol.DiagnosticWithFileName, node as FileNode, record))
|
|
819
850
|
.filter((diag) => !!diag);
|
|
820
851
|
|
|
@@ -847,7 +878,7 @@ export class NaslServer {
|
|
|
847
878
|
}
|
|
848
879
|
if (removed)
|
|
849
880
|
return diagnostics;
|
|
850
|
-
fileNode?.sourceMap.forEach(
|
|
881
|
+
fileNode?.sourceMap.forEach((value, node) => {
|
|
851
882
|
if (node instanceof Match) {
|
|
852
883
|
const { cases, expression } = node || {};
|
|
853
884
|
const typeAnnotationMap: any = {};
|
|
@@ -857,7 +888,7 @@ export class NaslServer {
|
|
|
857
888
|
count: 0,
|
|
858
889
|
};
|
|
859
890
|
if (Array.isArray(cases)) {
|
|
860
|
-
cases.forEach(
|
|
891
|
+
cases.forEach((caseItem, index) => {
|
|
861
892
|
let isDisabled = false;
|
|
862
893
|
// 是最后一项
|
|
863
894
|
if (index === cases.length - 1) {
|
|
@@ -997,7 +1028,7 @@ export class NaslServer {
|
|
|
997
1028
|
if (removed)
|
|
998
1029
|
return diagnostics;
|
|
999
1030
|
|
|
1000
|
-
fileNode?.sourceMap.forEach(
|
|
1031
|
+
fileNode?.sourceMap.forEach((value, node) => {
|
|
1001
1032
|
if (node instanceof ViewElement && node.view === fileNode) {
|
|
1002
1033
|
if (node.tag) {
|
|
1003
1034
|
node.bindAttrs.forEach((bindAttr) => {
|
|
@@ -1035,6 +1066,9 @@ export class NaslServer {
|
|
|
1035
1066
|
// 子页面内部逻辑过滤
|
|
1036
1067
|
if (nodeIn.view !== fileNode)
|
|
1037
1068
|
return;
|
|
1069
|
+
// 当局部变量、输出参数属于页面内逻辑时,需过滤同页面下不同逻辑下的同名变量
|
|
1070
|
+
if (node.logic && node.logic !== nodeIn.logic)
|
|
1071
|
+
return;
|
|
1038
1072
|
// 跟变量无关的赋值过滤
|
|
1039
1073
|
const jsCode = nodeIn.toJS();
|
|
1040
1074
|
if (!jsCode.includes(`${node.name} = `))
|
|
@@ -1108,6 +1142,40 @@ export class NaslServer {
|
|
|
1108
1142
|
},
|
|
1109
1143
|
};
|
|
1110
1144
|
diagnostics.push(diagnostic);
|
|
1145
|
+
} else if (propertyValue.value) {
|
|
1146
|
+
const dataSource: any = fileNode;
|
|
1147
|
+
// 数据源有连接错误
|
|
1148
|
+
let envText;
|
|
1149
|
+
if (propertyValue.env === 'dev') {
|
|
1150
|
+
if (dataSource.__devConnectError) {
|
|
1151
|
+
envText = '开发';
|
|
1152
|
+
} else if (dataSource.__devConnectError === false) {
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
} else if (propertyValue.env === 'online') {
|
|
1156
|
+
if (dataSource.__onlineConnectError) {
|
|
1157
|
+
envText = '生产';
|
|
1158
|
+
} else if (dataSource.__onlineConnectError === false) {
|
|
1159
|
+
return;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
// 手动插入报错
|
|
1163
|
+
if (envText) {
|
|
1164
|
+
const diagnostic = {
|
|
1165
|
+
node: fileNode,
|
|
1166
|
+
severity: 'error',
|
|
1167
|
+
message: `数据源配置:数据源 ${property.name} ${envText}环境数据源连接不通,请先检查${envText}环境数据源配置`,
|
|
1168
|
+
// 保留原来的内容方便查询一些问题
|
|
1169
|
+
originalDiagnostic: {
|
|
1170
|
+
fileName: '',
|
|
1171
|
+
start: <any>null,
|
|
1172
|
+
end: <any>null,
|
|
1173
|
+
category: 'error',
|
|
1174
|
+
text: `DataSource connection error`,
|
|
1175
|
+
},
|
|
1176
|
+
};
|
|
1177
|
+
return diagnostics.push(diagnostic);
|
|
1178
|
+
}
|
|
1111
1179
|
}
|
|
1112
1180
|
});
|
|
1113
1181
|
}
|
|
@@ -1118,17 +1186,18 @@ export class NaslServer {
|
|
|
1118
1186
|
if (fileNode.parentNode instanceof App && !fileNode.parentNode.logics.includes(fileNode))
|
|
1119
1187
|
return diagnostics;
|
|
1120
1188
|
|
|
1121
|
-
fileNode?.sourceMap.forEach(
|
|
1189
|
+
fileNode?.sourceMap.forEach((value, node) => {
|
|
1190
|
+
//OQL支持返回复合类型数据了
|
|
1122
1191
|
// SqlQueryComponent内部返回值类型,如果是嵌套的就需要报错
|
|
1123
|
-
if ((node instanceof OqlQueryComponent || node instanceof SqlQueryComponent) && (node as SqlQueryComponent).getTypeBanError()) {
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
}
|
|
1192
|
+
// if ((node instanceof OqlQueryComponent || node instanceof SqlQueryComponent) && (node as SqlQueryComponent).getTypeBanError()) {
|
|
1193
|
+
// const diagnostic = {
|
|
1194
|
+
// node,
|
|
1195
|
+
// severity: 'error',
|
|
1196
|
+
// message: 'SQL查询:返回类型内部,不支持复杂类型。',
|
|
1197
|
+
// };
|
|
1198
|
+
// node.tsErrorDetail = diagnostic;
|
|
1199
|
+
// diagnostics.push(diagnostic);
|
|
1200
|
+
// }
|
|
1132
1201
|
if (node instanceof Return || node instanceof Variable) {
|
|
1133
1202
|
if (!node.typeAnnotation && !node.__TypeAnnotation) {
|
|
1134
1203
|
const nodeTypeName = node.concept === 'Return' ? '输出参数' : '局部变量';
|
|
@@ -1164,6 +1233,11 @@ export class NaslServer {
|
|
|
1164
1233
|
this.checkNodeError(node, diagnostics);
|
|
1165
1234
|
});
|
|
1166
1235
|
}
|
|
1236
|
+
if (fileNode instanceof Process) {
|
|
1237
|
+
fileNode?.sourceMap.forEach((value, node) => {
|
|
1238
|
+
this.checkNodeError(node, diagnostics);
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1167
1241
|
return diagnostics;
|
|
1168
1242
|
}
|
|
1169
1243
|
|
|
@@ -1223,6 +1297,19 @@ export class NaslServer {
|
|
|
1223
1297
|
}
|
|
1224
1298
|
});
|
|
1225
1299
|
}
|
|
1300
|
+
if (node instanceof MatchCase && (node.getAncestor('Match') as Match)?.isExpression && node.body.length === 0) {
|
|
1301
|
+
// 如果不是其他就标红
|
|
1302
|
+
if ((node?.getIndexOfParent() !== ((node.getAncestor('Match') as Match)?.cases?.length || 0) - 1)) {
|
|
1303
|
+
const diagnostic = {
|
|
1304
|
+
node,
|
|
1305
|
+
severity: 'error',
|
|
1306
|
+
message: '匹配分支:表达式不能为空',
|
|
1307
|
+
titleTip: '表达式不能为空',
|
|
1308
|
+
};
|
|
1309
|
+
node.tsErrorDetail = diagnostic;
|
|
1310
|
+
diagnostics.push(diagnostic);
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1226
1313
|
// 如果节点是match的patterns 里的
|
|
1227
1314
|
if (node?.parentKey === 'patterns' && node.parentNode instanceof MatchCase) {
|
|
1228
1315
|
const matchNode = node.getAncestor('Match');
|
|
@@ -1241,9 +1328,30 @@ export class NaslServer {
|
|
|
1241
1328
|
node.tsErrorDetail = diagnostic;
|
|
1242
1329
|
diagnostics.push(diagnostic);
|
|
1243
1330
|
}
|
|
1331
|
+
// 如果TypeAnnotation 还存在,但是本身已经不是union类型,就是已经从union换别的类型了就都要报错
|
|
1332
|
+
} else if (node instanceof TypeAnnotation && matchExpressionType?.typeKind !== 'union') {
|
|
1333
|
+
const diagnostic = {
|
|
1334
|
+
node,
|
|
1335
|
+
severity: 'error',
|
|
1336
|
+
message: '匹配:选择类型不存在',
|
|
1337
|
+
titleTip: '该类型已被删除',
|
|
1338
|
+
};
|
|
1339
|
+
node.tsErrorDetail = diagnostic;
|
|
1340
|
+
diagnostics.push(diagnostic);
|
|
1341
|
+
// 如果可枚举变量的 ,变量 还存在,但是本身已经是union类型,就是已经从别的类型 换了union就都要报错
|
|
1342
|
+
} else if (!(node instanceof TypeAnnotation) && matchExpressionType?.typeKind === 'union') {
|
|
1343
|
+
const diagnostic = {
|
|
1344
|
+
node,
|
|
1345
|
+
severity: 'error',
|
|
1346
|
+
message: '匹配:选择值不存在',
|
|
1347
|
+
titleTip: '该值无法匹配,请重新选择类型',
|
|
1348
|
+
};
|
|
1349
|
+
node.tsErrorDetail = diagnostic;
|
|
1350
|
+
diagnostics.push(diagnostic);
|
|
1244
1351
|
}
|
|
1245
1352
|
if (node.tsErrorDetail) {
|
|
1246
|
-
|
|
1353
|
+
// 如果父级是枚举,而且子集选的是变量,就提示枚举值已被删除
|
|
1354
|
+
if (matchExpressionType?.typeNamespace?.includes('enums') && (node instanceof MemberExpression)) {
|
|
1247
1355
|
node.tsErrorDetail.titleTip = '该枚举值已被删除';
|
|
1248
1356
|
} else if (!node.tsErrorDetail.titleTip) {
|
|
1249
1357
|
node.tsErrorDetail.titleTip = '该值已被删除';
|
|
@@ -1260,6 +1368,25 @@ export class NaslServer {
|
|
|
1260
1368
|
node.tsErrorDetail = diagnostic;
|
|
1261
1369
|
diagnostics.push(diagnostic);
|
|
1262
1370
|
}
|
|
1371
|
+
/**
|
|
1372
|
+
* 如果节点是内置函数
|
|
1373
|
+
* 穷举在线上的情况,不在线上就void报错, calllogic 和 callinterface 因为原来有报错,所以就忽略掉
|
|
1374
|
+
* && 他在父级中,不在body
|
|
1375
|
+
* && 也不再 if的线上
|
|
1376
|
+
* && 也不再 switch的线上consequent
|
|
1377
|
+
* && 也不再草稿区域
|
|
1378
|
+
* && 不在 parentNode.parentNode(只用处理两层的,超过两层上就需要报错,只用直接是参数位第一层的需要) 是 callfunction 和 callInfterfase中,因为这两本身有强制类型,内置函数或者一些带T的声明那种,
|
|
1379
|
+
* && 而且也没有类型,就说明在槽位里,就需要报错
|
|
1380
|
+
*/
|
|
1381
|
+
if (node instanceof CallFunction && node.parentKey !== 'body' && node.parentKey !== 'alternate' && node.parentKey !== 'playground' && node.parentKey !== 'consequent' && node.parentNode?.parentNode?.concept !== 'CallLogic' && node.parentNode?.parentNode?.concept !== 'CallInterface' && !node.__TypeAnnotation) {
|
|
1382
|
+
const diagnostic = {
|
|
1383
|
+
node,
|
|
1384
|
+
severity: 'error',
|
|
1385
|
+
message: `类型不匹配,传入类型:void`,
|
|
1386
|
+
};
|
|
1387
|
+
node.tsErrorDetail = diagnostic;
|
|
1388
|
+
diagnostics.push(diagnostic);
|
|
1389
|
+
}
|
|
1263
1390
|
}
|
|
1264
1391
|
|
|
1265
1392
|
/* 接口导入查找 */
|
|
@@ -1983,12 +2110,8 @@ export class NaslServer {
|
|
|
1983
2110
|
const minRange: MinRange = this._findMinRange(record, fileNode as FileNode);
|
|
1984
2111
|
if (minRange) {
|
|
1985
2112
|
// 如果找到节点是callLogic就去更新
|
|
1986
|
-
if (minRange.node instanceof CallLogic && node instanceof Param) {
|
|
1987
|
-
minRange.node.
|
|
1988
|
-
}
|
|
1989
|
-
// 如果节点参数增加页面也要更新
|
|
1990
|
-
if (minRange.node instanceof Destination && node instanceof Param) {
|
|
1991
|
-
minRange.node.setViewArgument(parantNode as View);
|
|
2113
|
+
if ((minRange.node instanceof CallLogic || minRange.node instanceof Destination) && node instanceof Param) {
|
|
2114
|
+
minRange.node.addCalleeArg(parantNode as any);
|
|
1992
2115
|
}
|
|
1993
2116
|
}
|
|
1994
2117
|
});
|
|
@@ -2290,7 +2413,7 @@ export class NaslServer {
|
|
|
2290
2413
|
* @returns 不需要去查就可以返回类型的节点
|
|
2291
2414
|
*/
|
|
2292
2415
|
getCurrentNodeKnownTypeAnnotation(node: BaseNode) {
|
|
2293
|
-
if (node.concept === 'StringLiteral' || node.concept === 'BooleanLiteral' || node.concept === 'NullLiteral') {
|
|
2416
|
+
if (node.concept === 'StringLiteral' || node.concept === 'StringInterpolation' || node.concept === 'BooleanLiteral' || node.concept === 'NullLiteral') {
|
|
2294
2417
|
let type = 'String';
|
|
2295
2418
|
switch (node.concept) {
|
|
2296
2419
|
case 'NullLiteral':
|
|
@@ -2307,7 +2430,7 @@ export class NaslServer {
|
|
|
2307
2430
|
return TypeAnnotation.createPrimitive('Boolean');
|
|
2308
2431
|
}
|
|
2309
2432
|
// Convert和new都是自身携带类型的,就不进行修改
|
|
2310
|
-
if (node instanceof CallFunction && node.calleeNamespace === 'nasl.util' && (
|
|
2433
|
+
if (node instanceof CallFunction && node.calleeNamespace === 'nasl.util' && (['Convert', 'New', 'FromString'].includes(node.calleeName))) {
|
|
2311
2434
|
if (node.typeArguments.length) {
|
|
2312
2435
|
return node.typeArguments[0];
|
|
2313
2436
|
}
|
|
@@ -2397,6 +2520,9 @@ export class NaslServer {
|
|
|
2397
2520
|
'Return',
|
|
2398
2521
|
'Variable',
|
|
2399
2522
|
'Match',
|
|
2523
|
+
'NewComposite',
|
|
2524
|
+
'NewList',
|
|
2525
|
+
'NewMap',
|
|
2400
2526
|
].includes(node.concept))
|
|
2401
2527
|
return;
|
|
2402
2528
|
// 要去ls那边获取的
|
|
@@ -2443,12 +2569,18 @@ export class NaslServer {
|
|
|
2443
2569
|
let newCode = item.code.substring(0, indexOf);
|
|
2444
2570
|
newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
|
|
2445
2571
|
fileDetail.offset = newCode.length + 'return '.length;
|
|
2572
|
+
} else if (['NewComposite', 'NewList', 'NewMap'].includes(node.concept)) {
|
|
2573
|
+
fileDetail.line = item.range.end.line;
|
|
2574
|
+
const indexOf = item.code.indexOf('return __newComposite');
|
|
2575
|
+
let newCode = item.code.substring(0, indexOf);
|
|
2576
|
+
newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
|
|
2577
|
+
fileDetail.offset = newCode.length + 'return '.length;
|
|
2446
2578
|
}
|
|
2447
2579
|
args.push(fileDetail);
|
|
2448
2580
|
});
|
|
2449
|
-
console.time('请求')
|
|
2581
|
+
console.time('请求');
|
|
2450
2582
|
const resultMap: any = (await this.getNaslNodeTypeFull(args)).response;
|
|
2451
|
-
console.timeEnd('请求')
|
|
2583
|
+
console.timeEnd('请求');
|
|
2452
2584
|
|
|
2453
2585
|
// console.log(resultMap);
|
|
2454
2586
|
|
|
@@ -2489,14 +2621,24 @@ export class NaslServer {
|
|
|
2489
2621
|
}
|
|
2490
2622
|
});
|
|
2491
2623
|
|
|
2492
|
-
//
|
|
2624
|
+
// 重置类型状态, 并且赋值
|
|
2493
2625
|
types.forEach((value, node) => {
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2626
|
+
try {
|
|
2627
|
+
// 因为node可能是经过处理的TypeAnnotation
|
|
2628
|
+
node.__isCorrectTypeAnnotation = true;
|
|
2629
|
+
if (value) {
|
|
2630
|
+
if (value instanceof TypeAnnotation) {
|
|
2631
|
+
node.__TypeAnnotation = (Object.freeze(value) as TypeAnnotation);
|
|
2632
|
+
} else if (value.typeAnnotation) {
|
|
2633
|
+
node.__TypeAnnotation = (Object.freeze(value.typeAnnotation) as TypeAnnotation);
|
|
2634
|
+
}
|
|
2635
|
+
} else {
|
|
2636
|
+
// 清空原来已经赋值上去的类型,可能原来有现在没有了
|
|
2637
|
+
node.__TypeAnnotation = null;
|
|
2638
|
+
}
|
|
2639
|
+
} catch (err) {
|
|
2640
|
+
if (globalThis.window) {
|
|
2641
|
+
console.log(err);
|
|
2500
2642
|
}
|
|
2501
2643
|
}
|
|
2502
2644
|
});
|
|
@@ -2767,7 +2909,7 @@ export class NaslServer {
|
|
|
2767
2909
|
};
|
|
2768
2910
|
}
|
|
2769
2911
|
|
|
2770
|
-
async getCurrentTypeAnnotation(node: BaseNode) {
|
|
2912
|
+
async getCurrentTypeAnnotation(node: BaseNode, outTime: number = 600) {
|
|
2771
2913
|
if (node.__TypeAnnotation) {
|
|
2772
2914
|
return node.__TypeAnnotation;
|
|
2773
2915
|
}
|
|
@@ -2781,7 +2923,7 @@ export class NaslServer {
|
|
|
2781
2923
|
} else {
|
|
2782
2924
|
resolve(null);
|
|
2783
2925
|
}
|
|
2784
|
-
},
|
|
2926
|
+
}, outTime);
|
|
2785
2927
|
const mySetInterval = setInterval(() => {
|
|
2786
2928
|
if (node.__isCorrectTypeAnnotation) {
|
|
2787
2929
|
resolve(node.__TypeAnnotation);
|
|
@@ -89,6 +89,10 @@ export function processToTreeFragment(process: Process) {
|
|
|
89
89
|
k.getNamespace = function () {
|
|
90
90
|
return path;
|
|
91
91
|
};
|
|
92
|
+
const api = `/api/${process.name}/${e.name}/${k.name}`;
|
|
93
|
+
k.getPath = function () {
|
|
94
|
+
return api;
|
|
95
|
+
};
|
|
92
96
|
});
|
|
93
97
|
|
|
94
98
|
fragment.elements.push({
|
|
@@ -107,6 +111,10 @@ export function processToTreeFragment(process: Process) {
|
|
|
107
111
|
launchLogic.getNamespace = function () {
|
|
108
112
|
return path;
|
|
109
113
|
};
|
|
114
|
+
const api = `/api/${process.name}/${launchLogic.name}`;
|
|
115
|
+
launchLogic.getPath = function () {
|
|
116
|
+
return api;
|
|
117
|
+
};
|
|
110
118
|
|
|
111
119
|
fragment.logics.push(launchLogic);
|
|
112
120
|
launchLogic.parentKey = 'readonly';
|