@lcap/nasl 3.4.0-beta.5 → 3.4.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/b920244d-8d01-4e76-be5a-95132217c5a1.json +1 -0
- package/.nyc_output/processinfo/b920244d-8d01-4e76-be5a-95132217c5a1.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 +631 -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 +4081 -0
- package/coverage/src/common/Command.ts.html +310 -0
- package/coverage/src/common/EventEmitter.ts.html +373 -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 +331 -0
- package/coverage/src/concepts/Anchor__.ts.html +667 -0
- package/coverage/src/concepts/AnonymousFunction__.ts.html +2092 -0
- package/coverage/src/concepts/App__.ts.html +13651 -0
- package/coverage/src/concepts/Argument__.ts.html +907 -0
- package/coverage/src/concepts/Assignee__.ts.html +2317 -0
- package/coverage/src/concepts/AssignmentLine__.ts.html +430 -0
- package/coverage/src/concepts/Assignment__.ts.html +1174 -0
- package/coverage/src/concepts/Attribute__.ts.html +919 -0
- package/coverage/src/concepts/AuthInterface__.ts.html +370 -0
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +2011 -0
- package/coverage/src/concepts/AuthLogic__.ts.html +793 -0
- package/coverage/src/concepts/BackendVariable__.ts.html +1690 -0
- package/coverage/src/concepts/Backend__.ts.html +1192 -0
- package/coverage/src/concepts/BatchAssignment__.ts.html +3376 -0
- package/coverage/src/concepts/BinaryExpression__.ts.html +1468 -0
- package/coverage/src/concepts/BindAttribute__.ts.html +3931 -0
- package/coverage/src/concepts/BindDirective__.ts.html +2002 -0
- package/coverage/src/concepts/BindEvent__.ts.html +3487 -0
- package/coverage/src/concepts/BindStyle__.ts.html +1645 -0
- package/coverage/src/concepts/BooleanLiteral__.ts.html +421 -0
- package/coverage/src/concepts/CallAuthInterface__.ts.html +1642 -0
- package/coverage/src/concepts/CallConnector__.ts.html +925 -0
- package/coverage/src/concepts/CallFunction__.ts.html +2164 -0
- package/coverage/src/concepts/CallInterface__.ts.html +2776 -0
- package/coverage/src/concepts/CallLogic__.ts.html +4693 -0
- package/coverage/src/concepts/CallQueryComponent__.ts.html +5419 -0
- package/coverage/src/concepts/Comment__.ts.html +397 -0
- package/coverage/src/concepts/CompletionProperty__.ts.html +946 -0
- package/coverage/src/concepts/ConfigGroup__.ts.html +1132 -0
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +427 -0
- package/coverage/src/concepts/ConfigProperty__.ts.html +1375 -0
- package/coverage/src/concepts/Configuration__.ts.html +1054 -0
- package/coverage/src/concepts/Connection__.ts.html +1387 -0
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +598 -0
- package/coverage/src/concepts/Connector__.ts.html +4390 -0
- package/coverage/src/concepts/Constant__.ts.html +1123 -0
- package/coverage/src/concepts/DataSource__.ts.html +1798 -0
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +334 -0
- package/coverage/src/concepts/DefaultValue__.ts.html +946 -0
- package/coverage/src/concepts/Destination__.ts.html +2761 -0
- package/coverage/src/concepts/End__.ts.html +436 -0
- package/coverage/src/concepts/EntityIndex__.ts.html +799 -0
- package/coverage/src/concepts/EntityProperty__.ts.html +2866 -0
- package/coverage/src/concepts/Entity__.ts.html +3070 -0
- package/coverage/src/concepts/EnumItem__.ts.html +553 -0
- package/coverage/src/concepts/Enum__.ts.html +1258 -0
- package/coverage/src/concepts/Event__.ts.html +1111 -0
- package/coverage/src/concepts/ExternalDestination__.ts.html +1060 -0
- package/coverage/src/concepts/ForEachStatement__.ts.html +2023 -0
- package/coverage/src/concepts/FrontendLibrary__.ts.html +1762 -0
- package/coverage/src/concepts/FrontendVariable__.ts.html +292 -0
- package/coverage/src/concepts/Frontend__.ts.html +4078 -0
- package/coverage/src/concepts/Function__.ts.html +3718 -0
- package/coverage/src/concepts/Identifier__.ts.html +1060 -0
- package/coverage/src/concepts/IfStatement__.ts.html +1636 -0
- package/coverage/src/concepts/Integration__.ts.html +1273 -0
- package/coverage/src/concepts/InterfaceParam__.ts.html +1258 -0
- package/coverage/src/concepts/Interface__.ts.html +3463 -0
- package/coverage/src/concepts/JSBlock__.ts.html +424 -0
- package/coverage/src/concepts/JavaLogic__.ts.html +463 -0
- package/coverage/src/concepts/LogicItem__.ts.html +1174 -0
- package/coverage/src/concepts/Logic__.ts.html +7732 -0
- package/coverage/src/concepts/MatchCase__.ts.html +2974 -0
- package/coverage/src/concepts/Match__.ts.html +2494 -0
- package/coverage/src/concepts/MemberExpression__.ts.html +1744 -0
- package/coverage/src/concepts/MicroApp__.ts.html +439 -0
- package/coverage/src/concepts/Module__.ts.html +9385 -0
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +1072 -0
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +1045 -0
- package/coverage/src/concepts/Namespace__.ts.html +8221 -0
- package/coverage/src/concepts/NewComposite__.ts.html +4765 -0
- package/coverage/src/concepts/NewList__.ts.html +1702 -0
- package/coverage/src/concepts/NewMap__.ts.html +2470 -0
- package/coverage/src/concepts/New__.ts.html +289 -0
- package/coverage/src/concepts/NullLiteral__.ts.html +352 -0
- package/coverage/src/concepts/NumericLiteral__.ts.html +697 -0
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +1237 -0
- package/coverage/src/concepts/OverriddenLogic__.ts.html +6970 -0
- package/coverage/src/concepts/Param__.ts.html +1798 -0
- package/coverage/src/concepts/Point__.ts.html +334 -0
- package/coverage/src/concepts/ProcessComponent__.ts.html +1717 -0
- package/coverage/src/concepts/ProcessElement__.ts.html +6187 -0
- package/coverage/src/concepts/ProcessOutcome__.ts.html +355 -0
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +355 -0
- package/coverage/src/concepts/Process__.ts.html +5071 -0
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +589 -0
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +586 -0
- package/coverage/src/concepts/QueryFromExpression__.ts.html +937 -0
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +580 -0
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +1606 -0
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +664 -0
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +706 -0
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +1741 -0
- package/coverage/src/concepts/Rect__.ts.html +376 -0
- package/coverage/src/concepts/Return__.ts.html +1471 -0
- package/coverage/src/concepts/Role__.ts.html +604 -0
- package/coverage/src/concepts/SelectMembers__.ts.html +1279 -0
- package/coverage/src/concepts/Slot__.ts.html +649 -0
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +1003 -0
- package/coverage/src/concepts/Start__.ts.html +307 -0
- package/coverage/src/concepts/StringInterpolation__.ts.html +1156 -0
- package/coverage/src/concepts/StringLiteral__.ts.html +508 -0
- package/coverage/src/concepts/StructureProperty__.ts.html +1300 -0
- package/coverage/src/concepts/Structure__.ts.html +2182 -0
- package/coverage/src/concepts/SwitchCase__.ts.html +1204 -0
- package/coverage/src/concepts/SwitchStatement__.ts.html +904 -0
- package/coverage/src/concepts/Theme__.ts.html +361 -0
- package/coverage/src/concepts/Transactional__.ts.html +631 -0
- package/coverage/src/concepts/TriggerEvent__.ts.html +1039 -0
- package/coverage/src/concepts/TriggerLauncher__.ts.html +778 -0
- package/coverage/src/concepts/TypeAnnotation__.ts.html +3832 -0
- package/coverage/src/concepts/TypeParam__.ts.html +322 -0
- package/coverage/src/concepts/UnaryExpression__.ts.html +730 -0
- package/coverage/src/concepts/Unparsed__.ts.html +397 -0
- package/coverage/src/concepts/UseComponent__.ts.html +334 -0
- package/coverage/src/concepts/ValidationRule__.ts.html +1876 -0
- package/coverage/src/concepts/Variable__.ts.html +1705 -0
- package/coverage/src/concepts/ViewBlock__.ts.html +355 -0
- package/coverage/src/concepts/ViewComponent__.ts.html +4327 -0
- package/coverage/src/concepts/ViewElement__.ts.html +8992 -0
- package/coverage/src/concepts/View__.ts.html +9019 -0
- package/coverage/src/concepts/WhileStatement__.ts.html +1105 -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 +6955 -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 +1976 -0
- package/coverage/src/concepts/index.ts.html +103 -0
- package/coverage/src/concepts/index__.ts.html +454 -0
- package/coverage/src/config.ts.html +325 -0
- package/coverage/src/decorators/index.html +131 -0
- package/coverage/src/decorators/index.ts.html +583 -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 +1084 -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 +124 -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 +2707 -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 +919 -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 +1606 -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 +14356 -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 +397 -0
- package/coverage/src/service/creator/errHandles.js.html +304 -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 +3721 -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 +1021 -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 +973 -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 +694 -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 +2 -19
- package/out/bak/translator.js.map +1 -1
- package/out/common/BaseNode.d.ts +11 -0
- package/out/common/BaseNode.js +57 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/index.d.ts +1 -0
- package/out/common/index.js +1 -0
- package/out/common/index.js.map +1 -1
- package/out/common/utils.d.ts +2 -0
- package/out/common/utils.js +18 -0
- package/out/common/utils.js.map +1 -0
- package/out/concepts/Abort__.d.ts +2 -2
- package/out/concepts/Abort__.js +6 -2
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.d.ts +2 -2
- package/out/concepts/Anchor__.js +5 -4
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +3 -3
- package/out/concepts/AnonymousFunction__.js +19 -15
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/Argument__.d.ts +2 -2
- package/out/concepts/Argument__.js +12 -13
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.d.ts +2 -2
- package/out/concepts/Assignee__.js +11 -9
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.d.ts +2 -2
- package/out/concepts/AssignmentLine__.js +3 -2
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.d.ts +2 -2
- package/out/concepts/Assignment__.js +13 -29
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/AuthInterface__.js +1 -1
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +2 -2
- package/out/concepts/AuthLogicForCallInterface__.js +56 -75
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +5 -8
- package/out/concepts/BackendVariable__.js +47 -29
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +4 -7
- package/out/concepts/Backend__.js +7 -6
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +2 -2
- package/out/concepts/BatchAssignment__.js +19 -20
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.d.ts +2 -2
- package/out/concepts/BinaryExpression__.js +37 -38
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +4 -4
- package/out/concepts/BindAttribute__.js +39 -32
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.d.ts +2 -2
- package/out/concepts/BindDirective__.js +10 -8
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +4 -7
- package/out/concepts/BindEvent__.js +20 -18
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.d.ts +2 -2
- package/out/concepts/BindStyle__.js +9 -7
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/Block__.d.ts +6 -2
- package/out/concepts/Block__.js +36 -5
- package/out/concepts/Block__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.d.ts +2 -2
- package/out/concepts/BooleanLiteral__.js +2 -2
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +3 -2
- package/out/concepts/CallAuthInterface__.js +46 -30
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +2 -2
- package/out/concepts/CallConnector__.js +25 -23
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +2 -2
- package/out/concepts/CallFunction__.js +19 -16
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.d.ts +3 -2
- package/out/concepts/CallInterface__.js +16 -6
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.d.ts +2 -3
- package/out/concepts/CallLogic__.js +26 -20
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +4 -4
- package/out/concepts/CallQueryComponent__.js +38 -36
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.d.ts +2 -2
- package/out/concepts/Comment__.js +3 -2
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +4 -7
- package/out/concepts/ConfigProperty__.js +12 -10
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Connection__.d.ts +4 -7
- package/out/concepts/Connection__.js +6 -5
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/Constant__.d.ts +3 -3
- package/out/concepts/Constant__.js +38 -13
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +4 -7
- package/out/concepts/DataSource__.js +7 -6
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DefaultValue__.d.ts +6 -2
- package/out/concepts/DefaultValue__.js +11 -3
- package/out/concepts/DefaultValue__.js.map +1 -1
- package/out/concepts/Destination__.d.ts +3 -3
- package/out/concepts/Destination__.js +29 -26
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.d.ts +2 -2
- package/out/concepts/End__.js +17 -13
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +2 -2
- package/out/concepts/EntityIndex__.js +4 -3
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +2 -2
- package/out/concepts/EntityProperty__.js +9 -8
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +4 -7
- package/out/concepts/Entity__.js +22 -22
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.d.ts +2 -2
- package/out/concepts/EnumItem__.js +4 -3
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.d.ts +4 -7
- package/out/concepts/Enum__.js +10 -8
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/ExternalDestination__.d.ts +2 -2
- package/out/concepts/ExternalDestination__.js +7 -5
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.d.ts +2 -2
- package/out/concepts/ForEachStatement__.js +14 -12
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Frontend__.d.ts +4 -7
- package/out/concepts/Frontend__.js +7 -6
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.d.ts +3 -3
- package/out/concepts/Function__.js +22 -18
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +2 -2
- package/out/concepts/Identifier__.js +19 -23
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.d.ts +2 -2
- package/out/concepts/IfStatement__.js +12 -10
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/ImportedInterface__.d.ts +20 -0
- package/out/concepts/ImportedInterface__.js +57 -0
- package/out/concepts/ImportedInterface__.js.map +1 -0
- package/out/concepts/InterfaceParam__.d.ts +2 -7
- package/out/concepts/InterfaceParam__.js +33 -14
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +7 -15
- package/out/concepts/Interface__.js +33 -43
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.d.ts +2 -2
- package/out/concepts/JSBlock__.js +3 -58
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +2 -2
- package/out/concepts/JavaLogic__.js +6 -2
- package/out/concepts/JavaLogic__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +2 -2
- package/out/concepts/LogicItem__.js +7 -13
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +8 -11
- package/out/concepts/Logic__.js +124 -157
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.d.ts +2 -2
- package/out/concepts/MatchCase__.js +23 -22
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.d.ts +2 -2
- package/out/concepts/Match__.js +24 -22
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.d.ts +2 -2
- package/out/concepts/MemberExpression__.js +28 -24
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MetadataType__.d.ts +4 -7
- package/out/concepts/MetadataType__.js +11 -9
- package/out/concepts/MetadataType__.js.map +1 -1
- package/out/concepts/Module__.d.ts +8 -179
- package/out/concepts/Module__.js +124 -265
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +5 -5
- package/out/concepts/NewComposite__.js +75 -76
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.d.ts +5 -5
- package/out/concepts/NewList__.js +30 -26
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.d.ts +4 -4
- package/out/concepts/NewMap__.js +39 -35
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.d.ts +2 -2
- package/out/concepts/New__.js +3 -2
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.d.ts +2 -2
- package/out/concepts/NullLiteral__.js +2 -2
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.d.ts +2 -2
- package/out/concepts/NumericLiteral__.js +6 -5
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +2 -2
- package/out/concepts/OqlQueryComponent__.js +16 -14
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +8 -11
- package/out/concepts/OverriddenLogic__.js +99 -112
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/Param__.d.ts +3 -3
- package/out/concepts/Param__.js +24 -30
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +2 -2
- package/out/concepts/ProcessElement__.js +54 -68
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.d.ts +2 -1
- package/out/concepts/ProcessOutcome__.js +5 -4
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +2 -1
- package/out/concepts/ProcessOutcomes__.js +6 -5
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.d.ts +4 -7
- package/out/concepts/Process__.js +35 -52
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.d.ts +2 -2
- package/out/concepts/QueryAggregateExpression__.js +2 -2
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +2 -2
- package/out/concepts/QueryFieldExpression__.js +5 -4
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.d.ts +2 -2
- package/out/concepts/QueryFromExpression__.js +8 -6
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.d.ts +2 -1
- package/out/concepts/QueryGroupByExpression__.js +6 -5
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.d.ts +2 -2
- package/out/concepts/QueryJoinExpression__.js +12 -10
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.d.ts +2 -2
- package/out/concepts/QueryLimitExpression__.js +6 -5
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.d.ts +2 -2
- package/out/concepts/QueryOrderByExpression__.js +6 -5
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/Return__.d.ts +3 -3
- package/out/concepts/Return__.js +41 -24
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.d.ts +4 -7
- package/out/concepts/Role__.js +7 -6
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.d.ts +2 -2
- package/out/concepts/SelectMembers__.js +3 -2
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +2 -2
- package/out/concepts/SqlQueryComponent__.js +12 -10
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.d.ts +2 -2
- package/out/concepts/Start__.js +2 -2
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.d.ts +2 -2
- package/out/concepts/StringInterpolation__.js +7 -5
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.d.ts +2 -2
- package/out/concepts/StringLiteral__.js +12 -6
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +2 -2
- package/out/concepts/StructureProperty__.js +6 -5
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.d.ts +4 -7
- package/out/concepts/Structure__.js +15 -15
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.d.ts +2 -2
- package/out/concepts/SwitchCase__.js +12 -10
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.d.ts +2 -2
- package/out/concepts/SwitchStatement__.js +8 -6
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +4 -7
- package/out/concepts/TriggerLauncher__.js +7 -6
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +2 -2
- package/out/concepts/TypeAnnotation__.js +51 -25
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.d.ts +2 -2
- package/out/concepts/TypeParam__.js +4 -3
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.d.ts +2 -2
- package/out/concepts/UnaryExpression__.js +12 -7
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.d.ts +2 -2
- package/out/concepts/Unparsed__.js +2 -2
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/ValidationRule__.d.ts +2 -2
- package/out/concepts/ValidationRule__.js +11 -9
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +5 -8
- package/out/concepts/Variable__.js +49 -32
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +6 -6
- package/out/concepts/ViewElement__.js +110 -137
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +6 -9
- package/out/concepts/View__.js +76 -84
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.d.ts +2 -2
- package/out/concepts/WhileStatement__.js +9 -7
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/index__.d.ts +1 -1
- package/out/concepts/index__.js +1 -1
- package/out/concepts/index__.js.map +1 -1
- package/out/concepts/types__.d.ts +1 -3
- package/out/decorators/index.js +10 -9
- package/out/decorators/index.js.map +1 -1
- package/out/generator/genMetaData.js +0 -7
- package/out/generator/genMetaData.js.map +1 -1
- package/out/manager/diagnostic.d.ts +1 -1
- package/out/manager/diagnostic.js +2 -3
- package/out/manager/diagnostic.js.map +1 -1
- package/out/server/extendBaseNode.js +7 -24
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/getConnector.js +8 -3
- package/out/server/getConnector.js.map +1 -1
- package/out/server/getLogics.js +13 -3
- package/out/server/getLogics.js.map +1 -1
- package/out/server/naslServer.d.ts +44 -46
- package/out/server/naslServer.js +333 -461
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +1 -1
- package/out/server/translator.js.map +1 -1
- package/out/templator/genCreateBlock.js +5 -9
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +12 -18
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +8 -10
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +2 -3
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +9 -12
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.js.map +1 -1
- package/out/translator/types.d.ts +16 -3
- package/out/translator/utils.d.ts +19 -1
- package/out/translator/utils.js +90 -2
- package/out/translator/utils.js.map +1 -1
- package/out/utils/time-slicing/constant.d.ts +35 -0
- package/out/utils/time-slicing/constant.js +40 -0
- package/out/utils/time-slicing/constant.js.map +1 -0
- package/out/utils/time-slicing/controller.d.ts +53 -0
- package/out/utils/time-slicing/controller.js +280 -0
- package/out/utils/time-slicing/controller.js.map +1 -0
- package/out/utils/time-slicing/index.d.ts +5 -0
- package/out/utils/time-slicing/index.js +26 -0
- package/out/utils/time-slicing/index.js.map +1 -0
- package/out/utils/time-slicing/page-state.d.ts +2 -0
- package/out/utils/time-slicing/page-state.js +14 -0
- package/out/utils/time-slicing/page-state.js.map +1 -0
- package/out/utils/time-slicing/performance.d.ts +11 -0
- package/out/utils/time-slicing/performance.js +51 -0
- package/out/utils/time-slicing/performance.js.map +1 -0
- package/out/utils/time-slicing/runner.d.ts +12 -0
- package/out/utils/time-slicing/runner.js +53 -0
- package/out/utils/time-slicing/runner.js.map +1 -0
- package/out/utils/time-slicing/tool.d.ts +24 -0
- package/out/utils/time-slicing/tool.js +47 -0
- package/out/utils/time-slicing/tool.js.map +1 -0
- package/out/utils/time-slicing/utils.d.ts +62 -0
- package/out/utils/time-slicing/utils.js +47 -0
- package/out/utils/time-slicing/utils.js.map +1 -0
- package/out/utils/time-slicing/wrapper.d.ts +18 -0
- package/out/utils/time-slicing/wrapper.js +55 -0
- package/out/utils/time-slicing/wrapper.js.map +1 -0
- package/out/utils/types.d.ts +7 -0
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.core.ts +0 -2
- package/sandbox/stdlib/nasl.util.ts +1 -1
- package/src/bak/translator.js +2 -17
- package/src/common/BaseNode.ts +73 -7
- package/src/common/index.ts +1 -0
- package/src/common/utils.ts +17 -0
- package/src/concepts/Abort__.ts +12 -3
- package/src/concepts/Anchor__.ts +15 -5
- package/src/concepts/AnonymousFunction__.ts +29 -23
- package/src/concepts/Argument__.ts +25 -14
- package/src/concepts/Assignee__.ts +21 -10
- package/src/concepts/AssignmentLine__.ts +13 -3
- package/src/concepts/Assignment__.ts +33 -42
- package/src/concepts/AuthInterface__.ts +3 -3
- package/src/concepts/AuthLogicForCallInterface__.ts +63 -84
- package/src/concepts/BackendVariable__.ts +35 -30
- package/src/concepts/Backend__.ts +24 -7
- package/src/concepts/BatchAssignment__.ts +30 -21
- package/src/concepts/BinaryExpression__.ts +47 -38
- package/src/concepts/BindAttribute__.ts +43 -39
- package/src/concepts/BindDirective__.ts +19 -9
- package/src/concepts/BindEvent__.ts +31 -26
- package/src/concepts/BindStyle__.ts +18 -8
- package/src/concepts/Block__.ts +22 -6
- package/src/concepts/BooleanLiteral__.ts +11 -3
- package/src/concepts/CallAuthInterface__.ts +58 -33
- package/src/concepts/CallConnector__.ts +34 -26
- package/src/concepts/CallFunction__.ts +22 -17
- package/src/concepts/CallInterface__.ts +30 -12
- package/src/concepts/CallLogic__.ts +46 -47
- package/src/concepts/CallQueryComponent__.ts +48 -46
- package/src/concepts/Comment__.ts +13 -3
- package/src/concepts/ConfigProperty__.ts +22 -12
- package/src/concepts/Connection__.ts +22 -6
- package/src/concepts/Connector__.ts +1 -1
- package/src/concepts/Constant__.ts +24 -14
- package/src/concepts/DataSource__.ts +16 -7
- package/src/concepts/DefaultValue__.ts +13 -4
- package/src/concepts/Destination__.ts +39 -33
- package/src/concepts/End__.ts +24 -15
- package/src/concepts/EntityIndex__.ts +13 -4
- package/src/concepts/EntityProperty__.ts +20 -10
- package/src/concepts/Entity__.ts +34 -27
- package/src/concepts/EnumItem__.ts +13 -4
- package/src/concepts/Enum__.ts +21 -10
- package/src/concepts/ExternalDestination__.ts +16 -7
- package/src/concepts/ForEachStatement__.ts +24 -14
- package/src/concepts/Frontend__.ts +18 -7
- package/src/concepts/Function__.ts +30 -21
- package/src/concepts/Identifier__.ts +32 -34
- package/src/concepts/IfStatement__.ts +22 -14
- package/src/concepts/ImportedInterface__.ts +61 -0
- package/src/concepts/InterfaceParam__.ts +19 -16
- package/src/concepts/Interface__.ts +45 -51
- package/src/concepts/JSBlock__.ts +12 -61
- package/src/concepts/JavaLogic__.ts +13 -3
- package/src/concepts/LogicItem__.ts +13 -14
- package/src/concepts/Logic__.ts +147 -172
- package/src/concepts/MatchCase__.ts +33 -27
- package/src/concepts/Match__.ts +34 -26
- package/src/concepts/MemberExpression__.ts +37 -25
- package/src/concepts/MetadataType__.ts +22 -10
- package/src/concepts/Module__.ts +177 -540
- package/src/concepts/NewComposite__.ts +86 -80
- package/src/concepts/NewList__.ts +40 -32
- package/src/concepts/NewMap__.ts +49 -42
- package/src/concepts/New__.ts +13 -3
- package/src/concepts/NullLiteral__.ts +11 -3
- package/src/concepts/NumericLiteral__.ts +15 -6
- package/src/concepts/OqlQueryComponent__.ts +26 -18
- package/src/concepts/OverriddenLogic__.ts +117 -125
- package/src/concepts/Param__.ts +42 -38
- package/src/concepts/ProcessElement__.ts +67 -79
- package/src/concepts/ProcessOutcome__.ts +14 -6
- package/src/concepts/ProcessOutcomes__.ts +15 -7
- package/src/concepts/Process__.ts +50 -61
- package/src/concepts/QueryAggregateExpression__.ts +11 -3
- package/src/concepts/QueryFieldExpression__.ts +14 -5
- package/src/concepts/QueryFromExpression__.ts +18 -7
- package/src/concepts/QueryGroupByExpression__.ts +14 -6
- package/src/concepts/QueryJoinExpression__.ts +22 -11
- package/src/concepts/QueryLimitExpression__.ts +16 -6
- package/src/concepts/QueryOrderByExpression__.ts +17 -6
- package/src/concepts/Return__.ts +27 -25
- package/src/concepts/Role__.ts +17 -8
- package/src/concepts/SelectMembers__.ts +13 -3
- package/src/concepts/SqlQueryComponent__.ts +22 -11
- package/src/concepts/Start__.ts +11 -3
- package/src/concepts/StringInterpolation__.ts +10 -5
- package/src/concepts/StringLiteral__.ts +20 -7
- package/src/concepts/StructureProperty__.ts +16 -6
- package/src/concepts/Structure__.ts +26 -18
- package/src/concepts/SwitchCase__.ts +22 -14
- package/src/concepts/SwitchStatement__.ts +17 -7
- package/src/concepts/TriggerLauncher__.ts +17 -7
- package/src/concepts/TypeAnnotation__.ts +36 -26
- package/src/concepts/TypeParam__.ts +13 -4
- package/src/concepts/UnaryExpression__.ts +22 -9
- package/src/concepts/Unparsed__.ts +11 -3
- package/src/concepts/ValidationRule__.ts +21 -17
- package/src/concepts/Variable__.ts +37 -33
- package/src/concepts/ViewElement__.ts +128 -156
- package/src/concepts/View__.ts +101 -101
- package/src/concepts/WhileStatement__.ts +19 -10
- package/src/concepts/index__.ts +1 -1
- package/src/concepts/types__.ts +1 -5
- package/src/decorators/index.ts +10 -9
- package/src/generator/genMetaData.ts +2 -12
- package/src/manager/diagnostic.ts +3 -4
- package/src/server/extendBaseNode.ts +8 -24
- package/src/server/getConnector.ts +8 -3
- package/src/server/getLogics.ts +15 -3
- package/src/server/naslServer.ts +717 -749
- package/src/server/translator.ts +1 -1
- package/src/templator/genCreateBlock.ts +5 -9
- package/src/templator/genCurdEditMultipleKeyBlock.ts +13 -19
- package/src/templator/genCurdMultipleKeyBlock.ts +11 -14
- package/src/templator/genEditTableBlock.ts +2 -4
- package/src/templator/genUpdateBlock.ts +12 -15
- package/src/templator/utils.ts +7 -8
- package/src/translator/types.ts +20 -5
- package/src/translator/utils.ts +100 -5
- package/src/utils/time-slicing/constant.ts +37 -0
- package/src/utils/time-slicing/controller.ts +342 -0
- package/src/utils/time-slicing/index.ts +6 -0
- package/src/utils/time-slicing/page-state.ts +12 -0
- package/src/utils/time-slicing/performance.ts +56 -0
- package/src/utils/time-slicing/runner.ts +54 -0
- package/src/utils/time-slicing/tool.ts +45 -0
- package/src/utils/time-slicing/utils.ts +90 -0
- package/src/utils/time-slicing/wrapper.ts +58 -0
- package/src/utils/types.ts +9 -0
- package/test/concepts/anonymous-function/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/assignment/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/batch-assignment/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/binary-expression/__snapshots__/toEmbeddedTS.spec.ts.snap +3 -3
- package/test/concepts/binary-expression/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/boolean-literal/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/call-function/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/call-interface/__snapshots__/toJS.spec.ts.snap +3 -3
- package/test/concepts/call-interface/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +5 -5
- package/test/concepts/call-logic/getQuickInfoOffset.spec.ts +2 -1
- package/test/concepts/call-logic/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/data-source/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/data-source/toEmbeddedTSFile.spec.ts +2 -1
- package/test/concepts/entity/__snapshots__/toEmbeddedTS.spec.ts.snap +19 -19
- package/test/concepts/entity/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/identifier/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/match/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/match/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/member-expression/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/null-literal/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/numeric-literal/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/numeric-literal/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/string-literal/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +3 -3
- package/test/concepts/validation-rule/toEmbeddedTS.spec.ts +2 -1
- package/test/concepts/validation-rule/validation-rule.spec.ts +2 -1
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +3 -3
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +0 -4
- package/test/concepts/view-element/toEmbeddedTS.spec.ts +2 -1
- package/test/time-slicing/runner.spec.ts +28 -0
- package/test/time-slicing/time-slicing-nodejs.spec.ts +27 -0
- package/test/time-slicing/utils.ts +7 -0
- package/test/time-slicing/wrapper.spec.ts +92 -0
- package/ts-worker/lib/tsserver.js +10 -1
- package/ts-worker/package.json +1 -0
- package/ts-worker/src/index.js +13 -12
- package/ts-worker/webpack.config.js +1 -1
- package/out/concepts/InterfaceFromExample__.d.ts +0 -88
- package/out/concepts/InterfaceFromExample__.js +0 -183
- package/out/concepts/InterfaceFromExample__.js.map +0 -1
- package/out/utils/time-slicing.d.ts +0 -41
- package/out/utils/time-slicing.js +0 -82
- package/out/utils/time-slicing.js.map +0 -1
- package/src/concepts/InterfaceFromExample__.ts +0 -205
- package/src/utils/time-slicing.ts +0 -111
package/src/concepts/Logic__.ts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
import {
|
|
2
|
+
wrapForEachToGenerator as wrapForEach,
|
|
3
|
+
wrapIteratorToGenerator as wrapIterator,
|
|
4
|
+
runGeneratorSync as runSync,
|
|
5
|
+
returnOrigin,
|
|
6
|
+
} from '../utils/time-slicing';
|
|
7
|
+
import { waitOqlQueryComponentChildrenFinish } from '../common';
|
|
8
|
+
import type { EmbeddedTSFileGenerator } from '../utils';
|
|
1
9
|
import { FrontendLibrary } from './FrontendLibrary__';
|
|
2
10
|
import {
|
|
3
11
|
TranslatorState,
|
|
@@ -6,6 +14,9 @@ import {
|
|
|
6
14
|
indent,
|
|
7
15
|
createCompilerState,
|
|
8
16
|
embeddedTSEmitter,
|
|
17
|
+
withSourceMapGenerator,
|
|
18
|
+
withGenerator,
|
|
19
|
+
TranslatorGenerator,
|
|
9
20
|
} from '../translator';
|
|
10
21
|
import Namespace from './Namespace__';
|
|
11
22
|
import CallQueryComponent from './CallQueryComponent__';
|
|
@@ -22,7 +33,6 @@ import CallInterface from './CallInterface__';
|
|
|
22
33
|
import CallLogic from './CallLogic__';
|
|
23
34
|
import { CUSTOM_CONNECTOR_EDITABLE_SUFFIX } from './basics/constants';
|
|
24
35
|
import type Interface from './Interface__';
|
|
25
|
-
import InterfaceFromExample from './InterfaceFromExample__';
|
|
26
36
|
|
|
27
37
|
//================================================================================
|
|
28
38
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -1711,65 +1721,70 @@ export class Logic extends BaseNode {
|
|
|
1711
1721
|
};
|
|
1712
1722
|
}
|
|
1713
1723
|
|
|
1714
|
-
@
|
|
1715
|
-
toEmbeddedTSInProcess(
|
|
1724
|
+
@withSourceMapGenerator
|
|
1725
|
+
*toEmbeddedTSInProcess(
|
|
1726
|
+
state = createCompilerState(),
|
|
1727
|
+
prependCode?: string,
|
|
1728
|
+
noName?: boolean,
|
|
1729
|
+
prefix?: boolean,
|
|
1730
|
+
): TranslatorGenerator {
|
|
1731
|
+
const self = this;
|
|
1716
1732
|
let code = '';
|
|
1717
|
-
if (!prefix) code += `${noName ? '' : `${
|
|
1718
|
-
else code += `function ${
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1733
|
+
if (!prefix) code += `${noName ? '' : `${self.name}:`} function(`;
|
|
1734
|
+
else code += `function ${self.name}(`; // 加空格会导致无法查询到引用
|
|
1735
|
+
yield* wrapForEach(
|
|
1736
|
+
self.params,
|
|
1737
|
+
function* warpForEachGenerator(param, index) {
|
|
1738
|
+
code += yield* param.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1739
|
+
if (index !== self.params.length - 1) code += ', ';
|
|
1740
|
+
},
|
|
1741
|
+
);
|
|
1723
1742
|
code += `) {\n`;
|
|
1724
1743
|
code += prependCode || '';
|
|
1725
1744
|
code += '\n';
|
|
1726
|
-
|
|
1745
|
+
yield* wrapForEach(self.variables, function* warpForEachGenerator(variable) {
|
|
1727
1746
|
code += `${indent((state?.tabSize || 0) + 1)}let `;
|
|
1728
|
-
code += variable.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1747
|
+
code += yield* variable.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1729
1748
|
code += ';\n';
|
|
1730
1749
|
});
|
|
1731
|
-
|
|
1732
|
-
this.returns.forEach((ret) => {
|
|
1750
|
+
yield* wrapForEach(self.returns, function* warpForEachGenerator(ret) {
|
|
1733
1751
|
code += `${indent((state?.tabSize || 0) + 1)}let `;
|
|
1734
|
-
code += ret.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1752
|
+
code += yield* ret.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1735
1753
|
code += ';\n';
|
|
1736
1754
|
});
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
code += `${indent((state?.tabSize || 0) + 1)}return ${this.returns[0].name};\n`;
|
|
1755
|
+
if (!self.body.length && self.returns.length) {
|
|
1756
|
+
code += `${indent((state?.tabSize || 0) + 1)}return ${self.returns[0].name};\n`;
|
|
1740
1757
|
} else {
|
|
1741
|
-
if ((
|
|
1742
|
-
if (
|
|
1758
|
+
if ((self.parentNode as any).type === 'ExclusiveGateway') {
|
|
1759
|
+
if (self.body.length <= 1) {
|
|
1743
1760
|
code += indent((state?.tabSize || 0) + 1);
|
|
1744
1761
|
code += 'const __LogicEmpty: any = null;';
|
|
1745
1762
|
}
|
|
1746
1763
|
} else if (
|
|
1747
|
-
|
|
1748
|
-
!(
|
|
1749
|
-
!(
|
|
1764
|
+
self.body.length <= 2 &&
|
|
1765
|
+
!(self.parentNode instanceof Namespace) &&
|
|
1766
|
+
!(self.parentNode instanceof Process)
|
|
1750
1767
|
) {
|
|
1751
1768
|
code += indent((state?.tabSize || 0) + 1);
|
|
1752
1769
|
code += `${indent(state?.tabSize || 0 + 4)}const __LogicEmpty: any = null;`;
|
|
1753
1770
|
}
|
|
1754
|
-
|
|
1755
|
-
code +=
|
|
1771
|
+
yield* wrapForEach(self.body, function* warpForEachGenerator(item) {
|
|
1772
|
+
code += yield* item.toEmbeddedTS?.(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 })) ?? returnOrigin('');
|
|
1756
1773
|
code += ';\n';
|
|
1757
1774
|
});
|
|
1758
1775
|
}
|
|
1759
|
-
|
|
1760
1776
|
// 在body渲染完成之后把其余的节点放到下面
|
|
1761
|
-
|
|
1762
|
-
code += item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
1777
|
+
yield* wrapForEach(self.playground, function* warpForEachGenerator(item) {
|
|
1778
|
+
code += yield* item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
1763
1779
|
code += '\n';
|
|
1764
1780
|
});
|
|
1765
|
-
|
|
1766
1781
|
code += `${indent(state?.tabSize || 0 + 4)}}`;
|
|
1767
1782
|
code += '\n';
|
|
1768
1783
|
return code;
|
|
1769
1784
|
}
|
|
1770
1785
|
|
|
1771
1786
|
toEmbeddedTSNoExport(state?: TranslatorState): string {
|
|
1772
|
-
return this.toEmbeddedTS(state, 'noExport');
|
|
1787
|
+
return runSync(this.toEmbeddedTS(state, 'noExport'));
|
|
1773
1788
|
}
|
|
1774
1789
|
|
|
1775
1790
|
get tsName() {
|
|
@@ -1781,155 +1796,134 @@ export class Logic extends BaseNode {
|
|
|
1781
1796
|
return this.name;
|
|
1782
1797
|
}
|
|
1783
1798
|
|
|
1784
|
-
@
|
|
1785
|
-
toEmbeddedTS(state
|
|
1799
|
+
@withSourceMapGenerator
|
|
1800
|
+
*toEmbeddedTS(state = createCompilerState(), prefix?: string, hideDefaultValue?: boolean): TranslatorGenerator {
|
|
1801
|
+
const self = this;
|
|
1802
|
+
// 等待 oql 查询返回内容
|
|
1803
|
+
yield waitOqlQueryComponentChildrenFinish(self);
|
|
1786
1804
|
// 如果传了不要前缀那就为空, 要不用传进来的,要是都没有就默认导出
|
|
1787
1805
|
let code = '';
|
|
1788
1806
|
// 用来储存默认值翻译结构是__IDENTIFIER__或者__IDENTIFIER__()的节点
|
|
1789
|
-
const IDENTIFIERMAP = new Set();
|
|
1807
|
+
const IDENTIFIERMAP = new Set<Variable | Return>();
|
|
1790
1808
|
|
|
1791
1809
|
if (!prefix) {
|
|
1792
|
-
code += `export function ${
|
|
1810
|
+
code += `export function ${self.name}`;
|
|
1793
1811
|
} else if (prefix === 'noExport') {
|
|
1794
|
-
code += `function ${
|
|
1812
|
+
code += `function ${self.name}`;
|
|
1795
1813
|
} else if (prefix === 'inObject') {
|
|
1796
|
-
code += `${
|
|
1814
|
+
code += `${self.name}`;
|
|
1797
1815
|
}
|
|
1798
|
-
if (
|
|
1816
|
+
if (self.typeParams?.length) {
|
|
1799
1817
|
code += '<';
|
|
1800
|
-
|
|
1801
|
-
code += typeParam.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1802
|
-
if (typeParamIndex !==
|
|
1818
|
+
yield* wrapForEach(self.typeParams, function* warpForEachGenerator(typeParam, typeParamIndex) {
|
|
1819
|
+
code += yield* typeParam.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1820
|
+
if (typeParamIndex !== self.typeParams.length - 1) code += ', ';
|
|
1803
1821
|
});
|
|
1804
1822
|
code += '>';
|
|
1805
1823
|
}
|
|
1806
1824
|
// 有参数长度
|
|
1807
|
-
if (
|
|
1825
|
+
if (self.params.length) {
|
|
1808
1826
|
code += '(';
|
|
1809
|
-
|
|
1810
|
-
code += param.toEmbeddedTS(shiftState(state, code));
|
|
1811
|
-
if (index !==
|
|
1827
|
+
yield* wrapForEach(self.params, function* warpForEachGenerator(param, index) {
|
|
1828
|
+
code += yield* param.toEmbeddedTS(shiftState(state, code));
|
|
1829
|
+
if (index !== self.params.length - 1) code += ', ';
|
|
1812
1830
|
});
|
|
1813
1831
|
code += ')';
|
|
1814
1832
|
} else {
|
|
1815
1833
|
// 没有参数的
|
|
1816
1834
|
code += '()';
|
|
1817
1835
|
}
|
|
1818
|
-
|
|
1819
1836
|
// 需要类型推导的局部变量/返回值需要调整申明顺序
|
|
1820
1837
|
const advanceMap: Map<Return | Variable, Assignment | BatchAssignment> = new Map();
|
|
1821
|
-
const needGetSourceMapOqlList: Promise<any>[] = [];
|
|
1822
|
-
|
|
1838
|
+
// const needGetSourceMapOqlList: Promise<any>[] = [];
|
|
1839
|
+
yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
|
|
1823
1840
|
if (el && (el instanceof BatchAssignment || (el instanceof Assignment && el.left?.name))) {
|
|
1824
1841
|
if (el instanceof Assignment) {
|
|
1825
|
-
const advanceVar =
|
|
1842
|
+
const advanceVar = self.variables?.find(
|
|
1826
1843
|
(variable) => !variable.typeAnnotation && el.left?.name === variable.name,
|
|
1827
1844
|
);
|
|
1828
1845
|
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1829
1846
|
advanceMap.set(advanceVar, el);
|
|
1830
1847
|
}
|
|
1831
|
-
const advanceRn =
|
|
1848
|
+
const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && el.left?.name === ret.name);
|
|
1832
1849
|
if (advanceRn && !advanceMap.get(advanceRn)) {
|
|
1833
1850
|
advanceMap.set(advanceRn, el);
|
|
1834
1851
|
}
|
|
1835
1852
|
} else if (el instanceof BatchAssignment) {
|
|
1836
|
-
el.assignmentLines
|
|
1853
|
+
yield* wrapForEach(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
|
|
1837
1854
|
const leftCode =
|
|
1838
1855
|
leftIndex.length === 1
|
|
1839
|
-
? el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1840
|
-
: el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1841
|
-
const advanceVar =
|
|
1856
|
+
? yield* el.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1857
|
+
: yield* el.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ?? returnOrigin('');
|
|
1858
|
+
const advanceVar = self.variables?.find(
|
|
1842
1859
|
(variable) => !variable.typeAnnotation && leftCode === variable.name,
|
|
1843
1860
|
);
|
|
1844
1861
|
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1845
1862
|
advanceMap.set(advanceVar, el);
|
|
1846
1863
|
}
|
|
1847
|
-
const advanceRn =
|
|
1864
|
+
const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && leftCode === ret.name);
|
|
1848
1865
|
if (advanceRn && !advanceMap.get(advanceRn)) {
|
|
1849
1866
|
advanceMap.set(advanceRn, el);
|
|
1850
1867
|
}
|
|
1851
1868
|
});
|
|
1852
1869
|
}
|
|
1853
1870
|
}
|
|
1854
|
-
// 如果有sql查询组件就需要把他们存起来
|
|
1855
|
-
if (el instanceof OqlQueryComponent) {
|
|
1856
|
-
if (!el.codeSourceMap) {
|
|
1857
|
-
needGetSourceMapOqlList.push(el.requestEmbeddedTS());
|
|
1858
|
-
}
|
|
1859
|
-
}
|
|
1860
1871
|
});
|
|
1861
|
-
|
|
1862
|
-
if (needGetSourceMapOqlList.length) {
|
|
1863
|
-
Promise.all(needGetSourceMapOqlList).then(() => {
|
|
1864
|
-
// 触发一下更新重新生成代码
|
|
1865
|
-
(this.app as any)?.naslServer?.embeddedTSEmitter.emit('change', {
|
|
1866
|
-
value: [
|
|
1867
|
-
{
|
|
1868
|
-
originEvent: {
|
|
1869
|
-
action: 'update',
|
|
1870
|
-
target: this,
|
|
1871
|
-
},
|
|
1872
|
-
},
|
|
1873
|
-
],
|
|
1874
|
-
});
|
|
1875
|
-
});
|
|
1876
|
-
}
|
|
1877
1872
|
// 兼容 return 没有类型情况
|
|
1878
|
-
if (
|
|
1873
|
+
if (self.returns.length && self.returns[0].typeAnnotation) {
|
|
1879
1874
|
code += ': ';
|
|
1880
|
-
code +=
|
|
1875
|
+
code += yield* self.returns[0].typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) ?? returnOrigin('');
|
|
1881
1876
|
}
|
|
1882
1877
|
code += '{\n';
|
|
1883
|
-
|
|
1884
1878
|
// 用于虚拟节点的查找引用
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
this.virtualParams.forEach((param) => {
|
|
1879
|
+
if (Array.isArray(self.virtualParams)) {
|
|
1880
|
+
for (const param of self.virtualParams) {
|
|
1888
1881
|
code += indent((state?.tabSize || 0) + 1);
|
|
1889
|
-
code += param.toEmbeddedNameTS(shiftState(state, code, { inline: true }));
|
|
1882
|
+
code += yield* param.toEmbeddedNameTS(shiftState(state, code, { inline: true }));
|
|
1890
1883
|
code += '\n';
|
|
1891
|
-
}
|
|
1884
|
+
}
|
|
1885
|
+
}
|
|
1892
1886
|
|
|
1893
|
-
|
|
1894
|
-
const ts = variable.defaultValue?.toEmbeddedTS();
|
|
1887
|
+
for (const variable of self.variables) {
|
|
1888
|
+
const ts = yield* variable.defaultValue?.toEmbeddedTS?.() ?? utils.returnOrigin('');
|
|
1895
1889
|
if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
|
|
1896
1890
|
IDENTIFIERMAP.add(variable);
|
|
1897
1891
|
}
|
|
1898
1892
|
if (!advanceMap.get(variable)) {
|
|
1899
1893
|
code += `${indent((state?.tabSize || 0) + 1)}let `;
|
|
1900
|
-
code += variable.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1894
|
+
code += yield* variable.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1901
1895
|
code += ';\n';
|
|
1902
1896
|
}
|
|
1903
|
-
}
|
|
1897
|
+
}
|
|
1904
1898
|
|
|
1905
|
-
|
|
1906
|
-
const ts = ret.defaultValue?.toEmbeddedTS();
|
|
1899
|
+
for (const ret of self.returns) {
|
|
1900
|
+
const ts = yield* ret.defaultValue?.toEmbeddedTS?.() ?? returnOrigin('');
|
|
1907
1901
|
if (['__IDENTIFIER__', '__IDENTIFIER__()'].includes(ts)) {
|
|
1908
1902
|
IDENTIFIERMAP.add(ret);
|
|
1909
1903
|
}
|
|
1910
1904
|
if (!advanceMap.get(ret)) {
|
|
1911
1905
|
code += `${indent((state?.tabSize || 0) + 1)}let `;
|
|
1912
|
-
code += ret.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1906
|
+
code += yield* ret.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1913
1907
|
code += ';\n';
|
|
1914
1908
|
}
|
|
1915
|
-
}
|
|
1909
|
+
}
|
|
1916
1910
|
|
|
1917
|
-
advanceMap.
|
|
1911
|
+
yield* wrapIterator(advanceMap.entries(), function* warpForEachGenerator([node, assignment]) {
|
|
1918
1912
|
// 有默认值的用默认值来推导类型, 但是如果是__IDENTIFIER__或者__IDENTIFIER__(),就不需要默认值来推导了
|
|
1919
1913
|
if (node.defaultValue?.expression && !IDENTIFIERMAP.has(node)) {
|
|
1920
1914
|
code += `${indent((state?.tabSize || 0) + 1)}let `;
|
|
1921
|
-
code += node.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1915
|
+
code += yield* node.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1922
1916
|
return;
|
|
1923
1917
|
}
|
|
1924
1918
|
code += `${indent((state?.tabSize || 0) + 1)}// @ts-ignore\n`;
|
|
1925
1919
|
code += `${indent((state?.tabSize || 0) + 1)}let `;
|
|
1926
|
-
code += node.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1920
|
+
code += yield* node.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1927
1921
|
if (assignment instanceof BatchAssignment) {
|
|
1928
|
-
assignment.assignmentLines
|
|
1922
|
+
yield* wrapForEach(assignment.assignmentLines, function* warpForEachGenerator({ leftIndex, rightIndex }) {
|
|
1929
1923
|
const leftCode =
|
|
1930
1924
|
leftIndex.length === 1
|
|
1931
|
-
? assignment.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1932
|
-
: assignment.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1925
|
+
? yield* assignment.left.expression.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1926
|
+
: yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS(shiftState(state, code, { inline: true })) ?? returnOrigin('');
|
|
1933
1927
|
if (leftCode === node.name) {
|
|
1934
1928
|
const rightNode: any =
|
|
1935
1929
|
rightIndex.length === 1
|
|
@@ -1939,18 +1933,18 @@ export class Logic extends BaseNode {
|
|
|
1939
1933
|
if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && !rightNode.isAutoInfer())) {
|
|
1940
1934
|
if (rightNode.concept === 'NewComposite' && rightNode.typeAnnotation?.typeKind === 'anonymousStructure') {
|
|
1941
1935
|
code += '= ';
|
|
1942
|
-
code += rightNode.getInitCode(shiftState(state, code, { inline: true })) || 'null';
|
|
1936
|
+
code += (yield* rightNode.getInitCode(shiftState(state, code, { inline: true }))) || 'null';
|
|
1943
1937
|
} else if (rightNode.concept === 'NewComposite' && rightNode.typeAnnotation?.typeKind === 'generic') {
|
|
1944
1938
|
code += '= ';
|
|
1945
|
-
code += rightNode.getNewCompositeCode(shiftState(state, code, { inline: true })) || 'null';
|
|
1939
|
+
code += (yield* rightNode.getNewCompositeCode(shiftState(state, code, { inline: true }))) || 'null';
|
|
1946
1940
|
} else {
|
|
1947
1941
|
code += ': ';
|
|
1948
|
-
code += rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1942
|
+
code += yield* rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) ?? returnOrigin('null');
|
|
1949
1943
|
}
|
|
1950
1944
|
} else {
|
|
1951
1945
|
code += ' = ';
|
|
1952
|
-
const rightCode = rightNode?.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
1953
|
-
code +=
|
|
1946
|
+
const rightCode = yield* rightNode?.toEmbeddedTS(shiftState(state, code, { inline: true })) ?? returnOrigin('');
|
|
1947
|
+
code += yield* self.getRightCode(rightCode, assignment, rightNode);
|
|
1954
1948
|
}
|
|
1955
1949
|
}
|
|
1956
1950
|
});
|
|
@@ -1960,27 +1954,27 @@ export class Logic extends BaseNode {
|
|
|
1960
1954
|
) {
|
|
1961
1955
|
const rightNode: any = assignment.right;
|
|
1962
1956
|
code += ' = ';
|
|
1963
|
-
code += rightNode.getInitCode(shiftState(state, code, { inline: true }));
|
|
1957
|
+
code += yield* rightNode.getInitCode(shiftState(state, code, { inline: true }));
|
|
1964
1958
|
} else if (
|
|
1965
1959
|
assignment.right?.concept === 'NewComposite' &&
|
|
1966
1960
|
(assignment.right as any)?.typeAnnotation?.typeKind === 'anonymousStructure'
|
|
1967
1961
|
) {
|
|
1968
1962
|
const rightNode: any = assignment.right;
|
|
1969
1963
|
code += ' = ';
|
|
1970
|
-
code += rightNode.getInitCode(shiftState(state, code, { inline: true }));
|
|
1964
|
+
code += yield* rightNode.getInitCode(shiftState(state, code, { inline: true }));
|
|
1971
1965
|
} else if (
|
|
1972
1966
|
assignment.right?.concept === 'NewComposite' &&
|
|
1973
1967
|
(assignment.right as any)?.typeAnnotation?.typeKind === 'generic'
|
|
1974
1968
|
) {
|
|
1975
1969
|
const rightNode: any = assignment.right;
|
|
1976
1970
|
code += ' = ';
|
|
1977
|
-
code += rightNode.getNewCompositeCode(shiftState(state, code, { inline: true }));
|
|
1971
|
+
code += (yield* rightNode.getNewCompositeCode(shiftState(state, code, { inline: true })));
|
|
1978
1972
|
} else {
|
|
1979
1973
|
const rightNode: any = assignment.right;
|
|
1980
1974
|
// 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
|
|
1981
1975
|
if (rightNode?.typeAnnotation && !(rightNode instanceof CallQueryComponent && !rightNode.isAutoInfer())) {
|
|
1982
1976
|
code += ': ';
|
|
1983
|
-
code += rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1977
|
+
code += yield* rightNode.typeAnnotation?.toEmbeddedTS(shiftState(state, code, { inline: true })) ?? returnOrigin('null');
|
|
1984
1978
|
} else {
|
|
1985
1979
|
code += ' = ';
|
|
1986
1980
|
let rightCode = '';
|
|
@@ -1995,9 +1989,9 @@ export class Logic extends BaseNode {
|
|
|
1995
1989
|
}
|
|
1996
1990
|
rightCode +=
|
|
1997
1991
|
rightNode && rightNode.toEmbeddedTS
|
|
1998
|
-
? rightNode.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1992
|
+
? yield* rightNode.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
1999
1993
|
: '__RIGHT__';
|
|
2000
|
-
code +=
|
|
1994
|
+
code += yield* self.getRightCode(rightCode, assignment, rightNode);
|
|
2001
1995
|
}
|
|
2002
1996
|
}
|
|
2003
1997
|
code += ';\n';
|
|
@@ -2005,10 +1999,10 @@ export class Logic extends BaseNode {
|
|
|
2005
1999
|
|
|
2006
2000
|
// 参数的默认值是__IDENTIFIER__或者__IDENTIFIER__()时不赋默认值,但是需要ts翻译出来进行报错校验
|
|
2007
2001
|
if (!hideDefaultValue) {
|
|
2008
|
-
|
|
2009
|
-
code += node.defaultValue.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
2002
|
+
for (const node of IDENTIFIERMAP.values()) {
|
|
2003
|
+
code += yield* node.defaultValue.toEmbeddedTS(shiftState(state, code, { inline: true }));
|
|
2010
2004
|
code += '; ';
|
|
2011
|
-
}
|
|
2005
|
+
}
|
|
2012
2006
|
code += '\n';
|
|
2013
2007
|
}
|
|
2014
2008
|
|
|
@@ -2016,62 +2010,42 @@ export class Logic extends BaseNode {
|
|
|
2016
2010
|
code += `${indent((state?.tabSize || 0) + 1)}return ${this.returns[0].name};\n`;
|
|
2017
2011
|
} else {
|
|
2018
2012
|
// 如果长度小于2 并且不是虚拟节点就 加 报错,
|
|
2019
|
-
if (
|
|
2020
|
-
if (
|
|
2013
|
+
if (self.body.length <= 2 && !(self.parentNode instanceof Namespace)) {
|
|
2014
|
+
if (self.body.length && self.body[0].concept === 'JavaLogic') {
|
|
2021
2015
|
code += '';
|
|
2022
2016
|
} else {
|
|
2023
2017
|
code += indent((state?.tabSize || 0) + 1);
|
|
2024
2018
|
code += 'const __LogicEmpty: any = null;';
|
|
2025
2019
|
}
|
|
2026
2020
|
}
|
|
2027
|
-
|
|
2028
|
-
code +=
|
|
2021
|
+
yield* wrapForEach(self.body, function* warpForEachGenerator(item) {
|
|
2022
|
+
code += yield* item.toEmbeddedTS?.(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 })) ?? returnOrigin('');
|
|
2029
2023
|
code += ';\n';
|
|
2030
2024
|
});
|
|
2031
2025
|
}
|
|
2032
|
-
|
|
2033
2026
|
// 在body渲染完成之后把其余的节点放到下面
|
|
2034
|
-
|
|
2035
|
-
code += item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
2027
|
+
yield* wrapForEach(self.playground, function* warpForEachGenerator(item) {
|
|
2028
|
+
code += yield* item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
2036
2029
|
code += ';\n';
|
|
2037
2030
|
});
|
|
2038
2031
|
|
|
2039
2032
|
if (!hideDefaultValue) {
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
this.variables.forEach((variable) => {
|
|
2044
|
-
if (variable.defaultValue) {
|
|
2045
|
-
variable.defaultValue.playground?.forEach((item) => {
|
|
2046
|
-
code += item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
2047
|
-
code += ';\n';
|
|
2048
|
-
});
|
|
2033
|
+
function* setPlaygroundCode(arr: Variable[] | Param[] | Return[], name: string) {
|
|
2034
|
+
if (arr.length) {
|
|
2035
|
+
code += `${indent((state?.tabSize || 0) + 1)}/* -----以下是 ${name} 的默认值草稿------ */\n`;
|
|
2049
2036
|
}
|
|
2050
|
-
});
|
|
2051
2037
|
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
this.returns.forEach((return_) => {
|
|
2056
|
-
if (return_.defaultValue) {
|
|
2057
|
-
return_.defaultValue.playground?.forEach((item) => {
|
|
2058
|
-
code += item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
2038
|
+
for (const item1 of arr) {
|
|
2039
|
+
for (const item of item1.defaultValue?.playground ?? []) {
|
|
2040
|
+
code += yield* item.toEmbeddedTS(shiftState(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
2059
2041
|
code += ';\n';
|
|
2060
|
-
}
|
|
2042
|
+
}
|
|
2061
2043
|
}
|
|
2062
|
-
});
|
|
2063
|
-
|
|
2064
|
-
if (this.params.length) {
|
|
2065
|
-
code += `${indent((state?.tabSize || 0) + 1)}/* -----以下是params的默认值草稿------ */\n`;
|
|
2066
2044
|
}
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
code += ';\n';
|
|
2072
|
-
});
|
|
2073
|
-
}
|
|
2074
|
-
});
|
|
2045
|
+
|
|
2046
|
+
yield* setPlaygroundCode(self.variables, 'variables');
|
|
2047
|
+
yield* setPlaygroundCode(self.returns, 'returns');
|
|
2048
|
+
yield* setPlaygroundCode(self.params, 'params');
|
|
2075
2049
|
}
|
|
2076
2050
|
|
|
2077
2051
|
code += `${indent(state?.tabSize || 0)}}`;
|
|
@@ -2177,7 +2151,7 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2177
2151
|
if (item.toNaturalTS) {
|
|
2178
2152
|
partialCode = item.toNaturalTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
2179
2153
|
} else if (item.toEmbeddedTS) {
|
|
2180
|
-
partialCode = item.toEmbeddedTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
|
|
2154
|
+
partialCode = runSync(item.toEmbeddedTS(shiftState(state, code, { tabSize: state.tabSize + 1 })));
|
|
2181
2155
|
}
|
|
2182
2156
|
if (partialCode.trim()) {
|
|
2183
2157
|
code += partialCode;
|
|
@@ -2194,7 +2168,7 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2194
2168
|
return code;
|
|
2195
2169
|
}
|
|
2196
2170
|
|
|
2197
|
-
getRightCode(code: string, assignment: Assignment | BatchAssignment, rightNode: any)
|
|
2171
|
+
*getRightCode(code: string, assignment: Assignment | BatchAssignment, rightNode: any) {
|
|
2198
2172
|
code = code.replaceAll('\n', ' ');
|
|
2199
2173
|
if (assignment instanceof Assignment && !assignment.right) return code;
|
|
2200
2174
|
|
|
@@ -2202,7 +2176,7 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2202
2176
|
if (rightNode instanceof CallInterface) {
|
|
2203
2177
|
const { _interface } = rightNode.getModuleInterface();
|
|
2204
2178
|
return _interface
|
|
2205
|
-
? `${rightNode.tsCalleeKey}(${(_interface as Interface).params.map(() => 'null').join(',')})`
|
|
2179
|
+
? `${rightNode.tsCalleeKey}(${(_interface as unknown as Interface).params.map(() => 'null').join(',')})`
|
|
2206
2180
|
: null;
|
|
2207
2181
|
}
|
|
2208
2182
|
|
|
@@ -2216,12 +2190,12 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2216
2190
|
// ForEachStatement 内部变量需要替换处理,如 item、index
|
|
2217
2191
|
const forEachStatement = assignment.getAncestor('ForEachStatement') as ForEachStatement;
|
|
2218
2192
|
if (forEachStatement) {
|
|
2219
|
-
code = this.handleForEachCode(code, forEachStatement);
|
|
2193
|
+
code = yield* this.handleForEachCode(code, forEachStatement);
|
|
2220
2194
|
}
|
|
2221
2195
|
// Match 需要针对分支缩小类型范围
|
|
2222
2196
|
const matchCase = assignment.getAncestor('MatchCase') as MatchCase;
|
|
2223
2197
|
if (matchCase) {
|
|
2224
|
-
code = this.handleMatchCaseCode(code, matchCase);
|
|
2198
|
+
code = yield* this.handleMatchCaseCode(code, matchCase);
|
|
2225
2199
|
}
|
|
2226
2200
|
return code;
|
|
2227
2201
|
}
|
|
@@ -2245,37 +2219,39 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2245
2219
|
});
|
|
2246
2220
|
}
|
|
2247
2221
|
|
|
2248
|
-
handleForEachCode(code: string, forEachStatement: ForEachStatement): string {
|
|
2222
|
+
*handleForEachCode(code: string, forEachStatement: ForEachStatement): Generator<any, string, any> {
|
|
2249
2223
|
const { item, index, each } = forEachStatement;
|
|
2250
2224
|
if (code.includes(item.name)) {
|
|
2251
|
-
const eachTSCode = each ? each.toEmbeddedTS() : '__IDENTIFIER__';
|
|
2225
|
+
const eachTSCode = each ? yield* each.toEmbeddedTS() : '__IDENTIFIER__';
|
|
2252
2226
|
code = this.handleReplaceCode(
|
|
2253
2227
|
code,
|
|
2254
2228
|
item.name,
|
|
2255
2229
|
eachTSCode === '__IDENTIFIER__' ? eachTSCode : `${eachTSCode}.__get(0)`,
|
|
2256
2230
|
);
|
|
2257
2231
|
}
|
|
2258
|
-
if (code.includes(index.name))
|
|
2232
|
+
if (code.includes(index.name)) {
|
|
2233
|
+
code = this.handleReplaceCode(code, index.name, 'new nasl.core.Long(0)');
|
|
2234
|
+
}
|
|
2259
2235
|
|
|
2260
2236
|
const parentForEachStatement = forEachStatement.getAncestor('ForEachStatement') as ForEachStatement;
|
|
2261
2237
|
if (parentForEachStatement) {
|
|
2262
|
-
this.handleForEachCode(code, parentForEachStatement);
|
|
2238
|
+
code = yield* this.handleForEachCode(code, parentForEachStatement);
|
|
2263
2239
|
}
|
|
2264
2240
|
return code;
|
|
2265
2241
|
}
|
|
2266
2242
|
|
|
2267
|
-
handleMatchCaseCode(code: string, matchCase: MatchCase): string {
|
|
2243
|
+
*handleMatchCaseCode(code: string, matchCase: MatchCase): Generator<any, string, any> {
|
|
2268
2244
|
const match = matchCase.getAncestor('Match') as Match;
|
|
2269
|
-
const expressionTsCode = match.expression.toEmbeddedTS();
|
|
2245
|
+
const expressionTsCode = yield* match.expression.toEmbeddedTS();
|
|
2270
2246
|
if (code.includes(expressionTsCode)) {
|
|
2271
2247
|
let typeCode = '';
|
|
2272
|
-
matchCase.patterns
|
|
2248
|
+
yield* wrapForEach(matchCase.patterns, function* wrapForEach(pattern, index) {
|
|
2273
2249
|
if (pattern instanceof TypeAnnotation) {
|
|
2274
2250
|
if (index === 0) {
|
|
2275
|
-
typeCode += pattern.toEmbeddedTS();
|
|
2251
|
+
typeCode += yield* pattern.toEmbeddedTS();
|
|
2276
2252
|
} else {
|
|
2277
2253
|
typeCode += '|';
|
|
2278
|
-
typeCode += pattern.toEmbeddedTS();
|
|
2254
|
+
typeCode += yield* pattern.toEmbeddedTS();
|
|
2279
2255
|
}
|
|
2280
2256
|
}
|
|
2281
2257
|
});
|
|
@@ -2285,7 +2261,7 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2285
2261
|
}
|
|
2286
2262
|
const parentMatchCase = match.getAncestor('MatchCase') as MatchCase;
|
|
2287
2263
|
if (parentMatchCase) {
|
|
2288
|
-
code = this.handleMatchCaseCode(code, parentMatchCase);
|
|
2264
|
+
code = yield* this.handleMatchCaseCode(code, parentMatchCase);
|
|
2289
2265
|
}
|
|
2290
2266
|
return code;
|
|
2291
2267
|
}
|
|
@@ -2373,7 +2349,10 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2373
2349
|
let _path = '';
|
|
2374
2350
|
if (this.module) {
|
|
2375
2351
|
_path = `/${this.module.parentKey}/${this.module.name}`;
|
|
2376
|
-
}
|
|
2352
|
+
}
|
|
2353
|
+
// 由于 getAncestor逻辑变更导致现在在module 上也可以获取 connector ,导致之前的 else if 逻辑失效
|
|
2354
|
+
// 现断层处理
|
|
2355
|
+
if (this.connector) {
|
|
2377
2356
|
// 自定义连接器 编辑态文件对应parentKey 为 connectors,
|
|
2378
2357
|
// 稳定态文件对应parentKey 为 dependencies
|
|
2379
2358
|
// 自定义连接器有分组的概念因此,需要做文件夹处理
|
|
@@ -2391,12 +2370,11 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2391
2370
|
return `/embedded/${this.app.name}${_path}/logics/${name}.ts`;
|
|
2392
2371
|
}
|
|
2393
2372
|
|
|
2394
|
-
toEmbeddedTSFile() {
|
|
2373
|
+
*toEmbeddedTSFile(): EmbeddedTSFileGenerator {
|
|
2395
2374
|
let code = `namespace ${this.getTsNamespace()} {\n`;
|
|
2396
|
-
|
|
2397
2375
|
const state = createCompilerState(code, { tabSize: 1 });
|
|
2398
2376
|
try {
|
|
2399
|
-
code += this.toEmbeddedTS(state);
|
|
2377
|
+
code += yield* this.toEmbeddedTS(state);
|
|
2400
2378
|
} catch (err) {
|
|
2401
2379
|
console.log(err, `有问题翻译失败:${this.getTsNamespace()}.${this.name}`);
|
|
2402
2380
|
code += '';
|
|
@@ -2480,15 +2458,12 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2480
2458
|
const connector: Connector | null = el?.getAncestor?.('Connector') as Connector;
|
|
2481
2459
|
if (['CallAuthInterface', 'CallInterface'].includes(el?.concept) && connector) {
|
|
2482
2460
|
const { calleeName } = el as CallInterface;
|
|
2483
|
-
const targetInterface =
|
|
2484
|
-
(i) => i.inter.name === calleeName,
|
|
2485
|
-
) as InterfaceFromExample;
|
|
2461
|
+
const targetInterface = connector.interfaces.find((i) => i.name === calleeName) as Interface;
|
|
2486
2462
|
if (targetInterface) {
|
|
2487
2463
|
const refs = await (this.app as any)?.naslServer?._isHaveRef(targetInterface);
|
|
2488
2464
|
// 如果只有两个引用,则必然为自身以及当前logic引用,需要删除此接口
|
|
2489
2465
|
if (refs?.length <= 2) {
|
|
2490
|
-
|
|
2491
|
-
targetInterface.deleteInterfaceFromExample();
|
|
2466
|
+
targetInterface.deleteInterface();
|
|
2492
2467
|
}
|
|
2493
2468
|
}
|
|
2494
2469
|
}
|