@lcap/nasl 3.3.5-beta.1 → 3.3.6-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/{b920244d-8d01-4e76-be5a-95132217c5a1.json → d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json} +1 -1
- package/.nyc_output/processinfo/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/index.html +100 -100
- package/coverage/src/automate/engine/index.html +1 -1
- package/coverage/src/automate/engine/utils.js.html +36 -36
- package/coverage/src/bak/index.html +15 -15
- package/coverage/src/bak/translator.js.html +78 -87
- 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 +1 -1
- package/coverage/src/breakpoint/generator/CallbackNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/index.html +1 -1
- 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 +237 -444
- package/coverage/src/common/Command.ts.html +1 -1
- package/coverage/src/common/EventEmitter.ts.html +7 -10
- package/coverage/src/common/Messager.ts.html +1 -1
- package/coverage/src/common/asyncFuncMap.ts.html +1 -1
- package/coverage/src/common/index.html +19 -19
- package/coverage/src/common/index.ts.html +1 -1
- package/coverage/src/concepts/Abort__.ts.html +6 -9
- package/coverage/src/concepts/Anchor__.ts.html +22 -43
- package/coverage/src/concepts/AnonymousFunction__.ts.html +146 -209
- package/coverage/src/concepts/App__.ts.html +124 -523
- package/coverage/src/concepts/Argument__.ts.html +109 -52
- package/coverage/src/concepts/Assignee__.ts.html +18 -99
- package/coverage/src/concepts/AssignmentLine__.ts.html +14 -35
- package/coverage/src/concepts/Assignment__.ts.html +58 -109
- package/coverage/src/concepts/Attribute__.ts.html +15 -201
- package/coverage/src/concepts/AuthInterface__.ts.html +6 -9
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +11 -38
- package/coverage/src/concepts/AuthLogic__.ts.html +6 -18
- package/coverage/src/concepts/BackendVariable__.ts.html +81 -288
- package/coverage/src/concepts/Backend__.ts.html +16 -43
- package/coverage/src/concepts/BatchAssignment__.ts.html +154 -229
- package/coverage/src/concepts/BinaryExpression__.ts.html +125 -152
- package/coverage/src/concepts/BindAttribute__.ts.html +44 -140
- package/coverage/src/concepts/BindDirective__.ts.html +17 -98
- package/coverage/src/concepts/BindEvent__.ts.html +25 -106
- package/coverage/src/concepts/BindStyle__.ts.html +12 -45
- package/coverage/src/concepts/BooleanLiteral__.ts.html +17 -20
- package/coverage/src/concepts/CallAuthInterface__.ts.html +12 -39
- package/coverage/src/concepts/CallConnector__.ts.html +6 -9
- package/coverage/src/concepts/CallFunction__.ts.html +41 -83
- package/coverage/src/concepts/CallInterface__.ts.html +38 -95
- package/coverage/src/concepts/CallLogic__.ts.html +306 -192
- package/coverage/src/concepts/CallQueryComponent__.ts.html +23 -134
- package/coverage/src/concepts/Comment__.ts.html +8 -11
- package/coverage/src/concepts/CompletionProperty__.ts.html +11 -32
- package/coverage/src/concepts/ConfigGroup__.ts.html +16 -43
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +19 -22
- package/coverage/src/concepts/ConfigProperty__.ts.html +25 -52
- package/coverage/src/concepts/Configuration__.ts.html +17 -44
- package/coverage/src/concepts/Connection__.ts.html +12 -39
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +6 -9
- package/coverage/src/concepts/Connector__.ts.html +29 -164
- package/coverage/src/concepts/Constant__.ts.html +33 -243
- package/coverage/src/concepts/DataSource__.ts.html +53 -80
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +6 -9
- package/coverage/src/concepts/Destination__.ts.html +15 -45
- package/coverage/src/concepts/End__.ts.html +6 -9
- package/coverage/src/concepts/EntityIndex__.ts.html +7 -19
- package/coverage/src/concepts/EntityProperty__.ts.html +75 -273
- package/coverage/src/concepts/Entity__.ts.html +68 -188
- package/coverage/src/concepts/EnumItem__.ts.html +6 -9
- package/coverage/src/concepts/Enum__.ts.html +11 -38
- package/coverage/src/concepts/Event__.ts.html +11 -38
- package/coverage/src/concepts/ExternalDestination__.ts.html +12 -39
- package/coverage/src/concepts/ForEachStatement__.ts.html +27 -93
- package/coverage/src/concepts/FrontendLibrary__.ts.html +15 -66
- package/coverage/src/concepts/FrontendVariable__.ts.html +1 -1
- package/coverage/src/concepts/Frontend__.ts.html +28 -145
- package/coverage/src/concepts/Function__.ts.html +60 -180
- package/coverage/src/concepts/Identifier__.ts.html +38 -41
- package/coverage/src/concepts/IfStatement__.ts.html +48 -90
- package/coverage/src/concepts/Integration__.ts.html +15 -60
- package/coverage/src/concepts/InterfaceParam__.ts.html +31 -202
- package/coverage/src/concepts/Interface__.ts.html +25 -94
- package/coverage/src/concepts/JSBlock__.ts.html +6 -9
- package/coverage/src/concepts/JavaLogic__.ts.html +6 -9
- package/coverage/src/concepts/LogicItem__.ts.html +17 -20
- package/coverage/src/concepts/Logic__.ts.html +144 -468
- package/coverage/src/concepts/MatchCase__.ts.html +41 -86
- package/coverage/src/concepts/Match__.ts.html +29 -68
- package/coverage/src/concepts/MemberExpression__.ts.html +94 -112
- package/coverage/src/concepts/MicroApp__.ts.html +6 -9
- package/coverage/src/concepts/Module__.ts.html +20 -185
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +11 -38
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +11 -38
- package/coverage/src/concepts/Namespace__.ts.html +70 -349
- package/coverage/src/concepts/NewComposite__.ts.html +93 -129
- package/coverage/src/concepts/NewList__.ts.html +26 -110
- package/coverage/src/concepts/NewMap__.ts.html +22 -166
- package/coverage/src/concepts/New__.ts.html +1 -1
- package/coverage/src/concepts/NullLiteral__.ts.html +6 -9
- package/coverage/src/concepts/NumericLiteral__.ts.html +24 -45
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +14 -110
- package/coverage/src/concepts/OverriddenLogic__.ts.html +32 -185
- package/coverage/src/concepts/Param__.ts.html +119 -191
- package/coverage/src/concepts/Point__.ts.html +6 -9
- package/coverage/src/concepts/ProcessComponent__.ts.html +15 -66
- package/coverage/src/concepts/ProcessElement__.ts.html +40 -343
- package/coverage/src/concepts/ProcessOutcome__.ts.html +6 -9
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +7 -19
- package/coverage/src/concepts/Process__.ts.html +30 -333
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +11 -32
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +6 -9
- package/coverage/src/concepts/QueryFromExpression__.ts.html +11 -38
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +11 -32
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +12 -51
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +12 -39
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +12 -39
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +11 -38
- package/coverage/src/concepts/Rect__.ts.html +6 -9
- package/coverage/src/concepts/Return__.ts.html +92 -251
- package/coverage/src/concepts/Role__.ts.html +6 -9
- package/coverage/src/concepts/SelectMembers__.ts.html +18 -51
- package/coverage/src/concepts/Slot__.ts.html +11 -32
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +11 -32
- package/coverage/src/concepts/Start__.ts.html +6 -9
- package/coverage/src/concepts/StringInterpolation__.ts.html +17 -44
- package/coverage/src/concepts/StringLiteral__.ts.html +26 -29
- package/coverage/src/concepts/StructureProperty__.ts.html +31 -199
- package/coverage/src/concepts/Structure__.ts.html +17 -107
- package/coverage/src/concepts/SwitchCase__.ts.html +16 -46
- package/coverage/src/concepts/SwitchStatement__.ts.html +24 -51
- package/coverage/src/concepts/Theme__.ts.html +6 -9
- package/coverage/src/concepts/Transactional__.ts.html +6 -9
- package/coverage/src/concepts/TriggerEvent__.ts.html +11 -38
- package/coverage/src/concepts/TriggerLauncher__.ts.html +6 -9
- package/coverage/src/concepts/TypeAnnotation__.ts.html +95 -209
- package/coverage/src/concepts/TypeParam__.ts.html +7 -10
- package/coverage/src/concepts/UnaryExpression__.ts.html +14 -47
- package/coverage/src/concepts/Unparsed__.ts.html +8 -11
- package/coverage/src/concepts/UseComponent__.ts.html +6 -9
- package/coverage/src/concepts/ValidationRule__.ts.html +17 -53
- package/coverage/src/concepts/Variable__.ts.html +74 -290
- package/coverage/src/concepts/ViewBlock__.ts.html +6 -9
- package/coverage/src/concepts/ViewComponent__.ts.html +30 -177
- package/coverage/src/concepts/ViewElement__.ts.html +131 -320
- package/coverage/src/concepts/View__.ts.html +68 -467
- package/coverage/src/concepts/WhileStatement__.ts.html +51 -93
- package/coverage/src/concepts/basics/stdlib/index.html +8 -8
- 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 +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +17 -128
- 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 +863 -878
- package/coverage/src/concepts/index.ts.html +1 -1
- package/coverage/src/concepts/index__.ts.html +4 -7
- package/coverage/src/config.ts.html +1 -1
- package/coverage/src/decorators/index.html +14 -14
- package/coverage/src/decorators/index.ts.html +36 -45
- package/coverage/src/decorators/promise.ts.html +1 -1
- package/coverage/src/eventBus.ts.html +1 -1
- package/coverage/src/generator/compileComponent.ts.html +1 -1
- package/coverage/src/generator/genBundleFiles.ts.html +1 -1
- package/coverage/src/generator/genHash.ts.html +1 -1
- package/coverage/src/generator/genMetaData.ts.html +9 -51
- package/coverage/src/generator/genReleaseBody.ts.html +2 -2
- package/coverage/src/generator/icestark.ts.html +1 -1
- package/coverage/src/generator/index.html +15 -15
- 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 +7 -7
- package/coverage/src/index.ts.html +7 -10
- 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 +15 -15
- 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 +18 -78
- package/coverage/src/sentry/index.html +1 -1
- package/coverage/src/sentry/index.ts.html +23 -23
- package/coverage/src/server/createUiTs.ts.html +6 -15
- 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 +1 -1
- package/coverage/src/server/formatTsUtils.ts.html +10 -10
- 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 +1 -1
- package/coverage/src/server/getInterfaces.ts.html +1 -1
- package/coverage/src/server/getLogging.ts.html +1 -1
- package/coverage/src/server/getLogics.ts.html +1 -1
- package/coverage/src/server/getMemberIdentifier.ts.html +13 -58
- package/coverage/src/server/getProcessComponents.ts.html +1 -1
- package/coverage/src/server/getProcesses.ts.html +1 -1
- package/coverage/src/server/getValidates.ts.html +1 -1
- package/coverage/src/server/index.html +23 -23
- package/coverage/src/server/index.ts.html +1 -1
- package/coverage/src/server/naslServer.ts.html +179 -134
- package/coverage/src/server/naslStdlibMap.ts.html +1 -1
- package/coverage/src/server/process2LogicNamespace.ts.html +1 -1
- package/coverage/src/server/translator.ts.html +1 -1
- package/coverage/src/service/creator/add.configs.js.html +8 -26
- package/coverage/src/service/creator/errHandles.js.html +37 -19
- package/coverage/src/service/creator/index.html +22 -22
- 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 +19 -19
- package/coverage/src/service/storage/index.ts.html +1 -1
- package/coverage/src/service/storage/init.ts.html +618 -1578
- package/coverage/src/service/storage/jsoner.ts.html +3 -3
- 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 +1 -1
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +1 -1
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +1 -1
- package/coverage/src/templator/genEditTableBlock.ts.html +4 -70
- 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 +3 -66
- package/coverage/src/templator/genUpdateBlock.ts.html +1 -1
- package/coverage/src/templator/index.html +1 -1
- package/coverage/src/templator/index.ts.html +1 -1
- package/coverage/src/templator/utils.ts.html +1 -1
- 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 +37 -37
- package/coverage/src/utils/cookie.ts.html +1 -1
- package/coverage/src/utils/env.ts.html +1 -1
- package/coverage/src/utils/index.html +19 -19
- package/coverage/src/utils/index.ts.html +22 -61
- package/coverage/src/utils/logger.ts.html +1 -1
- package/coverage/src/utils/sortTsString.ts.html +1 -1
- package/coverage/src/utils/string.ts.html +1 -1
- 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/concepts/Argument__.js +7 -2
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.js +20 -3
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +24 -2
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +40 -13
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/CallLogic__.js +7 -12
- 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/Identifier__.js +3 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/JSBlock__.js +56 -0
- package/out/concepts/JSBlock__.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/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/NumericLiteral__.js +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.js +24 -2
- 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/Return__.js +24 -2
- 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/Variable__.js +24 -2
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.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 +32 -1
- package/out/server/extendBaseNode.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/getProcesses.js +66 -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.js +2 -2
- 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/genCreateBlock.js +9 -5
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +18 -12
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +10 -8
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +3 -2
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +12 -9
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.js.map +1 -1
- package/package.json +2 -2
- package/sandbox/stdlib/nasl.core.ts +2 -0
- package/sandbox/stdlib/nasl.util.ts +3 -3
- package/src/bak/translator.js +0 -1
- package/src/concepts/Argument__.ts +7 -2
- package/src/concepts/Assignment__.ts +31 -13
- package/src/concepts/BackendVariable__.ts +22 -3
- package/src/concepts/BinaryExpression__.ts +39 -13
- package/src/concepts/CallLogic__.ts +13 -23
- package/src/concepts/CountersignPolicy__.ts +77 -0
- package/src/concepts/ForEachStatement__.ts +17 -26
- package/src/concepts/Identifier__.ts +4 -1
- package/src/concepts/JSBlock__.ts +58 -0
- package/src/concepts/LogicItem__.ts +2 -2
- package/src/concepts/Logic__.ts +1 -0
- package/src/concepts/MultiApprovalPolicy__.ts +69 -0
- package/src/concepts/NewComposite__.ts +18 -9
- package/src/concepts/NumericLiteral__.ts +1 -1
- package/src/concepts/Param__.ts +24 -2
- package/src/concepts/ProcessElement__.ts +70 -1
- package/src/concepts/Return__.ts +23 -3
- package/src/concepts/SequentialPolicy__.ts +58 -0
- package/src/concepts/Variable__.ts +23 -3
- package/src/concepts/ViewElement__.ts +6 -4
- 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 +30 -2
- package/src/server/getLogics.ts +4 -0
- package/src/server/getProcesses.ts +66 -6
- package/src/server/index.ts +2 -1
- package/src/server/naslServer.ts +2 -2
- 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/genCreateBlock.ts +9 -5
- package/src/templator/genCurdEditMultipleKeyBlock.ts +19 -13
- package/src/templator/genCurdMultipleKeyBlock.ts +14 -11
- package/src/templator/genEditTableBlock.ts +4 -2
- package/src/templator/genUpdateBlock.ts +15 -12
- package/src/templator/utils.ts +8 -7
- package/test/concepts/anonymous-function/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/assignment/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/batch-assignment/__snapshots__/toJS.spec.ts.snap +2 -2
- package/test/concepts/binary-expression/__snapshots__/toJS.spec.ts.snap +3 -2
- package/test/concepts/call-interface/__snapshots__/toJS.spec.ts.snap +2 -2
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +3 -3
- package/test/concepts/match/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/numeric-literal/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +3 -3
- package/.nyc_output/processinfo/b920244d-8d01-4e76-be5a-95132217c5a1.json +0 -1
- package/coverage/src/concepts/DefaultValue__.ts.html +0 -946
package/src/concepts/Param__.ts
CHANGED
|
@@ -325,6 +325,9 @@ export class Param extends BaseNode {
|
|
|
325
325
|
const { defaultValue } = this;
|
|
326
326
|
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
327
327
|
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
328
|
+
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
329
|
+
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
330
|
+
|
|
328
331
|
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
329
332
|
let parsedValue = defaultValue ?? undefined;
|
|
330
333
|
if (
|
|
@@ -342,10 +345,27 @@ export class Param extends BaseNode {
|
|
|
342
345
|
if ([''].includes(defaultValue)) {
|
|
343
346
|
parsedValue = undefined;
|
|
344
347
|
} else {
|
|
345
|
-
|
|
348
|
+
function parseNumberValue(defaultValue: any, typeAnnotation: any) {
|
|
349
|
+
const { typeKind, typeName } = typeAnnotation;
|
|
350
|
+
const isNaslNumber = typeKind === 'primitive' && ['Decimal', 'Long', 'Double', 'Int'].includes(typeName);
|
|
351
|
+
if (isNaslNumber) {
|
|
352
|
+
return String(defaultValue);
|
|
353
|
+
} else {
|
|
354
|
+
return tryJSONParse(defaultValue) ?? defaultValue;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
parsedValue = parseNumberValue(defaultValue, typeAnnotation);
|
|
346
358
|
}
|
|
347
359
|
}
|
|
348
|
-
|
|
360
|
+
let valueCode = '';
|
|
361
|
+
if (isDecimal) {
|
|
362
|
+
valueCode = `new NaslDecimal('${defaultValue}')`;
|
|
363
|
+
} else if (isInteger) {
|
|
364
|
+
valueCode = `new NaslLong('${defaultValue}')`;
|
|
365
|
+
} else {
|
|
366
|
+
valueCode = `${JSON.stringify(parsedValue)}`;
|
|
367
|
+
}
|
|
368
|
+
code += `${this.name} !== undefined ? ${this.name} : ${valueCode}`;
|
|
349
369
|
|
|
350
370
|
if (needGenInitFromSchema) {
|
|
351
371
|
code += `)`;
|
|
@@ -561,3 +581,5 @@ export default Param;
|
|
|
561
581
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
562
582
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
563
583
|
//================================================================================
|
|
584
|
+
|
|
585
|
+
|
|
@@ -37,6 +37,7 @@ import Variable from './Variable__';
|
|
|
37
37
|
import Return from './Return__';
|
|
38
38
|
import Constant from './Constant__';
|
|
39
39
|
import BindAttribute from './BindAttribute__';
|
|
40
|
+
import MultiApprovalPolicy from './MultiApprovalPolicy__';
|
|
40
41
|
import Process from './Process__';
|
|
41
42
|
import Module from './Module__';
|
|
42
43
|
import App from './App__';
|
|
@@ -157,6 +158,13 @@ export class ProcessElement extends BaseNode {
|
|
|
157
158
|
@property('BindAttribute')
|
|
158
159
|
bindAttrs: Array<BindAttribute> = [];
|
|
159
160
|
|
|
161
|
+
/**
|
|
162
|
+
* 多人审批任务
|
|
163
|
+
*/
|
|
164
|
+
@property('MultiApprovalPolicy')
|
|
165
|
+
// @ts-ignore
|
|
166
|
+
multiApprovalPolicy!: MultiApprovalPolicy;
|
|
167
|
+
|
|
160
168
|
/**
|
|
161
169
|
* 祖先 Process
|
|
162
170
|
*/
|
|
@@ -1656,6 +1664,62 @@ export class ProcessElement extends BaseNode {
|
|
|
1656
1664
|
return params;
|
|
1657
1665
|
}
|
|
1658
1666
|
|
|
1667
|
+
/**
|
|
1668
|
+
* 删除多人审批任务
|
|
1669
|
+
* @param name 多人审批任务名称
|
|
1670
|
+
*/
|
|
1671
|
+
removeMultiApprovalPolicy(name: string): void;
|
|
1672
|
+
|
|
1673
|
+
/**
|
|
1674
|
+
* 删除多人审批任务
|
|
1675
|
+
* @param multiApprovalPolicy 已有的多人审批任务实例
|
|
1676
|
+
*/
|
|
1677
|
+
removeMultiApprovalPolicy(multiApprovalPolicy: MultiApprovalPolicy): void;
|
|
1678
|
+
|
|
1679
|
+
removeMultiApprovalPolicy(options: string | MultiApprovalPolicy) {
|
|
1680
|
+
let multiApprovalPolicy: MultiApprovalPolicy;
|
|
1681
|
+
if (typeof options === 'string') {
|
|
1682
|
+
multiApprovalPolicy = this.multiApprovalPolicy;
|
|
1683
|
+
if (!multiApprovalPolicy) {
|
|
1684
|
+
throw new Error('找不到多人审批任务 ' + options);
|
|
1685
|
+
}
|
|
1686
|
+
} else {
|
|
1687
|
+
multiApprovalPolicy = options;
|
|
1688
|
+
}
|
|
1689
|
+
return multiApprovalPolicy.delete();
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
__removeMultiApprovalPolicy(multiApprovalPolicy: MultiApprovalPolicy) {
|
|
1693
|
+
const parentKey = multiApprovalPolicy.parentKey;
|
|
1694
|
+
const params: Params = {
|
|
1695
|
+
parentNode: this,
|
|
1696
|
+
parentKey,
|
|
1697
|
+
index: -1,
|
|
1698
|
+
object: null,
|
|
1699
|
+
oldObject: multiApprovalPolicy,
|
|
1700
|
+
};
|
|
1701
|
+
if (parentKey) {
|
|
1702
|
+
params.parentKey = parentKey;
|
|
1703
|
+
// @ts-ignore
|
|
1704
|
+
const t = this.__v_raw || this;
|
|
1705
|
+
// @ts-ignore
|
|
1706
|
+
const n = multiApprovalPolicy.__v_raw || multiApprovalPolicy;
|
|
1707
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
1708
|
+
// @ts-ignore
|
|
1709
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
1710
|
+
~index && (this as any)[parentKey].splice(index, 1);
|
|
1711
|
+
params.index = index;
|
|
1712
|
+
} else {
|
|
1713
|
+
const q = (t as any)[parentKey];
|
|
1714
|
+
if ((q.__v_raw || q) === n) {
|
|
1715
|
+
params.index = 0;
|
|
1716
|
+
(this as any)[parentKey] = undefined;
|
|
1717
|
+
}
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
return params;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1659
1723
|
//================================================================================
|
|
1660
1724
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1661
1725
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
@@ -1668,7 +1732,12 @@ export class ProcessElement extends BaseNode {
|
|
|
1668
1732
|
}
|
|
1669
1733
|
|
|
1670
1734
|
get isUserTask() {
|
|
1671
|
-
return
|
|
1735
|
+
return (
|
|
1736
|
+
this.type === 'UserTask' ||
|
|
1737
|
+
this.type === 'ApprovalTask' ||
|
|
1738
|
+
this.type === 'MultiApprovalTask' ||
|
|
1739
|
+
this.type === 'InitiateTask'
|
|
1740
|
+
);
|
|
1672
1741
|
}
|
|
1673
1742
|
|
|
1674
1743
|
get logics() {
|
package/src/concepts/Return__.ts
CHANGED
|
@@ -17,7 +17,7 @@ function tryJSONParse(str: string) {
|
|
|
17
17
|
|
|
18
18
|
try {
|
|
19
19
|
result = JSON.parse(str);
|
|
20
|
-
} catch (e) {
|
|
20
|
+
} catch (e) {}
|
|
21
21
|
|
|
22
22
|
return result;
|
|
23
23
|
}
|
|
@@ -282,6 +282,9 @@ export class Return extends BaseNode {
|
|
|
282
282
|
const { defaultValue } = this;
|
|
283
283
|
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
284
284
|
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
285
|
+
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
286
|
+
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
287
|
+
|
|
285
288
|
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
286
289
|
let parsedValue = defaultValue ?? undefined;
|
|
287
290
|
if (
|
|
@@ -295,10 +298,27 @@ export class Return extends BaseNode {
|
|
|
295
298
|
if ([''].includes(defaultValue)) {
|
|
296
299
|
parsedValue = undefined;
|
|
297
300
|
} else {
|
|
298
|
-
|
|
301
|
+
function parseNumberValue(defaultValue: any, typeAnnotation: any) {
|
|
302
|
+
const { typeKind, typeName } = typeAnnotation;
|
|
303
|
+
const isNaslNumber = typeKind === 'primitive' && ['Decimal', 'Long', 'Double', 'Int'].includes(typeName);
|
|
304
|
+
if (isNaslNumber) {
|
|
305
|
+
return String(defaultValue);
|
|
306
|
+
} else {
|
|
307
|
+
return tryJSONParse(defaultValue) ?? defaultValue;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
parsedValue = parseNumberValue(defaultValue, typeAnnotation);
|
|
299
311
|
}
|
|
300
312
|
}
|
|
301
|
-
|
|
313
|
+
if (isDecimal) {
|
|
314
|
+
parsedValue = `new NaslDecimal('${defaultValue}')`;
|
|
315
|
+
code += `${parsedValue}`;
|
|
316
|
+
} else if (isInteger) {
|
|
317
|
+
parsedValue = `new NaslLong('${defaultValue}')`;
|
|
318
|
+
code += `${parsedValue}`;
|
|
319
|
+
} else {
|
|
320
|
+
code += `${JSON.stringify(parsedValue)}`;
|
|
321
|
+
}
|
|
302
322
|
if (needGenInitFromSchema) {
|
|
303
323
|
code += `)`;
|
|
304
324
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
//================================================================================
|
|
2
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
4
|
+
//================================================================================
|
|
5
|
+
import { EventPayload, Params } from '../common/EventEmitter';
|
|
6
|
+
import { concept, excludedInJSON, property, className } from '../decorators';
|
|
7
|
+
|
|
8
|
+
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import BaseNode from '../common/BaseNode';
|
|
11
|
+
import MultiApprovalPolicy from './MultiApprovalPolicy__';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 依次审批
|
|
15
|
+
*/
|
|
16
|
+
@className
|
|
17
|
+
@concept('依次审批')
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
export class SequentialPolicy extends MultiApprovalPolicy {
|
|
20
|
+
/** 类名 */
|
|
21
|
+
static readonly ConceptName = 'SequentialPolicy';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 产品概念
|
|
25
|
+
*/
|
|
26
|
+
@property('concept')
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
readonly concept!: 'SequentialPolicy';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @param source 需要合并的部分参数
|
|
32
|
+
*/
|
|
33
|
+
constructor(source?: Partial<SequentialPolicy>) {
|
|
34
|
+
source = Object.assign({}, SequentialPolicy.getDefaultOptions(), source);
|
|
35
|
+
super(source);
|
|
36
|
+
super.subConstructor(source);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
static from(source: any, parentNode?: any, parentKey?: string): SequentialPolicy {
|
|
40
|
+
return super.from(source, parentNode, parentKey) as SequentialPolicy;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//================================================================================
|
|
44
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
45
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
46
|
+
//================================================================================
|
|
47
|
+
|
|
48
|
+
//================================================================================
|
|
49
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
50
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
51
|
+
//================================================================================
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export default SequentialPolicy;
|
|
55
|
+
//================================================================================
|
|
56
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
57
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
58
|
+
//================================================================================
|
|
@@ -22,7 +22,7 @@ function tryJSONParse(str: string) {
|
|
|
22
22
|
|
|
23
23
|
try {
|
|
24
24
|
result = JSON.parse(str);
|
|
25
|
-
} catch (e) {
|
|
25
|
+
} catch (e) {}
|
|
26
26
|
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
@@ -298,11 +298,14 @@ export class Variable extends BaseNode {
|
|
|
298
298
|
if (needGenInitFromSchema) {
|
|
299
299
|
code += `${context}.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}',`;
|
|
300
300
|
}
|
|
301
|
+
|
|
301
302
|
const { defaultValue } = this;
|
|
302
303
|
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
303
304
|
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
304
305
|
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
305
306
|
let parsedValue = defaultValue ?? undefined;
|
|
307
|
+
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
308
|
+
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
306
309
|
if (
|
|
307
310
|
defaultValueType === '[object String]' &&
|
|
308
311
|
!(typeKind === 'primitive' && typeNamespace === 'nasl.core' && ['String', 'Text', 'Email'].includes(typeName)) &&
|
|
@@ -314,10 +317,27 @@ export class Variable extends BaseNode {
|
|
|
314
317
|
if ([''].includes(defaultValue)) {
|
|
315
318
|
parsedValue = undefined;
|
|
316
319
|
} else {
|
|
317
|
-
|
|
320
|
+
function parseNumberValue(defaultValue: any, typeAnnotation: any) {
|
|
321
|
+
const { typeKind, typeName } = typeAnnotation;
|
|
322
|
+
const isNaslNumber = typeKind === 'primitive' && ['Decimal', 'Long', 'Double', 'Int'].includes(typeName);
|
|
323
|
+
if (isNaslNumber) {
|
|
324
|
+
return String(defaultValue);
|
|
325
|
+
} else {
|
|
326
|
+
return tryJSONParse(defaultValue) ?? defaultValue;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
parsedValue = parseNumberValue(defaultValue, typeAnnotation);
|
|
318
330
|
}
|
|
319
331
|
}
|
|
320
|
-
|
|
332
|
+
if (isDecimal) {
|
|
333
|
+
parsedValue = `new NaslDecimal('${defaultValue}')`;
|
|
334
|
+
code += `${parsedValue}`;
|
|
335
|
+
} else if (isInteger) {
|
|
336
|
+
parsedValue = `new NaslLong('${defaultValue}')`;
|
|
337
|
+
code += `${parsedValue}`;
|
|
338
|
+
} else {
|
|
339
|
+
code += `${JSON.stringify(parsedValue)}`;
|
|
340
|
+
}
|
|
321
341
|
if (needGenInitFromSchema) {
|
|
322
342
|
code += `)`;
|
|
323
343
|
}
|
|
@@ -1579,8 +1579,9 @@ export class ViewElement extends BaseNode {
|
|
|
1579
1579
|
code += `${self.name}: nasl.ui.${self.toHump(self.tag)}<any, any>;\n`;
|
|
1580
1580
|
} else if (Object.keys(PAGE_COMPONENT_INCLUDE_TAG_MAP).includes(self.tag)) {
|
|
1581
1581
|
if (self.bindAttrs?.findIndex((attr) => attr.name === 'data-source') > -1) {
|
|
1582
|
-
code += `${self.name}: nasl.ui.${self.toHump(self.tag)}<__elements_completionProperty['${
|
|
1583
|
-
|
|
1582
|
+
code += `${self.name}: nasl.ui.${self.toHump(self.tag)}<__elements_completionProperty['${
|
|
1583
|
+
self.name
|
|
1584
|
+
}']['dataSource']>;\n`;
|
|
1584
1585
|
} else {
|
|
1585
1586
|
code += `${self.name}: nasl.ui.${self.toHump(self.tag)}<any>;\n`;
|
|
1586
1587
|
}
|
|
@@ -1659,8 +1660,9 @@ export class ViewElement extends BaseNode {
|
|
|
1659
1660
|
const _this = self.parentNode;
|
|
1660
1661
|
let genericity = '';
|
|
1661
1662
|
if (_this.tag === 'u-table-view-column-dynamic') {
|
|
1662
|
-
genericity += `<${(_this.parentNode as any).__tsVariableDataSourceTypeName}, ${
|
|
1663
|
-
|
|
1663
|
+
genericity += `<${(_this.parentNode as any).__tsVariableDataSourceTypeName}, ${
|
|
1664
|
+
(_this as any).__tsVariableDataSourceTypeName
|
|
1665
|
+
}>`;
|
|
1664
1666
|
} else {
|
|
1665
1667
|
let targetNode: any = _this;
|
|
1666
1668
|
while (!targetNode.__tsVariableDataSourceTypeName && targetNode?.parentNode instanceof ViewElement) {
|
package/src/concepts/index__.ts
CHANGED
|
@@ -98,6 +98,9 @@ export * from './ProcessComponent__';
|
|
|
98
98
|
export * from './ProcessOutcome__';
|
|
99
99
|
export * from './Assignee__';
|
|
100
100
|
export * from './ProcessOutcomes__';
|
|
101
|
+
export * from './MultiApprovalPolicy__';
|
|
102
|
+
export * from './SequentialPolicy__';
|
|
103
|
+
export * from './CountersignPolicy__';
|
|
101
104
|
export * from './Role__';
|
|
102
105
|
export * from './Configuration__';
|
|
103
106
|
export * from './ConfigGroup__';
|
package/src/concepts/types__.ts
CHANGED
|
@@ -97,6 +97,9 @@ import type { ProcessComponent } from './ProcessComponent__';
|
|
|
97
97
|
import type { ProcessOutcome } from './ProcessOutcome__';
|
|
98
98
|
import type { Assignee } from './Assignee__';
|
|
99
99
|
import type { ProcessOutcomes } from './ProcessOutcomes__';
|
|
100
|
+
import type { MultiApprovalPolicy } from './MultiApprovalPolicy__';
|
|
101
|
+
import type { SequentialPolicy } from './SequentialPolicy__';
|
|
102
|
+
import type { CountersignPolicy } from './CountersignPolicy__';
|
|
100
103
|
import type { Role } from './Role__';
|
|
101
104
|
import type { Configuration } from './Configuration__';
|
|
102
105
|
import type { ConfigGroup } from './ConfigGroup__';
|
|
@@ -221,6 +224,9 @@ export type SyntaxNode =
|
|
|
221
224
|
| ProcessOutcome
|
|
222
225
|
| Assignee
|
|
223
226
|
| ProcessOutcomes
|
|
227
|
+
| MultiApprovalPolicy
|
|
228
|
+
| SequentialPolicy
|
|
229
|
+
| CountersignPolicy
|
|
224
230
|
| Role
|
|
225
231
|
| Configuration
|
|
226
232
|
| ConfigGroup
|
|
@@ -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,15 +188,24 @@ 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
|
};
|
|
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
|
+
}
|
|
181
209
|
/**
|
|
182
210
|
* nasl和vue的通信,回退,要触发vue的watch。
|
|
183
211
|
* 因为如果没修改的话nasl不会修改view,就不会通知到页面改成旧值
|
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 = [];
|
|
@@ -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,73 @@ 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
|
+
new Return({
|
|
145
|
+
name: 'result',
|
|
146
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
147
|
+
}),
|
|
148
|
+
],
|
|
149
|
+
}),
|
|
150
|
+
new Logic({
|
|
151
|
+
name: `fail`,
|
|
152
|
+
fake: true,
|
|
153
|
+
params: [
|
|
154
|
+
new Param({
|
|
155
|
+
name: 'taskId',
|
|
156
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
157
|
+
}),
|
|
158
|
+
],
|
|
159
|
+
returns: [
|
|
160
|
+
new Return({
|
|
161
|
+
name: 'result',
|
|
162
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
163
|
+
}),
|
|
164
|
+
],
|
|
165
|
+
}),
|
|
166
|
+
]
|
|
167
|
+
logics = userTask.type === 'MultiApprovalTask' ? multiTaskLogics : usertaskLogics;
|
|
168
|
+
if (userTask.type === 'InitiateTask') logics.pop();
|
|
110
169
|
const path = `app.processes.${process.name}.elements.${userTask.name}.logics`;
|
|
111
|
-
|
|
170
|
+
logics.forEach((item) => {
|
|
112
171
|
item.getNamespace = function () {
|
|
113
172
|
return path;
|
|
114
173
|
};
|
|
115
174
|
item.fake = true;
|
|
116
175
|
});
|
|
117
|
-
return
|
|
176
|
+
return logics;
|
|
118
177
|
}
|
|
119
178
|
|
|
120
179
|
export function userTask2LogicNamespace(userTask: ProcessElement) {
|
|
@@ -361,12 +420,13 @@ export function getProcessVariableSuggestions(node: LogicItem, abandonConstant:
|
|
|
361
420
|
|
|
362
421
|
const elements: ProcessElement[] = getPreviousTask(processElem, process);
|
|
363
422
|
const prevtasks = elements.map((us) => {
|
|
423
|
+
const constant = us.type === 'MultiApprovalTask' ? [] : us.constants.map(genCompletionProperty([process.name, us.name]));
|
|
364
424
|
const cp = new CompletionProperty({
|
|
365
425
|
name: us.name,
|
|
366
426
|
value: us.name,
|
|
367
427
|
children: [
|
|
368
428
|
...us.returns.map(genCompletionProperty([process.name, us.name])),
|
|
369
|
-
...(abandonConstant ? [] :
|
|
429
|
+
...(abandonConstant ? [] : constant),
|
|
370
430
|
],
|
|
371
431
|
});
|
|
372
432
|
cp.icon = us.type;
|
|
@@ -400,7 +460,7 @@ export function getProcessVariableSuggestions(node: LogicItem, abandonConstant:
|
|
|
400
460
|
if (processElem.isUserTask) {
|
|
401
461
|
// 任务完成时可以拿到该任务的输出参数
|
|
402
462
|
let returns: CompletionProperty[] = [];
|
|
403
|
-
if (node.logic && node.logic.parentNode.name === 'OnClose') {
|
|
463
|
+
if (node.logic && node.logic.parentNode.name === 'OnClose' && processElem.type !== 'MultiApprovalTask') {
|
|
404
464
|
returns = processElem.returns.map(genCompletionProperty([process.name, processElem.name]));
|
|
405
465
|
}
|
|
406
466
|
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,
|