@lcap/nasl 3.3.3-beta.7 → 3.3.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/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 +18 -99
- package/out/bak/translator.js.map +1 -1
- package/out/common/Command.js +1 -1
- package/out/common/Command.js.map +1 -1
- package/out/concepts/Argument__.js +2 -7
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignment__.js +3 -20
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/BackendVariable__.js +2 -24
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +13 -40
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.d.ts +0 -6
- package/out/concepts/BindAttribute__.js +11 -105
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/CallLogic__.js +21 -7
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/Identifier__.js +0 -3
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/JSBlock__.js +0 -56
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/Match__.js +1 -1
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +1 -2
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/Param__.js +2 -24
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Return__.js +2 -24
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Variable__.js +2 -24
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +0 -1
- package/out/concepts/ViewElement__.js +4 -75
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +0 -2
- package/out/concepts/View__.js +3 -12
- package/out/concepts/View__.js.map +1 -1
- package/out/templator/genCreateBlock.js +5 -9
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +9 -15
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +5 -7
- 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/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 +20 -99
- package/src/common/Command.ts +1 -1
- package/src/concepts/Argument__.ts +2 -7
- package/src/concepts/Assignment__.ts +13 -31
- package/src/concepts/BackendVariable__.ts +3 -22
- package/src/concepts/BinaryExpression__.ts +13 -39
- package/src/concepts/BindAttribute__.ts +11 -108
- package/src/concepts/CallLogic__.ts +12 -0
- package/src/concepts/Identifier__.ts +1 -4
- package/src/concepts/JSBlock__.ts +0 -58
- package/src/concepts/Match__.ts +1 -1
- package/src/concepts/NumericLiteral__.ts +1 -2
- package/src/concepts/Param__.ts +2 -24
- package/src/concepts/Return__.ts +3 -23
- package/src/concepts/Variable__.ts +3 -23
- package/src/concepts/ViewElement__.ts +8 -83
- package/src/concepts/View__.ts +18 -32
- package/src/templator/genCreateBlock.ts +5 -9
- package/src/templator/genCurdEditMultipleKeyBlock.ts +10 -16
- package/src/templator/genCurdMultipleKeyBlock.ts +8 -11
- package/src/templator/genEditTableBlock.ts +2 -4
- package/src/templator/genUpdateBlock.ts +12 -15
- package/src/templator/utils.ts +7 -8
- package/test/concepts/anonymous-function/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/assignment/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/batch-assignment/__snapshots__/toJS.spec.ts.snap +2 -2
- package/test/concepts/binary-expression/__snapshots__/toJS.spec.ts.snap +2 -3
- package/test/concepts/call-interface/__snapshots__/toJS.spec.ts.snap +2 -2
- package/test/concepts/call-logic/__snapshots__/toJS.spec.ts.snap +3 -3
- package/test/concepts/match/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/numeric-literal/__snapshots__/toJS.spec.ts.snap +1 -1
- package/test/concepts/validation-rule/__snapshots__/toJS.spec.ts.snap +3 -3
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +0 -2
|
@@ -83,66 +83,8 @@ export class JSBlock extends LogicItem {
|
|
|
83
83
|
/**
|
|
84
84
|
* 生成 JS 脚本
|
|
85
85
|
*/
|
|
86
|
-
let boxVariablesCode = '\n';
|
|
87
|
-
let logicVariableList: any[] = [];
|
|
88
|
-
let viewVariableList: any[] = [];
|
|
89
|
-
let currentLogic = this.logic;
|
|
90
|
-
let currentView;
|
|
91
|
-
if (currentLogic) {
|
|
92
|
-
// logic能使用的所有变量: View.variables params Logic.variables params returns
|
|
93
|
-
let { variables, params, returns } = currentLogic;
|
|
94
|
-
logicVariableList = [...variables, ...params, ...returns];
|
|
95
|
-
currentView = currentLogic.view;
|
|
96
|
-
if (currentView) {
|
|
97
|
-
let { variables, params } = currentView;
|
|
98
|
-
viewVariableList = [...variables, ...params];
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
const getBoxCode = (variable: any, context?: string) => {
|
|
102
|
-
let boxClass = '';
|
|
103
|
-
const defaultValue = variable.defaultValue;
|
|
104
|
-
const typeAnnotation = variable?.typeAnnotation || variable?.__TypeAnnotation;
|
|
105
|
-
if (typeAnnotation) {
|
|
106
|
-
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
107
|
-
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
108
|
-
|
|
109
|
-
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
110
|
-
let parsedValue = defaultValue ?? undefined;
|
|
111
|
-
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
112
|
-
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
113
|
-
// typeKind: 'union'
|
|
114
|
-
// typeName: 'Union'
|
|
115
|
-
// typeKey: 'nasl.core.Long | nasl.core.Decimal'
|
|
116
|
-
if (isInteger) {
|
|
117
|
-
boxClass = 'NaslLong';
|
|
118
|
-
}
|
|
119
|
-
if (isDecimal) {
|
|
120
|
-
boxClass = 'NaslDecimal';
|
|
121
|
-
}
|
|
122
|
-
if (!isInteger && !isDecimal) {
|
|
123
|
-
// 不是数值类型就不用做box转换 但是有可能 字符串类型被代码块使用并强行赋值 这个情况暂时不考虑
|
|
124
|
-
return '';
|
|
125
|
-
}
|
|
126
|
-
let variableName = context ? `${context}.${variable.name}` : variable.name;
|
|
127
|
-
return `${variableName} = new ${boxClass}(${variableName});`;
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
logicVariableList.map((variable) => {
|
|
131
|
-
let variableCode = getBoxCode(variable);
|
|
132
|
-
if (variableCode && variableCode?.length > 0) {
|
|
133
|
-
boxVariablesCode += `${variableCode}\n`;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
viewVariableList.map((variable) => {
|
|
137
|
-
let variableCode = getBoxCode(variable, 'this');
|
|
138
|
-
if (variableCode && variableCode?.length > 0) {
|
|
139
|
-
boxVariablesCode += `${variableCode}\n`;
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
|
|
143
86
|
return `await (async () => {
|
|
144
87
|
${this.code}
|
|
145
|
-
${boxVariablesCode}
|
|
146
88
|
})();`;
|
|
147
89
|
}
|
|
148
90
|
|
package/src/concepts/Match__.ts
CHANGED
|
@@ -775,7 +775,7 @@ export class Match extends LogicItem {
|
|
|
775
775
|
code += item.toNaturalTS(shiftState(state, code, { tabSize: state.tabSize + 1 }), index, parentCode);
|
|
776
776
|
});
|
|
777
777
|
code += indent(state.tabSize);
|
|
778
|
-
code += `})(${this.expression
|
|
778
|
+
code += `})(${this.expression?.toNaturalTS(shiftState(state, code, { inline: true }))})`;
|
|
779
779
|
|
|
780
780
|
if (
|
|
781
781
|
this.parentNode?.concept !== 'Argument' &&
|
|
@@ -138,8 +138,7 @@ export class NumericLiteral extends LogicItem {
|
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
toJS(): string {
|
|
141
|
-
|
|
142
|
-
const code = this.value ? `"${String(this.value)}"` : '';
|
|
141
|
+
const code = this.value ? String(this.value) : '';
|
|
143
142
|
return code;
|
|
144
143
|
}
|
|
145
144
|
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -325,9 +325,6 @@ export class Param extends BaseNode {
|
|
|
325
325
|
const { defaultValue } = this;
|
|
326
326
|
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
327
327
|
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
328
|
-
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
329
|
-
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
330
|
-
|
|
331
328
|
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
332
329
|
let parsedValue = defaultValue ?? undefined;
|
|
333
330
|
if (
|
|
@@ -345,27 +342,10 @@ export class Param extends BaseNode {
|
|
|
345
342
|
if ([''].includes(defaultValue)) {
|
|
346
343
|
parsedValue = undefined;
|
|
347
344
|
} else {
|
|
348
|
-
|
|
349
|
-
const { typeKind, typeName } = typeAnnotation;
|
|
350
|
-
const isNaslNumber = typeKind === 'primitive' && ['Decimal', 'Long', 'Double', 'Int'].includes(typeName);
|
|
351
|
-
if (isNaslNumber) {
|
|
352
|
-
return String(defaultValue);
|
|
353
|
-
} else {
|
|
354
|
-
return tryJSONParse(defaultValue) ?? defaultValue;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
parsedValue = parseNumberValue(defaultValue, typeAnnotation);
|
|
345
|
+
parsedValue = tryJSONParse(defaultValue) ?? defaultValue;
|
|
358
346
|
}
|
|
359
347
|
}
|
|
360
|
-
|
|
361
|
-
if (isDecimal) {
|
|
362
|
-
valueCode = `new NaslDecimal('${defaultValue}')`;
|
|
363
|
-
} else if (isInteger) {
|
|
364
|
-
valueCode = `new NaslLong('${defaultValue}')`;
|
|
365
|
-
} else {
|
|
366
|
-
valueCode = `${JSON.stringify(parsedValue)}`;
|
|
367
|
-
}
|
|
368
|
-
code += `${this.name} !== undefined ? ${this.name} : ${valueCode}`;
|
|
348
|
+
code += `${this.name} !== undefined ? ${this.name} : ${JSON.stringify(parsedValue)}`;
|
|
369
349
|
|
|
370
350
|
if (needGenInitFromSchema) {
|
|
371
351
|
code += `)`;
|
|
@@ -581,5 +561,3 @@ export default Param;
|
|
|
581
561
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
582
562
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
583
563
|
//================================================================================
|
|
584
|
-
|
|
585
|
-
|
package/src/concepts/Return__.ts
CHANGED
|
@@ -17,7 +17,7 @@ function tryJSONParse(str: string) {
|
|
|
17
17
|
|
|
18
18
|
try {
|
|
19
19
|
result = JSON.parse(str);
|
|
20
|
-
} catch (e) {}
|
|
20
|
+
} catch (e) { }
|
|
21
21
|
|
|
22
22
|
return result;
|
|
23
23
|
}
|
|
@@ -282,9 +282,6 @@ export class Return extends BaseNode {
|
|
|
282
282
|
const { defaultValue } = this;
|
|
283
283
|
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
284
284
|
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
285
|
-
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
286
|
-
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
287
|
-
|
|
288
285
|
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
289
286
|
let parsedValue = defaultValue ?? undefined;
|
|
290
287
|
if (
|
|
@@ -298,27 +295,10 @@ export class Return extends BaseNode {
|
|
|
298
295
|
if ([''].includes(defaultValue)) {
|
|
299
296
|
parsedValue = undefined;
|
|
300
297
|
} else {
|
|
301
|
-
|
|
302
|
-
const { typeKind, typeName } = typeAnnotation;
|
|
303
|
-
const isNaslNumber = typeKind === 'primitive' && ['Decimal', 'Long', 'Double', 'Int'].includes(typeName);
|
|
304
|
-
if (isNaslNumber) {
|
|
305
|
-
return String(defaultValue);
|
|
306
|
-
} else {
|
|
307
|
-
return tryJSONParse(defaultValue) ?? defaultValue;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
parsedValue = parseNumberValue(defaultValue, typeAnnotation);
|
|
298
|
+
parsedValue = tryJSONParse(defaultValue) ?? defaultValue;
|
|
311
299
|
}
|
|
312
300
|
}
|
|
313
|
-
|
|
314
|
-
parsedValue = `new NaslDecimal('${defaultValue}')`;
|
|
315
|
-
code += `${parsedValue}`;
|
|
316
|
-
} else if (isInteger) {
|
|
317
|
-
parsedValue = `new NaslLong('${defaultValue}')`;
|
|
318
|
-
code += `${parsedValue}`;
|
|
319
|
-
} else {
|
|
320
|
-
code += `${JSON.stringify(parsedValue)}`;
|
|
321
|
-
}
|
|
301
|
+
code += JSON.stringify(parsedValue);
|
|
322
302
|
if (needGenInitFromSchema) {
|
|
323
303
|
code += `)`;
|
|
324
304
|
}
|
|
@@ -22,7 +22,7 @@ function tryJSONParse(str: string) {
|
|
|
22
22
|
|
|
23
23
|
try {
|
|
24
24
|
result = JSON.parse(str);
|
|
25
|
-
} catch (e) {}
|
|
25
|
+
} catch (e) { }
|
|
26
26
|
|
|
27
27
|
return result;
|
|
28
28
|
}
|
|
@@ -298,14 +298,11 @@ export class Variable extends BaseNode {
|
|
|
298
298
|
if (needGenInitFromSchema) {
|
|
299
299
|
code += `${context}.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}',`;
|
|
300
300
|
}
|
|
301
|
-
|
|
302
301
|
const { defaultValue } = this;
|
|
303
302
|
const defaultValueType = Object.prototype.toString.call(defaultValue);
|
|
304
303
|
const { typeKind, typeNamespace, typeName } = typeAnnotation || {};
|
|
305
304
|
// 设置成null,才能同步给后端清除该值,但是null对checkbox组件是一种特殊状态
|
|
306
305
|
let parsedValue = defaultValue ?? undefined;
|
|
307
|
-
const isDecimal = typeKind === 'primitive' && ['Decimal', 'Double'].includes(typeName);
|
|
308
|
-
const isInteger = typeKind === 'primitive' && ['Long', 'Integer'].includes(typeName);
|
|
309
306
|
if (
|
|
310
307
|
defaultValueType === '[object String]' &&
|
|
311
308
|
!(typeKind === 'primitive' && typeNamespace === 'nasl.core' && ['String', 'Text', 'Email'].includes(typeName)) &&
|
|
@@ -317,27 +314,10 @@ export class Variable extends BaseNode {
|
|
|
317
314
|
if ([''].includes(defaultValue)) {
|
|
318
315
|
parsedValue = undefined;
|
|
319
316
|
} else {
|
|
320
|
-
|
|
321
|
-
const { typeKind, typeName } = typeAnnotation;
|
|
322
|
-
const isNaslNumber = typeKind === 'primitive' && ['Decimal', 'Long', 'Double', 'Int'].includes(typeName);
|
|
323
|
-
if (isNaslNumber) {
|
|
324
|
-
return String(defaultValue);
|
|
325
|
-
} else {
|
|
326
|
-
return tryJSONParse(defaultValue) ?? defaultValue;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
parsedValue = parseNumberValue(defaultValue, typeAnnotation);
|
|
317
|
+
parsedValue = tryJSONParse(defaultValue) ?? defaultValue;
|
|
330
318
|
}
|
|
331
319
|
}
|
|
332
|
-
|
|
333
|
-
parsedValue = `new NaslDecimal('${defaultValue}')`;
|
|
334
|
-
code += `${parsedValue}`;
|
|
335
|
-
} else if (isInteger) {
|
|
336
|
-
parsedValue = `new NaslLong('${defaultValue}')`;
|
|
337
|
-
code += `${parsedValue}`;
|
|
338
|
-
} else {
|
|
339
|
-
code += `${JSON.stringify(parsedValue)}`;
|
|
340
|
-
}
|
|
320
|
+
code += JSON.stringify(parsedValue);
|
|
341
321
|
if (needGenInitFromSchema) {
|
|
342
322
|
code += `)`;
|
|
343
323
|
}
|
|
@@ -1579,9 +1579,8 @@ export class ViewElement extends BaseNode {
|
|
|
1579
1579
|
code += `${self.name}: nasl.ui.${self.toHump(self.tag)}<any, any>;\n`;
|
|
1580
1580
|
} else if (Object.keys(PAGE_COMPONENT_INCLUDE_TAG_MAP).includes(self.tag)) {
|
|
1581
1581
|
if (self.bindAttrs?.findIndex((attr) => attr.name === 'data-source') > -1) {
|
|
1582
|
-
code += `${self.name}: nasl.ui.${self.toHump(self.tag)}<__elements_completionProperty['${
|
|
1583
|
-
|
|
1584
|
-
}']['dataSource']>;\n`;
|
|
1582
|
+
code += `${self.name}: nasl.ui.${self.toHump(self.tag)}<__elements_completionProperty['${self.name
|
|
1583
|
+
}']['dataSource']>;\n`;
|
|
1585
1584
|
} else {
|
|
1586
1585
|
code += `${self.name}: nasl.ui.${self.toHump(self.tag)}<any>;\n`;
|
|
1587
1586
|
}
|
|
@@ -1660,9 +1659,8 @@ export class ViewElement extends BaseNode {
|
|
|
1660
1659
|
const _this = self.parentNode;
|
|
1661
1660
|
let genericity = '';
|
|
1662
1661
|
if (_this.tag === 'u-table-view-column-dynamic') {
|
|
1663
|
-
genericity += `<${(_this.parentNode as any).__tsVariableDataSourceTypeName}, ${
|
|
1664
|
-
|
|
1665
|
-
}>`;
|
|
1662
|
+
genericity += `<${(_this.parentNode as any).__tsVariableDataSourceTypeName}, ${(_this as any).__tsVariableDataSourceTypeName
|
|
1663
|
+
}>`;
|
|
1666
1664
|
} else {
|
|
1667
1665
|
let targetNode: any = _this;
|
|
1668
1666
|
while (!targetNode.__tsVariableDataSourceTypeName && targetNode?.parentNode instanceof ViewElement) {
|
|
@@ -1703,6 +1701,8 @@ export class ViewElement extends BaseNode {
|
|
|
1703
1701
|
code += `type ${datasourceName} = nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof __funcName>>;\n`;
|
|
1704
1702
|
// code += `let current${levelIndex === 0 ? '' : levelIndex}: nasl.ui.${currentType}<nasl.ui.GetItemTypeFromDataSource<ReturnType<typeof __funcName>>>;\n`;
|
|
1705
1703
|
}
|
|
1704
|
+
} else {
|
|
1705
|
+
(self as any).__tsVariableDataSourceTypeName = 'any';
|
|
1706
1706
|
}
|
|
1707
1707
|
code += indent((state?.tabSize || 0) + 3);
|
|
1708
1708
|
code += `return {\n`;
|
|
@@ -2618,13 +2618,6 @@ export class ViewElement extends BaseNode {
|
|
|
2618
2618
|
return null;
|
|
2619
2619
|
}
|
|
2620
2620
|
|
|
2621
|
-
// 获取双向绑定的属性
|
|
2622
|
-
getSyncBindAttrs() {
|
|
2623
|
-
return (this.bindAttrs || []).filter((bindAttr) => {
|
|
2624
|
-
return !bindAttr?.shouldExcluded && bindAttr?.sync && bindAttr?.expression;
|
|
2625
|
-
});
|
|
2626
|
-
}
|
|
2627
|
-
|
|
2628
2621
|
/**
|
|
2629
2622
|
* 转换成 Vue 的模板格式
|
|
2630
2623
|
*/
|
|
@@ -2714,22 +2707,9 @@ export class ViewElement extends BaseNode {
|
|
|
2714
2707
|
return;
|
|
2715
2708
|
}
|
|
2716
2709
|
|
|
2717
|
-
result &&
|
|
2718
|
-
});
|
|
2719
|
-
if (options?.finalCode !== false) {
|
|
2720
|
-
const eventNames: string[] = [];
|
|
2721
|
-
(this.bindEvents || []).forEach((bindEvent) => {
|
|
2722
|
-
eventNames.push(bindEvent?.name);
|
|
2710
|
+
result && parts.push(result);
|
|
2723
2711
|
});
|
|
2724
|
-
|
|
2725
|
-
(syncBindAttrs || []).forEach((bindAttr) => {
|
|
2726
|
-
const syncEventName = bindAttr.syncEventName;
|
|
2727
|
-
if (!eventNames.includes(syncEventName)) {
|
|
2728
|
-
const argsList = ['$event', ...(bindAttr.getArgsList() || [])];
|
|
2729
|
-
parts.push(`@${syncEventName}="${bindAttr.syncMethodName}(${argsList.join(', ')})"`);
|
|
2730
|
-
}
|
|
2731
|
-
});
|
|
2732
|
-
}
|
|
2712
|
+
|
|
2733
2713
|
if (vIfs.length === 2) parts.push(`v-if="(${vIfs[0]}) && (${vIfs[1]})"`);
|
|
2734
2714
|
else if (vIfs.length === 1) parts.push(`v-if="${vIfs[0]}"`);
|
|
2735
2715
|
|
|
@@ -2737,62 +2717,7 @@ export class ViewElement extends BaseNode {
|
|
|
2737
2717
|
if (bindStyles) parts.push(bindStyles);
|
|
2738
2718
|
|
|
2739
2719
|
newOptions.getExtraParts(this).forEach((part) => parts.push(part));
|
|
2740
|
-
if (["u-number-input", 'van-stepper-new'].includes(this.tag)) {
|
|
2741
|
-
// cloudUI
|
|
2742
|
-
// :step="${step}" :decimalLength="${decimalLength}"
|
|
2743
|
-
// :decimal-places="{ places:${decimalLength}, omit:false }" //这个属性单独存在 需要测试
|
|
2744
|
-
// vant
|
|
2745
|
-
// step="${step}" :decimal-length="${decimalLength}"
|
|
2746
|
-
const checkAttr = (attrName: string) => {
|
|
2747
|
-
let value = this.bindAttrs?.find(attr => attr?.name === attrName)?.value
|
|
2748
|
-
return value && (value !== 'undefined')
|
|
2749
|
-
}
|
|
2750
|
-
let hasdecimalLength = (checkAttr("decimal-length") || checkAttr("decimalLength"))
|
|
2751
|
-
let valueAttr = this.bindAttrs?.find(attr => attr?.name === "value")
|
|
2752
|
-
const getNumberType = (attr: any) => {
|
|
2753
|
-
let { typeName, typeNamespace } = attr?.expression?.__nodeType || {}
|
|
2754
|
-
return typeName;
|
|
2755
|
-
}
|
|
2756
|
-
let numberType = getNumberType(valueAttr)
|
|
2757
|
-
const pushDecimalLeng = (len: number, variableName?: string) => {
|
|
2758
|
-
if (!(checkAttr("decimal-length") || checkAttr("decimalLength"))) {
|
|
2759
|
-
// 值分 动态 非动态
|
|
2760
|
-
// 1 有默认值 没有设置组件精度 : 取默认值的length
|
|
2761
|
-
// 2 无默认值无精度 取2
|
|
2762
|
-
// 3 无默认值 有精度 取精度
|
|
2763
|
-
if (variableName && variableName.length > 0) {
|
|
2764
|
-
parts.push(`:decimal-length="${len}"`)
|
|
2765
|
-
// parts.push(`:decimal-length="${variableName}.length"`)
|
|
2766
|
-
} else {
|
|
2767
|
-
parts.push(`:decimal-length="${len}"`)
|
|
2768
|
-
}
|
|
2769
|
-
}
|
|
2770
|
-
};
|
|
2771
|
-
// 许彤需求 不需要 number-input 的精度属性 要跟之前反着写 有就删除 不允许翻译
|
|
2772
|
-
if (hasdecimalLength) {
|
|
2773
|
-
// parts.delete(`:decimal-length="${len}"`)
|
|
2774
|
-
}
|
|
2775
2720
|
|
|
2776
|
-
// if (!hasdecimalLength) {
|
|
2777
|
-
|
|
2778
|
-
// if (valueAttr?.type === "dynamic" && numberType) {
|
|
2779
|
-
// if (numberType == 'Decimal') {
|
|
2780
|
-
// let variableName = ''
|
|
2781
|
-
// if (valueAttr?.expression) {
|
|
2782
|
-
// variableName = valueAttr?.expression?.name
|
|
2783
|
-
// }
|
|
2784
|
-
// pushDecimalLeng(2, variableName)
|
|
2785
|
-
// !checkAttr("step") && parts.push(`:step="0.01"`);
|
|
2786
|
-
// } else {
|
|
2787
|
-
// pushDecimalLeng(0)
|
|
2788
|
-
// }
|
|
2789
|
-
// } else {
|
|
2790
|
-
// pushDecimalLeng(0)
|
|
2791
|
-
|
|
2792
|
-
// }
|
|
2793
|
-
// }
|
|
2794
|
-
!checkAttr("highPrecision") && parts.push(`:highPrecision="true"`);
|
|
2795
|
-
}
|
|
2796
2721
|
if (['u-modal', 'u-drawer'].includes(this.tag)) {
|
|
2797
2722
|
this.children.forEach((citem) => {
|
|
2798
2723
|
if (citem.tag === 'template' && !citem.children.length) {
|
package/src/concepts/View__.ts
CHANGED
|
@@ -25,12 +25,11 @@ import Match from './Match__';
|
|
|
25
25
|
import BatchAssignment from './BatchAssignment__';
|
|
26
26
|
import CallInterface from './CallInterface__';
|
|
27
27
|
import CallLogic from './CallLogic__';
|
|
28
|
-
import BindAttribute from './BindAttribute__';
|
|
29
|
-
const getBranchCopyUniCode = () => (window as any)?.BranchCopyUniCode
|
|
30
28
|
|
|
31
|
-
const
|
|
29
|
+
const getBranchCopyUniCode = () => (window as any)?.BranchCopyUniCode
|
|
30
|
+
const removedViewElementCache : {
|
|
32
31
|
[key: string]: number | bigint;
|
|
33
|
-
}
|
|
32
|
+
}= {} // 临时记录删除的页面元素计数的最大值
|
|
34
33
|
|
|
35
34
|
//================================================================================
|
|
36
35
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -1583,7 +1582,7 @@ export class View extends BaseNode {
|
|
|
1583
1582
|
}
|
|
1584
1583
|
const newPrefix = newName.replace(/\d*$/, '');
|
|
1585
1584
|
const newPrefixNum = removedViewElementCache?.[newPrefix] ? removedViewElementCache[newPrefix] : 1
|
|
1586
|
-
const startNum = newPrefixNum < Number.MAX_SAFE_INTEGER ?
|
|
1585
|
+
const startNum = newPrefixNum < Number.MAX_SAFE_INTEGER ? newPrefixNum as number + 1 : BigInt(newPrefixNum) + BigInt(1);
|
|
1587
1586
|
const viewElementUniqueName = utils.uniqueMax(newName, this.existingViewElement, removedViewElementCache?.[newPrefix] ? startNum : newPrefixNum);
|
|
1588
1587
|
this.existingViewElement.add(viewElementUniqueName);
|
|
1589
1588
|
return viewElementUniqueName;
|
|
@@ -1835,7 +1834,6 @@ export class View extends BaseNode {
|
|
|
1835
1834
|
first: this.children.find((child) => child.isIndex)?.name,
|
|
1836
1835
|
auth: this.auth ? 'loginAuth' : undefined,
|
|
1837
1836
|
viewBindEvents: this.getViewBindEvents(),
|
|
1838
|
-
viewBindSyncAttrs: this.getViewBindSyncAttrs(),
|
|
1839
1837
|
viewExpressions: this.getViewExpressions(),
|
|
1840
1838
|
elements: componentList,
|
|
1841
1839
|
elementsAll: componentListExtra,
|
|
@@ -1854,15 +1852,15 @@ export class View extends BaseNode {
|
|
|
1854
1852
|
methods: {
|
|
1855
1853
|
async onKeyDown(e) {
|
|
1856
1854
|
${this.bindEvents
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1855
|
+
.filter((event) => ['keydown'].includes(event.name))
|
|
1856
|
+
.map((event) => `await this.${event.view.name}_${event.name}(e);`)
|
|
1857
|
+
.join('\n')}
|
|
1860
1858
|
},
|
|
1861
1859
|
async onKeyUp(e) {
|
|
1862
1860
|
${this.bindEvents
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1861
|
+
.filter((event) => ['keyup'].includes(event.name))
|
|
1862
|
+
.map((event) => `await this.${event.view.name}_${event.name}(e);`)
|
|
1863
|
+
.join('\n')}
|
|
1866
1864
|
}
|
|
1867
1865
|
}
|
|
1868
1866
|
};`;
|
|
@@ -1887,7 +1885,7 @@ export class View extends BaseNode {
|
|
|
1887
1885
|
code += translator(definition, this);
|
|
1888
1886
|
code += '};\n';
|
|
1889
1887
|
return code;
|
|
1890
|
-
|
|
1888
|
+
}
|
|
1891
1889
|
|
|
1892
1890
|
genVueTemplate(options?: ElementToVueOptions) {
|
|
1893
1891
|
return this.elements?.map((element) => `${element?.toVue(options)}\n`).join('');
|
|
@@ -2006,7 +2004,9 @@ export class View extends BaseNode {
|
|
|
2006
2004
|
elementsAttrsAll(elements: Array<ViewElement>, componentListExtra: Array<ViewElement>) {
|
|
2007
2005
|
if (elements) {
|
|
2008
2006
|
elements.forEach((item: ViewElement) => {
|
|
2009
|
-
|
|
2007
|
+
if (!PAGE_COMPONENT_INCLUDE_TAG_MAP?.[item.tag]) {
|
|
2008
|
+
componentListExtra.push(item);
|
|
2009
|
+
}
|
|
2010
2010
|
if (item.children.length > 0) {
|
|
2011
2011
|
this.elementsAttrsAll(item.children, componentListExtra);
|
|
2012
2012
|
}
|
|
@@ -2469,20 +2469,6 @@ ${indent(state.tabSize)}export function ${this.tsName}_view`;
|
|
|
2469
2469
|
return bindEvents;
|
|
2470
2470
|
}
|
|
2471
2471
|
|
|
2472
|
-
// 获取页面内所有开启了双向绑定的属性
|
|
2473
|
-
getViewBindSyncAttrs() {
|
|
2474
|
-
const bindSyncAttrs: BindAttribute[] = [];
|
|
2475
|
-
this.elements.forEach((item) => {
|
|
2476
|
-
utils.traverse(
|
|
2477
|
-
(current) => {
|
|
2478
|
-
bindSyncAttrs.push(...(current.node as ViewElement).getSyncBindAttrs())
|
|
2479
|
-
},
|
|
2480
|
-
{ node: item },
|
|
2481
|
-
);
|
|
2482
|
-
});
|
|
2483
|
-
return bindSyncAttrs;
|
|
2484
|
-
}
|
|
2485
|
-
|
|
2486
2472
|
// 获取页面上需要替换的表达式
|
|
2487
2473
|
getViewExpressions() {
|
|
2488
2474
|
const bindExpressions: any[] = [];
|
|
@@ -2607,7 +2593,7 @@ ${indent(state.tabSize)}export function ${this.tsName}_view`;
|
|
|
2607
2593
|
|
|
2608
2594
|
const prefix = viewElement?.name.replace(/\d*$/, '');
|
|
2609
2595
|
let lastDigit = viewElement?.name.match(/\d+$/)?.[0];
|
|
2610
|
-
if
|
|
2596
|
+
if(lastDigit === undefined) return;
|
|
2611
2597
|
|
|
2612
2598
|
//@ts-ignore
|
|
2613
2599
|
lastDigit = lastDigit < Number.MAX_SAFE_INTEGER ? parseInt(lastDigit) : BigInt(lastDigit);
|
|
@@ -2615,9 +2601,9 @@ ${indent(state.tabSize)}export function ${this.tsName}_view`;
|
|
|
2615
2601
|
if (removedViewElementCache?.[prefix]) {
|
|
2616
2602
|
//@ts-ignore
|
|
2617
2603
|
if (lastDigit > removedViewElementCache[prefix])
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
}
|
|
2604
|
+
//@ts-ignore
|
|
2605
|
+
removedViewElementCache[prefix] = lastDigit;
|
|
2606
|
+
}else {
|
|
2621
2607
|
//@ts-ignore
|
|
2622
2608
|
removedViewElementCache[prefix] = lastDigit;
|
|
2623
2609
|
}
|
|
@@ -71,13 +71,11 @@ export function genCreateFormTemplate(entity: Entity, nameGroup: NameGroup, sele
|
|
|
71
71
|
</u-select>
|
|
72
72
|
`;
|
|
73
73
|
} else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
|
|
74
|
-
|
|
75
|
-
formItem += `<u-number-input v-model="${vModel}" :highPrecision="true" :step="${step}" placeholder="请输入${label}"></u-number-input>`;
|
|
74
|
+
formItem += `<u-number-input v-model="${vModel}" placeholder="请输入${label}"></u-number-input>`;
|
|
76
75
|
} else if (propertyTypeName === 'Double') {
|
|
77
76
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
78
77
|
} else if (propertyTypeName === 'Decimal') {
|
|
79
|
-
|
|
80
|
-
formItem += `<u-number-input v-model="${vModel}" :highPrecision="true" :step="${step}" placeholder="请输入${label}"></u-number-input>`
|
|
78
|
+
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
81
79
|
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 256) {
|
|
82
80
|
formItem += `<u-textarea v-model="${vModel}" placeholder="请输入${label}"></u-textarea>`;
|
|
83
81
|
} else if (propertyTypeName === 'Date') {
|
|
@@ -151,15 +149,13 @@ export function genH5CreateFormTemplate(entity: Entity, nameGroup: NameGroup, se
|
|
|
151
149
|
} else if (propertyTypeName === 'Boolean') {
|
|
152
150
|
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-switch v-model="${vModel}"></van-switch></van-linear-layout></template>`;
|
|
153
151
|
} else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
|
|
154
|
-
|
|
155
|
-
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-stepper-new :highPrecision="true" step="${step}" v-model="${vModel}" placeholder="请输入${property.label || property.name
|
|
152
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-stepper-new v-model="${vModel}" placeholder="请输入${property.label || property.name
|
|
156
153
|
}" :showPlus="false" :showMinus="false" align="left"></van-stepper-new></van-linear-layout></template>`;
|
|
157
154
|
} else if (propertyTypeName === 'Double') {
|
|
158
|
-
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-stepper-new
|
|
155
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-stepper-new v-model="${vModel}" placeholder="请输入${property.label || property.name
|
|
159
156
|
}" :showPlus="false" :showMinus="false" align="left"></van-stepper-new></van-linear-layout></template>`;
|
|
160
157
|
} else if (propertyTypeName === 'Decimal') {
|
|
161
|
-
|
|
162
|
-
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-stepper-new :highPrecision="true" step="${step}" v-model="${vModel}" placeholder="请输入${property.label || property.name
|
|
158
|
+
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-stepper-new v-model="${vModel}" placeholder="请输入${property.label || property.name
|
|
163
159
|
}" :showPlus="false" :showMinus="false" align="left"></van-stepper-new></van-linear-layout></template>`;
|
|
164
160
|
} else if (propertyTypeName === 'Text') {
|
|
165
161
|
formItem += `<template #input><van-linear-layout style="width:100%;" direction="horizontal"><van-fieldtextarea v-model="${vModel}" placeholder="请输入${property.label || property.name
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import * as utils from '../utils';
|
|
7
7
|
import { App, Module, Namespace, Entity, View, Enum, DataSource, ViewElement, EntityProperty } from '../concepts';
|
|
8
|
-
import { NaslCoreTypeAnnotation, NaslUITypeAnnotation, NaslTypeAnnotation, NaslLogicItem, NaslNode
|
|
8
|
+
import { NaslCoreTypeAnnotation, NaslUITypeAnnotation, NaslTypeAnnotation, NaslLogicItem, NaslNode } from './utils';
|
|
9
9
|
import {
|
|
10
10
|
filterProperty,
|
|
11
11
|
NameGroup,
|
|
@@ -39,8 +39,7 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
39
39
|
let formItem = `<u-form-item layout="center"><template #label><u-text text="${label}"></u-text></template>`;
|
|
40
40
|
|
|
41
41
|
const { typeAnnotation } = property || {};
|
|
42
|
-
const { typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
43
|
-
const propertyTypeName = transEntityMetadataTypes(typeAnnotation, dataSource.app);
|
|
42
|
+
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
44
43
|
const propertyTypeMaxLength: number =
|
|
45
44
|
Number(
|
|
46
45
|
property.rules
|
|
@@ -75,13 +74,11 @@ function genFilterTemplate(entity: Entity, nameGroup: NameGroup, selectNameGroup
|
|
|
75
74
|
</u-select>
|
|
76
75
|
`;
|
|
77
76
|
} else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
|
|
78
|
-
|
|
79
|
-
formItem += `<u-number-input v-model="${vModel}" :highPrecision="true" :step="${step}" placeholder="请输入${label}"></u-number-input>`;
|
|
77
|
+
formItem += `<u-number-input v-model="${vModel}" placeholder="请输入${label}"></u-number-input>`;
|
|
80
78
|
} else if (propertyTypeName === 'Double') {
|
|
81
79
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
82
80
|
} else if (propertyTypeName === 'Decimal') {
|
|
83
|
-
|
|
84
|
-
formItem += `<u-number-input v-model="${vModel}" :highPrecision="true" :step="${step}" placeholder="请输入${label}"></u-number-input>`
|
|
81
|
+
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
85
82
|
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 256) {
|
|
86
83
|
formItem += `<u-textarea v-model="${vModel}" placeholder="请输入${label}"></u-textarea>`;
|
|
87
84
|
} else if (propertyTypeName === 'Date') {
|
|
@@ -146,8 +143,7 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
146
143
|
><template #label><u-text text="${label}"></u-text></template>`;
|
|
147
144
|
|
|
148
145
|
const { typeAnnotation } = property || {};
|
|
149
|
-
const { typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
150
|
-
const propertyTypeName = transEntityMetadataTypes(typeAnnotation, dataSource.app);
|
|
146
|
+
const { typeName: propertyTypeName, typeNamespace: propertyTypeNamespace } = typeAnnotation || {};
|
|
151
147
|
const propertyTypeMaxLength: number =
|
|
152
148
|
Number(
|
|
153
149
|
property.rules
|
|
@@ -181,12 +177,11 @@ function genSaveModalTemplate(entity: Entity, nameGroup: NameGroup, selectNameGr
|
|
|
181
177
|
<u-select-item :value="false" text="否">否</u-select-item>
|
|
182
178
|
</u-select>`;
|
|
183
179
|
} else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
|
|
184
|
-
formItem += `<u-number-input v-model="${vModel}"
|
|
180
|
+
formItem += `<u-number-input v-model="${vModel}" placeholder="请输入${label}"></u-number-input>`;
|
|
185
181
|
} else if (propertyTypeName === 'Double') {
|
|
186
182
|
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
187
183
|
} else if (propertyTypeName === 'Decimal') {
|
|
188
|
-
|
|
189
|
-
formItem += `<u-number-input v-model="${vModel}" :highPrecision="true" :step="${step}" placeholder="请输入${label}"></u-number-input>`
|
|
184
|
+
formItem += `<u-number-input v-model="${vModel}" :precision="0" :step="0" placeholder="请输入${label}"></u-number-input>`;
|
|
190
185
|
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 256) {
|
|
191
186
|
formItem += `<u-textarea v-model="${vModel}" placeholder="请输入${label}"></u-textarea>`;
|
|
192
187
|
} else if (propertyTypeName === 'Date') {
|
|
@@ -413,8 +408,8 @@ export function genEditTableColumnComponent(app: App, entity: Entity, property:
|
|
|
413
408
|
const label = (property.label || property.name).replace(/"/g, '"');
|
|
414
409
|
let formItem = '';
|
|
415
410
|
|
|
411
|
+
const propertyTypeName = property.typeAnnotation.typeName;
|
|
416
412
|
const propertyTypeNamespace = property.typeAnnotation.typeNamespace;
|
|
417
|
-
const propertyTypeName = transEntityMetadataTypes(property.typeAnnotation, dataSource.app);
|
|
418
413
|
const propertyTypeMaxLength: number =
|
|
419
414
|
Number(
|
|
420
415
|
property.rules
|
|
@@ -459,12 +454,11 @@ export function genEditTableColumnComponent(app: App, entity: Entity, property:
|
|
|
459
454
|
<u-select-item :value="false" text="否">否</u-select-item>
|
|
460
455
|
</u-select>`;
|
|
461
456
|
} else if (propertyTypeName === 'Integer' || propertyTypeName === 'Long') {
|
|
462
|
-
formItem = `<u-number-input :value.sync="${valueExpression}"
|
|
457
|
+
formItem = `<u-number-input :value.sync="${valueExpression}" placeholder="请输入${label}" :autofocus="true" @blur="${nameGroup.viewLogicBlurUpdate}"></u-number-input>`;
|
|
463
458
|
} else if (propertyTypeName === 'Double') {
|
|
464
459
|
formItem = `<u-number-input :value.sync="${valueExpression}" :precision="0" :step="0" placeholder="请输入${label}" :autofocus="true" @blur="${nameGroup.viewLogicBlurUpdate}"></u-number-input>`;
|
|
465
460
|
} else if (propertyTypeName === 'Decimal') {
|
|
466
|
-
|
|
467
|
-
formItem = `<u-number-input :value.sync="${valueExpression}" :highPrecision="true" :step="${step}" placeholder="请输入${label}" :autofocus="true" @blur="${nameGroup.viewLogicBlurUpdate}"></u-number-input>`;
|
|
461
|
+
formItem = `<u-number-input :value.sync="${valueExpression}" :precision="0" :step="0" placeholder="请输入${label}" :autofocus="true" @blur="${nameGroup.viewLogicBlurUpdate}"></u-number-input>`;
|
|
468
462
|
} else if (propertyTypeName === 'String' && propertyTypeMaxLength > 256) {
|
|
469
463
|
formItem = `<u-validator placement="bottom" display="appear" @blur-valid="${nameGroup.viewLogicBlurUpdate}" style="width:100%">
|
|
470
464
|
<u-textarea :value.sync="${valueExpression}" placeholder="请输入${label}" :autofocus="true" size="full"></u-textarea>
|