@lcap/nasl 2.22.12-beta.1 → 2.22.12-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/breakpoint/generator/AfterStartNode.js +1 -1
- package/out/breakpoint/generator/AfterStartNode.js.map +1 -1
- package/out/breakpoint/generator/BeforeEndNode.js +1 -1
- package/out/breakpoint/generator/BeforeEndNode.js.map +1 -1
- package/out/breakpoint/generator/BreakpointNode.d.ts +3 -0
- package/out/breakpoint/generator/BreakpointNode.js +12 -3
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
- package/out/breakpoint/generator/CallbackNode.js +15 -0
- package/out/breakpoint/generator/CallbackNode.js.map +1 -1
- package/out/breakpoint/shared/constants.js +1 -0
- package/out/breakpoint/shared/constants.js.map +1 -1
- package/out/breakpoint/shared/utils.js +12 -6
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/common/BaseNode.js +1 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/utils.d.ts +2 -0
- package/out/common/utils.js +18 -0
- package/out/common/utils.js.map +1 -0
- package/out/concepts/AbstractInterface__.d.ts +22 -0
- package/out/concepts/AbstractInterface__.js +56 -0
- package/out/concepts/AbstractInterface__.js.map +1 -0
- package/out/concepts/AuthInterface__.d.ts +5 -3
- package/out/concepts/AuthInterface__.js +11 -22
- package/out/concepts/AuthInterface__.js.map +1 -1
- package/out/concepts/AuthLogicForCallInterface__.d.ts +6 -4
- package/out/concepts/AuthLogicForCallInterface__.js +102 -118
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
- package/out/concepts/AuthLogic__.d.ts +9 -7
- package/out/concepts/AuthLogic__.js +11 -22
- package/out/concepts/AuthLogic__.js.map +1 -1
- package/out/concepts/BackendVariable__.d.ts +30 -23
- package/out/concepts/BackendVariable__.js +179 -130
- package/out/concepts/BackendVariable__.js.map +1 -1
- package/out/concepts/Backend__.d.ts +9 -10
- package/out/concepts/Backend__.js +42 -43
- package/out/concepts/Backend__.js.map +1 -1
- package/out/concepts/Block__.d.ts +84 -0
- package/out/concepts/Block__.js +215 -0
- package/out/concepts/Block__.js.map +1 -0
- package/out/concepts/BusinessComponent__.d.ts +641 -0
- package/out/concepts/BusinessComponent__.js +1901 -0
- package/out/concepts/BusinessComponent__.js.map +1 -0
- package/out/concepts/BusinessLogic__.d.ts +38 -0
- package/out/concepts/BusinessLogic__.js +358 -0
- package/out/concepts/BusinessLogic__.js.map +1 -0
- package/out/concepts/CallAuthInterface__.d.ts +10 -6
- package/out/concepts/CallAuthInterface__.js +84 -60
- package/out/concepts/CallAuthInterface__.js.map +1 -1
- package/out/concepts/CallConnector__.d.ts +7 -5
- package/out/concepts/CallConnector__.js +41 -50
- package/out/concepts/CallConnector__.js.map +1 -1
- package/out/concepts/CallEvent__.d.ts +97 -0
- package/out/concepts/CallEvent__.js +263 -0
- package/out/concepts/CallEvent__.js.map +1 -0
- package/out/concepts/Connection__.d.ts +10 -11
- package/out/concepts/Connection__.js +38 -50
- package/out/concepts/Connection__.js.map +1 -1
- package/out/concepts/ConnectorTrigger__.d.ts +9 -7
- package/out/concepts/ConnectorTrigger__.js +11 -32
- package/out/concepts/ConnectorTrigger__.js.map +1 -1
- package/out/concepts/Connector__.d.ts +382 -23
- package/out/concepts/Connector__.js +581 -121
- package/out/concepts/Connector__.js.map +1 -1
- package/out/concepts/CountersignPolicy__.d.ts +28 -0
- package/out/concepts/CountersignPolicy__.js +62 -0
- package/out/concepts/CountersignPolicy__.js.map +1 -0
- package/out/concepts/DefaultValue__.d.ts +104 -0
- package/out/concepts/DefaultValue__.js +242 -0
- package/out/concepts/DefaultValue__.js.map +1 -0
- package/out/concepts/FrontendType__.d.ts +308 -0
- package/out/concepts/FrontendType__.js +605 -0
- package/out/concepts/FrontendType__.js.map +1 -0
- package/out/concepts/FrontendVariable__.d.ts +15 -1
- package/out/concepts/FrontendVariable__.js +23 -11
- package/out/concepts/FrontendVariable__.js.map +1 -1
- package/out/concepts/I18nInfo__.d.ts +46 -0
- package/out/concepts/I18nInfo__.js +90 -0
- package/out/concepts/I18nInfo__.js.map +1 -0
- package/out/concepts/ImportedInterface__.d.ts +20 -0
- package/out/concepts/ImportedInterface__.js +48 -0
- package/out/concepts/ImportedInterface__.js.map +1 -0
- package/out/concepts/MsgTriggerEvent__.d.ts +10 -8
- package/out/concepts/MsgTriggerEvent__.js +32 -30
- package/out/concepts/MsgTriggerEvent__.js.map +1 -1
- package/out/concepts/MsgTriggerLauncher__.d.ts +7 -5
- package/out/concepts/MsgTriggerLauncher__.js +32 -35
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
- package/out/concepts/MultiApprovalPolicy__.d.ts +26 -0
- package/out/concepts/MultiApprovalPolicy__.js +59 -0
- package/out/concepts/MultiApprovalPolicy__.js.map +1 -0
- package/out/concepts/OverriddenLogic__.d.ts +28 -29
- package/out/concepts/OverriddenLogic__.js +268 -273
- package/out/concepts/OverriddenLogic__.js.map +1 -1
- package/out/concepts/ParamWithGroup__.d.ts +39 -0
- package/out/concepts/ParamWithGroup__.js +85 -0
- package/out/concepts/ParamWithGroup__.js.map +1 -0
- package/out/concepts/SequentialPolicy__.d.ts +20 -0
- package/out/concepts/SequentialPolicy__.js +48 -0
- package/out/concepts/SequentialPolicy__.js.map +1 -0
- package/out/concepts/StaticString__.d.ts +49 -0
- package/out/concepts/StaticString__.js +91 -0
- package/out/concepts/StaticString__.js.map +1 -0
- package/out/concepts/TriggerEvent__.d.ts +11 -78
- package/out/concepts/TriggerEvent__.js +24 -118
- package/out/concepts/TriggerEvent__.js.map +1 -1
- package/out/concepts/TriggerLauncher__.d.ts +10 -11
- package/out/concepts/TriggerLauncher__.js +18 -43
- package/out/concepts/TriggerLauncher__.js.map +1 -1
- package/out/concepts/basics/constants.d.ts +1 -0
- package/out/concepts/basics/constants.js +6 -0
- package/out/concepts/basics/constants.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.http.d.ts +7 -5
- package/out/concepts/basics/stdlib/nasl.http.js +78 -73
- package/out/concepts/basics/stdlib/nasl.http.js.map +1 -1
- package/out/concepts/types__.d.ts +0 -124
- package/out/concepts/types__.js +0 -2
- package/out/concepts/utils/asserts.d.ts +6931 -0
- package/out/concepts/utils/asserts.js +9208 -0
- package/out/concepts/utils/asserts.js.map +1 -0
- package/out/concepts/utils/quick-info.d.ts +13 -0
- package/out/concepts/utils/quick-info.js +51 -0
- package/out/concepts/utils/quick-info.js.map +1 -0
- package/out/concepts/utils/types.d.ts +447 -0
- package/out/concepts/utils/types.js +3 -0
- package/out/concepts/utils/types.js.map +1 -0
- package/out/server/getConnector.js +27 -4
- package/out/server/getConnector.js.map +1 -1
- package/out/utils/i18nInfo.d.ts +5 -0
- package/out/utils/i18nInfo.js +36 -0
- package/out/utils/i18nInfo.js.map +1 -0
- package/out/utils/time-slicing/constant.d.ts +35 -0
- package/out/utils/time-slicing/constant.js +40 -0
- package/out/utils/time-slicing/constant.js.map +1 -0
- package/out/utils/time-slicing/controller.d.ts +53 -0
- package/out/utils/time-slicing/controller.js +294 -0
- package/out/utils/time-slicing/controller.js.map +1 -0
- package/out/utils/time-slicing/index.d.ts +5 -0
- package/out/utils/time-slicing/index.js +26 -0
- package/out/utils/time-slicing/index.js.map +1 -0
- package/out/utils/time-slicing/page-state.d.ts +2 -0
- package/out/utils/time-slicing/page-state.js +14 -0
- package/out/utils/time-slicing/page-state.js.map +1 -0
- package/out/utils/time-slicing/performance.d.ts +11 -0
- package/out/utils/time-slicing/performance.js +50 -0
- package/out/utils/time-slicing/performance.js.map +1 -0
- package/out/utils/time-slicing/runner.d.ts +12 -0
- package/out/utils/time-slicing/runner.js +52 -0
- package/out/utils/time-slicing/runner.js.map +1 -0
- package/out/utils/time-slicing/tool.d.ts +24 -0
- package/out/utils/time-slicing/tool.js +47 -0
- package/out/utils/time-slicing/tool.js.map +1 -0
- package/out/utils/time-slicing/utils.d.ts +62 -0
- package/out/utils/time-slicing/utils.js +47 -0
- package/out/utils/time-slicing/utils.js.map +1 -0
- package/out/utils/time-slicing/wrapper.d.ts +18 -0
- package/out/utils/time-slicing/wrapper.js +55 -0
- package/out/utils/time-slicing/wrapper.js.map +1 -0
- package/package.json +3 -3
- package/src/common/BaseNode.ts +1 -1
- package/ts-worker/package.json +1 -1
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -461
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/src/automate/engine/index.html +0 -116
- package/coverage/src/automate/engine/utils.js.html +0 -1414
- package/coverage/src/bak/index.html +0 -116
- package/coverage/src/bak/translator.js.html +0 -745
- package/coverage/src/breakpoint/generator/AfterStartNode.ts.html +0 -175
- package/coverage/src/breakpoint/generator/BeforeEndNode.ts.html +0 -169
- package/coverage/src/breakpoint/generator/BreakpointNode.ts.html +0 -1246
- package/coverage/src/breakpoint/generator/CallbackNode.ts.html +0 -145
- package/coverage/src/breakpoint/generator/index.html +0 -176
- package/coverage/src/breakpoint/generator/index.ts.html +0 -508
- package/coverage/src/breakpoint/index.html +0 -116
- package/coverage/src/breakpoint/index.ts.html +0 -94
- package/coverage/src/breakpoint/shared/constants.ts.html +0 -436
- package/coverage/src/breakpoint/shared/index.html +0 -176
- package/coverage/src/breakpoint/shared/index.ts.html +0 -94
- package/coverage/src/breakpoint/shared/operations.ts.html +0 -160
- package/coverage/src/breakpoint/shared/socket.ts.html +0 -1297
- package/coverage/src/breakpoint/shared/utils.ts.html +0 -1087
- package/coverage/src/breakpoint/store/core.ts.html +0 -1600
- package/coverage/src/breakpoint/store/dock.ts.html +0 -733
- package/coverage/src/breakpoint/store/index.html +0 -146
- package/coverage/src/breakpoint/store/index.ts.html +0 -91
- package/coverage/src/common/BaseNode.ts.html +0 -3904
- package/coverage/src/common/Command.ts.html +0 -310
- package/coverage/src/common/EventEmitter.ts.html +0 -370
- package/coverage/src/common/Messager.ts.html +0 -820
- package/coverage/src/common/asyncFuncMap.ts.html +0 -127
- package/coverage/src/common/index.html +0 -191
- package/coverage/src/common/index.ts.html +0 -94
- package/coverage/src/concepts/Abort__.ts.html +0 -331
- package/coverage/src/concepts/Anchor__.ts.html +0 -661
- package/coverage/src/concepts/AnonymousFunction__.ts.html +0 -2071
- package/coverage/src/concepts/App__.ts.html +0 -14095
- package/coverage/src/concepts/Argument__.ts.html +0 -979
- package/coverage/src/concepts/Assignee__.ts.html +0 -2263
- package/coverage/src/concepts/AssignmentLine__.ts.html +0 -412
- package/coverage/src/concepts/Assignment__.ts.html +0 -1162
- package/coverage/src/concepts/Attribute__.ts.html +0 -748
- package/coverage/src/concepts/AuthInterface__.ts.html +0 -370
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +0 -1999
- package/coverage/src/concepts/AuthLogic__.ts.html +0 -793
- package/coverage/src/concepts/BackendVariable__.ts.html +0 -1498
- package/coverage/src/concepts/Backend__.ts.html +0 -1180
- package/coverage/src/concepts/BatchAssignment__.ts.html +0 -3346
- package/coverage/src/concepts/BinaryExpression__.ts.html +0 -1543
- package/coverage/src/concepts/BindAttribute__.ts.html +0 -3928
- package/coverage/src/concepts/BindDirective__.ts.html +0 -1984
- package/coverage/src/concepts/BindEvent__.ts.html +0 -3463
- package/coverage/src/concepts/BindStyle__.ts.html +0 -1627
- package/coverage/src/concepts/BooleanLiteral__.ts.html +0 -421
- package/coverage/src/concepts/CallAuthInterface__.ts.html +0 -1630
- package/coverage/src/concepts/CallConnector__.ts.html +0 -925
- package/coverage/src/concepts/CallFunction__.ts.html +0 -2140
- package/coverage/src/concepts/CallInterface__.ts.html +0 -2764
- package/coverage/src/concepts/CallLogic__.ts.html +0 -4738
- package/coverage/src/concepts/CallQueryComponent__.ts.html +0 -5335
- package/coverage/src/concepts/Comment__.ts.html +0 -397
- package/coverage/src/concepts/CompletionProperty__.ts.html +0 -940
- package/coverage/src/concepts/ConfigGroup__.ts.html +0 -1120
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +0 -427
- package/coverage/src/concepts/ConfigProperty__.ts.html +0 -1363
- package/coverage/src/concepts/Configuration__.ts.html +0 -1042
- package/coverage/src/concepts/Connection__.ts.html +0 -1375
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +0 -598
- package/coverage/src/concepts/Connector__.ts.html +0 -4318
- package/coverage/src/concepts/Constant__.ts.html +0 -928
- package/coverage/src/concepts/DataSource__.ts.html +0 -1786
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +0 -334
- package/coverage/src/concepts/Destination__.ts.html +0 -2743
- package/coverage/src/concepts/End__.ts.html +0 -436
- package/coverage/src/concepts/EntityIndex__.ts.html +0 -790
- package/coverage/src/concepts/EntityProperty__.ts.html +0 -2716
- package/coverage/src/concepts/Entity__.ts.html +0 -2977
- package/coverage/src/concepts/EnumItem__.ts.html +0 -553
- package/coverage/src/concepts/Enum__.ts.html +0 -1246
- package/coverage/src/concepts/Event__.ts.html +0 -1099
- package/coverage/src/concepts/ExternalDestination__.ts.html +0 -1048
- package/coverage/src/concepts/ForEachStatement__.ts.html +0 -1978
- package/coverage/src/concepts/FrontendLibrary__.ts.html +0 -1738
- package/coverage/src/concepts/FrontendVariable__.ts.html +0 -292
- package/coverage/src/concepts/Frontend__.ts.html +0 -4024
- package/coverage/src/concepts/Function__.ts.html +0 -3664
- package/coverage/src/concepts/Identifier__.ts.html +0 -1060
- package/coverage/src/concepts/IfStatement__.ts.html +0 -1621
- package/coverage/src/concepts/Integration__.ts.html +0 -1255
- package/coverage/src/concepts/InterfaceParam__.ts.html +0 -1102
- package/coverage/src/concepts/Interface__.ts.html +0 -3433
- package/coverage/src/concepts/JSBlock__.ts.html +0 -601
- package/coverage/src/concepts/JavaLogic__.ts.html +0 -463
- package/coverage/src/concepts/LogicItem__.ts.html +0 -1174
- package/coverage/src/concepts/Logic__.ts.html +0 -7444
- package/coverage/src/concepts/MatchCase__.ts.html +0 -2968
- package/coverage/src/concepts/Match__.ts.html +0 -2476
- package/coverage/src/concepts/MemberExpression__.ts.html +0 -1732
- package/coverage/src/concepts/MetadataType__.ts.html +0 -1996
- package/coverage/src/concepts/MicroApp__.ts.html +0 -439
- package/coverage/src/concepts/Module__.ts.html +0 -9874
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +0 -1060
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +0 -1033
- package/coverage/src/concepts/Namespace__.ts.html +0 -8077
- package/coverage/src/concepts/NewComposite__.ts.html +0 -4795
- package/coverage/src/concepts/NewList__.ts.html +0 -1648
- package/coverage/src/concepts/NewMap__.ts.html +0 -2356
- package/coverage/src/concepts/New__.ts.html +0 -289
- package/coverage/src/concepts/NullLiteral__.ts.html +0 -352
- package/coverage/src/concepts/NumericLiteral__.ts.html +0 -691
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +0 -1231
- package/coverage/src/concepts/OverriddenLogic__.ts.html +0 -6892
- package/coverage/src/concepts/Param__.ts.html +0 -1735
- package/coverage/src/concepts/Point__.ts.html +0 -334
- package/coverage/src/concepts/ProcessComponent__.ts.html +0 -1693
- package/coverage/src/concepts/ProcessElement__.ts.html +0 -5983
- package/coverage/src/concepts/ProcessOutcome__.ts.html +0 -355
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +0 -346
- package/coverage/src/concepts/Process__.ts.html +0 -4831
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +0 -583
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +0 -586
- package/coverage/src/concepts/QueryFromExpression__.ts.html +0 -925
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +0 -574
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +0 -1582
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +0 -652
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +0 -694
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +0 -1729
- package/coverage/src/concepts/Rect__.ts.html +0 -376
- package/coverage/src/concepts/Return__.ts.html +0 -1327
- package/coverage/src/concepts/Role__.ts.html +0 -604
- package/coverage/src/concepts/SelectMembers__.ts.html +0 -1261
- package/coverage/src/concepts/Slot__.ts.html +0 -643
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +0 -997
- package/coverage/src/concepts/Start__.ts.html +0 -307
- package/coverage/src/concepts/StringInterpolation__.ts.html +0 -1150
- package/coverage/src/concepts/StringLiteral__.ts.html +0 -508
- package/coverage/src/concepts/StructureProperty__.ts.html +0 -1147
- package/coverage/src/concepts/Structure__.ts.html +0 -2119
- package/coverage/src/concepts/SwitchCase__.ts.html +0 -1189
- package/coverage/src/concepts/SwitchStatement__.ts.html +0 -892
- package/coverage/src/concepts/Theme__.ts.html +0 -361
- package/coverage/src/concepts/Transactional__.ts.html +0 -631
- package/coverage/src/concepts/TriggerEvent__.ts.html +0 -1027
- package/coverage/src/concepts/TriggerLauncher__.ts.html +0 -778
- package/coverage/src/concepts/TypeAnnotation__.ts.html +0 -3880
- package/coverage/src/concepts/TypeParam__.ts.html +0 -322
- package/coverage/src/concepts/UnaryExpression__.ts.html +0 -724
- package/coverage/src/concepts/Unparsed__.ts.html +0 -397
- package/coverage/src/concepts/UseComponent__.ts.html +0 -334
- package/coverage/src/concepts/ValidationRule__.ts.html +0 -1855
- package/coverage/src/concepts/Variable__.ts.html +0 -1534
- package/coverage/src/concepts/ViewBlock__.ts.html +0 -355
- package/coverage/src/concepts/ViewComponent__.ts.html +0 -4255
- package/coverage/src/concepts/ViewElement__.ts.html +0 -8956
- package/coverage/src/concepts/View__.ts.html +0 -8875
- package/coverage/src/concepts/WhileStatement__.ts.html +0 -1096
- package/coverage/src/concepts/basics/stdlib/index.html +0 -356
- package/coverage/src/concepts/basics/stdlib/index.ts.html +0 -208
- package/coverage/src/concepts/basics/stdlib/nasl.auth.ts.html +0 -565
- package/coverage/src/concepts/basics/stdlib/nasl.browser.ts.html +0 -517
- package/coverage/src/concepts/basics/stdlib/nasl.collection.ts.html +0 -226
- package/coverage/src/concepts/basics/stdlib/nasl.configuration.ts.html +0 -172
- package/coverage/src/concepts/basics/stdlib/nasl.core.ts.html +0 -214
- package/coverage/src/concepts/basics/stdlib/nasl.event.ts.html +0 -145
- package/coverage/src/concepts/basics/stdlib/nasl.http.ts.html +0 -589
- package/coverage/src/concepts/basics/stdlib/nasl.interface.ts.html +0 -214
- package/coverage/src/concepts/basics/stdlib/nasl.io.ts.html +0 -229
- package/coverage/src/concepts/basics/stdlib/nasl.logging.ts.html +0 -268
- package/coverage/src/concepts/basics/stdlib/nasl.process.ts.html +0 -1999
- package/coverage/src/concepts/basics/stdlib/nasl.ui.ts.html +0 -3259
- package/coverage/src/concepts/basics/stdlib/nasl.util.ts.html +0 -6844
- package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +0 -1768
- package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +0 -163
- package/coverage/src/concepts/basics/stdlib/timeZone.ts.html +0 -664
- package/coverage/src/concepts/basics/types/coreTypeList.ts.html +0 -121
- package/coverage/src/concepts/basics/types/index.html +0 -131
- package/coverage/src/concepts/basics/types/index.ts.html +0 -160
- package/coverage/src/concepts/index.html +0 -1976
- package/coverage/src/concepts/index.ts.html +0 -103
- package/coverage/src/concepts/index__.ts.html +0 -454
- package/coverage/src/config.ts.html +0 -325
- package/coverage/src/decorators/index.html +0 -131
- package/coverage/src/decorators/index.ts.html +0 -574
- package/coverage/src/decorators/promise.ts.html +0 -169
- package/coverage/src/eventBus.ts.html +0 -100
- package/coverage/src/generator/compileComponent.ts.html +0 -142
- package/coverage/src/generator/genBundleFiles.ts.html +0 -1822
- package/coverage/src/generator/genHash.ts.html +0 -124
- package/coverage/src/generator/genMetaData.ts.html +0 -1129
- package/coverage/src/generator/genReleaseBody.ts.html +0 -1282
- package/coverage/src/generator/icestark.ts.html +0 -220
- package/coverage/src/generator/index.html +0 -266
- package/coverage/src/generator/index.ts.html +0 -106
- package/coverage/src/generator/microApp.ts.html +0 -172
- package/coverage/src/generator/permission.ts.html +0 -1036
- package/coverage/src/generator/qiankun.ts.html +0 -232
- package/coverage/src/generator/styleReplacer.ts.html +0 -199
- package/coverage/src/index.html +0 -146
- package/coverage/src/index.ts.html +0 -121
- package/coverage/src/manager/diagnostic.ts.html +0 -442
- package/coverage/src/manager/index.html +0 -131
- package/coverage/src/manager/stepRecorder.ts.html +0 -457
- package/coverage/src/natural/genNaturalTS.ts.html +0 -355
- package/coverage/src/natural/index.html +0 -161
- package/coverage/src/natural/index.ts.html +0 -91
- package/coverage/src/natural/naslStdlibMap.ts.html +0 -157
- package/coverage/src/natural/transformTSCode.ts.html +0 -2707
- package/coverage/src/sentry/index.html +0 -116
- package/coverage/src/sentry/index.ts.html +0 -676
- package/coverage/src/server/createUiTs.ts.html +0 -919
- package/coverage/src/server/entity2LogicNamespace.ts.html +0 -1294
- package/coverage/src/server/event.js.html +0 -526
- package/coverage/src/server/extendBaseNode.ts.html +0 -1765
- package/coverage/src/server/formatTsUtils.ts.html +0 -2689
- package/coverage/src/server/getConnector.ts.html +0 -316
- package/coverage/src/server/getExtensionModules.ts.html +0 -178
- package/coverage/src/server/getFunctions.ts.html +0 -133
- package/coverage/src/server/getInterfaces.ts.html +0 -229
- package/coverage/src/server/getLogging.ts.html +0 -100
- package/coverage/src/server/getLogics.ts.html +0 -1363
- package/coverage/src/server/getMemberIdentifier.ts.html +0 -1609
- package/coverage/src/server/getProcessComponents.ts.html +0 -112
- package/coverage/src/server/getProcesses.ts.html +0 -2023
- package/coverage/src/server/getValidates.ts.html +0 -115
- package/coverage/src/server/index.html +0 -401
- package/coverage/src/server/index.ts.html +0 -229
- package/coverage/src/server/naslServer.ts.html +0 -14812
- package/coverage/src/server/naslStdlibMap.ts.html +0 -241
- package/coverage/src/server/process2LogicNamespace.ts.html +0 -454
- package/coverage/src/server/translator.ts.html +0 -2566
- package/coverage/src/service/creator/add.configs.js.html +0 -397
- package/coverage/src/service/creator/errHandles.js.html +0 -304
- package/coverage/src/service/creator/index.html +0 -146
- package/coverage/src/service/creator/index.js.html +0 -352
- package/coverage/src/service/datasource/api.js.html +0 -118
- package/coverage/src/service/datasource/index.html +0 -131
- package/coverage/src/service/datasource/index.js.html +0 -103
- package/coverage/src/service/logic/api.js.html +0 -109
- package/coverage/src/service/logic/index.html +0 -131
- package/coverage/src/service/logic/index.js.html +0 -103
- package/coverage/src/service/storage/api.js.html +0 -202
- package/coverage/src/service/storage/index.html +0 -206
- package/coverage/src/service/storage/index.ts.html +0 -103
- package/coverage/src/service/storage/init.ts.html +0 -3661
- package/coverage/src/service/storage/jsoner.ts.html +0 -502
- package/coverage/src/service/storage/map.ts.html +0 -256
- package/coverage/src/service/storage/service.ts.html +0 -331
- package/coverage/src/service/storage/storagePoint.ts.html +0 -304
- package/coverage/src/templator/genCallComponentLogic.ts.html +0 -163
- package/coverage/src/templator/genCreateBlock.ts.html +0 -1084
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +0 -1627
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +0 -2242
- package/coverage/src/templator/genEditTableBlock.ts.html +0 -1024
- package/coverage/src/templator/genEnumSelectBlock.ts.html +0 -178
- package/coverage/src/templator/genGetBlock.ts.html +0 -451
- package/coverage/src/templator/genGridViewBlock.ts.html +0 -1114
- package/coverage/src/templator/genListViewBlock.ts.html +0 -475
- package/coverage/src/templator/genQueryComponent.ts.html +0 -1207
- package/coverage/src/templator/genSelectBlock.ts.html +0 -1243
- package/coverage/src/templator/genTableBlock.ts.html +0 -973
- package/coverage/src/templator/genUpdateBlock.ts.html +0 -1204
- package/coverage/src/templator/index.html +0 -326
- package/coverage/src/templator/index.ts.html +0 -154
- package/coverage/src/templator/utils.ts.html +0 -1927
- package/coverage/src/translator/constant.ts.html +0 -106
- package/coverage/src/translator/index.html +0 -146
- package/coverage/src/translator/index.ts.html +0 -94
- package/coverage/src/translator/utils.ts.html +0 -493
- package/coverage/src/utils/cookie.ts.html +0 -265
- package/coverage/src/utils/env.ts.html +0 -91
- package/coverage/src/utils/index.html +0 -236
- package/coverage/src/utils/index.ts.html +0 -748
- package/coverage/src/utils/logger.ts.html +0 -145
- package/coverage/src/utils/sortTsString.ts.html +0 -187
- package/coverage/src/utils/string.ts.html +0 -502
- package/coverage/src/utils/time-slicing.ts.html +0 -418
- package/coverage/src/utils/traverse.ts.html +0 -568
- package/coverage/src/utils/window.ts.html +0 -112
- package/out/utils/time-slicing.d.ts +0 -41
- package/out/utils/time-slicing.js +0 -82
- package/out/utils/time-slicing.js.map +0 -1
|
@@ -34,94 +34,55 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
34
34
|
var OverriddenLogic_1;
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.OverriddenLogic = void 0;
|
|
37
|
-
const
|
|
37
|
+
const time_slicing_1 = require("../utils/time-slicing");
|
|
38
38
|
const translator_1 = require("../translator");
|
|
39
|
-
const
|
|
40
|
-
const CallQueryComponent__1 = __importDefault(require("./CallQueryComponent__"));
|
|
41
|
-
const Assignment__1 = __importDefault(require("./Assignment__"));
|
|
42
|
-
const Identifier__1 = __importDefault(require("./Identifier__"));
|
|
43
|
-
const BindEvent__1 = __importDefault(require("./BindEvent__"));
|
|
44
|
-
const BatchAssignment__1 = __importDefault(require("./BatchAssignment__"));
|
|
45
|
-
const OqlQueryComponent__1 = __importDefault(require("./OqlQueryComponent__"));
|
|
46
|
-
const TypeAnnotation__1 = __importDefault(require("./TypeAnnotation__"));
|
|
47
|
-
const CallInterface__1 = __importDefault(require("./CallInterface__"));
|
|
48
|
-
const CallLogic__1 = __importDefault(require("./CallLogic__"));
|
|
39
|
+
const common_1 = require("../common");
|
|
49
40
|
const decorators_1 = require("../decorators");
|
|
50
41
|
const utils = __importStar(require("../utils"));
|
|
42
|
+
const asserts = __importStar(require("./utils/asserts"));
|
|
51
43
|
const BaseNode_1 = __importDefault(require("../common/BaseNode"));
|
|
52
|
-
const Transactional__1 = __importDefault(require("./Transactional__"));
|
|
53
|
-
const TypeParam__1 = __importDefault(require("./TypeParam__"));
|
|
54
|
-
const Param__1 = __importDefault(require("./Param__"));
|
|
55
|
-
const Return__1 = __importDefault(require("./Return__"));
|
|
56
|
-
const Variable__1 = __importDefault(require("./Variable__"));
|
|
57
|
-
const LogicItem__1 = __importDefault(require("./LogicItem__"));
|
|
58
|
-
const Process__1 = __importDefault(require("./Process__"));
|
|
59
44
|
/**
|
|
60
45
|
* 覆写逻辑
|
|
61
46
|
*/
|
|
62
|
-
let OverriddenLogic = OverriddenLogic_1 =
|
|
63
|
-
// @ts-ignore
|
|
64
|
-
class OverriddenLogic extends BaseNode_1.default {
|
|
65
|
-
/** 类名 */
|
|
66
|
-
static ConceptName = 'OverriddenLogic';
|
|
47
|
+
let OverriddenLogic = OverriddenLogic_1 = class OverriddenLogic extends BaseNode_1.default {
|
|
67
48
|
/**
|
|
68
|
-
*
|
|
69
|
-
*/
|
|
70
|
-
concept;
|
|
71
|
-
/**
|
|
72
|
-
* 覆写的模块
|
|
73
|
-
*/
|
|
74
|
-
// @ts-ignore
|
|
75
|
-
overriddenModule;
|
|
76
|
-
/**
|
|
77
|
-
* 覆写逻辑名称
|
|
78
|
-
*/
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
name;
|
|
81
|
-
/**
|
|
82
|
-
* 覆写逻辑描述
|
|
83
|
-
*/
|
|
84
|
-
// @ts-ignore
|
|
85
|
-
description;
|
|
86
|
-
/**
|
|
87
|
-
* 触发方式
|
|
88
|
-
*/
|
|
89
|
-
// @ts-ignore
|
|
90
|
-
triggerType;
|
|
91
|
-
/**
|
|
92
|
-
* 定时任务表达式
|
|
93
|
-
*/
|
|
94
|
-
// @ts-ignore
|
|
95
|
-
cron;
|
|
96
|
-
/**
|
|
97
|
-
* 事务
|
|
98
|
-
*/
|
|
99
|
-
// @ts-ignore
|
|
100
|
-
transactional;
|
|
101
|
-
/**
|
|
102
|
-
* 类型参数列表
|
|
103
|
-
*/
|
|
104
|
-
typeParams = null;
|
|
105
|
-
/**
|
|
106
|
-
* 输入参数列表
|
|
107
|
-
*/
|
|
108
|
-
params = [];
|
|
109
|
-
/**
|
|
110
|
-
* 输出参数列表
|
|
111
|
-
*/
|
|
112
|
-
returns = [];
|
|
113
|
-
/**
|
|
114
|
-
* 变量列表
|
|
115
|
-
*/
|
|
116
|
-
variables = [];
|
|
117
|
-
/**
|
|
118
|
-
* 逻辑项列表
|
|
119
|
-
*/
|
|
120
|
-
body = [];
|
|
121
|
-
/**
|
|
122
|
-
* 逻辑项列表
|
|
49
|
+
* @param source 需要合并的部分参数
|
|
123
50
|
*/
|
|
124
|
-
|
|
51
|
+
constructor(source) {
|
|
52
|
+
source = Object.assign({}, OverriddenLogic_1.getDefaultOptions(), source);
|
|
53
|
+
super(source);
|
|
54
|
+
/**
|
|
55
|
+
* 类型参数列表
|
|
56
|
+
*/
|
|
57
|
+
this.typeParams = null;
|
|
58
|
+
/**
|
|
59
|
+
* 输入参数列表
|
|
60
|
+
*/
|
|
61
|
+
this.params = [];
|
|
62
|
+
/**
|
|
63
|
+
* 输出参数列表
|
|
64
|
+
*/
|
|
65
|
+
this.returns = [];
|
|
66
|
+
/**
|
|
67
|
+
* 变量列表
|
|
68
|
+
*/
|
|
69
|
+
this.variables = [];
|
|
70
|
+
/**
|
|
71
|
+
* 逻辑项列表
|
|
72
|
+
*/
|
|
73
|
+
this.body = [];
|
|
74
|
+
/**
|
|
75
|
+
* 逻辑项列表
|
|
76
|
+
*/
|
|
77
|
+
this.playground = [];
|
|
78
|
+
// 是不是内部有错误
|
|
79
|
+
this.haveError = false;
|
|
80
|
+
// 是否body为空
|
|
81
|
+
this.isSmpty = false;
|
|
82
|
+
// 虚拟输入参数列表
|
|
83
|
+
this.virtualParams = [];
|
|
84
|
+
super.subConstructor(source);
|
|
85
|
+
}
|
|
125
86
|
/**
|
|
126
87
|
* 祖先 Module
|
|
127
88
|
*/
|
|
@@ -158,14 +119,6 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
158
119
|
get process() {
|
|
159
120
|
return this.getAncestor('Process');
|
|
160
121
|
}
|
|
161
|
-
/**
|
|
162
|
-
* @param source 需要合并的部分参数
|
|
163
|
-
*/
|
|
164
|
-
constructor(source) {
|
|
165
|
-
source = Object.assign({}, OverriddenLogic_1.getDefaultOptions(), source);
|
|
166
|
-
super(source);
|
|
167
|
-
super.subConstructor(source);
|
|
168
|
-
}
|
|
169
122
|
static from(source, parentNode, parentKey) {
|
|
170
123
|
return super.from(source, parentNode, parentKey);
|
|
171
124
|
}
|
|
@@ -260,26 +213,27 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
260
213
|
_insertTypeParamAt(options, index) {
|
|
261
214
|
const typeParamOptions = {};
|
|
262
215
|
const relationOptions = { parentNode: this, parentKey: 'typeParams' };
|
|
216
|
+
const TypeParam = (0, decorators_1.getConceptConstructor)('TypeParam');
|
|
263
217
|
let typeParam;
|
|
264
218
|
if (!options) {
|
|
265
|
-
typeParam =
|
|
219
|
+
typeParam = TypeParam.from({
|
|
266
220
|
...typeParamOptions,
|
|
267
221
|
name: this.getTypeParamUniqueName(),
|
|
268
222
|
}, this, 'typeParams');
|
|
269
223
|
}
|
|
270
224
|
else if (typeof options === 'string') {
|
|
271
|
-
typeParam =
|
|
225
|
+
typeParam = TypeParam.from({
|
|
272
226
|
...typeParamOptions,
|
|
273
227
|
name: options,
|
|
274
228
|
}, this, 'typeParams');
|
|
275
229
|
}
|
|
276
|
-
else if (options
|
|
230
|
+
else if (asserts.isTypeParam(options)) {
|
|
277
231
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
278
232
|
typeParam = options;
|
|
279
233
|
Object.assign(typeParam, relationOptions);
|
|
280
234
|
}
|
|
281
235
|
else {
|
|
282
|
-
typeParam =
|
|
236
|
+
typeParam = TypeParam.from({
|
|
283
237
|
...typeParamOptions,
|
|
284
238
|
...options,
|
|
285
239
|
}, this, 'typeParams');
|
|
@@ -316,26 +270,27 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
316
270
|
_insertParamAt(options, index) {
|
|
317
271
|
const paramOptions = {};
|
|
318
272
|
const relationOptions = { parentNode: this, parentKey: 'params' };
|
|
273
|
+
const Param = (0, decorators_1.getConceptConstructor)('Param');
|
|
319
274
|
let param;
|
|
320
275
|
if (!options) {
|
|
321
|
-
param =
|
|
276
|
+
param = Param.from({
|
|
322
277
|
...paramOptions,
|
|
323
278
|
name: this.getParamUniqueName(),
|
|
324
279
|
}, this, 'params');
|
|
325
280
|
}
|
|
326
281
|
else if (typeof options === 'string') {
|
|
327
|
-
param =
|
|
282
|
+
param = Param.from({
|
|
328
283
|
...paramOptions,
|
|
329
284
|
name: options,
|
|
330
285
|
}, this, 'params');
|
|
331
286
|
}
|
|
332
|
-
else if (options
|
|
287
|
+
else if (asserts.isParam(options)) {
|
|
333
288
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
334
289
|
param = options;
|
|
335
290
|
Object.assign(param, relationOptions);
|
|
336
291
|
}
|
|
337
292
|
else {
|
|
338
|
-
param =
|
|
293
|
+
param = Param.from({
|
|
339
294
|
...paramOptions,
|
|
340
295
|
...options,
|
|
341
296
|
}, this, 'params');
|
|
@@ -372,26 +327,27 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
372
327
|
_insertReturnAt(options, index) {
|
|
373
328
|
const retOptions = {};
|
|
374
329
|
const relationOptions = { parentNode: this, parentKey: 'returns' };
|
|
330
|
+
const Return = (0, decorators_1.getConceptConstructor)('Return');
|
|
375
331
|
let ret;
|
|
376
332
|
if (!options) {
|
|
377
|
-
ret =
|
|
333
|
+
ret = Return.from({
|
|
378
334
|
...retOptions,
|
|
379
335
|
name: this.getReturnUniqueName(),
|
|
380
336
|
}, this, 'returns');
|
|
381
337
|
}
|
|
382
338
|
else if (typeof options === 'string') {
|
|
383
|
-
ret =
|
|
339
|
+
ret = Return.from({
|
|
384
340
|
...retOptions,
|
|
385
341
|
name: options,
|
|
386
342
|
}, this, 'returns');
|
|
387
343
|
}
|
|
388
|
-
else if (options
|
|
344
|
+
else if (asserts.isReturn(options)) {
|
|
389
345
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
390
346
|
ret = options;
|
|
391
347
|
Object.assign(ret, relationOptions);
|
|
392
348
|
}
|
|
393
349
|
else {
|
|
394
|
-
ret =
|
|
350
|
+
ret = Return.from({
|
|
395
351
|
...retOptions,
|
|
396
352
|
...options,
|
|
397
353
|
}, this, 'returns');
|
|
@@ -428,26 +384,27 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
428
384
|
_insertVariableAt(options, index) {
|
|
429
385
|
const variableOptions = {};
|
|
430
386
|
const relationOptions = { parentNode: this, parentKey: 'variables' };
|
|
387
|
+
const Variable = (0, decorators_1.getConceptConstructor)('Variable');
|
|
431
388
|
let variable;
|
|
432
389
|
if (!options) {
|
|
433
|
-
variable =
|
|
390
|
+
variable = Variable.from({
|
|
434
391
|
...variableOptions,
|
|
435
392
|
name: this.getVariableUniqueName(),
|
|
436
393
|
}, this, 'variables');
|
|
437
394
|
}
|
|
438
395
|
else if (typeof options === 'string') {
|
|
439
|
-
variable =
|
|
396
|
+
variable = Variable.from({
|
|
440
397
|
...variableOptions,
|
|
441
398
|
name: options,
|
|
442
399
|
}, this, 'variables');
|
|
443
400
|
}
|
|
444
|
-
else if (options
|
|
401
|
+
else if (asserts.isVariable(options)) {
|
|
445
402
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
446
403
|
variable = options;
|
|
447
404
|
Object.assign(variable, relationOptions);
|
|
448
405
|
}
|
|
449
406
|
else {
|
|
450
|
-
variable =
|
|
407
|
+
variable = Variable.from({
|
|
451
408
|
...variableOptions,
|
|
452
409
|
...options,
|
|
453
410
|
}, this, 'variables');
|
|
@@ -481,14 +438,15 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
481
438
|
_insertItemInBodyAt(options, index) {
|
|
482
439
|
const logicItemOptions = {};
|
|
483
440
|
const relationOptions = { parentNode: this, parentKey: 'body' };
|
|
441
|
+
const LogicItem = (0, decorators_1.getConceptConstructor)('LogicItem');
|
|
484
442
|
let logicItem;
|
|
485
|
-
if (options
|
|
443
|
+
if (asserts.isLogicItem(options)) {
|
|
486
444
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
487
445
|
logicItem = options;
|
|
488
446
|
Object.assign(logicItem, relationOptions);
|
|
489
447
|
}
|
|
490
448
|
else {
|
|
491
|
-
logicItem =
|
|
449
|
+
logicItem = LogicItem.from({
|
|
492
450
|
...logicItemOptions,
|
|
493
451
|
...options,
|
|
494
452
|
}, this, 'body');
|
|
@@ -522,14 +480,15 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
522
480
|
_insertItemInPlaygroundAt(options, index) {
|
|
523
481
|
const logicItemOptions = {};
|
|
524
482
|
const relationOptions = { parentNode: this, parentKey: 'playground' };
|
|
483
|
+
const LogicItem = (0, decorators_1.getConceptConstructor)('LogicItem');
|
|
525
484
|
let logicItem;
|
|
526
|
-
if (options
|
|
485
|
+
if (asserts.isLogicItem(options)) {
|
|
527
486
|
options.ensureDelete(); // 同一实例不支持多处存在
|
|
528
487
|
logicItem = options;
|
|
529
488
|
Object.assign(logicItem, relationOptions);
|
|
530
489
|
}
|
|
531
490
|
else {
|
|
532
|
-
logicItem =
|
|
491
|
+
logicItem = LogicItem.from({
|
|
533
492
|
...logicItemOptions,
|
|
534
493
|
...options,
|
|
535
494
|
}, this, 'playground');
|
|
@@ -594,9 +553,12 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
594
553
|
~index && this[parentKey].splice(index, 1);
|
|
595
554
|
params.index = index;
|
|
596
555
|
}
|
|
597
|
-
else
|
|
598
|
-
|
|
599
|
-
|
|
556
|
+
else {
|
|
557
|
+
const q = t[parentKey];
|
|
558
|
+
if ((q.__v_raw || q) === n) {
|
|
559
|
+
params.index = 0;
|
|
560
|
+
this[parentKey] = undefined;
|
|
561
|
+
}
|
|
600
562
|
}
|
|
601
563
|
}
|
|
602
564
|
return params;
|
|
@@ -635,9 +597,12 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
635
597
|
~index && this[parentKey].splice(index, 1);
|
|
636
598
|
params.index = index;
|
|
637
599
|
}
|
|
638
|
-
else
|
|
639
|
-
|
|
640
|
-
|
|
600
|
+
else {
|
|
601
|
+
const q = t[parentKey];
|
|
602
|
+
if ((q.__v_raw || q) === n) {
|
|
603
|
+
params.index = 0;
|
|
604
|
+
this[parentKey] = undefined;
|
|
605
|
+
}
|
|
641
606
|
}
|
|
642
607
|
}
|
|
643
608
|
return params;
|
|
@@ -676,9 +641,12 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
676
641
|
~index && this[parentKey].splice(index, 1);
|
|
677
642
|
params.index = index;
|
|
678
643
|
}
|
|
679
|
-
else
|
|
680
|
-
|
|
681
|
-
|
|
644
|
+
else {
|
|
645
|
+
const q = t[parentKey];
|
|
646
|
+
if ((q.__v_raw || q) === n) {
|
|
647
|
+
params.index = 0;
|
|
648
|
+
this[parentKey] = undefined;
|
|
649
|
+
}
|
|
682
650
|
}
|
|
683
651
|
}
|
|
684
652
|
return params;
|
|
@@ -717,9 +685,12 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
717
685
|
~index && this[parentKey].splice(index, 1);
|
|
718
686
|
params.index = index;
|
|
719
687
|
}
|
|
720
|
-
else
|
|
721
|
-
|
|
722
|
-
|
|
688
|
+
else {
|
|
689
|
+
const q = t[parentKey];
|
|
690
|
+
if ((q.__v_raw || q) === n) {
|
|
691
|
+
params.index = 0;
|
|
692
|
+
this[parentKey] = undefined;
|
|
693
|
+
}
|
|
723
694
|
}
|
|
724
695
|
}
|
|
725
696
|
return params;
|
|
@@ -758,9 +729,12 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
758
729
|
~index && this[parentKey].splice(index, 1);
|
|
759
730
|
params.index = index;
|
|
760
731
|
}
|
|
761
|
-
else
|
|
762
|
-
|
|
763
|
-
|
|
732
|
+
else {
|
|
733
|
+
const q = t[parentKey];
|
|
734
|
+
if ((q.__v_raw || q) === n) {
|
|
735
|
+
params.index = 0;
|
|
736
|
+
this[parentKey] = undefined;
|
|
737
|
+
}
|
|
764
738
|
}
|
|
765
739
|
}
|
|
766
740
|
return params;
|
|
@@ -794,9 +768,12 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
794
768
|
~index && this[parentKey].splice(index, 1);
|
|
795
769
|
params.index = index;
|
|
796
770
|
}
|
|
797
|
-
else
|
|
798
|
-
|
|
799
|
-
|
|
771
|
+
else {
|
|
772
|
+
const q = t[parentKey];
|
|
773
|
+
if ((q.__v_raw || q) === n) {
|
|
774
|
+
params.index = 0;
|
|
775
|
+
this[parentKey] = undefined;
|
|
776
|
+
}
|
|
800
777
|
}
|
|
801
778
|
}
|
|
802
779
|
return params;
|
|
@@ -823,8 +800,9 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
823
800
|
* 创建的时候 打开事务 通过开关设置数据库事务
|
|
824
801
|
*/
|
|
825
802
|
openTransactional(flag) {
|
|
803
|
+
const Transactional = (0, decorators_1.getConceptConstructor)('Transactional');
|
|
826
804
|
if (flag) {
|
|
827
|
-
const transactional = new
|
|
805
|
+
const transactional = new Transactional({
|
|
828
806
|
enabled: flag,
|
|
829
807
|
});
|
|
830
808
|
transactional._delete();
|
|
@@ -884,7 +862,7 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
884
862
|
if (Array.isArray(this.params)) {
|
|
885
863
|
this.params.forEach((param) => {
|
|
886
864
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}`;
|
|
887
|
-
code += param.toJS(
|
|
865
|
+
code += param.toJS(state);
|
|
888
866
|
code += ';\n';
|
|
889
867
|
});
|
|
890
868
|
}
|
|
@@ -892,7 +870,7 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
892
870
|
if (Array.isArray(this.variables)) {
|
|
893
871
|
this.variables.forEach((variable) => {
|
|
894
872
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
895
|
-
code += variable.toJS(
|
|
873
|
+
code += variable.toJS(state);
|
|
896
874
|
code += ';\n';
|
|
897
875
|
});
|
|
898
876
|
}
|
|
@@ -900,7 +878,7 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
900
878
|
if (Array.isArray(this.returns)) {
|
|
901
879
|
this.returns.forEach((ret) => {
|
|
902
880
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
903
|
-
code += ret.toJS(
|
|
881
|
+
code += ret.toJS(state);
|
|
904
882
|
code += ';\n';
|
|
905
883
|
});
|
|
906
884
|
}
|
|
@@ -1033,54 +1011,58 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1033
1011
|
},
|
|
1034
1012
|
};
|
|
1035
1013
|
}
|
|
1036
|
-
toEmbeddedTSInProcess(state, prependCode, noName, prefix) {
|
|
1014
|
+
*toEmbeddedTSInProcess(state = (0, translator_1.createCompilerState)(), prependCode, noName, prefix) {
|
|
1015
|
+
const self = this;
|
|
1037
1016
|
let code = '';
|
|
1038
1017
|
if (!prefix)
|
|
1039
|
-
code += `${noName ? '' : `${
|
|
1018
|
+
code += `${noName ? '' : `${self.name}:`} function(`;
|
|
1040
1019
|
else
|
|
1041
|
-
code += `function ${
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1020
|
+
code += `function ${self.name}(`; // 加空格会导致无法查询到引用
|
|
1021
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(
|
|
1022
|
+
// 加空格会导致无法查询到引用
|
|
1023
|
+
self.params, function* warpForEachGenerator(param, index) {
|
|
1024
|
+
code += yield* param.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1025
|
+
if (index !== self.params.length - 1)
|
|
1045
1026
|
code += ', ';
|
|
1046
1027
|
});
|
|
1047
1028
|
code += `) {\n`;
|
|
1048
1029
|
code += prependCode || '';
|
|
1049
1030
|
code += '\n';
|
|
1050
|
-
|
|
1031
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.variables, function* warpForEachGenerator(variable) {
|
|
1051
1032
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1052
|
-
code += variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1033
|
+
code += yield* variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1053
1034
|
code += ';\n';
|
|
1054
1035
|
});
|
|
1055
|
-
|
|
1036
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.returns, function* warpForEachGenerator(ret) {
|
|
1056
1037
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1057
|
-
code += ret.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1038
|
+
code += yield* ret.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1058
1039
|
code += ';\n';
|
|
1059
1040
|
});
|
|
1060
|
-
if (!
|
|
1061
|
-
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}return ${
|
|
1041
|
+
if (!self.body.length && self.returns.length) {
|
|
1042
|
+
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}return ${self.returns[0].name};\n`;
|
|
1062
1043
|
}
|
|
1063
1044
|
else {
|
|
1064
|
-
if (
|
|
1065
|
-
if (
|
|
1045
|
+
if (self.parentNode.type === 'ExclusiveGateway') {
|
|
1046
|
+
if (self.body.length <= 1) {
|
|
1066
1047
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1067
1048
|
code += 'const __LogicEmpty: any = null;';
|
|
1068
1049
|
}
|
|
1069
1050
|
}
|
|
1070
|
-
else if (
|
|
1071
|
-
!(
|
|
1072
|
-
!(
|
|
1051
|
+
else if (self.body.length <= 2 &&
|
|
1052
|
+
!asserts.isNamespace(self.parentNode) &&
|
|
1053
|
+
!asserts.isProcess(self.parentNode)) {
|
|
1073
1054
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1074
1055
|
code += `${(0, translator_1.indent)(state?.tabSize || 0 + 4)}const __LogicEmpty: any = null;`;
|
|
1075
1056
|
}
|
|
1076
|
-
|
|
1077
|
-
code +=
|
|
1057
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.body, function* warpForEachGenerator(item) {
|
|
1058
|
+
code += yield* item.toEmbeddedTS?.((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 })) ??
|
|
1059
|
+
(0, time_slicing_1.returnOrigin)('');
|
|
1078
1060
|
code += ';\n';
|
|
1079
1061
|
});
|
|
1080
1062
|
}
|
|
1081
1063
|
// 在body渲染完成之后把其余的节点放到下面
|
|
1082
|
-
|
|
1083
|
-
code += item.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
1064
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.playground, function* warpForEachGenerator(item) {
|
|
1065
|
+
code += yield* item.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
1084
1066
|
code += '\n';
|
|
1085
1067
|
});
|
|
1086
1068
|
code += `${(0, translator_1.indent)(state?.tabSize || 0 + 4)}}`;
|
|
@@ -1088,35 +1070,38 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1088
1070
|
return code;
|
|
1089
1071
|
}
|
|
1090
1072
|
toEmbeddedTSNoExport(state) {
|
|
1091
|
-
return this.toEmbeddedTS(state, 'noExport');
|
|
1073
|
+
return (0, time_slicing_1.runGeneratorSync)(this.toEmbeddedTS(state, 'noExport'));
|
|
1092
1074
|
}
|
|
1093
|
-
toEmbeddedTS(state, prefix) {
|
|
1075
|
+
*toEmbeddedTS(state = (0, translator_1.createCompilerState)(), prefix) {
|
|
1076
|
+
const self = this;
|
|
1077
|
+
// 等待 oql 查询返回内容
|
|
1078
|
+
yield (0, common_1.waitOqlQueryComponentChildrenFinish)(self);
|
|
1094
1079
|
// 如果传了不要前缀那就为空, 要不用传进来的,要是都没有就默认导出
|
|
1095
1080
|
let code = '';
|
|
1096
1081
|
if (!prefix) {
|
|
1097
|
-
code += `export function ${
|
|
1082
|
+
code += `export function ${self.name}`;
|
|
1098
1083
|
}
|
|
1099
1084
|
else if (prefix === 'noExport') {
|
|
1100
|
-
code += `function ${
|
|
1085
|
+
code += `function ${self.name}`;
|
|
1101
1086
|
}
|
|
1102
1087
|
else if (prefix === 'inObject') {
|
|
1103
|
-
code += `${
|
|
1088
|
+
code += `${self.name}`;
|
|
1104
1089
|
}
|
|
1105
|
-
if (
|
|
1090
|
+
if (self.typeParams?.length) {
|
|
1106
1091
|
code += '<';
|
|
1107
|
-
|
|
1108
|
-
code += typeParam.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1109
|
-
if (typeParamIndex !==
|
|
1092
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.typeParams, function* warpForEachGenerator(typeParam, typeParamIndex) {
|
|
1093
|
+
code += yield* typeParam.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1094
|
+
if (typeParamIndex !== self.typeParams.length - 1)
|
|
1110
1095
|
code += ', ';
|
|
1111
1096
|
});
|
|
1112
1097
|
code += '>';
|
|
1113
1098
|
}
|
|
1114
1099
|
// 有参数长度
|
|
1115
|
-
if (
|
|
1100
|
+
if (self.params.length) {
|
|
1116
1101
|
code += '(';
|
|
1117
|
-
|
|
1118
|
-
code += param.toEmbeddedTS((0, translator_1.shiftState)(state, code));
|
|
1119
|
-
if (index !==
|
|
1102
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.params, function* warpForEachGenerator(param, index) {
|
|
1103
|
+
code += yield* param.toEmbeddedTS((0, translator_1.shiftState)(state, code));
|
|
1104
|
+
if (index !== self.params.length - 1)
|
|
1120
1105
|
code += ', ';
|
|
1121
1106
|
});
|
|
1122
1107
|
code += ')';
|
|
@@ -1128,107 +1113,91 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1128
1113
|
// 需要类型推导的局部变量/返回值需要调整申明顺序
|
|
1129
1114
|
const advanceMap = new Map();
|
|
1130
1115
|
const needGetSourceMapOqlList = [];
|
|
1131
|
-
|
|
1132
|
-
if (el && (el
|
|
1133
|
-
if (el
|
|
1134
|
-
const advanceVar =
|
|
1116
|
+
yield* self.traverseChildrenGenerator(function* traverseChildrenGenerator(el) {
|
|
1117
|
+
if (el && (asserts.isBatchAssignment(el) || (asserts.isAssignment(el) && el.left?.name))) {
|
|
1118
|
+
if (asserts.isAssignment(el)) {
|
|
1119
|
+
const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && el.left?.name === variable.name);
|
|
1135
1120
|
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1136
1121
|
advanceMap.set(advanceVar, el);
|
|
1137
1122
|
}
|
|
1138
|
-
const advanceRn =
|
|
1123
|
+
const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && el.left?.name === ret.name);
|
|
1139
1124
|
if (advanceRn && !advanceMap.get(advanceRn)) {
|
|
1140
1125
|
advanceMap.set(advanceRn, el);
|
|
1141
1126
|
}
|
|
1142
1127
|
}
|
|
1143
|
-
else if (el
|
|
1144
|
-
el.assignmentLines
|
|
1128
|
+
else if (asserts.isBatchAssignment(el)) {
|
|
1129
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(el.assignmentLines, function* warpForEachGenerator({ leftIndex }) {
|
|
1145
1130
|
const leftCode = leftIndex.length === 1
|
|
1146
|
-
? el.left.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1147
|
-
: el.left.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1148
|
-
|
|
1131
|
+
? yield* el.left.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1132
|
+
: yield* el.left.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1133
|
+
(0, time_slicing_1.returnOrigin)('');
|
|
1134
|
+
const advanceVar = self.variables?.find((variable) => !variable.typeAnnotation && leftCode === variable.name);
|
|
1149
1135
|
if (advanceVar && !advanceMap.get(advanceVar)) {
|
|
1150
1136
|
advanceMap.set(advanceVar, el);
|
|
1151
1137
|
}
|
|
1152
|
-
const advanceRn =
|
|
1138
|
+
const advanceRn = self.returns?.find((ret) => !ret.typeAnnotation && leftCode === ret.name);
|
|
1153
1139
|
if (advanceRn && !advanceMap.get(advanceRn)) {
|
|
1154
1140
|
advanceMap.set(advanceRn, el);
|
|
1155
1141
|
}
|
|
1156
1142
|
});
|
|
1157
1143
|
}
|
|
1158
1144
|
}
|
|
1159
|
-
// 如果有sql查询组件就需要把他们存起来
|
|
1160
|
-
if (el instanceof OqlQueryComponent__1.default) {
|
|
1161
|
-
if (!el.codeSourceMap) {
|
|
1162
|
-
needGetSourceMapOqlList.push(el.requestEmbeddedTS());
|
|
1163
|
-
}
|
|
1164
|
-
}
|
|
1165
1145
|
});
|
|
1166
|
-
if (needGetSourceMapOqlList.length) {
|
|
1167
|
-
Promise.all(needGetSourceMapOqlList).then(() => {
|
|
1168
|
-
// 触发一下更新重新生成代码
|
|
1169
|
-
this.app?.naslServer?.embeddedTSEmitter.emit('change', {
|
|
1170
|
-
value: [
|
|
1171
|
-
{
|
|
1172
|
-
originEvent: {
|
|
1173
|
-
action: 'update',
|
|
1174
|
-
target: this,
|
|
1175
|
-
},
|
|
1176
|
-
},
|
|
1177
|
-
],
|
|
1178
|
-
});
|
|
1179
|
-
});
|
|
1180
|
-
}
|
|
1181
1146
|
// 兼容 return 没有类型情况
|
|
1182
|
-
if (
|
|
1147
|
+
if (self.returns.length && self.returns[0].typeAnnotation) {
|
|
1183
1148
|
code += ': ';
|
|
1184
|
-
code +=
|
|
1149
|
+
code += yield* self.returns[0].typeAnnotation?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1150
|
+
(0, time_slicing_1.returnOrigin)('');
|
|
1185
1151
|
}
|
|
1186
1152
|
code += '{\n';
|
|
1187
1153
|
// 用于虚拟节点的查找引用
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
this.virtualParams.forEach((param) => {
|
|
1154
|
+
if (Array.isArray(self.virtualParams)) {
|
|
1155
|
+
for (const param of self.virtualParams) {
|
|
1191
1156
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1192
|
-
code += param.toEmbeddedNameTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1157
|
+
code += yield* param.toEmbeddedNameTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1193
1158
|
code += '\n';
|
|
1194
|
-
}
|
|
1195
|
-
|
|
1159
|
+
}
|
|
1160
|
+
}
|
|
1161
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.variables, function* warpForEachGenerator(variable) {
|
|
1196
1162
|
if (!advanceMap.get(variable)) {
|
|
1197
1163
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1198
|
-
code += variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1164
|
+
code += yield* variable.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1199
1165
|
code += ';\n';
|
|
1200
1166
|
}
|
|
1201
1167
|
});
|
|
1202
|
-
|
|
1168
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.returns, function* warpForEachGenerator(ret) {
|
|
1203
1169
|
if (!advanceMap.get(ret)) {
|
|
1204
1170
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1205
|
-
code += ret.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1171
|
+
code += yield* ret.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1206
1172
|
code += ';\n';
|
|
1207
1173
|
}
|
|
1208
1174
|
});
|
|
1209
|
-
advanceMap.
|
|
1175
|
+
yield* (0, time_slicing_1.wrapIteratorToGenerator)(advanceMap.entries(), function* warpForEachGenerator([node, assignment]) {
|
|
1210
1176
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}// @ts-ignore\n`;
|
|
1211
1177
|
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}let `;
|
|
1212
|
-
code += node.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1213
|
-
if (assignment
|
|
1214
|
-
assignment.assignmentLines
|
|
1178
|
+
code += yield* node.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1179
|
+
if (asserts.isBatchAssignment(assignment)) {
|
|
1180
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(assignment.assignmentLines, function* warpForEachGenerator({ leftIndex, rightIndex }) {
|
|
1215
1181
|
const leftCode = leftIndex.length === 1
|
|
1216
|
-
? assignment.left.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1217
|
-
: assignment.left.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1182
|
+
? yield* assignment.left.expression.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1183
|
+
: yield* assignment.left.members[leftIndex[1]]?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1184
|
+
(0, time_slicing_1.returnOrigin)('');
|
|
1218
1185
|
if (leftCode === node.name) {
|
|
1219
1186
|
const rightNode = rightIndex.length === 1
|
|
1220
1187
|
? assignment.rights[rightIndex[0]]?.expression
|
|
1221
1188
|
: assignment.rights[rightIndex[0]]?.members[rightIndex[1]];
|
|
1222
1189
|
// 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
|
|
1223
1190
|
if (rightNode?.typeAnnotation &&
|
|
1224
|
-
!(rightNode
|
|
1191
|
+
!(asserts.isCallQueryComponent(rightNode) && rightNode.ideVersion !== '2.11')) {
|
|
1225
1192
|
code += ': ';
|
|
1226
|
-
code += rightNode.typeAnnotation?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1193
|
+
code += yield* rightNode.typeAnnotation?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1194
|
+
(0, time_slicing_1.returnOrigin)('null');
|
|
1227
1195
|
}
|
|
1228
1196
|
else {
|
|
1229
1197
|
code += ' = ';
|
|
1230
|
-
const rightCode = rightNode?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1231
|
-
|
|
1198
|
+
const rightCode = yield* rightNode?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1199
|
+
(0, time_slicing_1.returnOrigin)('');
|
|
1200
|
+
code += yield* self.getRightCode(rightCode, assignment, rightNode);
|
|
1232
1201
|
}
|
|
1233
1202
|
}
|
|
1234
1203
|
});
|
|
@@ -1237,58 +1206,60 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1237
1206
|
!assignment.right?.typeAnnotation) {
|
|
1238
1207
|
const rightNode = assignment.right;
|
|
1239
1208
|
code += ' = ';
|
|
1240
|
-
code += rightNode.getInitCode((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1209
|
+
code += yield* rightNode.getInitCode((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1241
1210
|
}
|
|
1242
1211
|
else if (assignment.right?.concept === 'NewComposite' &&
|
|
1243
1212
|
assignment.right?.typeAnnotation?.typeKind === 'anonymousStructure') {
|
|
1244
1213
|
const rightNode = assignment.right;
|
|
1245
1214
|
code += ' = ';
|
|
1246
|
-
code += rightNode.getInitCode((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1215
|
+
code += yield* rightNode.getInitCode((0, translator_1.shiftState)(state, code, { inline: true }));
|
|
1247
1216
|
}
|
|
1248
1217
|
else {
|
|
1249
1218
|
const rightNode = assignment.right;
|
|
1250
1219
|
// 当右边有明确类型时,直接使用其类型。旧版本数据查询不能直接使用其 typeAnnotation
|
|
1251
1220
|
if (rightNode?.typeAnnotation &&
|
|
1252
|
-
!(rightNode
|
|
1221
|
+
!(asserts.isCallQueryComponent(rightNode) && rightNode.ideVersion !== '2.11')) {
|
|
1253
1222
|
code += ': ';
|
|
1254
|
-
code += rightNode.typeAnnotation?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1223
|
+
code += yield* rightNode.typeAnnotation?.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true })) ??
|
|
1224
|
+
(0, time_slicing_1.returnOrigin)('null');
|
|
1255
1225
|
}
|
|
1256
1226
|
else {
|
|
1257
1227
|
code += ' = ';
|
|
1258
1228
|
let rightCode = '';
|
|
1259
1229
|
// 因为右侧枚举要赋值就得new 一下;
|
|
1260
1230
|
if (rightNode &&
|
|
1261
|
-
rightNode
|
|
1231
|
+
asserts.isIdentifier(rightNode) &&
|
|
1262
1232
|
rightNode.namespace &&
|
|
1263
1233
|
rightNode.namespace.endsWith('enums')) {
|
|
1264
1234
|
rightCode += 'new ';
|
|
1265
1235
|
}
|
|
1266
1236
|
rightCode +=
|
|
1267
1237
|
rightNode && rightNode.toEmbeddedTS
|
|
1268
|
-
? rightNode.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1238
|
+
? yield* rightNode.toEmbeddedTS((0, translator_1.shiftState)(state, code, { inline: true }))
|
|
1269
1239
|
: '__RIGHT__';
|
|
1270
|
-
code +=
|
|
1240
|
+
code += yield* self.getRightCode(rightCode, assignment, rightNode);
|
|
1271
1241
|
}
|
|
1272
1242
|
}
|
|
1273
1243
|
code += ';\n';
|
|
1274
1244
|
});
|
|
1275
|
-
if (!
|
|
1276
|
-
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}return ${
|
|
1245
|
+
if (!self.body.length && self.returns.length) {
|
|
1246
|
+
code += `${(0, translator_1.indent)((state?.tabSize || 0) + 1)}return ${self.returns[0].name};\n`;
|
|
1277
1247
|
}
|
|
1278
1248
|
else {
|
|
1279
1249
|
// 如果长度小于2 并且不是虚拟节点就 加 报错,
|
|
1280
|
-
if (
|
|
1250
|
+
if (self.body.length <= 2 && !asserts.isNamespace(self.parentNode)) {
|
|
1281
1251
|
code += (0, translator_1.indent)((state?.tabSize || 0) + 1);
|
|
1282
1252
|
code += 'const __LogicEmpty: any = null;';
|
|
1283
1253
|
}
|
|
1284
|
-
|
|
1285
|
-
code +=
|
|
1254
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.body, function* warpForEachGenerator(item) {
|
|
1255
|
+
code += yield* item.toEmbeddedTS?.((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 })) ??
|
|
1256
|
+
(0, time_slicing_1.returnOrigin)('');
|
|
1286
1257
|
code += ';\n';
|
|
1287
1258
|
});
|
|
1288
1259
|
}
|
|
1289
1260
|
// 在body渲染完成之后把其余的节点放到下面
|
|
1290
|
-
|
|
1291
|
-
code += item.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
1261
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(self.playground, function* warpForEachGenerator(item) {
|
|
1262
|
+
code += yield* item.toEmbeddedTS((0, translator_1.shiftState)(state, code, { tabSize: (state?.tabSize || 0) + 1 }));
|
|
1292
1263
|
code += ';\n';
|
|
1293
1264
|
});
|
|
1294
1265
|
code += `${(0, translator_1.indent)(state?.tabSize || 0)}}`;
|
|
@@ -1298,17 +1269,19 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1298
1269
|
code += '\n';
|
|
1299
1270
|
return code;
|
|
1300
1271
|
}
|
|
1301
|
-
getRightCode(code, assignment, rightNode) {
|
|
1272
|
+
*getRightCode(code, assignment, rightNode) {
|
|
1302
1273
|
code = code.replaceAll('\n', ' ');
|
|
1303
|
-
if (assignment
|
|
1274
|
+
if (asserts.isAssignment(assignment) && !assignment.right)
|
|
1304
1275
|
return code;
|
|
1305
1276
|
// 调用接口,参数替换成 null
|
|
1306
|
-
if (rightNode
|
|
1277
|
+
if (asserts.isCallInterface(rightNode)) {
|
|
1307
1278
|
const { _interface } = rightNode.getModuleInterface();
|
|
1308
|
-
return _interface
|
|
1279
|
+
return _interface
|
|
1280
|
+
? `${rightNode.tsCalleeKey}(${_interface.params.map(() => 'null').join(',')})`
|
|
1281
|
+
: null;
|
|
1309
1282
|
}
|
|
1310
1283
|
// 调用服务端逻辑,参数替换成 null
|
|
1311
|
-
if (rightNode
|
|
1284
|
+
if (asserts.isCallLogic(rightNode) && rightNode.calleeNamespace === 'app.logics') {
|
|
1312
1285
|
const calleeName = rightNode?.calleeName;
|
|
1313
1286
|
const calleeLogic = this.app.logics.find((l) => l.name === calleeName);
|
|
1314
1287
|
return calleeLogic ? `app.logics.${calleeName}(${calleeLogic.params.map(() => 'null').join(',')})` : null;
|
|
@@ -1316,12 +1289,12 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1316
1289
|
// ForEachStatement 内部变量需要替换处理,如 item、index
|
|
1317
1290
|
const forEachStatement = assignment.getAncestor('ForEachStatement');
|
|
1318
1291
|
if (forEachStatement) {
|
|
1319
|
-
code = this.handleForEachCode(code, forEachStatement);
|
|
1292
|
+
code = yield* this.handleForEachCode(code, forEachStatement);
|
|
1320
1293
|
}
|
|
1321
1294
|
// Match 需要针对分支缩小类型范围
|
|
1322
1295
|
const matchCase = assignment.getAncestor('MatchCase');
|
|
1323
1296
|
if (matchCase) {
|
|
1324
|
-
code = this.handleMatchCaseCode(code, matchCase);
|
|
1297
|
+
code = yield* this.handleMatchCaseCode(code, matchCase);
|
|
1325
1298
|
}
|
|
1326
1299
|
return code;
|
|
1327
1300
|
}
|
|
@@ -1351,33 +1324,34 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1351
1324
|
return fnCode;
|
|
1352
1325
|
});
|
|
1353
1326
|
}
|
|
1354
|
-
handleForEachCode(code, forEachStatement) {
|
|
1327
|
+
*handleForEachCode(code, forEachStatement) {
|
|
1355
1328
|
const { item, index, each } = forEachStatement;
|
|
1356
1329
|
if (code.includes(item.name)) {
|
|
1357
|
-
const eachTSCode = each ? each.toEmbeddedTS() : '__IDENTIFIER__';
|
|
1330
|
+
const eachTSCode = each ? yield* each.toEmbeddedTS() : '__IDENTIFIER__';
|
|
1358
1331
|
code = this.handleReplaceCode(code, item.name, eachTSCode === '__IDENTIFIER__' ? eachTSCode : `${eachTSCode}.__get(0)`);
|
|
1359
1332
|
}
|
|
1360
|
-
if (code.includes(index.name))
|
|
1333
|
+
if (code.includes(index.name)) {
|
|
1361
1334
|
code = this.handleReplaceCode(code, index.name, 'new nasl.core.Integer(0)');
|
|
1335
|
+
}
|
|
1362
1336
|
const parentForEachStatement = forEachStatement.getAncestor('ForEachStatement');
|
|
1363
1337
|
if (parentForEachStatement) {
|
|
1364
|
-
this.handleForEachCode(code, parentForEachStatement);
|
|
1338
|
+
code = yield* this.handleForEachCode(code, parentForEachStatement);
|
|
1365
1339
|
}
|
|
1366
1340
|
return code;
|
|
1367
1341
|
}
|
|
1368
|
-
handleMatchCaseCode(code, matchCase) {
|
|
1342
|
+
*handleMatchCaseCode(code, matchCase) {
|
|
1369
1343
|
const match = matchCase.getAncestor('Match');
|
|
1370
|
-
const expressionTsCode = match.expression.toEmbeddedTS();
|
|
1344
|
+
const expressionTsCode = yield* match.expression.toEmbeddedTS();
|
|
1371
1345
|
if (code.includes(expressionTsCode)) {
|
|
1372
1346
|
let typeCode = '';
|
|
1373
|
-
matchCase.patterns
|
|
1374
|
-
if (pattern
|
|
1347
|
+
yield* (0, time_slicing_1.wrapForEachToGenerator)(matchCase.patterns, function* wrapForEach(pattern, index) {
|
|
1348
|
+
if (asserts.isTypeAnnotation(pattern)) {
|
|
1375
1349
|
if (index === 0) {
|
|
1376
|
-
typeCode += pattern.toEmbeddedTS();
|
|
1350
|
+
typeCode += yield* pattern.toEmbeddedTS();
|
|
1377
1351
|
}
|
|
1378
1352
|
else {
|
|
1379
1353
|
typeCode += '|';
|
|
1380
|
-
typeCode += pattern.toEmbeddedTS();
|
|
1354
|
+
typeCode += yield* pattern.toEmbeddedTS();
|
|
1381
1355
|
}
|
|
1382
1356
|
}
|
|
1383
1357
|
});
|
|
@@ -1387,7 +1361,7 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1387
1361
|
}
|
|
1388
1362
|
const parentMatchCase = match.getAncestor('MatchCase');
|
|
1389
1363
|
if (parentMatchCase) {
|
|
1390
|
-
code = this.handleMatchCaseCode(code, parentMatchCase);
|
|
1364
|
+
code = yield* this.handleMatchCaseCode(code, parentMatchCase);
|
|
1391
1365
|
}
|
|
1392
1366
|
return code;
|
|
1393
1367
|
}
|
|
@@ -1454,16 +1428,16 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1454
1428
|
*/
|
|
1455
1429
|
getEmbeddedFilePath(name = this.name) {
|
|
1456
1430
|
let _path = this.module ? `/${this.module.parentKey}/${this.module.name}` : '';
|
|
1457
|
-
if (this.parentNode
|
|
1431
|
+
if (asserts.isFrontendLibrary(this.parentNode)) {
|
|
1458
1432
|
_path += `/frontends/${this.parentNode.type}`;
|
|
1459
1433
|
}
|
|
1460
1434
|
return `/embedded/${this.app.name}${_path}/overriddenLogics/${name}.ts`;
|
|
1461
1435
|
}
|
|
1462
|
-
toEmbeddedTSFile() {
|
|
1436
|
+
*toEmbeddedTSFile() {
|
|
1463
1437
|
let code = `namespace ${this.getTsNamespace()} {\n`;
|
|
1464
1438
|
const state = (0, translator_1.createCompilerState)(code, { tabSize: 1 });
|
|
1465
1439
|
try {
|
|
1466
|
-
code += this.toEmbeddedTS(state);
|
|
1440
|
+
code += yield* this.toEmbeddedTS(state);
|
|
1467
1441
|
}
|
|
1468
1442
|
catch (err) {
|
|
1469
1443
|
console.log(err, '有问题翻译失败');
|
|
@@ -1500,7 +1474,7 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1500
1474
|
root = this;
|
|
1501
1475
|
const set = new Set();
|
|
1502
1476
|
utils.traverse(({ node }) => {
|
|
1503
|
-
if (node
|
|
1477
|
+
if (asserts.isCallQueryComponent(node)) {
|
|
1504
1478
|
set.add(node);
|
|
1505
1479
|
}
|
|
1506
1480
|
}, { node: root }, {
|
|
@@ -1513,12 +1487,11 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1513
1487
|
}
|
|
1514
1488
|
// 通过开关设置数据库事务
|
|
1515
1489
|
setTransactionEnabled(flag) {
|
|
1516
|
-
|
|
1490
|
+
const Transactional = (0, decorators_1.getConceptConstructor)('Transactional');
|
|
1491
|
+
this.setTransactional(new Transactional({
|
|
1517
1492
|
enabled: flag,
|
|
1518
1493
|
}));
|
|
1519
1494
|
}
|
|
1520
|
-
fake;
|
|
1521
|
-
getPath;
|
|
1522
1495
|
delete() {
|
|
1523
1496
|
let actionMsg = '删除逻辑项';
|
|
1524
1497
|
if (this.name)
|
|
@@ -1533,10 +1506,6 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1533
1506
|
});
|
|
1534
1507
|
this.app?.emit('collect:end');
|
|
1535
1508
|
}
|
|
1536
|
-
// 是不是内部有错误
|
|
1537
|
-
haveError = false;
|
|
1538
|
-
// 是否body为空
|
|
1539
|
-
isSmpty = false;
|
|
1540
1509
|
get pathName() {
|
|
1541
1510
|
if (this.view) {
|
|
1542
1511
|
return this.getEventLogicName('chinese');
|
|
@@ -1561,7 +1530,7 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1561
1530
|
}
|
|
1562
1531
|
// 获取bindEvent下的logic的名称
|
|
1563
1532
|
getEventLogicName(type) {
|
|
1564
|
-
if (this.parentNode
|
|
1533
|
+
if (asserts.isBindEvent(this.parentNode)) {
|
|
1565
1534
|
if (type === 'chinese') {
|
|
1566
1535
|
const bindEvent = this.parentNode;
|
|
1567
1536
|
const bindChineseName = bindEvent.getPageViewEventChineseName();
|
|
@@ -1570,8 +1539,6 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1570
1539
|
}
|
|
1571
1540
|
return this.name;
|
|
1572
1541
|
}
|
|
1573
|
-
// 虚拟输入参数列表
|
|
1574
|
-
virtualParams = [];
|
|
1575
1542
|
get getLogicBelongTo() {
|
|
1576
1543
|
const [, belongTo] = this.calleewholeKey.split('.');
|
|
1577
1544
|
return belongTo;
|
|
@@ -1607,6 +1574,10 @@ class OverriddenLogic extends BaseNode_1.default {
|
|
|
1607
1574
|
return null;
|
|
1608
1575
|
}
|
|
1609
1576
|
};
|
|
1577
|
+
/** 类名 */
|
|
1578
|
+
OverriddenLogic.ConceptName = 'OverriddenLogic';
|
|
1579
|
+
/** 继承链 */
|
|
1580
|
+
OverriddenLogic.inheritanceChain = ['BaseNode'];
|
|
1610
1581
|
__decorate([
|
|
1611
1582
|
(0, decorators_1.property)('concept')
|
|
1612
1583
|
], OverriddenLogic.prototype, "concept", void 0);
|
|
@@ -1626,36 +1597,60 @@ __decorate([
|
|
|
1626
1597
|
(0, decorators_1.property)()
|
|
1627
1598
|
], OverriddenLogic.prototype, "cron", void 0);
|
|
1628
1599
|
__decorate([
|
|
1629
|
-
(0, decorators_1.property)(
|
|
1600
|
+
(0, decorators_1.property)({
|
|
1601
|
+
objectRef: 'Transactional',
|
|
1602
|
+
})
|
|
1630
1603
|
], OverriddenLogic.prototype, "transactional", void 0);
|
|
1631
1604
|
__decorate([
|
|
1632
|
-
(0, decorators_1.property)(
|
|
1605
|
+
(0, decorators_1.property)({
|
|
1606
|
+
objectRef: 'TypeParam',
|
|
1607
|
+
isArray: true,
|
|
1608
|
+
defaultValue: null,
|
|
1609
|
+
})
|
|
1633
1610
|
], OverriddenLogic.prototype, "typeParams", void 0);
|
|
1634
1611
|
__decorate([
|
|
1635
|
-
(0, decorators_1.property)(
|
|
1612
|
+
(0, decorators_1.property)({
|
|
1613
|
+
objectRef: 'Param',
|
|
1614
|
+
isArray: true,
|
|
1615
|
+
defaultValue: [],
|
|
1616
|
+
})
|
|
1636
1617
|
], OverriddenLogic.prototype, "params", void 0);
|
|
1637
1618
|
__decorate([
|
|
1638
|
-
(0, decorators_1.property)(
|
|
1619
|
+
(0, decorators_1.property)({
|
|
1620
|
+
objectRef: 'Return',
|
|
1621
|
+
isArray: true,
|
|
1622
|
+
defaultValue: [],
|
|
1623
|
+
})
|
|
1639
1624
|
], OverriddenLogic.prototype, "returns", void 0);
|
|
1640
1625
|
__decorate([
|
|
1641
|
-
(0, decorators_1.property)(
|
|
1626
|
+
(0, decorators_1.property)({
|
|
1627
|
+
objectRef: 'Variable',
|
|
1628
|
+
isArray: true,
|
|
1629
|
+
defaultValue: [],
|
|
1630
|
+
})
|
|
1642
1631
|
], OverriddenLogic.prototype, "variables", void 0);
|
|
1643
1632
|
__decorate([
|
|
1644
|
-
(0, decorators_1.property)(
|
|
1633
|
+
(0, decorators_1.property)({
|
|
1634
|
+
objectRef: 'LogicItem',
|
|
1635
|
+
isArray: true,
|
|
1636
|
+
defaultValue: [],
|
|
1637
|
+
})
|
|
1645
1638
|
], OverriddenLogic.prototype, "body", void 0);
|
|
1646
1639
|
__decorate([
|
|
1647
|
-
(0, decorators_1.property)(
|
|
1640
|
+
(0, decorators_1.property)({
|
|
1641
|
+
objectRef: 'LogicItem',
|
|
1642
|
+
isArray: true,
|
|
1643
|
+
defaultValue: [],
|
|
1644
|
+
})
|
|
1648
1645
|
], OverriddenLogic.prototype, "playground", void 0);
|
|
1649
1646
|
__decorate([
|
|
1650
|
-
|
|
1647
|
+
translator_1.withSourceMapGenerator
|
|
1651
1648
|
], OverriddenLogic.prototype, "toEmbeddedTSInProcess", null);
|
|
1652
1649
|
__decorate([
|
|
1653
|
-
|
|
1650
|
+
translator_1.withSourceMapGenerator
|
|
1654
1651
|
], OverriddenLogic.prototype, "toEmbeddedTS", null);
|
|
1655
1652
|
OverriddenLogic = OverriddenLogic_1 = __decorate([
|
|
1656
|
-
decorators_1.className,
|
|
1657
1653
|
(0, decorators_1.concept)('覆写逻辑')
|
|
1658
|
-
// @ts-ignore
|
|
1659
1654
|
], OverriddenLogic);
|
|
1660
1655
|
exports.OverriddenLogic = OverriddenLogic;
|
|
1661
1656
|
exports.default = OverriddenLogic;
|