@lcap/nasl 3.3.2-beta.4 → 3.3.2-beta.5
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/coverage/index.html +108 -108
- 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 +183 -60
- 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 +1 -1
- 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 +1 -1
- 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 +92 -62
- package/coverage/src/common/Command.ts.html +1 -1
- package/coverage/src/common/EventEmitter.ts.html +1 -1
- package/coverage/src/common/Messager.ts.html +1 -1
- package/coverage/src/common/asyncFuncMap.ts.html +1 -1
- package/coverage/src/common/index.html +14 -14
- package/coverage/src/common/index.ts.html +1 -1
- package/coverage/src/concepts/Abort__.ts.html +9 -6
- package/coverage/src/concepts/Anchor__.ts.html +36 -21
- package/coverage/src/concepts/AnonymousFunction__.ts.html +62 -20
- package/coverage/src/concepts/App__.ts.html +917 -74
- package/coverage/src/concepts/Argument__.ts.html +41 -26
- package/coverage/src/concepts/Assignee__.ts.html +40 -13
- package/coverage/src/concepts/AssignmentLine__.ts.html +9 -6
- package/coverage/src/concepts/Assignment__.ts.html +61 -22
- package/coverage/src/concepts/Attribute__.ts.html +25 -10
- package/coverage/src/concepts/AuthInterface__.ts.html +9 -6
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +25 -10
- package/coverage/src/concepts/AuthLogic__.ts.html +18 -6
- package/coverage/src/concepts/BackendVariable__.ts.html +25 -10
- package/coverage/src/concepts/Backend__.ts.html +25 -10
- package/coverage/src/concepts/BatchAssignment__.ts.html +61 -16
- package/coverage/src/concepts/BinaryExpression__.ts.html +141 -39
- package/coverage/src/concepts/BindAttribute__.ts.html +134 -41
- package/coverage/src/concepts/BindDirective__.ts.html +79 -16
- package/coverage/src/concepts/BindEvent__.ts.html +80 -23
- package/coverage/src/concepts/BindStyle__.ts.html +25 -10
- package/coverage/src/concepts/BooleanLiteral__.ts.html +9 -6
- package/coverage/src/concepts/CallAuthInterface__.ts.html +25 -10
- package/coverage/src/concepts/CallConnector__.ts.html +9 -6
- package/coverage/src/concepts/CallFunction__.ts.html +56 -38
- package/coverage/src/concepts/CallInterface__.ts.html +81 -36
- package/coverage/src/concepts/CallLogic__.ts.html +195 -264
- package/coverage/src/concepts/CallQueryComponent__.ts.html +40 -13
- package/coverage/src/concepts/Comment__.ts.html +11 -8
- package/coverage/src/concepts/CompletionProperty__.ts.html +25 -10
- package/coverage/src/concepts/ConfigGroup__.ts.html +25 -10
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +9 -6
- package/coverage/src/concepts/ConfigProperty__.ts.html +25 -10
- package/coverage/src/concepts/Configuration__.ts.html +25 -10
- package/coverage/src/concepts/Connection__.ts.html +26 -11
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +9 -6
- package/coverage/src/concepts/Connector__.ts.html +85 -22
- package/coverage/src/concepts/Constant__.ts.html +25 -10
- package/coverage/src/concepts/DataSource__.ts.html +26 -11
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +9 -6
- package/coverage/src/concepts/Destination__.ts.html +24 -12
- package/coverage/src/concepts/End__.ts.html +9 -6
- package/coverage/src/concepts/EntityIndex__.ts.html +9 -6
- package/coverage/src/concepts/EntityProperty__.ts.html +62 -14
- package/coverage/src/concepts/Entity__.ts.html +41 -14
- package/coverage/src/concepts/EnumItem__.ts.html +9 -6
- package/coverage/src/concepts/Enum__.ts.html +25 -10
- package/coverage/src/concepts/Event__.ts.html +25 -10
- package/coverage/src/concepts/ExternalDestination__.ts.html +25 -10
- package/coverage/src/concepts/ForEachStatement__.ts.html +68 -47
- package/coverage/src/concepts/FrontendLibrary__.ts.html +40 -13
- package/coverage/src/concepts/FrontendVariable__.ts.html +1 -1
- package/coverage/src/concepts/Frontend__.ts.html +86 -23
- package/coverage/src/concepts/Function__.ts.html +92 -26
- package/coverage/src/concepts/Identifier__.ts.html +28 -25
- package/coverage/src/concepts/IfStatement__.ts.html +83 -56
- package/coverage/src/concepts/Integration__.ts.html +40 -13
- package/coverage/src/concepts/InterfaceParam__.ts.html +25 -10
- package/coverage/src/concepts/Interface__.ts.html +61 -22
- package/coverage/src/concepts/JSBlock__.ts.html +188 -8
- package/coverage/src/concepts/JavaLogic__.ts.html +9 -6
- package/coverage/src/concepts/LogicItem__.ts.html +15 -12
- package/coverage/src/concepts/Logic__.ts.html +117 -81
- package/coverage/src/concepts/MatchCase__.ts.html +100 -61
- package/coverage/src/concepts/Match__.ts.html +48 -27
- package/coverage/src/concepts/MemberExpression__.ts.html +72 -66
- package/coverage/src/concepts/MetadataType__.ts.html +1996 -0
- package/coverage/src/concepts/MicroApp__.ts.html +9 -6
- package/coverage/src/concepts/Module__.ts.html +672 -18
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +25 -10
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +25 -10
- package/coverage/src/concepts/Namespace__.ts.html +175 -40
- package/coverage/src/concepts/NewComposite__.ts.html +93 -27
- package/coverage/src/concepts/NewList__.ts.html +44 -14
- package/coverage/src/concepts/NewMap__.ts.html +44 -14
- package/coverage/src/concepts/New__.ts.html +1 -1
- package/coverage/src/concepts/NullLiteral__.ts.html +9 -6
- package/coverage/src/concepts/NumericLiteral__.ts.html +27 -12
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +103 -13
- package/coverage/src/concepts/OverriddenLogic__.ts.html +100 -25
- package/coverage/src/concepts/Param__.ts.html +24 -15
- package/coverage/src/concepts/Point__.ts.html +9 -6
- package/coverage/src/concepts/ProcessComponent__.ts.html +40 -13
- package/coverage/src/concepts/ProcessElement__.ts.html +128 -29
- package/coverage/src/concepts/ProcessOutcome__.ts.html +9 -6
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +9 -6
- package/coverage/src/concepts/Process__.ts.html +85 -22
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +9 -6
- package/coverage/src/concepts/QueryFromExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +25 -10
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +25 -10
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +25 -10
- package/coverage/src/concepts/Rect__.ts.html +9 -6
- package/coverage/src/concepts/Return__.ts.html +25 -10
- package/coverage/src/concepts/Role__.ts.html +9 -6
- package/coverage/src/concepts/SelectMembers__.ts.html +25 -10
- package/coverage/src/concepts/Slot__.ts.html +25 -10
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +25 -10
- package/coverage/src/concepts/Start__.ts.html +9 -6
- package/coverage/src/concepts/StringInterpolation__.ts.html +40 -19
- package/coverage/src/concepts/StringLiteral__.ts.html +9 -6
- package/coverage/src/concepts/StructureProperty__.ts.html +25 -10
- package/coverage/src/concepts/Structure__.ts.html +40 -13
- package/coverage/src/concepts/SwitchCase__.ts.html +33 -18
- package/coverage/src/concepts/SwitchStatement__.ts.html +38 -23
- package/coverage/src/concepts/Theme__.ts.html +9 -6
- package/coverage/src/concepts/Transactional__.ts.html +9 -6
- package/coverage/src/concepts/TriggerEvent__.ts.html +25 -10
- package/coverage/src/concepts/TriggerLauncher__.ts.html +9 -6
- package/coverage/src/concepts/TypeAnnotation__.ts.html +223 -61
- package/coverage/src/concepts/TypeParam__.ts.html +10 -7
- package/coverage/src/concepts/UnaryExpression__.ts.html +40 -13
- package/coverage/src/concepts/Unparsed__.ts.html +11 -8
- package/coverage/src/concepts/UseComponent__.ts.html +9 -6
- package/coverage/src/concepts/ValidationRule__.ts.html +30 -15
- package/coverage/src/concepts/Variable__.ts.html +61 -16
- package/coverage/src/concepts/ViewBlock__.ts.html +9 -6
- package/coverage/src/concepts/ViewComponent__.ts.html +99 -24
- package/coverage/src/concepts/ViewElement__.ts.html +334 -181
- package/coverage/src/concepts/View__.ts.html +326 -71
- package/coverage/src/concepts/WhileStatement__.ts.html +78 -45
- 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 +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +1 -1
- package/coverage/src/concepts/basics/types/coreTypeList.ts.html +1 -1
- package/coverage/src/concepts/basics/types/index.html +1 -1
- package/coverage/src/concepts/basics/types/index.ts.html +1 -1
- package/coverage/src/concepts/index.html +823 -808
- package/coverage/src/concepts/index.ts.html +1 -1
- package/coverage/src/concepts/index__.ts.html +7 -4
- package/coverage/src/config.ts.html +1 -1
- package/coverage/src/decorators/index.html +1 -1
- package/coverage/src/decorators/index.ts.html +24 -24
- package/coverage/src/decorators/promise.ts.html +1 -1
- package/coverage/src/eventBus.ts.html +1 -1
- package/coverage/src/generator/compileComponent.ts.html +1 -1
- package/coverage/src/generator/genBundleFiles.ts.html +13 -19
- package/coverage/src/generator/genHash.ts.html +1 -1
- package/coverage/src/generator/genMetaData.ts.html +103 -16
- package/coverage/src/generator/genReleaseBody.ts.html +1 -1
- 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 +4 -4
- 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 +78 -18
- package/coverage/src/sentry/index.html +1 -1
- package/coverage/src/sentry/index.ts.html +21 -21
- package/coverage/src/server/createUiTs.ts.html +15 -6
- package/coverage/src/server/entity2LogicNamespace.ts.html +1 -1
- package/coverage/src/server/event.js.html +1 -1
- package/coverage/src/server/extendBaseNode.ts.html +7 -4
- package/coverage/src/server/formatTsUtils.ts.html +1 -1
- 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 +161 -113
- 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 +25 -25
- package/coverage/src/server/index.ts.html +1 -1
- package/coverage/src/server/naslServer.ts.html +470 -59
- 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 +3 -3
- package/coverage/src/service/creator/add.configs.js.html +26 -8
- package/coverage/src/service/creator/errHandles.js.html +19 -37
- 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 +1498 -598
- package/coverage/src/service/storage/jsoner.ts.html +3 -3
- package/coverage/src/service/storage/map.ts.html +1 -1
- 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 +47 -56
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +49 -31
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +81 -93
- package/coverage/src/templator/genEditTableBlock.ts.html +80 -11
- 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 +66 -3
- package/coverage/src/templator/genUpdateBlock.ts.html +48 -36
- package/coverage/src/templator/index.html +39 -39
- package/coverage/src/templator/index.ts.html +1 -1
- package/coverage/src/templator/utils.ts.html +77 -11
- package/coverage/src/translator/constant.ts.html +1 -1
- package/coverage/src/translator/index.html +20 -20
- package/coverage/src/translator/index.ts.html +1 -1
- package/coverage/src/translator/utils.ts.html +87 -30
- package/coverage/src/utils/cookie.ts.html +1 -1
- package/coverage/src/utils/env.ts.html +1 -1
- package/coverage/src/utils/index.html +27 -27
- package/coverage/src/utils/index.ts.html +115 -22
- 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 +110 -8
- package/coverage/src/utils/time-slicing.ts.html +1 -1
- package/coverage/src/utils/traverse.ts.html +1 -1
- package/coverage/src/utils/window.ts.html +1 -1
- package/out/common/BaseNode.d.ts +1 -1
- package/out/common/BaseNode.js +6 -2
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/Abort__.js +3 -1
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.js +11 -4
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js +30 -11
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.js +147 -63
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +11 -4
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js +23 -9
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js +3 -1
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js +19 -6
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +11 -4
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/AuthInterface__.js +3 -1
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +12 -5
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.js +3 -1
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +11 -4
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.js +12 -5
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +32 -16
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +15 -8
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +21 -6
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +28 -5
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +20 -8
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +11 -4
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js +3 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.js +14 -5
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.js +3 -1
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.js +23 -12
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +15 -8
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +45 -26
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +19 -7
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js +3 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js +11 -4
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +12 -5
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js +3 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.js +12 -5
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +12 -5
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.js +12 -5
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.js +3 -1
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.js +48 -21
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.js +11 -4
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.js +12 -5
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js +3 -1
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.js +11 -4
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +3 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.js +3 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.js +19 -7
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +21 -9
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js +3 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js +11 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +12 -5
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js +11 -4
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +34 -24
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js +21 -9
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js +47 -20
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +47 -18
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +3 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +26 -17
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.js +20 -8
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +11 -4
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +27 -10
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +3 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.js +3 -1
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +4 -4
- package/out/concepts/LogicItem__.js +7 -5
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +68 -36
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +36 -24
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +23 -16
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +27 -20
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.js +3 -1
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.js +5 -3
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.js +12 -5
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.js +12 -5
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.js +102 -45
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.js +57 -25
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js +20 -8
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js +20 -8
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/NullLiteral__.js +3 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +11 -4
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +32 -5
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +52 -20
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +12 -5
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js +3 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js +21 -9
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +73 -31
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +3 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js +3 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js +48 -21
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +11 -4
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js +3 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js +11 -4
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js +11 -4
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +12 -5
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +11 -4
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +11 -4
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +12 -5
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js +3 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js +11 -4
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js +3 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +12 -5
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js +11 -4
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +11 -4
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js +3 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +12 -5
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js +3 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js +11 -4
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +21 -9
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +15 -8
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +11 -4
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js +3 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js +3 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TriggerEvent__.js +12 -5
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.js +3 -1
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +2 -1
- package/out/concepts/TypeAnnotation__.js +48 -15
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js +3 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js +17 -6
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js +3 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js +3 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +11 -4
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +11 -4
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.js +3 -1
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponent__.js +59 -25
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +51 -24
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +54 -22
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +20 -11
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +2 -2
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/generator/permission.js +32 -6
- package/out/generator/permission.js.map +1 -1
- package/out/sentry/index.js +2 -1
- package/out/sentry/index.js.map +1 -1
- package/out/server/translator.js +5 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -1
- package/out/service/storage/init.js +17 -5
- package/out/service/storage/init.js.map +1 -1
- package/out/utils/sortTsString.js +10 -4
- package/out/utils/sortTsString.js.map +1 -1
- package/package.json +1 -1
- package/src/common/BaseNode.ts +9 -4
- package/src/concepts/Abort__.ts +1 -0
- package/src/concepts/Anchor__.ts +20 -14
- package/src/concepts/AnonymousFunction__.ts +29 -12
- package/src/concepts/App__.ts +161 -76
- package/src/concepts/Argument__.ts +9 -3
- package/src/concepts/Assignee__.ts +21 -8
- package/src/concepts/AssignmentLine__.ts +1 -0
- package/src/concepts/Assignment__.ts +28 -14
- package/src/concepts/Attribute__.ts +9 -3
- package/src/concepts/AuthInterface__.ts +1 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +10 -4
- package/src/concepts/AuthLogic__.ts +4 -0
- package/src/concepts/BackendVariable__.ts +9 -3
- package/src/concepts/Backend__.ts +10 -4
- package/src/concepts/BatchAssignment__.ts +33 -16
- package/src/concepts/BinaryExpression__.ts +15 -9
- package/src/concepts/BindAttribute__.ts +35 -18
- package/src/concepts/BindDirective__.ts +26 -4
- package/src/concepts/BindEvent__.ts +37 -16
- package/src/concepts/BindStyle__.ts +9 -3
- package/src/concepts/BooleanLiteral__.ts +1 -0
- package/src/concepts/CallAuthInterface__.ts +12 -4
- package/src/concepts/CallConnector__.ts +1 -0
- package/src/concepts/CallFunction__.ts +25 -20
- package/src/concepts/CallInterface__.ts +44 -28
- package/src/concepts/CallLogic__.ts +80 -59
- package/src/concepts/CallQueryComponent__.ts +17 -6
- package/src/concepts/Comment__.ts +2 -1
- package/src/concepts/CompletionProperty__.ts +9 -3
- package/src/concepts/ConfigGroup__.ts +10 -4
- package/src/concepts/ConfigPropertyValue__.ts +1 -0
- package/src/concepts/ConfigProperty__.ts +10 -4
- package/src/concepts/Configuration__.ts +10 -4
- package/src/concepts/Connection__.ts +11 -5
- package/src/concepts/ConnectorTrigger__.ts +1 -0
- package/src/concepts/Connector__.ts +46 -20
- package/src/concepts/Constant__.ts +9 -3
- package/src/concepts/DataSource__.ts +10 -4
- package/src/concepts/DatabaseTypeAnnotation__.ts +1 -0
- package/src/concepts/Destination__.ts +9 -4
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/EntityIndex__.ts +1 -0
- package/src/concepts/EntityProperty__.ts +17 -6
- package/src/concepts/Entity__.ts +19 -8
- package/src/concepts/EnumItem__.ts +1 -0
- package/src/concepts/Enum__.ts +9 -3
- package/src/concepts/Event__.ts +10 -4
- package/src/concepts/ExternalDestination__.ts +9 -3
- package/src/concepts/ForEachStatement__.ts +45 -36
- package/src/concepts/FrontendLibrary__.ts +19 -8
- package/src/concepts/Frontend__.ts +45 -19
- package/src/concepts/Function__.ts +46 -19
- package/src/concepts/Identifier__.ts +1 -0
- package/src/concepts/IfStatement__.ts +30 -20
- package/src/concepts/Integration__.ts +18 -7
- package/src/concepts/InterfaceParam__.ts +9 -3
- package/src/concepts/Interface__.ts +31 -15
- package/src/concepts/JSBlock__.ts +1 -0
- package/src/concepts/JavaLogic__.ts +1 -0
- package/src/concepts/LogicItem__.ts +5 -4
- package/src/concepts/Logic__.ts +77 -59
- package/src/concepts/MatchCase__.ts +46 -31
- package/src/concepts/Match__.ts +24 -16
- package/src/concepts/MemberExpression__.ts +25 -19
- package/src/concepts/MicroApp__.ts +1 -0
- package/src/concepts/Module__.ts +10 -9
- package/src/concepts/MsgTriggerEvent__.ts +10 -4
- package/src/concepts/MsgTriggerLauncher__.ts +10 -4
- package/src/concepts/Namespace__.ts +100 -44
- package/src/concepts/NewComposite__.ts +60 -28
- package/src/concepts/NewList__.ts +20 -8
- package/src/concepts/NewMap__.ts +20 -8
- package/src/concepts/NullLiteral__.ts +1 -0
- package/src/concepts/NumericLiteral__.ts +9 -3
- package/src/concepts/OqlQueryComponent__.ts +32 -4
- package/src/concepts/OverriddenLogic__.ts +51 -20
- package/src/concepts/Param__.ts +10 -6
- package/src/concepts/Point__.ts +1 -0
- package/src/concepts/ProcessComponent__.ts +19 -8
- package/src/concepts/ProcessElement__.ts +71 -30
- package/src/concepts/ProcessOutcome__.ts +1 -0
- package/src/concepts/ProcessOutcomes__.ts +1 -0
- package/src/concepts/Process__.ts +46 -20
- package/src/concepts/QueryAggregateExpression__.ts +9 -3
- package/src/concepts/QueryFieldExpression__.ts +1 -0
- package/src/concepts/QueryFromExpression__.ts +9 -3
- package/src/concepts/QueryGroupByExpression__.ts +9 -3
- package/src/concepts/QueryJoinExpression__.ts +10 -4
- package/src/concepts/QueryLimitExpression__.ts +9 -3
- package/src/concepts/QueryOrderByExpression__.ts +9 -3
- package/src/concepts/QuerySelectExpression__.ts +10 -4
- package/src/concepts/Rect__.ts +1 -0
- package/src/concepts/Return__.ts +9 -3
- package/src/concepts/Role__.ts +1 -0
- package/src/concepts/SelectMembers__.ts +10 -4
- package/src/concepts/Slot__.ts +9 -3
- package/src/concepts/SqlQueryComponent__.ts +9 -3
- package/src/concepts/Start__.ts +1 -0
- package/src/concepts/StringInterpolation__.ts +11 -5
- package/src/concepts/StringLiteral__.ts +1 -0
- package/src/concepts/StructureProperty__.ts +9 -3
- package/src/concepts/Structure__.ts +19 -8
- package/src/concepts/SwitchCase__.ts +15 -9
- package/src/concepts/SwitchStatement__.ts +22 -16
- package/src/concepts/Theme__.ts +1 -0
- package/src/concepts/Transactional__.ts +1 -0
- package/src/concepts/TriggerEvent__.ts +10 -4
- package/src/concepts/TriggerLauncher__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +55 -21
- package/src/concepts/TypeParam__.ts +2 -1
- package/src/concepts/UnaryExpression__.ts +16 -6
- package/src/concepts/Unparsed__.ts +2 -1
- package/src/concepts/UseComponent__.ts +1 -0
- package/src/concepts/ValidationRule__.ts +10 -4
- package/src/concepts/Variable__.ts +9 -3
- package/src/concepts/ViewBlock__.ts +1 -0
- package/src/concepts/ViewComponent__.ts +57 -24
- package/src/concepts/ViewElement__.ts +148 -110
- package/src/concepts/View__.ts +100 -56
- package/src/concepts/WhileStatement__.ts +27 -15
- package/src/concepts/basics/stdlib/nasl.util.ts +2 -2
- package/src/generator/permission.ts +33 -9
- package/src/sentry/index.ts +3 -1
- package/src/server/translator.ts +5 -2
- package/src/service/storage/init.ts +17 -5
- package/src/utils/sortTsString.ts +9 -4
- package/test/concepts/call-function/__snapshots__/toEmbeddedTS.spec.ts.snap +26 -0
- package/test/concepts/call-function/__snapshots__/toJS.spec.ts.snap +26 -0
- package/test/concepts/call-function/constant.ts +5 -0
- package/test/concepts/call-function/fixtures/from-string.json +100 -0
- package/test/concepts/call-function/fixtures/to-string-global-tz.json +99 -0
- package/test/concepts/call-function/fixtures/to-string-no-tz.json +89 -0
- package/test/concepts/call-function/fixtures/to-string-user-tz.json +101 -0
- package/test/concepts/call-function/fixtures/to-string-utc-tz.json +101 -0
- package/test/concepts/call-function/toEmbeddedTS.spec.ts +14 -0
- package/test/concepts/call-function/toJS.spec.ts +14 -0
- package/.nyc_output/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +0 -1
- package/.nyc_output/processinfo/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +0 -1
- package/.nyc_output/processinfo/index.json +0 -1
|
@@ -26,6 +26,7 @@ export class Attribute extends BaseNode {
|
|
|
26
26
|
/**
|
|
27
27
|
* 产品概念
|
|
28
28
|
*/
|
|
29
|
+
@property('concept')
|
|
29
30
|
// @ts-ignore
|
|
30
31
|
readonly concept!: 'Attribute';
|
|
31
32
|
|
|
@@ -179,11 +180,16 @@ export class Attribute extends BaseNode {
|
|
|
179
180
|
};
|
|
180
181
|
if (parentKey) {
|
|
181
182
|
params.parentKey = parentKey;
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
// @ts-ignore
|
|
184
|
+
const t = this.__v_raw || this;
|
|
185
|
+
// @ts-ignore
|
|
186
|
+
const n = typeAnnotation.__v_raw || typeAnnotation;
|
|
187
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
188
|
+
// @ts-ignore
|
|
189
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
184
190
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
185
191
|
params.index = index;
|
|
186
|
-
} else if ((
|
|
192
|
+
} else if ((t as any)[parentKey] === n) {
|
|
187
193
|
params.index = 0;
|
|
188
194
|
(this as any)[parentKey] = undefined;
|
|
189
195
|
}
|
|
@@ -43,6 +43,7 @@ export class AuthLogicForCallInterface extends AuthLogic {
|
|
|
43
43
|
/**
|
|
44
44
|
* 产品概念
|
|
45
45
|
*/
|
|
46
|
+
@property('concept')
|
|
46
47
|
// @ts-ignore
|
|
47
48
|
readonly concept!: 'AuthLogicForCallInterface';
|
|
48
49
|
|
|
@@ -67,7 +68,7 @@ export class AuthLogicForCallInterface extends AuthLogic {
|
|
|
67
68
|
|
|
68
69
|
getParamExistingNames(excludedList: Array<Param> = []) {
|
|
69
70
|
const excludedSet = new Set(excludedList);
|
|
70
|
-
return ((this.authParams as Param[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
71
|
+
return ((this.authParams as Param[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
71
72
|
}
|
|
72
73
|
getParamUniqueName(name = 'param1') {
|
|
73
74
|
return utils.unique(name, this.getParamExistingNames(), undefined, false);
|
|
@@ -254,11 +255,16 @@ export class AuthLogicForCallInterface extends AuthLogic {
|
|
|
254
255
|
};
|
|
255
256
|
if (parentKey) {
|
|
256
257
|
params.parentKey = parentKey;
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
// @ts-ignore
|
|
259
|
+
const t = this.__v_raw || this;
|
|
260
|
+
// @ts-ignore
|
|
261
|
+
const n = param.__v_raw || param;
|
|
262
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
263
|
+
// @ts-ignore
|
|
264
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
259
265
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
260
266
|
params.index = index;
|
|
261
|
-
} else if ((
|
|
267
|
+
} else if ((t as any)[parentKey] === n) {
|
|
262
268
|
params.index = 0;
|
|
263
269
|
(this as any)[parentKey] = undefined;
|
|
264
270
|
}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
import { EventPayload, Params } from '../common/EventEmitter';
|
|
6
6
|
import { concept, excludedInJSON, property, className } from '../decorators';
|
|
7
7
|
|
|
8
|
+
import * as utils from '../utils';
|
|
9
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
+
import BaseNode from '../common/BaseNode';
|
|
8
11
|
import Module from './Module__';
|
|
9
12
|
import View from './View__';
|
|
10
13
|
import ProcessElement from './ProcessElement__';
|
|
@@ -26,6 +29,7 @@ export class AuthLogic extends Logic {
|
|
|
26
29
|
/**
|
|
27
30
|
* 产品概念
|
|
28
31
|
*/
|
|
32
|
+
@property('concept')
|
|
29
33
|
// @ts-ignore
|
|
30
34
|
readonly concept!: 'AuthLogic' | 'AuthLogicForCallInterface';
|
|
31
35
|
|
|
@@ -45,6 +45,7 @@ export class BackendVariable extends BaseNode {
|
|
|
45
45
|
/**
|
|
46
46
|
* 产品概念
|
|
47
47
|
*/
|
|
48
|
+
@property('concept')
|
|
48
49
|
// @ts-ignore
|
|
49
50
|
readonly concept!: 'BackendVariable';
|
|
50
51
|
|
|
@@ -223,11 +224,16 @@ export class BackendVariable extends BaseNode {
|
|
|
223
224
|
};
|
|
224
225
|
if (parentKey) {
|
|
225
226
|
params.parentKey = parentKey;
|
|
226
|
-
|
|
227
|
-
|
|
227
|
+
// @ts-ignore
|
|
228
|
+
const t = this.__v_raw || this;
|
|
229
|
+
// @ts-ignore
|
|
230
|
+
const n = typeAnnotation.__v_raw || typeAnnotation;
|
|
231
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
232
|
+
// @ts-ignore
|
|
233
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
228
234
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
229
235
|
params.index = index;
|
|
230
|
-
} else if ((
|
|
236
|
+
} else if ((t as any)[parentKey] === n) {
|
|
231
237
|
params.index = 0;
|
|
232
238
|
(this as any)[parentKey] = undefined;
|
|
233
239
|
}
|
|
@@ -27,6 +27,7 @@ export class Backend extends BaseNode {
|
|
|
27
27
|
/**
|
|
28
28
|
* 产品概念
|
|
29
29
|
*/
|
|
30
|
+
@property('concept')
|
|
30
31
|
// @ts-ignore
|
|
31
32
|
readonly concept!: 'Backend';
|
|
32
33
|
|
|
@@ -91,7 +92,7 @@ export class Backend extends BaseNode {
|
|
|
91
92
|
const excludedSet = new Set(excludedList);
|
|
92
93
|
return ((this.variables as BackendVariable[]) || [])
|
|
93
94
|
.filter((item) => !excludedSet.has(item))
|
|
94
|
-
.map((item) => item
|
|
95
|
+
.map((item) => item?.name);
|
|
95
96
|
}
|
|
96
97
|
getBackendVariableUniqueName(name = 'backendVariable1') {
|
|
97
98
|
return utils.unique(name, this.getVarExistingNames(), undefined, true);
|
|
@@ -278,11 +279,16 @@ export class Backend extends BaseNode {
|
|
|
278
279
|
};
|
|
279
280
|
if (parentKey) {
|
|
280
281
|
params.parentKey = parentKey;
|
|
281
|
-
|
|
282
|
-
|
|
282
|
+
// @ts-ignore
|
|
283
|
+
const t = this.__v_raw || this;
|
|
284
|
+
// @ts-ignore
|
|
285
|
+
const n = backendVariable.__v_raw || backendVariable;
|
|
286
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
287
|
+
// @ts-ignore
|
|
288
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
283
289
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
284
290
|
params.index = index;
|
|
285
|
-
} else if ((
|
|
291
|
+
} else if ((t as any)[parentKey] === n) {
|
|
286
292
|
params.index = 0;
|
|
287
293
|
(this as any)[parentKey] = undefined;
|
|
288
294
|
}
|
|
@@ -30,6 +30,7 @@ export class BatchAssignment extends LogicItem {
|
|
|
30
30
|
/**
|
|
31
31
|
* 产品概念
|
|
32
32
|
*/
|
|
33
|
+
@property('concept')
|
|
33
34
|
// @ts-ignore
|
|
34
35
|
readonly concept!: 'BatchAssignment';
|
|
35
36
|
|
|
@@ -130,7 +131,7 @@ export class BatchAssignment extends LogicItem {
|
|
|
130
131
|
|
|
131
132
|
getSelectMembersExistingNames(excludedList: Array<SelectMembers> = []) {
|
|
132
133
|
const excludedSet = new Set(excludedList);
|
|
133
|
-
return ((this.rights as SelectMembers[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
134
|
+
return ((this.rights as SelectMembers[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
134
135
|
}
|
|
135
136
|
getSelectMembersUniqueName(name = 'selectMembers1') {
|
|
136
137
|
return utils.unique(name, this.getSelectMembersExistingNames(), undefined, false);
|
|
@@ -285,7 +286,7 @@ export class BatchAssignment extends LogicItem {
|
|
|
285
286
|
const excludedSet = new Set(excludedList);
|
|
286
287
|
return ((this.assignmentLines as AssignmentLine[]) || [])
|
|
287
288
|
.filter((item) => !excludedSet.has(item))
|
|
288
|
-
.map((item) => item
|
|
289
|
+
.map((item) => item?.name);
|
|
289
290
|
}
|
|
290
291
|
getAssignmentLineUniqueName(name = 'assignmentLine1') {
|
|
291
292
|
return utils.unique(name, this.getAssignmentLineExistingNames(), undefined, false);
|
|
@@ -497,11 +498,16 @@ export class BatchAssignment extends LogicItem {
|
|
|
497
498
|
};
|
|
498
499
|
if (parentKey) {
|
|
499
500
|
params.parentKey = parentKey;
|
|
500
|
-
|
|
501
|
-
|
|
501
|
+
// @ts-ignore
|
|
502
|
+
const t = this.__v_raw || this;
|
|
503
|
+
// @ts-ignore
|
|
504
|
+
const n = selectMembers.__v_raw || selectMembers;
|
|
505
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
506
|
+
// @ts-ignore
|
|
507
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
502
508
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
503
509
|
params.index = index;
|
|
504
|
-
} else if ((
|
|
510
|
+
} else if ((t as any)[parentKey] === n) {
|
|
505
511
|
params.index = 0;
|
|
506
512
|
(this as any)[parentKey] = undefined;
|
|
507
513
|
}
|
|
@@ -545,11 +551,16 @@ export class BatchAssignment extends LogicItem {
|
|
|
545
551
|
};
|
|
546
552
|
if (parentKey) {
|
|
547
553
|
params.parentKey = parentKey;
|
|
548
|
-
|
|
549
|
-
|
|
554
|
+
// @ts-ignore
|
|
555
|
+
const t = this.__v_raw || this;
|
|
556
|
+
// @ts-ignore
|
|
557
|
+
const n = assignmentLine.__v_raw || assignmentLine;
|
|
558
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
559
|
+
// @ts-ignore
|
|
560
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
550
561
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
551
562
|
params.index = index;
|
|
552
|
-
} else if ((
|
|
563
|
+
} else if ((t as any)[parentKey] === n) {
|
|
553
564
|
params.index = 0;
|
|
554
565
|
(this as any)[parentKey] = undefined;
|
|
555
566
|
}
|
|
@@ -633,7 +644,7 @@ export class BatchAssignment extends LogicItem {
|
|
|
633
644
|
members.forEach((rightMember: any, rightSecondIndex: number) => {
|
|
634
645
|
const rightValue = rightMember.getValue();
|
|
635
646
|
const rightName = rightMember.property?.name;
|
|
636
|
-
if (rightLineSet.has(rightSecondIndex)) return;
|
|
647
|
+
if (rightLineSet.has(rightSecondIndex) || leftLineSet.has(leftSecondIndex)) return;
|
|
637
648
|
|
|
638
649
|
if (leftName === rightName && leftValue.split('.').length === rightValue.split('.').length) {
|
|
639
650
|
const rightTypeAnnotation = rightMember.__TypeAnnotation;
|
|
@@ -847,14 +858,14 @@ export class BatchAssignment extends LogicItem {
|
|
|
847
858
|
const [firstIndex, secondIndex] = [arrIndex[0], arrIndex[1]];
|
|
848
859
|
if (place === 'left') {
|
|
849
860
|
if (secondIndex === undefined) {
|
|
850
|
-
return this.left
|
|
861
|
+
return this.left?.expression;
|
|
851
862
|
}
|
|
852
|
-
return this.left
|
|
863
|
+
return this.left?.members?.[secondIndex];
|
|
853
864
|
}
|
|
854
865
|
if (secondIndex === undefined) {
|
|
855
|
-
return this.rights[firstIndex]
|
|
866
|
+
return this.rights?.[firstIndex]?.expression;
|
|
856
867
|
}
|
|
857
|
-
return this.rights[firstIndex]
|
|
868
|
+
return this.rights?.[firstIndex]?.members?.[secondIndex];
|
|
858
869
|
}
|
|
859
870
|
|
|
860
871
|
findlines(member: any, selectMember: any) {
|
|
@@ -1048,10 +1059,16 @@ export class BatchAssignment extends LogicItem {
|
|
|
1048
1059
|
let code = '';
|
|
1049
1060
|
// 根据连线状态,拆分成多个单赋值
|
|
1050
1061
|
this.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
|
|
1051
|
-
const leftValue =
|
|
1062
|
+
const leftValue =
|
|
1063
|
+
leftIndex.length === 1
|
|
1064
|
+
? this.left.expression.toNaturalTS(shiftState(state, code, { inline: true }))
|
|
1065
|
+
: this.left.members[leftIndex[1]]?.toNaturalTS(shiftState(state, code, { inline: true }));
|
|
1052
1066
|
code += `${leftValue}`;
|
|
1053
1067
|
code += ' = ';
|
|
1054
|
-
const rightValue =
|
|
1068
|
+
const rightValue =
|
|
1069
|
+
rightIndex.length === 1
|
|
1070
|
+
? this.rights[rightIndex[0]]?.expression?.toNaturalTS(shiftState(state, code, { inline: true }))
|
|
1071
|
+
: this.rights[rightIndex[0]]?.members[rightIndex[1]]?.toNaturalTS(shiftState(state, code, { inline: true }));
|
|
1055
1072
|
code += `${rightValue}`;
|
|
1056
1073
|
code += ';';
|
|
1057
1074
|
code += '\n';
|
|
@@ -1059,7 +1076,7 @@ export class BatchAssignment extends LogicItem {
|
|
|
1059
1076
|
return code;
|
|
1060
1077
|
}
|
|
1061
1078
|
|
|
1062
|
-
|
|
1079
|
+
//================================================================================
|
|
1063
1080
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
1064
1081
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
1065
1082
|
//================================================================================
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
2
1
|
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
3
2
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
3
|
|
|
@@ -10,6 +9,7 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
10
9
|
import { concept, excludedInJSON, property, className } from '../decorators';
|
|
11
10
|
|
|
12
11
|
import * as utils from '../utils';
|
|
12
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
13
13
|
import BaseNode from '../common/BaseNode';
|
|
14
14
|
import LogicItem from './LogicItem__';
|
|
15
15
|
|
|
@@ -26,6 +26,7 @@ export class BinaryExpression extends LogicItem {
|
|
|
26
26
|
/**
|
|
27
27
|
* 产品概念
|
|
28
28
|
*/
|
|
29
|
+
@property('concept')
|
|
29
30
|
// @ts-ignore
|
|
30
31
|
readonly concept!: 'BinaryExpression';
|
|
31
32
|
|
|
@@ -71,7 +72,7 @@ export class BinaryExpression extends LogicItem {
|
|
|
71
72
|
* @param source 需要合并的部分参数
|
|
72
73
|
*/
|
|
73
74
|
constructor(source?: Partial<BinaryExpression>) {
|
|
74
|
-
source = {
|
|
75
|
+
source = Object.assign({}, BinaryExpression.getDefaultOptions(), source);
|
|
75
76
|
super(source);
|
|
76
77
|
super.subConstructor(source);
|
|
77
78
|
}
|
|
@@ -158,7 +159,7 @@ export class BinaryExpression extends LogicItem {
|
|
|
158
159
|
if (typeof options === 'string') {
|
|
159
160
|
left = this.left;
|
|
160
161
|
if (!left) {
|
|
161
|
-
throw new Error(
|
|
162
|
+
throw new Error('找不到逻辑项 ' + options);
|
|
162
163
|
}
|
|
163
164
|
} else {
|
|
164
165
|
left = options;
|
|
@@ -183,7 +184,7 @@ export class BinaryExpression extends LogicItem {
|
|
|
183
184
|
if (typeof options === 'string') {
|
|
184
185
|
right = this.right;
|
|
185
186
|
if (!right) {
|
|
186
|
-
throw new Error(
|
|
187
|
+
throw new Error('找不到逻辑项 ' + options);
|
|
187
188
|
}
|
|
188
189
|
} else {
|
|
189
190
|
right = options;
|
|
@@ -192,7 +193,7 @@ export class BinaryExpression extends LogicItem {
|
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
__removeLogicItem(logicItem: LogicItem) {
|
|
195
|
-
const
|
|
196
|
+
const parentKey = logicItem.parentKey;
|
|
196
197
|
const params: Params = {
|
|
197
198
|
parentNode: this,
|
|
198
199
|
parentKey,
|
|
@@ -202,11 +203,16 @@ export class BinaryExpression extends LogicItem {
|
|
|
202
203
|
};
|
|
203
204
|
if (parentKey) {
|
|
204
205
|
params.parentKey = parentKey;
|
|
205
|
-
|
|
206
|
-
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
const t = this.__v_raw || this;
|
|
208
|
+
// @ts-ignore
|
|
209
|
+
const n = logicItem.__v_raw || logicItem;
|
|
210
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
211
|
+
// @ts-ignore
|
|
212
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
207
213
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
208
214
|
params.index = index;
|
|
209
|
-
} else if ((
|
|
215
|
+
} else if ((t as any)[parentKey] === n) {
|
|
210
216
|
params.index = 0;
|
|
211
217
|
(this as any)[parentKey] = undefined;
|
|
212
218
|
}
|
|
@@ -439,7 +445,7 @@ export class BinaryExpression extends LogicItem {
|
|
|
439
445
|
return code;
|
|
440
446
|
}
|
|
441
447
|
|
|
442
|
-
|
|
448
|
+
//================================================================================
|
|
443
449
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
444
450
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
445
451
|
//================================================================================
|
|
@@ -25,7 +25,6 @@ import Module from './Module__';
|
|
|
25
25
|
import App from './App__';
|
|
26
26
|
import Frontend from './Frontend__';
|
|
27
27
|
import Process from './Process__';
|
|
28
|
-
import Identifier from './Identifier__';
|
|
29
28
|
|
|
30
29
|
/**
|
|
31
30
|
* 元素绑定属性
|
|
@@ -40,6 +39,7 @@ export class BindAttribute extends BaseNode {
|
|
|
40
39
|
/**
|
|
41
40
|
* 产品概念
|
|
42
41
|
*/
|
|
42
|
+
@property('concept')
|
|
43
43
|
// @ts-ignore
|
|
44
44
|
readonly concept!: 'BindAttribute';
|
|
45
45
|
|
|
@@ -271,7 +271,7 @@ export class BindAttribute extends BaseNode {
|
|
|
271
271
|
|
|
272
272
|
getValidationRuleExistingNames(excludedList: Array<ValidationRule> = []) {
|
|
273
273
|
const excludedSet = new Set(excludedList);
|
|
274
|
-
return ((this.rules as ValidationRule[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
274
|
+
return ((this.rules as ValidationRule[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
275
275
|
}
|
|
276
276
|
getValidationRuleUniqueName(name = 'validationRule1') {
|
|
277
277
|
return utils.unique(name, this.getValidationRuleExistingNames(), undefined, false);
|
|
@@ -669,11 +669,16 @@ export class BindAttribute extends BaseNode {
|
|
|
669
669
|
};
|
|
670
670
|
if (parentKey) {
|
|
671
671
|
params.parentKey = parentKey;
|
|
672
|
-
|
|
673
|
-
|
|
672
|
+
// @ts-ignore
|
|
673
|
+
const t = this.__v_raw || this;
|
|
674
|
+
// @ts-ignore
|
|
675
|
+
const n = logicItem.__v_raw || logicItem;
|
|
676
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
677
|
+
// @ts-ignore
|
|
678
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
674
679
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
675
680
|
params.index = index;
|
|
676
|
-
} else if ((
|
|
681
|
+
} else if ((t as any)[parentKey] === n) {
|
|
677
682
|
params.index = 0;
|
|
678
683
|
(this as any)[parentKey] = undefined;
|
|
679
684
|
}
|
|
@@ -1088,22 +1093,25 @@ export class BindAttribute extends BaseNode {
|
|
|
1088
1093
|
return code;
|
|
1089
1094
|
}
|
|
1090
1095
|
|
|
1091
|
-
toEmbeddedTSVariableDefinition(
|
|
1096
|
+
toEmbeddedTSVariableDefinition(
|
|
1097
|
+
state?: TranslatorState,
|
|
1098
|
+
attrList?: string[],
|
|
1099
|
+
elementName?: string,
|
|
1100
|
+
currentLevel?: string,
|
|
1101
|
+
): string {
|
|
1092
1102
|
let code = '';
|
|
1093
1103
|
let arrCode = '';
|
|
1094
1104
|
code += indent((state?.tabSize || 0) + 3);
|
|
1095
1105
|
code += `${attrConvertCamelCase(this.name)}: `;
|
|
1096
1106
|
if (this.expression) {
|
|
1097
1107
|
if (this.name === 'data-source') {
|
|
1098
|
-
code += `ReturnType<typeof __elements_stashFunctionVariable.${elementName}_${attrConvertCamelCase(
|
|
1099
|
-
this.name,
|
|
1100
|
-
)}>`;
|
|
1108
|
+
code += `ReturnType<typeof __elements_stashFunctionVariable.${elementName}_${attrConvertCamelCase(this.name)}>`;
|
|
1101
1109
|
} else {
|
|
1102
1110
|
code += `ReturnType<typeof __elements_stashFunctionVariable.${elementName}_${attrConvertCamelCase(this.name)}>`;
|
|
1103
1111
|
}
|
|
1104
1112
|
arrCode = `() => {
|
|
1105
1113
|
return __elements_variable_function.${currentLevel}?.${attrConvertCamelCase(this.name)}?.()
|
|
1106
|
-
}
|
|
1114
|
+
}`;
|
|
1107
1115
|
} else if (this.name === 'sorting') {
|
|
1108
1116
|
code += `{
|
|
1109
1117
|
field: nasl.core.String
|
|
@@ -1144,24 +1152,34 @@ export class BindAttribute extends BaseNode {
|
|
|
1144
1152
|
} else {
|
|
1145
1153
|
stashVariable = `${this.expression.toEmbeddedTS()}`;
|
|
1146
1154
|
}
|
|
1147
|
-
code += `() => {\n
|
|
1155
|
+
code += `() => {\n`;
|
|
1148
1156
|
code += indent((state?.tabSize || 0) + 5);
|
|
1149
|
-
code += `return ${stashVariable}\n
|
|
1157
|
+
code += `return ${stashVariable}\n`;
|
|
1150
1158
|
code += indent((state?.tabSize || 0) + 4);
|
|
1151
|
-
code += `},\n
|
|
1159
|
+
code += `},\n`;
|
|
1152
1160
|
}
|
|
1153
1161
|
return code;
|
|
1154
1162
|
}
|
|
1155
1163
|
|
|
1156
1164
|
findCurrentElementParent(node: any): ViewElement | undefined {
|
|
1157
1165
|
if (node.parentNode instanceof ViewElement) {
|
|
1158
|
-
if (
|
|
1159
|
-
|
|
1166
|
+
if (
|
|
1167
|
+
[
|
|
1168
|
+
'u-table-view',
|
|
1169
|
+
'u-list-view',
|
|
1170
|
+
'u-grid-view',
|
|
1171
|
+
'u-list-components',
|
|
1172
|
+
'van-list-view',
|
|
1173
|
+
'van-grid-view',
|
|
1174
|
+
'van-for-components',
|
|
1175
|
+
].includes(node.parentNode.tag)
|
|
1176
|
+
) {
|
|
1177
|
+
return node.parentNode;
|
|
1160
1178
|
} else {
|
|
1161
|
-
return this.findCurrentElementParent(node.parentNode)
|
|
1179
|
+
return this.findCurrentElementParent(node.parentNode);
|
|
1162
1180
|
}
|
|
1163
1181
|
} else {
|
|
1164
|
-
return undefined
|
|
1182
|
+
return undefined;
|
|
1165
1183
|
}
|
|
1166
1184
|
}
|
|
1167
1185
|
@withSourceMap()
|
|
@@ -1247,4 +1265,3 @@ export function attrConvertCamelCase(str: string) {
|
|
|
1247
1265
|
});
|
|
1248
1266
|
return strList.join('');
|
|
1249
1267
|
}
|
|
1250
|
-
|
|
@@ -31,6 +31,7 @@ export class BindDirective extends BaseNode {
|
|
|
31
31
|
/**
|
|
32
32
|
* 产品概念
|
|
33
33
|
*/
|
|
34
|
+
@property('concept')
|
|
34
35
|
// @ts-ignore
|
|
35
36
|
readonly concept!: 'BindDirective';
|
|
36
37
|
|
|
@@ -306,11 +307,16 @@ export class BindDirective extends BaseNode {
|
|
|
306
307
|
};
|
|
307
308
|
if (parentKey) {
|
|
308
309
|
params.parentKey = parentKey;
|
|
309
|
-
|
|
310
|
-
|
|
310
|
+
// @ts-ignore
|
|
311
|
+
const t = this.__v_raw || this;
|
|
312
|
+
// @ts-ignore
|
|
313
|
+
const n = logicItem.__v_raw || logicItem;
|
|
314
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
315
|
+
// @ts-ignore
|
|
316
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
311
317
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
312
318
|
params.index = index;
|
|
313
|
-
} else if ((
|
|
319
|
+
} else if ((t as any)[parentKey] === n) {
|
|
314
320
|
params.index = 0;
|
|
315
321
|
(this as any)[parentKey] = undefined;
|
|
316
322
|
}
|
|
@@ -526,7 +532,21 @@ export class BindDirective extends BaseNode {
|
|
|
526
532
|
toVue(options?: ElementToVueOptions) {
|
|
527
533
|
let str = '';
|
|
528
534
|
// eslint-disable-next-line no-nested-ternary
|
|
529
|
-
let value =
|
|
535
|
+
let value = this.value;
|
|
536
|
+
if (this.type === 'string') {
|
|
537
|
+
value = value.replace(/['"`\\]/g, (m) => {
|
|
538
|
+
let escape = '\\\\';
|
|
539
|
+
escape = '\\\\';
|
|
540
|
+
/// #if process.env.BUILD_TARGET === 'node'
|
|
541
|
+
escape = '\\';
|
|
542
|
+
/// #endif
|
|
543
|
+
if (m === '\\') {
|
|
544
|
+
return `${escape}${escape}`;
|
|
545
|
+
}
|
|
546
|
+
return `${escape}${m}`;
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
value = (this.type ?? 'string') !== 'string' ? this.value : value ? `\`${value}\`` : '';
|
|
530
550
|
// 需要用标识符替换
|
|
531
551
|
// if (options.finalCode !== false && this.needReplaceWithIdentifier) {
|
|
532
552
|
// const argsList = this.getArgsList();
|
|
@@ -537,6 +557,8 @@ export class BindDirective extends BaseNode {
|
|
|
537
557
|
if (this.expression.concept === 'StringLiteral') {
|
|
538
558
|
value = `${value}`;
|
|
539
559
|
}
|
|
560
|
+
}
|
|
561
|
+
if (value !== undefined && value !== null && typeof value === 'string') {
|
|
540
562
|
value = value?.replace(/"/g, "'");
|
|
541
563
|
}
|
|
542
564
|
if (this.name === 'auth' && !!this.value) {
|
|
@@ -38,6 +38,7 @@ export class BindEvent extends BaseNode {
|
|
|
38
38
|
/**
|
|
39
39
|
* 产品概念
|
|
40
40
|
*/
|
|
41
|
+
@property('concept')
|
|
41
42
|
// @ts-ignore
|
|
42
43
|
readonly concept!: 'BindEvent';
|
|
43
44
|
|
|
@@ -168,7 +169,7 @@ export class BindEvent extends BaseNode {
|
|
|
168
169
|
|
|
169
170
|
getLogicExistingNames(excludedList: Array<Logic> = []) {
|
|
170
171
|
const excludedSet = new Set(excludedList);
|
|
171
|
-
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item
|
|
172
|
+
return ((this.logics as Logic[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item?.name);
|
|
172
173
|
}
|
|
173
174
|
getLogicUniqueName(name = 'logic1') {
|
|
174
175
|
return utils.unique(name, this.getLogicExistingNames(), undefined, true);
|
|
@@ -455,11 +456,16 @@ export class BindEvent extends BaseNode {
|
|
|
455
456
|
};
|
|
456
457
|
if (parentKey) {
|
|
457
458
|
params.parentKey = parentKey;
|
|
458
|
-
|
|
459
|
-
|
|
459
|
+
// @ts-ignore
|
|
460
|
+
const t = this.__v_raw || this;
|
|
461
|
+
// @ts-ignore
|
|
462
|
+
const n = logic.__v_raw || logic;
|
|
463
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
464
|
+
// @ts-ignore
|
|
465
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
460
466
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
461
467
|
params.index = index;
|
|
462
|
-
} else if ((
|
|
468
|
+
} else if ((t as any)[parentKey] === n) {
|
|
463
469
|
params.index = 0;
|
|
464
470
|
(this as any)[parentKey] = undefined;
|
|
465
471
|
}
|
|
@@ -489,11 +495,16 @@ export class BindEvent extends BaseNode {
|
|
|
489
495
|
};
|
|
490
496
|
if (parentKey) {
|
|
491
497
|
params.parentKey = parentKey;
|
|
492
|
-
|
|
493
|
-
|
|
498
|
+
// @ts-ignore
|
|
499
|
+
const t = this.__v_raw || this;
|
|
500
|
+
// @ts-ignore
|
|
501
|
+
const n = logicItem.__v_raw || logicItem;
|
|
502
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
503
|
+
// @ts-ignore
|
|
504
|
+
const index = (t as any)[parentKey].findIndex((el) => (el.__v_raw || el) === n);
|
|
494
505
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
495
506
|
params.index = index;
|
|
496
|
-
} else if ((
|
|
507
|
+
} else if ((t as any)[parentKey] === n) {
|
|
497
508
|
params.index = 0;
|
|
498
509
|
(this as any)[parentKey] = undefined;
|
|
499
510
|
}
|
|
@@ -677,9 +688,13 @@ export class BindEvent extends BaseNode {
|
|
|
677
688
|
this.logics.forEach((logic, index) => {
|
|
678
689
|
const logicName = `viewLogic_${logic.name}${index}`;
|
|
679
690
|
// logic.name = logic.view.name + logic.name + index;
|
|
680
|
-
code += logic.toNaturalTS(
|
|
681
|
-
|
|
682
|
-
|
|
691
|
+
code += logic.toNaturalTS(
|
|
692
|
+
shiftState(state, code, {
|
|
693
|
+
tabSize: state.tabSize,
|
|
694
|
+
}),
|
|
695
|
+
'noExport',
|
|
696
|
+
logicName,
|
|
697
|
+
);
|
|
683
698
|
|
|
684
699
|
// logic.name = logicName;
|
|
685
700
|
// code += indent(state.tabSize);
|
|
@@ -704,17 +719,23 @@ export class BindEvent extends BaseNode {
|
|
|
704
719
|
// logic.name = '__' + logic.view.name + (logic.parentNode as BindEvent).element.name + logic.name;
|
|
705
720
|
logic.name = logic.name.replace(/-/g, '');
|
|
706
721
|
try {
|
|
707
|
-
code += logic.toNaturalTS(
|
|
708
|
-
|
|
709
|
-
|
|
722
|
+
code += logic.toNaturalTS(
|
|
723
|
+
shiftState(state, code, {
|
|
724
|
+
tabSize: state.tabSize,
|
|
725
|
+
}),
|
|
726
|
+
'noExport',
|
|
727
|
+
);
|
|
710
728
|
} finally {
|
|
711
729
|
// 翻译logic可能出错
|
|
712
730
|
logic.name = logicName;
|
|
713
731
|
}
|
|
714
732
|
} else {
|
|
715
|
-
code += logic.toNaturalTS(
|
|
716
|
-
|
|
717
|
-
|
|
733
|
+
code += logic.toNaturalTS(
|
|
734
|
+
shiftState(state, code, {
|
|
735
|
+
tabSize: state.tabSize,
|
|
736
|
+
}),
|
|
737
|
+
'noExport',
|
|
738
|
+
);
|
|
718
739
|
}
|
|
719
740
|
|
|
720
741
|
code += indent(state.tabSize);
|