@lcap/nasl 3.7.0-beta.3 → 3.7.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/breakpoint/store/core.js +1 -7
- package/out/breakpoint/store/core.js.map +1 -1
- package/out/common/BaseNode.js +1 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +5 -1
- package/out/concepts/App__.js +30 -14
- 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/BindAttribute__.js +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.js +5 -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/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/EnumItem__.js +1 -1
- package/out/concepts/EnumItem__.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 +6 -0
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -1
- package/out/concepts/Logic__.js +5 -1
- 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__.d.ts +1 -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/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/basics/stdlib/nasl.util.js +217 -1
- package/out/concepts/basics/stdlib/nasl.util.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 +7 -4
- 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 +10 -7
- 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 +2 -0
- 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/prompt/analyzeClaims.js +2 -0
- package/out/natural/prompt/analyzeClaims.js.map +1 -1
- package/out/natural/prompt/analyzeFormatOutput.js +1 -0
- package/out/natural/prompt/analyzeFormatOutput.js.map +1 -1
- package/out/natural/prompt/analyzeTasks.js +3 -1
- package/out/natural/prompt/analyzeTasks.js.map +1 -1
- package/out/natural/prompt/executeClaims.js +4 -0
- package/out/natural/prompt/executeClaims.js.map +1 -1
- package/out/natural/transformTSCode.js +32 -4
- 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 +133 -59
- package/out/server/naslServer.js.map +1 -1
- package/out/service/storage/init.js +2 -2
- package/out/service/storage/init.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/package.json +1 -1
- package/sandbox/stdlib/nasl.browser.ts +5 -0
- package/sandbox/stdlib/nasl.util.ts +3 -1
- package/src/automate/engine/utils.js +1 -1
- package/src/breakpoint/store/core.ts +2 -7
- package/src/common/BaseNode.ts +1 -1
- package/src/concepts/App__.ts +32 -16
- package/src/concepts/Argument__.ts +6 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +15 -4
- package/src/concepts/BindAttribute__.ts +1 -1
- package/src/concepts/BindDirective__.ts +1 -1
- package/src/concepts/CallAuthInterface__.ts +8 -1
- package/src/concepts/CallInterface__.ts +121 -16
- 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/EnumItem__.ts +1 -1
- package/src/concepts/InterfaceTriggerEvent__.ts +88 -0
- package/src/concepts/Interface__.ts +9 -8
- package/src/concepts/LogicItem__.ts +7 -0
- package/src/concepts/Logic__.ts +7 -2
- 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 +2 -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/basics/stdlib/nasl.browser.ts +42 -0
- package/src/concepts/basics/stdlib/nasl.configuration.ts +8 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +217 -1
- 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 +9 -5
- package/src/generator/release-body/data.ts +10 -7
- package/src/generator/release-body/internal.ts +1 -0
- package/src/generator/release-body/types.ts +2 -0
- package/src/manager/diagnostic.ts +35 -31
- package/src/natural/prompt/analyzeClaims.ts +2 -0
- package/src/natural/prompt/analyzeFormatOutput.ts +1 -0
- package/src/natural/prompt/analyzeTasks.ts +3 -1
- package/src/natural/prompt/executeClaims.ts +4 -0
- package/src/natural/transformTSCode.ts +33 -5
- 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 +144 -63
- package/src/service/storage/init.ts +2 -2
- package/src/utils/index.ts +36 -1
- package/ts-worker/src/index.js +4 -3
|
@@ -145,12 +145,15 @@ import type { AuthInterface } from '../AuthInterface__';
|
|
|
145
145
|
import type { CallAuthInterface } from '../CallAuthInterface__';
|
|
146
146
|
import type { TriggerEvent } from '../TriggerEvent__';
|
|
147
147
|
import type { MsgTriggerEvent } from '../MsgTriggerEvent__';
|
|
148
|
+
import type { InterfaceTriggerEvent } from '../InterfaceTriggerEvent__';
|
|
148
149
|
import type { ConnectorTrigger } from '../ConnectorTrigger__';
|
|
149
150
|
import type { TriggerLauncher } from '../TriggerLauncher__';
|
|
151
|
+
import type { ConnectorTriggerLauncher } from '../ConnectorTriggerLauncher__';
|
|
150
152
|
import type { MsgTriggerLauncher } from '../MsgTriggerLauncher__';
|
|
151
153
|
import type { Connector } from '../Connector__';
|
|
152
154
|
import type { CallConnector } from '../CallConnector__';
|
|
153
155
|
import type { Connection } from '../Connection__';
|
|
156
|
+
import type { ConnectorLogic } from '../ConnectorLogic__';
|
|
154
157
|
|
|
155
158
|
/** concept 与类类型映射表 */
|
|
156
159
|
export interface ConceptTypeofClassMap {
|
|
@@ -301,12 +304,15 @@ export interface ConceptTypeofClassMap {
|
|
|
301
304
|
CallAuthInterface: typeof CallAuthInterface;
|
|
302
305
|
TriggerEvent: typeof TriggerEvent;
|
|
303
306
|
MsgTriggerEvent: typeof MsgTriggerEvent;
|
|
307
|
+
InterfaceTriggerEvent: typeof InterfaceTriggerEvent;
|
|
304
308
|
ConnectorTrigger: typeof ConnectorTrigger;
|
|
305
309
|
TriggerLauncher: typeof TriggerLauncher;
|
|
310
|
+
ConnectorTriggerLauncher: typeof ConnectorTriggerLauncher;
|
|
306
311
|
MsgTriggerLauncher: typeof MsgTriggerLauncher;
|
|
307
312
|
Connector: typeof Connector;
|
|
308
313
|
CallConnector: typeof CallConnector;
|
|
309
314
|
Connection: typeof Connection;
|
|
315
|
+
ConnectorLogic: typeof ConnectorLogic;
|
|
310
316
|
}
|
|
311
317
|
|
|
312
318
|
/** concept 与类实例类型映射表 */
|
|
@@ -458,12 +464,15 @@ export interface ConceptClassMap {
|
|
|
458
464
|
CallAuthInterface: CallAuthInterface;
|
|
459
465
|
TriggerEvent: TriggerEvent;
|
|
460
466
|
MsgTriggerEvent: MsgTriggerEvent;
|
|
467
|
+
InterfaceTriggerEvent: InterfaceTriggerEvent;
|
|
461
468
|
ConnectorTrigger: ConnectorTrigger;
|
|
462
469
|
TriggerLauncher: TriggerLauncher;
|
|
470
|
+
ConnectorTriggerLauncher: ConnectorTriggerLauncher;
|
|
463
471
|
MsgTriggerLauncher: MsgTriggerLauncher;
|
|
464
472
|
Connector: Connector;
|
|
465
473
|
CallConnector: CallConnector;
|
|
466
474
|
Connection: Connection;
|
|
475
|
+
ConnectorLogic: ConnectorLogic;
|
|
467
476
|
}
|
|
468
477
|
|
|
469
478
|
export type SyntaxNode =
|
|
@@ -607,14 +616,16 @@ export type SyntaxNode =
|
|
|
607
616
|
| ViewBlockWithImage
|
|
608
617
|
| AuthInterface
|
|
609
618
|
| CallAuthInterface
|
|
610
|
-
| TriggerEvent
|
|
611
619
|
| MsgTriggerEvent
|
|
620
|
+
| InterfaceTriggerEvent
|
|
612
621
|
| ConnectorTrigger
|
|
613
622
|
| TriggerLauncher
|
|
623
|
+
| ConnectorTriggerLauncher
|
|
614
624
|
| MsgTriggerLauncher
|
|
615
625
|
| Connector
|
|
616
626
|
| CallConnector
|
|
617
|
-
| Connection
|
|
627
|
+
| Connection
|
|
628
|
+
| ConnectorLogic;
|
|
618
629
|
|
|
619
630
|
export type SyntaxNodeConcept = SyntaxNode['concept'];
|
|
620
631
|
|
|
@@ -640,7 +651,8 @@ export type LogicNode =
|
|
|
640
651
|
| Logic
|
|
641
652
|
| AuthLogic
|
|
642
653
|
| AuthLogicForCallInterface
|
|
643
|
-
| BusinessLogic
|
|
654
|
+
| BusinessLogic
|
|
655
|
+
| ConnectorLogic;
|
|
644
656
|
|
|
645
657
|
export type LogicNodeConcept = LogicNode['concept'];
|
|
646
658
|
|
|
@@ -766,13 +778,20 @@ export type ViewBlockNode =
|
|
|
766
778
|
export type ViewBlockNodeConcept = ViewBlockNode['concept'];
|
|
767
779
|
|
|
768
780
|
export type TriggerEventNode =
|
|
769
|
-
|
|
|
770
|
-
|
|
|
781
|
+
| MsgTriggerEvent
|
|
782
|
+
| InterfaceTriggerEvent;
|
|
771
783
|
|
|
772
784
|
export type TriggerEventNodeConcept = TriggerEventNode['concept'];
|
|
773
785
|
|
|
774
786
|
export type TriggerLauncherNode =
|
|
775
787
|
| TriggerLauncher
|
|
788
|
+
| ConnectorTriggerLauncher
|
|
789
|
+
| MsgTriggerLauncher;
|
|
790
|
+
|
|
791
|
+
export type TriggerLauncherNodeConcept = TriggerLauncherNode['concept'];
|
|
792
|
+
|
|
793
|
+
export type ConnectorTriggerLauncherNode =
|
|
794
|
+
| ConnectorTriggerLauncher
|
|
776
795
|
| MsgTriggerLauncher;
|
|
777
796
|
|
|
778
|
-
export type
|
|
797
|
+
export type ConnectorTriggerLauncherNodeConcept = ConnectorTriggerLauncherNode['concept'];
|
|
@@ -101,6 +101,7 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
101
101
|
|
|
102
102
|
app.dependencies && modules.push(...app.dependencies);
|
|
103
103
|
app.interfaceDependencies && modules.push(...app.interfaceDependencies);
|
|
104
|
+
app.connectorDependencies && modules.push(...app.connectorDependencies);
|
|
104
105
|
frontend.views && views.push(...frontend.views);
|
|
105
106
|
modules.forEach((module: Module) => {
|
|
106
107
|
module.views && views.push(...module.views);
|
|
@@ -367,7 +368,6 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
367
368
|
const assetsInfo = app.genAllAssetsInfo(STATIC_URL, frontend.type);
|
|
368
369
|
const customNames = JSON5.stringify(assetsInfo.custom.names);
|
|
369
370
|
|
|
370
|
-
|
|
371
371
|
let content = `(function(){
|
|
372
372
|
`;
|
|
373
373
|
if (frontend.globalScaleEnabled) {
|
|
@@ -660,7 +660,12 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
660
660
|
if(config.isPreviewFe){
|
|
661
661
|
const changeToRelativePath =(str:any)=>{
|
|
662
662
|
const {pathname} = new URL(`http:${str}`)
|
|
663
|
-
|
|
663
|
+
let arr = pathname.split('/').filter(v=>v)
|
|
664
|
+
if( ['packages',config?.tenant].includes(arr[0])) {
|
|
665
|
+
return `${arr.join('/')}`
|
|
666
|
+
}else {
|
|
667
|
+
return `${arr.slice(1).join('/')}`
|
|
668
|
+
}
|
|
664
669
|
}
|
|
665
670
|
jsAssetsList = jsAssetsList.map(changeToRelativePath)
|
|
666
671
|
cssAssetsList = cssAssetsList.map(changeToRelativePath)
|
|
@@ -745,10 +750,15 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
745
750
|
}`
|
|
746
751
|
}
|
|
747
752
|
|
|
748
|
-
|
|
749
753
|
const loadMockAssets = `
|
|
750
754
|
const loadJSWrap = (arr)=>{
|
|
751
|
-
LazyLoad.js(arr.map(url=>
|
|
755
|
+
LazyLoad.js(arr.map(url=>{
|
|
756
|
+
if(url.includes('mockBundle')){
|
|
757
|
+
return window.userAssetsDomain + url
|
|
758
|
+
}else {
|
|
759
|
+
return window.assetsDomain + url
|
|
760
|
+
}
|
|
761
|
+
}));
|
|
752
762
|
}
|
|
753
763
|
const loadCSSWrap = (arr)=>{
|
|
754
764
|
LazyLoad.css(arr.map(url=>window.assetsDomain + url));
|
|
@@ -93,6 +93,7 @@ export function genMetaData(app: App, frontend: Frontend, config: any) {
|
|
|
93
93
|
|
|
94
94
|
app.dependencies && modules.push(...app.dependencies);
|
|
95
95
|
app.interfaceDependencies && modules.push(...app.interfaceDependencies);
|
|
96
|
+
app.connectorDependencies && modules.push(...app.connectorDependencies);
|
|
96
97
|
|
|
97
98
|
// 内置国际化枚举
|
|
98
99
|
enums.push(...configurationEnums)
|
|
@@ -194,6 +194,7 @@ export function getAllLogics(app: App) {
|
|
|
194
194
|
|
|
195
195
|
app.dependencies && modules.push(...app.dependencies);
|
|
196
196
|
app.interfaceDependencies && modules.push(...app.interfaceDependencies);
|
|
197
|
+
app.connectorDependencies && modules.push(...app.connectorDependencies);
|
|
197
198
|
|
|
198
199
|
modules.forEach((module: Module) => {
|
|
199
200
|
module.logics && logics.push(...module.logics);
|
|
@@ -16,8 +16,8 @@ async function getNaslAnnotatedJSON(app: App, opt: InternalReleaseData) {
|
|
|
16
16
|
|
|
17
17
|
let NaslAnnotatedJSON: any;
|
|
18
18
|
try {
|
|
19
|
-
NaslAnnotatedJSON = await
|
|
20
|
-
opt.logPublishFunc?.('语言', '获取类型标注成功');
|
|
19
|
+
NaslAnnotatedJSON = await app.naslServer.getNaslAnnotatedJSON(app, true);
|
|
20
|
+
await opt.logPublishFunc?.('语言', '获取类型标注成功');
|
|
21
21
|
|
|
22
22
|
// // 打印传给服务端的 nasl,为了服务端排查问题方便
|
|
23
23
|
// if (globalThis.window) {
|
|
@@ -47,7 +47,8 @@ async function getFrontendBundleFiles(app: App, opt: InternalReleaseData) {
|
|
|
47
47
|
let files: utils.GetPromise<ReturnType<typeof genFrontendBundleFiles>> = [];
|
|
48
48
|
|
|
49
49
|
if (opt.frontends && opt.frontends.length) {
|
|
50
|
-
opt.logPublishFunc?.('代码', '生成页面代码:开始');
|
|
50
|
+
await opt.logPublishFunc?.('代码', '生成页面代码:开始');
|
|
51
|
+
app.naslServer.logger.time('生成前端页面');
|
|
51
52
|
files = await genFrontendBundleFiles(app, opt.frontends, {
|
|
52
53
|
...opt.appInfo,
|
|
53
54
|
env: opt.env,
|
|
@@ -65,9 +66,11 @@ async function getFrontendBundleFiles(app: App, opt: InternalReleaseData) {
|
|
|
65
66
|
files = replaceAssetUrl(files, opt.appInfo.USER_STATIC_URL, opt.staticUrl);
|
|
66
67
|
}
|
|
67
68
|
|
|
68
|
-
|
|
69
|
+
app.naslServer.logger.timeEnd('生成前端页面');
|
|
70
|
+
await opt.logPublishFunc?.('代码', '生成页面代码:完成');
|
|
69
71
|
}
|
|
70
72
|
|
|
73
|
+
|
|
71
74
|
return files;
|
|
72
75
|
}
|
|
73
76
|
|
|
@@ -75,7 +78,7 @@ async function mergeBodyData(app: App, opt: InternalReleaseData) {
|
|
|
75
78
|
await utils.delay(500);
|
|
76
79
|
|
|
77
80
|
const authReport: ReturnType<typeof getAuthReport> = getAuthReport(app, opt.frontends);
|
|
78
|
-
opt.logPublishFunc?.('权限', '分析权限数据成功!');
|
|
81
|
+
await opt.logPublishFunc?.('权限', '分析权限数据成功!');
|
|
79
82
|
const logicPageResourceDtoList = await genPermissionData(app);
|
|
80
83
|
const allFrontends = getFrontendByTypes(app?.frontendTypes);
|
|
81
84
|
const releaseFrontends = allFrontends.map((frontend: Frontend) => ({
|
|
@@ -92,6 +95,7 @@ async function mergeBodyData(app: App, opt: InternalReleaseData) {
|
|
|
92
95
|
reportIdList: findAllReportIdList(app, opt.frontends),
|
|
93
96
|
appId: app.id,
|
|
94
97
|
env: opt.env,
|
|
98
|
+
branchId: opt.branchId,
|
|
95
99
|
replicas: opt.replicas,
|
|
96
100
|
appSpecification: opt.appSpecification,
|
|
97
101
|
callbackLogicsName: app.getExtensionsCallbackLogics(),
|
|
@@ -17,10 +17,11 @@ import { Logger, File } from '../../utils';
|
|
|
17
17
|
export async function getReleaseData(app: App, data: ReleaseData, naslServer: NaslServer, inputLogger?: Logger) {
|
|
18
18
|
const { http, logger: defaultLogger } = naslServer;
|
|
19
19
|
const logger = inputLogger ?? defaultLogger;
|
|
20
|
+
defaultLogger.time('前端生成器发布');
|
|
20
21
|
const appInfo = await getAppInfo(http, data);
|
|
21
|
-
logger.info('构建环境', '获取环境信息成功');
|
|
22
|
+
await logger.info('构建环境', '获取环境信息成功');
|
|
22
23
|
const { version, fullVersion, dependencies } = await getVersionDetail(http, app);
|
|
23
|
-
logger.info('构建环境', '获取版本数据成功');
|
|
24
|
+
await logger.info('构建环境', '获取版本数据成功');
|
|
24
25
|
const allFrontend = getFrontendByTypes(app.frontendTypes);
|
|
25
26
|
const inputFrontendNames = (data.config.frontendNames ?? []).filter(Boolean);
|
|
26
27
|
const releaseFrontends = inputFrontendNames.length > 0
|
|
@@ -29,6 +30,7 @@ export async function getReleaseData(app: App, data: ReleaseData, naslServer: Na
|
|
|
29
30
|
const result: InternalReleaseData = {
|
|
30
31
|
appInfo: appInfo as any,
|
|
31
32
|
env: data.env,
|
|
33
|
+
branchId: data.branchId,
|
|
32
34
|
debug: data.config.debug ?? false,
|
|
33
35
|
replicas: data.replicas ?? 1,
|
|
34
36
|
realRelease: data.config.mode === ReleaseMode.Release,
|
|
@@ -45,13 +47,13 @@ export async function getReleaseData(app: App, data: ReleaseData, naslServer: Na
|
|
|
45
47
|
// 设置依赖数据
|
|
46
48
|
if (app.packageInfos.length === 0) {
|
|
47
49
|
app.packageInfos = await getPackageInfos(http, app, dependencies, appInfo.STATIC_URL, fullVersion);
|
|
48
|
-
logger.info('构建环境', '设置依赖库内容');
|
|
50
|
+
await logger.info('构建环境', '设置依赖库内容');
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
// 私有化环境,需要同步资源;内部环境暂不需要,针对使用 CDN 场景增加判断
|
|
52
54
|
if (String(appInfo.isPrivatized) === 'true') {
|
|
53
55
|
result.staticUrl = await staticResourceSync(http, data.appId, data.env, releaseFrontends);
|
|
54
|
-
logger.info('构建环境', '私有化部署同步资源成功');
|
|
56
|
+
await logger.info('构建环境', '私有化部署同步资源成功');
|
|
55
57
|
}
|
|
56
58
|
|
|
57
59
|
// 服务端验证规则
|
|
@@ -62,18 +64,19 @@ export async function getReleaseData(app: App, data: ReleaseData, naslServer: Na
|
|
|
62
64
|
throw new Error(result.validations);
|
|
63
65
|
}
|
|
64
66
|
else {
|
|
65
|
-
logger.info('生成器', '服务端验证数据获取成功');
|
|
67
|
+
await logger.info('生成器', '服务端验证数据获取成功');
|
|
66
68
|
}
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
logger.info('构建环境', '构建环境完成,开始拼装发布数据');
|
|
71
|
+
await logger.info('构建环境', '构建环境完成,开始拼装发布数据');
|
|
70
72
|
|
|
71
73
|
const releaseBody = await genReleaseBody(app, {
|
|
72
74
|
...result,
|
|
73
75
|
logPublishFunc: (...message: string[]) => logger.info(...message),
|
|
74
76
|
});
|
|
75
77
|
|
|
76
|
-
logger.info('前端生成器', '应用发布数据准备完成');
|
|
78
|
+
await logger.info('前端生成器', '应用发布数据准备完成');
|
|
79
|
+
defaultLogger.timeEnd('前端生成器发布');
|
|
77
80
|
|
|
78
81
|
return releaseBody;
|
|
79
82
|
}
|
|
@@ -38,20 +38,44 @@ export interface Diagnostic {
|
|
|
38
38
|
*/
|
|
39
39
|
export interface DiagnosticRecord {
|
|
40
40
|
id: string;
|
|
41
|
+
|
|
41
42
|
logicId?: string;
|
|
42
|
-
|
|
43
|
+
|
|
43
44
|
filePath?: string;
|
|
44
45
|
node: BaseNode;
|
|
45
46
|
message: string;
|
|
46
47
|
syntaxDiagnostics: Array<Diagnostic>;
|
|
47
48
|
semanticDiagnostics: Array<Diagnostic>;
|
|
48
49
|
suggestionDiagnostics: Array<Diagnostic>;
|
|
49
|
-
// processComponentId?: string,
|
|
50
|
-
// attributes?: TypeCheckAttribute[],
|
|
51
50
|
}
|
|
52
51
|
|
|
53
52
|
export class DiagnosticManager {
|
|
54
|
-
|
|
53
|
+
private initVersionByFilePath(filePath: string) {
|
|
54
|
+
if (this.versions[filePath] === undefined) {
|
|
55
|
+
this.versions[filePath] = 0;
|
|
56
|
+
}
|
|
57
|
+
return this.versions[filePath];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
incrementVersionByFilePath(filePath: string): number {
|
|
61
|
+
this.initVersionByFilePath(filePath);
|
|
62
|
+
return ++this.versions[filePath];
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
getVersionByFilePath(filePath: string) {
|
|
66
|
+
// 单纯 get 不需要写入
|
|
67
|
+
return this.versions[filePath] ?? 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
deleteVersionByFilePath(filePath: string) {
|
|
71
|
+
if (!filePath) {
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
delete this.versions[filePath];
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
private versions: Record<string, number> = Object.create(null);
|
|
78
|
+
private records: Array<DiagnosticRecord> = [];
|
|
55
79
|
|
|
56
80
|
push(record: DiagnosticRecord) {
|
|
57
81
|
const index = this.records.findIndex((item) => item.id === record.id);
|
|
@@ -60,15 +84,7 @@ export class DiagnosticManager {
|
|
|
60
84
|
} else {
|
|
61
85
|
this.records.splice(index, 1, record);
|
|
62
86
|
}
|
|
63
|
-
|
|
64
|
-
// if(record.typeCheckNote?.message?.filter)
|
|
65
|
-
// record.typeCheckNote.message = record.typeCheckNote.message.filter((item) => !!item);
|
|
66
|
-
|
|
67
|
-
// if(!record.typeCheckNote || record.typeCheckNote.status === 'success'
|
|
68
|
-
// || (record.typeCheckNote && record.typeCheckNote.message && record.typeCheckNote.message.length === 0))
|
|
69
|
-
// return;
|
|
70
87
|
}
|
|
71
|
-
|
|
72
88
|
getRecord(id: string) {
|
|
73
89
|
const index = this.records.findIndex((item) => item.id === id);
|
|
74
90
|
return this.records[index];
|
|
@@ -76,27 +92,18 @@ export class DiagnosticManager {
|
|
|
76
92
|
|
|
77
93
|
deleteOwn(id: string) {
|
|
78
94
|
const index = this.records.findIndex((item) => item.id === id);
|
|
95
|
+
if (index !== -1) {
|
|
96
|
+
const path = this.records[index].filePath;
|
|
97
|
+
if (path) {
|
|
98
|
+
this.deleteVersionByFilePath(path);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
79
101
|
~index && this.records.splice(index, 1);
|
|
80
102
|
}
|
|
81
103
|
|
|
82
|
-
delete(id: string) {
|
|
83
|
-
// const node = vertexsMap.get(id);
|
|
84
|
-
// this.deleteOwn(id);
|
|
85
|
-
// if (node) {
|
|
86
|
-
// const children: LogicItem[] = [];
|
|
87
|
-
// // [...logicItemKeyOfLogicItem, ...logicItemArrayKeyOfLogicItem].forEach((key) => {
|
|
88
|
-
// // const item = (node as LogicItem)[key as keyof LogicItem];
|
|
89
|
-
// // if (item)
|
|
90
|
-
// // children = children.concat(item);
|
|
91
|
-
// // });
|
|
92
|
-
// children.forEach((item) => {
|
|
93
|
-
// this.delete(item.id);
|
|
94
|
-
// });
|
|
95
|
-
// }
|
|
96
|
-
}
|
|
97
|
-
|
|
98
104
|
clear() {
|
|
99
105
|
this.records.splice(0, this.records.length);
|
|
106
|
+
this.versions = Object.create(null);
|
|
100
107
|
}
|
|
101
108
|
|
|
102
109
|
pushAll(records: DiagnosticRecord[]) {
|
|
@@ -108,9 +115,6 @@ export class DiagnosticManager {
|
|
|
108
115
|
return [].concat(
|
|
109
116
|
...this.records.map((record) => {
|
|
110
117
|
const diagnostics: Diagnostic[] = [].concat(record.semanticDiagnostics, record.suggestionDiagnostics);
|
|
111
|
-
// if (!showTSError) {
|
|
112
|
-
// diagnostics = diagnostics.filter((diagnostic) => chineseRE.test(diagnostic.message));
|
|
113
|
-
// }
|
|
114
118
|
return diagnostics;
|
|
115
119
|
})
|
|
116
120
|
);
|
|
@@ -2,6 +2,7 @@ export const analyzeClaims = (params: any) => {
|
|
|
2
2
|
const { logicType } = params;
|
|
3
3
|
const claims = `
|
|
4
4
|
- Knowledge 是你的知识库,你可以参考,但是你最终制定的计划中禁止包含方法或者函数名
|
|
5
|
+
- moduleIndexList 用于下一步的具体实施,需要尽可能详细的返回所有和执行计划相关的模块或方法索引
|
|
5
6
|
- 如果用户没有特别指明是打印(日志/输出结果),"输出结果"一律按照"返回输出结果"处理
|
|
6
7
|
- 涉及到查询、获取数据时,先查找当前上下文[6/7/8/9]中是否有相关的方法,如果没有,再考虑实体的方法
|
|
7
8
|
- 实体的 get 方法一次只能获取一条数据,返回一个对象,无法返回列表。
|
|
@@ -13,6 +14,7 @@ export const analyzeClaims = (params: any) => {
|
|
|
13
14
|
const claimsMap = {
|
|
14
15
|
global_logic: `
|
|
15
16
|
- Knowledge 是你的知识库,你可以参考,但是你最终制定的计划中禁止包含方法或者函数名
|
|
17
|
+
- moduleIndexList 用于下一步的具体实施,需要尽可能详细的返回所有和执行计划相关的模块或方法索引
|
|
16
18
|
- 如果用户没有特别指明是打印(日志/输出结果),"输出结果"一律按照"返回输出结果"处理
|
|
17
19
|
- 如果用户的需求涉及定时或延时等操作,请提示用户:当前暂不支持定时或延时操作,请调整后重新输入。
|
|
18
20
|
- 如果用户的需求需要调用某个方法并且当前上下文中不存在时,请提示用户:当前应用中暂无该方法,请先导入相关依赖库或连接器模块
|
|
@@ -9,6 +9,8 @@ export const analyzeTasks = () => {
|
|
|
9
9
|
- 类型为 boolean, 如果你认为需求比较明确并且 plan 可执行, 返回 true, 否则返回 false
|
|
10
10
|
- moduleIndexList
|
|
11
11
|
- 类型为 Array, 你需要根据用户的执行计划,从 Context Definition 中整理出执行需要用到的模块或者方法,返回对应的索引
|
|
12
|
-
-
|
|
12
|
+
- 用于下一步的具体实施,需要尽可能详细的返回所有和执行计划相关的模块或方法索引。例如:"moduleIndexList": ['1','6-3','8-1-1-0']。
|
|
13
|
+
- needQueryRepository
|
|
14
|
+
- 类型为 boolean, 如果你认为需求相关的上下文信息不足,需要另外查询知识库时, 返回 true, 否则返回 false
|
|
13
15
|
`;
|
|
14
16
|
};
|
|
@@ -22,6 +22,7 @@ export const executeClaims = (params: any) => {
|
|
|
22
22
|
- 禁止使用 Object 的所有方法,如果想使用对象或者想要获取属性的值时,请使用 Map 系列函数
|
|
23
23
|
- 禁止使用三元表达式,你可以使用 if 语句或者 while 语句
|
|
24
24
|
- 禁止使用 for/forEach 语句,如果需要循环或者遍历,你**必须**使用 ForEach 方法
|
|
25
|
+
- 禁止使用 import 关键字
|
|
25
26
|
- 禁止频繁操作实体
|
|
26
27
|
- 只获取单条数据时使用 namespace.Entity.get()
|
|
27
28
|
- namespace.Entity.get 是一个整体,禁止将 namespace 赋值给变量
|
|
@@ -29,6 +30,7 @@ export const executeClaims = (params: any) => {
|
|
|
29
30
|
- 需要使用 nasl.ui 中类的方法时,请使用 $refs 的前缀,例如 $refs.tableView1.reload()
|
|
30
31
|
- 禁止将 $ref 实例赋值给变量
|
|
31
32
|
- 禁止使用 new 创建实例
|
|
33
|
+
- 提供的方法为一个整体,请完整调用,禁止将方法赋值给变量
|
|
32
34
|
- 直接输出代码结果,其他描述请以注释的形式出现
|
|
33
35
|
- 返回值
|
|
34
36
|
- 如果用户没有特别指明是打印(日志/输出结果),"输出结果"一律按照"返回输出结果"处理
|
|
@@ -57,6 +59,7 @@ export const executeClaims = (params: any) => {
|
|
|
57
59
|
- 禁止使用 Object 的所有方法,如果想使用对象或者想要获取属性的值时,请使用 Map 系列函数
|
|
58
60
|
- 禁止使用三元表达式,你可以使用 if 语句或者 while 语句
|
|
59
61
|
- 禁止使用 for/forEach 语句,如果需要循环或者遍历,你**必须**使用 ForEach 方法
|
|
62
|
+
- 禁止使用 import 关键字
|
|
60
63
|
- 禁止频繁操作实体
|
|
61
64
|
- 分析用户的需求,优先使用数据库的查询和数据操纵能力,例如 JOIN、SUM、GROUP_BY 等能力,使用 SQL 语句同时实现查询和计算
|
|
62
65
|
- 如果要查询,则使用 nasl.oql.query,同时分析整个需求,尽量用一句 SQL 实现
|
|
@@ -64,6 +67,7 @@ export const executeClaims = (params: any) => {
|
|
|
64
67
|
- namespace.Entity.get 是一个整体,禁止将 namespace 赋值给变量
|
|
65
68
|
- 禁止对 nasl.oql.query 的结果进行连续调用
|
|
66
69
|
- 字符串或者变量之间的拼接或者 concat 请使用字符串插值(模板字符串)语法
|
|
70
|
+
- 提供的方法为一个整体,请完整调用,禁止将方法赋值给变量
|
|
67
71
|
- 直接输出代码结果,其他描述请以注释的形式出现
|
|
68
72
|
- 返回值
|
|
69
73
|
- 如果用户没有特别指明是打印(日志/输出结果),"输出结果"一律按照"返回输出结果"处理
|
|
@@ -593,7 +593,7 @@ export function transformTSCode(tsCode: string, contextLogicName: string, type?:
|
|
|
593
593
|
return new naslTypes.CallInterface({
|
|
594
594
|
calleeNamespace: generate((node.callee as any).object).code,
|
|
595
595
|
calleeName: (callee[callee.length - 1] as babelTypes.Identifier).name,
|
|
596
|
-
arguments: node?.arguments?.map((arg: any) => arg?.properties
|
|
596
|
+
arguments: node?.arguments?.map((arg: any) => arg?.properties?.map((item: any) => new naslTypes.Argument({
|
|
597
597
|
keyword: item?.key?.name,
|
|
598
598
|
expression: transformLogicNode(item?.value),
|
|
599
599
|
}))).flat() as naslTypes.Argument[],
|
|
@@ -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) {
|