@lcap/nasl 3.6.0-alpha.4 → 3.6.0-alpha.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/50a74696-517e-4e22-8a16-9eeecc5ae7c2.json +1 -0
- package/.nyc_output/processinfo/50a74696-517e-4e22-8a16-9eeecc5ae7c2.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/cobertura-coverage.xml +6417 -0
- package/coverage/index.html +127 -127
- package/coverage/src/automate/engine/index.html +1 -1
- package/coverage/src/automate/engine/utils.js.html +28 -28
- package/coverage/src/bak/index.html +19 -19
- package/coverage/src/bak/translator.js.html +59 -293
- package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +8 -44
- package/coverage/src/breakpoint/generator/CallbackNode.ts.html +10 -61
- package/coverage/src/breakpoint/generator/index.html +26 -26
- package/coverage/src/breakpoint/generator/index.ts.html +1 -1
- package/coverage/src/breakpoint/index.html +1 -1
- package/coverage/src/breakpoint/index.ts.html +1 -1
- package/coverage/src/breakpoint/shared/constants.ts.html +2 -8
- package/coverage/src/breakpoint/shared/index.html +12 -12
- package/coverage/src/breakpoint/shared/index.ts.html +1 -1
- package/coverage/src/breakpoint/shared/operations.ts.html +4 -4
- package/coverage/src/breakpoint/shared/socket.ts.html +1 -1
- package/coverage/src/breakpoint/shared/utils.ts.html +80 -29
- package/coverage/src/breakpoint/store/core.ts.html +12 -12
- package/coverage/src/breakpoint/store/dock.ts.html +1 -1
- package/coverage/src/breakpoint/store/index.html +1 -1
- package/coverage/src/breakpoint/store/index.ts.html +1 -1
- package/coverage/src/common/BaseNode.ts.html +235 -259
- package/coverage/src/common/Command.ts.html +6 -9
- package/coverage/src/common/EventEmitter.ts.html +34 -19
- package/coverage/src/common/Messager.ts.html +1 -1
- package/coverage/src/common/asyncFuncMap.ts.html +1 -1
- package/coverage/src/common/index.html +28 -28
- package/coverage/src/common/index.ts.html +1 -1
- package/coverage/src/common/utils.ts.html +1 -1
- package/coverage/src/concepts/Abort__.ts.html +2 -2
- package/coverage/src/concepts/AbstractInterface__.ts.html +6 -6
- package/coverage/src/concepts/Anchor__.ts.html +3 -3
- package/coverage/src/concepts/AnonymousFunction__.ts.html +69 -123
- package/coverage/src/concepts/App__.ts.html +194 -623
- package/coverage/src/concepts/Argument__.ts.html +30 -30
- package/coverage/src/concepts/Assignee__.ts.html +3 -3
- package/coverage/src/concepts/AssignmentLine__.ts.html +8 -8
- package/coverage/src/concepts/Assignment__.ts.html +9 -9
- package/coverage/src/concepts/Attribute__.ts.html +2 -2
- package/coverage/src/concepts/AuthInterface__.ts.html +2 -2
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +3 -3
- package/coverage/src/concepts/AuthLogic__.ts.html +2 -2
- package/coverage/src/concepts/BackendVariable__.ts.html +11 -35
- package/coverage/src/concepts/Backend__.ts.html +7 -7
- package/coverage/src/concepts/BatchAssignment__.ts.html +3 -3
- package/coverage/src/concepts/BinaryExpression__.ts.html +26 -38
- package/coverage/src/concepts/BindAttribute__.ts.html +15 -60
- package/coverage/src/concepts/BindDirective__.ts.html +20 -65
- package/coverage/src/concepts/BindEvent__.ts.html +31 -115
- package/coverage/src/concepts/BindStyle__.ts.html +3 -3
- package/coverage/src/concepts/Block__.ts.html +3 -3
- package/coverage/src/concepts/BooleanLiteral__.ts.html +8 -8
- package/coverage/src/concepts/CallAuthInterface__.ts.html +3 -3
- package/coverage/src/concepts/CallConnector__.ts.html +2 -2
- package/coverage/src/concepts/CallFunction__.ts.html +88 -97
- package/coverage/src/concepts/CallInterface__.ts.html +60 -75
- package/coverage/src/concepts/CallLogic__.ts.html +111 -87
- package/coverage/src/concepts/CallQueryComponent__.ts.html +303 -57
- package/coverage/src/concepts/Comment__.ts.html +2 -2
- package/coverage/src/concepts/CompletionProperty__.ts.html +2 -2
- package/coverage/src/concepts/ConfigGroup__.ts.html +8 -8
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +2 -2
- package/coverage/src/concepts/ConfigProperty__.ts.html +3 -3
- package/coverage/src/concepts/Configuration__.ts.html +9 -9
- package/coverage/src/concepts/Connection__.ts.html +3 -3
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +2 -2
- package/coverage/src/concepts/Connector__.ts.html +3 -3
- package/coverage/src/concepts/Constant__.ts.html +18 -12
- package/coverage/src/concepts/CountersignPolicy__.ts.html +2 -2
- package/coverage/src/concepts/DataSource__.ts.html +3 -3
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +2 -2
- package/coverage/src/concepts/DefaultValue__.ts.html +3 -3
- package/coverage/src/concepts/Destination__.ts.html +12 -18
- package/coverage/src/concepts/End__.ts.html +10 -13
- package/coverage/src/concepts/EntityIndex__.ts.html +2 -2
- package/coverage/src/concepts/EntityProperty__.ts.html +3 -3
- package/coverage/src/concepts/Entity__.ts.html +4 -10
- package/coverage/src/concepts/EnumItem__.ts.html +2 -2
- package/coverage/src/concepts/Enum__.ts.html +3 -3
- package/coverage/src/concepts/Event__.ts.html +12 -222
- package/coverage/src/concepts/ExternalDestination__.ts.html +3 -3
- package/coverage/src/concepts/ForEachStatement__.ts.html +3 -3
- package/coverage/src/concepts/FrontendLibrary__.ts.html +3 -3
- package/coverage/src/concepts/FrontendVariable__.ts.html +2 -2
- package/coverage/src/concepts/Frontend__.ts.html +770 -26
- package/coverage/src/concepts/Function__.ts.html +10 -10
- package/coverage/src/concepts/I18nInfo__.ts.html +2 -2
- package/coverage/src/concepts/Identifier__.ts.html +54 -102
- package/coverage/src/concepts/IfStatement__.ts.html +3 -3
- package/coverage/src/concepts/ImportedInterface__.ts.html +6 -6
- package/coverage/src/concepts/Integration__.ts.html +3 -3
- package/coverage/src/concepts/InterfaceParam__.ts.html +7 -7
- package/coverage/src/concepts/Interface__.ts.html +31 -73
- package/coverage/src/concepts/JSBlock__.ts.html +2 -2
- package/coverage/src/concepts/JavaLogic__.ts.html +2 -2
- package/coverage/src/concepts/LogicItem__.ts.html +11 -17
- package/coverage/src/concepts/Logic__.ts.html +150 -267
- package/coverage/src/concepts/MatchCase__.ts.html +3 -3
- package/coverage/src/concepts/Match__.ts.html +3 -3
- package/coverage/src/concepts/MemberExpression__.ts.html +22 -22
- package/coverage/src/concepts/MetadataType__.ts.html +3 -3
- package/coverage/src/concepts/MicroApp__.ts.html +2 -2
- package/coverage/src/concepts/Module__.ts.html +20 -20
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +3 -3
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +3 -3
- package/coverage/src/concepts/MultiApprovalPolicy__.ts.html +2 -2
- package/coverage/src/concepts/Namespace__.ts.html +20 -20
- package/coverage/src/concepts/NewComposite__.ts.html +232 -226
- package/coverage/src/concepts/NewList__.ts.html +103 -115
- package/coverage/src/concepts/NewMap__.ts.html +158 -167
- package/coverage/src/concepts/New__.ts.html +2 -2
- package/coverage/src/concepts/NullLiteral__.ts.html +2 -2
- package/coverage/src/concepts/NumericLiteral__.ts.html +14 -14
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +2 -2
- package/coverage/src/concepts/OverriddenLogic__.ts.html +3 -3
- package/coverage/src/concepts/Param__.ts.html +32 -56
- package/coverage/src/concepts/Point__.ts.html +2 -2
- package/coverage/src/concepts/ProcessComponent__.ts.html +3 -3
- package/coverage/src/concepts/ProcessElement__.ts.html +8 -29
- package/coverage/src/concepts/ProcessOutcome__.ts.html +2 -2
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +2 -2
- package/coverage/src/concepts/Process__.ts.html +3 -3
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +2 -2
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +2 -2
- package/coverage/src/concepts/QueryFromExpression__.ts.html +3 -3
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +2 -2
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +3 -3
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +6 -6
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +2 -2
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +3 -3
- package/coverage/src/concepts/Rect__.ts.html +2 -2
- package/coverage/src/concepts/Return__.ts.html +36 -45
- package/coverage/src/concepts/Role__.ts.html +2 -2
- package/coverage/src/concepts/SelectMembers__.ts.html +9 -9
- package/coverage/src/concepts/SequentialPolicy__.ts.html +2 -2
- package/coverage/src/concepts/Slot__.ts.html +2 -2
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +2 -2
- package/coverage/src/concepts/Start__.ts.html +7 -7
- package/coverage/src/concepts/StaticString__.ts.html +2 -2
- package/coverage/src/concepts/StringInterpolation__.ts.html +3 -3
- package/coverage/src/concepts/StringLiteral__.ts.html +18 -18
- package/coverage/src/concepts/StructureProperty__.ts.html +9 -9
- package/coverage/src/concepts/Structure__.ts.html +9 -9
- package/coverage/src/concepts/SwitchCase__.ts.html +3 -3
- package/coverage/src/concepts/SwitchStatement__.ts.html +3 -3
- package/coverage/src/concepts/Theme__.ts.html +9 -9
- package/coverage/src/concepts/Transactional__.ts.html +2 -2
- package/coverage/src/concepts/TriggerEvent__.ts.html +2 -2
- package/coverage/src/concepts/TriggerLauncher__.ts.html +2 -2
- package/coverage/src/concepts/TypeAnnotation__.ts.html +37 -37
- package/coverage/src/concepts/TypeParam__.ts.html +2 -2
- package/coverage/src/concepts/UnaryExpression__.ts.html +2 -2
- package/coverage/src/concepts/Unparsed__.ts.html +2 -2
- package/coverage/src/concepts/UseComponent__.ts.html +2 -2
- package/coverage/src/concepts/ValidationRule__.ts.html +6 -21
- package/coverage/src/concepts/Variable__.ts.html +29 -53
- package/coverage/src/concepts/ViewBlock__.ts.html +2 -2
- package/coverage/src/concepts/ViewComponent__.ts.html +3 -3
- package/coverage/src/concepts/ViewElement__.ts.html +61 -535
- package/coverage/src/concepts/View__.ts.html +60 -69
- package/coverage/src/concepts/WhileStatement__.ts.html +3 -3
- package/coverage/src/concepts/basics/constants.ts.html +1 -1
- package/coverage/src/concepts/basics/index.html +1 -1
- package/coverage/src/concepts/basics/stdlib/index.html +1 -1
- package/coverage/src/concepts/basics/stdlib/index.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +32 -32
- package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +2 -2
- package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +1 -1
- package/coverage/src/concepts/basics/types/coreTypeList.ts.html +1 -1
- package/coverage/src/concepts/basics/types/index.html +1 -1
- package/coverage/src/concepts/basics/types/index.ts.html +1 -1
- package/coverage/src/concepts/index.html +239 -329
- package/coverage/src/concepts/index.ts.html +2 -2
- package/coverage/src/concepts/index__.ts.html +4 -22
- package/coverage/src/concepts/utils/asserts.ts.html +26 -1334
- package/coverage/src/concepts/utils/index.html +18 -33
- package/coverage/src/concepts/utils/types.ts.html +2 -101
- package/coverage/src/config.ts.html +2 -2
- package/coverage/src/decorators/index.html +18 -18
- package/coverage/src/decorators/index.ts.html +57 -42
- package/coverage/src/decorators/promise.ts.html +1 -1
- package/coverage/src/eventBus.ts.html +1 -1
- package/coverage/src/generator/compileComponent.ts.html +1 -1
- package/coverage/src/generator/genBundleFiles.ts.html +45 -180
- package/coverage/src/generator/genHash.ts.html +2 -2
- package/coverage/src/generator/genMetaData.ts.html +11 -14
- package/coverage/src/generator/genReleaseBody.ts.html +13 -46
- package/coverage/src/generator/icestark.ts.html +1 -1
- package/coverage/src/generator/index.html +36 -36
- package/coverage/src/generator/index.ts.html +1 -1
- package/coverage/src/generator/microApp.ts.html +1 -1
- package/coverage/src/generator/permission.ts.html +10 -16
- package/coverage/src/generator/qiankun.ts.html +1 -1
- package/coverage/src/generator/styleReplacer.ts.html +1 -1
- package/coverage/src/index.html +1 -1
- package/coverage/src/index.ts.html +2 -2
- package/coverage/src/manager/diagnostic.ts.html +1 -1
- package/coverage/src/manager/index.html +1 -1
- package/coverage/src/manager/stepRecorder.ts.html +1 -1
- package/coverage/src/natural/genNaturalTS.ts.html +1 -1
- package/coverage/src/natural/index.html +1 -1
- package/coverage/src/natural/index.ts.html +1 -1
- package/coverage/src/natural/naslStdlibMap.ts.html +1 -1
- package/coverage/src/natural/transformTSCode.ts.html +3 -3
- package/coverage/src/sentry/index.html +1 -1
- package/coverage/src/sentry/index.ts.html +25 -25
- package/coverage/src/server/createUiTs.ts.html +1 -1
- package/coverage/src/server/entity2LogicNamespace.ts.html +1 -1
- package/coverage/src/server/event.js.html +1 -1
- package/coverage/src/server/extendBaseNode.ts.html +30 -99
- package/coverage/src/server/formatTsUtils.ts.html +18 -27
- package/coverage/src/server/getConnector.ts.html +1 -1
- package/coverage/src/server/getExtensionModules.ts.html +1 -1
- package/coverage/src/server/getFunctions.ts.html +1 -1
- package/coverage/src/server/getInterfaces.ts.html +1 -1
- package/coverage/src/server/getLogging.ts.html +1 -1
- package/coverage/src/server/getLogics.ts.html +66 -180
- package/coverage/src/server/getMemberIdentifier.ts.html +9 -27
- package/coverage/src/server/getProcessComponents.ts.html +1 -1
- package/coverage/src/server/getProcesses.ts.html +6 -6
- package/coverage/src/server/getValidates.ts.html +1 -1
- package/coverage/src/server/index.html +58 -58
- package/coverage/src/server/index.ts.html +1 -1
- package/coverage/src/server/naslServer.ts.html +127 -163
- package/coverage/src/server/naslStdlibMap.ts.html +1 -1
- package/coverage/src/server/process2LogicNamespace.ts.html +1 -1
- package/coverage/src/server/translator.ts.html +16 -67
- package/coverage/src/service/creator/add.configs.js.html +1 -1
- package/coverage/src/service/creator/errHandles.js.html +1 -1
- package/coverage/src/service/creator/index.html +1 -1
- package/coverage/src/service/creator/index.js.html +2 -2
- package/coverage/src/service/datasource/api.js.html +1 -1
- package/coverage/src/service/datasource/index.html +1 -1
- package/coverage/src/service/datasource/index.js.html +1 -1
- package/coverage/src/service/logic/api.js.html +1 -1
- package/coverage/src/service/logic/index.html +1 -1
- package/coverage/src/service/logic/index.js.html +1 -1
- package/coverage/src/service/storage/api.js.html +1 -1
- package/coverage/src/service/storage/index.html +17 -17
- package/coverage/src/service/storage/index.ts.html +2 -2
- package/coverage/src/service/storage/init.ts.html +13 -100
- package/coverage/src/service/storage/jsoner.ts.html +1 -1
- package/coverage/src/service/storage/map.ts.html +4 -4
- package/coverage/src/service/storage/service.ts.html +1 -1
- package/coverage/src/service/storage/storagePoint.ts.html +1 -1
- package/coverage/src/templator/genCallComponentLogic.ts.html +1 -1
- package/coverage/src/templator/genCreateBlock.ts.html +8 -8
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +18 -18
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +126 -2298
- package/coverage/src/templator/genEditTableBlock.ts.html +2 -2
- package/coverage/src/templator/genEnumSelectBlock.ts.html +1 -1
- package/coverage/src/templator/genGetBlock.ts.html +13 -16
- package/coverage/src/templator/genGridViewBlock.ts.html +14 -14
- package/coverage/src/templator/genListViewBlock.ts.html +6 -6
- package/coverage/src/templator/genQueryComponent.ts.html +55 -40
- package/coverage/src/templator/genSelectBlock.ts.html +5 -5
- package/coverage/src/templator/genTableBlock.ts.html +22 -397
- package/coverage/src/templator/genUpdateBlock.ts.html +17 -20
- package/coverage/src/templator/index.html +55 -55
- package/coverage/src/templator/index.ts.html +2 -2
- package/coverage/src/templator/utils.ts.html +62 -35
- package/coverage/src/translator/constant.ts.html +1 -1
- package/coverage/src/translator/index.html +19 -19
- package/coverage/src/translator/index.ts.html +2 -2
- package/coverage/src/translator/types.ts.html +1 -1
- package/coverage/src/translator/utils.ts.html +56 -89
- package/coverage/src/utils/cookie.ts.html +1 -1
- package/coverage/src/utils/env.ts.html +2 -2
- package/coverage/src/utils/i18nInfo.ts.html +4 -19
- package/coverage/src/utils/index.html +19 -19
- package/coverage/src/utils/index.ts.html +17 -647
- package/coverage/src/utils/logger.ts.html +1 -1
- package/coverage/src/utils/sortTsString.ts.html +1 -1
- package/coverage/src/utils/string.ts.html +1 -1
- package/coverage/src/utils/time-slicing/constant.ts.html +1 -1
- package/coverage/src/utils/time-slicing/controller.ts.html +1 -1
- package/coverage/src/utils/time-slicing/index.html +1 -1
- package/coverage/src/utils/time-slicing/index.ts.html +2 -2
- package/coverage/src/utils/time-slicing/page-state.ts.html +1 -1
- package/coverage/src/utils/time-slicing/performance.ts.html +1 -1
- package/coverage/src/utils/time-slicing/runner.ts.html +6 -6
- package/coverage/src/utils/time-slicing/tool.ts.html +1 -1
- package/coverage/src/utils/time-slicing/utils.ts.html +3 -3
- package/coverage/src/utils/time-slicing/wrapper.ts.html +9 -9
- package/coverage/src/{concepts/ParamWithGroup__.ts.html → utils/time-slicing.ts.html} +142 -112
- package/coverage/src/utils/traverse.ts.html +1 -1
- package/coverage/src/utils/types.ts.html +1 -1
- package/coverage/src/utils/window.ts.html +1 -1
- package/out/automate/engine/utils.d.ts +1 -1
- package/out/automate/engine/utils.js +1 -5
- package/out/automate/engine/utils.js.map +1 -1
- package/out/common/BaseNode.js +23 -2
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/EventEmitter.d.ts +1 -0
- package/out/common/EventEmitter.js.map +1 -1
- package/out/concepts/App__.d.ts +8 -0
- package/out/concepts/App__.js +60 -4
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js +24 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/CallLogic__.js +1 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/FrontendType__.js +1 -0
- package/out/concepts/FrontendType__.js.map +1 -1
- package/out/concepts/Interface__.js +2 -0
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/Logic__.js +3 -0
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Paginate__.d.ts +3 -0
- package/out/concepts/Paginate__.js +23 -2
- package/out/concepts/Paginate__.js.map +1 -1
- package/out/concepts/Structure__.js +2 -0
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/ViewElement__.js +4 -2
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +4 -0
- package/out/concepts/View__.js +12 -0
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +68 -33
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/enums/KEYWORDS.js +2 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +2 -0
- package/out/generator/genBundleFiles.js +18 -4
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/permission.d.ts +5 -1
- package/out/generator/permission.js +2 -1
- package/out/generator/permission.js.map +1 -1
- package/out/natural/genNaturalTS.js +2 -5
- package/out/natural/genNaturalTS.js.map +1 -1
- package/out/natural/index.d.ts +2 -0
- package/out/natural/index.js +2 -0
- package/out/natural/index.js.map +1 -1
- package/out/natural/naslStdlibMap.d.ts +1 -2
- package/out/natural/naslStdlibMap.js +32 -23
- package/out/natural/naslStdlibMap.js.map +1 -1
- package/out/natural/prompt/analyzeClaims.d.ts +1 -0
- package/out/natural/prompt/analyzeClaims.js +21 -0
- package/out/natural/prompt/analyzeClaims.js.map +1 -0
- package/out/natural/prompt/executeClaims.d.ts +1 -0
- package/out/natural/prompt/executeClaims.js +73 -0
- package/out/natural/prompt/executeClaims.js.map +1 -0
- package/out/natural/transformTSCode.js +13 -2
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/extendBaseNode.js +35 -8
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/getLogics.js +3 -3
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +16 -16
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +1 -0
- package/out/server/naslServer.js +7 -2
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +8 -0
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +1 -0
- package/out/service/storage/init.js +6 -2
- package/out/service/storage/init.js.map +1 -1
- package/out/translator/types.d.ts +1 -0
- package/package.json +1 -1
- package/sandbox/stdlib/nasl.auth.ts +4 -0
- package/sandbox/stdlib/nasl.core.ts +12 -0
- package/sandbox-natural/stdlib/nasl.core.ts +3 -0
- package/sandbox-natural/stdlib/nasl.oql.ts +4 -3
- package/src/automate/engine/utils.js +1 -5
- package/src/common/BaseNode.ts +31 -3
- package/src/common/EventEmitter.ts +1 -0
- package/src/concepts/App__.ts +61 -4
- package/src/concepts/BinaryExpression__.ts +23 -1
- package/src/concepts/CallLogic__.ts +1 -1
- package/src/concepts/FrontendType__.ts +1 -0
- package/src/concepts/Interface__.ts +2 -0
- package/src/concepts/Logic__.ts +2 -0
- package/src/concepts/Paginate__.ts +24 -3
- package/src/concepts/Structure__.ts +2 -0
- package/src/concepts/ViewElement__.ts +4 -2
- package/src/concepts/View__.ts +13 -0
- package/src/concepts/basics/stdlib/nasl.auth.ts +97 -34
- package/src/enums/KEYWORDS.ts +2 -0
- package/src/generator/genBundleFiles.ts +19 -4
- package/src/generator/permission.ts +1 -1
- package/src/natural/genNaturalTS.ts +2 -2
- package/src/natural/index.ts +3 -0
- package/src/natural/naslStdlibMap.ts +25 -19
- package/src/natural/prompt/analyzeClaims.ts +16 -0
- package/src/natural/prompt/executeClaims.ts +69 -0
- package/src/natural/transformTSCode.ts +12 -2
- package/src/server/extendBaseNode.ts +45 -14
- package/src/server/getLogics.ts +3 -3
- package/src/server/getMemberIdentifier.ts +18 -18
- package/src/server/naslServer.ts +7 -2
- package/src/server/translator.ts +7 -0
- package/src/service/storage/init.ts +7 -2
- package/src/translator/types.ts +3 -0
- package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +199 -0
- package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +121 -0
- package/test/concepts/view-element/fixtures/table-data-source-calllogic-with-server-validation.json +2074 -0
- package/.nyc_output/477a0953-2b01-4d2a-affe-d4aaf3b0191c.json +0 -1
- package/.nyc_output/processinfo/477a0953-2b01-4d2a-affe-d4aaf3b0191c.json +0 -1
- package/coverage/src/concepts/BusinessComponent__.ts.html +0 -8164
- package/coverage/src/concepts/BusinessLogic__.ts.html +0 -1213
- package/coverage/src/concepts/CallEvent__.ts.html +0 -1138
- package/coverage/src/concepts/FrontendType__.ts.html +0 -2842
- package/coverage/src/concepts/Paginate__.ts.html +0 -1033
- package/coverage/src/concepts/utils/quick-info.ts.html +0 -277
package/src/concepts/App__.ts
CHANGED
|
@@ -3984,11 +3984,21 @@ export class App extends BaseNode {
|
|
|
3984
3984
|
path.forEach((key, index) => {
|
|
3985
3985
|
if (index === path.length - 1) {
|
|
3986
3986
|
if (compose?.[key]?.nodes) {
|
|
3987
|
+
// 需要判断下nodes里面是否已经存在
|
|
3987
3988
|
if (Array.isArray(node)) {
|
|
3988
|
-
|
|
3989
|
+
node.forEach((item) => {
|
|
3990
|
+
if (!compose[key].nodes.find((it) => it === item)) {
|
|
3991
|
+
compose[key].nodes.push(item);
|
|
3992
|
+
}
|
|
3993
|
+
});
|
|
3989
3994
|
} else {
|
|
3990
|
-
compose[key].nodes.
|
|
3995
|
+
if (!compose[key].nodes.find((it) => it === node)) {
|
|
3996
|
+
compose[key].nodes.push(node);
|
|
3997
|
+
}
|
|
3991
3998
|
}
|
|
3999
|
+
// 去重
|
|
4000
|
+
compose[key].nodes = Array.from(new Set(compose[key].nodes));
|
|
4001
|
+
|
|
3992
4002
|
} else {
|
|
3993
4003
|
if (!compose?.[key]) {
|
|
3994
4004
|
compose[key] = {};
|
|
@@ -4018,9 +4028,20 @@ export class App extends BaseNode {
|
|
|
4018
4028
|
delNodes(_compose[key]);
|
|
4019
4029
|
}
|
|
4020
4030
|
}
|
|
4021
|
-
_compose.nodes
|
|
4022
|
-
|
|
4031
|
+
const arr = [..._compose.nodes] || [];
|
|
4032
|
+
const triggerNode: BaseNode[] = []; // 触点放在最后删
|
|
4033
|
+
arr.forEach((node) => {
|
|
4034
|
+
if (node.name === path?.[0]) {
|
|
4035
|
+
triggerNode.push(node);
|
|
4036
|
+
} else {
|
|
4037
|
+
node && node.delete();
|
|
4038
|
+
}
|
|
4039
|
+
});
|
|
4040
|
+
|
|
4041
|
+
triggerNode.forEach((node) => {
|
|
4042
|
+
node && node.delete();
|
|
4023
4043
|
})
|
|
4044
|
+
|
|
4024
4045
|
_compose.nodes = [];
|
|
4025
4046
|
}
|
|
4026
4047
|
}
|
|
@@ -4081,6 +4102,42 @@ export class App extends BaseNode {
|
|
|
4081
4102
|
this.emit('collect:end');
|
|
4082
4103
|
}
|
|
4083
4104
|
|
|
4105
|
+
/**
|
|
4106
|
+
* 删除分组内的某一个
|
|
4107
|
+
*/
|
|
4108
|
+
deleteComposeNode(path: string[], node: BaseNode) {
|
|
4109
|
+
if (!node) return;
|
|
4110
|
+
let compose = this.composeCache;
|
|
4111
|
+
path.forEach((key, index) => {
|
|
4112
|
+
if (index === path.length - 1) {
|
|
4113
|
+
if (compose?.[key]?.nodes) {
|
|
4114
|
+
const index = compose[key].nodes.findIndex((it) => it === node);
|
|
4115
|
+
if (index > -1) {
|
|
4116
|
+
compose[key].nodes.splice(index, 1);
|
|
4117
|
+
}
|
|
4118
|
+
}
|
|
4119
|
+
} else {
|
|
4120
|
+
compose = compose[key];
|
|
4121
|
+
}
|
|
4122
|
+
});
|
|
4123
|
+
}
|
|
4124
|
+
|
|
4125
|
+
/**
|
|
4126
|
+
* 清空某一分组
|
|
4127
|
+
*/
|
|
4128
|
+
clearComposeNodes(path: string[]) {
|
|
4129
|
+
let compose = this.composeCache;
|
|
4130
|
+
path.forEach((key, index) => {
|
|
4131
|
+
if (index === path.length - 1) {
|
|
4132
|
+
if (compose?.[key]) {
|
|
4133
|
+
delete compose[key];
|
|
4134
|
+
}
|
|
4135
|
+
} else {
|
|
4136
|
+
compose = compose[key];
|
|
4137
|
+
}
|
|
4138
|
+
});
|
|
4139
|
+
}
|
|
4140
|
+
|
|
4084
4141
|
/**
|
|
4085
4142
|
* 获取命名空间
|
|
4086
4143
|
*/
|
|
@@ -27,6 +27,23 @@ const operatorMap = {
|
|
|
27
27
|
'>=': 'greaterThanOrEqual',
|
|
28
28
|
'<=': 'lessThanOrEqual',
|
|
29
29
|
};
|
|
30
|
+
const joinOperatorMap = {
|
|
31
|
+
'&&': 'and',
|
|
32
|
+
'||': 'or',
|
|
33
|
+
'+': 'add',
|
|
34
|
+
'-': 'minus',
|
|
35
|
+
'*': 'multiply',
|
|
36
|
+
'/': 'divide',
|
|
37
|
+
'%': 'remainder',
|
|
38
|
+
// '==': 'equal',
|
|
39
|
+
// '!=': 'notEqual',
|
|
40
|
+
'==': 'isEqual',
|
|
41
|
+
'!=': 'isNotEqual',
|
|
42
|
+
'>': 'joinGreaterThan', // join
|
|
43
|
+
'<': 'joinLessThan', // join
|
|
44
|
+
'>=': 'joinGreaterThanOrEqual', // join
|
|
45
|
+
'<=': 'joinLessThanOrEqual', // join
|
|
46
|
+
};
|
|
30
47
|
|
|
31
48
|
//================================================================================
|
|
32
49
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -418,7 +435,12 @@ export class BinaryExpression extends LogicItem {
|
|
|
418
435
|
}
|
|
419
436
|
if (['&&', '||', '+', '-', '*', '/', '%', '==', '!=', '>', '<', '>=', '<='].includes(self.operator)) {
|
|
420
437
|
let code = '';
|
|
421
|
-
|
|
438
|
+
// 数据查询的join支持特殊类型对比(枚举类型)
|
|
439
|
+
if (self.parentNode?.concept === 'QueryJoinExpression') {
|
|
440
|
+
code += `nasl.core.${joinOperatorMap[self.operator as keyof typeof operatorMap]}(`;
|
|
441
|
+
} else {
|
|
442
|
+
code += `nasl.core.${operatorMap[self.operator as keyof typeof operatorMap]}(`;
|
|
443
|
+
}
|
|
422
444
|
code += self.left?.toEmbeddedTS
|
|
423
445
|
? yield* self.left.toEmbeddedTS(shiftState(state, code, { inline: true }))
|
|
424
446
|
: '__LEFT__';
|
|
@@ -1335,7 +1335,7 @@ export class CallLogic extends LogicItem {
|
|
|
1335
1335
|
code += ';';
|
|
1336
1336
|
}
|
|
1337
1337
|
};
|
|
1338
|
-
if (useIife) {
|
|
1338
|
+
if (!state.callLogicNoIife && useIife) {
|
|
1339
1339
|
code += '(() =>{\nconst wrapper = ';
|
|
1340
1340
|
if (handleError) {
|
|
1341
1341
|
code += 'nasl.util.autoHandleError(';
|
|
@@ -769,6 +769,7 @@ export class FrontendType extends BaseNode {
|
|
|
769
769
|
let code = `export namespace ${self.name} {\n`;
|
|
770
770
|
code += 'const name = ';
|
|
771
771
|
code += `"${self.name}";\n`;
|
|
772
|
+
code += 'export namespace businessComponents { }\n';
|
|
772
773
|
code += '}\n';
|
|
773
774
|
return code;
|
|
774
775
|
}
|
|
@@ -1062,6 +1062,7 @@ export class Interface extends ImportedInterface {
|
|
|
1062
1062
|
// 本来 Connector 对应的 Namespace 是 connector,走默认逻辑就成
|
|
1063
1063
|
// 但是后端在翻译 Connector 下的 Interface 时选择的前缀为 extensions 故这里
|
|
1064
1064
|
if (this.parentNode?.concept === 'Connector') {
|
|
1065
|
+
// return `connector.${this.parentNode.name}.interfaces`;
|
|
1065
1066
|
return `extensions.${this.parentNode.name}.interfaces`;
|
|
1066
1067
|
}
|
|
1067
1068
|
if (this.parentNode && (this.parentNode as Namespace).getNamespace) {
|
|
@@ -1081,6 +1082,7 @@ export class Interface extends ImportedInterface {
|
|
|
1081
1082
|
// 本来 Connector 对应的 Namespace 是 connector,走默认逻辑就成
|
|
1082
1083
|
// 但是后端在翻译 Connector 下的 Interface 时选择的前缀为 extensions 故这里需要强行改成 extensions
|
|
1083
1084
|
if (this.parentNode?.concept === 'Connector') {
|
|
1085
|
+
// return `connector.${this.parentNode.tsName}.interfaces`;
|
|
1084
1086
|
return `extensions.${this.parentNode.tsName}.interfaces`;
|
|
1085
1087
|
}
|
|
1086
1088
|
if (this.parentNode && (this.parentNode as Namespace).getTsNamespace) {
|
package/src/concepts/Logic__.ts
CHANGED
|
@@ -2109,6 +2109,8 @@ ${indent(state.tabSize)} */\n`;
|
|
|
2109
2109
|
logicName = `viewLogic_${name}`;
|
|
2110
2110
|
} else if (parentNode?.concept === 'BindEvent') {
|
|
2111
2111
|
logicName = `on_${parentNode?.parentNode?.name}_${name}`;
|
|
2112
|
+
} else if (this?.concept === 'BusinessLogic') {
|
|
2113
|
+
logicName = `businessLogic_${name}`;
|
|
2112
2114
|
} else {
|
|
2113
2115
|
logicName = this.name;
|
|
2114
2116
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { shiftState, withSourceMapGenerator, TranslatorGenerator, createCompilerState } from '../translator';
|
|
1
|
+
import { shiftState, withSourceMapGenerator, TranslatorGenerator, createCompilerState, withSourceMap } from '../translator';
|
|
2
|
+
import { getCallExpressionQuickInfo, Range, GetCode } from './utils/quick-info';
|
|
2
3
|
//================================================================================
|
|
3
4
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
5
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -287,22 +288,42 @@ export class Paginate extends LogicItem {
|
|
|
287
288
|
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
288
289
|
// 自动生成的代码已结束。下面可以手动编写。
|
|
289
290
|
//================================================================================
|
|
291
|
+
@withSourceMap()
|
|
292
|
+
toNaturalTS(state = createCompilerState()): string {
|
|
293
|
+
const self = this;
|
|
294
|
+
let code = 'PaginateLimit(';
|
|
295
|
+
const list = self.list ? self.list.toNaturalTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
296
|
+
code += list;
|
|
297
|
+
code += ', ';
|
|
298
|
+
const page = self.page ? self.page.toNaturalTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
299
|
+
code += page;
|
|
300
|
+
code += ', ';
|
|
301
|
+
const size = self.size ? self.size.toNaturalTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
302
|
+
code += size;
|
|
303
|
+
code += `)\n`;
|
|
304
|
+
return code;
|
|
305
|
+
}
|
|
306
|
+
|
|
290
307
|
@withSourceMapGenerator
|
|
291
308
|
*toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
|
|
292
309
|
const self = this;
|
|
293
310
|
let code = 'nasl.util.paginateLimit(';
|
|
294
311
|
const list = self.list ? yield* self.list.toEmbeddedTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
295
312
|
code += list;
|
|
296
|
-
code += '
|
|
313
|
+
code += ',\n';
|
|
297
314
|
const page = self.page ? yield* self.page.toEmbeddedTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
298
315
|
code += page;
|
|
299
|
-
code += '
|
|
316
|
+
code += ',\n';
|
|
300
317
|
const size = self.size ? yield* self.size.toEmbeddedTS(shiftState(state, code)) : '__IDENTIFIER__';
|
|
301
318
|
code += size;
|
|
302
319
|
code += `)\n`;
|
|
303
320
|
return code;
|
|
304
321
|
}
|
|
305
322
|
|
|
323
|
+
getQuickInfoOffset(range: Range, getCode: GetCode) {
|
|
324
|
+
return getCallExpressionQuickInfo(range, getCode);
|
|
325
|
+
}
|
|
326
|
+
|
|
306
327
|
//================================================================================
|
|
307
328
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
308
329
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -653,6 +653,7 @@ export class Structure extends BaseNode {
|
|
|
653
653
|
// 本来 Connector 对应的 Namespace 是 connector,走默认逻辑就成
|
|
654
654
|
// 但是后端在翻译 Connector 下的 Interface 时选择的前缀为 extensions 故这里需要强行改成 extensions
|
|
655
655
|
if (this.parentNode?.concept === 'Connector') {
|
|
656
|
+
// return `connector.${this.parentNode.name}.structures`;
|
|
656
657
|
return `extensions.${this.parentNode.name}.structures`;
|
|
657
658
|
}
|
|
658
659
|
if (this.parentNode && (this.parentNode as Namespace).getNamespace) {
|
|
@@ -672,6 +673,7 @@ export class Structure extends BaseNode {
|
|
|
672
673
|
// 本来 Connector 对应的 Namespace 是 connector,走默认逻辑就成
|
|
673
674
|
// 但是后端在翻译 Connector 下的 Interface 时选择的前缀为 extensions 故这里需要强行改成 extensions
|
|
674
675
|
if (this.parentNode?.concept === 'Connector') {
|
|
676
|
+
// return `connector.${this.parentNode.tsName}.structures`;
|
|
675
677
|
return `extensions.${this.parentNode.tsName}.structures`;
|
|
676
678
|
}
|
|
677
679
|
if (this.parentNode && (this.parentNode as Namespace).getTsNamespace) {
|
|
@@ -1756,8 +1756,9 @@ export class ViewElement extends BaseNode {
|
|
|
1756
1756
|
tabSize: 4,
|
|
1757
1757
|
inline: true,
|
|
1758
1758
|
noNeedParams: true,
|
|
1759
|
+
callLogicNoIife: true,
|
|
1759
1760
|
};
|
|
1760
|
-
|
|
1761
|
+
const value = yield* attr.expression.toEmbeddedTS(
|
|
1761
1762
|
shiftState(state, code, attr.expression.concept === 'CallLogic' ? extraParams : {}),
|
|
1762
1763
|
);
|
|
1763
1764
|
code += indent((state?.tabSize || 0) + 3);
|
|
@@ -1853,8 +1854,9 @@ export class ViewElement extends BaseNode {
|
|
|
1853
1854
|
tabSize: 4,
|
|
1854
1855
|
inline: true,
|
|
1855
1856
|
noNeedParams: true,
|
|
1857
|
+
callLogicNoIife: true,
|
|
1856
1858
|
};
|
|
1857
|
-
|
|
1859
|
+
const value = yield* attr.expression.toEmbeddedTS(
|
|
1858
1860
|
shiftState(state, code, attr.expression.concept === 'CallLogic' ? extraParams : {}),
|
|
1859
1861
|
);
|
|
1860
1862
|
code += `type ${datasourceName} = `;
|
package/src/concepts/View__.ts
CHANGED
|
@@ -2897,6 +2897,19 @@ ${indent(state.tabSize)}export function ${this.tsName}_view`;
|
|
|
2897
2897
|
return code;
|
|
2898
2898
|
}
|
|
2899
2899
|
|
|
2900
|
+
/**
|
|
2901
|
+
* 该视图是否有子页面容器
|
|
2902
|
+
*/
|
|
2903
|
+
hasRouterView() {
|
|
2904
|
+
let res = false;
|
|
2905
|
+
utils.traverse((current: any) => {
|
|
2906
|
+
if (current.node.tag === 'u-router-view' || current.node.tag === 'van-router-view') {
|
|
2907
|
+
res = true;
|
|
2908
|
+
}
|
|
2909
|
+
}, { node: { children: this.elements } });
|
|
2910
|
+
return res;
|
|
2911
|
+
}
|
|
2912
|
+
|
|
2900
2913
|
getViewCallLogics(): string[] {
|
|
2901
2914
|
const callbackLogics: string[] = [];
|
|
2902
2915
|
this.traverseChildren((el) => {
|
|
@@ -66,30 +66,30 @@ export function initialize() {
|
|
|
66
66
|
}),
|
|
67
67
|
],
|
|
68
68
|
}),
|
|
69
|
-
new Structure({
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}),
|
|
69
|
+
// new Structure({
|
|
70
|
+
// name: 'LCAPUser',
|
|
71
|
+
// properties: [
|
|
72
|
+
// new StructureProperty({
|
|
73
|
+
// name: 'userName',
|
|
74
|
+
// typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
75
|
+
// }),
|
|
76
|
+
// new StructureProperty({
|
|
77
|
+
// name: 'userId',
|
|
78
|
+
// typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
79
|
+
// }),
|
|
80
|
+
// new StructureProperty({
|
|
81
|
+
// name: 'extendFiledMap',
|
|
82
|
+
// typeAnnotation: TypeAnnotation.createGeneric('map', {
|
|
83
|
+
// typeArguments: [
|
|
84
|
+
// // TypeAnnotation.createPrimitive('String'),
|
|
85
|
+
// // TypeAnnotation.createPrimitive('String'),
|
|
86
|
+
// TypeAnnotation.createTypeParam('K'),
|
|
87
|
+
// TypeAnnotation.createTypeParam('V'),
|
|
88
|
+
// ],
|
|
89
|
+
// }),
|
|
90
|
+
// }),
|
|
91
|
+
// ],
|
|
92
|
+
// }),
|
|
93
93
|
);
|
|
94
94
|
|
|
95
95
|
authTypeList.push(
|
|
@@ -105,12 +105,15 @@ export function initialize() {
|
|
|
105
105
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
106
106
|
}),
|
|
107
107
|
],
|
|
108
|
+
description: '检查当前用户是否有当前资源的权限',
|
|
108
109
|
returns: [],
|
|
109
110
|
}),
|
|
110
111
|
new Logic({
|
|
111
112
|
name: 'logout',
|
|
112
113
|
params: [],
|
|
113
114
|
returns: [],
|
|
115
|
+
description: '退出当前登录状态',
|
|
116
|
+
|
|
114
117
|
}),
|
|
115
118
|
new Logic({
|
|
116
119
|
name: 'encryptByAES',
|
|
@@ -120,10 +123,14 @@ export function initialize() {
|
|
|
120
123
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
121
124
|
}),
|
|
122
125
|
],
|
|
126
|
+
description: '对字符串实现aes加密 返回加密后的字符串',
|
|
127
|
+
|
|
123
128
|
returns: [],
|
|
124
129
|
}),
|
|
125
130
|
new Logic({
|
|
126
131
|
name: 'decryptByAES',
|
|
132
|
+
description: '对字符串实现aes解密 返回解密后的字符串',
|
|
133
|
+
|
|
127
134
|
params: [
|
|
128
135
|
new Param({
|
|
129
136
|
name: 'string',
|
|
@@ -132,34 +139,90 @@ export function initialize() {
|
|
|
132
139
|
],
|
|
133
140
|
returns: [],
|
|
134
141
|
}),
|
|
142
|
+
// new Logic({
|
|
143
|
+
// name: 'getUserList',
|
|
144
|
+
// params: [
|
|
145
|
+
// new Param({
|
|
146
|
+
// name: 'userNameFilter',
|
|
147
|
+
// typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
148
|
+
// }),
|
|
149
|
+
// new Param({
|
|
150
|
+
// name: 'limit',
|
|
151
|
+
// typeAnnotation: TypeAnnotation.createPrimitive('Long'),
|
|
152
|
+
// }),
|
|
153
|
+
// new Param({
|
|
154
|
+
// name: 'offset',
|
|
155
|
+
// typeAnnotation: TypeAnnotation.createPrimitive('Long'),
|
|
156
|
+
// }),
|
|
157
|
+
// ],
|
|
158
|
+
// returns: [
|
|
159
|
+
// new Return({
|
|
160
|
+
// name: 'result',
|
|
161
|
+
// typeAnnotation: TypeAnnotation.createGeneric('List', {
|
|
162
|
+
// typeArguments: [TypeAnnotation.createTypeParam('T')],
|
|
163
|
+
// }),
|
|
164
|
+
// }),
|
|
165
|
+
// ],
|
|
166
|
+
// }),
|
|
135
167
|
new Logic({
|
|
136
|
-
name: '
|
|
168
|
+
name: 'encryptPassword',
|
|
169
|
+
description: '密码加密(采用Bcrypt算法进行加密,salt默认10位)',
|
|
137
170
|
params: [
|
|
138
171
|
new Param({
|
|
139
|
-
name: '
|
|
172
|
+
name: 'password',
|
|
140
173
|
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
141
174
|
}),
|
|
175
|
+
],
|
|
176
|
+
returns: [
|
|
177
|
+
new Return({
|
|
178
|
+
name: 'BcryptedHashPassword',
|
|
179
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
180
|
+
}),
|
|
181
|
+
],
|
|
182
|
+
}),
|
|
183
|
+
new Logic({
|
|
184
|
+
name: 'validatePassword',
|
|
185
|
+
description: '密码校验(采用Bcrypt算法进行校验)',
|
|
186
|
+
params: [
|
|
142
187
|
new Param({
|
|
143
|
-
name: '
|
|
144
|
-
typeAnnotation: TypeAnnotation.createPrimitive('
|
|
188
|
+
name: 'plainText',
|
|
189
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
190
|
+
}), new Param({
|
|
191
|
+
name: 'hashedText',
|
|
192
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
145
193
|
}),
|
|
194
|
+
|
|
195
|
+
],
|
|
196
|
+
returns: [
|
|
197
|
+
new Return({
|
|
198
|
+
name: 'matchResult',
|
|
199
|
+
typeAnnotation: TypeAnnotation.createPrimitive('Boolean'),
|
|
200
|
+
}),
|
|
201
|
+
],
|
|
202
|
+
}),
|
|
203
|
+
new Logic({
|
|
204
|
+
name: 'generateUserId',
|
|
205
|
+
description: '生成用户唯一标识(根据Md5算法)',
|
|
206
|
+
params: [
|
|
146
207
|
new Param({
|
|
147
|
-
name: '
|
|
148
|
-
typeAnnotation: TypeAnnotation.createPrimitive('
|
|
208
|
+
name: 'userName',
|
|
209
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
210
|
+
}), new Param({
|
|
211
|
+
name: 'source',
|
|
212
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
149
213
|
}),
|
|
214
|
+
|
|
150
215
|
],
|
|
151
216
|
returns: [
|
|
152
217
|
new Return({
|
|
153
218
|
name: 'result',
|
|
154
|
-
typeAnnotation: TypeAnnotation.
|
|
155
|
-
typeArguments: [TypeAnnotation.createTypeParam('T')],
|
|
156
|
-
}),
|
|
219
|
+
typeAnnotation: TypeAnnotation.createPrimitive('String'),
|
|
157
220
|
}),
|
|
158
221
|
],
|
|
159
222
|
}),
|
|
160
223
|
new Logic({
|
|
161
224
|
name: 'getCurrentUser',
|
|
162
|
-
description: '
|
|
225
|
+
description: '即将下线,请使用服务端全局变量currentUser',
|
|
163
226
|
returns: [
|
|
164
227
|
new Return({
|
|
165
228
|
name: 'result',
|
package/src/enums/KEYWORDS.ts
CHANGED
|
@@ -32,9 +32,11 @@ interface Config {
|
|
|
32
32
|
tenantType: any;
|
|
33
33
|
tenantLevel: any;
|
|
34
34
|
appid: string;
|
|
35
|
+
isExport?:string;
|
|
35
36
|
devDnsAddr: string;
|
|
36
37
|
miniEnable: boolean;
|
|
37
38
|
isPreviewFe?: boolean;
|
|
39
|
+
previewVersion?: string;
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
// 将metaData转成字符串
|
|
@@ -362,7 +364,8 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
362
364
|
if (frontend.globalScaleEnabled) {
|
|
363
365
|
content += `{
|
|
364
366
|
// 如果是顶层页面,才使用iframe缩放,否则会死循环
|
|
365
|
-
|
|
367
|
+
// 如果不是登录页面,才使用iframe缩放,否则会拒绝连接
|
|
368
|
+
if(window.parent === window && location.pathname !== '/login'){
|
|
366
369
|
// 顶层页面里有个iframe,用来缩放页面
|
|
367
370
|
document.body.innerHTML = '<iframe src="' + location.href + '"></iframe>';
|
|
368
371
|
const iframe = document.querySelector('iframe');
|
|
@@ -384,6 +387,8 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
384
387
|
marginRight = (scale - 1)/scale * 100 + '%';
|
|
385
388
|
// 由于 marginBottom 的百分比也是基于宽度的,因此需要乘以 windowHeight / windowWidth
|
|
386
389
|
marginBottom = (scale - 1)/scale * windowHeight / windowWidth * 100 + '%';
|
|
390
|
+
// 消除白边,暂时没有找到原因,临时处理 bugid: 2765692131244288
|
|
391
|
+
marginBottom = 'calc(' + marginBottom + ' - 10px)';
|
|
387
392
|
}
|
|
388
393
|
iframe.style.marginRight = marginRight;
|
|
389
394
|
iframe.style.marginBottom = marginBottom;
|
|
@@ -615,10 +620,20 @@ export function genBundleFiles(app: App, frontend: Frontend, config: Config) {
|
|
|
615
620
|
`;
|
|
616
621
|
content += str;
|
|
617
622
|
}
|
|
618
|
-
const
|
|
619
|
-
|
|
623
|
+
const getBundleFileName =()=>{
|
|
624
|
+
if(config.isPreviewFe && config.previewVersion){
|
|
625
|
+
return `mockBundle-${config.previewVersion}`
|
|
626
|
+
}else {
|
|
627
|
+
return 'bundle'
|
|
628
|
+
}
|
|
629
|
+
}
|
|
630
|
+
let baseUrl = `${config.USER_STATIC_URL}/${config.tenant}/${app.id}/${config.env}`;
|
|
631
|
+
if((config.isExport)as any){
|
|
632
|
+
baseUrl = '';
|
|
633
|
+
}
|
|
634
|
+
let bundleMinPath = `${baseUrl}/${getBundleFileName()}.${genHash(content)}.min.js`;
|
|
620
635
|
if (frontend.basePath) {
|
|
621
|
-
bundleMinPath = `${baseUrl}${frontend.basePath}/${
|
|
636
|
+
bundleMinPath = `${baseUrl}${frontend.basePath}/${getBundleFileName()}.${genHash(content)}.min.js`;
|
|
622
637
|
}
|
|
623
638
|
const otherJsList = (frontend as any)?.appletsConfig?.enable ? ['//res.wx.qq.com/open/js/jweixin-1.3.2.js'] : [];
|
|
624
639
|
|
|
@@ -178,7 +178,7 @@ async function findResourcesOfLogic(logic: Logic, uploaders: Map<string, ViewEle
|
|
|
178
178
|
return optimizeResourceData(res);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
function getAllLogics(app: App) {
|
|
181
|
+
export function getAllLogics(app: App) {
|
|
182
182
|
const modules: (Module | Connector)[] = [];
|
|
183
183
|
const entities: Entity[] = [];
|
|
184
184
|
const logics: Logic[] = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { App, View, Logic, BaseNode, Frontend } from '../concepts';
|
|
2
2
|
import { shiftState, createCompilerState } from '../translator';
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { getNaslStbMap } from './naslStdlibMap';
|
|
5
5
|
|
|
6
6
|
export function genNaturalTS(app: App, currentNode?: BaseNode, focusedNodePath?: string) {
|
|
7
7
|
const logic = currentNode as Logic;
|
|
@@ -14,7 +14,7 @@ export function genNaturalTSContext(app: App, currentNode?: BaseNode, focusedNod
|
|
|
14
14
|
/* 标准库 */
|
|
15
15
|
code += `\`\`\`ts\n`;
|
|
16
16
|
code += '// 标准库\n';
|
|
17
|
-
code += `${Object.values(
|
|
17
|
+
code += `${Object.values(getNaslStbMap(currentNode)).join('\n')}\n`;
|
|
18
18
|
/* 全局上下文 */
|
|
19
19
|
code += '\n// 全局上下文\n';
|
|
20
20
|
app.enums.forEach((enumeration) => code += `${enumeration?.toNaturalTS()}\n`);
|
package/src/natural/index.ts
CHANGED
|
@@ -1,24 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
export const getNaslStbMap = (logic: any) => {
|
|
2
|
+
let naslStdlibMap: any;
|
|
3
|
+
const logicType = logic?.parentNode?.concept === 'App' ? 'global_logic' : 'view_logic';
|
|
4
|
+
/// #if process.env.BUILD_TARGET === 'node'
|
|
5
|
+
if (globalThis.process) { // For TS build
|
|
4
6
|
const fs = require('fs');
|
|
5
7
|
naslStdlibMap = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
'nasl.ui.ts': fs.readFileSync(require.resolve('../../sandbox-natural/stdlib/nasl.ui.ts'), 'utf8'),
|
|
8
|
+
'nasl.core.ts': fs.readFileSync(require.resolve('../../sandbox-natural/stdlib/nasl.core.ts'), 'utf8'),
|
|
9
|
+
'nasl.util.ts': fs.readFileSync(require.resolve('../../sandbox-natural/stdlib/nasl.util.ts'), 'utf8'),
|
|
10
|
+
'nasl.ui.ts': fs.readFileSync(require.resolve('../../sandbox-natural/stdlib/nasl.ui.ts'), 'utf8'),
|
|
10
11
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
if (logicType === 'global_logic') {
|
|
13
|
+
naslStdlibMap['nasl.oql.ts'] = fs.readFileSync(require.resolve('../../sandbox-natural/stdlib/nasl.oql.ts'), 'utf8');
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/// #endif
|
|
17
|
+
/// #if process.env.BUILD_TARGET !== 'node'
|
|
18
|
+
if (globalThis.window) { // For TS build
|
|
15
19
|
naslStdlibMap = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'nasl.ui.ts': require('!!raw-loader!../../sandbox-natural/stdlib/nasl.ui.ts').default,
|
|
20
|
+
'nasl.core.ts': require('!!raw-loader!../../sandbox-natural/stdlib/nasl.core.ts').default,
|
|
21
|
+
'nasl.util.ts': require('!!raw-loader!../../sandbox-natural/stdlib/nasl.util.ts').default,
|
|
22
|
+
'nasl.ui.ts': require('!!raw-loader!../../sandbox-natural/stdlib/nasl.ui.ts').default,
|
|
20
23
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
if (logicType === 'global_logic') {
|
|
25
|
+
naslStdlibMap['nasl.oql.ts'] = require('!!raw-loader!../../sandbox-natural/stdlib/nasl.oql.ts').default;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/// #endif
|
|
29
|
+
return naslStdlibMap;
|
|
30
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export const analyzeClaims = async (params: any) => {
|
|
2
|
+
const { logicType } = params;
|
|
3
|
+
const claims = `
|
|
4
|
+
- Knowledge 是你的知识库,你可以参考,但是你最终制定的计划中禁止包含方法或者函数名
|
|
5
|
+
- 如果用户没有特别指明是打印(日志/输出结果),"输出结果"一律按照"返回输出结果"处理
|
|
6
|
+
`;
|
|
7
|
+
// global_logic、view_logic、event_logic、business_Logic
|
|
8
|
+
const claimsMap = {
|
|
9
|
+
global_logic: `
|
|
10
|
+
- Knowledge 是你的知识库,你可以参考,但是你最终制定的计划中禁止包含方法或者函数名
|
|
11
|
+
- 如果用户没有特别指明是打印(日志/输出结果),"输出结果"一律按照"返回输出结果"处理
|
|
12
|
+
- 当前逻辑类型下暂不支持跳转页面功能,请提示用户: 如果需要跳转页面,请切换到前端页面逻辑或事件逻辑
|
|
13
|
+
`
|
|
14
|
+
} as any;
|
|
15
|
+
return claimsMap?.[logicType] || claims;
|
|
16
|
+
};
|