@lcap/nasl 3.3.3-beta.8 → 3.3.3-beta.9
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/.nyc_output/{78804420-ead6-486f-b682-ab54ccd95dc9.json → 559608df-ab15-4969-acf0-5239dacd6111.json} +1 -1
- package/.nyc_output/processinfo/559608df-ab15-4969-acf0-5239dacd6111.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/index.html +66 -66
- package/coverage/src/automate/engine/index.html +1 -1
- package/coverage/src/automate/engine/utils.js.html +44 -44
- package/coverage/src/bak/index.html +15 -15
- package/coverage/src/bak/translator.js.html +29 -269
- package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +43 -7
- package/coverage/src/breakpoint/generator/CallbackNode.ts.html +59 -8
- package/coverage/src/breakpoint/generator/index.html +21 -21
- package/coverage/src/breakpoint/generator/index.ts.html +1 -1
- package/coverage/src/breakpoint/index.html +1 -1
- package/coverage/src/breakpoint/index.ts.html +1 -1
- package/coverage/src/breakpoint/shared/constants.ts.html +1 -1
- package/coverage/src/breakpoint/shared/index.html +1 -1
- package/coverage/src/breakpoint/shared/index.ts.html +1 -1
- package/coverage/src/breakpoint/shared/operations.ts.html +2 -2
- package/coverage/src/breakpoint/shared/socket.ts.html +1 -1
- package/coverage/src/breakpoint/shared/utils.ts.html +1 -1
- package/coverage/src/breakpoint/store/core.ts.html +3 -3
- package/coverage/src/breakpoint/store/dock.ts.html +1 -1
- package/coverage/src/breakpoint/store/index.html +1 -1
- package/coverage/src/breakpoint/store/index.ts.html +1 -1
- package/coverage/src/common/BaseNode.ts.html +113 -113
- package/coverage/src/common/Command.ts.html +2 -2
- package/coverage/src/common/EventEmitter.ts.html +31 -31
- package/coverage/src/common/Messager.ts.html +1 -1
- package/coverage/src/common/asyncFuncMap.ts.html +1 -1
- package/coverage/src/common/index.html +5 -5
- package/coverage/src/common/index.ts.html +1 -1
- package/coverage/src/common/utils.ts.html +1 -1
- package/coverage/src/concepts/Abort__.ts.html +1 -1
- package/coverage/src/concepts/AbstractInterface__.ts.html +280 -0
- package/coverage/src/concepts/Anchor__.ts.html +1 -1
- package/coverage/src/concepts/AnonymousFunction__.ts.html +5 -5
- package/coverage/src/concepts/App__.ts.html +36 -36
- package/coverage/src/concepts/Argument__.ts.html +43 -58
- package/coverage/src/concepts/Assignee__.ts.html +1 -1
- package/coverage/src/concepts/AssignmentLine__.ts.html +7 -7
- package/coverage/src/concepts/Assignment__.ts.html +21 -75
- package/coverage/src/concepts/Attribute__.ts.html +1 -1
- package/coverage/src/concepts/AuthInterface__.ts.html +1 -1
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +1 -1
- package/coverage/src/concepts/AuthLogic__.ts.html +1 -1
- package/coverage/src/concepts/BackendVariable__.ts.html +29 -65
- package/coverage/src/concepts/Backend__.ts.html +6 -6
- package/coverage/src/concepts/BatchAssignment__.ts.html +1 -1
- package/coverage/src/concepts/BinaryExpression__.ts.html +50 -128
- package/coverage/src/concepts/BindAttribute__.ts.html +54 -345
- package/coverage/src/concepts/BindDirective__.ts.html +1 -1
- package/coverage/src/concepts/BindEvent__.ts.html +8 -8
- package/coverage/src/concepts/BindStyle__.ts.html +1 -1
- package/coverage/src/concepts/Block__.ts.html +910 -0
- package/coverage/src/concepts/BooleanLiteral__.ts.html +1 -1
- package/coverage/src/concepts/CallAuthInterface__.ts.html +1 -1
- package/coverage/src/concepts/CallConnector__.ts.html +1 -1
- package/coverage/src/concepts/CallFunction__.ts.html +76 -52
- package/coverage/src/concepts/CallInterface__.ts.html +1 -1
- package/coverage/src/concepts/CallLogic__.ts.html +387 -219
- package/coverage/src/concepts/CallQueryComponent__.ts.html +1 -1
- package/coverage/src/concepts/Comment__.ts.html +1 -1
- package/coverage/src/concepts/CompletionProperty__.ts.html +1 -1
- package/coverage/src/concepts/ConfigGroup__.ts.html +6 -6
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +1 -1
- package/coverage/src/concepts/ConfigProperty__.ts.html +1 -1
- package/coverage/src/concepts/Configuration__.ts.html +7 -7
- package/coverage/src/concepts/Connection__.ts.html +1 -1
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +1 -1
- package/coverage/src/concepts/Connector__.ts.html +1 -1
- package/coverage/src/concepts/Constant__.ts.html +1 -1
- package/coverage/src/concepts/CountersignPolicy__.ts.html +316 -0
- package/coverage/src/concepts/DataSource__.ts.html +13 -13
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +1 -1
- package/coverage/src/{automate/engine/operators.js.html → concepts/DefaultValue__.ts.html} +485 -347
- package/coverage/src/concepts/Destination__.ts.html +1 -1
- package/coverage/src/concepts/End__.ts.html +6 -6
- package/coverage/src/concepts/EntityIndex__.ts.html +1 -1
- package/coverage/src/concepts/EntityProperty__.ts.html +12 -12
- package/coverage/src/concepts/Entity__.ts.html +17 -17
- package/coverage/src/concepts/EnumItem__.ts.html +1 -1
- package/coverage/src/concepts/Enum__.ts.html +1 -1
- package/coverage/src/concepts/Event__.ts.html +1 -1
- package/coverage/src/concepts/ExternalDestination__.ts.html +1 -1
- package/coverage/src/concepts/ForEachStatement__.ts.html +28 -55
- package/coverage/src/concepts/FrontendLibrary__.ts.html +1 -1
- package/coverage/src/concepts/FrontendVariable__.ts.html +1 -1
- package/coverage/src/concepts/Frontend__.ts.html +12 -12
- package/coverage/src/concepts/Function__.ts.html +8 -8
- package/coverage/src/concepts/I18nInfo__.ts.html +436 -0
- package/coverage/src/concepts/Identifier__.ts.html +42 -51
- package/coverage/src/concepts/IfStatement__.ts.html +1 -1
- package/coverage/src/concepts/ImportedInterface__.ts.html +268 -0
- package/coverage/src/concepts/Integration__.ts.html +1 -1
- package/coverage/src/concepts/InterfaceParam__.ts.html +1 -1
- package/coverage/src/concepts/Interface__.ts.html +1 -1
- package/coverage/src/concepts/JSBlock__.ts.html +8 -182
- package/coverage/src/concepts/JavaLogic__.ts.html +1 -1
- package/coverage/src/concepts/LogicItem__.ts.html +20 -20
- package/coverage/src/concepts/Logic__.ts.html +25 -22
- package/coverage/src/concepts/MatchCase__.ts.html +1 -1
- package/coverage/src/concepts/Match__.ts.html +25 -10
- package/coverage/src/concepts/MemberExpression__.ts.html +10 -7
- package/coverage/src/concepts/MetadataType__.ts.html +1 -1
- package/coverage/src/concepts/MicroApp__.ts.html +1 -1
- package/coverage/src/concepts/Module__.ts.html +20 -20
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +1 -1
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +1 -1
- package/coverage/src/concepts/MultiApprovalPolicy__.ts.html +292 -0
- package/coverage/src/concepts/Namespace__.ts.html +18 -18
- package/coverage/src/concepts/NewComposite__.ts.html +59 -32
- package/coverage/src/concepts/NewList__.ts.html +5 -5
- package/coverage/src/concepts/NewMap__.ts.html +1 -1
- package/coverage/src/concepts/New__.ts.html +1 -1
- package/coverage/src/concepts/NullLiteral__.ts.html +1 -1
- package/coverage/src/concepts/NumericLiteral__.ts.html +10 -13
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +1 -1
- package/coverage/src/concepts/OverriddenLogic__.ts.html +1 -1
- package/coverage/src/concepts/Param__.ts.html +40 -79
- package/coverage/src/concepts/Point__.ts.html +1 -1
- package/coverage/src/concepts/ProcessComponent__.ts.html +1 -1
- package/coverage/src/concepts/ProcessElement__.ts.html +216 -9
- package/coverage/src/concepts/ProcessOutcome__.ts.html +1 -1
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +1 -1
- package/coverage/src/concepts/Process__.ts.html +8 -2
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +1 -1
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +1 -1
- package/coverage/src/concepts/QueryFromExpression__.ts.html +1 -1
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +1 -1
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +1 -1
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +1 -1
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +1 -1
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +1 -1
- package/coverage/src/concepts/Rect__.ts.html +1 -1
- package/coverage/src/concepts/Return__.ts.html +36 -75
- package/coverage/src/concepts/Role__.ts.html +1 -1
- package/coverage/src/concepts/SelectMembers__.ts.html +7 -7
- package/coverage/src/concepts/SequentialPolicy__.ts.html +259 -0
- package/coverage/src/concepts/Slot__.ts.html +1 -1
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +1 -1
- package/coverage/src/concepts/Start__.ts.html +6 -6
- package/coverage/src/concepts/StaticString__.ts.html +403 -0
- package/coverage/src/concepts/StringInterpolation__.ts.html +38 -32
- package/coverage/src/concepts/StringLiteral__.ts.html +13 -13
- package/coverage/src/concepts/StructureProperty__.ts.html +7 -7
- package/coverage/src/concepts/Structure__.ts.html +7 -7
- package/coverage/src/concepts/SwitchCase__.ts.html +1 -1
- package/coverage/src/concepts/SwitchStatement__.ts.html +1 -1
- package/coverage/src/concepts/Theme__.ts.html +7 -7
- package/coverage/src/concepts/Transactional__.ts.html +1 -1
- package/coverage/src/concepts/TriggerEvent__.ts.html +1 -1
- package/coverage/src/concepts/TriggerLauncher__.ts.html +1 -1
- package/coverage/src/concepts/TypeAnnotation__.ts.html +23 -23
- package/coverage/src/concepts/TypeParam__.ts.html +1 -1
- package/coverage/src/concepts/UnaryExpression__.ts.html +1 -1
- package/coverage/src/concepts/Unparsed__.ts.html +1 -1
- package/coverage/src/concepts/UseComponent__.ts.html +1 -1
- package/coverage/src/concepts/ValidationRule__.ts.html +9 -9
- package/coverage/src/concepts/Variable__.ts.html +35 -74
- package/coverage/src/concepts/ViewBlock__.ts.html +1 -1
- package/coverage/src/concepts/ViewComponent__.ts.html +1 -1
- package/coverage/src/concepts/ViewElement__.ts.html +50 -254
- package/coverage/src/concepts/View__.ts.html +42 -84
- package/coverage/src/concepts/WhileStatement__.ts.html +1 -1
- package/coverage/src/concepts/basics/constants.ts.html +88 -0
- package/coverage/src/concepts/basics/index.html +116 -0
- package/coverage/src/concepts/basics/stdlib/index.html +1 -1
- package/coverage/src/concepts/basics/stdlib/index.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +2 -2
- package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +1 -1
- package/coverage/src/concepts/basics/types/coreTypeList.ts.html +1 -1
- package/coverage/src/concepts/basics/types/index.html +1 -1
- package/coverage/src/concepts/basics/types/index.ts.html +1 -1
- package/coverage/src/concepts/index.html +238 -193
- package/coverage/src/concepts/index.ts.html +1 -1
- package/coverage/src/concepts/index__.ts.html +13 -4
- package/coverage/src/concepts/utils/asserts.ts.html +27967 -0
- package/coverage/src/{automate/template → concepts/utils}/index.html +22 -22
- package/coverage/src/config.ts.html +1 -1
- package/coverage/src/decorators/index.html +1 -1
- package/coverage/src/decorators/index.ts.html +24 -24
- package/coverage/src/decorators/promise.ts.html +1 -1
- package/coverage/src/eventBus.ts.html +1 -1
- package/coverage/src/generator/compileComponent.ts.html +4 -4
- package/coverage/src/generator/genBundleFiles.ts.html +1 -1
- package/coverage/src/generator/genHash.ts.html +3 -3
- package/coverage/src/generator/genMetaData.ts.html +1 -1
- package/coverage/src/generator/genReleaseBody.ts.html +41 -41
- package/coverage/src/generator/icestark.ts.html +1 -1
- package/coverage/src/generator/index.html +1 -1
- package/coverage/src/generator/index.ts.html +1 -1
- package/coverage/src/generator/microApp.ts.html +1 -1
- package/coverage/src/generator/permission.ts.html +1 -1
- package/coverage/src/generator/qiankun.ts.html +1 -1
- package/coverage/src/generator/styleReplacer.ts.html +1 -1
- package/coverage/src/index.html +1 -1
- package/coverage/src/index.ts.html +1 -1
- package/coverage/src/manager/diagnostic.ts.html +1 -1
- package/coverage/src/manager/index.html +1 -1
- package/coverage/src/manager/stepRecorder.ts.html +1 -1
- package/coverage/src/natural/genNaturalTS.ts.html +1 -1
- package/coverage/src/natural/index.html +1 -1
- package/coverage/src/natural/index.ts.html +1 -1
- package/coverage/src/natural/naslStdlibMap.ts.html +1 -1
- package/coverage/src/natural/transformTSCode.ts.html +1 -1
- package/coverage/src/sentry/index.html +1 -1
- package/coverage/src/sentry/index.ts.html +15 -15
- package/coverage/src/server/createUiTs.ts.html +1 -1
- package/coverage/src/server/entity2LogicNamespace.ts.html +9 -9
- package/coverage/src/server/event.js.html +1 -1
- package/coverage/src/server/extendBaseNode.ts.html +69 -42
- package/coverage/src/server/formatTsUtils.ts.html +23 -20
- package/coverage/src/server/getConnector.ts.html +1 -1
- package/coverage/src/server/getExtensionModules.ts.html +1 -1
- package/coverage/src/server/getFunctions.ts.html +4 -4
- package/coverage/src/server/getInterfaces.ts.html +1 -1
- package/coverage/src/server/getLogging.ts.html +2 -2
- package/coverage/src/server/getLogics.ts.html +20 -8
- package/coverage/src/server/getMemberIdentifier.ts.html +71 -8
- package/coverage/src/server/getProcessComponents.ts.html +3 -3
- package/coverage/src/server/getProcesses.ts.html +163 -13
- package/coverage/src/server/getValidates.ts.html +4 -4
- package/coverage/src/server/index.html +54 -54
- package/coverage/src/server/index.ts.html +6 -3
- package/coverage/src/server/naslServer.ts.html +49 -43
- package/coverage/src/server/naslStdlibMap.ts.html +1 -1
- package/coverage/src/server/process2LogicNamespace.ts.html +52 -52
- package/coverage/src/server/translator.ts.html +16 -7
- package/coverage/src/service/creator/add.configs.js.html +1 -1
- package/coverage/src/service/creator/errHandles.js.html +16 -7
- package/coverage/src/service/creator/index.html +4 -4
- package/coverage/src/service/creator/index.js.html +1 -1
- package/coverage/src/service/datasource/api.js.html +1 -1
- package/coverage/src/service/datasource/index.html +1 -1
- package/coverage/src/service/datasource/index.js.html +1 -1
- package/coverage/src/service/logic/api.js.html +1 -1
- package/coverage/src/service/logic/index.html +1 -1
- package/coverage/src/service/logic/index.js.html +1 -1
- package/coverage/src/service/storage/api.js.html +1 -1
- package/coverage/src/service/storage/index.html +10 -10
- package/coverage/src/service/storage/index.ts.html +1 -1
- package/coverage/src/service/storage/init.ts.html +8 -8
- package/coverage/src/service/storage/jsoner.ts.html +1 -1
- package/coverage/src/service/storage/map.ts.html +3 -3
- package/coverage/src/service/storage/service.ts.html +1 -1
- package/coverage/src/service/storage/storagePoint.ts.html +1 -1
- package/coverage/src/templator/genCallComponentLogic.ts.html +1 -1
- package/coverage/src/templator/genCreateBlock.ts.html +11 -23
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +19 -37
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +18 -27
- package/coverage/src/templator/genEditTableBlock.ts.html +8 -14
- package/coverage/src/templator/genEnumSelectBlock.ts.html +1 -1
- package/coverage/src/templator/genGetBlock.ts.html +1 -1
- package/coverage/src/templator/genGridViewBlock.ts.html +1 -1
- package/coverage/src/templator/genListViewBlock.ts.html +1 -1
- package/coverage/src/templator/genQueryComponent.ts.html +1 -1
- package/coverage/src/templator/genSelectBlock.ts.html +1 -1
- package/coverage/src/templator/genTableBlock.ts.html +1 -1
- package/coverage/src/templator/genUpdateBlock.ts.html +19 -28
- package/coverage/src/templator/index.html +31 -31
- package/coverage/src/templator/index.ts.html +1 -1
- package/coverage/src/templator/utils.ts.html +21 -24
- package/coverage/src/translator/constant.ts.html +1 -1
- package/coverage/src/translator/index.html +1 -1
- package/coverage/src/translator/index.ts.html +1 -1
- package/coverage/src/translator/utils.ts.html +38 -38
- package/coverage/src/utils/cookie.ts.html +1 -1
- package/coverage/src/utils/env.ts.html +1 -1
- package/coverage/src/{automate/engine/viewCache.js.html → utils/i18nInfo.ts.html} +45 -93
- package/coverage/src/utils/index.html +5 -5
- package/coverage/src/utils/index.ts.html +13 -13
- package/coverage/src/utils/logger.ts.html +13 -13
- package/coverage/src/utils/sortTsString.ts.html +1 -1
- package/coverage/src/utils/string.ts.html +1 -1
- package/coverage/src/utils/time-slicing/constant.ts.html +1 -1
- package/coverage/src/utils/time-slicing/controller.ts.html +70 -37
- package/coverage/src/utils/time-slicing/index.html +24 -24
- package/coverage/src/utils/time-slicing/index.ts.html +1 -1
- package/coverage/src/utils/time-slicing/page-state.ts.html +1 -1
- package/coverage/src/utils/time-slicing/performance.ts.html +1 -1
- package/coverage/src/utils/time-slicing/runner.ts.html +33 -39
- package/coverage/src/utils/time-slicing/tool.ts.html +2 -2
- package/coverage/src/utils/time-slicing/utils.ts.html +2 -2
- package/coverage/src/utils/time-slicing/wrapper.ts.html +8 -8
- package/coverage/src/utils/time-slicing.ts.html +1 -1
- package/coverage/src/utils/traverse.ts.html +1 -1
- package/coverage/src/utils/window.ts.html +1 -1
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.d.ts +3 -0
- package/out/breakpoint/generator/BreakpointNode.js +9 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/generator/CallbackNode.js +15 -0
- package/out/breakpoint/generator/CallbackNode.js.map +1 -1
- package/out/common/BaseNode.d.ts +1 -1
- package/out/common/BaseNode.js +1 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.js +1 -1
- package/out/common/Command.js.map +1 -1
- package/out/concepts/BackendVariable__.js +10 -3
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/CallFunction__.js +10 -2
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.js +71 -40
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CountersignPolicy__.d.ts +26 -0
- package/out/concepts/CountersignPolicy__.js +73 -0
- package/out/concepts/CountersignPolicy__.js.map +1 -0
- package/out/concepts/ForEachStatement__.js +12 -26
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/LogicItem__.js +2 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +2 -0
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Match__.js +9 -4
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -0
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MultiApprovalPolicy__.d.ts +24 -0
- package/out/concepts/MultiApprovalPolicy__.js +65 -0
- package/out/concepts/MultiApprovalPolicy__.js.map +1 -0
- package/out/concepts/NewComposite__.js +18 -10
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/Param__.js +10 -3
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +16 -0
- package/out/concepts/ProcessElement__.js +56 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Process__.d.ts +2 -0
- package/out/concepts/Process__.js +2 -0
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/Return__.js +10 -3
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/SequentialPolicy__.d.ts +18 -0
- package/out/concepts/SequentialPolicy__.js +54 -0
- package/out/concepts/SequentialPolicy__.js.map +1 -0
- package/out/concepts/StringInterpolation__.js +2 -0
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/Variable__.js +10 -3
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.js +8 -0
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +2 -2
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.js +1 -1
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/index__.d.ts +3 -0
- package/out/concepts/index__.js +3 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/types__.d.ts +4 -1
- package/out/generator/genReleaseBody.js +2 -2
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/server/extendBaseNode.js +33 -23
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +1 -2
- package/out/server/formatTsUtils.js +13 -12
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.d.ts +1 -0
- package/out/server/getLogics.js +6 -2
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +21 -0
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.js +56 -6
- 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 +2 -2
- package/out/server/naslServer.js +29 -32
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +3 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/errHandles.js +6 -3
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/storage/init.js +2 -2
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +3 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +3 -3
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/utils/time-slicing/controller.d.ts +1 -1
- package/out/utils/time-slicing/controller.js +31 -19
- package/out/utils/time-slicing/controller.js.map +1 -1
- package/out/utils/time-slicing/runner.d.ts +1 -1
- package/out/utils/time-slicing/runner.js +4 -5
- package/out/utils/time-slicing/runner.js.map +1 -1
- package/out/utils/time-slicing/tool.d.ts +1 -1
- package/package.json +2 -2
- package/sandbox/stdlib/nasl.util.ts +2 -2
- package/src/bak/translator.js +0 -1
- package/src/breakpoint/generator/BreakpointNode.ts +12 -0
- package/src/breakpoint/generator/CallbackNode.ts +17 -0
- package/src/common/BaseNode.ts +1 -1
- package/src/common/Command.ts +1 -1
- package/src/concepts/BackendVariable__.ts +10 -3
- package/src/concepts/CallFunction__.ts +10 -2
- package/src/concepts/CallLogic__.ts +90 -46
- package/src/concepts/CountersignPolicy__.ts +77 -0
- package/src/concepts/ForEachStatement__.ts +17 -26
- package/src/concepts/LogicItem__.ts +2 -2
- package/src/concepts/Logic__.ts +1 -0
- package/src/concepts/Match__.ts +9 -4
- package/src/concepts/MemberExpression__.ts +1 -0
- package/src/concepts/MultiApprovalPolicy__.ts +69 -0
- package/src/concepts/NewComposite__.ts +18 -9
- package/src/concepts/Param__.ts +12 -3
- package/src/concepts/ProcessElement__.ts +70 -1
- package/src/concepts/Process__.ts +2 -0
- package/src/concepts/Return__.ts +10 -3
- package/src/concepts/SequentialPolicy__.ts +58 -0
- package/src/concepts/StringInterpolation__.ts +2 -0
- package/src/concepts/Variable__.ts +10 -3
- package/src/concepts/ViewElement__.ts +7 -0
- package/src/concepts/View__.ts +5 -5
- package/src/concepts/basics/stdlib/nasl.process.ts +1 -1
- package/src/concepts/index__.ts +3 -0
- package/src/concepts/types__.ts +6 -0
- package/src/generator/genReleaseBody.ts +40 -40
- package/src/server/extendBaseNode.ts +32 -23
- package/src/server/formatTsUtils.ts +13 -12
- package/src/server/getLogics.ts +4 -0
- package/src/server/getMemberIdentifier.ts +21 -0
- package/src/server/getProcesses.ts +56 -6
- package/src/server/index.ts +2 -1
- package/src/server/naslServer.ts +35 -33
- package/src/server/translator.ts +3 -0
- package/src/service/creator/errHandles.js +7 -4
- package/src/service/storage/init.ts +2 -2
- package/src/templator/genCurdEditMultipleKeyBlock.ts +3 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +3 -3
- package/src/utils/time-slicing/controller.ts +34 -23
- package/src/utils/time-slicing/runner.ts +7 -9
- package/src/utils/time-slicing/tool.ts +1 -1
- package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +24 -0
- package/test/concepts/call-logic/__snapshots__/toEmbeddedTS.spec.ts.snap +15 -0
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +15 -0
- package/test/concepts/call-logic/__snapshots__/toUI.spec.ts.snap +7 -0
- package/test/concepts/call-logic/__snapshots__/toVue.spec.ts.snap +101 -0
- package/test/concepts/call-logic/__snapshots__/toVueDesigner.spec.ts.snap +7 -0
- package/test/concepts/call-logic/fixtures/json-deserialize.json +173 -0
- package/test/concepts/call-logic/fixtures/json-serialize-with-string.json +177 -0
- package/test/concepts/call-logic/fixtures/json-serialize.json +178 -0
- package/test/concepts/call-logic/toUI.spec.ts +16 -0
- package/test/concepts/call-logic/toVue.spec.ts +14 -0
- package/test/concepts/call-logic/toVueDesigner.spec.ts +16 -0
- package/test/time-slicing/runner.spec.ts +4 -0
- package/.nyc_output/processinfo/78804420-ead6-486f-b682-ab54ccd95dc9.json +0 -1
- package/coverage/cobertura-coverage.xml +0 -71878
- package/coverage/src/automate/engine/index.js.html +0 -1471
- package/coverage/src/automate/engine/uniqueName.js.html +0 -412
- package/coverage/src/automate/template/myProcess.js.html +0 -34645
- package/coverage/src/concepts/DataElement__.ts.html +0 -118
- package/coverage/src/utils/time.ts.html +0 -118
|
@@ -81,21 +81,21 @@ async function mergeBodyData(app: App, opt: ReleaseData) {
|
|
|
81
81
|
|
|
82
82
|
async function getCalllogicData(app: App, releaseData: ReleaseData) {
|
|
83
83
|
function getValidationMap(serverData: InputServerValidationData) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
const map = new Map<string, ServerValidationData>();
|
|
85
|
+
Object.values(serverData).forEach((logic) => {
|
|
86
|
+
logic.forEach((item) => {
|
|
87
|
+
map.set(item.uuid, item);
|
|
88
|
+
});
|
|
89
89
|
});
|
|
90
90
|
return map;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
function clearValidationMap(serverData: InputServerValidationData) {
|
|
94
94
|
Object.values(serverData).forEach((logic) => {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
logic.forEach((item) => {
|
|
96
|
+
item.rules = [];
|
|
97
|
+
item.failureRules = [];
|
|
98
|
+
});
|
|
99
99
|
});
|
|
100
100
|
return serverData;
|
|
101
101
|
}
|
|
@@ -109,14 +109,14 @@ async function getCalllogicData(app: App, releaseData: ReleaseData) {
|
|
|
109
109
|
|
|
110
110
|
nasl.traverseStrictChildren((node) => {
|
|
111
111
|
if (
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
'uuid' in node &&
|
|
113
|
+
node.concept === 'CallLogic' &&
|
|
114
|
+
node.validation &&
|
|
115
|
+
map.has(node.uuid)
|
|
116
116
|
) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
const data = map.get(node.uuid)!;
|
|
118
|
+
const naslRules = node.validation.rules.map((rule) => rule.toJSON());
|
|
119
|
+
data.rules = [...naslRules, ...data.rules];
|
|
120
120
|
}
|
|
121
121
|
});
|
|
122
122
|
|
|
@@ -136,24 +136,24 @@ async function getCalllogicData(app: App, releaseData: ReleaseData) {
|
|
|
136
136
|
|
|
137
137
|
const passwordCallLogicUuid = new Set<string>();
|
|
138
138
|
const removeRuleNames = [
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
139
|
+
"rangeLength",
|
|
140
|
+
"pattern",
|
|
141
|
+
"^az",
|
|
142
|
+
"^az09",
|
|
143
|
+
"^az09_",
|
|
144
|
+
"^azAZ",
|
|
145
|
+
"^azAZ09",
|
|
146
|
+
"^azAZ09_",
|
|
147
|
+
"az09$",
|
|
148
|
+
"azAZ09$",
|
|
149
|
+
"^09$",
|
|
150
|
+
"^az09$",
|
|
151
|
+
"^az09-$",
|
|
152
|
+
"^az09-.$",
|
|
153
|
+
"^azAZ09$",
|
|
154
|
+
"^azAZ09-$",
|
|
155
|
+
"^azAZ09_$",
|
|
156
|
+
"^azAZ09-_$",
|
|
157
157
|
];
|
|
158
158
|
|
|
159
159
|
// 获取所有调用加密函数的调用节点 uuid
|
|
@@ -205,18 +205,18 @@ async function getCalllogicData(app: App, releaseData: ReleaseData) {
|
|
|
205
205
|
validations = {},
|
|
206
206
|
} = releaseData;
|
|
207
207
|
const {
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
preferenceMap: {
|
|
209
|
+
serverValidationRules,
|
|
210
|
+
},
|
|
211
211
|
} = app;
|
|
212
212
|
const serverValidationRulesBySwitch =
|
|
213
213
|
serverValidationRules === 'custom'
|
|
214
214
|
? // 自定义
|
|
215
|
-
|
|
215
|
+
mergeValidation(validations, app)
|
|
216
216
|
: serverValidationRules === 'auto'
|
|
217
|
-
|
|
217
|
+
? // 自动
|
|
218
218
|
validations
|
|
219
|
-
|
|
219
|
+
: // 关闭
|
|
220
220
|
clearValidationMap(validations);
|
|
221
221
|
|
|
222
222
|
return removePasswordValidation(serverValidationRulesBySwitch, app);
|
|
@@ -131,9 +131,28 @@ BaseNode.prototype.changeName = async function changeName(newValue: string, upda
|
|
|
131
131
|
if (res.length <= 1) {
|
|
132
132
|
if (this.concept === 'enumItem') {
|
|
133
133
|
(this as any).setValue(newValue);
|
|
134
|
+
} else if (this.concept === 'Process' || (this.concept === 'ProcessElement' && ['InitiateTask', 'ApprovalTask', 'MultiApprovalTask', 'UserTask'].includes((this as any).type))) {
|
|
135
|
+
const confirmParms: any = {
|
|
136
|
+
actionType: 'rename',
|
|
137
|
+
node: this,
|
|
138
|
+
newValue,
|
|
139
|
+
unReference: true,
|
|
140
|
+
icon: 'warning',
|
|
141
|
+
};
|
|
142
|
+
if (this.concept === 'Process') {
|
|
143
|
+
confirmParms.title = '重命名流程名称';
|
|
144
|
+
confirmParms.process = true;
|
|
145
|
+
} else if (this.concept === 'ProcessElement') {
|
|
146
|
+
confirmParms.title = '修改节点名称'
|
|
147
|
+
confirmParms.process = true;
|
|
148
|
+
}
|
|
149
|
+
const callback = () => {
|
|
150
|
+
(this as SetNameNode).setName(newValue);
|
|
151
|
+
}
|
|
152
|
+
invokeCommand('tsConfirm.open', confirmParms, callback)
|
|
134
153
|
} else (this as SetNameNode).setName(newValue);
|
|
135
154
|
} else {
|
|
136
|
-
const callback = (value: boolean) => {
|
|
155
|
+
const callback = (value: boolean, toast?: Function) => {
|
|
137
156
|
if (value) {
|
|
138
157
|
const App = this.rootNode;
|
|
139
158
|
// 收集修改
|
|
@@ -169,36 +188,26 @@ BaseNode.prototype.changeName = async function changeName(newValue: string, upda
|
|
|
169
188
|
});
|
|
170
189
|
// 结束修改 ,批量操作
|
|
171
190
|
App.emit('collect:end');
|
|
191
|
+
toast && toast();
|
|
172
192
|
} else {
|
|
173
193
|
(this as SetNameNode).setName(newValue);
|
|
174
194
|
}
|
|
175
195
|
};
|
|
176
|
-
const confirmParms = {
|
|
196
|
+
const confirmParms: any = {
|
|
177
197
|
actionType: 'rename',
|
|
178
198
|
node: this,
|
|
179
199
|
newValue,
|
|
200
|
+
icon: 'warning',
|
|
180
201
|
};
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
setTimeout(() => {
|
|
191
|
-
(this as EnumItem).value = oldValue;
|
|
192
|
-
}, 0);
|
|
193
|
-
} else {
|
|
194
|
-
const oldValue = this.name;
|
|
195
|
-
this.name = oldValue + ' ';
|
|
196
|
-
setTimeout(() => {
|
|
197
|
-
this.name = oldValue;
|
|
198
|
-
}, 0);
|
|
199
|
-
}
|
|
200
|
-
};
|
|
201
|
-
updateAll ? callback(true) : invokeCommand('tsConfirm.open', confirmParms, callback, closeCallBack);
|
|
202
|
+
if (this.concept === 'Process') {
|
|
203
|
+
confirmParms.title = '重命名流程名称';
|
|
204
|
+
confirmParms.process = true;
|
|
205
|
+
} else if (this.concept === 'ProcessElement' && ['InitiateTask', 'ApprovalTask', 'MultiApprovalTask', 'UserTask'].includes((this as any).type)) {
|
|
206
|
+
confirmParms.title = '修改节点名称'
|
|
207
|
+
confirmParms.process = true;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
updateAll ? callback(true) : invokeCommand('tsConfirm.open', confirmParms, callback);
|
|
202
211
|
|
|
203
212
|
return;
|
|
204
213
|
}
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
AuthLogicForCallInterface,
|
|
22
22
|
} from '..';
|
|
23
23
|
import { getNaslNodeByNodeCallee } from '../automate/engine/utils';
|
|
24
|
+
import { runGeneratorSync as runSync } from '../utils';
|
|
24
25
|
|
|
25
26
|
interface variableItem {
|
|
26
27
|
text: string;
|
|
@@ -59,9 +60,8 @@ function isValidName(str: string) {
|
|
|
59
60
|
* 解析 Completion 和 QuickInfo 的 displayString
|
|
60
61
|
* 生成 TypeAnnotation
|
|
61
62
|
* @param displayString
|
|
62
|
-
* @returns TypeAnnotation
|
|
63
63
|
*/
|
|
64
|
-
export function type2TypeAnnotation(oldType: Array<any> | {}): TypeAnnotation {
|
|
64
|
+
export function* type2TypeAnnotation(oldType: Array<any> | {}): Generator<any, TypeAnnotation, any> {
|
|
65
65
|
if (!oldType) return null;
|
|
66
66
|
let type = oldType;
|
|
67
67
|
if (Array.isArray(oldType)) {
|
|
@@ -74,14 +74,14 @@ export function type2TypeAnnotation(oldType: Array<any> | {}): TypeAnnotation {
|
|
|
74
74
|
// 自定义类型
|
|
75
75
|
const newProperties: StructureProperty[] = [];
|
|
76
76
|
if (Array.isArray(properties) && properties.length) {
|
|
77
|
-
|
|
77
|
+
for (const item of properties) {
|
|
78
78
|
if (!item?.name?.startsWith('__')) {
|
|
79
79
|
// 如果没有获取到类型,就默认塞一个string
|
|
80
|
-
const itemType = type2TypeAnnotation(item.typeInfo) || TypeAnnotation.createPrimitive('String');
|
|
80
|
+
const itemType = (yield* type2TypeAnnotation(item.typeInfo)) || TypeAnnotation.createPrimitive('String');
|
|
81
81
|
const structureProperty = StructureProperty.from({ name: item.name, typeAnnotation: itemType }, typeAnnotation, 'properties');
|
|
82
82
|
newProperties.push(structureProperty);
|
|
83
83
|
}
|
|
84
|
-
}
|
|
84
|
+
}
|
|
85
85
|
}
|
|
86
86
|
typeAnnotation = TypeAnnotation.createTypeAnonymousStructure(newProperties);
|
|
87
87
|
} else if (!typeName || typeName === 'Promise' || typeName === 'nasl' || typeName === '___IDENTIFIER__') {
|
|
@@ -91,12 +91,12 @@ export function type2TypeAnnotation(oldType: Array<any> | {}): TypeAnnotation {
|
|
|
91
91
|
} else if (typeName === 'Union') {
|
|
92
92
|
typeAnnotation = TypeAnnotation.createPrimitive('Union');
|
|
93
93
|
typeAnnotation.typeArguments = [];
|
|
94
|
-
|
|
95
|
-
const typeItem = type2TypeAnnotation(item);
|
|
94
|
+
for (const item of typeArguments) {
|
|
95
|
+
const typeItem = yield* type2TypeAnnotation(item);
|
|
96
96
|
if (typeItem) {
|
|
97
97
|
typeAnnotation.typeArgumentsPush(typeItem);
|
|
98
98
|
}
|
|
99
|
-
}
|
|
99
|
+
}
|
|
100
100
|
} else if (typeNamespace && typeNamespace.startsWith('nasl.core')) {
|
|
101
101
|
typeAnnotation = TypeAnnotation.createPrimitive(typeName);
|
|
102
102
|
} else if (typeNamespace && typeArguments?.length) {
|
|
@@ -106,12 +106,12 @@ export function type2TypeAnnotation(oldType: Array<any> | {}): TypeAnnotation {
|
|
|
106
106
|
});
|
|
107
107
|
// 如果有泛型处理泛型
|
|
108
108
|
typeAnnotation.typeArguments = [];
|
|
109
|
-
|
|
110
|
-
const typeItem = type2TypeAnnotation(item);
|
|
109
|
+
for (const item of typeArguments) {
|
|
110
|
+
const typeItem = yield* type2TypeAnnotation(item);
|
|
111
111
|
if (typeItem) {
|
|
112
112
|
typeAnnotation.typeArgumentsPush(typeItem);
|
|
113
113
|
}
|
|
114
|
-
}
|
|
114
|
+
}
|
|
115
115
|
} else {
|
|
116
116
|
// 其余的引用类型
|
|
117
117
|
typeAnnotation = TypeAnnotation.createReference(typeName, {
|
|
@@ -121,6 +121,7 @@ export function type2TypeAnnotation(oldType: Array<any> | {}): TypeAnnotation {
|
|
|
121
121
|
} catch (err) {
|
|
122
122
|
console.log(err, type);
|
|
123
123
|
}
|
|
124
|
+
yield;
|
|
124
125
|
return typeAnnotation;
|
|
125
126
|
}
|
|
126
127
|
|
|
@@ -498,7 +499,7 @@ function getNodeTypeVariableData(nodeType: any, item: any, node: SyntaxNode) {
|
|
|
498
499
|
const parentExpression = new Identifier({ name: item.text });
|
|
499
500
|
item.expression = parentExpression;
|
|
500
501
|
if (nodeType) {
|
|
501
|
-
const typeAnnotation = type2TypeAnnotation(nodeType);
|
|
502
|
+
const typeAnnotation = runSync(type2TypeAnnotation(nodeType));
|
|
502
503
|
const typeKeyMap = new Map();
|
|
503
504
|
const app = node.rootNode as App;
|
|
504
505
|
let structure: any = {};
|
package/src/server/getLogics.ts
CHANGED
|
@@ -101,6 +101,10 @@ function getViewElementPath(node: BaseNode, parentNodeNames: Array<string>) {
|
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
export async function getLogics(node: CallLogic | BindEvent | Identifier | Logic, needAllLogic: boolean = true) {
|
|
104
|
+
return getLogicsSync(node, needAllLogic)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic, needAllLogic: boolean = true) {
|
|
104
108
|
const app = node?.rootNode as App;
|
|
105
109
|
if (node?.concept === 'CallLogic' || node?.concept === 'BindEvent' || node?.concept === 'Logic') {
|
|
106
110
|
const result = [];
|
|
@@ -375,6 +375,20 @@ function flatElements(elements: ViewElement[], componentList: CompletionProperty
|
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
})
|
|
378
|
+
const decoTagAtrrs = (attrName: any) => {
|
|
379
|
+
const filterAttr: any = {
|
|
380
|
+
name: attrName,
|
|
381
|
+
value: `${item.name}.${attrName}`,
|
|
382
|
+
expression: new MemberExpression({
|
|
383
|
+
object: stashItem.expression,
|
|
384
|
+
property: new Identifier({
|
|
385
|
+
name: attrName,
|
|
386
|
+
namespace: attrName
|
|
387
|
+
}),
|
|
388
|
+
}),
|
|
389
|
+
};
|
|
390
|
+
return filterAttr;
|
|
391
|
+
}
|
|
378
392
|
attrsList.forEach((attr) => {
|
|
379
393
|
const currentAttrInfo = PAGE_COMPONENT_INCLUDE_TAG_MAP[item.tag]?.[attr.name]
|
|
380
394
|
if (attr.name !== 'sorting') {
|
|
@@ -396,6 +410,13 @@ function flatElements(elements: ViewElement[], componentList: CompletionProperty
|
|
|
396
410
|
stashItem.children.push(completionProperty)
|
|
397
411
|
}
|
|
398
412
|
})
|
|
413
|
+
if (['u-list-view', 'van-grid-view', 'van-list-view', 'u-cascader', 'van-cascader'].includes(item.tag)) {
|
|
414
|
+
const filterAttr = decoTagAtrrs('filterText');
|
|
415
|
+
const filterTextCompletionProperty = new CompletionProperty(filterAttr);
|
|
416
|
+
filterTextCompletionProperty.name = 'filterText(过滤文本)';
|
|
417
|
+
filterTextCompletionProperty.icon = 'attr'
|
|
418
|
+
stashItem.children.push(filterTextCompletionProperty)
|
|
419
|
+
}
|
|
399
420
|
if (['u-select', 'van-pickerson'].includes(item.tag)) {
|
|
400
421
|
const pageAttr: any = {
|
|
401
422
|
name: 'page-number',
|
|
@@ -80,7 +80,8 @@ export function constantToParam(v: Constant) {
|
|
|
80
80
|
export function genUserTaskLogic(userTask: ProcessElement) {
|
|
81
81
|
const taskId = userTask.constants.find((p) => p.name === 'taskId');
|
|
82
82
|
const { process } = userTask;
|
|
83
|
-
|
|
83
|
+
let logics = [];
|
|
84
|
+
const usertaskLogics = [
|
|
84
85
|
new Logic({
|
|
85
86
|
name: `complete`,
|
|
86
87
|
fake: true,
|
|
@@ -106,15 +107,63 @@ export function genUserTaskLogic(userTask: ProcessElement) {
|
|
|
106
107
|
returns: [],
|
|
107
108
|
}),
|
|
108
109
|
];
|
|
109
|
-
|
|
110
|
+
const multiTaskLogics = [
|
|
111
|
+
new Logic({
|
|
112
|
+
name: `reject`,
|
|
113
|
+
fake: true,
|
|
114
|
+
params: [
|
|
115
|
+
new Param({
|
|
116
|
+
name: 'taskId',
|
|
117
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
118
|
+
}),
|
|
119
|
+
new Param({
|
|
120
|
+
name: 'targetTaskDefinitionId',
|
|
121
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
122
|
+
}),
|
|
123
|
+
],
|
|
124
|
+
body: [],
|
|
125
|
+
returns: [
|
|
126
|
+
new Return({
|
|
127
|
+
name: 'result',
|
|
128
|
+
typeAnnotation: TypeAnnotation.createReference('LCAPOperateProcessResult', {
|
|
129
|
+
typeNamespace: 'nasl.process',
|
|
130
|
+
}),
|
|
131
|
+
}),
|
|
132
|
+
],
|
|
133
|
+
}),
|
|
134
|
+
new Logic({
|
|
135
|
+
name: `pass`,
|
|
136
|
+
fake: true,
|
|
137
|
+
params: [
|
|
138
|
+
new Param({
|
|
139
|
+
name: 'taskId',
|
|
140
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
141
|
+
}),
|
|
142
|
+
],
|
|
143
|
+
returns: [],
|
|
144
|
+
}),
|
|
145
|
+
new Logic({
|
|
146
|
+
name: `fail`,
|
|
147
|
+
fake: true,
|
|
148
|
+
params: [
|
|
149
|
+
new Param({
|
|
150
|
+
name: 'taskId',
|
|
151
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
152
|
+
}),
|
|
153
|
+
],
|
|
154
|
+
returns: [],
|
|
155
|
+
}),
|
|
156
|
+
]
|
|
157
|
+
logics = userTask.type === 'MultiApprovalTask' ? multiTaskLogics : usertaskLogics;
|
|
158
|
+
if (userTask.type === 'InitiateTask') logics.pop();
|
|
110
159
|
const path = `app.processes.${process.name}.elements.${userTask.name}.logics`;
|
|
111
|
-
|
|
160
|
+
logics.forEach((item) => {
|
|
112
161
|
item.getNamespace = function () {
|
|
113
162
|
return path;
|
|
114
163
|
};
|
|
115
164
|
item.fake = true;
|
|
116
165
|
});
|
|
117
|
-
return
|
|
166
|
+
return logics;
|
|
118
167
|
}
|
|
119
168
|
|
|
120
169
|
export function userTask2LogicNamespace(userTask: ProcessElement) {
|
|
@@ -361,12 +410,13 @@ export function getProcessVariableSuggestions(node: LogicItem, abandonConstant:
|
|
|
361
410
|
|
|
362
411
|
const elements: ProcessElement[] = getPreviousTask(processElem, process);
|
|
363
412
|
const prevtasks = elements.map((us) => {
|
|
413
|
+
const constant = us.type === 'MultiApprovalTask' ? [] : us.constants.map(genCompletionProperty([process.name, us.name]));
|
|
364
414
|
const cp = new CompletionProperty({
|
|
365
415
|
name: us.name,
|
|
366
416
|
value: us.name,
|
|
367
417
|
children: [
|
|
368
418
|
...us.returns.map(genCompletionProperty([process.name, us.name])),
|
|
369
|
-
...(abandonConstant ? [] :
|
|
419
|
+
...(abandonConstant ? [] : constant),
|
|
370
420
|
],
|
|
371
421
|
});
|
|
372
422
|
cp.icon = us.type;
|
|
@@ -400,7 +450,7 @@ export function getProcessVariableSuggestions(node: LogicItem, abandonConstant:
|
|
|
400
450
|
if (processElem.isUserTask) {
|
|
401
451
|
// 任务完成时可以拿到该任务的输出参数
|
|
402
452
|
let returns: CompletionProperty[] = [];
|
|
403
|
-
if (node.logic && node.logic.parentNode.name === 'OnClose') {
|
|
453
|
+
if (node.logic && node.logic.parentNode.name === 'OnClose' && processElem.type !== 'MultiApprovalTask') {
|
|
404
454
|
returns = processElem.returns.map(genCompletionProperty([process.name, processElem.name]));
|
|
405
455
|
}
|
|
406
456
|
const scopeVariable = new CompletionProperty({
|
package/src/server/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getLogics, iteratorTree } from './getLogics';
|
|
1
|
+
import { getLogics, iteratorTree, getLogicsSync } from './getLogics';
|
|
2
2
|
import { getConnectorTree, publishConnector } from './getConnector';
|
|
3
3
|
import { getInterfaces } from './getInterfaces';
|
|
4
4
|
import { getFunctions, getBuildInFunction } from './getFunctions';
|
|
@@ -21,6 +21,7 @@ import { getAllComponentEventMap } from './createUiTs';
|
|
|
21
21
|
import { displayString2TypeAnnotation } from './formatTsUtils';
|
|
22
22
|
|
|
23
23
|
const server: any = {
|
|
24
|
+
getLogicsSync,
|
|
24
25
|
getLogics,
|
|
25
26
|
iteratorTree,
|
|
26
27
|
getInterfaces,
|
package/src/server/naslServer.ts
CHANGED
|
@@ -514,8 +514,8 @@ class NaslServer {
|
|
|
514
514
|
await this.writeFiles(files);
|
|
515
515
|
this._debugInFileStorage(app, files);
|
|
516
516
|
// 修改名称回调
|
|
517
|
-
registerCommand('tsRename.change', (value: boolean, callback: Function) => {
|
|
518
|
-
callback(value);
|
|
517
|
+
registerCommand('tsRename.change', (value: boolean, callback: Function, toast?: Function) => {
|
|
518
|
+
callback(value, toast);
|
|
519
519
|
});
|
|
520
520
|
// 删除回调
|
|
521
521
|
registerCommand('tsDelete.change', (callback: Function) => {
|
|
@@ -1704,8 +1704,8 @@ class NaslServer {
|
|
|
1704
1704
|
const fileSourceCode = self.getNodeCode(fileNode, value);
|
|
1705
1705
|
if (fileSourceCode.includes('|') && fileSourceCode.includes('.metadataTypes.')) {
|
|
1706
1706
|
const typeAnnotation = node.typeAnnotation.toJSON()
|
|
1707
|
-
self._treeMetadataType2CoreType(typeAnnotation, (node.rootNode as App))
|
|
1708
|
-
const isDuplicate = self._isDuplicateCoreType(typeAnnotation)
|
|
1707
|
+
yield* self._treeMetadataType2CoreType(typeAnnotation, (node.rootNode as App))
|
|
1708
|
+
const isDuplicate = yield* self._isDuplicateCoreType(typeAnnotation)
|
|
1709
1709
|
if (isDuplicate) {
|
|
1710
1710
|
const diagnostic = {
|
|
1711
1711
|
node: node,
|
|
@@ -2083,10 +2083,10 @@ class NaslServer {
|
|
|
2083
2083
|
diagnostics.push(diagnostic);
|
|
2084
2084
|
}
|
|
2085
2085
|
|
|
2086
|
-
yield* utils.wrapIteratorToGenerator(fileNode.sourceMap.entries(), ([node, value])
|
|
2086
|
+
yield* utils.wrapIteratorToGenerator(fileNode.sourceMap.entries(), function* wrapIterator([node, value]) {
|
|
2087
2087
|
if (node instanceof OqlQueryComponent) {
|
|
2088
2088
|
// 自动推导情况
|
|
2089
|
-
const typeAnnotation = type2TypeAnnotation((node as any).__nodeType);
|
|
2089
|
+
const typeAnnotation = yield* type2TypeAnnotation((node as any).__nodeType);
|
|
2090
2090
|
if (!node.typeAnnotation && typeAnnotation) {
|
|
2091
2091
|
if (typeAnnotation.typeName === 'List' && typeAnnotation.typeKind === 'generic') {
|
|
2092
2092
|
const {typeArguments} = typeAnnotation;
|
|
@@ -2139,11 +2139,11 @@ class NaslServer {
|
|
|
2139
2139
|
} else {
|
|
2140
2140
|
delete node.tsErrorDetail;
|
|
2141
2141
|
}
|
|
2142
|
-
const fileSourceCode =
|
|
2142
|
+
const fileSourceCode = self.getNodeCode(fileNode, value);
|
|
2143
2143
|
if (fileSourceCode.includes('|') && fileSourceCode.includes('.metadataTypes.')) {
|
|
2144
2144
|
const typeAnnotation = node.typeAnnotation.toJSON()
|
|
2145
|
-
|
|
2146
|
-
const isDuplicate =
|
|
2145
|
+
yield* self._treeMetadataType2CoreType(typeAnnotation, (node.rootNode as App))
|
|
2146
|
+
const isDuplicate = yield* self._isDuplicateCoreType(typeAnnotation)
|
|
2147
2147
|
if (isDuplicate) {
|
|
2148
2148
|
const diagnostic = {
|
|
2149
2149
|
node: node,
|
|
@@ -2155,11 +2155,11 @@ class NaslServer {
|
|
|
2155
2155
|
}
|
|
2156
2156
|
}
|
|
2157
2157
|
else if (node instanceof Param) {
|
|
2158
|
-
const fileSourceCode =
|
|
2158
|
+
const fileSourceCode = self.getNodeCode(fileNode, value);
|
|
2159
2159
|
if (fileSourceCode.includes('|') && fileSourceCode.includes('.metadataTypes.')) {
|
|
2160
2160
|
const typeAnnotation = node.typeAnnotation.toJSON()
|
|
2161
|
-
|
|
2162
|
-
const isDuplicate =
|
|
2161
|
+
yield* self._treeMetadataType2CoreType(typeAnnotation, (node.rootNode as App))
|
|
2162
|
+
const isDuplicate = yield* self._isDuplicateCoreType(typeAnnotation)
|
|
2163
2163
|
if (isDuplicate) {
|
|
2164
2164
|
const diagnostic = {
|
|
2165
2165
|
node: node,
|
|
@@ -2170,7 +2170,7 @@ class NaslServer {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
}
|
|
2172
2172
|
}
|
|
2173
|
-
|
|
2173
|
+
self.checkNodeError(node, diagnostics);
|
|
2174
2174
|
});
|
|
2175
2175
|
}
|
|
2176
2176
|
else if (fileNode instanceof Process) {
|
|
@@ -2225,8 +2225,10 @@ class NaslServer {
|
|
|
2225
2225
|
return diagnostics;
|
|
2226
2226
|
}
|
|
2227
2227
|
|
|
2228
|
-
_treeMetadataType2CoreType(type: TypeAnnotation, app: App) {
|
|
2229
|
-
|
|
2228
|
+
*_treeMetadataType2CoreType(type: TypeAnnotation, app: App): Generator<any, void, any> {
|
|
2229
|
+
const self = this;
|
|
2230
|
+
|
|
2231
|
+
yield* utils.wrapForEachToGenerator(type.typeArguments ?? [], function* wrapForEach(item) {
|
|
2230
2232
|
if (item.typeNamespace?.endsWith('.metadataTypes')) {
|
|
2231
2233
|
let originType = {} as TypeAnnotation
|
|
2232
2234
|
if (item.typeNamespace === 'app.metadataTypes') {
|
|
@@ -2239,29 +2241,29 @@ class NaslServer {
|
|
|
2239
2241
|
item.typeNamespace = 'nasl.core'
|
|
2240
2242
|
item.typeName = originType?.typeName
|
|
2241
2243
|
}
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
})
|
|
2244
|
+
|
|
2245
|
+
yield* utils.wrapForEachToGenerator(type.typeArguments ?? [], function* wrapForEach2(ele) {
|
|
2246
|
+
yield* self._treeMetadataType2CoreType(ele, app)
|
|
2247
|
+
});
|
|
2248
|
+
});
|
|
2248
2249
|
}
|
|
2249
2250
|
|
|
2250
|
-
_isDuplicateCoreType(type: TypeAnnotation) {
|
|
2251
|
+
*_isDuplicateCoreType(type: TypeAnnotation): Generator<any, boolean, any> {
|
|
2251
2252
|
const argsStringList = type.typeArguments?.map((item) => JSON.stringify(item)) || []
|
|
2252
2253
|
const setList = Array.from(new Set(argsStringList))
|
|
2253
2254
|
if (argsStringList.length > setList.length) {
|
|
2254
2255
|
return true
|
|
2255
2256
|
}
|
|
2257
|
+
|
|
2256
2258
|
let flag = false
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
})
|
|
2259
|
+
|
|
2260
|
+
for (const ele of type.typeArguments ?? []) {
|
|
2261
|
+
const subFlag = yield* this._isDuplicateCoreType(ele)
|
|
2262
|
+
if (subFlag) {
|
|
2263
|
+
flag = true
|
|
2264
|
+
}
|
|
2264
2265
|
}
|
|
2266
|
+
|
|
2265
2267
|
return flag
|
|
2266
2268
|
}
|
|
2267
2269
|
checkNodeError(node: BaseNode, diagnostics: Diagnostic[]): any {
|
|
@@ -4063,7 +4065,7 @@ class NaslServer {
|
|
|
4063
4065
|
} else if (['NewComposite', 'NewList', 'NewMap'].includes(node.concept)) {
|
|
4064
4066
|
const code = getCode(item);
|
|
4065
4067
|
fileDetail.line = item.end.line;
|
|
4066
|
-
const indexOf = code.
|
|
4068
|
+
const indexOf = code.lastIndexOf('return __newComposite');
|
|
4067
4069
|
let newCode = code.substring(0, indexOf);
|
|
4068
4070
|
newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
|
|
4069
4071
|
fileDetail.offset = newCode.length + 'return '.length;
|
|
@@ -4073,10 +4075,10 @@ class NaslServer {
|
|
|
4073
4075
|
args.push(fileDetail);
|
|
4074
4076
|
});
|
|
4075
4077
|
const resultMap: any = (yield this.getNaslNodeTypeFull(args))?.response;
|
|
4076
|
-
yield* utils.wrapForEachToGenerator(args, ({ file, line, offset }, index)
|
|
4078
|
+
yield* utils.wrapForEachToGenerator(args, function* wrapForEach({ file, line, offset }, index) {
|
|
4077
4079
|
const item = (resultMap as any)?.[file]?.[line]?.[offset];
|
|
4078
4080
|
const itemType = item?.[0]?.nodeType;
|
|
4079
|
-
const nodeTypeAnnotation = type2TypeAnnotation(itemType);
|
|
4081
|
+
const nodeTypeAnnotation = yield* type2TypeAnnotation(itemType);
|
|
4080
4082
|
const {node} = newQuickInfoNodes[index];
|
|
4081
4083
|
|
|
4082
4084
|
types.set(node, Object.freeze(nodeTypeAnnotation) as TypeAnnotation);
|
|
@@ -4362,7 +4364,7 @@ class NaslServer {
|
|
|
4362
4364
|
if (nodeType && Array.isArray(nodeType.fnParams)) {
|
|
4363
4365
|
const index = node.parentNode.arguments.indexOf(node);
|
|
4364
4366
|
const type = nodeType.fnParams[index]?.typeInfo;
|
|
4365
|
-
const nodeTypeAnnotation = type2TypeAnnotation(type);
|
|
4367
|
+
const nodeTypeAnnotation = yield* type2TypeAnnotation(type);
|
|
4366
4368
|
if (nodeTypeAnnotation) {
|
|
4367
4369
|
return {
|
|
4368
4370
|
typeAnnotation: nodeTypeAnnotation,
|
package/src/server/translator.ts
CHANGED
|
@@ -32,10 +32,13 @@ export default {
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
// 检测到当前应用已在新 tab
|
|
36
|
-
if (err.code === 500502) {
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
// 检测到当前应用已在新 tab 页操作,或者版本升级,备份还原
|
|
36
|
+
if (err.code === 500502 || err.code === 500505) {
|
|
37
|
+
eventBus.emit('multiTabOpened', {
|
|
38
|
+
refreshBrowser: err.code === 500505,
|
|
39
|
+
message: err.msg,
|
|
40
|
+
});
|
|
41
|
+
return;
|
|
39
42
|
}
|
|
40
43
|
|
|
41
44
|
if (versionStatus[err.code])
|
|
@@ -88,7 +88,6 @@ async function deleteExpiredRecords() {
|
|
|
88
88
|
expiredRecordsRequest.onsuccess = (event: any) => {
|
|
89
89
|
const cursor = event.target.result;
|
|
90
90
|
if (cursor) {
|
|
91
|
-
console.log(cursor);
|
|
92
91
|
objectStore.delete(cursor.primaryKey);
|
|
93
92
|
cursor.continue();
|
|
94
93
|
} else {
|
|
@@ -751,9 +750,10 @@ class TaskQueue {
|
|
|
751
750
|
|
|
752
751
|
// code: 401650, 检测到当前应用拉取操作已被强制结束, 用户确认后再刷新
|
|
753
752
|
// code: 500502 msg: '该应用已在新tab 页打开,请刷新!' 不重试或刷新
|
|
753
|
+
// code: 500505 需要刷新浏览器
|
|
754
754
|
if (!error)
|
|
755
755
|
this.recover(app);
|
|
756
|
-
else if (![401650, 500502].includes(error.code)) {
|
|
756
|
+
else if (![401650, 500502, 500505].includes(error.code)) {
|
|
757
757
|
// 连接失败,或超时,或后端持久化异常
|
|
758
758
|
if ((error.message === 'Network Error' || error.message?.includes('timeout') || error.code === 500500)
|
|
759
759
|
&& this.status !== TaskQueueStatus.Retrying) {
|