@lcap/nasl 3.3.2-beta.4 → 3.3.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/bak/translator.d.ts +1 -1
- package/out/bak/translator.js +42 -7
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +9 -4
- package/out/common/BaseNode.js +48 -9
- 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 +10 -4
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js +27 -11
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +85 -0
- package/out/concepts/App__.js +241 -63
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +16 -5
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js +17 -7
- 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 +38 -9
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js +10 -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 +10 -4
- 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 +34 -6
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.js +10 -4
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js +27 -13
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +50 -16
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +37 -6
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +27 -5
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js +17 -7
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js +10 -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 +10 -4
- 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 +45 -16
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +14 -8
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +49 -27
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +17 -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 +10 -4
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js +10 -4
- 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 +10 -4
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js +10 -4
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Connection__.js +10 -4
- 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 +38 -16
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.js +10 -4
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.js +10 -4
- 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 +10 -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 +25 -8
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.js +17 -7
- 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 +10 -4
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js +10 -4
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js +10 -4
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +32 -24
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js +17 -7
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js +38 -16
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +41 -17
- 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 +25 -17
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.js +17 -7
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceParam__.js +10 -4
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +24 -10
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js +59 -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 +49 -23
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +32 -22
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +22 -16
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +26 -20
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +245 -0
- package/out/concepts/MetadataType__.js +483 -0
- package/out/concepts/MetadataType__.js.map +1 -0
- package/out/concepts/MicroApp__.js +3 -1
- package/out/concepts/MicroApp__.js.map +1 -1
- package/out/concepts/Module__.d.ts +85 -0
- package/out/concepts/Module__.js +115 -3
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.js +10 -4
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.js +10 -4
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/Namespace__.js +80 -34
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.js +37 -16
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +1 -0
- package/out/concepts/NewList__.js +39 -11
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js +29 -11
- 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 -5
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +34 -5
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.js +45 -19
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.js +34 -6
- 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 +17 -7
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +59 -25
- 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 +38 -16
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js +10 -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 +10 -4
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js +10 -4
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js +10 -4
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js +10 -4
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js +10 -4
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.js +10 -4
- 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 +34 -6
- 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 +10 -4
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js +10 -4
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js +10 -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 +14 -6
- 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 +10 -4
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js +17 -7
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +14 -8
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js +10 -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 +10 -4
- 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 +75 -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 +16 -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 -5
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +35 -7
- 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 +45 -19
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +1 -0
- package/out/concepts/ViewElement__.js +83 -21
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -0
- package/out/concepts/View__.js +85 -22
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +19 -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/concepts/index__.d.ts +1 -0
- package/out/concepts/index__.js +1 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/types__.d.ts +2 -1
- package/out/generator/genBundleFiles.js +0 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.js +32 -4
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/permission.js +31 -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/extendBaseNode.js +1 -1
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/getMemberIdentifier.js +1 -1
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +2 -0
- package/out/server/naslServer.js +143 -5
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +5 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/add.configs.js +1 -1
- package/out/service/creator/add.configs.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -1
- package/out/service/storage/init.js +45 -21
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +13 -7
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +15 -9
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +13 -10
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +4 -4
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +14 -10
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +6 -1
- package/out/templator/utils.js +24 -1
- package/out/templator/utils.js.map +1 -1
- package/out/translator/utils.d.ts +8 -0
- package/out/translator/utils.js +19 -1
- package/out/translator/utils.js.map +1 -1
- package/out/utils/cookie.d.ts +1 -1
- package/out/utils/cookie.js +2 -2
- package/out/utils/cookie.js.map +1 -1
- package/out/utils/index.js +19 -0
- package/out/utils/index.js.map +1 -1
- package/out/utils/sortTsString.js +10 -4
- package/out/utils/sortTsString.js.map +1 -1
- package/out/utils/string.d.ts +1 -0
- package/out/utils/string.js +33 -1
- package/out/utils/string.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.core.ts +187 -185
- package/src/bak/translator.js +76 -43
- package/src/common/BaseNode.ts +62 -12
- package/src/concepts/Abort__.ts +1 -0
- package/src/concepts/Anchor__.ts +19 -14
- package/src/concepts/AnonymousFunction__.ts +26 -12
- package/src/concepts/App__.ts +359 -76
- package/src/concepts/Argument__.ts +14 -4
- package/src/concepts/Assignee__.ts +15 -6
- package/src/concepts/AssignmentLine__.ts +1 -0
- package/src/concepts/Assignment__.ts +43 -11
- package/src/concepts/Attribute__.ts +8 -3
- package/src/concepts/AuthInterface__.ts +1 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +8 -3
- package/src/concepts/AuthLogic__.ts +4 -0
- package/src/concepts/BackendVariable__.ts +30 -6
- package/src/concepts/Backend__.ts +8 -3
- package/src/concepts/BatchAssignment__.ts +28 -13
- package/src/concepts/BinaryExpression__.ts +56 -22
- package/src/concepts/BindAttribute__.ts +50 -18
- package/src/concepts/BindDirective__.ts +26 -5
- package/src/concepts/BindEvent__.ts +34 -15
- package/src/concepts/BindStyle__.ts +8 -3
- package/src/concepts/BooleanLiteral__.ts +1 -0
- package/src/concepts/CallAuthInterface__.ts +8 -3
- package/src/concepts/CallConnector__.ts +1 -0
- package/src/concepts/CallFunction__.ts +49 -27
- package/src/concepts/CallInterface__.ts +43 -28
- package/src/concepts/CallLogic__.ts +85 -62
- package/src/concepts/CallQueryComponent__.ts +15 -6
- package/src/concepts/Comment__.ts +2 -1
- package/src/concepts/CompletionProperty__.ts +8 -3
- package/src/concepts/ConfigGroup__.ts +8 -3
- package/src/concepts/ConfigPropertyValue__.ts +1 -0
- package/src/concepts/ConfigProperty__.ts +8 -3
- package/src/concepts/Configuration__.ts +8 -3
- package/src/concepts/Connection__.ts +9 -4
- package/src/concepts/ConnectorTrigger__.ts +1 -0
- package/src/concepts/Connector__.ts +36 -15
- package/src/concepts/Constant__.ts +8 -3
- package/src/concepts/DataSource__.ts +8 -3
- package/src/concepts/DatabaseTypeAnnotation__.ts +1 -0
- package/src/concepts/Destination__.ts +8 -4
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/EntityIndex__.ts +1 -0
- package/src/concepts/EntityProperty__.ts +23 -7
- package/src/concepts/Entity__.ts +15 -6
- package/src/concepts/EnumItem__.ts +1 -0
- package/src/concepts/Enum__.ts +8 -3
- package/src/concepts/Event__.ts +8 -3
- package/src/concepts/ExternalDestination__.ts +8 -3
- package/src/concepts/ForEachStatement__.ts +43 -36
- package/src/concepts/FrontendLibrary__.ts +15 -6
- package/src/concepts/Frontend__.ts +36 -15
- package/src/concepts/Function__.ts +40 -18
- package/src/concepts/Identifier__.ts +1 -0
- package/src/concepts/IfStatement__.ts +29 -20
- package/src/concepts/Integration__.ts +15 -6
- package/src/concepts/InterfaceParam__.ts +8 -3
- package/src/concepts/Interface__.ts +28 -15
- package/src/concepts/JSBlock__.ts +60 -0
- package/src/concepts/JavaLogic__.ts +1 -0
- package/src/concepts/LogicItem__.ts +5 -4
- package/src/concepts/Logic__.ts +70 -58
- package/src/concepts/MatchCase__.ts +42 -29
- package/src/concepts/Match__.ts +23 -16
- package/src/concepts/MemberExpression__.ts +24 -19
- package/src/concepts/MetadataType__.ts +637 -0
- package/src/concepts/MicroApp__.ts +1 -0
- package/src/concepts/Module__.ts +227 -9
- package/src/concepts/MsgTriggerEvent__.ts +8 -3
- package/src/concepts/MsgTriggerLauncher__.ts +8 -3
- package/src/concepts/Namespace__.ts +78 -33
- package/src/concepts/NewComposite__.ts +41 -19
- package/src/concepts/NewList__.ts +41 -11
- package/src/concepts/NewMap__.ts +31 -11
- package/src/concepts/NullLiteral__.ts +1 -0
- package/src/concepts/NumericLiteral__.ts +9 -4
- package/src/concepts/OqlQueryComponent__.ts +35 -5
- package/src/concepts/OverriddenLogic__.ts +44 -19
- package/src/concepts/Param__.ts +38 -15
- package/src/concepts/Point__.ts +1 -0
- package/src/concepts/ProcessComponent__.ts +15 -6
- package/src/concepts/ProcessElement__.ts +57 -24
- package/src/concepts/ProcessOutcome__.ts +1 -0
- package/src/concepts/ProcessOutcomes__.ts +1 -0
- package/src/concepts/Process__.ts +36 -15
- package/src/concepts/QueryAggregateExpression__.ts +8 -3
- package/src/concepts/QueryFieldExpression__.ts +1 -0
- package/src/concepts/QueryFromExpression__.ts +8 -3
- package/src/concepts/QueryGroupByExpression__.ts +8 -3
- package/src/concepts/QueryJoinExpression__.ts +8 -3
- package/src/concepts/QueryLimitExpression__.ts +8 -3
- package/src/concepts/QueryOrderByExpression__.ts +8 -3
- package/src/concepts/QuerySelectExpression__.ts +8 -3
- package/src/concepts/Rect__.ts +1 -0
- package/src/concepts/Return__.ts +31 -6
- package/src/concepts/Role__.ts +1 -0
- package/src/concepts/SelectMembers__.ts +8 -3
- package/src/concepts/Slot__.ts +8 -3
- package/src/concepts/SqlQueryComponent__.ts +8 -3
- package/src/concepts/Start__.ts +1 -0
- package/src/concepts/StringInterpolation__.ts +14 -7
- package/src/concepts/StringLiteral__.ts +1 -0
- package/src/concepts/StructureProperty__.ts +8 -3
- package/src/concepts/Structure__.ts +15 -6
- package/src/concepts/SwitchCase__.ts +14 -9
- package/src/concepts/SwitchStatement__.ts +21 -16
- package/src/concepts/Theme__.ts +1 -0
- package/src/concepts/Transactional__.ts +1 -0
- package/src/concepts/TriggerEvent__.ts +8 -3
- package/src/concepts/TriggerLauncher__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +75 -21
- package/src/concepts/TypeParam__.ts +2 -1
- package/src/concepts/UnaryExpression__.ts +15 -6
- package/src/concepts/Unparsed__.ts +2 -1
- package/src/concepts/UseComponent__.ts +1 -0
- package/src/concepts/ValidationRule__.ts +10 -5
- package/src/concepts/Variable__.ts +32 -8
- package/src/concepts/ViewBlock__.ts +1 -0
- package/src/concepts/ViewComponent__.ts +43 -18
- package/src/concepts/ViewElement__.ts +191 -120
- package/src/concepts/View__.ts +136 -58
- package/src/concepts/WhileStatement__.ts +26 -15
- package/src/concepts/basics/stdlib/nasl.util.ts +2 -2
- package/src/concepts/index__.ts +1 -0
- package/src/concepts/types__.ts +2 -0
- package/src/generator/genBundleFiles.ts +11 -13
- package/src/generator/genMetaData.ts +37 -8
- package/src/generator/permission.ts +33 -9
- package/src/sentry/index.ts +3 -1
- package/src/server/extendBaseNode.ts +2 -1
- package/src/server/getMemberIdentifier.ts +122 -121
- package/src/server/naslServer.ts +141 -5
- package/src/server/translator.ts +5 -2
- package/src/service/creator/add.configs.js +1 -1
- package/src/service/storage/init.ts +46 -22
- package/src/templator/genCreateBlock.ts +35 -38
- package/src/templator/genCurdEditMultipleKeyBlock.ts +31 -25
- package/src/templator/genCurdMultipleKeyBlock.ts +67 -71
- package/src/templator/genEditTableBlock.ts +7 -6
- package/src/templator/genUpdateBlock.ts +30 -26
- package/src/templator/utils.ts +23 -1
- package/src/translator/utils.ts +20 -0
- package/src/utils/cookie.ts +2 -2
- package/src/utils/index.ts +19 -1
- package/src/utils/sortTsString.ts +9 -4
- package/src/utils/string.ts +34 -0
- 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/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/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +4 -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
|
@@ -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
|
|
|
@@ -669,11 +669,15 @@ 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
|
+
const index = (t as any)[parentKey].indexOf(n);
|
|
674
678
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
675
679
|
params.index = index;
|
|
676
|
-
} else if ((
|
|
680
|
+
} else if ((t as any)[parentKey] === n) {
|
|
677
681
|
params.index = 0;
|
|
678
682
|
(this as any)[parentKey] = undefined;
|
|
679
683
|
}
|
|
@@ -1004,7 +1008,23 @@ export class BindAttribute extends BaseNode {
|
|
|
1004
1008
|
// 文本默认要经过toString转换
|
|
1005
1009
|
if (options?.finalCode !== false && name === 'text' && !this.sync && this.type === 'dynamic') {
|
|
1006
1010
|
const expTypeAnnotation = (this.expression as any)?.typeAnnotation || this.expression?.__TypeAnnotation;
|
|
1007
|
-
|
|
1011
|
+
// 针对union类型,typeAnntatation拿不到app数据,暂时先在这里处理
|
|
1012
|
+
if (expTypeAnnotation?.typeKind === 'union' && expTypeAnnotation?.typeArguments?.length) {
|
|
1013
|
+
expTypeAnnotation?.typeArguments?.forEach((typeArg: any) => {
|
|
1014
|
+
if (typeArg.typeNamespace?.endsWith('.metadataTypes')) {
|
|
1015
|
+
const referenceNode = this.app.findNodeByCompleteName(typeArg.typeNamespace + '.' + typeArg.typeName)?.typeAnnotation || {};
|
|
1016
|
+
typeArg.typeName = referenceNode.typeName
|
|
1017
|
+
typeArg.typeKind = referenceNode.typeKind
|
|
1018
|
+
typeArg.typeNamespace = referenceNode.typeNamespace
|
|
1019
|
+
}
|
|
1020
|
+
})
|
|
1021
|
+
}
|
|
1022
|
+
if (expTypeAnnotation?.typeNamespace?.endsWith('.metadataTypes')) {
|
|
1023
|
+
const referenceNode = this.app.findNodeByCompleteName(expTypeAnnotation.typeNamespace + '.' + expTypeAnnotation.typeName)?.typeAnnotation || {};
|
|
1024
|
+
value = `$utils['ToString']('${referenceNode?.typeNamespace}.${referenceNode.typeName}', ${value})`;
|
|
1025
|
+
} else {
|
|
1026
|
+
value = `$utils['ToString']('${expTypeAnnotation?.sortedTypeKey}', ${value})`;
|
|
1027
|
+
}
|
|
1008
1028
|
}
|
|
1009
1029
|
if (this.type === 'string' && name !== 'rules') {
|
|
1010
1030
|
if (options?.finalCode !== false) {
|
|
@@ -1088,22 +1108,25 @@ export class BindAttribute extends BaseNode {
|
|
|
1088
1108
|
return code;
|
|
1089
1109
|
}
|
|
1090
1110
|
|
|
1091
|
-
toEmbeddedTSVariableDefinition(
|
|
1111
|
+
toEmbeddedTSVariableDefinition(
|
|
1112
|
+
state?: TranslatorState,
|
|
1113
|
+
attrList?: string[],
|
|
1114
|
+
elementName?: string,
|
|
1115
|
+
currentLevel?: string,
|
|
1116
|
+
): string {
|
|
1092
1117
|
let code = '';
|
|
1093
1118
|
let arrCode = '';
|
|
1094
1119
|
code += indent((state?.tabSize || 0) + 3);
|
|
1095
1120
|
code += `${attrConvertCamelCase(this.name)}: `;
|
|
1096
1121
|
if (this.expression) {
|
|
1097
1122
|
if (this.name === 'data-source') {
|
|
1098
|
-
code += `ReturnType<typeof __elements_stashFunctionVariable.${elementName}_${attrConvertCamelCase(
|
|
1099
|
-
this.name,
|
|
1100
|
-
)}>`;
|
|
1123
|
+
code += `ReturnType<typeof __elements_stashFunctionVariable.${elementName}_${attrConvertCamelCase(this.name)}>`;
|
|
1101
1124
|
} else {
|
|
1102
1125
|
code += `ReturnType<typeof __elements_stashFunctionVariable.${elementName}_${attrConvertCamelCase(this.name)}>`;
|
|
1103
1126
|
}
|
|
1104
1127
|
arrCode = `() => {
|
|
1105
1128
|
return __elements_variable_function.${currentLevel}?.${attrConvertCamelCase(this.name)}?.()
|
|
1106
|
-
}
|
|
1129
|
+
}`;
|
|
1107
1130
|
} else if (this.name === 'sorting') {
|
|
1108
1131
|
code += `{
|
|
1109
1132
|
field: nasl.core.String
|
|
@@ -1144,24 +1167,34 @@ export class BindAttribute extends BaseNode {
|
|
|
1144
1167
|
} else {
|
|
1145
1168
|
stashVariable = `${this.expression.toEmbeddedTS()}`;
|
|
1146
1169
|
}
|
|
1147
|
-
code += `() => {\n
|
|
1170
|
+
code += `() => {\n`;
|
|
1148
1171
|
code += indent((state?.tabSize || 0) + 5);
|
|
1149
|
-
code += `return ${stashVariable}\n
|
|
1172
|
+
code += `return ${stashVariable}\n`;
|
|
1150
1173
|
code += indent((state?.tabSize || 0) + 4);
|
|
1151
|
-
code += `},\n
|
|
1174
|
+
code += `},\n`;
|
|
1152
1175
|
}
|
|
1153
1176
|
return code;
|
|
1154
1177
|
}
|
|
1155
1178
|
|
|
1156
1179
|
findCurrentElementParent(node: any): ViewElement | undefined {
|
|
1157
1180
|
if (node.parentNode instanceof ViewElement) {
|
|
1158
|
-
if (
|
|
1159
|
-
|
|
1181
|
+
if (
|
|
1182
|
+
[
|
|
1183
|
+
'u-table-view',
|
|
1184
|
+
'u-list-view',
|
|
1185
|
+
'u-grid-view',
|
|
1186
|
+
'u-list-components',
|
|
1187
|
+
'van-list-view',
|
|
1188
|
+
'van-grid-view',
|
|
1189
|
+
'van-for-components',
|
|
1190
|
+
].includes(node.parentNode.tag)
|
|
1191
|
+
) {
|
|
1192
|
+
return node.parentNode;
|
|
1160
1193
|
} else {
|
|
1161
|
-
return this.findCurrentElementParent(node.parentNode)
|
|
1194
|
+
return this.findCurrentElementParent(node.parentNode);
|
|
1162
1195
|
}
|
|
1163
1196
|
} else {
|
|
1164
|
-
return undefined
|
|
1197
|
+
return undefined;
|
|
1165
1198
|
}
|
|
1166
1199
|
}
|
|
1167
1200
|
@withSourceMap()
|
|
@@ -1247,4 +1280,3 @@ export function attrConvertCamelCase(str: string) {
|
|
|
1247
1280
|
});
|
|
1248
1281
|
return strList.join('');
|
|
1249
1282
|
}
|
|
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,15 @@ 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
|
+
const index = (t as any)[parentKey].indexOf(n);
|
|
311
316
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
312
317
|
params.index = index;
|
|
313
|
-
} else if ((
|
|
318
|
+
} else if ((t as any)[parentKey] === n) {
|
|
314
319
|
params.index = 0;
|
|
315
320
|
(this as any)[parentKey] = undefined;
|
|
316
321
|
}
|
|
@@ -526,7 +531,21 @@ export class BindDirective extends BaseNode {
|
|
|
526
531
|
toVue(options?: ElementToVueOptions) {
|
|
527
532
|
let str = '';
|
|
528
533
|
// eslint-disable-next-line no-nested-ternary
|
|
529
|
-
let value =
|
|
534
|
+
let value = this.value;
|
|
535
|
+
if(this.type === 'string') {
|
|
536
|
+
value = value.replace(/['"`\\]/g, (m) => {
|
|
537
|
+
let escape = '\\\\';
|
|
538
|
+
escape = '\\\\';
|
|
539
|
+
/// #if process.env.BUILD_TARGET === 'node'
|
|
540
|
+
escape = '\\';
|
|
541
|
+
/// #endif
|
|
542
|
+
if (m === '\\') {
|
|
543
|
+
return `${escape}${escape}`;
|
|
544
|
+
}
|
|
545
|
+
return `${escape}${m}`;
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
value = (this.type ?? 'string') !== 'string' ? this.value : value ? `\`${value}\`` : '';
|
|
530
549
|
// 需要用标识符替换
|
|
531
550
|
// if (options.finalCode !== false && this.needReplaceWithIdentifier) {
|
|
532
551
|
// const argsList = this.getArgsList();
|
|
@@ -537,7 +556,9 @@ export class BindDirective extends BaseNode {
|
|
|
537
556
|
if (this.expression.concept === 'StringLiteral') {
|
|
538
557
|
value = `${value}`;
|
|
539
558
|
}
|
|
540
|
-
|
|
559
|
+
}
|
|
560
|
+
if (value !== undefined && value !== null && typeof value === 'string') {
|
|
561
|
+
value = value?.replace(/"/g, "'");
|
|
541
562
|
}
|
|
542
563
|
if (this.name === 'auth' && !!this.value) {
|
|
543
564
|
const regex = /(.\w+\[name=\w+\])/g;
|
|
@@ -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
|
|
|
@@ -455,11 +456,15 @@ 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
|
+
const index = (t as any)[parentKey].indexOf(n);
|
|
460
465
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
461
466
|
params.index = index;
|
|
462
|
-
} else if ((
|
|
467
|
+
} else if ((t as any)[parentKey] === n) {
|
|
463
468
|
params.index = 0;
|
|
464
469
|
(this as any)[parentKey] = undefined;
|
|
465
470
|
}
|
|
@@ -489,11 +494,15 @@ export class BindEvent extends BaseNode {
|
|
|
489
494
|
};
|
|
490
495
|
if (parentKey) {
|
|
491
496
|
params.parentKey = parentKey;
|
|
492
|
-
|
|
493
|
-
|
|
497
|
+
// @ts-ignore
|
|
498
|
+
const t = this.__v_raw || this;
|
|
499
|
+
// @ts-ignore
|
|
500
|
+
const n = logicItem.__v_raw || logicItem;
|
|
501
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
502
|
+
const index = (t as any)[parentKey].indexOf(n);
|
|
494
503
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
495
504
|
params.index = index;
|
|
496
|
-
} else if ((
|
|
505
|
+
} else if ((t as any)[parentKey] === n) {
|
|
497
506
|
params.index = 0;
|
|
498
507
|
(this as any)[parentKey] = undefined;
|
|
499
508
|
}
|
|
@@ -677,9 +686,13 @@ export class BindEvent extends BaseNode {
|
|
|
677
686
|
this.logics.forEach((logic, index) => {
|
|
678
687
|
const logicName = `viewLogic_${logic.name}${index}`;
|
|
679
688
|
// logic.name = logic.view.name + logic.name + index;
|
|
680
|
-
code += logic.toNaturalTS(
|
|
681
|
-
|
|
682
|
-
|
|
689
|
+
code += logic.toNaturalTS(
|
|
690
|
+
shiftState(state, code, {
|
|
691
|
+
tabSize: state.tabSize,
|
|
692
|
+
}),
|
|
693
|
+
'noExport',
|
|
694
|
+
logicName,
|
|
695
|
+
);
|
|
683
696
|
|
|
684
697
|
// logic.name = logicName;
|
|
685
698
|
// code += indent(state.tabSize);
|
|
@@ -704,17 +717,23 @@ export class BindEvent extends BaseNode {
|
|
|
704
717
|
// logic.name = '__' + logic.view.name + (logic.parentNode as BindEvent).element.name + logic.name;
|
|
705
718
|
logic.name = logic.name.replace(/-/g, '');
|
|
706
719
|
try {
|
|
707
|
-
code += logic.toNaturalTS(
|
|
708
|
-
|
|
709
|
-
|
|
720
|
+
code += logic.toNaturalTS(
|
|
721
|
+
shiftState(state, code, {
|
|
722
|
+
tabSize: state.tabSize,
|
|
723
|
+
}),
|
|
724
|
+
'noExport',
|
|
725
|
+
);
|
|
710
726
|
} finally {
|
|
711
727
|
// 翻译logic可能出错
|
|
712
728
|
logic.name = logicName;
|
|
713
729
|
}
|
|
714
730
|
} else {
|
|
715
|
-
code += logic.toNaturalTS(
|
|
716
|
-
|
|
717
|
-
|
|
731
|
+
code += logic.toNaturalTS(
|
|
732
|
+
shiftState(state, code, {
|
|
733
|
+
tabSize: state.tabSize,
|
|
734
|
+
}),
|
|
735
|
+
'noExport',
|
|
736
|
+
);
|
|
718
737
|
}
|
|
719
738
|
|
|
720
739
|
code += indent(state.tabSize);
|
|
@@ -31,6 +31,7 @@ export class BindStyle extends BaseNode {
|
|
|
31
31
|
/**
|
|
32
32
|
* 产品概念
|
|
33
33
|
*/
|
|
34
|
+
@property('concept')
|
|
34
35
|
// @ts-ignore
|
|
35
36
|
readonly concept!: 'BindStyle';
|
|
36
37
|
|
|
@@ -271,11 +272,15 @@ export class BindStyle extends BaseNode {
|
|
|
271
272
|
};
|
|
272
273
|
if (parentKey) {
|
|
273
274
|
params.parentKey = parentKey;
|
|
274
|
-
|
|
275
|
-
|
|
275
|
+
// @ts-ignore
|
|
276
|
+
const t = this.__v_raw || this;
|
|
277
|
+
// @ts-ignore
|
|
278
|
+
const n = logicItem.__v_raw || logicItem;
|
|
279
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
280
|
+
const index = (t as any)[parentKey].indexOf(n);
|
|
276
281
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
277
282
|
params.index = index;
|
|
278
|
-
} else if ((
|
|
283
|
+
} else if ((t as any)[parentKey] === n) {
|
|
279
284
|
params.index = 0;
|
|
280
285
|
(this as any)[parentKey] = undefined;
|
|
281
286
|
}
|
|
@@ -30,6 +30,7 @@ export class CallAuthInterface extends CallInterface {
|
|
|
30
30
|
/**
|
|
31
31
|
* 产品概念
|
|
32
32
|
*/
|
|
33
|
+
@property('concept')
|
|
33
34
|
// @ts-ignore
|
|
34
35
|
readonly concept!: 'CallAuthInterface';
|
|
35
36
|
|
|
@@ -241,11 +242,15 @@ export class CallAuthInterface extends CallInterface {
|
|
|
241
242
|
};
|
|
242
243
|
if (parentKey) {
|
|
243
244
|
params.parentKey = parentKey;
|
|
244
|
-
|
|
245
|
-
|
|
245
|
+
// @ts-ignore
|
|
246
|
+
const t = this.__v_raw || this;
|
|
247
|
+
// @ts-ignore
|
|
248
|
+
const n = logicItem.__v_raw || logicItem;
|
|
249
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
250
|
+
const index = (t as any)[parentKey].indexOf(n);
|
|
246
251
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
247
252
|
params.index = index;
|
|
248
|
-
} else if ((
|
|
253
|
+
} else if ((t as any)[parentKey] === n) {
|
|
249
254
|
params.index = 0;
|
|
250
255
|
(this as any)[parentKey] = undefined;
|
|
251
256
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
1
|
+
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState, transfromMetadataType } from '../translator';
|
|
2
2
|
import Function from './Function__';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
import Identifier from './Identifier__';
|
|
@@ -20,7 +20,6 @@ import BaseNode from '../common/BaseNode';
|
|
|
20
20
|
import TypeAnnotation from './TypeAnnotation__';
|
|
21
21
|
import Argument from './Argument__';
|
|
22
22
|
import LogicItem from './LogicItem__';
|
|
23
|
-
import StringLiteral from './StringLiteral__';
|
|
24
23
|
|
|
25
24
|
/**
|
|
26
25
|
* 调用函数
|
|
@@ -35,6 +34,7 @@ export class CallFunction extends LogicItem {
|
|
|
35
34
|
/**
|
|
36
35
|
* 产品概念
|
|
37
36
|
*/
|
|
37
|
+
@property('concept')
|
|
38
38
|
// @ts-ignore
|
|
39
39
|
readonly concept!: 'CallFunction';
|
|
40
40
|
|
|
@@ -312,11 +312,15 @@ export class CallFunction extends LogicItem {
|
|
|
312
312
|
};
|
|
313
313
|
if (parentKey) {
|
|
314
314
|
params.parentKey = parentKey;
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
// @ts-ignore
|
|
316
|
+
const t = this.__v_raw || this;
|
|
317
|
+
// @ts-ignore
|
|
318
|
+
const n = typeAnnotation.__v_raw || typeAnnotation;
|
|
319
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
320
|
+
const index = (t as any)[parentKey].indexOf(n);
|
|
317
321
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
318
322
|
params.index = index;
|
|
319
|
-
} else if ((
|
|
323
|
+
} else if ((t as any)[parentKey] === n) {
|
|
320
324
|
params.index = 0;
|
|
321
325
|
(this as any)[parentKey] = undefined;
|
|
322
326
|
}
|
|
@@ -346,11 +350,15 @@ export class CallFunction extends LogicItem {
|
|
|
346
350
|
};
|
|
347
351
|
if (parentKey) {
|
|
348
352
|
params.parentKey = parentKey;
|
|
349
|
-
|
|
350
|
-
|
|
353
|
+
// @ts-ignore
|
|
354
|
+
const t = this.__v_raw || this;
|
|
355
|
+
// @ts-ignore
|
|
356
|
+
const n = logicItem.__v_raw || logicItem;
|
|
357
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
358
|
+
const index = (t as any)[parentKey].indexOf(n);
|
|
351
359
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
352
360
|
params.index = index;
|
|
353
|
-
} else if ((
|
|
361
|
+
} else if ((t as any)[parentKey] === n) {
|
|
354
362
|
params.index = 0;
|
|
355
363
|
(this as any)[parentKey] = undefined;
|
|
356
364
|
}
|
|
@@ -368,22 +376,41 @@ export class CallFunction extends LogicItem {
|
|
|
368
376
|
}
|
|
369
377
|
let code = `$utils['${this.calleeName}']`;
|
|
370
378
|
code += '(';
|
|
379
|
+
let argTyAnno;
|
|
380
|
+
if (this.calleeName === 'ToString') {
|
|
381
|
+
const arg0 = this.arguments[0];
|
|
382
|
+
argTyAnno = (arg0 as any).typeAnnotation || arg0.__TypeAnnotation;
|
|
383
|
+
} else if (this.calleeName === 'FromString') {
|
|
384
|
+
argTyAnno = this.typeArguments?.[0];
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
// 调整 ToString 的 typeKey 到第一个参数,剩下的以后重构。
|
|
388
|
+
// 事实上,大部分编译器都会选择把 type tag 放到前端来做运行时匹配,而非末位。
|
|
389
|
+
if (this.calleeName === 'ToString' && argTyAnno) {
|
|
390
|
+
code += `'${argTyAnno?.sortedTypeKey}', `;
|
|
391
|
+
}
|
|
392
|
+
|
|
371
393
|
if (Array.isArray(this.arguments) && this.arguments.length) {
|
|
372
394
|
const needToString = ['Concat'].includes(this.calleeName);
|
|
373
395
|
this.arguments?.forEach((arg: any, index) => {
|
|
374
396
|
let argStr = arg?.toVue(options);
|
|
375
397
|
const argTypeAnnotation = arg.typeAnnotation || arg.__TypeAnnotation;
|
|
376
|
-
|
|
398
|
+
const { sortedTypeKey } = transfromMetadataType(argTypeAnnotation, this.app)
|
|
377
399
|
if (needToString) {
|
|
378
|
-
argStr = `$utils['ToString'](${
|
|
400
|
+
argStr = `$utils['ToString']('${sortedTypeKey}', ${argStr})`;
|
|
379
401
|
} else if (['HasValue'].includes(this.calleeName)) {
|
|
380
|
-
argStr = `{ type: '${
|
|
402
|
+
argStr = `{ type: '${sortedTypeKey}', value: ${argStr} }`;
|
|
381
403
|
}
|
|
382
404
|
code += argStr;
|
|
383
405
|
if (index !== this.arguments?.length - 1) code += ', ';
|
|
384
406
|
});
|
|
385
407
|
}
|
|
386
|
-
if (this.
|
|
408
|
+
if (this.calleeName === 'FromString' && argTyAnno) {
|
|
409
|
+
code += `, '${argTyAnno?.sortedTypeKey}'`;
|
|
410
|
+
}
|
|
411
|
+
// 用作做语义控制。后面这段代码没完全理解,需要保持进入条件不变。
|
|
412
|
+
const flagControl = ['ToString', 'FromString'].includes(this.calleeName) && argTyAnno;
|
|
413
|
+
if (!flagControl && Array.isArray(this.typeArguments) && this.typeArguments.length) {
|
|
387
414
|
if (this.arguments?.length) code += ', ';
|
|
388
415
|
this.typeArguments?.forEach((arg, index) => {
|
|
389
416
|
code += arg?.toJS().replace(/"/g, "'");
|
|
@@ -426,7 +453,6 @@ export class CallFunction extends LogicItem {
|
|
|
426
453
|
code += `this.$utils['${calleeName}']`;
|
|
427
454
|
code += '(';
|
|
428
455
|
|
|
429
|
-
|
|
430
456
|
let argTyAnno;
|
|
431
457
|
if (this.calleeName === 'ToString') {
|
|
432
458
|
const arg0 = this.arguments[0];
|
|
@@ -435,11 +461,10 @@ export class CallFunction extends LogicItem {
|
|
|
435
461
|
argTyAnno = this.typeArguments?.[0];
|
|
436
462
|
}
|
|
437
463
|
|
|
438
|
-
|
|
439
464
|
// 调整 ToString 的 typeKey 到第一个参数,剩下的以后重构。
|
|
440
465
|
// 事实上,大部分编译器都会选择把 type tag 放到前端来做运行时匹配,而非末位。
|
|
441
466
|
if (this.calleeName === 'ToString' && argTyAnno) {
|
|
442
|
-
code += `'${argTyAnno?.sortedTypeKey}',
|
|
467
|
+
code += `'${argTyAnno?.sortedTypeKey}', `;
|
|
443
468
|
}
|
|
444
469
|
|
|
445
470
|
if (Array.isArray(this.arguments) && this.arguments.length) {
|
|
@@ -448,22 +473,22 @@ export class CallFunction extends LogicItem {
|
|
|
448
473
|
this.arguments.forEach((arg: any, index) => {
|
|
449
474
|
let argStr = arg?.toJS(shiftState(state, code));
|
|
450
475
|
const argTypeAnnotation = arg.typeAnnotation || arg.__TypeAnnotation;
|
|
451
|
-
|
|
476
|
+
const { sortedTypeKey } = transfromMetadataType(argTypeAnnotation, this.app)
|
|
452
477
|
if (needToString) {
|
|
453
|
-
argStr = `this.$utils['ToString']('${
|
|
478
|
+
argStr = `this.$utils['ToString']('${sortedTypeKey}', ${argStr})`;
|
|
454
479
|
} else if (['HasValue'].includes(this.calleeName)) {
|
|
455
|
-
argStr = `{ type: '${
|
|
480
|
+
argStr = `{ type: '${sortedTypeKey}', value: ${argStr} }`;
|
|
456
481
|
}
|
|
457
482
|
code += argStr;
|
|
458
483
|
if (index !== this.arguments?.length - 1) code += ', ';
|
|
459
484
|
});
|
|
460
485
|
}
|
|
461
486
|
|
|
462
|
-
if (this.calleeName === '
|
|
463
|
-
code += `, '${argTyAnno?.sortedTypeKey}'
|
|
487
|
+
if (this.calleeName === 'FromString' && argTyAnno) {
|
|
488
|
+
code += `, '${argTyAnno?.sortedTypeKey}'`;
|
|
464
489
|
}
|
|
465
490
|
// 用作做语义控制。后面这段代码没完全理解,需要保持进入条件不变。
|
|
466
|
-
const flagControl = ['ToString', '
|
|
491
|
+
const flagControl = ['ToString', 'FromString'].includes(this.calleeName) && argTyAnno;
|
|
467
492
|
if (!flagControl && Array.isArray(this.typeArguments) && this.typeArguments.length) {
|
|
468
493
|
if (this.arguments?.length) code += ', ';
|
|
469
494
|
|
|
@@ -476,8 +501,7 @@ export class CallFunction extends LogicItem {
|
|
|
476
501
|
code += ')';
|
|
477
502
|
const tyAnno = (this as any).typeAnnotation || this.__TypeAnnotation;
|
|
478
503
|
const needGenInitFromSchema =
|
|
479
|
-
|
|
480
|
-
(!['primitive', 'union'].includes(tyAnno.typeKind) || tyAnno.typeName === 'DateTime');
|
|
504
|
+
tyAnno && (!['primitive', 'union'].includes(tyAnno.typeKind) || tyAnno.typeName === 'DateTime');
|
|
481
505
|
if (needGenInitFromSchema) {
|
|
482
506
|
code = `this.$genInitFromSchema('${tyAnno?.sortedTypeKey}', ${code})`;
|
|
483
507
|
}
|
|
@@ -634,12 +658,10 @@ export class CallFunction extends LogicItem {
|
|
|
634
658
|
code += '(';
|
|
635
659
|
this.arguments.forEach((arg, index) => {
|
|
636
660
|
code += arg.toNaturalTS(shiftState(state, code, { tabSize: 0 }));
|
|
637
|
-
if (index !== this.arguments.length - 1)
|
|
638
|
-
code += ', ';
|
|
661
|
+
if (index !== this.arguments.length - 1) code += ', ';
|
|
639
662
|
});
|
|
640
663
|
if (this?.typeArguments?.[0]?.typeKind === 'reference') {
|
|
641
|
-
if (this.arguments?.length > 0)
|
|
642
|
-
code += ', ';
|
|
664
|
+
if (this.arguments?.length > 0) code += ', ';
|
|
643
665
|
code += `{ typeNamespace: '${this.typeArguments[0].typeNamespace}' }`;
|
|
644
666
|
}
|
|
645
667
|
code += `)`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TranslatorState, shiftState, withSourceMap, createCompilerState
|
|
1
|
+
import { TranslatorState, shiftState, withSourceMap, createCompilerState } from '../translator';
|
|
2
2
|
import Interface from './Interface__';
|
|
3
3
|
import { ElementToVueOptions } from './ViewElement__';
|
|
4
4
|
import { getNodeByNodeCallee } from '../automate/engine/utils';
|
|
@@ -35,6 +35,7 @@ export class CallInterface extends LogicItem {
|
|
|
35
35
|
/**
|
|
36
36
|
* 产品概念
|
|
37
37
|
*/
|
|
38
|
+
@property('concept')
|
|
38
39
|
// @ts-ignore
|
|
39
40
|
readonly concept!: 'CallInterface' | 'CallAuthInterface';
|
|
40
41
|
|
|
@@ -206,11 +207,15 @@ export class CallInterface extends LogicItem {
|
|
|
206
207
|
};
|
|
207
208
|
if (parentKey) {
|
|
208
209
|
params.parentKey = parentKey;
|
|
209
|
-
|
|
210
|
-
|
|
210
|
+
// @ts-ignore
|
|
211
|
+
const t = this.__v_raw || this;
|
|
212
|
+
// @ts-ignore
|
|
213
|
+
const n = logicItem.__v_raw || logicItem;
|
|
214
|
+
if (Array.isArray((t as any)[parentKey])) {
|
|
215
|
+
const index = (t as any)[parentKey].indexOf(n);
|
|
211
216
|
~index && (this as any)[parentKey].splice(index, 1);
|
|
212
217
|
params.index = index;
|
|
213
|
-
} else if ((
|
|
218
|
+
} else if ((t as any)[parentKey] === n) {
|
|
214
219
|
params.index = 0;
|
|
215
220
|
(this as any)[parentKey] = undefined;
|
|
216
221
|
}
|
|
@@ -264,12 +269,12 @@ export class CallInterface extends LogicItem {
|
|
|
264
269
|
this.app.emit('collect:start', { actionMsg: '删除接口' });
|
|
265
270
|
const parentModule = oldItf.module || oldItf.connector;
|
|
266
271
|
if (oldItf.module) {
|
|
267
|
-
const shouldDeleteStructures: Structure[] = []
|
|
272
|
+
const shouldDeleteStructures: Structure[] = [];
|
|
268
273
|
oldItf.module.getInterfaceStructureMap().forEach((itfs, stru) => {
|
|
269
274
|
if (itfs.size === 1 && itfs.has(oldItf)) {
|
|
270
|
-
shouldDeleteStructures.push(stru)
|
|
275
|
+
shouldDeleteStructures.push(stru);
|
|
271
276
|
}
|
|
272
|
-
})
|
|
277
|
+
});
|
|
273
278
|
shouldDeleteStructures.forEach((s: Structure) => s.delete());
|
|
274
279
|
} else {
|
|
275
280
|
const shouldDeleteStructures = oldItf.getRefStructures(parentModule.structures);
|
|
@@ -618,23 +623,33 @@ export class CallInterface extends LogicItem {
|
|
|
618
623
|
const calleeNamespace = _interface.getNamespace();
|
|
619
624
|
const calleeName = _interface.name;
|
|
620
625
|
const params = _interface.params.map((param) => {
|
|
621
|
-
const oldArgument = this.arguments.find((node) => node.keyword === param.name)
|
|
622
|
-
return Argument.from(
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
+
const oldArgument = this.arguments.find((node) => node.keyword === param.name);
|
|
627
|
+
return Argument.from(
|
|
628
|
+
{
|
|
629
|
+
keyword: param.name,
|
|
630
|
+
expression: oldArgument ? oldArgument.expression : undefined,
|
|
631
|
+
},
|
|
632
|
+
this,
|
|
633
|
+
'arguments',
|
|
634
|
+
);
|
|
626
635
|
});
|
|
627
636
|
const oldArguments = this.arguments.reduce((res, argumentNode) => {
|
|
628
|
-
const targetParam = _interface.params.find((item) => item.name === argumentNode.keyword)
|
|
637
|
+
const targetParam = _interface.params.find((item) => item.name === argumentNode.keyword);
|
|
629
638
|
if (!targetParam) {
|
|
630
|
-
res.push(
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
639
|
+
res.push(
|
|
640
|
+
Argument.from(
|
|
641
|
+
{
|
|
642
|
+
keyword: argumentNode.keyword,
|
|
643
|
+
expression: argumentNode ? argumentNode.expression : undefined,
|
|
644
|
+
},
|
|
645
|
+
this,
|
|
646
|
+
'arguments',
|
|
647
|
+
),
|
|
648
|
+
);
|
|
634
649
|
}
|
|
635
|
-
return res
|
|
636
|
-
}, [])
|
|
637
|
-
params.push(...oldArguments)
|
|
650
|
+
return res;
|
|
651
|
+
}, []);
|
|
652
|
+
params.push(...oldArguments);
|
|
638
653
|
|
|
639
654
|
if (this.app) {
|
|
640
655
|
this.app.emit('collect:start', {
|
|
@@ -833,13 +848,13 @@ export class CallInterface extends LogicItem {
|
|
|
833
848
|
// 仅被自己引用则删除
|
|
834
849
|
if (!isSameItf && isSelfRef && refCount === 1) {
|
|
835
850
|
// 删除旧的数据结构
|
|
836
|
-
const shouldDeleteStructures: Structure[] = []
|
|
837
|
-
const structureMap = oldItf.module.getInterfaceStructureMap()
|
|
851
|
+
const shouldDeleteStructures: Structure[] = [];
|
|
852
|
+
const structureMap = oldItf.module.getInterfaceStructureMap();
|
|
838
853
|
structureMap.forEach((itfs, stru) => {
|
|
839
854
|
if (itfs.size === 1 && itfs.has(oldItf)) {
|
|
840
|
-
shouldDeleteStructures.push(stru)
|
|
855
|
+
shouldDeleteStructures.push(stru);
|
|
841
856
|
}
|
|
842
|
-
})
|
|
857
|
+
});
|
|
843
858
|
shouldDeleteStructures.forEach((s: Structure) => s.delete());
|
|
844
859
|
oldItf.delete();
|
|
845
860
|
oldItf.afterDelete();
|
|
@@ -854,12 +869,12 @@ export class CallInterface extends LogicItem {
|
|
|
854
869
|
// 递归找出 response/request 的 Body/Returns 引用的数据结构
|
|
855
870
|
const newStructuresSet = targetItf.getRefStructures(moduleData.structures);
|
|
856
871
|
// 新导入的数据结构在系统中已存在时 提前进行删除
|
|
857
|
-
newStructuresSet.forEach(stru => {
|
|
858
|
-
const target = targetItf.module.structures.find(node => node.name === stru.name)
|
|
872
|
+
newStructuresSet.forEach((stru) => {
|
|
873
|
+
const target = targetItf.module.structures.find((node) => node.name === stru.name);
|
|
859
874
|
if (target) {
|
|
860
|
-
oldStructuresSet.add(target)
|
|
875
|
+
oldStructuresSet.add(target);
|
|
861
876
|
}
|
|
862
|
-
})
|
|
877
|
+
});
|
|
863
878
|
// 删除旧的数据结构
|
|
864
879
|
oldStructuresSet.forEach((s) => s.delete());
|
|
865
880
|
newStructuresSet.forEach((s) => module.addStructure(Structure.from(s)));
|