@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
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { App, Assignment, BatchAssignment, CallFunction, CallInterface, CallLogic, ForEachStatement, IfStatement, Logic, LogicItem, Match, MatchCase, Role, SwitchCase, SwitchStatement, View, ViewElement, WhileStatement } from '../concepts';
|
|
1
|
+
import { App, Assignment, BatchAssignment, CallFunction, CallInterface, CallLogic, ForEachStatement, IfStatement, Logic, LogicItem, Match, MatchCase, MemberExpression, Role, SwitchCase, SwitchStatement, View, ViewElement, WhileStatement, StringInterpolation } from '../concepts';
|
|
2
2
|
import { genBundleFiles } from './genBundleFiles';
|
|
3
|
+
import { genPermissionData } from './permission';
|
|
3
4
|
|
|
4
5
|
export async function genReleaseBody(app: App, {
|
|
5
6
|
env,
|
|
@@ -27,18 +28,35 @@ export async function genReleaseBody(app: App, {
|
|
|
27
28
|
},
|
|
28
29
|
staticUrl?: string,
|
|
29
30
|
}) {
|
|
31
|
+
let authReport: ReturnType<typeof getAuthReport>;
|
|
32
|
+
let logicPageResourceDtoList;
|
|
33
|
+
if (realRelease) {
|
|
34
|
+
authReport = getAuthReport(app);
|
|
35
|
+
logicPageResourceDtoList = await genPermissionData(app);
|
|
36
|
+
}
|
|
37
|
+
|
|
30
38
|
const body = {
|
|
31
|
-
...
|
|
39
|
+
...authReport, // 如果发布需要上报权限,导出源码不需要
|
|
32
40
|
noAuthApiPathList: getAuthApiPathList(app),
|
|
33
41
|
reportIdList: findAllReportIdList(app),
|
|
34
42
|
appId: app.id,
|
|
35
43
|
env,
|
|
36
44
|
replicas,
|
|
45
|
+
callbackLogicsName: app.getExtensionsCallbackLogics(),
|
|
37
46
|
generateMini,
|
|
38
47
|
files: [] as Array<{ name: string, content: string }>,
|
|
39
48
|
};
|
|
40
49
|
|
|
41
|
-
|
|
50
|
+
if (logicPageResourceDtoList)
|
|
51
|
+
Object.assign(body, { logicPageResourceDtoList });
|
|
52
|
+
|
|
53
|
+
let NaslAnnotatedJSON;
|
|
54
|
+
try {
|
|
55
|
+
NaslAnnotatedJSON = await (app as any).naslServer.getNaslAnnotatedJSON(app, true);
|
|
56
|
+
} catch (err) {
|
|
57
|
+
console.error(err);
|
|
58
|
+
throw new Error('代码标注失败');
|
|
59
|
+
}
|
|
42
60
|
|
|
43
61
|
let files = genBundleFiles(app, Object.assign({}, appInfo, {
|
|
44
62
|
env,
|
|
@@ -59,7 +77,9 @@ export async function genReleaseBody(app: App, {
|
|
|
59
77
|
const jsonString = JSON.stringify(NaslAnnotatedJSON);
|
|
60
78
|
|
|
61
79
|
// 打印传给服务端的nasl,为了服务端排查问题方便
|
|
62
|
-
|
|
80
|
+
if (globalThis.window) {
|
|
81
|
+
console.log(NaslAnnotatedJSON, '标注后的nasl');
|
|
82
|
+
}
|
|
63
83
|
files.push({ name: 'nasl-annotated.json', content: jsonString });
|
|
64
84
|
|
|
65
85
|
body.files = files;
|
|
@@ -73,7 +93,7 @@ function getAuthReport(app: App) {
|
|
|
73
93
|
const result = {
|
|
74
94
|
roleList: [] as Array<Role>,
|
|
75
95
|
resourceList: [] as Array<string>,
|
|
76
|
-
resourceDataList: [] as Array<{ value: string, description: string }>,
|
|
96
|
+
resourceDataList: [] as Array<{ value: string, description: string, type: 'page' | 'component' | 'logic' }>,
|
|
77
97
|
roleResourceMappingList: [] as Array<{ roleName: string, resourcePath: string }>,
|
|
78
98
|
};
|
|
79
99
|
|
|
@@ -100,6 +120,7 @@ function getAuthReport(app: App) {
|
|
|
100
120
|
result.resourceDataList.push({
|
|
101
121
|
value: view.authPath,
|
|
102
122
|
description: view.authDescription,
|
|
123
|
+
type: view.concept === 'View' ? 'page' : 'component',
|
|
103
124
|
});
|
|
104
125
|
if (view.bindRoles) {
|
|
105
126
|
const _arr = view.bindRoles.map((it) => ({
|
|
@@ -240,6 +261,10 @@ function getAuthApiPathList(app: App) {
|
|
|
240
261
|
logicItems = state.arguments?.map((item) => item.expression);
|
|
241
262
|
} else if (state instanceof CallInterface) {
|
|
242
263
|
logicItems = state.arguments?.map((item) => item.expression);
|
|
264
|
+
} else if (state instanceof MemberExpression) {
|
|
265
|
+
logicItems = [state.object, state.property];
|
|
266
|
+
} else if (state instanceof StringInterpolation) {
|
|
267
|
+
logicItems = [...state.expressions];
|
|
243
268
|
}
|
|
244
269
|
|
|
245
270
|
return logicItems.filter((item) => !!item);
|
package/src/generator/index.ts
CHANGED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { Logic, View, BaseNode, CallLogic, ViewElement, BindEvent, BindAttribute, App, Entity, Module } from "../concepts";
|
|
2
|
+
import { processToTreeFragment } from '../server/process2LogicNamespace';
|
|
3
|
+
|
|
4
|
+
type Usage = {
|
|
5
|
+
node: BaseNode,
|
|
6
|
+
children?: Usage[],
|
|
7
|
+
}
|
|
8
|
+
type ResourceNode = {
|
|
9
|
+
path: string,
|
|
10
|
+
type: 'component' | 'page',
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function isReadOnly(logic: Logic) {
|
|
14
|
+
return !!logic.module
|
|
15
|
+
|| logic.parentNode?.concept === 'Namespace'
|
|
16
|
+
|| logic.parentKey === 'readonly'; // process logic
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const cache = new Map();
|
|
20
|
+
let useCache = false;
|
|
21
|
+
async function findUsage(logic: Logic) {
|
|
22
|
+
if(useCache && cache.has(logic))
|
|
23
|
+
return cache.get(logic);
|
|
24
|
+
|
|
25
|
+
const res = isReadOnly(logic) ? await logic.findReadOnlyLogicUsage() : await logic.findUsage();
|
|
26
|
+
if(useCache) cache.set(logic, res);
|
|
27
|
+
return res;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function openCache() {
|
|
31
|
+
useCache = true;
|
|
32
|
+
cache.clear();
|
|
33
|
+
}
|
|
34
|
+
function closeCache() {
|
|
35
|
+
useCache = false;
|
|
36
|
+
cache.clear();
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async function findViewLogicReferences(logic: Logic, vis: Set<Logic> = new Set()) {
|
|
40
|
+
const usageMap: Map<BaseNode, Usage> = await findUsage(logic);
|
|
41
|
+
const usages: Usage[] = [];
|
|
42
|
+
usageMap.forEach((usage: Usage, node: BaseNode) => {
|
|
43
|
+
if(node instanceof View) usages.push(usage);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
async function dfs(usage: Usage) {
|
|
47
|
+
if(usage.node instanceof CallLogic) {
|
|
48
|
+
const logic = usage.node.logic;
|
|
49
|
+
if(!vis.has(logic)) {
|
|
50
|
+
vis.add(logic);
|
|
51
|
+
await findViewLogicReferences(logic, vis);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if(usage.children) {
|
|
56
|
+
for(const child of usage.children) {
|
|
57
|
+
await dfs(child);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
for(const usage of usages) {
|
|
63
|
+
await dfs(usage);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return Array.from(vis);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function findUIReferences(logic: Logic) {
|
|
70
|
+
const usageMap: Map<BaseNode, Usage> = await findUsage(logic);
|
|
71
|
+
const usages: Usage[] = [];
|
|
72
|
+
usageMap.forEach((usage: Usage, node: BaseNode) => {
|
|
73
|
+
if(node instanceof View) usages.push(usage);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const res: Array<View | ViewElement> = [];
|
|
77
|
+
function dfs(usage: Usage, parent: Usage = null) {
|
|
78
|
+
if((usage.node instanceof BindEvent || usage.node instanceof BindAttribute)
|
|
79
|
+
&& (parent.node instanceof View || parent.node instanceof ViewElement))
|
|
80
|
+
res.push(parent.node);
|
|
81
|
+
|
|
82
|
+
usage.children?.forEach((child) => {
|
|
83
|
+
dfs(child, usage);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
usages.forEach((usage) => {
|
|
88
|
+
dfs(usage);
|
|
89
|
+
});
|
|
90
|
+
return res;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function findResourcesOfUI(view: View | ViewElement) {
|
|
94
|
+
const res: ResourceNode[] = [];
|
|
95
|
+
let node: BaseNode = view;
|
|
96
|
+
while(node) {
|
|
97
|
+
if(node instanceof View && node.auth)
|
|
98
|
+
res.push({
|
|
99
|
+
path: node.authPath,
|
|
100
|
+
type: 'page',
|
|
101
|
+
});
|
|
102
|
+
else if(node instanceof ViewElement) {
|
|
103
|
+
const hasAuth = node.bindDirectives.find((directive) => directive.name === 'auth');
|
|
104
|
+
if(hasAuth)
|
|
105
|
+
res.push({
|
|
106
|
+
path: node.authPath,
|
|
107
|
+
type: 'component',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
node = node.parentNode;
|
|
111
|
+
}
|
|
112
|
+
return res;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function optimizeResourceData(resources: ResourceNode[][]) {
|
|
116
|
+
let res = removeRedundantResourceData(resources);
|
|
117
|
+
res = removeRedundantResourceData2(res);
|
|
118
|
+
return res;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// [['b'], ['a' ,'b']] 只需要保留 [['b']]
|
|
122
|
+
function removeRedundantResourceData(resources: ResourceNode[][]) {
|
|
123
|
+
const wm: WeakMap<ResourceNode[], string> = new WeakMap();
|
|
124
|
+
for(const resource of resources) {
|
|
125
|
+
const hash = resource.map(({ path, type }) => `${path}_${type}`)
|
|
126
|
+
.join();
|
|
127
|
+
wm.set(resource, hash);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
resources.sort((a, b) => wm.get(a).length - wm.get(b).length);
|
|
131
|
+
|
|
132
|
+
const res: ResourceNode[][] = [];
|
|
133
|
+
const hashs: string[] = [];;
|
|
134
|
+
|
|
135
|
+
for(const resource of resources) {
|
|
136
|
+
const hash = wm.get(resource);
|
|
137
|
+
if(hashs.some((h) => hash.endsWith(h))) continue;
|
|
138
|
+
|
|
139
|
+
res.push(resource);
|
|
140
|
+
hashs.push(hash);
|
|
141
|
+
}
|
|
142
|
+
return res;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// 子页面有权限,父页面默认也有权限,所以不需要记录父页面权限;
|
|
146
|
+
// 组件有权限,组件所在的页面默认也有权限,所以不需要记录页面权限
|
|
147
|
+
function removeRedundantResourceData2(resources: ResourceNode[][]) {
|
|
148
|
+
return resources.map((resource) => {
|
|
149
|
+
if(resource.length <= 1) return resource;
|
|
150
|
+
|
|
151
|
+
if(resource[0].type === 'page')
|
|
152
|
+
return resource.slice(0, 1);
|
|
153
|
+
else if(resource[0].type === 'component')
|
|
154
|
+
return resource.filter((item) => item.type === 'component');
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async function findResourcesOfLogic(logic: Logic, uploaders: Map<string, ViewElement[]>) {
|
|
159
|
+
const logics = await findViewLogicReferences(logic);
|
|
160
|
+
logics.push(logic);
|
|
161
|
+
|
|
162
|
+
let UIs: Array<View | ViewElement> = [];
|
|
163
|
+
for(const logic of logics) {
|
|
164
|
+
UIs = UIs.concat(await findUIReferences(logic));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const service = logic.toService() as { url: { method: string, path: string } };
|
|
168
|
+
if(uploaders.has(service.url.path)) {
|
|
169
|
+
UIs = UIs.concat(uploaders.get(service.url.path));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
UIs = Array.from(new Set(UIs));
|
|
173
|
+
|
|
174
|
+
const res = UIs.map((ui) => findResourcesOfUI(ui));
|
|
175
|
+
|
|
176
|
+
return optimizeResourceData(res);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
function getAllLogics(app: App) {
|
|
180
|
+
const modules: Module[] = [];
|
|
181
|
+
const entities: Entity[] = [];
|
|
182
|
+
const logics: Logic[] = [];
|
|
183
|
+
|
|
184
|
+
if (Array.isArray(app.dataSources)) {
|
|
185
|
+
app.dataSources.forEach((dataSource) => {
|
|
186
|
+
if (Array.isArray(dataSource.entities)) {
|
|
187
|
+
entities.push(...dataSource.entities);
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
app.logics && logics.push(...app.logics);
|
|
192
|
+
|
|
193
|
+
app.dependencies && modules.push(...app.dependencies);
|
|
194
|
+
app.interfaceDependencies && modules.push(...app.interfaceDependencies);
|
|
195
|
+
|
|
196
|
+
modules.forEach((module: Module) => {
|
|
197
|
+
module.logics && logics.push(...module.logics);
|
|
198
|
+
if (Array.isArray(module.dataSources)) {
|
|
199
|
+
module.dataSources.forEach((dataSource) => {
|
|
200
|
+
if (Array.isArray(dataSource.entities)) {
|
|
201
|
+
entities.push(...dataSource.entities);
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
const allLogics: Logic[] = [];
|
|
208
|
+
|
|
209
|
+
if (Array.isArray(entities)) {
|
|
210
|
+
entities.forEach((entity) => {
|
|
211
|
+
const ns = entity.ns;
|
|
212
|
+
if (Array.isArray(ns?.logics)) {
|
|
213
|
+
allLogics.push(...ns.logics);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
if (Array.isArray(logics)) {
|
|
218
|
+
allLogics.push(...logics);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const processLogics: Logic[] = [];
|
|
222
|
+
const processTreeFragments = (app.processes || [])
|
|
223
|
+
.map(processToTreeFragment);
|
|
224
|
+
processTreeFragments.forEach(tree => {
|
|
225
|
+
processLogics.push(...tree.logics);
|
|
226
|
+
tree.elements.forEach((element) => {
|
|
227
|
+
processLogics.push(...element.logics);
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
return {
|
|
232
|
+
logics: allLogics,
|
|
233
|
+
processLogics: processLogics,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function findUploaders(app: App) {
|
|
238
|
+
const map = new Map<string, ViewElement[]>();
|
|
239
|
+
app.traverseChildren((node) => {
|
|
240
|
+
if(node instanceof ViewElement && node.tag?.includes('uploader')) {
|
|
241
|
+
const urlAttr = node.bindAttrs.find((item) => item.name === 'url');
|
|
242
|
+
const url = urlAttr?.value;
|
|
243
|
+
if(url) {
|
|
244
|
+
if(!map.has(url))
|
|
245
|
+
map.set(url, [node]);
|
|
246
|
+
else
|
|
247
|
+
map.get(url).push(node);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
});
|
|
251
|
+
return map;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export async function genPermissionData(app: App) {
|
|
255
|
+
// console.time('xxx');
|
|
256
|
+
openCache();
|
|
257
|
+
const logicPageResourceDtoList: { [key: string]: ResourceNode[][] } = {};
|
|
258
|
+
const { logics, processLogics } = getAllLogics(app);
|
|
259
|
+
const uploaders = findUploaders(app);
|
|
260
|
+
for(const logic of [...logics, ...processLogics]) {
|
|
261
|
+
let resources = await findResourcesOfLogic(logic, uploaders);
|
|
262
|
+
if(resources.length === 0) continue;
|
|
263
|
+
|
|
264
|
+
const service = logics.includes(logic) ? logic.toService() : logic.toProcessService() as { url: { method: string, path: string } };
|
|
265
|
+
const key = `${service.url.path}:${service.url.method}`;
|
|
266
|
+
logicPageResourceDtoList[key] = resources;
|
|
267
|
+
}
|
|
268
|
+
closeCache();
|
|
269
|
+
// console.timeEnd('xxx');
|
|
270
|
+
return logicPageResourceDtoList;
|
|
271
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { EventEmitter, EventPayload, BaseNode } from './common';
|
|
2
2
|
export * from './concepts';
|
|
3
|
-
export { genBundleFiles, genMetaData, genReleaseBody } from './generator';
|
|
3
|
+
export { genBundleFiles, genMetaData, genReleaseBody, genPermissionData } from './generator';
|
|
4
4
|
export * from './translator';
|
|
5
5
|
// export { default as diagnosticManager } from './manager/diagnostic';
|
|
6
6
|
export { default as server, NaslServer } from './server';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallLogic, EntityProperty, BindEvent, App, Namespace, Entity, BaseNode, Logic, Param, TypeAnnotation, Function, Return } from '..';
|
|
1
|
+
import { CallLogic, EntityProperty, BindEvent, App, Namespace, Entity, BaseNode, Logic, Param, TypeAnnotation, Function, Return, AnonymousFunction, NewList } from '..';
|
|
2
2
|
|
|
3
3
|
export function entity2LogicNamespace(entity: Entity) {
|
|
4
4
|
const properties = entity.properties;
|
|
@@ -86,6 +86,26 @@ export function entity2LogicNamespace(entity: Entity) {
|
|
|
86
86
|
}),
|
|
87
87
|
required: true,
|
|
88
88
|
}),
|
|
89
|
+
new Param({
|
|
90
|
+
name: 'properties',
|
|
91
|
+
defaultExpression: new AnonymousFunction({
|
|
92
|
+
description: '',
|
|
93
|
+
params: [
|
|
94
|
+
new Param({
|
|
95
|
+
name: 'item',
|
|
96
|
+
typeAnnotation: new TypeAnnotation({
|
|
97
|
+
typeKind: 'reference',
|
|
98
|
+
typeNamespace: entity.getNamespace(),
|
|
99
|
+
typeName: entity.name,
|
|
100
|
+
}),
|
|
101
|
+
}),
|
|
102
|
+
],
|
|
103
|
+
body: new NewList({
|
|
104
|
+
concept: 'NewList',
|
|
105
|
+
}),
|
|
106
|
+
}),
|
|
107
|
+
required: false,
|
|
108
|
+
}),
|
|
89
109
|
],
|
|
90
110
|
returns: [
|
|
91
111
|
new Return({
|
|
@@ -135,15 +155,6 @@ export function entity2LogicNamespace(entity: Entity) {
|
|
|
135
155
|
name: 'updateBy',
|
|
136
156
|
description: '根据条件,将body除id外所有属性更新到数据记录',
|
|
137
157
|
params: [
|
|
138
|
-
new Param({
|
|
139
|
-
name: 'body',
|
|
140
|
-
typeAnnotation: new TypeAnnotation({
|
|
141
|
-
typeKind: 'reference',
|
|
142
|
-
typeNamespace: entity.getNamespace(),
|
|
143
|
-
typeName: entity.name,
|
|
144
|
-
}),
|
|
145
|
-
required: true,
|
|
146
|
-
}),
|
|
147
158
|
new Param({
|
|
148
159
|
name: 'filter',
|
|
149
160
|
defaultExpression: new Function({
|
|
@@ -167,6 +178,35 @@ export function entity2LogicNamespace(entity: Entity) {
|
|
|
167
178
|
}),
|
|
168
179
|
required: true,
|
|
169
180
|
}),
|
|
181
|
+
new Param({
|
|
182
|
+
name: 'body',
|
|
183
|
+
typeAnnotation: new TypeAnnotation({
|
|
184
|
+
typeKind: 'reference',
|
|
185
|
+
typeNamespace: entity.getNamespace(),
|
|
186
|
+
typeName: entity.name,
|
|
187
|
+
}),
|
|
188
|
+
required: true,
|
|
189
|
+
}),
|
|
190
|
+
new Param({
|
|
191
|
+
name: 'properties',
|
|
192
|
+
defaultExpression: new AnonymousFunction({
|
|
193
|
+
description: '',
|
|
194
|
+
params: [
|
|
195
|
+
new Param({
|
|
196
|
+
name: 'item',
|
|
197
|
+
typeAnnotation: new TypeAnnotation({
|
|
198
|
+
typeKind: 'reference',
|
|
199
|
+
typeNamespace: entity.getNamespace(),
|
|
200
|
+
typeName: entity.name,
|
|
201
|
+
}),
|
|
202
|
+
}),
|
|
203
|
+
],
|
|
204
|
+
body: new NewList({
|
|
205
|
+
concept: 'NewList',
|
|
206
|
+
}),
|
|
207
|
+
}),
|
|
208
|
+
required: false,
|
|
209
|
+
}),
|
|
170
210
|
],
|
|
171
211
|
returns: [
|
|
172
212
|
new Return({
|
|
@@ -257,6 +297,26 @@ export function entity2LogicNamespace(entity: Entity) {
|
|
|
257
297
|
}),
|
|
258
298
|
required: true,
|
|
259
299
|
}),
|
|
300
|
+
new Param({
|
|
301
|
+
name: 'properties',
|
|
302
|
+
defaultExpression: new AnonymousFunction({
|
|
303
|
+
description: '',
|
|
304
|
+
params: [
|
|
305
|
+
new Param({
|
|
306
|
+
name: 'item',
|
|
307
|
+
typeAnnotation: new TypeAnnotation({
|
|
308
|
+
typeKind: 'reference',
|
|
309
|
+
typeNamespace: entity.getNamespace(),
|
|
310
|
+
typeName: entity.name,
|
|
311
|
+
}),
|
|
312
|
+
}),
|
|
313
|
+
],
|
|
314
|
+
body: new NewList({
|
|
315
|
+
concept: 'NewList',
|
|
316
|
+
}),
|
|
317
|
+
}),
|
|
318
|
+
required: false,
|
|
319
|
+
}),
|
|
260
320
|
],
|
|
261
321
|
returns: [
|
|
262
322
|
new Return({
|
|
@@ -161,19 +161,6 @@ BaseNode.prototype.prepareDelete = async function prepareDelete() {
|
|
|
161
161
|
refsList = refsList.filter((item) =>
|
|
162
162
|
// 因为ui组件本身会多渲染一次,就先过滤一个
|
|
163
163
|
!(item.lineText.includes(': nasl.ui.')));
|
|
164
|
-
// 删除参数单独处理
|
|
165
|
-
if (node instanceof Param) {
|
|
166
|
-
const methodRefs: tsProtocol.ReferencesResponseItem[] = [];
|
|
167
|
-
refsList.forEach((item) => {
|
|
168
|
-
// 入参查找引用,查到logic 和自己,内容完全一样,就保留一个
|
|
169
|
-
const find = methodRefs.find((findItem) => item.lineText === findItem.lineText);
|
|
170
|
-
if (!find) {
|
|
171
|
-
methodRefs.push(item);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
refsList = methodRefs;
|
|
175
|
-
}
|
|
176
|
-
|
|
177
164
|
// delete的弹框展示
|
|
178
165
|
const confirmParms = {
|
|
179
166
|
actionType: 'delete',
|
|
@@ -182,7 +169,7 @@ BaseNode.prototype.prepareDelete = async function prepareDelete() {
|
|
|
182
169
|
icon: 'warning',
|
|
183
170
|
};
|
|
184
171
|
let callback = null;
|
|
185
|
-
if (refsList.length <= 1) {
|
|
172
|
+
if (refsList.length <= 1 || (node instanceof Param && node.parentNode instanceof Logic && refsList.length <= 2)) {
|
|
186
173
|
// 页面组件直接删除然后return
|
|
187
174
|
if (node instanceof ViewElement) {
|
|
188
175
|
this.delete();
|
|
@@ -235,6 +222,7 @@ BaseNode.prototype.prepareDelete = async function prepareDelete() {
|
|
|
235
222
|
App.emit('collect:start', {
|
|
236
223
|
actionMsg: '删除参数',
|
|
237
224
|
});
|
|
225
|
+
const Index = node.getIndexOfParent();
|
|
238
226
|
this.delete();
|
|
239
227
|
refsList.forEach((record) => {
|
|
240
228
|
const fileNode = naslServer.file2NodeMap.get(record.file);
|
|
@@ -242,11 +230,12 @@ BaseNode.prototype.prepareDelete = async function prepareDelete() {
|
|
|
242
230
|
return null;
|
|
243
231
|
const minRange: MinRange = naslServer._findMinRange(record, fileNode as FileNode);
|
|
244
232
|
if (minRange) {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
233
|
+
/**
|
|
234
|
+
* 调用方是 调用逻辑或者跳转页面, 去删除对应位置的内容
|
|
235
|
+
* 如果是跳转页面,因为流程下的特殊翻译,需要过滤下 非页面下的参数修改,查找到页面跳转
|
|
236
|
+
*/
|
|
237
|
+
if (minRange.node instanceof CallLogic || (node.parentNode instanceof View && minRange.node instanceof Destination)) {
|
|
238
|
+
minRange.node.deleteCalleeArg(Index);
|
|
250
239
|
}
|
|
251
240
|
}
|
|
252
241
|
});
|
|
@@ -354,14 +343,14 @@ BaseNode.prototype.addParamsPrepare = async function addParamsPrepare(needAdd =
|
|
|
354
343
|
/**
|
|
355
344
|
* 在原型上增加方法来调用
|
|
356
345
|
*/
|
|
357
|
-
BaseNode.prototype.getCurrentTypeAnnotation = async function getCurrentTypeAnnotation() {
|
|
346
|
+
BaseNode.prototype.getCurrentTypeAnnotation = async function getCurrentTypeAnnotation(outTime? :number) {
|
|
358
347
|
try {
|
|
359
348
|
/**
|
|
360
349
|
* 查找这个节点是不是有依赖
|
|
361
350
|
*/
|
|
362
351
|
const app = this.getAncestor('App');
|
|
363
352
|
const naslServer = (app as any).naslServer as NaslServer;
|
|
364
|
-
return naslServer.getCurrentTypeAnnotation(this);
|
|
353
|
+
return naslServer.getCurrentTypeAnnotation(this, outTime || 2000);
|
|
365
354
|
} catch (err) {
|
|
366
355
|
console.log(err);
|
|
367
356
|
}
|