@lcap/nasl 3.3.3-beta.8 → 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/{78804420-ead6-486f-b682-ab54ccd95dc9.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 +126 -141
- 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 +14 -14
- package/coverage/src/bak/translator.js.html +57 -393
- 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 +164 -593
- package/coverage/src/common/Command.ts.html +1 -1
- 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 +23 -38
- package/coverage/src/common/index.ts.html +4 -7
- package/coverage/src/concepts/Abort__.ts.html +9 -39
- package/coverage/src/concepts/Anchor__.ts.html +29 -86
- package/coverage/src/concepts/AnonymousFunction__.ts.html +169 -262
- package/coverage/src/concepts/App__.ts.html +152 -1205
- package/coverage/src/concepts/Argument__.ts.html +53 -137
- package/coverage/src/concepts/Assignee__.ts.html +34 -124
- package/coverage/src/concepts/AssignmentLine__.ts.html +15 -48
- package/coverage/src/concepts/Assignment__.ts.html +81 -213
- package/coverage/src/concepts/Attribute__.ts.html +14 -41
- package/coverage/src/concepts/AuthInterface__.ts.html +6 -9
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +144 -108
- package/coverage/src/concepts/AuthLogic__.ts.html +6 -18
- package/coverage/src/concepts/BackendVariable__.ts.html +48 -168
- package/coverage/src/concepts/Backend__.ts.html +28 -106
- package/coverage/src/concepts/BatchAssignment__.ts.html +169 -274
- package/coverage/src/concepts/BinaryExpression__.ts.html +129 -285
- package/coverage/src/concepts/BindAttribute__.ts.html +111 -522
- package/coverage/src/concepts/BindDirective__.ts.html +26 -131
- package/coverage/src/concepts/BindEvent__.ts.html +64 -160
- package/coverage/src/concepts/BindStyle__.ts.html +21 -78
- package/coverage/src/concepts/BooleanLiteral__.ts.html +20 -47
- package/coverage/src/concepts/CallAuthInterface__.ts.html +48 -105
- package/coverage/src/concepts/CallConnector__.ts.html +35 -62
- package/coverage/src/concepts/CallFunction__.ts.html +144 -288
- package/coverage/src/concepts/CallInterface__.ts.html +60 -93
- package/coverage/src/concepts/CallLogic__.ts.html +343 -292
- package/coverage/src/concepts/CallQueryComponent__.ts.html +93 -126
- package/coverage/src/concepts/Comment__.ts.html +10 -43
- package/coverage/src/concepts/CompletionProperty__.ts.html +13 -40
- package/coverage/src/concepts/ConfigGroup__.ts.html +20 -47
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +19 -22
- package/coverage/src/concepts/ConfigProperty__.ts.html +40 -97
- package/coverage/src/concepts/Configuration__.ts.html +21 -48
- package/coverage/src/concepts/Connection__.ts.html +22 -97
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +6 -9
- package/coverage/src/concepts/Connector__.ts.html +38 -161
- package/coverage/src/concepts/Constant__.ts.html +24 -84
- package/coverage/src/concepts/DataSource__.ts.html +57 -111
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +6 -9
- package/coverage/src/concepts/Destination__.ts.html +55 -97
- package/coverage/src/concepts/End__.ts.html +21 -51
- package/coverage/src/concepts/EntityIndex__.ts.html +10 -40
- package/coverage/src/concepts/EntityProperty__.ts.html +56 -164
- package/coverage/src/concepts/Entity__.ts.html +89 -167
- package/coverage/src/concepts/EnumItem__.ts.html +10 -40
- package/coverage/src/concepts/Enum__.ts.html +24 -84
- package/coverage/src/concepts/Event__.ts.html +14 -41
- package/coverage/src/concepts/ExternalDestination__.ts.html +21 -75
- package/coverage/src/concepts/ForEachStatement__.ts.html +64 -139
- package/coverage/src/concepts/FrontendLibrary__.ts.html +20 -71
- package/coverage/src/concepts/FrontendVariable__.ts.html +1 -1
- package/coverage/src/concepts/Frontend__.ts.html +57 -213
- package/coverage/src/concepts/Function__.ts.html +86 -239
- package/coverage/src/concepts/Identifier__.ts.html +72 -111
- package/coverage/src/concepts/IfStatement__.ts.html +75 -138
- package/coverage/src/concepts/Integration__.ts.html +19 -70
- package/coverage/src/concepts/InterfaceParam__.ts.html +21 -78
- package/coverage/src/concepts/Interface__.ts.html +60 -162
- package/coverage/src/concepts/JSBlock__.ts.html +11 -215
- package/coverage/src/concepts/JavaLogic__.ts.html +9 -42
- package/coverage/src/concepts/LogicItem__.ts.html +21 -51
- package/coverage/src/concepts/Logic__.ts.html +321 -405
- package/coverage/src/concepts/MatchCase__.ts.html +97 -181
- package/coverage/src/concepts/Match__.ts.html +59 -116
- package/coverage/src/concepts/MemberExpression__.ts.html +128 -182
- package/coverage/src/concepts/MicroApp__.ts.html +6 -9
- package/coverage/src/concepts/Module__.ts.html +18 -672
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +14 -41
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +14 -41
- package/coverage/src/concepts/Namespace__.ts.html +91 -358
- package/coverage/src/concepts/NewComposite__.ts.html +125 -278
- package/coverage/src/concepts/NewList__.ts.html +57 -195
- package/coverage/src/concepts/NewMap__.ts.html +63 -168
- package/coverage/src/concepts/New__.ts.html +9 -39
- package/coverage/src/concepts/NullLiteral__.ts.html +9 -36
- package/coverage/src/concepts/NumericLiteral__.ts.html +33 -90
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +35 -161
- package/coverage/src/concepts/OverriddenLogic__.ts.html +201 -324
- package/coverage/src/concepts/Param__.ts.html +75 -189
- package/coverage/src/concepts/Point__.ts.html +6 -9
- package/coverage/src/concepts/ProcessComponent__.ts.html +21 -72
- package/coverage/src/concepts/ProcessElement__.ts.html +115 -316
- package/coverage/src/concepts/ProcessOutcome__.ts.html +13 -85
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +13 -85
- package/coverage/src/concepts/Process__.ts.html +70 -211
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +16 -67
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +11 -41
- package/coverage/src/concepts/QueryFromExpression__.ts.html +21 -81
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +19 -70
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +25 -85
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +20 -77
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +20 -80
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +15 -42
- package/coverage/src/concepts/Rect__.ts.html +6 -9
- package/coverage/src/concepts/Return__.ts.html +44 -164
- package/coverage/src/concepts/Role__.ts.html +15 -45
- package/coverage/src/concepts/SelectMembers__.ts.html +24 -81
- package/coverage/src/concepts/Slot__.ts.html +13 -40
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +24 -84
- package/coverage/src/concepts/Start__.ts.html +9 -36
- package/coverage/src/concepts/StringInterpolation__.ts.html +29 -104
- package/coverage/src/concepts/StringLiteral__.ts.html +32 -62
- package/coverage/src/concepts/StructureProperty__.ts.html +23 -80
- package/coverage/src/concepts/Structure__.ts.html +32 -116
- package/coverage/src/concepts/SwitchCase__.ts.html +36 -87
- package/coverage/src/concepts/SwitchStatement__.ts.html +33 -90
- package/coverage/src/concepts/Theme__.ts.html +12 -15
- package/coverage/src/concepts/Transactional__.ts.html +6 -9
- package/coverage/src/concepts/TriggerEvent__.ts.html +14 -41
- package/coverage/src/concepts/TriggerLauncher__.ts.html +13 -46
- package/coverage/src/concepts/TypeAnnotation__.ts.html +116 -347
- package/coverage/src/concepts/TypeParam__.ts.html +12 -42
- package/coverage/src/concepts/UnaryExpression__.ts.html +27 -105
- package/coverage/src/concepts/Unparsed__.ts.html +12 -36
- package/coverage/src/concepts/UseComponent__.ts.html +6 -9
- package/coverage/src/concepts/ValidationRule__.ts.html +40 -79
- package/coverage/src/concepts/Variable__.ts.html +37 -157
- package/coverage/src/concepts/ViewBlock__.ts.html +6 -9
- package/coverage/src/concepts/ViewComponent__.ts.html +24 -99
- package/coverage/src/concepts/ViewElement__.ts.html +278 -692
- package/coverage/src/concepts/View__.ts.html +163 -517
- package/coverage/src/concepts/WhileStatement__.ts.html +55 -118
- 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 +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +3 -3
- 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 +965 -980
- 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 +5 -5
- package/coverage/src/decorators/index.ts.html +32 -32
- package/coverage/src/decorators/promise.ts.html +10 -10
- package/coverage/src/eventBus.ts.html +1 -1
- package/coverage/src/generator/compileComponent.ts.html +4 -4
- package/coverage/src/generator/genBundleFiles.ts.html +23 -17
- package/coverage/src/generator/genHash.ts.html +3 -3
- package/coverage/src/generator/genMetaData.ts.html +16 -103
- package/coverage/src/generator/genReleaseBody.ts.html +3 -3
- package/coverage/src/generator/icestark.ts.html +4 -10
- package/coverage/src/generator/index.html +21 -21
- 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 +20 -92
- package/coverage/src/generator/qiankun.ts.html +3 -9
- package/coverage/src/generator/styleReplacer.ts.html +1 -1
- package/coverage/src/index.html +7 -7
- package/coverage/src/index.ts.html +4 -4
- package/coverage/src/manager/diagnostic.ts.html +14 -11
- package/coverage/src/manager/index.html +13 -13
- 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 +14 -14
- package/coverage/src/sentry/index.ts.html +32 -38
- 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 +4 -7
- package/coverage/src/server/formatTsUtils.ts.html +9 -9
- 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 +1 -1
- package/coverage/src/server/getMemberIdentifier.ts.html +119 -167
- package/coverage/src/server/getProcessComponents.ts.html +3 -3
- package/coverage/src/server/getProcesses.ts.html +1 -1
- package/coverage/src/server/getValidates.ts.html +4 -4
- package/coverage/src/server/index.html +34 -34
- package/coverage/src/server/index.ts.html +1 -1
- package/coverage/src/server/naslServer.ts.html +943 -1195
- 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 +14 -50
- package/coverage/src/service/creator/add.configs.js.html +9 -27
- 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 +29 -29
- package/coverage/src/service/storage/index.ts.html +1 -1
- package/coverage/src/service/storage/init.ts.html +601 -1534
- package/coverage/src/service/storage/jsoner.ts.html +13 -76
- 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 +56 -47
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +31 -49
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +89 -80
- package/coverage/src/templator/genEditTableBlock.ts.html +11 -80
- 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 +36 -48
- package/coverage/src/templator/index.html +39 -39
- package/coverage/src/templator/index.ts.html +1 -1
- package/coverage/src/templator/utils.ts.html +11 -77
- package/coverage/src/translator/constant.ts.html +1 -1
- package/coverage/src/translator/index.html +21 -21
- package/coverage/src/translator/index.ts.html +1 -1
- package/coverage/src/translator/utils.ts.html +68 -389
- package/coverage/src/utils/cookie.ts.html +4 -4
- package/coverage/src/utils/env.ts.html +1 -1
- package/coverage/src/utils/index.html +51 -36
- package/coverage/src/utils/index.ts.html +22 -115
- package/coverage/src/utils/logger.ts.html +13 -13
- package/coverage/src/utils/sortTsString.ts.html +10 -25
- package/coverage/src/utils/string.ts.html +8 -110
- 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/common/Command.js +1 -1
- package/out/common/Command.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/Match__.js +1 -1
- package/out/concepts/Match__.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/View__.js +2 -2
- package/out/concepts/View__.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/common/Command.ts +1 -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/Match__.ts +1 -1
- 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/View__.ts +5 -5
- 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/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/operators.js.html +0 -862
- package/coverage/src/automate/engine/uniqueName.js.html +0 -412
- package/coverage/src/automate/engine/viewCache.js.html +0 -214
- package/coverage/src/automate/template/index.html +0 -116
- package/coverage/src/automate/template/myProcess.js.html +0 -34645
- package/coverage/src/common/utils.ts.html +0 -136
- package/coverage/src/concepts/DataElement__.ts.html +0 -118
- package/coverage/src/concepts/MetadataType__.ts.html +0 -2053
- package/coverage/src/utils/time-slicing/constant.ts.html +0 -196
- package/coverage/src/utils/time-slicing/controller.ts.html +0 -1111
- package/coverage/src/utils/time-slicing/index.html +0 -236
- package/coverage/src/utils/time-slicing/index.ts.html +0 -103
- package/coverage/src/utils/time-slicing/page-state.ts.html +0 -121
- package/coverage/src/utils/time-slicing/performance.ts.html +0 -253
- package/coverage/src/utils/time-slicing/runner.ts.html +0 -247
- package/coverage/src/utils/time-slicing/tool.ts.html +0 -220
- package/coverage/src/utils/time-slicing/utils.ts.html +0 -355
- package/coverage/src/utils/time-slicing/wrapper.ts.html +0 -259
- package/coverage/src/utils/time.ts.html +0 -118
|
@@ -244,15 +244,15 @@ export class Assignment extends LogicItem {
|
|
|
244
244
|
});
|
|
245
245
|
const batchObject = this.right
|
|
246
246
|
? {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
left: leftSelect,
|
|
248
|
+
rights: [rightSelect],
|
|
249
|
+
assignmentLines: [assignmentLine],
|
|
250
|
+
}
|
|
251
251
|
: {
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
252
|
+
left: leftSelect,
|
|
253
|
+
rights: [],
|
|
254
|
+
assignmentLines: [],
|
|
255
|
+
};
|
|
256
256
|
const batchAssignment = new BatchAssignment({
|
|
257
257
|
...batchObject,
|
|
258
258
|
offsetX: this.offsetX,
|
|
@@ -304,11 +304,29 @@ export class Assignment extends LogicItem {
|
|
|
304
304
|
code += this.left ? this.left.toJS(shiftState(state, code, { inline: true })) : '';
|
|
305
305
|
if (this.right) {
|
|
306
306
|
code += ' = ';
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
307
|
+
let isNaslNumber = false;
|
|
308
|
+
let consName = '';
|
|
309
|
+
let typeAnnotation = (this.right as any)?.typeAnnotation;
|
|
310
|
+
if (typeAnnotation) {
|
|
311
|
+
let { typeKind, typeName, typeNamespace } = typeAnnotation;
|
|
312
|
+
if (typeNamespace === 'nasl.core' && typeKind === 'primitive' && ['Long', 'Decimal'].includes(typeName)) {
|
|
313
|
+
isNaslNumber = true;
|
|
314
|
+
consName = `Nasl${typeName}`;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (isNaslNumber) {
|
|
318
|
+
code += `new ${consName}(${this.right.toJS(
|
|
319
|
+
shiftState(state, code, {
|
|
320
|
+
inline: true,
|
|
321
|
+
}),
|
|
322
|
+
)})`;
|
|
323
|
+
} else {
|
|
324
|
+
code += this.right.toJS(
|
|
325
|
+
shiftState(state, code, {
|
|
326
|
+
inline: true,
|
|
327
|
+
}),
|
|
328
|
+
);
|
|
329
|
+
}
|
|
312
330
|
}
|
|
313
331
|
return code;
|
|
314
332
|
}
|
|
@@ -20,7 +20,7 @@ function tryJSONParse(str: string) {
|
|
|
20
20
|
|
|
21
21
|
try {
|
|
22
22
|
result = JSON.parse(str);
|
|
23
|
-
} catch (e) {
|
|
23
|
+
} catch (e) {}
|
|
24
24
|
|
|
25
25
|
return result;
|
|
26
26
|
}
|
|
@@ -284,6 +284,8 @@ export class BackendVariable extends BaseNode {
|
|
|
284
284
|
const { defaultValue } = this;
|
|
285
285
|
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
286
286
|
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
287
|
+
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
288
|
+
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
287
289
|
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
288
290
|
let parsedValue = defaultValue ?? undefined;
|
|
289
291
|
if (
|
|
@@ -297,10 +299,27 @@ export class BackendVariable extends BaseNode {
|
|
|
297
299
|
if ([''].includes(defaultValue)) {
|
|
298
300
|
parsedValue = undefined;
|
|
299
301
|
} else {
|
|
300
|
-
|
|
302
|
+
function parseNumberValue(defaultValue: any, typeAnnotation: any) {
|
|
303
|
+
const { typeKind, typeName } = typeAnnotation;
|
|
304
|
+
const isNaslNumber = typeKind === 'primitive' && ['Decimal', 'Long', 'Double', 'Int'].includes(typeName);
|
|
305
|
+
if (isNaslNumber) {
|
|
306
|
+
return String(defaultValue);
|
|
307
|
+
} else {
|
|
308
|
+
return tryJSONParse(defaultValue) ?? defaultValue;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
parsedValue = parseNumberValue(defaultValue, typeAnnotation);
|
|
301
312
|
}
|
|
302
313
|
}
|
|
303
|
-
|
|
314
|
+
if (isDecimal) {
|
|
315
|
+
parsedValue = `new NaslDecimal('${defaultValue}')`;
|
|
316
|
+
code += `${parsedValue}`;
|
|
317
|
+
} else if (isInteger) {
|
|
318
|
+
parsedValue = `new NaslLong('${defaultValue}')`;
|
|
319
|
+
code += `${parsedValue}`;
|
|
320
|
+
} else {
|
|
321
|
+
code += `${JSON.stringify(parsedValue)}`;
|
|
322
|
+
}
|
|
304
323
|
if (needGenInitFromSchema) {
|
|
305
324
|
code += `)`;
|
|
306
325
|
}
|
|
@@ -10,6 +10,24 @@ import {
|
|
|
10
10
|
} from '../translator';
|
|
11
11
|
import { ElementToVueOptions } from './ViewElement__';
|
|
12
12
|
|
|
13
|
+
const operatorMap = {
|
|
14
|
+
'&&': 'and',
|
|
15
|
+
'||': 'or',
|
|
16
|
+
'+': 'add',
|
|
17
|
+
'-': 'minus',
|
|
18
|
+
'*': 'multiply',
|
|
19
|
+
'/': 'divide',
|
|
20
|
+
'%': 'remainder',
|
|
21
|
+
// '==': 'equal',
|
|
22
|
+
// '!=': 'notEqual',
|
|
23
|
+
'==': 'isEqual',
|
|
24
|
+
'!=': 'isNotEqual',
|
|
25
|
+
'>': 'greaterThan',
|
|
26
|
+
'<': 'lessThan',
|
|
27
|
+
'>=': 'greaterThanOrEqual',
|
|
28
|
+
'<=': 'lessThanOrEqual',
|
|
29
|
+
};
|
|
30
|
+
|
|
13
31
|
//================================================================================
|
|
14
32
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
15
33
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -322,22 +340,25 @@ export class BinaryExpression extends LogicItem {
|
|
|
322
340
|
// code += right;
|
|
323
341
|
// code += ')';
|
|
324
342
|
// return code;
|
|
325
|
-
|
|
326
|
-
if (['+', '-', '*', '/'].includes(this.operator)) {
|
|
327
|
-
const operatorMap: any = {
|
|
328
|
-
'+': 'add',
|
|
329
|
-
'-': 'minus',
|
|
330
|
-
'*': 'multiply',
|
|
331
|
-
'/': 'divide',
|
|
332
|
-
};
|
|
343
|
+
const getOperatorCode = (code: string) => {
|
|
333
344
|
code += `this.$global.${operatorMap[this.operator as keyof typeof operatorMap]}(`;
|
|
334
345
|
code += left;
|
|
335
346
|
code += `,`;
|
|
336
347
|
code += right;
|
|
337
348
|
code += ')';
|
|
338
349
|
return code;
|
|
350
|
+
};
|
|
351
|
+
if (['+', '-', '*', '/', '%'].includes(this.operator)) {
|
|
352
|
+
// 之前一年都没有 % 取模 操作符的处理 本次补上
|
|
353
|
+
// code += `this.$global.${operatorMap[this.operator as keyof typeof operatorMap]}(`;
|
|
354
|
+
// code += left;
|
|
355
|
+
// code += `,`;
|
|
356
|
+
// code += right;
|
|
357
|
+
// code += ')';
|
|
358
|
+
// return code
|
|
359
|
+
return getOperatorCode(code);
|
|
339
360
|
}
|
|
340
|
-
if (['>', '>=', '<', '<='].includes(this.operator)) {
|
|
361
|
+
if (['>', '>=', '<', '<=', '=='].includes(this.operator)) {
|
|
341
362
|
const leftType = this.left?.getCurrentAnnotatedJSON();
|
|
342
363
|
const rightType = this.right?.getCurrentAnnotatedJSON();
|
|
343
364
|
// 如果两边类型一致可以做一些特殊比较
|
|
@@ -350,15 +371,20 @@ export class BinaryExpression extends LogicItem {
|
|
|
350
371
|
code += `Date.parse(${left})`;
|
|
351
372
|
code += ` ${this.operator} `;
|
|
352
373
|
code += `Date.parse(${right})`;
|
|
374
|
+
} else {
|
|
375
|
+
// code += `(${left})`;
|
|
376
|
+
// code += ` ${this.operator} `;
|
|
377
|
+
// code += `(${right})`;
|
|
378
|
+
code = getOperatorCode(code);
|
|
379
|
+
}
|
|
380
|
+
} else {
|
|
381
|
+
if (['==', '!='].includes(this.operator)) {
|
|
382
|
+
code = getOperatorCode(code);
|
|
353
383
|
} else {
|
|
354
384
|
code += `(${left})`;
|
|
355
385
|
code += ` ${this.operator} `;
|
|
356
386
|
code += `(${right})`;
|
|
357
387
|
}
|
|
358
|
-
} else {
|
|
359
|
-
code += `(${left})`;
|
|
360
|
-
code += ` ${this.operator} `;
|
|
361
|
-
code += `(${right})`;
|
|
362
388
|
}
|
|
363
389
|
|
|
364
390
|
return code;
|
|
@@ -743,8 +743,8 @@ export class CallLogic extends LogicItem {
|
|
|
743
743
|
code += '$global.';
|
|
744
744
|
}
|
|
745
745
|
const { completeArguments } = this;
|
|
746
|
-
|
|
747
746
|
if (this.concept === 'CallLogic' && this.getAncestor('BindAttribute')?.name === 'data-source') {
|
|
747
|
+
let code = '';
|
|
748
748
|
if (this.calleeNamespace) {
|
|
749
749
|
const currentElement = this.getAncestor('ViewElement') as ViewElement;
|
|
750
750
|
code += `__${currentElement.name}_dataSourceLoad`;
|
|
@@ -755,15 +755,15 @@ export class CallLogic extends LogicItem {
|
|
|
755
755
|
return code;
|
|
756
756
|
}
|
|
757
757
|
} else {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
758
|
+
code += this.calleeName;
|
|
759
|
+
code += '(';
|
|
760
|
+
completeArguments.forEach((arg, index) => {
|
|
761
|
+
code += arg?.toVue(options);
|
|
762
|
+
if (index !== completeArguments.length - 1) code += ', ';
|
|
763
|
+
});
|
|
764
|
+
code += ')';
|
|
765
|
+
return code;
|
|
764
766
|
}
|
|
765
|
-
code += ')';
|
|
766
|
-
return code;
|
|
767
767
|
}
|
|
768
768
|
|
|
769
769
|
toUI(state?: TranslatorState): string {
|
|
@@ -1211,9 +1211,13 @@ export class CallLogic extends LogicItem {
|
|
|
1211
1211
|
code += `>`;
|
|
1212
1212
|
}
|
|
1213
1213
|
};
|
|
1214
|
+
const currThis = this;
|
|
1214
1215
|
/** 设置输入参数 */
|
|
1215
1216
|
const setInputParam = function* setTypeArguments() {
|
|
1216
1217
|
const paramRequired = ['showMessage', 'consoleLog', 'jsonDeserialize', 'jsonSerialize'].includes(calleeName);
|
|
1218
|
+
if (['expression'].includes(parentKey) && currThis.getAncestor('BindAttribute')?.name === 'data-source' && (state as any)?.noNeedParams) {
|
|
1219
|
+
return;
|
|
1220
|
+
}
|
|
1217
1221
|
if (
|
|
1218
1222
|
(tsCalleeNamespace.startsWith('elements') && tsCalleeNamespace.endsWith('logics')) ||
|
|
1219
1223
|
tsCalleeNamespace.startsWith('nasl.')
|
|
@@ -1227,13 +1231,6 @@ export class CallLogic extends LogicItem {
|
|
|
1227
1231
|
});
|
|
1228
1232
|
code += ')';
|
|
1229
1233
|
} else if (completeArguments.length) {
|
|
1230
|
-
if (
|
|
1231
|
-
['expression'].includes(parentKey) &&
|
|
1232
|
-
self.getAncestor('BindAttribute')?.name === 'data-source' &&
|
|
1233
|
-
(state as any)?.noNeedParams
|
|
1234
|
-
) {
|
|
1235
|
-
return;
|
|
1236
|
-
}
|
|
1237
1234
|
code += '(';
|
|
1238
1235
|
yield *
|
|
1239
1236
|
wrapForEach(completeArguments, function* warpForEachGenerator(arg, index) {
|
|
@@ -1243,13 +1240,6 @@ export class CallLogic extends LogicItem {
|
|
|
1243
1240
|
});
|
|
1244
1241
|
code += ')';
|
|
1245
1242
|
} else {
|
|
1246
|
-
if (
|
|
1247
|
-
['expression'].includes(parentKey) &&
|
|
1248
|
-
self.getAncestor('BindAttribute')?.name === 'data-source' &&
|
|
1249
|
-
(state as any)?.noNeedParams
|
|
1250
|
-
) {
|
|
1251
|
-
return;
|
|
1252
|
-
}
|
|
1253
1243
|
if (completeArguments.length) {
|
|
1254
1244
|
code += '(';
|
|
1255
1245
|
yield *
|
|
@@ -0,0 +1,77 @@
|
|
|
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 CountersignPolicy extends MultiApprovalPolicy {
|
|
20
|
+
/** 类名 */
|
|
21
|
+
static readonly ConceptName = 'CountersignPolicy';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* 产品概念
|
|
25
|
+
*/
|
|
26
|
+
@property('concept')
|
|
27
|
+
// @ts-ignore
|
|
28
|
+
readonly concept!: 'CountersignPolicy';
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* passPercent
|
|
32
|
+
*/
|
|
33
|
+
@property()
|
|
34
|
+
// @ts-ignore
|
|
35
|
+
passPercent!: number;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @param source 需要合并的部分参数
|
|
39
|
+
*/
|
|
40
|
+
constructor(source?: Partial<CountersignPolicy>) {
|
|
41
|
+
source = Object.assign({}, CountersignPolicy.getDefaultOptions(), source);
|
|
42
|
+
super(source);
|
|
43
|
+
super.subConstructor(source);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static from(source: any, parentNode?: any, parentKey?: string): CountersignPolicy {
|
|
47
|
+
return super.from(source, parentNode, parentKey) as CountersignPolicy;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* 设置passPercent
|
|
52
|
+
*/
|
|
53
|
+
setPassPercent(passPercent: number) {
|
|
54
|
+
const object = {
|
|
55
|
+
passPercent,
|
|
56
|
+
};
|
|
57
|
+
this.update({
|
|
58
|
+
...object,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
//================================================================================
|
|
63
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
64
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
65
|
+
//================================================================================
|
|
66
|
+
|
|
67
|
+
//================================================================================
|
|
68
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
69
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
70
|
+
//================================================================================
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default CountersignPolicy;
|
|
74
|
+
//================================================================================
|
|
75
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
76
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
77
|
+
//================================================================================
|
|
@@ -593,43 +593,34 @@ export class ForEachStatement extends LogicItem {
|
|
|
593
593
|
|
|
594
594
|
@withSourceMap()
|
|
595
595
|
toNaturalTS(state = createCompilerState()): string {
|
|
596
|
-
let code = '';
|
|
596
|
+
let code = 'ForEach(';
|
|
597
597
|
code += this.each
|
|
598
|
-
? this.each
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
598
|
+
? this.each?.toNaturalTS(
|
|
599
|
+
shiftState(state, code, {
|
|
600
|
+
tabSize: 0,
|
|
601
|
+
}),
|
|
602
|
+
)
|
|
603
603
|
: '__IDENTIFIER__';
|
|
604
|
-
if (['NewList', 'NewMap'].includes(this.each?.concept)) code += '\n';
|
|
605
|
-
code += '.__slice(';
|
|
606
|
-
code += this.start ? this.start.toNaturalTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
607
604
|
code += ', ';
|
|
608
|
-
|
|
609
|
-
if (!virtualEnd && this.each) {
|
|
610
|
-
// if (['List', 'String', 'Email', 'Text', 'Map'].includes(this.each.__TypeAnnotation?.typeName)) {
|
|
611
|
-
virtualEnd = new MemberExpression({
|
|
612
|
-
object: BaseNode.from({ ...this.each.toJSON(), name: this.each.name }) as LogicItem,
|
|
613
|
-
property: new Identifier({ name: 'length' }),
|
|
614
|
-
});
|
|
615
|
-
// }
|
|
616
|
-
}
|
|
617
|
-
code += virtualEnd ? virtualEnd.toNaturalTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
618
|
-
code += ').__forEach((';
|
|
619
|
-
code += this.item ? this.item.toNaturalTS(shiftState(state, code), true) : '__IDENTIFIER__';
|
|
605
|
+
code += this.start ? this.start?.toNaturalTS(shiftState(state, code, { tabSize: 0 })) : '__IDENTIFIER__';
|
|
620
606
|
code += ', ';
|
|
621
|
-
code += this.
|
|
622
|
-
code += '
|
|
607
|
+
code += this.end ? this.end?.toNaturalTS(shiftState(state, code, { tabSize: 0 })) : '__IDENTIFIER__';
|
|
608
|
+
code += ', (';
|
|
609
|
+
code += this.item ? this.item?.toNaturalTS(shiftState(state, code, { tabSize: 0 }), true) : '__IDENTIFIER__';
|
|
610
|
+
code += ', ';
|
|
611
|
+
code += this.index ? this.index?.toNaturalTS(shiftState(state, code, { tabSize: 0 }), true) : '__IDENTIFIER__';
|
|
612
|
+
code += ') => {\n ';
|
|
613
|
+
|
|
623
614
|
if (Array.isArray(this.body)) {
|
|
624
615
|
this.body.forEach((logicItem) => {
|
|
625
|
-
code += `${logicItem
|
|
616
|
+
code += `${logicItem?.toNaturalTS(
|
|
626
617
|
shiftState(state, code, {
|
|
627
618
|
tabSize: (state?.tabSize || 0) + 1,
|
|
628
619
|
}),
|
|
629
620
|
)};\n`;
|
|
630
621
|
});
|
|
631
|
-
if (state
|
|
632
|
-
code += `${indent(state
|
|
622
|
+
if (state?.focusedNodePath === `${this?.nodePath}.body[${this.body?.length}]`)
|
|
623
|
+
code += `${indent(state?.tabSize + 1)}// 当前位置\n`;
|
|
633
624
|
}
|
|
634
625
|
code += `${indent(state?.tabSize || 0)}})\n`;
|
|
635
626
|
|
|
@@ -90,6 +90,9 @@ export class Identifier extends LogicItem {
|
|
|
90
90
|
toVue(options?: ElementToVueOptions): string {
|
|
91
91
|
let { name } = this;
|
|
92
92
|
const { namespace } = this;
|
|
93
|
+
if (this?.parentNode?.parentKey === 'bindAttrs' && ["decimalLength", "decimal-length"].includes(this?.parentNode?.name) && name === 'undefined') {
|
|
94
|
+
name = undefined
|
|
95
|
+
}
|
|
93
96
|
if (namespace) {
|
|
94
97
|
if (
|
|
95
98
|
this.namespace.endsWith('nasl.browser') ||
|
|
@@ -209,7 +212,7 @@ export class Identifier extends LogicItem {
|
|
|
209
212
|
*toEmbeddedTS(state = createCompilerState(), options?: any): TranslatorGenerator {
|
|
210
213
|
const self = this;
|
|
211
214
|
// new实体,连线修改实体字段,无法同步到new实体的字段上,因为解构赋值后的property查找不回去,所以改成obj.
|
|
212
|
-
if (options?.isNewcomposite)
|
|
215
|
+
if (options?.isNewcomposite){
|
|
213
216
|
return `__obj.${this.name}`;
|
|
214
217
|
}
|
|
215
218
|
// 只有data-source可以是函数 ,也可能是属性
|
|
@@ -83,8 +83,66 @@ export class JSBlock extends LogicItem {
|
|
|
83
83
|
/**
|
|
84
84
|
* 生成 JS 脚本
|
|
85
85
|
*/
|
|
86
|
+
let boxVariablesCode = '\n';
|
|
87
|
+
let logicVariableList: any[] = [];
|
|
88
|
+
let viewVariableList: any[] = [];
|
|
89
|
+
let currentLogic = this.logic;
|
|
90
|
+
let currentView;
|
|
91
|
+
if (currentLogic) {
|
|
92
|
+
// logic能使用的所有变量: View.variables params Logic.variables params returns
|
|
93
|
+
let { variables, params, returns } = currentLogic;
|
|
94
|
+
logicVariableList = [...variables, ...params, ...returns];
|
|
95
|
+
currentView = currentLogic.view;
|
|
96
|
+
if (currentView) {
|
|
97
|
+
let { variables, params } = currentView;
|
|
98
|
+
viewVariableList = [...variables, ...params];
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const getBoxCode = (variable: any, context?: string) => {
|
|
102
|
+
let boxClass = '';
|
|
103
|
+
const defaultValue = variable.defaultValue;
|
|
104
|
+
const typeAnnotation = variable?.typeAnnotation || variable?.__TypeAnnotation;
|
|
105
|
+
if (typeAnnotation) {
|
|
106
|
+
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
107
|
+
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
108
|
+
|
|
109
|
+
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
110
|
+
let parsedValue = defaultValue ?? undefined;
|
|
111
|
+
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
112
|
+
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
113
|
+
// typeKind: 'union'
|
|
114
|
+
// typeName: 'Union'
|
|
115
|
+
// typeKey: 'nasl.core.Long | nasl.core.Decimal'
|
|
116
|
+
if (isInteger) {
|
|
117
|
+
boxClass = 'NaslLong';
|
|
118
|
+
}
|
|
119
|
+
if (isDecimal) {
|
|
120
|
+
boxClass = 'NaslDecimal';
|
|
121
|
+
}
|
|
122
|
+
if (!isInteger && !isDecimal) {
|
|
123
|
+
// 不是数值类型就不用做box转换 但是有可能 字符串类型被代码块使用并强行赋值 这个情况暂时不考虑
|
|
124
|
+
return '';
|
|
125
|
+
}
|
|
126
|
+
let variableName = context ? `${context}.${variable.name}` : variable.name;
|
|
127
|
+
return `${variableName} = new ${boxClass}(${variableName});`;
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
logicVariableList.map((variable) => {
|
|
131
|
+
let variableCode = getBoxCode(variable);
|
|
132
|
+
if (variableCode && variableCode?.length > 0) {
|
|
133
|
+
boxVariablesCode += `${variableCode}\n`;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
viewVariableList.map((variable) => {
|
|
137
|
+
let variableCode = getBoxCode(variable, 'this');
|
|
138
|
+
if (variableCode && variableCode?.length > 0) {
|
|
139
|
+
boxVariablesCode += `${variableCode}\n`;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
|
|
86
143
|
return `await (async () => {
|
|
87
144
|
${this.code}
|
|
145
|
+
${boxVariablesCode}
|
|
88
146
|
})();`;
|
|
89
147
|
}
|
|
90
148
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { runGeneratorSync as runSync } from '../utils/time-slicing';
|
|
2
2
|
import {
|
|
3
3
|
TranslatorState,
|
|
4
4
|
createCompilerState,
|
|
@@ -342,7 +342,7 @@ export class LogicItem extends BaseNode {
|
|
|
342
342
|
* @returns 生成的代码
|
|
343
343
|
*/
|
|
344
344
|
toNaturalTS(state = createCompilerState()): string {
|
|
345
|
-
return this.
|
|
345
|
+
return runSync(this.toEmbeddedTS(state));
|
|
346
346
|
}
|
|
347
347
|
|
|
348
348
|
delete() {
|
package/src/concepts/Logic__.ts
CHANGED
|
@@ -2108,6 +2108,7 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2108
2108
|
if ($1.includes(`,${variable},`)) fnCode = $1.replaceAll(`,${variable},`, `,${replaceCode},`);
|
|
2109
2109
|
if ($1.includes(`,${variable}.`)) fnCode = $1.replaceAll(`,${variable}.`, `,${replaceCode}.`);
|
|
2110
2110
|
if ($1.includes(`,${variable})`)) fnCode = $1.replaceAll(`,${variable})`, `,${replaceCode})`);
|
|
2111
|
+
if ($1.includes(`...[${variable}.`)) fnCode = $1.replaceAll(`...[${variable}.`, `...[${replaceCode}.`);
|
|
2111
2112
|
return fnCode;
|
|
2112
2113
|
});
|
|
2113
2114
|
}
|
package/src/concepts/Match__.ts
CHANGED
|
@@ -775,7 +775,7 @@ export class Match extends LogicItem {
|
|
|
775
775
|
code += item.toNaturalTS(shiftState(state, code, { tabSize: state.tabSize + 1 }), index, parentCode);
|
|
776
776
|
});
|
|
777
777
|
code += indent(state.tabSize);
|
|
778
|
-
code += `})(${this.expression
|
|
778
|
+
code += `})(${this.expression?.toNaturalTS(shiftState(state, code, { inline: true }))})`;
|
|
779
779
|
|
|
780
780
|
if (
|
|
781
781
|
this.parentNode?.concept !== 'Argument' &&
|
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
|
|
12
|
+
/**
|
|
13
|
+
* 多人审批任务
|
|
14
|
+
*/
|
|
15
|
+
@className
|
|
16
|
+
@concept('多人审批任务')
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
export class MultiApprovalPolicy extends BaseNode {
|
|
19
|
+
/** 类名 */
|
|
20
|
+
static readonly ConceptName = 'MultiApprovalPolicy';
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 产品概念
|
|
24
|
+
*/
|
|
25
|
+
@property('concept')
|
|
26
|
+
// @ts-ignore
|
|
27
|
+
readonly concept!: 'MultiApprovalPolicy' | 'SequentialPolicy' | 'CountersignPolicy';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* @param source 需要合并的部分参数
|
|
31
|
+
*/
|
|
32
|
+
constructor(source?: Partial<MultiApprovalPolicy>) {
|
|
33
|
+
source = Object.assign({}, MultiApprovalPolicy.getDefaultOptions(), source);
|
|
34
|
+
super(source);
|
|
35
|
+
super.subConstructor(source);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
static from(source: any, parentNode?: any, parentKey?: string): MultiApprovalPolicy {
|
|
39
|
+
return super.from(source, parentNode, parentKey) as MultiApprovalPolicy;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* 从父级删除该节点
|
|
44
|
+
* @internal
|
|
45
|
+
*/
|
|
46
|
+
_delete() {
|
|
47
|
+
let params: Params = null;
|
|
48
|
+
if (this.parentNode) {
|
|
49
|
+
params = (this.parentNode as any)?.__removeMultiApprovalPolicy?.(this);
|
|
50
|
+
}
|
|
51
|
+
return params;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
//================================================================================
|
|
55
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
56
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
57
|
+
//================================================================================
|
|
58
|
+
|
|
59
|
+
//================================================================================
|
|
60
|
+
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
61
|
+
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
62
|
+
//================================================================================
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export default MultiApprovalPolicy;
|
|
66
|
+
//================================================================================
|
|
67
|
+
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
68
|
+
// 自动生成的代码已结束。下面可以手动编写。
|
|
69
|
+
//================================================================================
|
|
@@ -1361,21 +1361,30 @@ export class NewComposite extends LogicItem {
|
|
|
1361
1361
|
});
|
|
1362
1362
|
code += right.members.length ? '\n' : '';
|
|
1363
1363
|
});
|
|
1364
|
-
//
|
|
1365
|
-
code += `${indent1}function __newComposite() {\n`;
|
|
1364
|
+
// 先把连线的变量定义出来,否则匿名数据结构属性名称与变量名称相同时会报错,
|
|
1366
1365
|
yield* wrapForEach(self.properties, function* warpForEachGenerator(property, index) {
|
|
1367
|
-
const temp = `temp${index}`;
|
|
1368
|
-
const propertyType = self.typeAnnotation.properties[index]?.typeAnnotation;
|
|
1366
|
+
const temp = `temp${index}__`;
|
|
1369
1367
|
const { name } = property;
|
|
1370
1368
|
const rightItem = nameMap.get(name);
|
|
1371
1369
|
const ts = rightMap.get(rightItem);
|
|
1372
1370
|
if (ts !== undefined) {
|
|
1373
1371
|
if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
|
|
1374
|
-
code += `${
|
|
1372
|
+
code += `${indent1}let ${temp}: void = null; \n`;
|
|
1375
1373
|
} else {
|
|
1376
|
-
code += `${
|
|
1374
|
+
code += `${indent1}let ${temp}${ts === 'null' ? ':void' : ''} = ${ts}; \n`;
|
|
1377
1375
|
}
|
|
1378
|
-
|
|
1376
|
+
}
|
|
1377
|
+
});
|
|
1378
|
+
// 方便ts报错检查
|
|
1379
|
+
code += `${indent1}function __newComposite() {\n`;
|
|
1380
|
+
yield* wrapForEach(self.properties, function* warpForEachGenerator(property, index) {
|
|
1381
|
+
const temp = `temp${index}__`;
|
|
1382
|
+
const propertyType = self.typeAnnotation.properties[index]?.typeAnnotation;
|
|
1383
|
+
const { name } = property;
|
|
1384
|
+
const rightItem = nameMap.get(name);
|
|
1385
|
+
const ts = rightMap.get(rightItem);
|
|
1386
|
+
if (ts !== undefined) {
|
|
1387
|
+
code += `${indent2}let `;
|
|
1379
1388
|
code += `${yield* property.toEmbeddedTS(shiftState(state, code, { inline: true }))}: `;
|
|
1380
1389
|
if (propertyType) {
|
|
1381
1390
|
const typeTs = yield* propertyType.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
@@ -1403,7 +1412,7 @@ export class NewComposite extends LogicItem {
|
|
|
1403
1412
|
yield* wrapForEach(self.properties, function* warpForEachGenerator(property) {
|
|
1404
1413
|
code += `${indent3}${property.name},\n`;
|
|
1405
1414
|
});
|
|
1406
|
-
code += `${indent3}__name: "
|
|
1415
|
+
code += `${indent3}__name: "AStructure_AAAAAAAA" as const,\n`;
|
|
1407
1416
|
code += `${indent2}}\n`;
|
|
1408
1417
|
code += `${indent1}};\n`;
|
|
1409
1418
|
code += `${indent1}return __newComposite();\n`;
|
|
@@ -1482,7 +1491,7 @@ export class NewComposite extends LogicItem {
|
|
|
1482
1491
|
this.properties.forEach((property) => {
|
|
1483
1492
|
code += `${indent4}${property.name},\n`;
|
|
1484
1493
|
});
|
|
1485
|
-
code += `${indent4}__name: "
|
|
1494
|
+
code += `${indent4}__name: "AStructure_AAAAAAAA" as const,\n`;
|
|
1486
1495
|
code += `${indent3}}\n`;
|
|
1487
1496
|
|
|
1488
1497
|
code += `${indent2}};\n`;
|