@lcap/nasl 3.3.0-beta.2 → 3.3.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.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/bak/translator.js +16 -18
- package/out/bak/translator.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.js +1 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/shared/constants.d.ts +2 -0
- package/out/breakpoint/shared/constants.js +3 -1
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/socket.d.ts +1 -0
- package/out/breakpoint/shared/socket.js +35 -17
- package/out/breakpoint/shared/socket.js.map +1 -1
- package/out/breakpoint/shared/utils.js +33 -1
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/breakpoint/store/core.d.ts +2 -0
- package/out/breakpoint/store/core.js +5 -3
- package/out/breakpoint/store/core.js.map +1 -1
- package/out/breakpoint/store/dock.js +33 -0
- package/out/breakpoint/store/dock.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.js +2 -1
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +5 -5
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +3 -3
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +2 -0
- package/out/concepts/CallConnector__.js +17 -1
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.js +31 -24
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallLogic__.js +53 -46
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Connection__.js +1 -1
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +1 -20
- package/out/concepts/ForEachStatement__.js +16 -14
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/IfStatement__.js +24 -25
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Logic__.js +8 -20
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +12 -7
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +11 -14
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +1 -1
- package/out/concepts/NewComposite__.js +11 -83
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js +11 -9
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +1 -1
- package/out/concepts/NewMap__.js +12 -4
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.js +3 -1
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +2 -2
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +8 -4
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +4 -2
- package/out/concepts/ViewElement__.js +7 -21
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/WhileStatement__.js +6 -4
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.browser.js +19 -3
- package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.d.ts +2 -0
- package/out/concepts/basics/stdlib/nasl.util.js +36 -11
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/timeZone.d.ts +5 -0
- package/out/concepts/basics/stdlib/timeZone.js +196 -0
- package/out/concepts/basics/stdlib/timeZone.js.map +1 -0
- package/out/generator/genBundleFiles.js +12 -4
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +1 -1
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/natural/genNaturalTS.d.ts +2 -2
- package/out/natural/genNaturalTS.js +5 -5
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/transformTSCode.js +18 -3
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/createUiTs.js +3 -0
- package/out/server/createUiTs.js.map +1 -1
- package/out/server/getLogics.js +3 -1
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +15 -0
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.js +35 -9
- package/out/server/naslServer.js.map +1 -1
- package/out/service/creator/errHandles.js +10 -19
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/storage/init.js +7 -2
- package/out/service/storage/init.js.map +1 -1
- package/out/service/storage/jsoner.js +1 -3
- package/out/service/storage/jsoner.js.map +1 -1
- package/out/templator/genEditTableBlock.js +24 -2
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +22 -1
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/translator/types.d.ts +1 -0
- package/out/translator/utils.js +13 -0
- package/out/translator/utils.js.map +1 -1
- package/package.json +2 -2
- package/sandbox/stdlib/nasl.browser.ts +2 -0
- package/sandbox/stdlib/nasl.ui.definition.ts +2220 -2218
- package/sandbox/stdlib/nasl.util.ts +20 -10
- package/sandbox-natural/stdlib/nasl.core.ts +6 -3
- package/sandbox-natural/stdlib/nasl.oql.ts +6 -0
- package/sandbox-natural/stdlib/nasl.util.ts +1 -1
- package/src/bak/translator.js +16 -17
- package/src/breakpoint/generator/BreakpointNode.ts +1 -0
- package/src/breakpoint/shared/constants.ts +2 -0
- package/src/breakpoint/shared/socket.ts +41 -17
- package/src/breakpoint/shared/utils.ts +43 -1
- package/src/breakpoint/store/core.ts +2 -2
- package/src/breakpoint/store/dock.ts +50 -0
- package/src/breakpoint/types/index.d.ts +1 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +2 -1
- package/src/concepts/BinaryExpression__.ts +6 -6
- package/src/concepts/BindAttribute__.ts +5 -4
- package/src/concepts/CallConnector__.ts +19 -1
- package/src/concepts/CallFunction__.ts +40 -22
- package/src/concepts/CallLogic__.ts +39 -32
- package/src/concepts/Connection__.ts +1 -1
- package/src/concepts/ForEachStatement__.ts +17 -15
- package/src/concepts/IfStatement__.ts +30 -30
- package/src/concepts/Logic__.ts +13 -27
- package/src/concepts/MatchCase__.ts +15 -7
- package/src/concepts/MemberExpression__.ts +11 -14
- package/src/concepts/NewComposite__.ts +15 -83
- package/src/concepts/NewList__.ts +11 -9
- package/src/concepts/NewMap__.ts +12 -4
- package/src/concepts/New__.ts +1 -0
- package/src/concepts/StringInterpolation__.ts +2 -2
- package/src/concepts/SwitchCase__.ts +9 -5
- package/src/concepts/ViewElement__.ts +8 -22
- package/src/concepts/WhileStatement__.ts +7 -5
- package/src/concepts/basics/stdlib/nasl.browser.ts +19 -3
- package/src/concepts/basics/stdlib/nasl.util.ts +38 -19
- package/src/concepts/basics/stdlib/timeZone.ts +193 -0
- package/src/generator/genBundleFiles.ts +12 -4
- package/src/generator/genReleaseBody.ts +1 -1
- package/src/natural/genNaturalTS.ts +5 -5
- package/src/natural/transformTSCode.ts +18 -4
- package/src/server/createUiTs.ts +3 -0
- package/src/server/getLogics.ts +3 -1
- package/src/server/getMemberIdentifier.ts +15 -0
- package/src/server/naslServer.ts +126 -83
- package/src/service/creator/errHandles.js +10 -16
- package/src/service/storage/init.ts +10 -3
- package/src/service/storage/jsoner.ts +2 -2
- package/src/templator/genEditTableBlock.ts +24 -2
- package/src/templator/genTableBlock.ts +22 -1
- package/src/translator/types.ts +1 -0
- package/src/translator/utils.ts +15 -0
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +20 -20
- package/test/concepts/match/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/member-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +1 -1
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +10 -10
package/src/concepts/Logic__.ts
CHANGED
|
@@ -24,10 +24,10 @@ import CallLogic from './CallLogic__';
|
|
|
24
24
|
import ViewElement from './ViewElement__';
|
|
25
25
|
import { SynatxNode } from './types__';
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
//================================================================================
|
|
28
28
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
29
29
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
30
|
-
|
|
30
|
+
//================================================================================
|
|
31
31
|
import { EventPayload, Params } from '../common/EventEmitter';
|
|
32
32
|
import { concept, excludedInJSON, property, className } from '../decorators';
|
|
33
33
|
|
|
@@ -1396,10 +1396,10 @@ export class Logic extends BaseNode {
|
|
|
1396
1396
|
return params;
|
|
1397
1397
|
}
|
|
1398
1398
|
|
|
1399
|
-
|
|
1399
|
+
//================================================================================
|
|
1400
1400
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
1401
1401
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
1402
|
-
|
|
1402
|
+
//================================================================================
|
|
1403
1403
|
// 用于calllogic树中定位是那个logic,回显
|
|
1404
1404
|
get calleewholeKey() {
|
|
1405
1405
|
return `${this.getNamespace()}.${this.name}`;
|
|
@@ -1985,24 +1985,6 @@ ${indent(state.tabSize)} */\n`;
|
|
|
1985
1985
|
|
|
1986
1986
|
code += ')';
|
|
1987
1987
|
|
|
1988
|
-
// 需要类型推导的局部变量/返回值需要调整申明顺序
|
|
1989
|
-
const advanceMap: Map<Return | Variable, Assignment | BatchAssignment> = new Map();
|
|
1990
|
-
this.traverseChildren((el) => {
|
|
1991
|
-
if (el && (el instanceof BatchAssignment || (el instanceof Assignment && el.left?.name))) {
|
|
1992
|
-
const jsCode = el.toJS();
|
|
1993
|
-
const advanceVar = this.variables?.find((variable) =>
|
|
1994
|
-
!variable.typeAnnotation && jsCode.includes(`${variable.name} = `));
|
|
1995
|
-
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1996
|
-
advanceMap.set(advanceVar, el);
|
|
1997
|
-
}
|
|
1998
|
-
const advanceRn = this.returns?.find((ret) =>
|
|
1999
|
-
!ret.typeAnnotation && jsCode.includes(`${ret.name} = `));
|
|
2000
|
-
if (advanceRn && !advanceMap.get(advanceRn)) {
|
|
2001
|
-
advanceMap.set(advanceRn, el);
|
|
2002
|
-
}
|
|
2003
|
-
}
|
|
2004
|
-
});
|
|
2005
|
-
|
|
2006
1988
|
// 兼容 return 没有类型情况
|
|
2007
1989
|
if (this.returns.length && this.returns[0].typeAnnotation) {
|
|
2008
1990
|
code += ': ';
|
|
@@ -2025,12 +2007,16 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2025
2007
|
code += ';\n';
|
|
2026
2008
|
});
|
|
2027
2009
|
|
|
2028
|
-
code += `${indent(state.tabSize + 1)}// 当前位置\n`;
|
|
2029
2010
|
if (!this.body.length && this.returns.length) {
|
|
2011
|
+
if (!state.focusedNodePath || `${this.nodePath}.body[0]` === state.focusedNodePath)
|
|
2012
|
+
code += `${indent(state.tabSize + 1)}// 当前位置\n`;
|
|
2030
2013
|
code += `${indent(state.tabSize + 1)}return ${this.returns[0].name};\n`;
|
|
2031
2014
|
} else {
|
|
2032
2015
|
this.body.forEach((item) => {
|
|
2033
2016
|
let partialCode = '';
|
|
2017
|
+
|
|
2018
|
+
if (!state.focusedNodePath && item.concept === 'End')
|
|
2019
|
+
code += `${indent(state.tabSize + 1)}// 当前位置\n`;
|
|
2034
2020
|
if (item.toNaturalTS) {
|
|
2035
2021
|
partialCode = item.toNaturalTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
2036
2022
|
} else if (item.toEmbeddedTS) {
|
|
@@ -2442,14 +2428,14 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2442
2428
|
return findHasError;
|
|
2443
2429
|
}
|
|
2444
2430
|
|
|
2445
|
-
|
|
2431
|
+
//================================================================================
|
|
2446
2432
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
2447
2433
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
2448
|
-
|
|
2434
|
+
//================================================================================
|
|
2449
2435
|
}
|
|
2450
2436
|
|
|
2451
2437
|
export default Logic;
|
|
2452
|
-
|
|
2438
|
+
//================================================================================
|
|
2453
2439
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
2454
2440
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
2455
|
-
|
|
2441
|
+
//================================================================================
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
2
3
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
3
4
|
import Match from './Match__';
|
|
4
5
|
import MemberExpression from './MemberExpression__';
|
|
@@ -13,7 +14,6 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
13
14
|
import { concept, excludedInJSON, property, className } from '../decorators';
|
|
14
15
|
|
|
15
16
|
import * as utils from '../utils';
|
|
16
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
17
17
|
import BaseNode from '../common/BaseNode';
|
|
18
18
|
import LogicItem from './LogicItem__';
|
|
19
19
|
import TypeAnnotation from './TypeAnnotation__';
|
|
@@ -56,7 +56,7 @@ export class MatchCase extends LogicItem {
|
|
|
56
56
|
* @param source 需要合并的部分参数
|
|
57
57
|
*/
|
|
58
58
|
constructor(source?: Partial<MatchCase>) {
|
|
59
|
-
source =
|
|
59
|
+
source = { ...MatchCase.getDefaultOptions(), ...source};
|
|
60
60
|
super(source);
|
|
61
61
|
super.subConstructor(source);
|
|
62
62
|
}
|
|
@@ -93,6 +93,7 @@ export class MatchCase extends LogicItem {
|
|
|
93
93
|
const excludedSet = new Set(excludedList);
|
|
94
94
|
return ((this.patterns as LogicItem[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
95
95
|
}
|
|
96
|
+
|
|
96
97
|
getLogicItemUniqueName(name = 'logicItem1') {
|
|
97
98
|
return utils.unique(name, this.getLogicItemExistingNames(), undefined, false);
|
|
98
99
|
}
|
|
@@ -348,6 +349,7 @@ export class MatchCase extends LogicItem {
|
|
|
348
349
|
.filter((item) => !excludedSet.has(item))
|
|
349
350
|
.map((item) => item.name);
|
|
350
351
|
}
|
|
352
|
+
|
|
351
353
|
getTypeAnnotationUniqueName(name = 'typeAnnotation1') {
|
|
352
354
|
return utils.unique(name, this.getTypeAnnotationExistingNames(), undefined, false);
|
|
353
355
|
}
|
|
@@ -514,7 +516,7 @@ export class MatchCase extends LogicItem {
|
|
|
514
516
|
if (typeof options === 'string') {
|
|
515
517
|
logicItem = (this.patterns as LogicItem[]).find((item) => item.name === options);
|
|
516
518
|
if (!logicItem) {
|
|
517
|
-
throw new Error(
|
|
519
|
+
throw new Error(`找不到逻辑项 ${ options}`);
|
|
518
520
|
}
|
|
519
521
|
} else {
|
|
520
522
|
logicItem = options;
|
|
@@ -529,12 +531,12 @@ export class MatchCase extends LogicItem {
|
|
|
529
531
|
removeItemInBody(logicItem: LogicItem): void;
|
|
530
532
|
|
|
531
533
|
removeItemInBody(options: LogicItem) {
|
|
532
|
-
|
|
534
|
+
const logicItem: LogicItem = options;
|
|
533
535
|
return logicItem.delete();
|
|
534
536
|
}
|
|
535
537
|
|
|
536
538
|
__removeLogicItem(logicItem: LogicItem) {
|
|
537
|
-
const parentKey = logicItem
|
|
539
|
+
const {parentKey} = logicItem;
|
|
538
540
|
const params: Params = {
|
|
539
541
|
parentNode: this,
|
|
540
542
|
parentKey,
|
|
@@ -573,7 +575,7 @@ export class MatchCase extends LogicItem {
|
|
|
573
575
|
if (typeof options === 'string') {
|
|
574
576
|
typeAnnotation = (this.patterns as TypeAnnotation[]).find((item) => item.name === options);
|
|
575
577
|
if (!typeAnnotation) {
|
|
576
|
-
throw new Error(
|
|
578
|
+
throw new Error(`找不到类型标注 ${ options}`);
|
|
577
579
|
}
|
|
578
580
|
} else {
|
|
579
581
|
typeAnnotation = options;
|
|
@@ -582,7 +584,7 @@ export class MatchCase extends LogicItem {
|
|
|
582
584
|
}
|
|
583
585
|
|
|
584
586
|
__removeTypeAnnotation(typeAnnotation: TypeAnnotation) {
|
|
585
|
-
const parentKey = typeAnnotation
|
|
587
|
+
const {parentKey} = typeAnnotation;
|
|
586
588
|
const params: Params = {
|
|
587
589
|
parentNode: this,
|
|
588
590
|
parentKey,
|
|
@@ -893,6 +895,8 @@ export class MatchCase extends LogicItem {
|
|
|
893
895
|
tabSize: state.tabSize + 1,
|
|
894
896
|
}))}\n`;
|
|
895
897
|
});
|
|
898
|
+
if (state.focusedNodePath === `${this.nodePath}.body[${this.body.length}]`)
|
|
899
|
+
code += `${indent(state.tabSize + 1)}// 当前位置\n`;
|
|
896
900
|
}
|
|
897
901
|
code += `${indent(state.tabSize)}}`;
|
|
898
902
|
} else {
|
|
@@ -907,6 +911,8 @@ export class MatchCase extends LogicItem {
|
|
|
907
911
|
tabSize: state.tabSize + 1,
|
|
908
912
|
}))}\n`;
|
|
909
913
|
});
|
|
914
|
+
if (state.focusedNodePath === `${this.nodePath}.body[${this.body.length}]`)
|
|
915
|
+
code += `${indent(state.tabSize + 1)}// 当前位置\n`;
|
|
910
916
|
code += `${indent(state.tabSize)}}\n`;
|
|
911
917
|
}
|
|
912
918
|
} else {
|
|
@@ -920,6 +926,8 @@ export class MatchCase extends LogicItem {
|
|
|
920
926
|
tabSize: state.tabSize,
|
|
921
927
|
}))}\n`;
|
|
922
928
|
});
|
|
929
|
+
if (state.focusedNodePath === `${this.nodePath}.body[${this.body.length}]`)
|
|
930
|
+
code += `${indent(state.tabSize + 1)}// 当前位置\n`;
|
|
923
931
|
code += '\n';
|
|
924
932
|
}
|
|
925
933
|
|
|
@@ -176,13 +176,16 @@ export class MemberExpression extends LogicItem {
|
|
|
176
176
|
} else {
|
|
177
177
|
elementName = this.object.name;
|
|
178
178
|
}
|
|
179
|
+
if (['size', 'page', 'sort', 'order', 'filterText'].includes(this.property.name)) {
|
|
180
|
+
return `this['__${elementName}_params']?.${this.property.name}`;
|
|
181
|
+
}
|
|
179
182
|
let propertyName = '';
|
|
180
183
|
let subProperty = '';
|
|
181
184
|
if (this.property instanceof Identifier) {
|
|
182
185
|
const namespace = this.property.namespace;
|
|
183
186
|
const namespaceList = namespace.includes('.') ? namespace.split('.') : [namespace];
|
|
184
187
|
propertyName = namespaceList[0];
|
|
185
|
-
subProperty = namespaceList?.[1] ?
|
|
188
|
+
subProperty = namespaceList?.[1] ? `?.()['${namespaceList?.[1]}']` : '';
|
|
186
189
|
}
|
|
187
190
|
return `this['__${elementName}_${propertyName}']${subProperty}`;
|
|
188
191
|
} else if (
|
|
@@ -269,13 +272,16 @@ export class MemberExpression extends LogicItem {
|
|
|
269
272
|
} else {
|
|
270
273
|
elementName = this.object.name;
|
|
271
274
|
}
|
|
275
|
+
if (['size', 'page', 'sort', 'order', 'filterText'].includes(this.property.name)) {
|
|
276
|
+
return `this['__${elementName}_params']?.${this.property.name}`;
|
|
277
|
+
}
|
|
272
278
|
let propertyName = '';
|
|
273
279
|
let subProperty = '';
|
|
274
280
|
if (this.property instanceof Identifier) {
|
|
275
281
|
const namespace = this.property.namespace;
|
|
276
282
|
const namespaceList = namespace.includes('.') ? namespace.split('.') : [namespace];
|
|
277
283
|
propertyName = namespaceList[0];
|
|
278
|
-
subProperty = namespaceList?.[1] ?
|
|
284
|
+
subProperty = namespaceList?.[1] ? `?.()['${namespaceList?.[1]}']` : '';
|
|
279
285
|
}
|
|
280
286
|
return `this['__${elementName}_${propertyName}']${subProperty}`;
|
|
281
287
|
} else if (
|
|
@@ -386,16 +392,7 @@ export class MemberExpression extends LogicItem {
|
|
|
386
392
|
}
|
|
387
393
|
transfromAtrrLogic() {
|
|
388
394
|
let elementName = this.getAncestor('ViewElement')?.name;
|
|
389
|
-
|
|
390
|
-
let subProperty = '';
|
|
391
|
-
let name = this.property.name;
|
|
392
|
-
if (atrrParamsMap[this.property.name]) {
|
|
393
|
-
name = atrrParamsMap[this.property.name];
|
|
394
|
-
}
|
|
395
|
-
const namesList = name.includes('.') ? name.split('.') : [name];
|
|
396
|
-
propertyName = namesList[0];
|
|
397
|
-
subProperty = namesList?.[1] ? `['${namesList?.[1]}']` : '';
|
|
398
|
-
return `this['__${elementName}_${propertyName}']${subProperty}`;
|
|
395
|
+
return `this['__${elementName}_params']?.${this.property.name}`;
|
|
399
396
|
}
|
|
400
397
|
|
|
401
398
|
get completeName() {
|
|
@@ -470,12 +467,12 @@ export class MemberExpression extends LogicItem {
|
|
|
470
467
|
});
|
|
471
468
|
}
|
|
472
469
|
} else {
|
|
473
|
-
newCode += `
|
|
470
|
+
newCode += `__elements_completionProperty.${this.object?.name}`;
|
|
474
471
|
if (this.property instanceof Identifier) {
|
|
475
472
|
const namespace = this.property.namespace;
|
|
476
473
|
const namespaceList = namespace.includes('.') ? namespace.split('.') : [namespace];
|
|
477
474
|
namespaceList.forEach((item) => {
|
|
478
|
-
newCode +=
|
|
475
|
+
newCode += `.${attrConvertCamelCase(item)}`;
|
|
479
476
|
});
|
|
480
477
|
}
|
|
481
478
|
}
|
|
@@ -1090,9 +1090,8 @@ export class NewComposite extends LogicItem {
|
|
|
1090
1090
|
: this.rights[rightIndex[0]].expression;
|
|
1091
1091
|
code += `return ${obj};\n`;
|
|
1092
1092
|
} else if (typeAnnotation.typeKind !== 'anonymousStructure') {
|
|
1093
|
-
code += `const obj = this.$genInitFromSchema('${
|
|
1094
|
-
typeAnnotation.
|
|
1095
|
-
}', this.$utils['New'](${typeAnnotation.toUI(shiftState(state, code, { inline: true }))}));\n`;
|
|
1093
|
+
code += `const obj = this.$genInitFromSchema('${typeAnnotation.sortedTypeKey
|
|
1094
|
+
}', this.$utils['New'](${typeAnnotation.toUI(shiftState(state, code, { inline: true }))}));\n`;
|
|
1096
1095
|
this.assignmentLines.forEach(({ leftIndex, rightIndex }, index) => {
|
|
1097
1096
|
const leftSecondIndex = leftIndex[1];
|
|
1098
1097
|
const [rightFirst, rightSecond] = [rightIndex[0], rightIndex[1]];
|
|
@@ -1138,9 +1137,8 @@ export class NewComposite extends LogicItem {
|
|
|
1138
1137
|
: this.rights[rightIndex[0]].expression;
|
|
1139
1138
|
code += `return ${obj.toJS(shiftState(state, code, { inline: true }))};\n`;
|
|
1140
1139
|
} else if (typeAnnotation.typeKind !== 'anonymousStructure') {
|
|
1141
|
-
code += `const obj = this.$genInitFromSchema('${
|
|
1142
|
-
typeAnnotation.
|
|
1143
|
-
}', this.$utils['New'](${typeAnnotation.toJS(shiftState(state, code, { inline: true }))}));\n`;
|
|
1140
|
+
code += `const obj = this.$genInitFromSchema('${typeAnnotation.sortedTypeKey
|
|
1141
|
+
}', this.$utils['New'](${typeAnnotation.toJS(shiftState(state, code, { inline: true }))}));\n`;
|
|
1144
1142
|
const rightMap = new Map();
|
|
1145
1143
|
this.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
|
|
1146
1144
|
const rightIndexJson = JSON.stringify(rightIndex);
|
|
@@ -1366,85 +1364,19 @@ export class NewComposite extends LogicItem {
|
|
|
1366
1364
|
}
|
|
1367
1365
|
|
|
1368
1366
|
@withSourceMap()
|
|
1369
|
-
toNaturalTS(
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
// 提供sourcemap,获取类型标注和上下文可选变量
|
|
1379
|
-
this.rights.forEach((right) => {
|
|
1380
|
-
code += indent1;
|
|
1381
|
-
rightMap.set(right.expression, right.expression.toNaturalTS(shiftState(state, code, { inline: true })));
|
|
1382
|
-
code += rightMap.get(right.expression);
|
|
1383
|
-
code += ';\n';
|
|
1384
|
-
if (right.members?.length) {
|
|
1385
|
-
code += indent2;
|
|
1367
|
+
toNaturalTS(): string {
|
|
1368
|
+
let code = 'nasl.util.';
|
|
1369
|
+
code += this?.typeAnnotation?.typeKind === 'anonymousStructure' ? 'NewAnonymityStructure' : `NewEntity<${this?.typeAnnotation?.typeName || '__IDENTIFIER__'}>`;
|
|
1370
|
+
let params = '';
|
|
1371
|
+
this?.properties?.forEach((item, index) => {
|
|
1372
|
+
if (item) {
|
|
1373
|
+
params += `${item?.toNaturalTS()}: ${this?.rights?.[index]?.expression?.toNaturalTS()}`;
|
|
1374
|
+
if (index !== this.properties.length - 1) {
|
|
1375
|
+
params += ';';
|
|
1386
1376
|
}
|
|
1387
|
-
right.members.forEach((member) => {
|
|
1388
|
-
rightMap.set(member, member.toNaturalTS(shiftState(state, code, { inline: true })));
|
|
1389
|
-
code += rightMap.get(member);
|
|
1390
|
-
code += '; ';
|
|
1391
|
-
});
|
|
1392
|
-
code += right.members.length ? '\n' : '';
|
|
1393
|
-
});
|
|
1394
|
-
// 方便ts报错检查
|
|
1395
|
-
// 是否是左边的顶层连线
|
|
1396
|
-
const leftTopIndex = this.assignmentLines.findIndex(({ leftIndex }) => leftIndex[1] === undefined);
|
|
1397
|
-
if (leftTopIndex !== -1) {
|
|
1398
|
-
// const rightIndex = this.assignmentLines[leftTopIndex].rightIndex;
|
|
1399
|
-
// const rightExpression = rightIndex[1] !== undefined ? this.rights[rightIndex[0]].members[rightIndex[1]] : this.rights[rightIndex[0]].expression;
|
|
1400
|
-
// code += `__obj = ${rightExpression.toNaturalTS(shiftState(state, code, { inline: true }))};`;
|
|
1401
|
-
// code += '\n';
|
|
1402
|
-
} else {
|
|
1403
|
-
code += `${indent0}new ${this.typeAnnotation.typeName}({\n`;
|
|
1404
|
-
this.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
|
|
1405
|
-
const leftSecondIndex = leftIndex[1];
|
|
1406
|
-
const [rightFirst, rightSecond] = [rightIndex[0], rightIndex[1]];
|
|
1407
|
-
const leftItem = this.properties[leftSecondIndex];
|
|
1408
|
-
const rightItem = rightSecond !== undefined ? this.rights[rightFirst].members[rightSecond] : this.rights[rightFirst].expression;
|
|
1409
|
-
const rightTs = rightMap.get(rightItem);
|
|
1410
|
-
code += `${indent1}${leftItem.toNaturalTS(shiftState(state, code, { inline: true }))}: ${['__IDENTIFIER__', '__IDENTIFIER__()'].includes(rightTs) ? 'null' : rightMap.get(rightItem)},\n`;
|
|
1411
|
-
});
|
|
1412
|
-
code += `${indent0}})`;
|
|
1413
1377
|
}
|
|
1414
|
-
}
|
|
1415
|
-
|
|
1416
|
-
const rightMap = new Map();
|
|
1417
|
-
this.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
|
|
1418
|
-
const leftSecondIndex = leftIndex[1];
|
|
1419
|
-
const [rightFirst, rightSecond] = [rightIndex[0], rightIndex[1]];
|
|
1420
|
-
const leftItem = this.properties[leftSecondIndex];
|
|
1421
|
-
const rightItem = rightSecond !== undefined ? this.rights[rightFirst].members[rightSecond] : this.rights[rightFirst].expression;
|
|
1422
|
-
nameMap.set(leftItem.name, rightItem);
|
|
1423
|
-
rightMap.set(rightItem, null);
|
|
1424
|
-
});
|
|
1425
|
-
code += `${indent0}{\n`;
|
|
1426
|
-
this.properties.forEach((property, index) => {
|
|
1427
|
-
const temp = `temp${index}`;
|
|
1428
|
-
const propertyType = this.typeAnnotation.properties[index]?.typeAnnotation;
|
|
1429
|
-
const { name } = property;
|
|
1430
|
-
const rightItem = nameMap.get(name);
|
|
1431
|
-
const ts = rightMap.get(rightItem);
|
|
1432
|
-
if (ts !== undefined) {
|
|
1433
|
-
if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
|
|
1434
|
-
code += `${indent1}${temp}: null,\n`;
|
|
1435
|
-
} else {
|
|
1436
|
-
code += `${indent1}${temp}: ${ts},\n`;
|
|
1437
|
-
}
|
|
1438
|
-
} else if (propertyType) {
|
|
1439
|
-
code += `${indent1}${property.name}: ${propertyType.toNaturalTS(shiftState(state, code, { inline: true }))},\n`;
|
|
1440
|
-
} else {
|
|
1441
|
-
code += `${indent1}`;
|
|
1442
|
-
code += property.toNaturalTS(shiftState(state, code, { inline: true }));
|
|
1443
|
-
code += ',\n';
|
|
1444
|
-
}
|
|
1445
|
-
});
|
|
1446
|
-
code += `${indent0}}`;
|
|
1447
|
-
}
|
|
1378
|
+
});
|
|
1379
|
+
code += `(${params ? `{${params}}` : '__IDENTIFIER__'})`;
|
|
1448
1380
|
return code;
|
|
1449
1381
|
}
|
|
1450
1382
|
|
|
@@ -447,16 +447,18 @@ export class NewList extends LogicItem {
|
|
|
447
447
|
|
|
448
448
|
@withSourceMap()
|
|
449
449
|
toNaturalTS(state = createCompilerState()): string {
|
|
450
|
-
const indent0 = indent((state?.tabSize || 0));
|
|
451
450
|
let code = '';
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
451
|
+
const typeAnnotation = this?.typeAnnotation?.typeArguments?.map((item) => item?.toNaturalTS())?.join(', ') || '__IDENTIFIER__';
|
|
452
|
+
let params = '';
|
|
453
|
+
this?.items?.forEach((item, index) => {
|
|
454
|
+
if (item) {
|
|
455
|
+
params += item.toNaturalTS(shiftState(state, code, { inline: true }));
|
|
456
|
+
if (index !== this.items.length - 1) {
|
|
457
|
+
params += ', ';
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
code += `nasl.util.NewList<${typeAnnotation}>(${params ? `{${params}}` : '__IDENTIFIER__'})`;
|
|
460
462
|
return code;
|
|
461
463
|
}
|
|
462
464
|
|
package/src/concepts/NewMap__.ts
CHANGED
|
@@ -679,11 +679,19 @@ export class NewMap extends LogicItem {
|
|
|
679
679
|
}
|
|
680
680
|
|
|
681
681
|
@withSourceMap()
|
|
682
|
-
toNaturalTS(
|
|
682
|
+
toNaturalTS(): string {
|
|
683
683
|
let code = '';
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
684
|
+
const typeAnnotation = this?.typeAnnotation?.typeArguments?.map((item) => item?.toNaturalTS())?.join(', ') || '__IDENTIFIER__';
|
|
685
|
+
let params = '';
|
|
686
|
+
this?.keys?.forEach((item, index) => {
|
|
687
|
+
if (item) {
|
|
688
|
+
params += `${item?.toNaturalTS()}: ${this?.values?.[index]?.toNaturalTS()}`;
|
|
689
|
+
if (index !== this.keys.length - 1) {
|
|
690
|
+
params += ';';
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
});
|
|
694
|
+
code += `nasl.util.NewMap<${typeAnnotation}>(${params ? `{${params}}` : '__IDENTIFIER__'})`;
|
|
687
695
|
return code;
|
|
688
696
|
}
|
|
689
697
|
|
package/src/concepts/New__.ts
CHANGED
|
@@ -281,7 +281,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
281
281
|
let expCode = exp.toVue();
|
|
282
282
|
if (options?.finalCode !== false) {
|
|
283
283
|
const expTypeAnnotation = exp.typeAnnotation || exp.__TypeAnnotation;
|
|
284
|
-
expCode = `$utils['ToString'](${
|
|
284
|
+
expCode = `$utils['ToString']('${expTypeAnnotation?.sortedTypeKey}', ${expCode})`;
|
|
285
285
|
}
|
|
286
286
|
return expCode;
|
|
287
287
|
})
|
|
@@ -297,7 +297,7 @@ export class StringInterpolation extends LogicItem {
|
|
|
297
297
|
return this.expressions
|
|
298
298
|
.map((exp: any) => {
|
|
299
299
|
const expTypeAnnotation = exp.typeAnnotation || exp.__TypeAnnotation;
|
|
300
|
-
return `this.$utils['ToString'](
|
|
300
|
+
return `this.$utils['ToString']('${expTypeAnnotation?.sortedTypeKey}', ${exp.toJS()})`;
|
|
301
301
|
})
|
|
302
302
|
.join(' + ');
|
|
303
303
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { v4 as uuidv4 } from 'uuid';
|
|
1
2
|
import { TranslatorState, shiftState, withSourceMap, indent, createCompilerState } from '../translator';
|
|
2
3
|
//================================================================================
|
|
3
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -7,7 +8,6 @@ import { EventPayload, Params } from '../common/EventEmitter';
|
|
|
7
8
|
import { concept, excludedInJSON, property, className } from '../decorators';
|
|
8
9
|
|
|
9
10
|
import * as utils from '../utils';
|
|
10
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
11
11
|
import BaseNode from '../common/BaseNode';
|
|
12
12
|
import LogicItem from './LogicItem__';
|
|
13
13
|
|
|
@@ -44,7 +44,7 @@ export class SwitchCase extends LogicItem {
|
|
|
44
44
|
* @param source 需要合并的部分参数
|
|
45
45
|
*/
|
|
46
46
|
constructor(source?: Partial<SwitchCase>) {
|
|
47
|
-
source =
|
|
47
|
+
source = { ...SwitchCase.getDefaultOptions(), ...source};
|
|
48
48
|
super(source);
|
|
49
49
|
super.subConstructor(source);
|
|
50
50
|
}
|
|
@@ -185,7 +185,7 @@ export class SwitchCase extends LogicItem {
|
|
|
185
185
|
if (typeof options === 'string') {
|
|
186
186
|
test = this.test;
|
|
187
187
|
if (!test) {
|
|
188
|
-
throw new Error(
|
|
188
|
+
throw new Error(`找不到逻辑项 ${ options}`);
|
|
189
189
|
}
|
|
190
190
|
} else {
|
|
191
191
|
test = options;
|
|
@@ -200,12 +200,12 @@ export class SwitchCase extends LogicItem {
|
|
|
200
200
|
removeItemInConsequent(logicItem: LogicItem): void;
|
|
201
201
|
|
|
202
202
|
removeItemInConsequent(options: LogicItem) {
|
|
203
|
-
|
|
203
|
+
const logicItem: LogicItem = options;
|
|
204
204
|
return logicItem.delete();
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
__removeLogicItem(logicItem: LogicItem) {
|
|
208
|
-
const parentKey = logicItem
|
|
208
|
+
const {parentKey} = logicItem;
|
|
209
209
|
const params: Params = {
|
|
210
210
|
parentNode: this,
|
|
211
211
|
parentKey,
|
|
@@ -327,6 +327,8 @@ export class SwitchCase extends LogicItem {
|
|
|
327
327
|
code += indent(state.tabSize + 3);
|
|
328
328
|
code += `${logicItem.toNaturalTS(shiftState(state, code, { inline: true }))}\n`;
|
|
329
329
|
});
|
|
330
|
+
if (state.focusedNodePath === `${this.nodePath}.consequent[${this.consequent.length}]`)
|
|
331
|
+
code += `${indent(state.tabSize + 1)}// 当前位置\n`;
|
|
330
332
|
}
|
|
331
333
|
code += indent(state.tabSize + 2);
|
|
332
334
|
code += '}';
|
|
@@ -338,6 +340,8 @@ export class SwitchCase extends LogicItem {
|
|
|
338
340
|
code += indent(state.tabSize + 2);
|
|
339
341
|
code += `${logicItem.toNaturalTS(shiftState(state, code, { inline: true }))}\n`;
|
|
340
342
|
});
|
|
343
|
+
if (state.focusedNodePath === `${this.nodePath}.consequent[${this.consequent.length}]`)
|
|
344
|
+
code += `${indent(state.tabSize + 1)}// 当前位置\n`;
|
|
341
345
|
}
|
|
342
346
|
code += indent(state.tabSize + 2);
|
|
343
347
|
code += '}';
|
|
@@ -1562,6 +1562,8 @@ export class ViewElement extends BaseNode {
|
|
|
1562
1562
|
if (['u-select', 'van-pickerson'].includes(this.tag)) {
|
|
1563
1563
|
code += indent((state?.tabSize || 0) + 3);
|
|
1564
1564
|
code += `pageNumber: nasl.core.Long\n`;
|
|
1565
|
+
code += indent((state?.tabSize || 0) + 3);
|
|
1566
|
+
code += `filterText: nasl.core.String\n`;
|
|
1565
1567
|
} else if (
|
|
1566
1568
|
['u-list-view', 'u-grid-view', 'u-table-view', 'van-list-view', 'van-grid-view'].includes(this.tag) &&
|
|
1567
1569
|
this.bindAttrs?.findIndex((attr) => attr.name === 'sorting') === -1
|
|
@@ -2732,7 +2734,9 @@ export class ViewElement extends BaseNode {
|
|
|
2732
2734
|
/**
|
|
2733
2735
|
* 计算约束样式
|
|
2734
2736
|
* @param positionData 位置数据
|
|
2735
|
-
* @param
|
|
2737
|
+
* @param ops 配置项
|
|
2738
|
+
* @param ops.beforeSetStyleCb 设置样式前的回调
|
|
2739
|
+
* @param ops.setStaticSize 是否设置静态尺寸,开启此项会将节点的宽高设置为像素值,通常在修改约束规则时候开启
|
|
2736
2740
|
*/
|
|
2737
2741
|
computeConstraintStyle(
|
|
2738
2742
|
positionData: {
|
|
@@ -2746,8 +2750,8 @@ export class ViewElement extends BaseNode {
|
|
|
2746
2750
|
};
|
|
2747
2751
|
},
|
|
2748
2752
|
ops: {
|
|
2749
|
-
doNotRecordLastWidthHeight?: boolean;
|
|
2750
2753
|
beforeSetStyleCb?: (newStyleObj: Record<string, any>) => void;
|
|
2754
|
+
setStaticSize?: boolean;
|
|
2751
2755
|
} = {},
|
|
2752
2756
|
) {
|
|
2753
2757
|
if (!positionData) {
|
|
@@ -2770,12 +2774,8 @@ export class ViewElement extends BaseNode {
|
|
|
2770
2774
|
let top = '';
|
|
2771
2775
|
let bottom = '';
|
|
2772
2776
|
let transform = '';
|
|
2773
|
-
|
|
2774
|
-
let
|
|
2775
|
-
let height = Number(styleObj['--constraint-height-auto']) ? styleObj['--last-height'] : rawHeight;
|
|
2776
|
-
// 用于记录宽高是否被约束规则改成 auto 了
|
|
2777
|
-
let constraintWidthAuto = 0;
|
|
2778
|
-
let constraintHeightAuto = 0;
|
|
2777
|
+
let width = ops.setStaticSize ? `${staticWidth}px` : rawWidth;
|
|
2778
|
+
let height = ops.setStaticSize ? `${staticHeight}px` : rawHeight;
|
|
2779
2779
|
|
|
2780
2780
|
const parentWidth = staticLeft + staticWidth + staticRight;
|
|
2781
2781
|
const parentHeight = staticTop + staticHeight + staticBottom;
|
|
@@ -2795,12 +2795,10 @@ export class ViewElement extends BaseNode {
|
|
|
2795
2795
|
left = (staticLeft * 100) / parentWidth + '%';
|
|
2796
2796
|
right = '';
|
|
2797
2797
|
width = (staticWidth * 100) / parentWidth + '%';
|
|
2798
|
-
constraintWidthAuto = 1;
|
|
2799
2798
|
} else if (constraintX === 'left-right') {
|
|
2800
2799
|
left = staticLeft + 'px';
|
|
2801
2800
|
right = staticRight + 'px';
|
|
2802
2801
|
width = 'auto';
|
|
2803
|
-
constraintWidthAuto = 1;
|
|
2804
2802
|
}
|
|
2805
2803
|
|
|
2806
2804
|
if (constraintY === 'top') {
|
|
@@ -2818,12 +2816,10 @@ export class ViewElement extends BaseNode {
|
|
|
2818
2816
|
top = (staticTop * 100) / parentHeight + '%';
|
|
2819
2817
|
bottom = '';
|
|
2820
2818
|
height = (staticHeight * 100) / parentHeight + '%';
|
|
2821
|
-
constraintHeightAuto = 1;
|
|
2822
2819
|
} else if (constraintY === 'top-bottom') {
|
|
2823
2820
|
top = staticTop + 'px';
|
|
2824
2821
|
bottom = staticBottom + 'px';
|
|
2825
2822
|
height = 'auto';
|
|
2826
|
-
constraintHeightAuto = 1;
|
|
2827
2823
|
}
|
|
2828
2824
|
const newStyleObj: Record<string, any> = {
|
|
2829
2825
|
...styleObj,
|
|
@@ -2834,17 +2830,7 @@ export class ViewElement extends BaseNode {
|
|
|
2834
2830
|
transform,
|
|
2835
2831
|
width,
|
|
2836
2832
|
height,
|
|
2837
|
-
'--constraint-width-auto': constraintWidthAuto,
|
|
2838
|
-
'--constraint-height-auto': constraintHeightAuto,
|
|
2839
2833
|
};
|
|
2840
|
-
if (!ops.doNotRecordLastWidthHeight) {
|
|
2841
|
-
if (rawWidth !== 'auto') {
|
|
2842
|
-
newStyleObj['--last-width'] = rawWidth;
|
|
2843
|
-
}
|
|
2844
|
-
if (rawHeight !== 'auto') {
|
|
2845
|
-
newStyleObj['--last-height'] = rawHeight;
|
|
2846
|
-
}
|
|
2847
|
-
}
|
|
2848
2834
|
ops.beforeSetStyleCb?.(newStyleObj);
|
|
2849
2835
|
const newStaticStyle = this.stringifyStyleAttr(newStyleObj);
|
|
2850
2836
|
this.setStaticStyle(newStaticStyle);
|