@lcap/nasl 3.7.0-beta.4 → 3.7.0-beta.6
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/dist/README.md +97 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.js +397 -0
- package/dist/index.js.map +1 -0
- package/dist/package.json +91 -0
- package/dist/src/automate/engine/index.d.ts +4 -0
- package/dist/src/automate/engine/operators.d.ts +26 -0
- package/dist/src/automate/engine/uniqueName.d.ts +12 -0
- package/dist/src/automate/engine/utils.d.ts +25 -0
- package/dist/src/automate/engine/viewCache.d.ts +19 -0
- package/dist/src/automate/template/myProcess.d.ts +10 -0
- package/dist/src/automate/upgrader/2.12.d.ts +7 -0
- package/dist/src/automate/upgrader/2.14-components.d.ts +1115 -0
- package/dist/src/automate/upgrader/2.14.d.ts +10 -0
- package/dist/src/automate/upgrader/2.14.old.d.ts +1 -0
- package/dist/src/automate/upgrader/2.16.d.ts +10 -0
- package/dist/src/automate/upgrader/2.17.d.ts +21 -0
- package/dist/src/automate/upgrader/2.18.d.ts +10 -0
- package/dist/src/automate/upgrader/2.20.d.ts +17 -0
- package/dist/src/bak/translator.d.ts +1 -0
- package/dist/src/breakpoint/generator/AfterStartNode.d.ts +7 -0
- package/dist/src/breakpoint/generator/BeforeEndNode.d.ts +7 -0
- package/dist/src/breakpoint/generator/BreakpointNode.d.ts +20 -0
- package/dist/src/breakpoint/generator/CallbackNode.d.ts +4 -0
- package/dist/src/breakpoint/generator/FragmentNode.d.ts +4 -0
- package/dist/src/breakpoint/generator/index.d.ts +4 -0
- package/dist/src/breakpoint/index.d.ts +3 -0
- package/dist/src/breakpoint/shared/constants.d.ts +37 -0
- package/dist/src/breakpoint/shared/index.d.ts +3 -0
- package/dist/src/breakpoint/shared/operations.d.ts +10 -0
- package/dist/src/breakpoint/shared/socket.d.ts +48 -0
- package/dist/src/breakpoint/shared/utils.d.ts +27 -0
- package/dist/src/breakpoint/store/core.d.ts +80 -0
- package/dist/src/breakpoint/store/dock.d.ts +1 -0
- package/dist/src/breakpoint/store/index.d.ts +2 -0
- package/dist/src/common/BaseNode.d.ts +384 -0
- package/dist/src/common/Command.d.ts +21 -0
- package/dist/src/common/ComponentAPI.d.ts +112 -0
- package/dist/src/common/EventEmitter.d.ts +61 -0
- package/dist/src/common/Messager.d.ts +91 -0
- package/dist/src/common/asyncFuncMap.d.ts +2 -0
- package/dist/src/common/index.d.ts +4 -0
- package/dist/src/common/utils.d.ts +2 -0
- package/dist/src/concepts/Abort__.d.ts +31 -0
- package/dist/src/concepts/AbstractInterface__.d.ts +25 -0
- package/dist/src/concepts/Anchor__.d.ts +42 -0
- package/dist/src/concepts/AnonymousFunction__.d.ts +144 -0
- package/dist/src/concepts/App__.d.ts +1711 -0
- package/dist/src/concepts/Argument__.d.ts +64 -0
- package/dist/src/concepts/Assignee__.d.ts +294 -0
- package/dist/src/concepts/AssignmentLine__.d.ts +43 -0
- package/dist/src/concepts/Assignment__.d.ts +57 -0
- package/dist/src/concepts/Attribute__.d.ts +75 -0
- package/dist/src/concepts/AuthInterface__.d.ts +38 -0
- package/dist/src/concepts/AuthLogicForCallInterface__.d.ts +145 -0
- package/dist/src/concepts/AuthLogic__.d.ts +69 -0
- package/dist/src/concepts/BackendVariable__.d.ts +118 -0
- package/dist/src/concepts/Backend__.d.ts +127 -0
- package/dist/src/concepts/BaseSetter__.d.ts +25 -0
- package/dist/src/concepts/BatchAssignment__.d.ts +244 -0
- package/dist/src/concepts/BinaryExpression__.d.ts +61 -0
- package/dist/src/concepts/BindAttribute__.d.ts +284 -0
- package/dist/src/concepts/BindDirective__.d.ts +156 -0
- package/dist/src/concepts/BindEvent__.d.ts +246 -0
- package/dist/src/concepts/BindStyle__.d.ts +127 -0
- package/dist/src/concepts/Block__.d.ts +88 -0
- package/dist/src/concepts/BooleanLiteral__.d.ts +44 -0
- package/dist/src/concepts/BusinessComponent__.d.ts +640 -0
- package/dist/src/concepts/BusinessLogic__.d.ts +44 -0
- package/dist/src/concepts/CallAuthInterface__.d.ts +132 -0
- package/dist/src/concepts/CallConnector__.d.ts +55 -0
- package/dist/src/concepts/CallEvent__.d.ts +100 -0
- package/dist/src/concepts/CallFunction__.d.ts +171 -0
- package/dist/src/concepts/CallInterface__.d.ts +143 -0
- package/dist/src/concepts/CallLogic__.d.ts +224 -0
- package/dist/src/concepts/CallQueryComponent__.d.ts +383 -0
- package/dist/src/concepts/CapsulesSetter__.d.ts +109 -0
- package/dist/src/concepts/Comment__.d.ts +41 -0
- package/dist/src/concepts/CompletionProperty__.d.ts +87 -0
- package/dist/src/concepts/ConfigGroup__.d.ts +121 -0
- package/dist/src/concepts/ConfigPropertyValue__.d.ts +42 -0
- package/dist/src/concepts/ConfigProperty__.d.ts +147 -0
- package/dist/src/concepts/Configuration__.d.ts +120 -0
- package/dist/src/concepts/Connection__.d.ts +159 -0
- package/dist/src/concepts/ConnectorLogic__.d.ts +33 -0
- package/dist/src/concepts/ConnectorTriggerLauncher__.d.ts +44 -0
- package/dist/src/concepts/ConnectorTrigger__.d.ts +76 -0
- package/dist/src/concepts/Connector__.d.ts +532 -0
- package/dist/src/concepts/Constant__.d.ts +94 -0
- package/dist/src/concepts/CountersignPolicy__.d.ts +29 -0
- package/dist/src/concepts/DataSource__.d.ts +163 -0
- package/dist/src/concepts/DatabaseTypeAnnotation__.d.ts +35 -0
- package/dist/src/concepts/DefaultValue__.d.ts +94 -0
- package/dist/src/concepts/Destination__.d.ts +150 -0
- package/dist/src/concepts/End__.d.ts +30 -0
- package/dist/src/concepts/EntityIndex__.d.ts +93 -0
- package/dist/src/concepts/EntityProperty__.d.ts +255 -0
- package/dist/src/concepts/Entity__.d.ts +332 -0
- package/dist/src/concepts/EnumItem__.d.ts +83 -0
- package/dist/src/concepts/EnumSelectSetter__.d.ts +109 -0
- package/dist/src/concepts/Enum__.d.ts +133 -0
- package/dist/src/concepts/EventDeclaration__.d.ts +41 -0
- package/dist/src/concepts/Event__.d.ts +149 -0
- package/dist/src/concepts/ExternalDestination__.d.ts +63 -0
- package/dist/src/concepts/ForEachStatement__.d.ts +126 -0
- package/dist/src/concepts/FrontendLibrary__.d.ts +208 -0
- package/dist/src/concepts/FrontendType__.d.ts +304 -0
- package/dist/src/concepts/FrontendVariable__.d.ts +41 -0
- package/dist/src/concepts/Frontend__.d.ts +389 -0
- package/dist/src/concepts/Function__.d.ts +399 -0
- package/dist/src/concepts/I18nInfo__.d.ts +47 -0
- package/dist/src/concepts/IconSetter__.d.ts +29 -0
- package/dist/src/concepts/Identifier__.d.ts +66 -0
- package/dist/src/concepts/IfStatement__.d.ts +155 -0
- package/dist/src/concepts/ImageSetter__.d.ts +25 -0
- package/dist/src/concepts/ImportedInterface__.d.ts +29 -0
- package/dist/src/concepts/InputSetter__.d.ts +29 -0
- package/dist/src/concepts/Integration__.d.ts +127 -0
- package/dist/src/concepts/InterfaceParam__.d.ts +119 -0
- package/dist/src/concepts/InterfaceTriggerEvent__.d.ts +34 -0
- package/dist/src/concepts/Interface__.d.ts +323 -0
- package/dist/src/concepts/JSBlock__.d.ts +38 -0
- package/dist/src/concepts/JavaLogic__.d.ts +50 -0
- package/dist/src/concepts/LogicDeclaration__.d.ts +289 -0
- package/dist/src/concepts/LogicItem__.d.ts +171 -0
- package/dist/src/concepts/Logic__.d.ts +632 -0
- package/dist/src/concepts/MatchCase__.d.ts +264 -0
- package/dist/src/concepts/Match__.d.ts +122 -0
- package/dist/src/concepts/MemberExpression__.d.ts +64 -0
- package/dist/src/concepts/MetadataType__.d.ts +220 -0
- package/dist/src/concepts/MicroApp__.d.ts +53 -0
- package/dist/src/concepts/Module__.d.ts +1142 -0
- package/dist/src/concepts/MsgTriggerEvent__.d.ts +138 -0
- package/dist/src/concepts/MsgTriggerLauncher__.d.ts +119 -0
- package/dist/src/concepts/MultiApprovalPolicy__.d.ts +25 -0
- package/dist/src/concepts/Namespace__.d.ts +1060 -0
- package/dist/src/concepts/NewComposite__.d.ts +346 -0
- package/dist/src/concepts/NewList__.d.ts +135 -0
- package/dist/src/concepts/NewMap__.d.ts +226 -0
- package/dist/src/concepts/New__.d.ts +30 -0
- package/dist/src/concepts/NullLiteral__.d.ts +36 -0
- package/dist/src/concepts/NumberInputSetter__.d.ts +45 -0
- package/dist/src/concepts/NumericLiteral__.d.ts +53 -0
- package/dist/src/concepts/OqlQueryComponent__.d.ts +67 -0
- package/dist/src/concepts/OverriddenLogic__.d.ts +615 -0
- package/dist/src/concepts/Paginate__.d.ts +59 -0
- package/dist/src/concepts/ParamWithGroup__.d.ts +44 -0
- package/dist/src/concepts/Param__.d.ts +140 -0
- package/dist/src/concepts/Point__.d.ts +33 -0
- package/dist/src/concepts/ProcessComponent__.d.ts +214 -0
- package/dist/src/concepts/ProcessElement__.d.ts +620 -0
- package/dist/src/concepts/ProcessOutcome__.d.ts +35 -0
- package/dist/src/concepts/ProcessOutcomes__.d.ts +35 -0
- package/dist/src/concepts/Process__.d.ts +605 -0
- package/dist/src/concepts/PropDeclaration__.d.ts +99 -0
- package/dist/src/concepts/PropertySelectSetter__.d.ts +25 -0
- package/dist/src/concepts/QueryAggregateExpression__.d.ts +50 -0
- package/dist/src/concepts/QueryFieldExpression__.d.ts +66 -0
- package/dist/src/concepts/QueryFromExpression__.d.ts +107 -0
- package/dist/src/concepts/QueryGroupByExpression__.d.ts +46 -0
- package/dist/src/concepts/QueryJoinExpression__.d.ts +194 -0
- package/dist/src/concepts/QueryLimitExpression__.d.ts +46 -0
- package/dist/src/concepts/QueryOrderByExpression__.d.ts +57 -0
- package/dist/src/concepts/QuerySelectExpression__.d.ts +213 -0
- package/dist/src/concepts/Rect__.d.ts +41 -0
- package/dist/src/concepts/Return__.d.ts +120 -0
- package/dist/src/concepts/Role__.d.ts +58 -0
- package/dist/src/concepts/SelectMembers__.d.ts +134 -0
- package/dist/src/concepts/SequentialPolicy__.d.ts +25 -0
- package/dist/src/concepts/SetterOption__.d.ts +49 -0
- package/dist/src/concepts/SlotDeclaration__.d.ts +213 -0
- package/dist/src/concepts/Slot__.d.ts +53 -0
- package/dist/src/concepts/SqlQueryComponent__.d.ts +63 -0
- package/dist/src/concepts/Start__.d.ts +30 -0
- package/dist/src/concepts/StaticString__.d.ts +49 -0
- package/dist/src/concepts/StringInterpolation__.d.ts +122 -0
- package/dist/src/concepts/StringLiteral__.d.ts +51 -0
- package/dist/src/concepts/StructureProperty__.d.ts +119 -0
- package/dist/src/concepts/Structure__.d.ts +243 -0
- package/dist/src/concepts/SwitchCase__.d.ts +91 -0
- package/dist/src/concepts/SwitchSetter__.d.ts +25 -0
- package/dist/src/concepts/SwitchStatement__.d.ts +90 -0
- package/dist/src/concepts/ThemeVariable__.d.ts +29 -0
- package/dist/src/concepts/Theme__.d.ts +39 -0
- package/dist/src/concepts/Transactional__.d.ts +85 -0
- package/dist/src/concepts/TriggerEvent__.d.ts +42 -0
- package/dist/src/concepts/TriggerLauncher__.d.ts +76 -0
- package/dist/src/concepts/TypeAnnotation__.d.ts +303 -0
- package/dist/src/concepts/TypeParam__.d.ts +34 -0
- package/dist/src/concepts/UnaryExpression__.d.ts +45 -0
- package/dist/src/concepts/Unparsed__.d.ts +41 -0
- package/dist/src/concepts/UseComponent__.d.ts +33 -0
- package/dist/src/concepts/ValidationRule__.d.ts +133 -0
- package/dist/src/concepts/Variable__.d.ts +137 -0
- package/dist/src/concepts/ViewBlockWithImage__.d.ts +33 -0
- package/dist/src/concepts/ViewBlock__.d.ts +37 -0
- package/dist/src/concepts/ViewComponentDeclaration__.d.ts +721 -0
- package/dist/src/concepts/ViewElement__.d.ts +652 -0
- package/dist/src/concepts/View__.d.ts +728 -0
- package/dist/src/concepts/WhileStatement__.d.ts +94 -0
- package/dist/src/concepts/basics/constants.d.ts +1 -0
- package/dist/src/concepts/basics/stdlib/index.d.ts +16 -0
- package/dist/src/concepts/basics/stdlib/nasl.auth.d.ts +9 -0
- package/dist/src/concepts/basics/stdlib/nasl.browser.d.ts +5 -0
- package/dist/src/concepts/basics/stdlib/nasl.collection.d.ts +9 -0
- package/dist/src/concepts/basics/stdlib/nasl.configuration.d.ts +9 -0
- package/dist/src/concepts/basics/stdlib/nasl.core.d.ts +7 -0
- package/dist/src/concepts/basics/stdlib/nasl.event.d.ts +5 -0
- package/dist/src/concepts/basics/stdlib/nasl.http.d.ts +9 -0
- package/dist/src/concepts/basics/stdlib/nasl.interface.d.ts +9 -0
- package/dist/src/concepts/basics/stdlib/nasl.io.d.ts +5 -0
- package/dist/src/concepts/basics/stdlib/nasl.logging.d.ts +5 -0
- package/dist/src/concepts/basics/stdlib/nasl.process.d.ts +9 -0
- package/dist/src/concepts/basics/stdlib/nasl.ui.d.ts +9 -0
- package/dist/src/concepts/basics/stdlib/nasl.util.d.ts +6 -0
- package/dist/src/concepts/basics/stdlib/nasl.validation.d.ts +5 -0
- package/dist/src/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +4 -0
- package/dist/src/concepts/basics/stdlib/timeZone.d.ts +5 -0
- package/dist/src/concepts/basics/types/coreTypeList.d.ts +2 -0
- package/dist/src/concepts/basics/types/index.d.ts +17 -0
- package/dist/src/concepts/index.d.ts +7 -0
- package/dist/src/concepts/index__.d.ts +156 -0
- package/dist/src/concepts/utils/asserts.d.ts +7825 -0
- package/dist/src/concepts/utils/quick-info.d.ts +13 -0
- package/dist/src/concepts/utils/types.d.ts +510 -0
- package/dist/src/config.d.ts +52 -0
- package/dist/src/decorators/index.d.ts +67 -0
- package/dist/src/decorators/promise.d.ts +7 -0
- package/dist/src/enums/KEYWORDS.d.ts +6 -0
- package/dist/src/enums/LEVEL_NAME_MAP.d.ts +26 -0
- package/dist/src/eventBus.d.ts +3 -0
- package/dist/src/generator/compileComponent.d.ts +11 -0
- package/dist/src/generator/genBundleFiles.d.ts +37 -0
- package/dist/src/generator/genHash.d.ts +7 -0
- package/dist/src/generator/genMetaData.d.ts +31 -0
- package/dist/src/generator/icestark.d.ts +2 -0
- package/dist/src/generator/index.d.ts +7 -0
- package/dist/src/generator/microApp.d.ts +2 -0
- package/dist/src/generator/permission.d.ts +14 -0
- package/dist/src/generator/qiankun.d.ts +2 -0
- package/dist/src/generator/release-body/body.d.ts +42 -0
- package/dist/src/generator/release-body/data.d.ts +45 -0
- package/dist/src/generator/release-body/index.d.ts +2 -0
- package/dist/src/generator/release-body/internal.d.ts +622 -0
- package/dist/src/generator/release-body/types.d.ts +57 -0
- package/dist/src/generator/release-body/utils.d.ts +418 -0
- package/dist/src/generator/release-body/validation.d.ts +3 -0
- package/dist/src/generator/styleReplacer.d.ts +3 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/manager/diagnostic.d.ts +39 -0
- package/dist/src/manager/stepRecorder.d.ts +20 -0
- package/dist/src/natural/componentData.d.ts +31 -0
- package/dist/src/natural/genNaturalTS.d.ts +241 -0
- package/dist/src/natural/index.d.ts +6 -0
- package/dist/src/natural/naslStdlibMap.d.ts +1 -0
- package/dist/src/natural/prompt/analyzeClaims.d.ts +1 -0
- package/dist/src/natural/prompt/analyzeFormatOutput.d.ts +1 -0
- package/dist/src/natural/prompt/analyzeTasks.d.ts +1 -0
- package/dist/src/natural/prompt/executeClaims.d.ts +1 -0
- package/dist/src/natural/transformTSCode.d.ts +7 -0
- package/dist/src/sentry/index.d.ts +34 -0
- package/dist/src/server/createUiTs.d.ts +17 -0
- package/dist/src/server/entity2LogicNamespace.d.ts +10 -0
- package/dist/src/server/event.d.ts +30 -0
- package/dist/src/server/extendBaseNode.d.ts +1 -0
- package/dist/src/server/formatTsUtils.d.ts +36 -0
- package/dist/src/server/getConnector.d.ts +15 -0
- package/dist/src/server/getExtensionModules.d.ts +3 -0
- package/dist/src/server/getFunctions.d.ts +3 -0
- package/dist/src/server/getInterfaces.d.ts +2 -0
- package/dist/src/server/getLogging.d.ts +1 -0
- package/dist/src/server/getLogics.d.ts +5 -0
- package/dist/src/server/getMemberIdentifier.d.ts +17 -0
- package/dist/src/server/getProcessComponents.d.ts +2 -0
- package/dist/src/server/getProcesses.d.ts +33 -0
- package/dist/src/server/getScope.d.ts +13 -0
- package/dist/src/server/getValidates.d.ts +3 -0
- package/dist/src/server/index.d.ts +5 -0
- package/dist/src/server/naslServer.d.ts +391 -0
- package/dist/src/server/naslStdlibMap.d.ts +2 -0
- package/dist/src/server/process2LogicNamespace.d.ts +26 -0
- package/dist/src/server/translator.d.ts +26 -0
- package/dist/src/service/creator/add.configs.d.ts +1 -0
- package/dist/src/service/creator/errHandles.d.ts +18 -0
- package/dist/src/service/creator/index.d.ts +1 -0
- package/dist/src/service/datasource/api.d.ts +12 -0
- package/dist/src/service/datasource/index.d.ts +2 -0
- package/dist/src/service/logic/api.d.ts +9 -0
- package/dist/src/service/logic/checktypeSocket.d.ts +5 -0
- package/dist/src/service/logic/index.d.ts +2 -0
- package/dist/src/service/storage/api.d.ts +54 -0
- package/dist/src/service/storage/index.d.ts +2 -0
- package/dist/src/service/storage/init.d.ts +105 -0
- package/dist/src/service/storage/jsoner.d.ts +36 -0
- package/dist/src/service/storage/map.d.ts +4 -0
- package/dist/src/service/storage/service.d.ts +25 -0
- package/dist/src/service/storage/storagePoint.d.ts +17 -0
- package/dist/src/service/video/BaseService.d.ts +7 -0
- package/dist/src/service/video/MainCallbackService.d.ts +12 -0
- package/dist/src/service/video/VideoTranscribe.d.ts +15 -0
- package/dist/src/service/video/publishService.d.ts +1 -0
- package/dist/src/templator/genCallComponentLogic.d.ts +17 -0
- package/dist/src/templator/genCreateBlock.d.ts +10 -0
- package/dist/src/templator/genCurdEditMultipleKeyBlock.d.ts +8 -0
- package/dist/src/templator/genCurdMultipleKeyBlock.d.ts +61 -0
- package/dist/src/templator/genEditTableBlock.d.ts +51 -0
- package/dist/src/templator/genEnumSelectBlock.d.ts +10 -0
- package/dist/src/templator/genGetBlock.d.ts +6 -0
- package/dist/src/templator/genGridViewBlock.d.ts +55 -0
- package/dist/src/templator/genListViewBlock.d.ts +19 -0
- package/dist/src/templator/genQueryComponent.d.ts +34 -0
- package/dist/src/templator/genSelectBlock.d.ts +45 -0
- package/dist/src/templator/genTableBlock.d.ts +55 -0
- package/dist/src/templator/genUpdateBlock.d.ts +6 -0
- package/dist/src/templator/index.d.ts +19 -0
- package/dist/src/templator/utils.d.ts +683 -0
- package/dist/src/translator/constant.d.ts +6 -0
- package/dist/src/translator/index.d.ts +3 -0
- package/dist/src/translator/types.d.ts +85 -0
- package/dist/src/translator/utils.d.ts +47 -0
- package/dist/src/utils/cookie.d.ts +9 -0
- package/dist/src/utils/create.d.ts +2 -0
- package/dist/src/utils/env.d.ts +2 -0
- package/dist/src/utils/file.d.ts +33 -0
- package/dist/src/utils/i18nInfo.d.ts +5 -0
- package/dist/src/utils/index.d.ts +72 -0
- package/dist/src/utils/logger.d.ts +8 -0
- package/dist/src/utils/sortTsString.d.ts +1 -0
- package/dist/src/utils/string.d.ts +64 -0
- package/dist/src/utils/time-slicing/constant.d.ts +35 -0
- package/dist/src/utils/time-slicing/controller.d.ts +53 -0
- package/dist/src/utils/time-slicing/index.d.ts +5 -0
- package/dist/src/utils/time-slicing/page-state.d.ts +2 -0
- package/dist/src/utils/time-slicing/performance.d.ts +11 -0
- package/dist/src/utils/time-slicing/runner.d.ts +12 -0
- package/dist/src/utils/time-slicing/tool.d.ts +24 -0
- package/dist/src/utils/time-slicing/utils.d.ts +62 -0
- package/dist/src/utils/time-slicing/wrapper.d.ts +18 -0
- package/dist/src/utils/traverse.d.ts +36 -0
- package/dist/src/utils/types.d.ts +13 -0
- package/dist/src/utils/window.d.ts +7 -0
- package/dist/test/concepts/anonymous-function/constant.d.ts +2 -0
- package/dist/test/concepts/anonymous-function/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/anonymous-function/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/anonymous-function/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/assignment/constant.d.ts +2 -0
- package/dist/test/concepts/assignment/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/assignment/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/assignment/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/batch-assignment/constant.d.ts +2 -0
- package/dist/test/concepts/batch-assignment/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/batch-assignment/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/batch-assignment/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/binary-expression/constant.d.ts +2 -0
- package/dist/test/concepts/binary-expression/getQuickInfoOffset.spec.d.ts +1 -0
- package/dist/test/concepts/binary-expression/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/binary-expression/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/binary-expression/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/boolean-literal/constant.d.ts +2 -0
- package/dist/test/concepts/boolean-literal/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/boolean-literal/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/boolean-literal/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/call-function/constant.d.ts +2 -0
- package/dist/test/concepts/call-function/getQuickInfoOffset.spec.d.ts +1 -0
- package/dist/test/concepts/call-function/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/call-function/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/call-interface/constant.d.ts +2 -0
- package/dist/test/concepts/call-interface/getQuickInfoOffset.spec.d.ts +1 -0
- package/dist/test/concepts/call-interface/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/call-interface/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/call-logic/constant.d.ts +2 -0
- package/dist/test/concepts/call-logic/getQuickInfoOffset.spec.d.ts +1 -0
- package/dist/test/concepts/call-logic/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/call-logic/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/call-logic/toUI.spec.d.ts +1 -0
- package/dist/test/concepts/call-logic/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/call-logic/toVueDesigner.spec.d.ts +1 -0
- package/dist/test/concepts/data-source/constant.d.ts +2 -0
- package/dist/test/concepts/data-source/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/data-source/toEmbeddedTSFile.spec.d.ts +1 -0
- package/dist/test/concepts/entity/constant.d.ts +2 -0
- package/dist/test/concepts/entity/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/entity/toEmbeddedTSFile.spec.d.ts +1 -0
- package/dist/test/concepts/identifier/constant.d.ts +2 -0
- package/dist/test/concepts/identifier/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/identifier/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/identifier/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/match/constant.d.ts +2 -0
- package/dist/test/concepts/match/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/match/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/member-expression/constant.d.ts +2 -0
- package/dist/test/concepts/member-expression/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/member-expression/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/member-expression/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/new-composite/constant.d.ts +2 -0
- package/dist/test/concepts/new-composite/getQuickInfoOffset.spec.d.ts +1 -0
- package/dist/test/concepts/new-composite/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/new-composite/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/new-list/constant.d.ts +2 -0
- package/dist/test/concepts/new-list/getQuickInfoOffset.spec.d.ts +1 -0
- package/dist/test/concepts/new-list/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/new-list/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/new-map/constant.d.ts +2 -0
- package/dist/test/concepts/new-map/getQuickInfoOffset.spec.d.ts +1 -0
- package/dist/test/concepts/new-map/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/new-map/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/null-literal/constant.d.ts +2 -0
- package/dist/test/concepts/null-literal/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/null-literal/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/null-literal/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/numeric-literal/constant.d.ts +2 -0
- package/dist/test/concepts/numeric-literal/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/numeric-literal/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/numeric-literal/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/string-literal/constant.d.ts +2 -0
- package/dist/test/concepts/string-literal/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/string-literal/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/string-literal/toVue.spec.d.ts +1 -0
- package/dist/test/concepts/utils.d.ts +13 -0
- package/dist/test/concepts/validation-rule/constant.d.ts +2 -0
- package/dist/test/concepts/validation-rule/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/validation-rule/toJS.spec.d.ts +1 -0
- package/dist/test/concepts/validation-rule/validation-rule.spec.d.ts +1 -0
- package/dist/test/concepts/view-element/constant.d.ts +2 -0
- package/dist/test/concepts/view-element/toEmbeddedTS.spec.d.ts +1 -0
- package/dist/test/concepts/view-element/toVue.spec.d.ts +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/test/time-slicing/runner.spec.d.ts +1 -0
- package/dist/test/time-slicing/time-slicing-nodejs.spec.d.ts +1 -0
- package/dist/test/time-slicing/utils.d.ts +1 -0
- package/dist/test/time-slicing/wrapper.spec.d.ts +1 -0
- package/out/automate/engine/utils.js +1 -1
- package/out/automate/engine/utils.js.map +1 -1
- package/out/bak/translator.js +12 -12
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.js +3 -3
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +6 -2
- package/out/concepts/App__.js +32 -16
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js +5 -0
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +1 -0
- package/out/concepts/AuthLogicForCallInterface__.js +15 -4
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +1 -0
- package/out/concepts/CallAuthInterface__.js +14 -1
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +9 -1
- package/out/concepts/CallInterface__.js +105 -16
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +12 -6
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +2 -1
- package/out/concepts/ConnectorLogic__.d.ts +33 -0
- package/out/concepts/ConnectorLogic__.js +69 -0
- package/out/concepts/ConnectorLogic__.js.map +1 -0
- package/out/concepts/ConnectorTriggerLauncher__.d.ts +44 -0
- package/out/concepts/ConnectorTriggerLauncher__.js +99 -0
- package/out/concepts/ConnectorTriggerLauncher__.js.map +1 -0
- package/out/concepts/ConnectorTrigger__.d.ts +5 -4
- package/out/concepts/ConnectorTrigger__.js +39 -4
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.d.ts +1 -0
- package/out/concepts/Connector__.js +5 -0
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/End__.js +1 -0
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/Frontend__.js +1 -0
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +1 -0
- package/out/concepts/Integration__.js +4 -0
- package/out/concepts/Integration__.js.map +1 -1
- package/out/concepts/InterfaceTriggerEvent__.d.ts +34 -0
- package/out/concepts/InterfaceTriggerEvent__.js +72 -0
- package/out/concepts/InterfaceTriggerEvent__.js.map +1 -0
- package/out/concepts/Interface__.d.ts +3 -3
- package/out/concepts/Interface__.js +7 -6
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +5 -0
- package/out/concepts/LogicItem__.js +7 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -1
- package/out/concepts/Logic__.js +4 -4
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Module__.js +1 -0
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.d.ts +3 -10
- package/out/concepts/MsgTriggerLauncher__.js +6 -19
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +2 -1
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.js +3 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Structure__.js +4 -4
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/TriggerEvent__.d.ts +2 -2
- package/out/concepts/TriggerEvent__.js +1 -1
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +1 -1
- package/out/concepts/TriggerLauncher__.js +18 -1
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +1 -0
- package/out/concepts/ViewElement__.js +7 -0
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +3 -2
- package/out/concepts/View__.js +11 -18
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.browser.js +42 -0
- package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.configuration.js +8 -0
- package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
- package/out/concepts/index__.d.ts +3 -0
- package/out/concepts/index__.js +3 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/utils/asserts.d.ts +145 -17
- package/out/concepts/utils/asserts.js +212 -39
- package/out/concepts/utils/asserts.js.map +1 -1
- package/out/concepts/utils/types.d.ts +15 -4
- package/out/generator/genBundleFiles.js +15 -2
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.js +1 -0
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/permission.js +1 -0
- package/out/generator/permission.js.map +1 -1
- package/out/generator/release-body/body.d.ts +1 -0
- package/out/generator/release-body/body.js +8 -6
- package/out/generator/release-body/body.js.map +1 -1
- package/out/generator/release-body/data.d.ts +1 -0
- package/out/generator/release-body/data.js +11 -8
- package/out/generator/release-body/data.js.map +1 -1
- package/out/generator/release-body/internal.d.ts +1 -0
- package/out/generator/release-body/internal.js.map +1 -1
- package/out/generator/release-body/types.d.ts +3 -1
- package/out/manager/diagnostic.d.ts +6 -2
- package/out/manager/diagnostic.js +28 -23
- package/out/manager/diagnostic.js.map +1 -1
- package/out/natural/genNaturalTS.d.ts +8 -8
- package/out/natural/genNaturalTS.js +41 -41
- package/out/natural/prompt/analyzeClaims.js +4 -3
- package/out/natural/prompt/analyzeClaims.js.map +1 -1
- package/out/natural/prompt/analyzeFormatOutput.js +1 -1
- package/out/natural/prompt/analyzeTasks.js +2 -2
- package/out/natural/transformTSCode.js +31 -3
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/extendBaseNode.js +36 -3
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +1 -1
- package/out/server/formatTsUtils.js +7 -3
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getConnector.d.ts +4 -4
- package/out/server/getConnector.js +3 -3
- package/out/server/getConnector.js.map +1 -1
- package/out/server/getExtensionModules.d.ts +1 -1
- package/out/server/getLogics.js +20 -6
- package/out/server/getLogics.js.map +1 -1
- package/out/server/naslServer.d.ts +5 -4
- package/out/server/naslServer.js +94 -61
- package/out/server/naslServer.js.map +1 -1
- package/out/service/storage/init.js +1 -1
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +2 -2
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +2 -3
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +5 -4
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/utils/delay/index.d.ts +0 -0
- package/out/utils/delay/index.js +1 -0
- package/out/utils/delay/index.js.map +1 -0
- package/out/utils/delay.d.ts +9 -0
- package/out/utils/delay.js +41 -0
- package/out/utils/delay.js.map +1 -0
- package/out/utils/env.d.ts +4 -0
- package/out/utils/env.js +6 -1
- package/out/utils/env.js.map +1 -1
- package/out/utils/index.d.ts +5 -0
- package/out/utils/index.js +36 -1
- package/out/utils/index.js.map +1 -1
- package/out/utils/time-slicing/controller.js +4 -2
- package/out/utils/time-slicing/controller.js.map +1 -1
- package/out/utils/time-slicing/page-state.d.ts +1 -1
- package/out/utils/time-slicing/page-state.js +3 -9
- package/out/utils/time-slicing/page-state.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.browser.ts +5 -0
- package/sandbox-natural/stdlib/nasl.core.ts +0 -2
- package/src/automate/engine/utils.js +1 -1
- package/src/bak/translator.js +13 -13
- package/src/common/BaseNode.ts +3 -3
- package/src/concepts/App__.ts +34 -18
- package/src/concepts/Argument__.ts +6 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +15 -4
- package/src/concepts/CallAuthInterface__.ts +18 -1
- package/src/concepts/CallInterface__.ts +121 -16
- package/src/concepts/CallLogic__.ts +14 -7
- package/src/concepts/Connection__.ts +1 -1
- package/src/concepts/ConnectorLogic__.ts +84 -0
- package/src/concepts/ConnectorTriggerLauncher__.ts +117 -0
- package/src/concepts/ConnectorTrigger__.ts +38 -5
- package/src/concepts/Connector__.ts +6 -0
- package/src/concepts/End__.ts +1 -0
- package/src/concepts/Frontend__.ts +1 -0
- package/src/concepts/Integration__.ts +6 -0
- package/src/concepts/InterfaceTriggerEvent__.ts +88 -0
- package/src/concepts/Interface__.ts +9 -8
- package/src/concepts/LogicItem__.ts +8 -1
- package/src/concepts/Logic__.ts +6 -5
- package/src/concepts/MatchCase__.ts +1 -0
- package/src/concepts/Module__.ts +2 -1
- package/src/concepts/MsgTriggerLauncher__.ts +7 -23
- package/src/concepts/OqlQueryComponent__.ts +18 -17
- package/src/concepts/Param__.ts +3 -1
- package/src/concepts/Structure__.ts +4 -4
- package/src/concepts/TriggerEvent__.ts +3 -3
- package/src/concepts/TriggerLauncher__.ts +19 -2
- package/src/concepts/ViewElement__.ts +11 -1
- package/src/concepts/View__.ts +12 -20
- package/src/concepts/basics/stdlib/nasl.browser.ts +42 -0
- package/src/concepts/basics/stdlib/nasl.configuration.ts +8 -0
- package/src/concepts/index__.ts +3 -0
- package/src/concepts/utils/asserts.ts +212 -24
- package/src/concepts/utils/types.ts +25 -6
- package/src/generator/genBundleFiles.ts +14 -4
- package/src/generator/genMetaData.ts +1 -0
- package/src/generator/permission.ts +1 -0
- package/src/generator/release-body/body.ts +10 -7
- package/src/generator/release-body/data.ts +11 -8
- package/src/generator/release-body/internal.ts +1 -0
- package/src/generator/release-body/types.ts +3 -1
- package/src/manager/diagnostic.ts +35 -31
- package/src/natural/genNaturalTS.ts +41 -41
- package/src/natural/prompt/analyzeClaims.ts +4 -3
- package/src/natural/prompt/analyzeFormatOutput.ts +1 -1
- package/src/natural/prompt/analyzeTasks.ts +2 -2
- package/src/natural/transformTSCode.ts +32 -4
- package/src/server/extendBaseNode.ts +35 -4
- package/src/server/formatTsUtils.ts +6 -3
- package/src/server/getConnector.ts +7 -7
- package/src/server/getLogics.ts +21 -6
- package/src/server/naslServer.ts +107 -64
- package/src/service/storage/init.ts +1 -1
- package/src/templator/genCreateBlock.ts +2 -2
- package/src/templator/genCurdEditMultipleKeyBlock.ts +1 -1
- package/src/templator/genCurdMultipleKeyBlock.ts +2 -3
- package/src/templator/genUpdateBlock.ts +5 -4
- package/src/utils/delay/index.ts +0 -0
- package/src/utils/delay.ts +41 -0
- package/src/utils/env.ts +7 -0
- package/src/utils/index.ts +36 -1
- package/src/utils/time-slicing/controller.ts +5 -3
- package/src/utils/time-slicing/page-state.ts +1 -9
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +2 -2
- package/ts-worker/src/index.js +4 -3
|
@@ -7,9 +7,9 @@ export const analyzeTasks = () => {
|
|
|
7
7
|
- text: 如果你认为需求不够明确时,可以继续询问用户需求的细节,不可为空
|
|
8
8
|
- executable
|
|
9
9
|
- 类型为 boolean, 如果你认为需求比较明确并且 plan 可执行, 返回 true, 否则返回 false
|
|
10
|
-
-
|
|
10
|
+
- requiredIndexes
|
|
11
11
|
- 类型为 Array, 你需要根据用户的执行计划,从 Context Definition 中整理出执行需要用到的模块或者方法,返回对应的索引
|
|
12
|
-
- 用于下一步的具体实施,需要尽可能详细的返回所有和执行计划相关的模块或方法索引。例如:"
|
|
12
|
+
- 用于下一步的具体实施,需要尽可能详细的返回所有和执行计划相关的模块或方法索引。例如:"requiredIndexes": ['1','6-3','8-1-1-0']。
|
|
13
13
|
- needQueryRepository
|
|
14
14
|
- 类型为 boolean, 如果你认为需求相关的上下文信息不足,需要另外查询知识库时, 返回 true, 否则返回 false
|
|
15
15
|
`;
|
|
@@ -687,11 +687,36 @@ export function transformTSCode(tsCode: string, contextLogicName: string, type?:
|
|
|
687
687
|
pushElseIf(node, switchStatement);
|
|
688
688
|
return switchStatement;
|
|
689
689
|
}
|
|
690
|
-
|
|
690
|
+
let consequentIndex: number;
|
|
691
|
+
let alternateIndex: number;
|
|
692
|
+
const naslNode = new naslTypes.IfStatement({
|
|
691
693
|
test: transformLogicNode(node.test),
|
|
692
|
-
consequent: !node.consequent ? [] : (node.consequent as babelTypes.BlockStatement).body.map((item
|
|
693
|
-
|
|
694
|
-
|
|
694
|
+
consequent: !node.consequent ? [] : (node.consequent as babelTypes.BlockStatement).body.map((item: any, index: number) => {
|
|
695
|
+
if (item?.type === 'ReturnStatement') {
|
|
696
|
+
item.ends = true;
|
|
697
|
+
if (item?.argument) {
|
|
698
|
+
consequentIndex = index;
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
return transformLogicNode(item);
|
|
702
|
+
}).filter((item) => !!item),
|
|
703
|
+
alternate: !node.alternate ? [] : (node.alternate as babelTypes.BlockStatement).body.map((item: any, index: number) => {
|
|
704
|
+
if (item?.type === 'ReturnStatement') {
|
|
705
|
+
item.ends = true;
|
|
706
|
+
if (item?.argument) {
|
|
707
|
+
alternateIndex = index;
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
return transformLogicNode(item);
|
|
711
|
+
}).filter((item) => !!item),
|
|
712
|
+
}) as any;
|
|
713
|
+
if (consequentIndex !== undefined) {
|
|
714
|
+
naslNode?.consequent?.splice(consequentIndex + 1, 0, new naslTypes.End());
|
|
715
|
+
}
|
|
716
|
+
if (alternateIndex !== undefined) {
|
|
717
|
+
naslNode?.alternate?.splice(alternateIndex + 1, 0, new naslTypes.End());
|
|
718
|
+
}
|
|
719
|
+
return naslNode;
|
|
695
720
|
} else if (node.type === 'WhileStatement') {
|
|
696
721
|
return new naslTypes.WhileStatement({
|
|
697
722
|
test: transformLogicNode(node.test),
|
|
@@ -883,6 +908,9 @@ export function transformTSCode(tsCode: string, contextLogicName: string, type?:
|
|
|
883
908
|
right: transformLogicNode(node.argument),
|
|
884
909
|
});
|
|
885
910
|
}
|
|
911
|
+
if ((node as any)?.ends) {
|
|
912
|
+
return new naslTypes.End();
|
|
913
|
+
}
|
|
886
914
|
} else if (node.type === 'EmptyStatement') {
|
|
887
915
|
return node.leadingComments && new naslTypes.Comment({
|
|
888
916
|
value: String(node.leadingComments[0].value),
|
|
@@ -30,7 +30,7 @@ import { EventPayload, invokeCommand, registerCommand } from '../common';
|
|
|
30
30
|
import { getNodeByNodeCallee, getNaslNodeByNodeCallee } from '../automate/engine/utils';
|
|
31
31
|
|
|
32
32
|
import { extendSentryMonitorNaslNode } from '../sentry';
|
|
33
|
-
import {
|
|
33
|
+
import { isAuthLogicForCallInterface, isParam } from '../concepts/utils/asserts';
|
|
34
34
|
|
|
35
35
|
interface SetNameNode extends BaseNode {
|
|
36
36
|
setName(name: string): any;
|
|
@@ -114,6 +114,23 @@ BaseNode.prototype.nodeFindRefNodes = function nodeFindRefNodes() {
|
|
|
114
114
|
}
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
+
/**
|
|
118
|
+
* AuthLogicForCallInterface 通过当前节点,查找被引用的节点
|
|
119
|
+
* 以下面代码为例由于相关文件TS代码翻译的特殊性,
|
|
120
|
+
* 导致在查找引用的时候是以类型参数为准,而不是实际参数
|
|
121
|
+
* 此种行为会导致函数体内的参数无法查找到引用
|
|
122
|
+
* ({par, pa, api}:{ par: nasl.core.String, pa: nasl.core.String, api?: ApiReturn})
|
|
123
|
+
* 为此需要重新查找一次引用
|
|
124
|
+
*/
|
|
125
|
+
async function extensionRefForAuthLogicForCallInterfaceParams(refsList: any[], node: BaseNode, naslServer: NaslServer) {
|
|
126
|
+
const target = refsList[0];
|
|
127
|
+
const newRefs = await naslServer.references({
|
|
128
|
+
file: refsList[0].file,
|
|
129
|
+
line: target.start.line,
|
|
130
|
+
offset: target.start.offset,
|
|
131
|
+
})
|
|
132
|
+
return [...newRefs.refs];
|
|
133
|
+
}
|
|
117
134
|
BaseNode.prototype.changeName = async function changeName(newValue: string, updateAll: boolean = false) {
|
|
118
135
|
try {
|
|
119
136
|
/**
|
|
@@ -121,7 +138,13 @@ BaseNode.prototype.changeName = async function changeName(newValue: string, upda
|
|
|
121
138
|
*/
|
|
122
139
|
const app = this.getAncestor('App');
|
|
123
140
|
const naslServer = (app as any).naslServer as NaslServer;
|
|
124
|
-
|
|
141
|
+
let refsList = await naslServer._isHaveRef(this);
|
|
142
|
+
// 鉴权方式 参数修改需要协同变更相关参数
|
|
143
|
+
// 但由于鉴权返回实现TS的特殊性,在查询节点的时候,只会查询类型参数的引用,导致引用查找缺失
|
|
144
|
+
// 因此需要手动更新一下
|
|
145
|
+
if (isParam(this) && isAuthLogicForCallInterface(this.parentNode)) {
|
|
146
|
+
refsList = await extensionRefForAuthLogicForCallInterfaceParams(refsList, this, naslServer);
|
|
147
|
+
}
|
|
125
148
|
// 是不是有引用有的话,就返回
|
|
126
149
|
/**
|
|
127
150
|
* @param this 当前重命名的节点
|
|
@@ -185,8 +208,16 @@ BaseNode.prototype.changeName = async function changeName(newValue: string, upda
|
|
|
185
208
|
} else {
|
|
186
209
|
if (_this.concept === 'AuthLogicForCallInterface' && itemNode.concept === 'CallAuthInterface') {
|
|
187
210
|
const { calleewholeKey } = itemNode;
|
|
188
|
-
|
|
189
|
-
|
|
211
|
+
let targetItf: AuthInterface;
|
|
212
|
+
const connector = itemNode.getAncestor('Connector') as Connector;
|
|
213
|
+
if (connector) {
|
|
214
|
+
targetItf = connector.interfaces?.find((itf: Interface | AuthInterface) => {
|
|
215
|
+
return calleewholeKey.endsWith(itf.name);
|
|
216
|
+
}) as AuthInterface;
|
|
217
|
+
} else {
|
|
218
|
+
targetItf = getNodeByNodeCallee(App, calleewholeKey)
|
|
219
|
+
}
|
|
220
|
+
targetItf?.setAuthLogic?.(newValue);
|
|
190
221
|
// 需要触发更新,否则对应的ts文件不会更新会导致鉴权方式找不到报错
|
|
191
222
|
itemNode.update({});
|
|
192
223
|
} else {
|
|
@@ -231,7 +231,7 @@ function createType2Annotation(type: string, parentPrefix?: string): TypeAnnotat
|
|
|
231
231
|
}
|
|
232
232
|
return typeAnnotation;
|
|
233
233
|
}
|
|
234
|
-
export function getPlatformType(type: string): string {
|
|
234
|
+
export function getPlatformType(type: string, node?: types.SyntaxNode): string {
|
|
235
235
|
let tsType = '';
|
|
236
236
|
|
|
237
237
|
if (type?.includes(': ')) {
|
|
@@ -241,7 +241,7 @@ export function getPlatformType(type: string): string {
|
|
|
241
241
|
tsType = type;
|
|
242
242
|
}
|
|
243
243
|
tsType = tsType.replaceAll(' ', '');
|
|
244
|
-
const namespacePrefix = ['app', 'extensions', 'apis', 'components', 'nasl'];
|
|
244
|
+
const namespacePrefix = ['app', 'extensions', 'apis', 'components', 'nasl', 'connector'];
|
|
245
245
|
if (tsType === 'String') {
|
|
246
246
|
return 'nasl.core.String';
|
|
247
247
|
} else if (tsType === 'Boolean') {
|
|
@@ -253,6 +253,9 @@ export function getPlatformType(type: string): string {
|
|
|
253
253
|
const first = strTypes[0];
|
|
254
254
|
// 如果不是这几个前缀就加一个namespace
|
|
255
255
|
if (!namespacePrefix.includes(first)) {
|
|
256
|
+
if (node && (node as any)?.connector) {
|
|
257
|
+
return `${(node as any)?.connector?.getNamespacePrefix || ''}${tsType}`;
|
|
258
|
+
};
|
|
256
259
|
return 'app.' + tsType;
|
|
257
260
|
}
|
|
258
261
|
}
|
|
@@ -623,7 +626,7 @@ export function formatVariableData(data: unknown | variableItem[], node: types.S
|
|
|
623
626
|
}
|
|
624
627
|
}
|
|
625
628
|
}
|
|
626
|
-
typeKey = getPlatformType(currentType);
|
|
629
|
+
typeKey = getPlatformType(currentType, node);
|
|
627
630
|
item.typeAnnotation = displayString2TypeAnnotation(typeKey);
|
|
628
631
|
}
|
|
629
632
|
} else if (item instanceof StructureProperty || item instanceof EntityProperty) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import CallConnector from '../concepts/CallConnector__';
|
|
2
|
-
import { App } from '..';
|
|
3
|
-
import Connector from '../concepts/Connector__';
|
|
4
|
-
import Connection from '../concepts/Connection__';
|
|
1
|
+
import type CallConnector from '../concepts/CallConnector__';
|
|
2
|
+
import type { App } from '..';
|
|
3
|
+
import type Connector from '../concepts/Connector__';
|
|
4
|
+
import type Connection from '../concepts/Connection__';
|
|
5
5
|
|
|
6
6
|
export function getConnections(node: CallConnector) {
|
|
7
7
|
const app = node?.rootNode as App;
|
|
@@ -91,11 +91,11 @@ function notifyTsWorkToUpdateConnections(app: App, connector: Connector) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
export function publishConnector(app: App, connector: Connector) {
|
|
94
|
-
const dependenciesNames = app.
|
|
94
|
+
const dependenciesNames = app.connectorDependencies.map((dep) => dep.name);
|
|
95
95
|
// 已经存在,直接更新
|
|
96
96
|
if (dependenciesNames.includes(connector.name)) {
|
|
97
|
-
const connectorIndex = app.
|
|
98
|
-
const oldConnector = app.
|
|
97
|
+
const connectorIndex = app.connectorDependencies.findIndex((dep) => dep.name === connector.name);
|
|
98
|
+
const oldConnector = app.connectorDependencies[connectorIndex] as Connector;
|
|
99
99
|
app.removeConnector(oldConnector);
|
|
100
100
|
// 由于 CallInterface 会在setTimeout 中处理删除Interface
|
|
101
101
|
// 为了防止误删已经增加的。需要同样做一个延迟操作
|
package/src/server/getLogics.ts
CHANGED
|
@@ -147,7 +147,7 @@ function getElementsMethods(likeComponent: View | BusinessComponent, parentNodeN
|
|
|
147
147
|
}
|
|
148
148
|
const viewElement = new Namespace({
|
|
149
149
|
title: toHump(item.name),
|
|
150
|
-
logics: eleLogis.filter(e => e).map((item: Logic) => Logic.from(item.toJSON())),
|
|
150
|
+
logics: eleLogis.filter(e => e?.toJSON).map((item: Logic) => Logic.from(item.toJSON())),
|
|
151
151
|
path,
|
|
152
152
|
originConcept: 'ViewElement',
|
|
153
153
|
});
|
|
@@ -185,8 +185,12 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
|
|
|
185
185
|
pItem.originConcept = 'Process';
|
|
186
186
|
return pItem;
|
|
187
187
|
});
|
|
188
|
-
|
|
189
|
-
const
|
|
188
|
+
// 连接器 相关迁移到了 conenctorDependencies 下,因此这边需要扩展
|
|
189
|
+
const dependencies = [
|
|
190
|
+
...app.dependencies,
|
|
191
|
+
...(app.connectorDependencies || [])
|
|
192
|
+
]; //.filter((d) => d.enable);
|
|
193
|
+
const extensions = [...app.dependencies, ...(app.connectorDependencies || [])]
|
|
190
194
|
.map((dep) => moduleToLogicNamesapce(dep, app.overriddenLogics))
|
|
191
195
|
.filter((item) => item.logics && item.logics.length);
|
|
192
196
|
const dependEntityNs: Namespace[] = [];
|
|
@@ -310,10 +314,14 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
|
|
|
310
314
|
'getIsMiniApp',
|
|
311
315
|
'navigateToUserInfo',
|
|
312
316
|
'getWeChatHeadImg',
|
|
317
|
+
'getWeChatLocation',
|
|
313
318
|
'getWeChatNickName',
|
|
314
319
|
'getWeChatPhone',
|
|
315
320
|
'getWeChatOpenid',
|
|
316
321
|
'navigateToUserPhone',
|
|
322
|
+
'navigateToScanCode',
|
|
323
|
+
'getWeChatScanCode',
|
|
324
|
+
'navigateToLocation'
|
|
317
325
|
].includes(item.name)
|
|
318
326
|
),
|
|
319
327
|
expanded: false,
|
|
@@ -398,7 +406,7 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
|
|
|
398
406
|
title: '微信',
|
|
399
407
|
logics: getStdlibNamespace()
|
|
400
408
|
.findChild('browser')
|
|
401
|
-
.logics.filter((item) => ['navigateToUserInfo', 'getWeChatHeadImg', 'getWeChatNickName', 'getWeChatOpenid', 'navigateToUserPhone', 'getWeChatPhone'].includes(item.name)),
|
|
409
|
+
.logics.filter((item) => ['navigateToUserInfo', 'getWeChatHeadImg', 'getWeChatNickName', 'getWeChatOpenid', 'navigateToUserPhone', 'getWeChatPhone','navigateToScanCode','getWeChatScanCode','navigateToLocation','getWeChatLocation'].includes(item.name)),
|
|
402
410
|
expanded: false,
|
|
403
411
|
})
|
|
404
412
|
);
|
|
@@ -469,8 +477,15 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
|
|
|
469
477
|
result.push(systemTree);
|
|
470
478
|
}
|
|
471
479
|
return result;
|
|
472
|
-
}
|
|
473
|
-
|
|
480
|
+
}
|
|
481
|
+
if (node?.concept === 'Identifier') {
|
|
482
|
+
// 之前 连接器 Connector 相关也存在与 app.dependencies 下,
|
|
483
|
+
// 现在迁移到 app.connectorDependencies 下,
|
|
484
|
+
// 为保证上下游逻辑与之前保持一致,这边做相应的扩展
|
|
485
|
+
const extensions = [
|
|
486
|
+
...app.dependencies,
|
|
487
|
+
...(app.connectorDependencies || [])
|
|
488
|
+
]
|
|
474
489
|
.map((dep) => moduleToLogicNamesapce(dep, app.overriddenLogics))
|
|
475
490
|
.filter((item) => item.logics && item.logics.length);
|
|
476
491
|
const tree = new Namespace({
|
package/src/server/naslServer.ts
CHANGED
|
@@ -92,6 +92,8 @@ import {
|
|
|
92
92
|
BusinessComponent,
|
|
93
93
|
CallEvent,
|
|
94
94
|
Paginate,
|
|
95
|
+
MsgTriggerLauncher,
|
|
96
|
+
ConnectorTrigger,
|
|
95
97
|
FrontendType,
|
|
96
98
|
InterfaceParam,
|
|
97
99
|
} from '../concepts';
|
|
@@ -113,7 +115,7 @@ import { EventEmitter } from '../common/EventEmitter';
|
|
|
113
115
|
import { traverse, FileNode } from '../utils';
|
|
114
116
|
import { withQueueExecute } from '../decorators';
|
|
115
117
|
import { getNodeByNodeCallee } from '../automate/engine/utils';
|
|
116
|
-
import { isConnection, isConnector } from '../concepts/utils/asserts';
|
|
118
|
+
import { isConnection, isConnector, isMsgTriggerEvent } from '../concepts/utils/asserts';
|
|
117
119
|
|
|
118
120
|
const EmbeddedTSFileLineMap: { [name: string]: number } = {
|
|
119
121
|
Entity: 3,
|
|
@@ -295,10 +297,17 @@ class NaslServer {
|
|
|
295
297
|
// worker = new Worker(path.join(__dirname, '../../../src/static/ts-worker.js'));
|
|
296
298
|
/// #endif
|
|
297
299
|
/// #if process.env.BUILD_TARGET !== 'node'
|
|
298
|
-
if (globalThis.window)
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
300
|
+
if (globalThis.window){
|
|
301
|
+
const source = require('!!raw-loader!../../../../public/ts-worker/1.0.0.js').default;
|
|
302
|
+
const createWorker = (code = '') => {
|
|
303
|
+
const content = [code];
|
|
304
|
+
const bold = new Blob(content);
|
|
305
|
+
const url = URL.createObjectURL(bold);
|
|
306
|
+
const worker = new Worker(url);
|
|
307
|
+
return worker;
|
|
308
|
+
};
|
|
309
|
+
this.worker = createWorker(source);
|
|
310
|
+
}
|
|
302
311
|
/// #endif
|
|
303
312
|
|
|
304
313
|
this.http = opt.http;
|
|
@@ -319,7 +328,7 @@ class NaslServer {
|
|
|
319
328
|
getSender: () => this.worker as any,
|
|
320
329
|
handleMessage: async ({ data }: any) => {
|
|
321
330
|
if (data && data.event === 'publishDiagnostics') {
|
|
322
|
-
const records = await this._resolveDiagnosticRecords(data.records);
|
|
331
|
+
const records = await this._resolveDiagnosticRecords(data.records, data.versions);
|
|
323
332
|
await this.diagnosticManager.pushAll(records);
|
|
324
333
|
try {
|
|
325
334
|
// 结束诊断和标注
|
|
@@ -575,7 +584,7 @@ class NaslServer {
|
|
|
575
584
|
|
|
576
585
|
if (module instanceof Connector) {
|
|
577
586
|
yield* getTsFiles(triggerLaunchers, 'triggerLauncher');
|
|
578
|
-
yield* getTsFiles(authLogicsForCallInterface, 'authLogicForCallInterface');
|
|
587
|
+
// yield* getTsFiles(authLogicsForCallInterface, 'authLogicForCallInterface');
|
|
579
588
|
yield* getTsFiles(concat(namespaces, 'logics'), 'namespaces_logic');
|
|
580
589
|
}
|
|
581
590
|
|
|
@@ -607,6 +616,11 @@ class NaslServer {
|
|
|
607
616
|
fileContent: result.code,
|
|
608
617
|
}));
|
|
609
618
|
|
|
619
|
+
// 全量生成TS文件,因此清空版本记录
|
|
620
|
+
files.forEach((f)=>{
|
|
621
|
+
this.diagnosticManager.deleteVersionByFilePath(f.file);
|
|
622
|
+
});
|
|
623
|
+
|
|
610
624
|
await this.writeFiles(files);
|
|
611
625
|
this._debugInFileStorage(app, files);
|
|
612
626
|
// 修改名称回调
|
|
@@ -624,6 +638,7 @@ class NaslServer {
|
|
|
624
638
|
const otherModules = [
|
|
625
639
|
...app.integration?.connectors ?? [],
|
|
626
640
|
...app.dependencies ?? [],
|
|
641
|
+
...app.connectorDependencies ?? [],
|
|
627
642
|
...app.interfaceDependencies ?? [],
|
|
628
643
|
];
|
|
629
644
|
|
|
@@ -703,17 +718,17 @@ class NaslServer {
|
|
|
703
718
|
|
|
704
719
|
/// #if process.env.NODE_ENV === 'development'
|
|
705
720
|
// 首次尝试请求
|
|
706
|
-
await this.http.post(
|
|
721
|
+
await this.http.post(`/proxy/nasl-storage/api/App/debugEmbedded?id=${ app.id}`, openFiles[0]).catch(() => (this.openDebugEmbedded = false));
|
|
707
722
|
if (this.openDebugEmbedded && globalThis.window) {
|
|
708
723
|
// For TS build
|
|
709
724
|
try {
|
|
710
725
|
let canDebug = true;
|
|
711
|
-
await this.http.post(
|
|
726
|
+
await this.http.post(`/proxy/nasl-storage/api/App/debugEmbedded?id=${ app.id}`, openFiles[0]).catch(() => (canDebug = false));
|
|
712
727
|
|
|
713
728
|
if (canDebug) {
|
|
714
729
|
await Promise.all(
|
|
715
730
|
openFiles.map(async (file) => {
|
|
716
|
-
const res = await this.http.post(
|
|
731
|
+
const res = await this.http.post(`/proxy/nasl-storage/api/App/debugEmbedded?id=${ app.id}`, file);
|
|
717
732
|
return res.data;
|
|
718
733
|
})
|
|
719
734
|
);
|
|
@@ -1012,13 +1027,11 @@ class NaslServer {
|
|
|
1012
1027
|
}
|
|
1013
1028
|
|
|
1014
1029
|
getDiagnosticRecordsAndPushAll(fileNames?: Array<string>) {
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
// return this.messager.requestCommand('getDiagnosticRecords', fileNames, versions);
|
|
1021
|
-
return this.messager.requestCommand('getDiagnosticRecords', fileNames);
|
|
1030
|
+
invokeCommand('naslServer:startWork');
|
|
1031
|
+
const versions = fileNames?.map((x) => {
|
|
1032
|
+
return this.diagnosticManager.incrementVersionByFilePath(x);
|
|
1033
|
+
});
|
|
1034
|
+
return this.messager.requestCommand('getDiagnosticRecords', fileNames, versions);
|
|
1022
1035
|
}
|
|
1023
1036
|
|
|
1024
1037
|
/**
|
|
@@ -1029,7 +1042,18 @@ class NaslServer {
|
|
|
1029
1042
|
node.tsErrorDetail = tsErrorDetail;
|
|
1030
1043
|
}
|
|
1031
1044
|
|
|
1032
|
-
private *_resolveDiagnosticRecordsWithGenerator(records: Array<DiagnosticRecord
|
|
1045
|
+
private *_resolveDiagnosticRecordsWithGenerator(records: Array<DiagnosticRecord>, versions: number[] | undefined) {
|
|
1046
|
+
// 这个操作几乎没有性能开销,在主线程完成即可
|
|
1047
|
+
// 保证每个文件的record的版本正确,防止竞态
|
|
1048
|
+
// 若版本不符合,则忽略此record
|
|
1049
|
+
records = records.filter((x, index) => {
|
|
1050
|
+
const requestVersion = versions?.[index] ?? 0;
|
|
1051
|
+
if (!x.filePath) {
|
|
1052
|
+
return true;
|
|
1053
|
+
}
|
|
1054
|
+
return this.diagnosticManager.getVersionByFilePath(x.filePath) === requestVersion;
|
|
1055
|
+
});
|
|
1056
|
+
|
|
1033
1057
|
// 热更新类型标注
|
|
1034
1058
|
if (records.length) {
|
|
1035
1059
|
yield* this._incrementalAnnotationJSONWithGenerator(records);
|
|
@@ -1234,8 +1258,8 @@ class NaslServer {
|
|
|
1234
1258
|
* @returns 过滤或者转换后的诊断结果
|
|
1235
1259
|
*/
|
|
1236
1260
|
@withQueueExecute('diagnostic')
|
|
1237
|
-
private _resolveDiagnosticRecords(records: Array<DiagnosticRecord
|
|
1238
|
-
return utils.timeSlicingWithGenerator(this._resolveDiagnosticRecordsWithGenerator(records));
|
|
1261
|
+
private _resolveDiagnosticRecords(records: Array<DiagnosticRecord>, versions: number[] | undefined) {
|
|
1262
|
+
return utils.timeSlicingWithGenerator(this._resolveDiagnosticRecordsWithGenerator(records, versions));
|
|
1239
1263
|
}
|
|
1240
1264
|
|
|
1241
1265
|
/**
|
|
@@ -1619,20 +1643,19 @@ class NaslServer {
|
|
|
1619
1643
|
/** 是否被 触发器依赖, 如果存在,返回第一个触发器对应的名称 */
|
|
1620
1644
|
isRefedByTriggerAndReturnFirstRef(fileNode: BaseNode): Promise<{
|
|
1621
1645
|
isRefedByTrigger: boolean;
|
|
1622
|
-
|
|
1646
|
+
fRefNames: string[];
|
|
1623
1647
|
}> {
|
|
1624
1648
|
return this._isHaveRef(fileNode).then((refs) => {
|
|
1625
1649
|
const basePath = TriggerLauncher.getEmbeddedFileBasePath(fileNode.rootNode as App);
|
|
1626
1650
|
let flag = false;
|
|
1627
|
-
let
|
|
1651
|
+
let fRefNames = [];
|
|
1628
1652
|
try {
|
|
1629
1653
|
for (const ref of refs) {
|
|
1630
1654
|
const { file } = ref;
|
|
1631
1655
|
if (file.startsWith(basePath)) {
|
|
1632
1656
|
flag = true;
|
|
1633
1657
|
// file: /embedded/tttta/triggerLaunchers/订阅配置_asd.ts
|
|
1634
|
-
|
|
1635
|
-
break;
|
|
1658
|
+
fRefNames.push(file.split(basePath)[1].split('.')[0]);
|
|
1636
1659
|
}
|
|
1637
1660
|
}
|
|
1638
1661
|
} catch (error) {
|
|
@@ -1640,7 +1663,7 @@ class NaslServer {
|
|
|
1640
1663
|
}
|
|
1641
1664
|
return {
|
|
1642
1665
|
isRefedByTrigger: flag,
|
|
1643
|
-
|
|
1666
|
+
fRefNames,
|
|
1644
1667
|
};
|
|
1645
1668
|
});
|
|
1646
1669
|
// const refs = await this._isHaveRef(fileNode);
|
|
@@ -1669,29 +1692,29 @@ class NaslServer {
|
|
|
1669
1692
|
/**
|
|
1670
1693
|
* 是否符合 触发器规则
|
|
1671
1694
|
* 规则:
|
|
1672
|
-
* 1. 入参仅有一个,且必须为string类型
|
|
1673
|
-
* 2. 不允许有返回值
|
|
1674
1695
|
*/
|
|
1675
|
-
isTriggerRule(fileNode:
|
|
1676
|
-
const
|
|
1677
|
-
|
|
1678
|
-
let returnLength = 0;
|
|
1696
|
+
isTriggerRule(fileNode: Logic, fRefNames: string[]) {
|
|
1697
|
+
const app = fileNode.rootNode as App;
|
|
1698
|
+
const targetLaunchers = app.triggerLaunchers?.filter((triggerLauncher) => fRefNames.includes(triggerLauncher.name));
|
|
1679
1699
|
let flag = true;
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
const
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1700
|
+
let errorFRefNames: string[] = [];
|
|
1701
|
+
targetLaunchers?.forEach((triggerLauncher: MsgTriggerLauncher) => {
|
|
1702
|
+
const targetMsgTrigger = triggerLauncher?.connection?.connector?.triggers?.find((trigger: ConnectorTrigger) => isMsgTriggerEvent(trigger.triggerEvent));
|
|
1703
|
+
if (targetMsgTrigger) {
|
|
1704
|
+
const callBackLogic = targetMsgTrigger.triggerEvent.callBackLogic as unknown as TypeAnnotation;
|
|
1705
|
+
const { returnType, typeArguments } = callBackLogic;
|
|
1706
|
+
const sameInReturn = utils.isSameInType(returnType, fileNode.returns?.map((re) => re.typeAnnotation));
|
|
1707
|
+
const sameInParams = utils.isSameInType(typeArguments, fileNode.params?.map((param) => param.typeAnnotation));
|
|
1708
|
+
if (!sameInReturn || !sameInParams) {
|
|
1687
1709
|
flag = false;
|
|
1710
|
+
errorFRefNames.push(triggerLauncher.name);
|
|
1688
1711
|
}
|
|
1689
1712
|
}
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1713
|
+
})
|
|
1714
|
+
return {
|
|
1715
|
+
isTriggerRule: flag,
|
|
1716
|
+
errorFRefNames,
|
|
1717
|
+
};
|
|
1695
1718
|
}
|
|
1696
1719
|
|
|
1697
1720
|
/**
|
|
@@ -2182,8 +2205,8 @@ class NaslServer {
|
|
|
2182
2205
|
}
|
|
2183
2206
|
}
|
|
2184
2207
|
else if (fileNode instanceof Logic || fileNode instanceof OverriddenLogic) {
|
|
2185
|
-
const { isRefedByTrigger,
|
|
2186
|
-
if (fileNode instanceof Logic && fileNode?.exportInterface) {
|
|
2208
|
+
const { isRefedByTrigger, fRefNames } = yield this.isRefedByTriggerAndReturnFirstRef(fileNode);
|
|
2209
|
+
if (fileNode instanceof Logic && fileNode?.exportInterface && fileNode.calleewholeKey.startsWith('app.logics')) {
|
|
2187
2210
|
let isSame = true;
|
|
2188
2211
|
const itf = (fileNode.exportInterface as Interface);
|
|
2189
2212
|
const { params: logicParams, returns: logicReturns } = fileNode;
|
|
@@ -2210,7 +2233,7 @@ class NaslServer {
|
|
|
2210
2233
|
if (isSame && logicReturns?.length === itfReturns?.length && logicReturns?.length > 0) {
|
|
2211
2234
|
if (logicReturns[0].name !== itfReturns[0].name) {
|
|
2212
2235
|
isSame = false;
|
|
2213
|
-
} else if (!logicReturns[0]?.typeAnnotation
|
|
2236
|
+
} else if (!(logicReturns[0]?.typeAnnotation ?? logicReturns[0]?.__TypeAnnotation)?.isSame?.(itfReturns[0]?.typeAnnotation)) {
|
|
2214
2237
|
isSame = false;
|
|
2215
2238
|
}
|
|
2216
2239
|
}
|
|
@@ -2228,13 +2251,16 @@ class NaslServer {
|
|
|
2228
2251
|
diagnostics.push(diagnostic);
|
|
2229
2252
|
}
|
|
2230
2253
|
}
|
|
2231
|
-
if (isRefedByTrigger
|
|
2232
|
-
const
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2254
|
+
if (isRefedByTrigger) {
|
|
2255
|
+
const { isTriggerRule, errorFRefNames } = this.isTriggerRule(fileNode as Logic, fRefNames);
|
|
2256
|
+
if (!isTriggerRule) {
|
|
2257
|
+
const diagnostic = {
|
|
2258
|
+
node: fileNode,
|
|
2259
|
+
severity: 'error',
|
|
2260
|
+
message: `${fileNode.name} 已被消息订阅配置 ${errorFRefNames.join(',')} 引用,但出入参数类型不匹配,或数量不一致`,
|
|
2261
|
+
};
|
|
2262
|
+
diagnostics.push(diagnostic);
|
|
2263
|
+
}
|
|
2238
2264
|
}
|
|
2239
2265
|
|
|
2240
2266
|
yield* utils.wrapIteratorToGenerator(fileNode.sourceMap.entries(), function* wrapIterator([node, value]) {
|
|
@@ -2780,8 +2806,14 @@ class NaslServer {
|
|
|
2780
2806
|
* @returns 处理后的结果
|
|
2781
2807
|
*/
|
|
2782
2808
|
private *_resolveDiagnosticWithGenerator(diagnostic: tsProtocol.DiagnosticWithFileName, fileNode: FileNode, record: DiagnosticRecord) {
|
|
2809
|
+
// 连接器只校验编辑态的连接器
|
|
2810
|
+
if (fileNode?.getAncestor('Connector') && !fileNode.getAncestor('Integration')) {
|
|
2811
|
+
return;
|
|
2812
|
+
}
|
|
2813
|
+
|
|
2783
2814
|
// 拓展模块中的翻译先过滤掉,因为有错用户也不能修改
|
|
2784
|
-
|
|
2815
|
+
// module属性下也可以拿到 connector,所以要过滤掉
|
|
2816
|
+
if (((fileNode as any).module && (fileNode as any).module.concept !== 'Connector') && !(fileNode instanceof ConfigProperty)) {
|
|
2785
2817
|
return;
|
|
2786
2818
|
}
|
|
2787
2819
|
if (fileNode.concept === 'OverriddenLogic' && diagnostic.text === `'__LogicEmpty' is declared but its value is never read.`) {
|
|
@@ -2974,11 +3006,11 @@ class NaslServer {
|
|
|
2974
3006
|
refsList = [...refsList, ...newRefs.refs];
|
|
2975
3007
|
}
|
|
2976
3008
|
}
|
|
2977
|
-
// 根据 moduleName 中是否存在
|
|
2978
|
-
const isStable = moduleName.includes(`/embedded/${appName}/
|
|
3009
|
+
// 根据 moduleName 中是否存在 connectorDependencies 来判断是否为稳定态的Connector
|
|
3010
|
+
const isStable = moduleName.includes(`/embedded/${appName}/connectorDependencies`);
|
|
2979
3011
|
// 根据 item 的 file 去重
|
|
2980
3012
|
refsList = refsList.filter((item, index, arr) => {
|
|
2981
|
-
const tempStable = item.file.includes(`/embedded/${appName}/
|
|
3013
|
+
const tempStable = item.file.includes(`/embedded/${appName}/connectorDependencies`); // 约定
|
|
2982
3014
|
const isGlobalLogic = item.file.includes(`/embedded/${appName}/logics`); // 约定
|
|
2983
3015
|
// 关于 isGlobalLogic 单独判断的说明:
|
|
2984
3016
|
// 全局逻辑与Connector 有直接关联的只有两种情况
|
|
@@ -4422,6 +4454,7 @@ class NaslServer {
|
|
|
4422
4454
|
if (this.changeStackList?.length) {
|
|
4423
4455
|
throw new Error(`当前还有${this.changeStackList.length}个文件还在执行更新操作`);
|
|
4424
4456
|
}
|
|
4457
|
+
this.logger.time('全量标注');
|
|
4425
4458
|
const nodes: QuickInfoNodes = [];
|
|
4426
4459
|
this.file2NodeMap.forEach((fileNode, filePath) => {
|
|
4427
4460
|
// 先不排除view,传递给后端的时候,去除views下的标注
|
|
@@ -4435,12 +4468,16 @@ class NaslServer {
|
|
|
4435
4468
|
});
|
|
4436
4469
|
}
|
|
4437
4470
|
});
|
|
4438
|
-
this.logger.time('全量标注');
|
|
4439
4471
|
const typesMap = await this.getQuickInfoNodesTypeMap(nodes, true);
|
|
4440
|
-
this.logger.timeEnd('全量标注');
|
|
4441
4472
|
|
|
4442
4473
|
const json = app.toJSON();
|
|
4443
|
-
|
|
4474
|
+
|
|
4475
|
+
this.logger.timeEnd('全量标注');
|
|
4476
|
+
|
|
4477
|
+
// 测试环境打印数据
|
|
4478
|
+
if (utils.isTestBrowser) {
|
|
4479
|
+
this.logger.info('全量标注数据', json);
|
|
4480
|
+
}
|
|
4444
4481
|
|
|
4445
4482
|
if (releaseFlag) {
|
|
4446
4483
|
// 全量标注后对json进行一些修改,为了服务端翻译处理
|
|
@@ -4771,7 +4808,10 @@ class NaslServer {
|
|
|
4771
4808
|
* @param result toTs生成的内容
|
|
4772
4809
|
*/
|
|
4773
4810
|
async handleDelete(fileNode: BaseNode, targetNode: BaseNode, result: utils.EmbeddedTSFileResult) {
|
|
4774
|
-
const filePath = (fileNode as FileNode)
|
|
4811
|
+
const filePath = (fileNode as FileNode)?.getEmbeddedFilePath();
|
|
4812
|
+
if (!filePath) {
|
|
4813
|
+
return;
|
|
4814
|
+
}
|
|
4775
4815
|
// 如果要删除,而且当前要删Logic就直接删除并且清除错误
|
|
4776
4816
|
/**
|
|
4777
4817
|
* 删除节点中的一个内容,删除了以后,就查一下引用的地方一起查一下异常
|
|
@@ -5076,9 +5116,7 @@ class NaslServer {
|
|
|
5076
5116
|
}
|
|
5077
5117
|
|
|
5078
5118
|
async receiveHandleChange($event: EventPayload) {
|
|
5079
|
-
|
|
5080
|
-
invokeCommand('naslServer:startWork');
|
|
5081
|
-
}
|
|
5119
|
+
invokeCommand('naslServer:startWork');
|
|
5082
5120
|
|
|
5083
5121
|
this.logger.time('语言服务变更');
|
|
5084
5122
|
this.singleFileChangeIng = true;
|
|
@@ -5132,6 +5170,10 @@ class NaslServer {
|
|
|
5132
5170
|
}
|
|
5133
5171
|
|
|
5134
5172
|
const fileTsPath = fileNode.getEmbeddedFilePath();
|
|
5173
|
+
|
|
5174
|
+
// 递增ts文件版本号
|
|
5175
|
+
this.diagnosticManager.incrementVersionByFilePath(fileTsPath);
|
|
5176
|
+
|
|
5135
5177
|
const result = await utils.timeSlicingWithGenerator(fileNode.toEmbeddedTSFile());
|
|
5136
5178
|
|
|
5137
5179
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -5189,6 +5231,7 @@ class NaslServer {
|
|
|
5189
5231
|
if (process.env.NODE_ENV === 'development') {
|
|
5190
5232
|
console.info('校验以下文件', Array.from(this.filesToCheck));
|
|
5191
5233
|
}
|
|
5234
|
+
|
|
5192
5235
|
await this.getDiagnosticRecordsAndPushAll(Array.from(this.filesToCheck));
|
|
5193
5236
|
this.filesToCheck.clear();
|
|
5194
5237
|
}
|
|
@@ -481,7 +481,7 @@ async function doAction(app: any, actionItem: any) {
|
|
|
481
481
|
const _path: string = event.originEvent.path;
|
|
482
482
|
const _root = _path.split('.')?.[1] || '';
|
|
483
483
|
const breakabled = isBreakpointEvent(event);
|
|
484
|
-
if (['backend', 'overriddenLogics', 'dataSources', 'processes', 'roles', 'logics', 'enums', 'structures', 'interfaces', 'interfaceDependencies', 'configuration', 'dependencies', 'authLogics', 'authLogicsForCallInterface', 'triggerLaunchers', 'connections'].some((item) => _root.startsWith(item))) {
|
|
484
|
+
if (['backend', 'overriddenLogics', 'dataSources', 'processes', 'roles', 'logics', 'enums', 'structures', 'interfaces', 'interfaceDependencies', 'configuration', 'dependencies', 'authLogics', 'authLogicsForCallInterface', 'triggerLaunchers', 'connections', 'connectorDependencies'].some((item) => _root.startsWith(item))) {
|
|
485
485
|
if (!breakabled) {
|
|
486
486
|
hasBackEnd = true;
|
|
487
487
|
}
|