@lcap/nasl 3.4.0-beta.8 → 3.4.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +1 -0
- package/.nyc_output/processinfo/d58d92d8-c0d6-479b-9f82-1f4da8e73ff3.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -0
- package/coverage/base.css +224 -0
- package/coverage/block-navigation.js +87 -0
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +461 -0
- package/coverage/prettify.css +1 -0
- package/coverage/prettify.js +2 -0
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +196 -0
- package/coverage/src/automate/engine/index.html +116 -0
- package/coverage/src/automate/engine/utils.js.html +1414 -0
- package/coverage/src/bak/index.html +116 -0
- package/coverage/src/bak/translator.js.html +622 -0
- package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +175 -0
- package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +169 -0
- package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +1246 -0
- package/coverage/src/breakpoint/generator/CallbackNode.ts.html +145 -0
- package/coverage/src/breakpoint/generator/index.html +176 -0
- package/coverage/src/breakpoint/generator/index.ts.html +508 -0
- package/coverage/src/breakpoint/index.html +116 -0
- package/coverage/src/breakpoint/index.ts.html +94 -0
- package/coverage/src/breakpoint/shared/constants.ts.html +436 -0
- package/coverage/src/breakpoint/shared/index.html +176 -0
- package/coverage/src/breakpoint/shared/index.ts.html +94 -0
- package/coverage/src/breakpoint/shared/operations.ts.html +160 -0
- package/coverage/src/breakpoint/shared/socket.ts.html +1297 -0
- package/coverage/src/breakpoint/shared/utils.ts.html +1087 -0
- package/coverage/src/breakpoint/store/core.ts.html +1600 -0
- package/coverage/src/breakpoint/store/dock.ts.html +733 -0
- package/coverage/src/breakpoint/store/index.html +146 -0
- package/coverage/src/breakpoint/store/index.ts.html +91 -0
- package/coverage/src/common/BaseNode.ts.html +3874 -0
- package/coverage/src/common/Command.ts.html +310 -0
- package/coverage/src/common/EventEmitter.ts.html +370 -0
- package/coverage/src/common/Messager.ts.html +820 -0
- package/coverage/src/common/asyncFuncMap.ts.html +127 -0
- package/coverage/src/common/index.html +191 -0
- package/coverage/src/common/index.ts.html +94 -0
- package/coverage/src/concepts/Abort__.ts.html +328 -0
- package/coverage/src/concepts/Anchor__.ts.html +646 -0
- package/coverage/src/concepts/AnonymousFunction__.ts.html +2029 -0
- package/coverage/src/concepts/App__.ts.html +13252 -0
- package/coverage/src/concepts/Argument__.ts.html +964 -0
- package/coverage/src/concepts/Assignee__.ts.html +2236 -0
- package/coverage/src/concepts/AssignmentLine__.ts.html +409 -0
- package/coverage/src/concepts/Assignment__.ts.html +1123 -0
- package/coverage/src/concepts/Attribute__.ts.html +733 -0
- package/coverage/src/concepts/AuthInterface__.ts.html +367 -0
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +1984 -0
- package/coverage/src/concepts/AuthLogic__.ts.html +781 -0
- package/coverage/src/concepts/BackendVariable__.ts.html +1483 -0
- package/coverage/src/concepts/Backend__.ts.html +1165 -0
- package/coverage/src/concepts/BatchAssignment__.ts.html +3301 -0
- package/coverage/src/concepts/BinaryExpression__.ts.html +1441 -0
- package/coverage/src/concepts/BindAttribute__.ts.html +3835 -0
- package/coverage/src/concepts/BindDirective__.ts.html +1921 -0
- package/coverage/src/concepts/BindEvent__.ts.html +3406 -0
- package/coverage/src/concepts/BindStyle__.ts.html +1612 -0
- package/coverage/src/concepts/BooleanLiteral__.ts.html +418 -0
- package/coverage/src/concepts/CallAuthInterface__.ts.html +1615 -0
- package/coverage/src/concepts/CallConnector__.ts.html +922 -0
- package/coverage/src/concepts/CallFunction__.ts.html +2122 -0
- package/coverage/src/concepts/CallInterface__.ts.html +2719 -0
- package/coverage/src/concepts/CallLogic__.ts.html +4807 -0
- package/coverage/src/concepts/CallQueryComponent__.ts.html +5308 -0
- package/coverage/src/concepts/Comment__.ts.html +394 -0
- package/coverage/src/concepts/CompletionProperty__.ts.html +925 -0
- package/coverage/src/concepts/ConfigGroup__.ts.html +1105 -0
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +424 -0
- package/coverage/src/concepts/ConfigProperty__.ts.html +1348 -0
- package/coverage/src/concepts/Configuration__.ts.html +1027 -0
- package/coverage/src/concepts/Connection__.ts.html +1360 -0
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +595 -0
- package/coverage/src/concepts/Connector__.ts.html +4255 -0
- package/coverage/src/concepts/Constant__.ts.html +913 -0
- package/coverage/src/concepts/DataSource__.ts.html +1771 -0
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +331 -0
- package/coverage/src/concepts/Destination__.ts.html +2731 -0
- package/coverage/src/concepts/End__.ts.html +433 -0
- package/coverage/src/concepts/EntityIndex__.ts.html +787 -0
- package/coverage/src/concepts/EntityProperty__.ts.html +2668 -0
- package/coverage/src/concepts/Entity__.ts.html +2950 -0
- package/coverage/src/concepts/EnumItem__.ts.html +550 -0
- package/coverage/src/concepts/Enum__.ts.html +1231 -0
- package/coverage/src/concepts/Event__.ts.html +1084 -0
- package/coverage/src/concepts/ExternalDestination__.ts.html +1033 -0
- package/coverage/src/concepts/ForEachStatement__.ts.html +1957 -0
- package/coverage/src/concepts/FrontendLibrary__.ts.html +1711 -0
- package/coverage/src/concepts/FrontendVariable__.ts.html +292 -0
- package/coverage/src/concepts/Frontend__.ts.html +3961 -0
- package/coverage/src/concepts/Function__.ts.html +3598 -0
- package/coverage/src/concepts/Identifier__.ts.html +1057 -0
- package/coverage/src/concepts/IfStatement__.ts.html +1594 -0
- package/coverage/src/concepts/Integration__.ts.html +1228 -0
- package/coverage/src/concepts/InterfaceParam__.ts.html +1087 -0
- package/coverage/src/concepts/Interface__.ts.html +3394 -0
- package/coverage/src/concepts/JSBlock__.ts.html +421 -0
- package/coverage/src/concepts/JavaLogic__.ts.html +460 -0
- package/coverage/src/concepts/LogicItem__.ts.html +1171 -0
- package/coverage/src/concepts/Logic__.ts.html +7408 -0
- package/coverage/src/concepts/MatchCase__.ts.html +2929 -0
- package/coverage/src/concepts/Match__.ts.html +2455 -0
- package/coverage/src/concepts/MemberExpression__.ts.html +1726 -0
- package/coverage/src/concepts/MicroApp__.ts.html +436 -0
- package/coverage/src/concepts/Module__.ts.html +9220 -0
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +1045 -0
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +1018 -0
- package/coverage/src/concepts/Namespace__.ts.html +7942 -0
- package/coverage/src/concepts/NewComposite__.ts.html +4729 -0
- package/coverage/src/concepts/NewList__.ts.html +1618 -0
- package/coverage/src/concepts/NewMap__.ts.html +2326 -0
- package/coverage/src/concepts/New__.ts.html +289 -0
- package/coverage/src/concepts/NullLiteral__.ts.html +349 -0
- package/coverage/src/concepts/NumericLiteral__.ts.html +676 -0
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +1141 -0
- package/coverage/src/concepts/OverriddenLogic__.ts.html +6817 -0
- package/coverage/src/concepts/Param__.ts.html +1726 -0
- package/coverage/src/concepts/Point__.ts.html +331 -0
- package/coverage/src/concepts/ProcessComponent__.ts.html +1666 -0
- package/coverage/src/concepts/ProcessElement__.ts.html +5884 -0
- package/coverage/src/concepts/ProcessOutcome__.ts.html +352 -0
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +343 -0
- package/coverage/src/concepts/Process__.ts.html +4768 -0
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +568 -0
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +583 -0
- package/coverage/src/concepts/QueryFromExpression__.ts.html +910 -0
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +559 -0
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +1567 -0
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +637 -0
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +679 -0
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +1714 -0
- package/coverage/src/concepts/Rect__.ts.html +373 -0
- package/coverage/src/concepts/Return__.ts.html +1312 -0
- package/coverage/src/concepts/Role__.ts.html +601 -0
- package/coverage/src/concepts/SelectMembers__.ts.html +1246 -0
- package/coverage/src/concepts/Slot__.ts.html +628 -0
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +982 -0
- package/coverage/src/concepts/Start__.ts.html +304 -0
- package/coverage/src/concepts/StringInterpolation__.ts.html +1129 -0
- package/coverage/src/concepts/StringLiteral__.ts.html +505 -0
- package/coverage/src/concepts/StructureProperty__.ts.html +1132 -0
- package/coverage/src/concepts/Structure__.ts.html +2092 -0
- package/coverage/src/concepts/SwitchCase__.ts.html +1174 -0
- package/coverage/src/concepts/SwitchStatement__.ts.html +877 -0
- package/coverage/src/concepts/Theme__.ts.html +358 -0
- package/coverage/src/concepts/Transactional__.ts.html +628 -0
- package/coverage/src/concepts/TriggerEvent__.ts.html +1012 -0
- package/coverage/src/concepts/TriggerLauncher__.ts.html +775 -0
- package/coverage/src/concepts/TypeAnnotation__.ts.html +3718 -0
- package/coverage/src/concepts/TypeParam__.ts.html +319 -0
- package/coverage/src/concepts/UnaryExpression__.ts.html +697 -0
- package/coverage/src/concepts/Unparsed__.ts.html +394 -0
- package/coverage/src/concepts/UseComponent__.ts.html +331 -0
- package/coverage/src/concepts/ValidationRule__.ts.html +1840 -0
- package/coverage/src/concepts/Variable__.ts.html +1489 -0
- package/coverage/src/concepts/ViewBlock__.ts.html +352 -0
- package/coverage/src/concepts/ViewComponent__.ts.html +4180 -0
- package/coverage/src/concepts/ViewElement__.ts.html +8803 -0
- package/coverage/src/concepts/View__.ts.html +8620 -0
- package/coverage/src/concepts/WhileStatement__.ts.html +1063 -0
- package/coverage/src/concepts/basics/stdlib/index.html +356 -0
- package/coverage/src/concepts/basics/stdlib/index.ts.html +208 -0
- package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +565 -0
- package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +517 -0
- package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +226 -0
- package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +172 -0
- package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +214 -0
- package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +145 -0
- package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +589 -0
- package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +214 -0
- package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +229 -0
- package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +268 -0
- package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +1999 -0
- package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +3259 -0
- package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +6844 -0
- package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +1768 -0
- package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +163 -0
- package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +664 -0
- package/coverage/src/concepts/basics/types/coreTypeList.ts.html +121 -0
- package/coverage/src/concepts/basics/types/index.html +131 -0
- package/coverage/src/concepts/basics/types/index.ts.html +160 -0
- package/coverage/src/concepts/index.html +1961 -0
- package/coverage/src/concepts/index.ts.html +103 -0
- package/coverage/src/concepts/index__.ts.html +451 -0
- package/coverage/src/config.ts.html +325 -0
- package/coverage/src/decorators/index.html +131 -0
- package/coverage/src/decorators/index.ts.html +574 -0
- package/coverage/src/decorators/promise.ts.html +169 -0
- package/coverage/src/eventBus.ts.html +100 -0
- package/coverage/src/generator/compileComponent.ts.html +142 -0
- package/coverage/src/generator/genBundleFiles.ts.html +1828 -0
- package/coverage/src/generator/genHash.ts.html +124 -0
- package/coverage/src/generator/genMetaData.ts.html +1042 -0
- package/coverage/src/generator/genReleaseBody.ts.html +1282 -0
- package/coverage/src/generator/icestark.ts.html +220 -0
- package/coverage/src/generator/index.html +266 -0
- package/coverage/src/generator/index.ts.html +106 -0
- package/coverage/src/generator/microApp.ts.html +172 -0
- package/coverage/src/generator/permission.ts.html +1036 -0
- package/coverage/src/generator/qiankun.ts.html +232 -0
- package/coverage/src/generator/styleReplacer.ts.html +199 -0
- package/coverage/src/index.html +146 -0
- package/coverage/src/index.ts.html +121 -0
- package/coverage/src/manager/diagnostic.ts.html +442 -0
- package/coverage/src/manager/index.html +131 -0
- package/coverage/src/manager/stepRecorder.ts.html +457 -0
- package/coverage/src/natural/genNaturalTS.ts.html +355 -0
- package/coverage/src/natural/index.html +161 -0
- package/coverage/src/natural/index.ts.html +91 -0
- package/coverage/src/natural/naslStdlibMap.ts.html +157 -0
- package/coverage/src/natural/transformTSCode.ts.html +2647 -0
- package/coverage/src/sentry/index.html +116 -0
- package/coverage/src/sentry/index.ts.html +676 -0
- package/coverage/src/server/createUiTs.ts.html +910 -0
- package/coverage/src/server/entity2LogicNamespace.ts.html +1294 -0
- package/coverage/src/server/event.js.html +526 -0
- package/coverage/src/server/extendBaseNode.ts.html +1762 -0
- package/coverage/src/server/formatTsUtils.ts.html +2689 -0
- package/coverage/src/server/getConnector.ts.html +316 -0
- package/coverage/src/server/getExtensionModules.ts.html +178 -0
- package/coverage/src/server/getFunctions.ts.html +133 -0
- package/coverage/src/server/getInterfaces.ts.html +229 -0
- package/coverage/src/server/getLogging.ts.html +100 -0
- package/coverage/src/server/getLogics.ts.html +1363 -0
- package/coverage/src/server/getMemberIdentifier.ts.html +1561 -0
- package/coverage/src/server/getProcessComponents.ts.html +112 -0
- package/coverage/src/server/getProcesses.ts.html +2023 -0
- package/coverage/src/server/getValidates.ts.html +115 -0
- package/coverage/src/server/index.html +401 -0
- package/coverage/src/server/index.ts.html +229 -0
- package/coverage/src/server/naslServer.ts.html +14401 -0
- package/coverage/src/server/naslStdlibMap.ts.html +241 -0
- package/coverage/src/server/process2LogicNamespace.ts.html +454 -0
- package/coverage/src/server/translator.ts.html +2566 -0
- package/coverage/src/service/creator/add.configs.js.html +379 -0
- package/coverage/src/service/creator/errHandles.js.html +322 -0
- package/coverage/src/service/creator/index.html +146 -0
- package/coverage/src/service/creator/index.js.html +352 -0
- package/coverage/src/service/datasource/api.js.html +118 -0
- package/coverage/src/service/datasource/index.html +131 -0
- package/coverage/src/service/datasource/index.js.html +103 -0
- package/coverage/src/service/logic/api.js.html +109 -0
- package/coverage/src/service/logic/index.html +131 -0
- package/coverage/src/service/logic/index.js.html +103 -0
- package/coverage/src/service/storage/api.js.html +202 -0
- package/coverage/src/service/storage/index.html +206 -0
- package/coverage/src/service/storage/index.ts.html +103 -0
- package/coverage/src/service/storage/init.ts.html +2761 -0
- package/coverage/src/service/storage/jsoner.ts.html +502 -0
- package/coverage/src/service/storage/map.ts.html +256 -0
- package/coverage/src/service/storage/service.ts.html +331 -0
- package/coverage/src/service/storage/storagePoint.ts.html +304 -0
- package/coverage/src/templator/genCallComponentLogic.ts.html +163 -0
- package/coverage/src/templator/genCreateBlock.ts.html +1093 -0
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +1609 -0
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +2254 -0
- package/coverage/src/templator/genEditTableBlock.ts.html +955 -0
- package/coverage/src/templator/genEnumSelectBlock.ts.html +178 -0
- package/coverage/src/templator/genGetBlock.ts.html +451 -0
- package/coverage/src/templator/genGridViewBlock.ts.html +1114 -0
- package/coverage/src/templator/genListViewBlock.ts.html +475 -0
- package/coverage/src/templator/genQueryComponent.ts.html +1207 -0
- package/coverage/src/templator/genSelectBlock.ts.html +1243 -0
- package/coverage/src/templator/genTableBlock.ts.html +910 -0
- package/coverage/src/templator/genUpdateBlock.ts.html +1192 -0
- package/coverage/src/templator/index.html +326 -0
- package/coverage/src/templator/index.ts.html +154 -0
- package/coverage/src/templator/utils.ts.html +1861 -0
- package/coverage/src/translator/constant.ts.html +106 -0
- package/coverage/src/translator/index.html +146 -0
- package/coverage/src/translator/index.ts.html +94 -0
- package/coverage/src/translator/utils.ts.html +436 -0
- package/coverage/src/utils/cookie.ts.html +265 -0
- package/coverage/src/utils/env.ts.html +91 -0
- package/coverage/src/utils/index.html +236 -0
- package/coverage/src/utils/index.ts.html +655 -0
- package/coverage/src/utils/logger.ts.html +145 -0
- package/coverage/src/utils/sortTsString.ts.html +187 -0
- package/coverage/src/utils/string.ts.html +400 -0
- package/coverage/src/utils/time-slicing.ts.html +418 -0
- package/coverage/src/utils/traverse.ts.html +568 -0
- package/coverage/src/utils/window.ts.html +112 -0
- package/out/automate/engine/utils.d.ts +1 -1
- package/out/automate/engine/utils.js +1 -5
- package/out/automate/engine/utils.js.map +1 -1
- package/out/common/BaseNode.d.ts +2 -0
- package/out/common/BaseNode.js +24 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/BackendVariable__.js +10 -2
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +2 -0
- package/out/concepts/BinaryExpression__.js +4 -0
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +3 -0
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +2 -0
- package/out/concepts/CallFunction__.js +14 -2
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +2 -0
- package/out/concepts/CallInterface__.js +5 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +3 -2
- package/out/concepts/CallLogic__.js +33 -48
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +1 -1
- package/out/concepts/Destination__.js +2 -2
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/Logic__.js +21 -5
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +1 -1
- package/out/concepts/MemberExpression__.js +3 -3
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +2 -0
- package/out/concepts/NewComposite__.js +4 -0
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +2 -0
- package/out/concepts/NewList__.js +4 -0
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +2 -0
- package/out/concepts/NewMap__.js +4 -0
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/Param__.js +11 -3
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +9 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Return__.js +10 -2
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Variable__.js +10 -2
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +1 -0
- package/out/concepts/ViewElement__.js +8 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +1 -1
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/utils/quick-info.d.ts +13 -0
- package/out/concepts/utils/quick-info.js +51 -0
- package/out/concepts/utils/quick-info.js.map +1 -0
- package/out/generator/genBundleFiles.d.ts +1 -0
- package/out/generator/genBundleFiles.js +4 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/server/getProcesses.js +3 -3
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.js +11 -50
- package/out/server/naslServer.js.map +1 -1
- package/out/translator/utils.d.ts +2 -2
- package/out/utils/i18nInfo.js +7 -2
- package/out/utils/i18nInfo.js.map +1 -1
- package/package.json +1 -1
- package/src/automate/engine/utils.js +1 -5
- package/src/common/BaseNode.ts +23 -2
- package/src/concepts/BackendVariable__.ts +10 -2
- package/src/concepts/BinaryExpression__.ts +5 -1
- package/src/concepts/BindAttribute__.ts +2 -0
- package/src/concepts/CallFunction__.ts +15 -2
- package/src/concepts/CallInterface__.ts +6 -1
- package/src/concepts/CallLogic__.ts +36 -52
- package/src/concepts/Destination__.ts +2 -2
- package/src/concepts/Logic__.ts +35 -22
- package/src/concepts/MemberExpression__.ts +3 -3
- package/src/concepts/NewComposite__.ts +5 -5
- package/src/concepts/NewList__.ts +6 -2
- package/src/concepts/NewMap__.ts +6 -3
- package/src/concepts/Param__.ts +11 -3
- package/src/concepts/ProcessElement__.ts +8 -1
- package/src/concepts/Return__.ts +10 -2
- package/src/concepts/Variable__.ts +10 -2
- package/src/concepts/ViewElement__.ts +11 -2
- package/src/concepts/View__.ts +1 -1
- package/src/concepts/utils/quick-info.ts +64 -0
- package/src/generator/genBundleFiles.ts +8 -3
- package/src/server/getProcesses.ts +3 -3
- package/src/server/naslServer.ts +10 -47
- package/src/translator/utils.ts +2 -2
- package/src/utils/i18nInfo.ts +7 -2
- package/test/concepts/binary-expression/__snapshots__/getQuickInfoOffset.spec.ts.snap +25 -0
- package/test/concepts/binary-expression/getQuickInfoOffset.spec.ts +19 -0
- package/test/concepts/call-function/__snapshots__/getQuickInfoOffset.spec.ts.snap +41 -0
- package/test/concepts/call-function/getQuickInfoOffset.spec.ts +19 -0
- package/test/concepts/call-interface/__snapshots__/getQuickInfoOffset.spec.ts.snap +86 -0
- package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +3 -3
- package/test/concepts/call-interface/getQuickInfoOffset.spec.ts +19 -0
- package/test/concepts/call-logic/getQuickInfoOffset.spec.ts +2 -7
- package/test/concepts/new-composite/__snapshots__/getQuickInfoOffset.spec.ts.snap +104 -0
- package/test/concepts/new-composite/__snapshots__/toEmbeddedTS.spec.ts.snap +97 -0
- package/test/concepts/new-composite/__snapshots__/toJS.spec.ts.snap +43 -0
- package/test/concepts/new-composite/constant.ts +5 -0
- package/test/concepts/new-composite/fixtures/nested-transform.json +241 -0
- package/test/concepts/new-composite/fixtures/nested.json +146 -0
- package/test/concepts/new-composite/fixtures/normal.json +63 -0
- package/test/concepts/new-composite/getQuickInfoOffset.spec.ts +19 -0
- package/test/concepts/new-composite/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/new-composite/toJS.spec.ts +14 -0
- package/test/concepts/new-list/__snapshots__/getQuickInfoOffset.spec.ts.snap +165 -0
- package/test/concepts/new-list/__snapshots__/toEmbeddedTS.spec.ts.snap +207 -0
- package/test/concepts/new-list/__snapshots__/toJS.spec.ts.snap +63 -0
- package/test/concepts/new-list/constant.ts +5 -0
- package/test/concepts/new-list/fixtures/nested-map.json +117 -0
- package/test/concepts/new-list/fixtures/nested-tranform.json +140 -0
- package/test/concepts/new-list/fixtures/nested.json +107 -0
- package/test/concepts/new-list/fixtures/normal.json +95 -0
- package/test/concepts/new-list/getQuickInfoOffset.spec.ts +19 -0
- package/test/concepts/new-list/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/new-list/toJS.spec.ts +14 -0
- package/test/concepts/new-map/__snapshots__/getQuickInfoOffset.spec.ts.snap +115 -0
- package/test/concepts/new-map/__snapshots__/toEmbeddedTS.spec.ts.snap +192 -0
- package/test/concepts/new-map/__snapshots__/toJS.spec.ts.snap +54 -0
- package/test/concepts/new-map/constant.ts +5 -0
- package/test/concepts/new-map/fixtures/nested-transform.json +169 -0
- package/test/concepts/new-map/fixtures/nested.json +141 -0
- package/test/concepts/new-map/fixtures/normal.json +101 -0
- package/test/concepts/new-map/getQuickInfoOffset.spec.ts +19 -0
- package/test/concepts/new-map/toEmbeddedTS.spec.ts +15 -0
- package/test/concepts/new-map/toJS.spec.ts +14 -0
- package/test/concepts/utils.ts +17 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Position, Range, TranslatorState } from './types';
|
|
2
|
-
import TypeAnnotation from '../concepts/TypeAnnotation__';
|
|
3
|
-
import App from '../concepts/App__';
|
|
2
|
+
import type TypeAnnotation from '../concepts/TypeAnnotation__';
|
|
3
|
+
import type App from '../concepts/App__';
|
|
4
4
|
export declare function lsp2tspNumber(num: number): number;
|
|
5
5
|
export declare const indent: (tabSize: number) => string;
|
|
6
6
|
/**
|
package/out/utils/i18nInfo.js
CHANGED
|
@@ -4,14 +4,19 @@ exports.languageList = void 0;
|
|
|
4
4
|
exports.languageList = [
|
|
5
5
|
{
|
|
6
6
|
id: 'en-US',
|
|
7
|
-
name: 'English
|
|
8
|
-
title: '
|
|
7
|
+
name: 'English',
|
|
8
|
+
title: '英语',
|
|
9
9
|
},
|
|
10
10
|
{
|
|
11
11
|
id: 'fr-FR',
|
|
12
12
|
name: 'Français',
|
|
13
13
|
title: '法语',
|
|
14
14
|
},
|
|
15
|
+
{
|
|
16
|
+
id: 'ko-KR',
|
|
17
|
+
name: '한국어',
|
|
18
|
+
title: '韩语',
|
|
19
|
+
},
|
|
15
20
|
{
|
|
16
21
|
id: 'zh-CN',
|
|
17
22
|
name: '中文 (简体)',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18nInfo.js","sourceRoot":"","sources":["../../src/utils/i18nInfo.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"i18nInfo.js","sourceRoot":"","sources":["../../src/utils/i18nInfo.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,IAAI;KACZ;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,UAAU;QAChB,KAAK,EAAE,IAAI;KACZ;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,IAAI;KACZ;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,QAAQ;KAChB;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,QAAQ;KAChB;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,KAAK;QACX,KAAK,EAAE,IAAI;KACZ;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
// BaseNode,
|
|
3
|
-
// Module
|
|
4
|
-
// } from '../../concepts';
|
|
5
|
-
import { BaseNode, uiStructures, collectionStructures, interfaceStructures, processStructures, getStdlibNamespace, coreStructures, httpStructures } from '../../concepts';
|
|
1
|
+
import { BaseNode, uiStructures, collectionStructures, interfaceStructures, processStructures, getStdlibNamespace, coreStructures, authStructures, httpStructures } from '../../concepts';
|
|
6
2
|
import { getConceptMeta } from '../../decorators/index';
|
|
7
3
|
/*
|
|
8
4
|
根据 namespace 字符串来获取 node
|
package/src/common/BaseNode.ts
CHANGED
|
@@ -1085,7 +1085,27 @@ export class BaseNode extends EventEmitter {
|
|
|
1085
1085
|
});
|
|
1086
1086
|
return JSON.parse(JSON.stringify(temp));
|
|
1087
1087
|
}
|
|
1088
|
-
|
|
1088
|
+
// 给国际化展示用
|
|
1089
|
+
getNodeChinesePath(useIndex: boolean | string[] | NodePathOption) {
|
|
1090
|
+
let node: BaseNode = this;
|
|
1091
|
+
const pathArr: string[] = [];
|
|
1092
|
+
while (node && node.concept) {
|
|
1093
|
+
let pathText = '';
|
|
1094
|
+
const { parentNode } = node;
|
|
1095
|
+
if (parentNode) {
|
|
1096
|
+
const { name, title, label } = parentNode as any;
|
|
1097
|
+
pathText = `${(parentNode.constructor as any)?.nodeTitle || ''}${name || ''}`;
|
|
1098
|
+
if (title && label) {
|
|
1099
|
+
pathText += `(${title} | ${label})`;
|
|
1100
|
+
} else if (title || label) {
|
|
1101
|
+
pathText += `(${title || label})`;
|
|
1102
|
+
}
|
|
1103
|
+
pathArr.unshift(pathText);
|
|
1104
|
+
}
|
|
1105
|
+
node = parentNode;
|
|
1106
|
+
}
|
|
1107
|
+
return pathArr.join('/');
|
|
1108
|
+
}
|
|
1089
1109
|
/**
|
|
1090
1110
|
* 查找引用
|
|
1091
1111
|
*/
|
|
@@ -1311,6 +1331,7 @@ export class BaseNode extends EventEmitter {
|
|
|
1311
1331
|
* 迭代所有属性
|
|
1312
1332
|
*
|
|
1313
1333
|
* @description 是所有属性!!不是所有子节点!!
|
|
1334
|
+
* @deprecated 请使用`traverseStrictChildren`方法
|
|
1314
1335
|
*/
|
|
1315
1336
|
traverseChildren(cb: (el: any) => void): void {
|
|
1316
1337
|
function traverse(node: any) {
|
|
@@ -1518,7 +1539,7 @@ export class BaseNode extends EventEmitter {
|
|
|
1518
1539
|
nodes.push(self);
|
|
1519
1540
|
}
|
|
1520
1541
|
|
|
1521
|
-
this.
|
|
1542
|
+
this.traverseStrictChildren((current) => {
|
|
1522
1543
|
if (pre(current)) {
|
|
1523
1544
|
nodes.push(current);
|
|
1524
1545
|
}
|
|
@@ -321,12 +321,20 @@ export class BackendVariable extends BaseNode {
|
|
|
321
321
|
toJS(state?: TranslatorState): string {
|
|
322
322
|
const context = this.view ? 'this' : 'Vue.prototype';
|
|
323
323
|
const typeAnnotation = this.typeAnnotation || this.__TypeAnnotation;
|
|
324
|
+
let { sortedTypeKey, typeKind, typeName, typeNamespace } = typeAnnotation || {};
|
|
325
|
+
if (typeNamespace?.endsWith('.metadataTypes')) {
|
|
326
|
+
const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
|
|
327
|
+
const typeAn = referenceNode.typeAnnotation || {};
|
|
328
|
+
sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
|
|
329
|
+
typeKind = typeAn.typeKind;
|
|
330
|
+
typeName = typeAn.typeName;
|
|
331
|
+
}
|
|
324
332
|
const needGenInitFromSchema =
|
|
325
333
|
typeAnnotation &&
|
|
326
|
-
(!['primitive', 'union'].includes(
|
|
334
|
+
(!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
|
|
327
335
|
let code = `${this.name} =`;
|
|
328
336
|
if (needGenInitFromSchema) {
|
|
329
|
-
code += `${context}.$genInitFromSchema('${
|
|
337
|
+
code += `${context}.$genInitFromSchema('${sortedTypeKey}',`;
|
|
330
338
|
}
|
|
331
339
|
|
|
332
340
|
if (this.defaultValue?.expression) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
2
1
|
import {
|
|
3
2
|
TranslatorState,
|
|
4
3
|
shiftState,
|
|
@@ -9,6 +8,7 @@ import {
|
|
|
9
8
|
TranslatorGenerator,
|
|
10
9
|
} from '../translator';
|
|
11
10
|
import { ElementToVueOptions } from './ViewElement__';
|
|
11
|
+
import { getCallExpressionQuickInfo, Range, GetCode } from './utils/quick-info';
|
|
12
12
|
|
|
13
13
|
const operatorMap = {
|
|
14
14
|
'&&': 'and',
|
|
@@ -475,6 +475,10 @@ export class BinaryExpression extends LogicItem {
|
|
|
475
475
|
return code;
|
|
476
476
|
}
|
|
477
477
|
|
|
478
|
+
getQuickInfoOffset(range: Range, getCode: GetCode) {
|
|
479
|
+
return getCallExpressionQuickInfo(range, getCode);
|
|
480
|
+
}
|
|
481
|
+
|
|
478
482
|
//================================================================================
|
|
479
483
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
480
484
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -1168,6 +1168,8 @@ export class BindAttribute extends BaseNode {
|
|
|
1168
1168
|
type = `${self.value}`.includes('.') ? 'nasl.core.Decimal' : 'nasl.core.Long';
|
|
1169
1169
|
} else if (typeof self.value === 'boolean') {
|
|
1170
1170
|
type = 'nasl.core.Boolean';
|
|
1171
|
+
} else if (['page-size', 'page-number'].includes(self.name) && self.value === null) {
|
|
1172
|
+
type = 'nasl.core.Long'
|
|
1171
1173
|
}
|
|
1172
1174
|
code += `${type}`;
|
|
1173
1175
|
} else {
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
withGenerator,
|
|
12
12
|
TranslatorGenerator,
|
|
13
13
|
} from '../translator';
|
|
14
|
+
import { getCallExpressionQuickInfo, Range, GetCode } from './utils/quick-info';
|
|
14
15
|
import type Function from './Function__';
|
|
15
16
|
import { ElementToVueOptions } from './ViewElement__';
|
|
16
17
|
import type Identifier from './Identifier__';
|
|
@@ -526,10 +527,18 @@ export class CallFunction extends LogicItem {
|
|
|
526
527
|
|
|
527
528
|
code += ')';
|
|
528
529
|
const tyAnno = (this as any).typeAnnotation || this.__TypeAnnotation;
|
|
530
|
+
let { sortedTypeKey, typeKind, typeName, typeNamespace } = tyAnno || {};
|
|
531
|
+
if (typeNamespace?.endsWith('.metadataTypes')) {
|
|
532
|
+
const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
|
|
533
|
+
const typeAn = referenceNode.typeAnnotation || {};
|
|
534
|
+
sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
|
|
535
|
+
typeKind = typeAn.typeKind;
|
|
536
|
+
typeName = typeAn.typeName;
|
|
537
|
+
}
|
|
529
538
|
const needGenInitFromSchema =
|
|
530
|
-
tyAnno && (!['primitive', 'union'].includes(
|
|
539
|
+
tyAnno && (!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
|
|
531
540
|
if (needGenInitFromSchema) {
|
|
532
|
-
code = `this.$genInitFromSchema('${
|
|
541
|
+
code = `this.$genInitFromSchema('${sortedTypeKey}', ${code})`;
|
|
533
542
|
}
|
|
534
543
|
return code;
|
|
535
544
|
}
|
|
@@ -721,6 +730,10 @@ export class CallFunction extends LogicItem {
|
|
|
721
730
|
fn.checkParamName();
|
|
722
731
|
});
|
|
723
732
|
}
|
|
733
|
+
|
|
734
|
+
getQuickInfoOffset(range: Range, getCode: GetCode) {
|
|
735
|
+
return getCallExpressionQuickInfo(range, getCode);
|
|
736
|
+
}
|
|
724
737
|
//================================================================================
|
|
725
738
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
726
739
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -19,6 +19,7 @@ import type { MemberExpression } from './MemberExpression__';
|
|
|
19
19
|
import type Frontend from './Frontend__';
|
|
20
20
|
import type Connector from './Connector__';
|
|
21
21
|
import { CUSTOM_CONNECTOR_EDITABLE_SUFFIX } from './basics/constants';
|
|
22
|
+
import { getCallExpressionQuickInfo, Range, GetCode } from './utils/quick-info';
|
|
22
23
|
|
|
23
24
|
//================================================================================
|
|
24
25
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -722,7 +723,7 @@ export class CallInterface extends LogicItem {
|
|
|
722
723
|
const idx = logicParam.findIndex((params) => arg.keyword === params.name);
|
|
723
724
|
const param = logicParam[idx];
|
|
724
725
|
|
|
725
|
-
arg.paramRequired =
|
|
726
|
+
arg.paramRequired = param?.required;
|
|
726
727
|
arg.paramTypeAnnotation = undefined;
|
|
727
728
|
arg.paramDefaultValue = undefined;
|
|
728
729
|
// 取到是不是必填放入参数中
|
|
@@ -897,6 +898,10 @@ export class CallInterface extends LogicItem {
|
|
|
897
898
|
get integration() {
|
|
898
899
|
return this.getAncestor('Integration');
|
|
899
900
|
}
|
|
901
|
+
|
|
902
|
+
getQuickInfoOffset(range: Range, getCode: GetCode) {
|
|
903
|
+
return getCallExpressionQuickInfo(range, getCode);
|
|
904
|
+
}
|
|
900
905
|
//================================================================================
|
|
901
906
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
902
907
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -15,8 +15,7 @@ import type Param from './Param__';
|
|
|
15
15
|
import type View from './View__';
|
|
16
16
|
import { getNodeByNodeCallee, getNaslNodeByNodeCallee } from '../automate/engine/utils';
|
|
17
17
|
import { findConceptKeyWordIndexFromNamespace } from '../utils';
|
|
18
|
-
import {
|
|
19
|
-
import type Identifier from './Identifier__';
|
|
18
|
+
import { getCallExpressionQuickInfo, GetCode, Range } from './utils/quick-info';
|
|
20
19
|
import type { ViewElement, ElementToVueOptions } from './ViewElement__';
|
|
21
20
|
import type { MemberExpression } from './MemberExpression__';
|
|
22
21
|
|
|
@@ -774,23 +773,23 @@ export class CallLogic extends LogicItem {
|
|
|
774
773
|
code += calleeName;
|
|
775
774
|
}
|
|
776
775
|
return code;
|
|
777
|
-
}
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
}
|
|
787
|
-
setArguments();
|
|
788
|
-
return code;
|
|
789
|
-
} else if (calleeName === 'jsonDeserialize') {
|
|
790
|
-
code += options?.finalCode === false ? 'JSON 反序列化' : 'JSON.parse';
|
|
791
|
-
setArguments();
|
|
792
|
-
return code;
|
|
776
|
+
}
|
|
777
|
+
if (calleeName === 'jsonSerialize') {
|
|
778
|
+
if (
|
|
779
|
+
this.arguments[0]?.expression?.__TypeAnnotation?.typeName === 'String' &&
|
|
780
|
+
this.arguments[0]?.expression?.__TypeAnnotation?.typeNamespace === 'nasl.core'
|
|
781
|
+
) {
|
|
782
|
+
code += options?.finalCode === false ? 'JSON 序列化' : 'JSON.stringify';
|
|
783
|
+
} else {
|
|
784
|
+
code += options?.finalCode === false ? 'JSON 序列化' : `$utils['JsonSerialize']`;
|
|
793
785
|
}
|
|
786
|
+
setArguments();
|
|
787
|
+
return code;
|
|
788
|
+
}
|
|
789
|
+
if (calleeName === 'jsonDeserialize') {
|
|
790
|
+
code += options?.finalCode === false ? 'JSON 反序列化' : 'JSON.parse';
|
|
791
|
+
setArguments();
|
|
792
|
+
return code;
|
|
794
793
|
}
|
|
795
794
|
}
|
|
796
795
|
|
|
@@ -816,12 +815,11 @@ export class CallLogic extends LogicItem {
|
|
|
816
815
|
|
|
817
816
|
if (bindAttr?.name === 'data-source') {
|
|
818
817
|
return this.calleeName;
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
}
|
|
818
|
+
}
|
|
819
|
+
if (calleeName === 'jsonSerialize') {
|
|
820
|
+
return 'JSON 序列化';
|
|
821
|
+
} if (calleeName === 'jsonDeserialize') {
|
|
822
|
+
return 'JSON 反序列化';
|
|
825
823
|
}
|
|
826
824
|
}
|
|
827
825
|
|
|
@@ -1194,11 +1192,17 @@ export class CallLogic extends LogicItem {
|
|
|
1194
1192
|
};
|
|
1195
1193
|
}
|
|
1196
1194
|
const typeAnnotation = (this as any).typeAnnotation || this.__TypeAnnotation;
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
(
|
|
1195
|
+
let { sortedTypeKey, typeKind, typeName, typeNamespace } = typeAnnotation || {};
|
|
1196
|
+
if (typeNamespace?.endsWith('.metadataTypes')) {
|
|
1197
|
+
const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
|
|
1198
|
+
const typeAn = referenceNode.typeAnnotation || {};
|
|
1199
|
+
sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
|
|
1200
|
+
typeKind = typeAn.typeKind;
|
|
1201
|
+
typeName = typeAn.typeName;
|
|
1202
|
+
}
|
|
1203
|
+
const needGenInitFromSchema = typeAnnotation && (!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
|
|
1200
1204
|
if (needGenInitFromSchema) {
|
|
1201
|
-
code = `this.$genInitFromSchema('${
|
|
1205
|
+
code = `this.$genInitFromSchema('${sortedTypeKey}', ${code})`;
|
|
1202
1206
|
}
|
|
1203
1207
|
code += ')';
|
|
1204
1208
|
return code;
|
|
@@ -1515,41 +1519,21 @@ export class CallLogic extends LogicItem {
|
|
|
1515
1519
|
}
|
|
1516
1520
|
|
|
1517
1521
|
/** 获取类型标注时的偏移量 */
|
|
1518
|
-
getQuickInfoOffset(
|
|
1522
|
+
getQuickInfoOffset(range: Range, getCode: GetCode) {
|
|
1519
1523
|
if (this.useIife) {
|
|
1520
1524
|
const characterOffset = 8;
|
|
1525
|
+
const code = getCode();
|
|
1521
1526
|
const lines = code.split('\n');
|
|
1522
1527
|
const lineOffset = lines.findIndex((item) => item.startsWith('return wrapper'));
|
|
1523
1528
|
|
|
1524
1529
|
return {
|
|
1525
|
-
line:
|
|
1530
|
+
line: range.start.line + lineOffset + 1,
|
|
1526
1531
|
offset: characterOffset,
|
|
1527
1532
|
};
|
|
1528
1533
|
}
|
|
1529
|
-
let indexOf = 0;
|
|
1530
|
-
|
|
1531
|
-
// 没有括号,表示括号在外面
|
|
1532
|
-
if (!code.includes('(')) {
|
|
1533
|
-
indexOf = -1;
|
|
1534
|
-
}
|
|
1535
|
-
// 有括号就找到括号的位置
|
|
1536
1534
|
else {
|
|
1537
|
-
|
|
1538
|
-
if (code.includes('<')) {
|
|
1539
|
-
indexOf = Math.min(code.indexOf('<'), code.indexOf('('));
|
|
1540
|
-
} else {
|
|
1541
|
-
indexOf = code.indexOf('(');
|
|
1542
|
-
}
|
|
1543
|
-
const subStr = code.substring(0, indexOf);
|
|
1544
|
-
const codeArr = subStr?.split('.');
|
|
1545
|
-
const lastLen = codeArr?.[codeArr.length - 1]?.length;
|
|
1546
|
-
indexOf = subStr.length - lastLen;
|
|
1535
|
+
return getCallExpressionQuickInfo(range, getCode);
|
|
1547
1536
|
}
|
|
1548
|
-
|
|
1549
|
-
return {
|
|
1550
|
-
...detail,
|
|
1551
|
-
offset: detail.offset + indexOf,
|
|
1552
|
-
};
|
|
1553
1537
|
}
|
|
1554
1538
|
|
|
1555
1539
|
/**
|
|
@@ -697,13 +697,13 @@ export class Destination extends LogicItem {
|
|
|
697
697
|
}
|
|
698
698
|
|
|
699
699
|
@withSourceMapGenerator
|
|
700
|
-
*toEmbeddedTSInProcess(state = createCompilerState(),
|
|
700
|
+
*toEmbeddedTSInProcess(state = createCompilerState(), prevCode: string): TranslatorGenerator {
|
|
701
701
|
const self = this;
|
|
702
702
|
// const tab = indent((state?.tabSize || 0));
|
|
703
703
|
if (self.tsCalleeNamespace && self.tsName) {
|
|
704
704
|
const destinationName = self.parentNode.name.replace('-', '_');
|
|
705
705
|
let code = `${destinationName}: function() {\n`;
|
|
706
|
-
code +=
|
|
706
|
+
code += prevCode;
|
|
707
707
|
code += '\n';
|
|
708
708
|
if (self.tsCalleeNamespace && self.viewName) {
|
|
709
709
|
code += `${self.tsCalleeNamespace}.${self.viewName}.$destination({`;
|
package/src/concepts/Logic__.ts
CHANGED
|
@@ -1832,15 +1832,16 @@ export class Logic extends BaseNode {
|
|
|
1832
1832
|
// 没有参数的
|
|
1833
1833
|
code += '()';
|
|
1834
1834
|
}
|
|
1835
|
-
//
|
|
1835
|
+
// 需要类型推导的局部变量/返回值需要进行变量提升,声明在前
|
|
1836
1836
|
const advanceMap: Map<Return | Variable, Assignment | BatchAssignment> = new Map();
|
|
1837
|
-
// const needGetSourceMapOqlList: Promise<any>[] = [];
|
|
1838
1837
|
yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
|
|
1839
|
-
if (
|
|
1838
|
+
if (isInPlayground(el)) {
|
|
1839
|
+
// 若当前节点在草稿中,无须提升并忽略
|
|
1840
|
+
return;
|
|
1841
|
+
}
|
|
1842
|
+
if ((asserts.isBatchAssignment(el) || (asserts.isAssignment(el) && el.left?.name))) {
|
|
1840
1843
|
if (asserts.isAssignment(el)) {
|
|
1841
|
-
const advanceVar = self.variables?.find(
|
|
1842
|
-
(variable) => !variable.typeAnnotation && el.left?.name === variable.name,
|
|
1843
|
-
);
|
|
1844
|
+
const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && el.left?.name === variable.name);
|
|
1844
1845
|
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1845
1846
|
advanceMap.set(advanceVar, el);
|
|
1846
1847
|
}
|
|
@@ -1849,23 +1850,35 @@ export class Logic extends BaseNode {
|
|
|
1849
1850
|
advanceMap.set(advanceRn, el);
|
|
1850
1851
|
}
|
|
1851
1852
|
} else if (asserts.isBatchAssignment(el)) {
|
|
1852
|
-
yield
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
(
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1853
|
+
yield *
|
|
1854
|
+
wrapForEach(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
|
|
1855
|
+
const leftCode =
|
|
1856
|
+
leftIndex.length === 1
|
|
1857
|
+
? yield* el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1858
|
+
: yield* el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ?? returnOrigin('');
|
|
1859
|
+
const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && leftCode === variable.name);
|
|
1860
|
+
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1861
|
+
advanceMap.set(advanceVar, el);
|
|
1862
|
+
}
|
|
1863
|
+
const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && leftCode === ret.name);
|
|
1864
|
+
if (advanceRn && !advanceMap.get(advanceRn)) {
|
|
1865
|
+
advanceMap.set(advanceRn, el);
|
|
1866
|
+
}
|
|
1867
|
+
});
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
|
|
1871
|
+
function isInPlayground(node: types.SyntaxNode) {
|
|
1872
|
+
while (node) {
|
|
1873
|
+
const parent = node.parentNode;
|
|
1874
|
+
if (parent) {
|
|
1875
|
+
if (asserts.isLogic(parent) && node.parentKey === 'playground') {
|
|
1876
|
+
return true;
|
|
1867
1877
|
}
|
|
1868
|
-
|
|
1878
|
+
node = node.parentNode;
|
|
1879
|
+
} else {
|
|
1880
|
+
return false;
|
|
1881
|
+
}
|
|
1869
1882
|
}
|
|
1870
1883
|
}
|
|
1871
1884
|
});
|
|
@@ -276,7 +276,7 @@ export class MemberExpression extends LogicItem {
|
|
|
276
276
|
(this.object as Identifier)?.isEnum() &&
|
|
277
277
|
this.property?.concept === 'Identifier'
|
|
278
278
|
) {
|
|
279
|
-
return this.isDefaultValueExpression() ? this.property?.name : `"${this.property?.name}"`;
|
|
279
|
+
return this.isDefaultValueExpression(!!state?.getVuePrototype) ? this.property?.name : `"${this.property?.name}"`;
|
|
280
280
|
}
|
|
281
281
|
if (
|
|
282
282
|
this.object?.__TypeAnnotation?.sortedTypeKey?.startsWith('nasl.collection.Map') &&
|
|
@@ -379,8 +379,8 @@ export class MemberExpression extends LogicItem {
|
|
|
379
379
|
return (this.object as Identifier)?.isEnum?.();
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
-
isDefaultValueExpression() {
|
|
383
|
-
return this.parentNode instanceof DefaultValue;
|
|
382
|
+
isDefaultValueExpression(getVuePrototype: boolean) {
|
|
383
|
+
return this.parentNode instanceof DefaultValue && getVuePrototype;
|
|
384
384
|
}
|
|
385
385
|
|
|
386
386
|
// 方便快速取值,遍历获取value
|
|
@@ -9,13 +9,9 @@ import {
|
|
|
9
9
|
withGenerator,
|
|
10
10
|
TranslatorGenerator,
|
|
11
11
|
} from '../translator';
|
|
12
|
-
import { ElementToVueOptions } from './ViewElement__';
|
|
13
12
|
import type MemberExpression from './MemberExpression__';
|
|
14
|
-
import type StructureProperty from './StructureProperty__';
|
|
15
|
-
import type App from './App__';
|
|
16
|
-
import { genHash } from '../generator';
|
|
17
13
|
import type ForEachStatement from './ForEachStatement__';
|
|
18
|
-
import
|
|
14
|
+
import { getNewCompositeQuickInfo, GetCode, Range } from './utils/quick-info';
|
|
19
15
|
//================================================================================
|
|
20
16
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
21
17
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -1607,6 +1603,10 @@ export class NewComposite extends LogicItem {
|
|
|
1607
1603
|
}
|
|
1608
1604
|
return code;
|
|
1609
1605
|
}
|
|
1606
|
+
|
|
1607
|
+
getQuickInfoOffset(range: Range, getCode: GetCode) {
|
|
1608
|
+
return getNewCompositeQuickInfo(this.concept, range, getCode);
|
|
1609
|
+
}
|
|
1610
1610
|
//================================================================================
|
|
1611
1611
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
1612
1612
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { wrapForEachToGenerator as wrapForEach
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
2
2
|
import {
|
|
3
3
|
TranslatorState,
|
|
4
4
|
shiftState,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
TranslatorGenerator,
|
|
11
11
|
} from '../translator';
|
|
12
12
|
import type ForEachStatement from './ForEachStatement__';
|
|
13
|
-
import
|
|
13
|
+
import { getNewCompositeQuickInfo, GetCode, Range } from './utils/quick-info';
|
|
14
14
|
//================================================================================
|
|
15
15
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
16
16
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -558,6 +558,10 @@ export class NewList extends LogicItem {
|
|
|
558
558
|
}
|
|
559
559
|
return code;
|
|
560
560
|
}
|
|
561
|
+
|
|
562
|
+
getQuickInfoOffset(range: Range, getCode: GetCode) {
|
|
563
|
+
return getNewCompositeQuickInfo(this.concept, range, getCode);
|
|
564
|
+
}
|
|
561
565
|
//================================================================================
|
|
562
566
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
563
567
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
package/src/concepts/NewMap__.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { wrapForEachToGenerator as wrapForEach
|
|
1
|
+
import { wrapForEachToGenerator as wrapForEach } from '../utils/time-slicing';
|
|
2
2
|
import {
|
|
3
3
|
TranslatorState,
|
|
4
4
|
shiftState,
|
|
@@ -9,9 +9,8 @@ import {
|
|
|
9
9
|
withGenerator,
|
|
10
10
|
TranslatorGenerator,
|
|
11
11
|
} from '../translator';
|
|
12
|
-
import { ElementToVueOptions } from './ViewElement__';
|
|
13
12
|
import type ForEachStatement from './ForEachStatement__';
|
|
14
|
-
import
|
|
13
|
+
import { getNewCompositeQuickInfo, GetCode, Range } from './utils/quick-info';
|
|
15
14
|
//================================================================================
|
|
16
15
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
17
16
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -802,6 +801,10 @@ export class NewMap extends LogicItem {
|
|
|
802
801
|
}
|
|
803
802
|
return code;
|
|
804
803
|
}
|
|
804
|
+
|
|
805
|
+
getQuickInfoOffset(range: Range, getCode: GetCode) {
|
|
806
|
+
return getNewCompositeQuickInfo(this.concept, range, getCode);
|
|
807
|
+
}
|
|
805
808
|
//================================================================================
|
|
806
809
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
807
810
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -361,17 +361,25 @@ export class Param extends BaseNode {
|
|
|
361
361
|
toJS(state?: TranslatorState): string {
|
|
362
362
|
if (this.view) {
|
|
363
363
|
const typeAnnotation = this.typeAnnotation || this.__TypeAnnotation;
|
|
364
|
+
let { sortedTypeKey, typeKind, typeName, typeNamespace } = typeAnnotation || {};
|
|
365
|
+
if (typeNamespace?.endsWith('.metadataTypes')) {
|
|
366
|
+
const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
|
|
367
|
+
const typeAn = referenceNode.typeAnnotation || {};
|
|
368
|
+
sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
|
|
369
|
+
typeKind = typeAn.typeKind;
|
|
370
|
+
typeName = typeAn.typeName;
|
|
371
|
+
}
|
|
364
372
|
const needGenInitFromSchema =
|
|
365
373
|
typeAnnotation &&
|
|
366
|
-
(!['primitive', 'union'].includes(
|
|
374
|
+
(!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
|
|
367
375
|
let code = `${this.name} = `;
|
|
368
376
|
if (needGenInitFromSchema) {
|
|
369
|
-
code += `this.$genInitFromSchema('${
|
|
377
|
+
code += `this.$genInitFromSchema('${sortedTypeKey}',`;
|
|
370
378
|
}
|
|
371
379
|
|
|
372
380
|
const expressionJS = this.defaultValue?.toJS?.();
|
|
373
381
|
|
|
374
|
-
code += `${this.name} || (this.$route.query.hasOwnProperty('${this.name}') ? this.$genInitFromSchema('${
|
|
382
|
+
code += `${this.name} || (this.$route.query.hasOwnProperty('${this.name}') ? this.$genInitFromSchema('${sortedTypeKey}', this.$route.query.${this.name}) : ${expressionJS})`;
|
|
375
383
|
if (needGenInitFromSchema) {
|
|
376
384
|
code += `)`;
|
|
377
385
|
}
|
|
@@ -1915,7 +1915,14 @@ export class ProcessElement extends BaseNode {
|
|
|
1915
1915
|
if (Array.isArray(self.bindEvents)) {
|
|
1916
1916
|
yield* wrapForEach(self.bindEvents, function* warpForEachGenerator(bindEvent) {
|
|
1917
1917
|
// 任务完成时可以拿到输出参数
|
|
1918
|
-
|
|
1918
|
+
let currentPrevCode: any;
|
|
1919
|
+
if(bindEvent.name !== 'OnClose') {
|
|
1920
|
+
currentPrevCode = prevCode;
|
|
1921
|
+
// 除了任务完成时的逻辑,其他逻辑拿不到自己任务下的输出参数,所以不需要__ProcessIdentification__标注
|
|
1922
|
+
currentPrevCode = currentPrevCode.replace('__ProcessIdentification__', '');
|
|
1923
|
+
} else {
|
|
1924
|
+
currentPrevCode = prevCodeClose;
|
|
1925
|
+
}
|
|
1919
1926
|
code += `${tab1}${bindEvent.name}: () => [\n`;
|
|
1920
1927
|
yield* wrapForEach(bindEvent.logics, function* warpForEachGenerator(logic) {
|
|
1921
1928
|
code += `${yield* logic.toEmbeddedTSInProcess(
|
package/src/concepts/Return__.ts
CHANGED
|
@@ -322,12 +322,20 @@ export class Return extends BaseNode {
|
|
|
322
322
|
toJS(state?: TranslatorState): string {
|
|
323
323
|
const context = this.view ? 'this' : 'Vue.prototype';
|
|
324
324
|
const typeAnnotation = this.typeAnnotation || this.__TypeAnnotation;
|
|
325
|
+
let { sortedTypeKey, typeKind, typeName, typeNamespace } = typeAnnotation || {};
|
|
326
|
+
if (typeNamespace?.endsWith('.metadataTypes')) {
|
|
327
|
+
const referenceNode = this.app.findNodeByCompleteName(typeNamespace + '.' + typeName) || {};
|
|
328
|
+
const typeAn = referenceNode.typeAnnotation || {};
|
|
329
|
+
sortedTypeKey = `${typeAn.typeNamespace}.${typeAn.typeName}`;
|
|
330
|
+
typeKind = typeAn.typeKind;
|
|
331
|
+
typeName = typeAn.typeName;
|
|
332
|
+
}
|
|
325
333
|
const needGenInitFromSchema =
|
|
326
334
|
typeAnnotation &&
|
|
327
|
-
(!['primitive', 'union'].includes(
|
|
335
|
+
(!['primitive', 'union'].includes(typeKind) || typeName === 'DateTime');
|
|
328
336
|
let code = `${this.name} = `;
|
|
329
337
|
if (needGenInitFromSchema) {
|
|
330
|
-
code += `${context}.$genInitFromSchema('${
|
|
338
|
+
code += `${context}.$genInitFromSchema('${sortedTypeKey}',`;
|
|
331
339
|
}
|
|
332
340
|
|
|
333
341
|
if (this.defaultValue?.expression) {
|