@lcap/nasl 3.3.3-beta.8 → 3.3.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nyc_output/{78804420-ead6-486f-b682-ab54ccd95dc9.json → b920244d-8d01-4e76-be5a-95132217c5a1.json} +1 -1
- package/.nyc_output/processinfo/b920244d-8d01-4e76-be5a-95132217c5a1.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/index.html +113 -128
- package/coverage/src/automate/engine/index.html +1 -1
- package/coverage/src/automate/engine/utils.js.html +26 -26
- package/coverage/src/bak/index.html +15 -15
- package/coverage/src/bak/translator.js.html +63 -390
- 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 +1 -1
- package/coverage/src/breakpoint/generator/CallbackNode.ts.html +1 -1
- package/coverage/src/breakpoint/generator/index.html +1 -1
- 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 +1 -1
- package/coverage/src/breakpoint/shared/index.html +1 -1
- package/coverage/src/breakpoint/shared/index.ts.html +1 -1
- package/coverage/src/breakpoint/shared/operations.ts.html +2 -2
- package/coverage/src/breakpoint/shared/socket.ts.html +1 -1
- package/coverage/src/breakpoint/shared/utils.ts.html +1 -1
- package/coverage/src/breakpoint/store/core.ts.html +3 -3
- 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 +370 -592
- package/coverage/src/common/Command.ts.html +1 -1
- package/coverage/src/common/EventEmitter.ts.html +34 -31
- package/coverage/src/common/Messager.ts.html +1 -1
- package/coverage/src/common/asyncFuncMap.ts.html +1 -1
- package/coverage/src/common/index.html +23 -38
- package/coverage/src/common/index.ts.html +4 -7
- package/coverage/src/concepts/Abort__.ts.html +9 -36
- package/coverage/src/concepts/Anchor__.ts.html +22 -58
- package/coverage/src/concepts/AnonymousFunction__.ts.html +77 -107
- package/coverage/src/concepts/App__.ts.html +253 -907
- package/coverage/src/concepts/Argument__.ts.html +54 -195
- package/coverage/src/concepts/Assignee__.ts.html +70 -79
- package/coverage/src/concepts/AssignmentLine__.ts.html +21 -33
- package/coverage/src/concepts/Assignment__.ts.html +49 -130
- package/coverage/src/concepts/Attribute__.ts.html +179 -20
- package/coverage/src/concepts/AuthInterface__.ts.html +1 -1
- package/coverage/src/concepts/AuthLogicForCallInterface__.ts.html +161 -98
- package/coverage/src/concepts/AuthLogic__.ts.html +1 -1
- package/coverage/src/concepts/BackendVariable__.ts.html +226 -139
- package/coverage/src/concepts/Backend__.ts.html +35 -86
- package/coverage/src/concepts/BatchAssignment__.ts.html +65 -95
- package/coverage/src/concepts/BinaryExpression__.ts.html +89 -218
- package/coverage/src/concepts/BindAttribute__.ts.html +125 -440
- package/coverage/src/concepts/BindDirective__.ts.html +40 -64
- package/coverage/src/concepts/BindEvent__.ts.html +71 -86
- package/coverage/src/concepts/BindStyle__.ts.html +34 -58
- package/coverage/src/concepts/BooleanLiteral__.ts.html +8 -32
- package/coverage/src/concepts/CallAuthInterface__.ts.html +57 -87
- package/coverage/src/concepts/CallConnector__.ts.html +35 -59
- package/coverage/src/concepts/CallFunction__.ts.html +145 -247
- package/coverage/src/concepts/CallInterface__.ts.html +77 -53
- package/coverage/src/concepts/CallLogic__.ts.html +181 -244
- package/coverage/src/concepts/CallQueryComponent__.ts.html +181 -103
- package/coverage/src/concepts/Comment__.ts.html +10 -40
- package/coverage/src/concepts/CompletionProperty__.ts.html +17 -23
- package/coverage/src/concepts/ConfigGroup__.ts.html +27 -27
- package/coverage/src/concepts/ConfigPropertyValue__.ts.html +1 -1
- package/coverage/src/concepts/ConfigProperty__.ts.html +36 -66
- package/coverage/src/concepts/Configuration__.ts.html +27 -27
- package/coverage/src/concepts/Connection__.ts.html +29 -77
- package/coverage/src/concepts/ConnectorTrigger__.ts.html +1 -1
- package/coverage/src/concepts/Connector__.ts.html +92 -80
- package/coverage/src/concepts/Constant__.ts.html +222 -72
- package/coverage/src/concepts/DataSource__.ts.html +32 -59
- package/coverage/src/concepts/DatabaseTypeAnnotation__.ts.html +1 -1
- package/coverage/src/{utils/time-slicing/controller.ts.html → concepts/DefaultValue__.ts.html} +294 -459
- package/coverage/src/concepts/Destination__.ts.html +67 -79
- package/coverage/src/concepts/End__.ts.html +21 -48
- package/coverage/src/concepts/EntityIndex__.ts.html +17 -35
- package/coverage/src/concepts/EntityProperty__.ts.html +208 -118
- package/coverage/src/concepts/Entity__.ts.html +123 -81
- package/coverage/src/concepts/EnumItem__.ts.html +10 -37
- package/coverage/src/concepts/Enum__.ts.html +32 -65
- package/coverage/src/concepts/Event__.ts.html +21 -21
- package/coverage/src/concepts/ExternalDestination__.ts.html +30 -57
- package/coverage/src/concepts/ForEachStatement__.ts.html +89 -98
- package/coverage/src/concepts/FrontendLibrary__.ts.html +35 -35
- package/coverage/src/concepts/FrontendVariable__.ts.html +1 -1
- package/coverage/src/concepts/Frontend__.ts.html +93 -132
- package/coverage/src/concepts/Function__.ts.html +98 -131
- package/coverage/src/concepts/Identifier__.ts.html +67 -103
- package/coverage/src/concepts/IfStatement__.ts.html +67 -88
- package/coverage/src/concepts/Integration__.ts.html +31 -37
- package/coverage/src/concepts/InterfaceParam__.ts.html +179 -65
- package/coverage/src/concepts/Interface__.ts.html +74 -107
- package/coverage/src/concepts/JSBlock__.ts.html +11 -212
- package/coverage/src/concepts/JavaLogic__.ts.html +9 -39
- package/coverage/src/concepts/LogicItem__.ts.html +17 -44
- package/coverage/src/concepts/Logic__.ts.html +503 -263
- package/coverage/src/concepts/MatchCase__.ts.html +87 -126
- package/coverage/src/concepts/Match__.ts.html +56 -74
- package/coverage/src/concepts/MemberExpression__.ts.html +59 -95
- package/coverage/src/concepts/MicroApp__.ts.html +1 -1
- package/coverage/src/concepts/Module__.ts.html +136 -625
- package/coverage/src/concepts/MsgTriggerEvent__.ts.html +21 -21
- package/coverage/src/concepts/MsgTriggerLauncher__.ts.html +21 -21
- package/coverage/src/concepts/Namespace__.ts.html +178 -166
- package/coverage/src/concepts/NewComposite__.ts.html +178 -295
- package/coverage/src/concepts/NewList__.ts.html +75 -129
- package/coverage/src/concepts/NewMap__.ts.html +139 -100
- package/coverage/src/concepts/New__.ts.html +9 -39
- package/coverage/src/concepts/NullLiteral__.ts.html +5 -29
- package/coverage/src/concepts/NumericLiteral__.ts.html +29 -65
- package/coverage/src/concepts/OqlQueryComponent__.ts.html +39 -69
- package/coverage/src/concepts/OverriddenLogic__.ts.html +264 -234
- package/coverage/src/concepts/Param__.ts.html +154 -196
- package/coverage/src/concepts/Point__.ts.html +1 -1
- package/coverage/src/concepts/ProcessComponent__.ts.html +36 -36
- package/coverage/src/concepts/ProcessElement__.ts.html +285 -183
- package/coverage/src/concepts/ProcessOutcome__.ts.html +13 -82
- package/coverage/src/concepts/ProcessOutcomes__.ts.html +20 -80
- package/coverage/src/concepts/Process__.ts.html +284 -122
- package/coverage/src/concepts/QueryAggregateExpression__.ts.html +20 -50
- package/coverage/src/concepts/QueryFieldExpression__.ts.html +11 -38
- package/coverage/src/concepts/QueryFromExpression__.ts.html +29 -62
- package/coverage/src/concepts/QueryGroupByExpression__.ts.html +23 -53
- package/coverage/src/concepts/QueryJoinExpression__.ts.html +41 -62
- package/coverage/src/concepts/QueryLimitExpression__.ts.html +29 -59
- package/coverage/src/concepts/QueryOrderByExpression__.ts.html +29 -62
- package/coverage/src/concepts/QuerySelectExpression__.ts.html +22 -22
- package/coverage/src/concepts/Rect__.ts.html +1 -1
- package/coverage/src/concepts/Return__.ts.html +187 -148
- package/coverage/src/concepts/Role__.ts.html +15 -42
- package/coverage/src/concepts/SelectMembers__.ts.html +31 -55
- package/coverage/src/concepts/Slot__.ts.html +17 -23
- package/coverage/src/concepts/SqlQueryComponent__.ts.html +28 -67
- package/coverage/src/concepts/Start__.ts.html +5 -29
- package/coverage/src/concepts/StringInterpolation__.ts.html +31 -79
- package/coverage/src/concepts/StringLiteral__.ts.html +26 -53
- package/coverage/src/concepts/StructureProperty__.ts.html +175 -64
- package/coverage/src/concepts/Structure__.ts.html +73 -67
- package/coverage/src/concepts/SwitchCase__.ts.html +45 -66
- package/coverage/src/concepts/SwitchStatement__.ts.html +28 -58
- package/coverage/src/concepts/Theme__.ts.html +7 -7
- package/coverage/src/concepts/Transactional__.ts.html +1 -1
- package/coverage/src/concepts/TriggerEvent__.ts.html +21 -21
- package/coverage/src/concepts/TriggerLauncher__.ts.html +13 -43
- package/coverage/src/concepts/TypeAnnotation__.ts.html +106 -223
- package/coverage/src/concepts/TypeParam__.ts.html +11 -38
- package/coverage/src/concepts/UnaryExpression__.ts.html +28 -73
- package/coverage/src/concepts/Unparsed__.ts.html +6 -27
- package/coverage/src/concepts/UseComponent__.ts.html +1 -1
- package/coverage/src/concepts/ValidationRule__.ts.html +57 -60
- package/coverage/src/concepts/Variable__.ts.html +238 -142
- package/coverage/src/concepts/ViewBlock__.ts.html +1 -1
- package/coverage/src/concepts/ViewComponent__.ts.html +80 -8
- package/coverage/src/concepts/ViewElement__.ts.html +238 -463
- package/coverage/src/concepts/View__.ts.html +296 -251
- package/coverage/src/concepts/WhileStatement__.ts.html +54 -75
- package/coverage/src/concepts/basics/stdlib/index.html +8 -8
- 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 +130 -19
- package/coverage/src/concepts/basics/stdlib/nasl.validation.ts.html +1 -1
- package/coverage/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts.html +1 -1
- 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 +858 -858
- package/coverage/src/concepts/index.ts.html +1 -1
- package/coverage/src/concepts/index__.ts.html +2 -2
- package/coverage/src/config.ts.html +1 -1
- package/coverage/src/decorators/index.html +16 -16
- package/coverage/src/decorators/index.ts.html +40 -31
- package/coverage/src/decorators/promise.ts.html +10 -10
- package/coverage/src/eventBus.ts.html +1 -1
- package/coverage/src/generator/compileComponent.ts.html +4 -4
- package/coverage/src/generator/genBundleFiles.ts.html +23 -17
- package/coverage/src/generator/genHash.ts.html +3 -3
- package/coverage/src/generator/genMetaData.ts.html +31 -76
- package/coverage/src/generator/genReleaseBody.ts.html +4 -4
- package/coverage/src/generator/icestark.ts.html +4 -10
- package/coverage/src/generator/index.html +20 -20
- 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 +20 -92
- package/coverage/src/generator/qiankun.ts.html +3 -9
- package/coverage/src/generator/styleReplacer.ts.html +1 -1
- package/coverage/src/index.html +1 -1
- package/coverage/src/index.ts.html +7 -4
- package/coverage/src/manager/diagnostic.ts.html +14 -11
- package/coverage/src/manager/index.html +13 -13
- 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 +1 -1
- package/coverage/src/sentry/index.html +14 -14
- package/coverage/src/sentry/index.ts.html +32 -38
- 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 +4 -7
- package/coverage/src/server/formatTsUtils.ts.html +2 -2
- 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 +4 -4
- package/coverage/src/server/getInterfaces.ts.html +1 -1
- package/coverage/src/server/getLogging.ts.html +2 -2
- package/coverage/src/server/getLogics.ts.html +1 -1
- package/coverage/src/server/getMemberIdentifier.ts.html +128 -131
- package/coverage/src/server/getProcessComponents.ts.html +3 -3
- package/coverage/src/server/getProcesses.ts.html +1 -1
- package/coverage/src/server/getValidates.ts.html +4 -4
- package/coverage/src/server/index.html +26 -26
- package/coverage/src/server/index.ts.html +1 -1
- package/coverage/src/server/naslServer.ts.html +880 -1177
- package/coverage/src/server/naslStdlibMap.ts.html +1 -1
- package/coverage/src/server/process2LogicNamespace.ts.html +52 -52
- package/coverage/src/server/translator.ts.html +14 -50
- package/coverage/src/service/creator/add.configs.js.html +2 -2
- 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 +1 -1
- 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 +27 -27
- package/coverage/src/service/storage/index.ts.html +1 -1
- package/coverage/src/service/storage/init.ts.html +137 -110
- package/coverage/src/service/storage/jsoner.ts.html +13 -76
- package/coverage/src/service/storage/map.ts.html +3 -3
- 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 +56 -47
- package/coverage/src/templator/genCurdEditMultipleKeyBlock.ts.html +31 -49
- package/coverage/src/templator/genCurdMultipleKeyBlock.ts.html +89 -80
- package/coverage/src/templator/genEditTableBlock.ts.html +9 -12
- package/coverage/src/templator/genEnumSelectBlock.ts.html +1 -1
- package/coverage/src/templator/genGetBlock.ts.html +1 -1
- package/coverage/src/templator/genGridViewBlock.ts.html +1 -1
- package/coverage/src/templator/genListViewBlock.ts.html +1 -1
- package/coverage/src/templator/genQueryComponent.ts.html +1 -1
- package/coverage/src/templator/genSelectBlock.ts.html +1 -1
- package/coverage/src/templator/genTableBlock.ts.html +1 -1
- package/coverage/src/templator/genUpdateBlock.ts.html +36 -48
- package/coverage/src/templator/index.html +39 -39
- package/coverage/src/templator/index.ts.html +1 -1
- package/coverage/src/templator/utils.ts.html +11 -77
- package/coverage/src/translator/constant.ts.html +1 -1
- package/coverage/src/translator/index.html +21 -21
- package/coverage/src/translator/index.ts.html +1 -1
- package/coverage/src/translator/utils.ts.html +68 -389
- package/coverage/src/utils/cookie.ts.html +4 -4
- package/coverage/src/utils/env.ts.html +1 -1
- package/coverage/src/utils/index.html +41 -26
- package/coverage/src/utils/index.ts.html +9 -63
- package/coverage/src/utils/logger.ts.html +13 -13
- package/coverage/src/utils/sortTsString.ts.html +10 -25
- package/coverage/src/utils/string.ts.html +8 -110
- package/coverage/src/utils/time-slicing.ts.html +1 -1
- package/coverage/src/utils/traverse.ts.html +1 -1
- package/coverage/src/utils/window.ts.html +1 -1
- package/out/common/Command.js +1 -1
- package/out/common/Command.js.map +1 -1
- package/out/concepts/Match__.js +1 -1
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/View__.js +2 -2
- package/out/concepts/View__.js.map +1 -1
- package/package.json +1 -1
- package/src/common/Command.ts +1 -1
- package/src/concepts/Match__.ts +1 -1
- package/src/concepts/View__.ts +5 -5
- package/.nyc_output/processinfo/78804420-ead6-486f-b682-ab54ccd95dc9.json +0 -1
- package/coverage/cobertura-coverage.xml +0 -71878
- package/coverage/src/automate/engine/index.js.html +0 -1471
- package/coverage/src/automate/engine/operators.js.html +0 -862
- package/coverage/src/automate/engine/uniqueName.js.html +0 -412
- package/coverage/src/automate/engine/viewCache.js.html +0 -214
- package/coverage/src/automate/template/index.html +0 -116
- package/coverage/src/automate/template/myProcess.js.html +0 -34645
- package/coverage/src/common/utils.ts.html +0 -136
- package/coverage/src/concepts/DataElement__.ts.html +0 -118
- package/coverage/src/concepts/MetadataType__.ts.html +0 -2053
- package/coverage/src/utils/time-slicing/constant.ts.html +0 -196
- package/coverage/src/utils/time-slicing/index.html +0 -236
- package/coverage/src/utils/time-slicing/index.ts.html +0 -103
- package/coverage/src/utils/time-slicing/page-state.ts.html +0 -121
- package/coverage/src/utils/time-slicing/performance.ts.html +0 -253
- package/coverage/src/utils/time-slicing/runner.ts.html +0 -247
- package/coverage/src/utils/time-slicing/tool.ts.html +0 -220
- package/coverage/src/utils/time-slicing/utils.ts.html +0 -355
- package/coverage/src/utils/time-slicing/wrapper.ts.html +0 -259
- package/coverage/src/utils/time.ts.html +0 -118
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">5.
|
|
26
|
+
<span class="strong">5.38% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>35/
|
|
28
|
+
<span class='fraction'>35/650</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
33
|
<span class="strong">0.52% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>2/
|
|
35
|
+
<span class='fraction'>2/382</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">1.
|
|
40
|
+
<span class="strong">1.03% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>1/
|
|
42
|
+
<span class='fraction'>1/97</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">5.
|
|
47
|
+
<span class="strong">5.56% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>35/
|
|
49
|
+
<span class='fraction'>35/629</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -1266,7 +1266,16 @@
|
|
|
1266
1266
|
<a name='L1201'></a><a href='#L1201'>1201</a>
|
|
1267
1267
|
<a name='L1202'></a><a href='#L1202'>1202</a>
|
|
1268
1268
|
<a name='L1203'></a><a href='#L1203'>1203</a>
|
|
1269
|
-
<a name='L1204'></a><a href='#L1204'>1204</a
|
|
1269
|
+
<a name='L1204'></a><a href='#L1204'>1204</a>
|
|
1270
|
+
<a name='L1205'></a><a href='#L1205'>1205</a>
|
|
1271
|
+
<a name='L1206'></a><a href='#L1206'>1206</a>
|
|
1272
|
+
<a name='L1207'></a><a href='#L1207'>1207</a>
|
|
1273
|
+
<a name='L1208'></a><a href='#L1208'>1208</a>
|
|
1274
|
+
<a name='L1209'></a><a href='#L1209'>1209</a>
|
|
1275
|
+
<a name='L1210'></a><a href='#L1210'>1210</a>
|
|
1276
|
+
<a name='L1211'></a><a href='#L1211'>1211</a>
|
|
1277
|
+
<a name='L1212'></a><a href='#L1212'>1212</a>
|
|
1278
|
+
<a name='L1213'></a><a href='#L1213'>1213</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
|
1270
1279
|
<span class="cline-any cline-yes">1x</span>
|
|
1271
1280
|
<span class="cline-any cline-yes">1x</span>
|
|
1272
1281
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -1280,8 +1289,6 @@
|
|
|
1280
1289
|
<span class="cline-any cline-neutral"> </span>
|
|
1281
1290
|
<span class="cline-any cline-neutral"> </span>
|
|
1282
1291
|
<span class="cline-any cline-neutral"> </span>
|
|
1283
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1284
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1285
1292
|
<span class="cline-any cline-yes">1x</span>
|
|
1286
1293
|
<span class="cline-any cline-yes">1x</span>
|
|
1287
1294
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -1312,7 +1319,6 @@
|
|
|
1312
1319
|
<span class="cline-any cline-no"> </span>
|
|
1313
1320
|
<span class="cline-any cline-no"> </span>
|
|
1314
1321
|
<span class="cline-any cline-no"> </span>
|
|
1315
|
-
<span class="cline-any cline-no"> </span>
|
|
1316
1322
|
<span class="cline-any cline-neutral"> </span>
|
|
1317
1323
|
<span class="cline-any cline-no"> </span>
|
|
1318
1324
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1321,9 +1327,6 @@
|
|
|
1321
1327
|
<span class="cline-any cline-no"> </span>
|
|
1322
1328
|
<span class="cline-any cline-neutral"> </span>
|
|
1323
1329
|
<span class="cline-any cline-neutral"> </span>
|
|
1324
|
-
<span class="cline-any cline-no"> </span>
|
|
1325
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1326
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1327
1330
|
<span class="cline-any cline-neutral"> </span>
|
|
1328
1331
|
<span class="cline-any cline-no"> </span>
|
|
1329
1332
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1396,6 +1399,7 @@
|
|
|
1396
1399
|
<span class="cline-any cline-no"> </span>
|
|
1397
1400
|
<span class="cline-any cline-no"> </span>
|
|
1398
1401
|
<span class="cline-any cline-no"> </span>
|
|
1402
|
+
<span class="cline-any cline-no"> </span>
|
|
1399
1403
|
<span class="cline-any cline-neutral"> </span>
|
|
1400
1404
|
<span class="cline-any cline-no"> </span>
|
|
1401
1405
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1409,7 +1413,6 @@
|
|
|
1409
1413
|
<span class="cline-any cline-neutral"> </span>
|
|
1410
1414
|
<span class="cline-any cline-neutral"> </span>
|
|
1411
1415
|
<span class="cline-any cline-neutral"> </span>
|
|
1412
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1413
1416
|
<span class="cline-any cline-no"> </span>
|
|
1414
1417
|
<span class="cline-any cline-no"> </span>
|
|
1415
1418
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1486,16 +1489,6 @@
|
|
|
1486
1489
|
<span class="cline-any cline-no"> </span>
|
|
1487
1490
|
<span class="cline-any cline-no"> </span>
|
|
1488
1491
|
<span class="cline-any cline-no"> </span>
|
|
1489
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1490
|
-
<span class="cline-any cline-no"> </span>
|
|
1491
|
-
<span class="cline-any cline-no"> </span>
|
|
1492
|
-
<span class="cline-any cline-no"> </span>
|
|
1493
|
-
<span class="cline-any cline-no"> </span>
|
|
1494
|
-
<span class="cline-any cline-no"> </span>
|
|
1495
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1496
|
-
<span class="cline-any cline-no"> </span>
|
|
1497
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1498
|
-
<span class="cline-any cline-no"> </span>
|
|
1499
1492
|
<span class="cline-any cline-no"> </span>
|
|
1500
1493
|
<span class="cline-any cline-neutral"> </span>
|
|
1501
1494
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1517,8 +1510,6 @@
|
|
|
1517
1510
|
<span class="cline-any cline-neutral"> </span>
|
|
1518
1511
|
<span class="cline-any cline-no"> </span>
|
|
1519
1512
|
<span class="cline-any cline-no"> </span>
|
|
1520
|
-
<span class="cline-any cline-no"> </span>
|
|
1521
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1522
1513
|
<span class="cline-any cline-neutral"> </span>
|
|
1523
1514
|
<span class="cline-any cline-no"> </span>
|
|
1524
1515
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1557,7 +1548,6 @@
|
|
|
1557
1548
|
<span class="cline-any cline-neutral"> </span>
|
|
1558
1549
|
<span class="cline-any cline-neutral"> </span>
|
|
1559
1550
|
<span class="cline-any cline-neutral"> </span>
|
|
1560
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1561
1551
|
<span class="cline-any cline-no"> </span>
|
|
1562
1552
|
<span class="cline-any cline-no"> </span>
|
|
1563
1553
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1672,6 +1662,7 @@
|
|
|
1672
1662
|
<span class="cline-any cline-no"> </span>
|
|
1673
1663
|
<span class="cline-any cline-no"> </span>
|
|
1674
1664
|
<span class="cline-any cline-no"> </span>
|
|
1665
|
+
<span class="cline-any cline-no"> </span>
|
|
1675
1666
|
<span class="cline-any cline-neutral"> </span>
|
|
1676
1667
|
<span class="cline-any cline-neutral"> </span>
|
|
1677
1668
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1775,8 +1766,6 @@
|
|
|
1775
1766
|
<span class="cline-any cline-no"> </span>
|
|
1776
1767
|
<span class="cline-any cline-no"> </span>
|
|
1777
1768
|
<span class="cline-any cline-neutral"> </span>
|
|
1778
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1779
|
-
<span class="cline-any cline-no"> </span>
|
|
1780
1769
|
<span class="cline-any cline-no"> </span>
|
|
1781
1770
|
<span class="cline-any cline-no"> </span>
|
|
1782
1771
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1804,9 +1793,6 @@
|
|
|
1804
1793
|
<span class="cline-any cline-no"> </span>
|
|
1805
1794
|
<span class="cline-any cline-no"> </span>
|
|
1806
1795
|
<span class="cline-any cline-no"> </span>
|
|
1807
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1808
|
-
<span class="cline-any cline-no"> </span>
|
|
1809
|
-
<span class="cline-any cline-no"> </span>
|
|
1810
1796
|
<span class="cline-any cline-no"> </span>
|
|
1811
1797
|
<span class="cline-any cline-neutral"> </span>
|
|
1812
1798
|
<span class="cline-any cline-no"> </span>
|
|
@@ -1850,10 +1836,12 @@
|
|
|
1850
1836
|
<span class="cline-any cline-no"> </span>
|
|
1851
1837
|
<span class="cline-any cline-neutral"> </span>
|
|
1852
1838
|
<span class="cline-any cline-neutral"> </span>
|
|
1853
|
-
<span class="cline-any cline-neutral"> </span>
|
|
1854
1839
|
<span class="cline-any cline-no"> </span>
|
|
1855
1840
|
<span class="cline-any cline-no"> </span>
|
|
1856
1841
|
<span class="cline-any cline-no"> </span>
|
|
1842
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1843
|
+
<span class="cline-any cline-no"> </span>
|
|
1844
|
+
<span class="cline-any cline-no"> </span>
|
|
1857
1845
|
<span class="cline-any cline-no"> </span>
|
|
1858
1846
|
<span class="cline-any cline-neutral"> </span>
|
|
1859
1847
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -1894,6 +1882,7 @@
|
|
|
1894
1882
|
<span class="cline-any cline-neutral"> </span>
|
|
1895
1883
|
<span class="cline-any cline-neutral"> </span>
|
|
1896
1884
|
<span class="cline-any cline-neutral"> </span>
|
|
1885
|
+
<span class="cline-any cline-neutral"> </span>
|
|
1897
1886
|
<span class="cline-any cline-no"> </span>
|
|
1898
1887
|
<span class="cline-any cline-neutral"> </span>
|
|
1899
1888
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -2105,18 +2094,22 @@
|
|
|
2105
2094
|
<span class="cline-any cline-neutral"> </span>
|
|
2106
2095
|
<span class="cline-any cline-neutral"> </span>
|
|
2107
2096
|
<span class="cline-any cline-neutral"> </span>
|
|
2097
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2108
2098
|
<span class="cline-any cline-no"> </span>
|
|
2109
2099
|
<span class="cline-any cline-no"> </span>
|
|
2110
2100
|
<span class="cline-any cline-no"> </span>
|
|
2111
2101
|
<span class="cline-any cline-no"> </span>
|
|
2102
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2112
2103
|
<span class="cline-any cline-no"> </span>
|
|
2113
2104
|
<span class="cline-any cline-no"> </span>
|
|
2114
2105
|
<span class="cline-any cline-no"> </span>
|
|
2115
2106
|
<span class="cline-any cline-no"> </span>
|
|
2116
|
-
<span class="cline-any cline-no"> </span>
|
|
2117
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2118
2107
|
<span class="cline-any cline-neutral"> </span>
|
|
2108
|
+
<span class="cline-any cline-no"> </span>
|
|
2109
|
+
<span class="cline-any cline-no"> </span>
|
|
2119
2110
|
<span class="cline-any cline-neutral"> </span>
|
|
2111
|
+
<span class="cline-any cline-no"> </span>
|
|
2112
|
+
<span class="cline-any cline-no"> </span>
|
|
2120
2113
|
<span class="cline-any cline-neutral"> </span>
|
|
2121
2114
|
<span class="cline-any cline-no"> </span>
|
|
2122
2115
|
<span class="cline-any cline-no"> </span>
|
|
@@ -2126,21 +2119,47 @@
|
|
|
2126
2119
|
<span class="cline-any cline-neutral"> </span>
|
|
2127
2120
|
<span class="cline-any cline-neutral"> </span>
|
|
2128
2121
|
<span class="cline-any cline-neutral"> </span>
|
|
2122
|
+
<span class="cline-any cline-no"> </span>
|
|
2129
2123
|
<span class="cline-any cline-neutral"> </span>
|
|
2130
2124
|
<span class="cline-any cline-neutral"> </span>
|
|
2131
2125
|
<span class="cline-any cline-neutral"> </span>
|
|
2126
|
+
<span class="cline-any cline-no"> </span>
|
|
2127
|
+
<span class="cline-any cline-no"> </span>
|
|
2128
|
+
<span class="cline-any cline-no"> </span>
|
|
2129
|
+
<span class="cline-any cline-no"> </span>
|
|
2130
|
+
<span class="cline-any cline-no"> </span>
|
|
2131
|
+
<span class="cline-any cline-no"> </span>
|
|
2132
|
+
<span class="cline-any cline-no"> </span>
|
|
2133
|
+
<span class="cline-any cline-no"> </span>
|
|
2134
|
+
<span class="cline-any cline-no"> </span>
|
|
2132
2135
|
<span class="cline-any cline-neutral"> </span>
|
|
2133
2136
|
<span class="cline-any cline-neutral"> </span>
|
|
2134
|
-
<span class="cline-any cline-no"> </span>
|
|
2135
2137
|
<span class="cline-any cline-neutral"> </span>
|
|
2138
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2139
|
+
<span class="cline-any cline-no"> </span>
|
|
2140
|
+
<span class="cline-any cline-no"> </span>
|
|
2141
|
+
<span class="cline-any cline-no"> </span>
|
|
2136
2142
|
<span class="cline-any cline-no"> </span>
|
|
2137
2143
|
<span class="cline-any cline-no"> </span>
|
|
2138
2144
|
<span class="cline-any cline-no"> </span>
|
|
2139
2145
|
<span class="cline-any cline-neutral"> </span>
|
|
2140
2146
|
<span class="cline-any cline-neutral"> </span>
|
|
2141
2147
|
<span class="cline-any cline-neutral"> </span>
|
|
2148
|
+
<span class="cline-any cline-no"> </span>
|
|
2149
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2150
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2151
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2152
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2153
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2154
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2155
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2156
|
+
<span class="cline-any cline-neutral"> </span>
|
|
2142
2157
|
<span class="cline-any cline-neutral"> </span>
|
|
2158
|
+
<span class="cline-any cline-no"> </span>
|
|
2159
|
+
<span class="cline-any cline-no"> </span>
|
|
2143
2160
|
<span class="cline-any cline-neutral"> </span>
|
|
2161
|
+
<span class="cline-any cline-no"> </span>
|
|
2162
|
+
<span class="cline-any cline-no"> </span>
|
|
2144
2163
|
<span class="cline-any cline-neutral"> </span>
|
|
2145
2164
|
<span class="cline-any cline-neutral"> </span>
|
|
2146
2165
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -2387,7 +2406,6 @@
|
|
|
2387
2406
|
<span class="cline-any cline-neutral"> </span>
|
|
2388
2407
|
<span class="cline-any cline-neutral"> </span>
|
|
2389
2408
|
<span class="cline-any cline-neutral"> </span>
|
|
2390
|
-
<span class="cline-any cline-neutral"> </span>
|
|
2391
2409
|
<span class="cline-any cline-no"> </span>
|
|
2392
2410
|
<span class="cline-any cline-no"> </span>
|
|
2393
2411
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -2470,7 +2488,7 @@
|
|
|
2470
2488
|
<span class="cline-any cline-no"> </span>
|
|
2471
2489
|
<span class="cline-any cline-neutral"> </span>
|
|
2472
2490
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">import { cloneDeep } from 'lodash';
|
|
2473
|
-
import { App, LogicItem, Logic, Module, View, ViewElement, Argument, SelectMembers, SyntaxNode, BindDirective, CallLogic } from '../../concepts';
|
|
2491
|
+
import { App, LogicItem, Logic, Module, View, ViewElement, Argument, SelectMembers, SyntaxNode, BindDirective, CallLogic, BindAttribute } from '../../concepts';
|
|
2474
2492
|
import { addBreakpointNodesFromApp } from '../../breakpoint';
|
|
2475
2493
|
import { getConceptConstructor } from '../../decorators';
|
|
2476
2494
|
import { config } from '../../config';
|
|
@@ -2483,8 +2501,6 @@ import * as fs from 'fs-extra';
|
|
|
2483
2501
|
import type { NaslServer } from 'src/server/naslServer';
|
|
2484
2502
|
/// #endif
|
|
2485
2503
|
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
2504
|
export const batchQuery = storageService.batchQuery;
|
|
2489
2505
|
export const batchAction = storageService.batchAction;
|
|
2490
2506
|
export const batchInstruct = storageService.batchInstruct;
|
|
@@ -2507,25 +2523,21 @@ export function <span class="fstat-no" title="function not covered" >doOperation
|
|
|
2507
2523
|
};
|
|
2508
2524
|
|
|
2509
2525
|
<span class="cstat-no" title="statement not covered" > request.onsuccess = <span class="fstat-no" title="function not covered" >(e</span>vent: any) => {</span>
|
|
2510
|
-
<span class="cstat-no" title="statement not covered" >
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
<span class="cstat-no" title="statement not covered" >
|
|
2515
|
-
<span class="cstat-no" title="statement not covered" >
|
|
2516
|
-
<span class="cstat-no" title="statement not covered" >
|
|
2517
|
-
<span class="cstat-no" title="statement not covered" >
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
<span class="cstat-no" title="statement not covered" >
|
|
2523
|
-
<span class="cstat-no" title="statement not covered" >
|
|
2524
|
-
|
|
2525
|
-
};
|
|
2526
|
-
} catch(err) {
|
|
2527
|
-
<span class="cstat-no" title="statement not covered" > console.log(err);</span>
|
|
2528
|
-
}
|
|
2526
|
+
const db = <span class="cstat-no" title="statement not covered" >event.target.result;</span>
|
|
2527
|
+
const transaction = <span class="cstat-no" title="statement not covered" >db.transaction('operationRecord', 'readwrite');</span>
|
|
2528
|
+
const objectStore = <span class="cstat-no" title="statement not covered" >transaction.objectStore('operationRecord');</span>
|
|
2529
|
+
<span class="cstat-no" title="statement not covered" > operation.appId = operationRecordInfoMap.get('appId');</span>
|
|
2530
|
+
<span class="cstat-no" title="statement not covered" > operation.branchId = operationRecordInfoMap.get('branchId');</span>
|
|
2531
|
+
<span class="cstat-no" title="statement not covered" > operation.accountId = operationRecordInfoMap.get('accountId');</span>
|
|
2532
|
+
<span class="cstat-no" title="statement not covered" > operation.userId = operationRecordInfoMap.get('userId');</span>
|
|
2533
|
+
<span class="cstat-no" title="statement not covered" > operation.phone = operationRecordInfoMap.get('phone');</span>
|
|
2534
|
+
// 将时间戳添加到记录中
|
|
2535
|
+
<span class="cstat-no" title="statement not covered" > operation.timestamp = Date.now();</span>
|
|
2536
|
+
// 这份数据不存在向上的引用,因此用cloneDeep没有关系
|
|
2537
|
+
<span class="cstat-no" title="statement not covered" > objectStore.put(cloneDeep(operation));</span>
|
|
2538
|
+
<span class="cstat-no" title="statement not covered" > transaction.oncomplete = <span class="fstat-no" title="function not covered" >() =</span>> {</span>
|
|
2539
|
+
<span class="cstat-no" title="statement not covered" > db.close();</span>
|
|
2540
|
+
};
|
|
2529
2541
|
};
|
|
2530
2542
|
|
|
2531
2543
|
<span class="cstat-no" title="statement not covered" > request.onerror = <span class="fstat-no" title="function not covered" >function(e</span>vent) {</span>
|
|
@@ -2582,6 +2594,7 @@ async function <span class="fstat-no" title="function not covered" >deleteExpire
|
|
|
2582
2594
|
export function <span class="fstat-no" title="function not covered" >operationRecordQuery(</span>app: any) {
|
|
2583
2595
|
<span class="cstat-no" title="statement not covered" > return new Promise(<span class="fstat-no" title="function not covered" >(r</span>esolve, reject) => {</span>
|
|
2584
2596
|
const appId = <span class="cstat-no" title="statement not covered" >app?.id;</span>
|
|
2597
|
+
const branchId = <span class="cstat-no" title="statement not covered" >app?.__branchId;</span>
|
|
2585
2598
|
const request = <span class="cstat-no" title="statement not covered" >indexedDB.open('naslData', 1);</span>
|
|
2586
2599
|
<span class="cstat-no" title="statement not covered" > request.onsuccess = <span class="fstat-no" title="function not covered" >(e</span>vent: any) => {</span>
|
|
2587
2600
|
const db = <span class="cstat-no" title="statement not covered" >event.target.result;</span>
|
|
@@ -2589,9 +2602,9 @@ export function <span class="fstat-no" title="function not covered" >operationRe
|
|
|
2589
2602
|
const objectStore = <span class="cstat-no" title="statement not covered" >transaction.objectStore('operationRecord');</span>
|
|
2590
2603
|
const index = <span class="cstat-no" title="statement not covered" >objectStore.index('appId');</span> // 查询 'appId' 索引
|
|
2591
2604
|
const range = <span class="cstat-no" title="statement not covered" >IDBKeyRange.only(appId);</span>
|
|
2592
|
-
const request = <span class="cstat-no" title="statement not covered" >index.openCursor(range);</span>
|
|
2593
2605
|
const result: any[] = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
2594
2606
|
|
|
2607
|
+
const request = <span class="cstat-no" title="statement not covered" >index.openCursor(range);</span>
|
|
2595
2608
|
<span class="cstat-no" title="statement not covered" > request.onsuccess = <span class="fstat-no" title="function not covered" >(e</span>vent: any) => {</span>
|
|
2596
2609
|
const cursor = <span class="cstat-no" title="statement not covered" >event.target.result;</span>
|
|
2597
2610
|
<span class="cstat-no" title="statement not covered" > if (cursor) {</span>
|
|
@@ -2610,7 +2623,6 @@ export function <span class="fstat-no" title="function not covered" >operationRe
|
|
|
2610
2623
|
<span class="cstat-no" title="statement not covered" > transaction.oncomplete = <span class="fstat-no" title="function not covered" >() =</span>> {</span>
|
|
2611
2624
|
<span class="cstat-no" title="statement not covered" > db.close();</span>
|
|
2612
2625
|
};
|
|
2613
|
-
|
|
2614
2626
|
};
|
|
2615
2627
|
|
|
2616
2628
|
<span class="cstat-no" title="statement not covered" > request.onerror = <span class="fstat-no" title="function not covered" >(e</span>vent) => {</span>
|
|
@@ -2649,14 +2661,14 @@ function <span class="fstat-no" title="function not covered" >getParentInfo(</sp
|
|
|
2649
2661
|
}
|
|
2650
2662
|
|
|
2651
2663
|
// 操作记录回放
|
|
2652
|
-
export async function <span class="fstat-no" title="function not covered" >operationRecordPlayback(</span>app: any,
|
|
2664
|
+
export async function <span class="fstat-no" title="function not covered" >operationRecordPlayback(</span>app: any, action: 'undo' | 'redo') {
|
|
2653
2665
|
const operationRecord: any = <span class="cstat-no" title="statement not covered" >await operationRecordQuery(app);</span>
|
|
2654
2666
|
let operationRecordIndex = <span class="cstat-no" title="statement not covered" >operationRecordInfoMap.get('operationRecordIndex');</span>
|
|
2655
2667
|
<span class="cstat-no" title="statement not covered" > if ([null, undefined].includes(operationRecordIndex)) {</span>
|
|
2656
2668
|
<span class="cstat-no" title="statement not covered" > operationRecordIndex = operationRecord?.length;</span>
|
|
2657
2669
|
}
|
|
2658
2670
|
const appJson = <span class="cstat-no" title="statement not covered" >app.toJSON();</span>
|
|
2659
|
-
<span class="cstat-no" title="statement not covered" > if (
|
|
2671
|
+
<span class="cstat-no" title="statement not covered" > if (action === 'undo') {</span>
|
|
2660
2672
|
<span class="cstat-no" title="statement not covered" > if (operationRecordIndex > 0) {</span>
|
|
2661
2673
|
const currentRecordItem = <span class="cstat-no" title="statement not covered" >operationRecord?.[operationRecordIndex];</span>
|
|
2662
2674
|
const { type, action: recordItemAction } = <span class="cstat-no" title="statement not covered" >currentRecordItem || {};</span>
|
|
@@ -2686,19 +2698,9 @@ export async function <span class="fstat-no" title="function not covered" >opera
|
|
|
2686
2698
|
const { actionItem } = <span class="cstat-no" title="statement not covered" >recordItem || {};</span>
|
|
2687
2699
|
const { list } = <span class="cstat-no" title="statement not covered" >actionItem || {};</span>
|
|
2688
2700
|
<span class="cstat-no" title="statement not covered" > [...(list || [])].reverse().forEach(<span class="fstat-no" title="function not covered" >(a</span>ctionItem: any) => {</span>
|
|
2689
|
-
const { path, action,
|
|
2701
|
+
const { path, action, oldObject, parentKey, index: oldIndex } = <span class="cstat-no" title="statement not covered" >actionItem || {};</span>
|
|
2690
2702
|
const { parentNode } = <span class="cstat-no" title="statement not covered" >getParentInfo(appJson, path);</span>
|
|
2691
|
-
|
|
2692
|
-
// 如果涉及到改名操作,需要特殊处理
|
|
2693
|
-
<span class="cstat-no" title="statement not covered" > if (operationRecordAction === 'undo' && action === 'update' && object?.name) {</span>
|
|
2694
|
-
const pathArr = <span class="cstat-no" title="statement not covered" >path?.split('.') || [];</span>
|
|
2695
|
-
const lastPathItem = <span class="cstat-no" title="statement not covered" >pathArr?.pop();</span>
|
|
2696
|
-
<span class="cstat-no" title="statement not covered" > if (lastPathItem) {</span>
|
|
2697
|
-
<span class="cstat-no" title="statement not covered" > pathArr.push(lastPathItem.replace(/(name=)[^\]]+/, `$1${object?.name}`));</span>
|
|
2698
|
-
}
|
|
2699
|
-
<span class="cstat-no" title="statement not covered" > newPath = pathArr.join('.');</span>
|
|
2700
|
-
}
|
|
2701
|
-
const node = <span class="cstat-no" title="statement not covered" >jsoner.queryNodeByPath(appJson, newPath);</span>
|
|
2703
|
+
const node = <span class="cstat-no" title="statement not covered" >jsoner.queryNodeByPath(appJson, path);</span>
|
|
2702
2704
|
<span class="cstat-no" title="statement not covered" > switch (action) {</span>
|
|
2703
2705
|
case 'create':
|
|
2704
2706
|
<span class="cstat-no" title="statement not covered" > if (Array.isArray(parentNode)) {</span>
|
|
@@ -2719,9 +2721,7 @@ export async function <span class="fstat-no" title="function not covered" >opera
|
|
|
2719
2721
|
<span class="cstat-no" title="statement not covered" > break;</span>
|
|
2720
2722
|
case 'update':
|
|
2721
2723
|
<span class="cstat-no" title="statement not covered" > for (const key in oldObject) {</span>
|
|
2722
|
-
<span class="cstat-no" title="statement not covered" >
|
|
2723
|
-
(<span class="cstat-no" title="statement not covered" >node as any)[key] = oldObject[key] ?? null;</span>
|
|
2724
|
-
}
|
|
2724
|
+
(<span class="cstat-no" title="statement not covered" >node as any)[key] = oldObject[key] ?? null;</span>
|
|
2725
2725
|
}
|
|
2726
2726
|
<span class="cstat-no" title="statement not covered" > break;</span>
|
|
2727
2727
|
}
|
|
@@ -2758,7 +2758,6 @@ function <span class="fstat-no" title="function not covered" >getLogic(</span>ke
|
|
|
2758
2758
|
}
|
|
2759
2759
|
}
|
|
2760
2760
|
}
|
|
2761
|
-
|
|
2762
2761
|
/* 获取LogicITEM */
|
|
2763
2762
|
function <span class="fstat-no" title="function not covered" >getStatement(</span>state: any, app: any, diffLogicList: string[]) {
|
|
2764
2763
|
let logicItems = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
@@ -2869,6 +2868,7 @@ async function <span class="fstat-no" title="function not covered" >doAction(</s
|
|
|
2869
2868
|
let hasFrontEnd = <span class="cstat-no" title="statement not covered" >false;</span>
|
|
2870
2869
|
let hasBackEnd = <span class="cstat-no" title="statement not covered" >false;</span>
|
|
2871
2870
|
const actionList: any[] = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
2871
|
+
const allRiskList: any[] = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
2872
2872
|
const { list, actionMsg, action } = <span class="cstat-no" title="statement not covered" >actionItem || {};</span>
|
|
2873
2873
|
<span class="cstat-no" title="statement not covered" > handleAIPoint(app, actionItem);</span>
|
|
2874
2874
|
const itemloop = <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >(_</span>i: LogicItem, app: any, diffArr: string[]) => {</span>
|
|
@@ -2949,8 +2949,8 @@ async function <span class="fstat-no" title="function not covered" >doAction(</s
|
|
|
2949
2949
|
}
|
|
2950
2950
|
<span class="cstat-no" title="statement not covered" > if (emitTarget.concept === 'Logic') {</span>
|
|
2951
2951
|
const diffArr: string[] = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
2952
|
-
<span class="cstat-no" title="statement not covered" > if (emitTarget.body.length > 2) {</span>
|
|
2953
|
-
<span class="cstat-no" title="statement not covered" >
|
|
2952
|
+
<span class="cstat-no" title="statement not covered" > if ((emitTarget as Logic).body.length > 2) {</span>
|
|
2953
|
+
(<span class="cstat-no" title="statement not covered" >emitTarget as Logic).body.forEach(<span class="fstat-no" title="function not covered" >(i</span>t: LogicItem) => {</span>
|
|
2954
2954
|
<span class="cstat-no" title="statement not covered" > itemloop(it, app, diffArr);</span>
|
|
2955
2955
|
});
|
|
2956
2956
|
}
|
|
@@ -2978,13 +2978,11 @@ async function <span class="fstat-no" title="function not covered" >doAction(</s
|
|
|
2978
2978
|
<span class="cstat-no" title="statement not covered" > if (getMiniAppChange(emitTarget, event?.originEvent?.object, event?.originEvent?.action)) {</span>
|
|
2979
2979
|
<span class="cstat-no" title="statement not covered" > hasBackEnd = true;</span>
|
|
2980
2980
|
}
|
|
2981
|
-
|
|
2982
2981
|
const isDelete = <span class="cstat-no" title="statement not covered" >event?.originEvent?.action === 'delete';</span>
|
|
2983
|
-
const isAuthView = <span class="cstat-no" title="statement not covered" >emitTarget.auth && event?.originEvent?.object?.name;</span>
|
|
2984
|
-
const isUpdateAuth = <span class="cstat-no" title="statement not covered" >event?.originEvent?.action === 'update' &&
|
|
2985
|
-
const isUpdateAuthDes = <span class="cstat-no" title="statement not covered" >event?.originEvent?.action === 'update' && "authDescription" in (event?.originEvent?.object || {});</span>
|
|
2982
|
+
const isAuthView = (<span class="cstat-no" title="statement not covered" >emitTarget as View).auth && event?.originEvent?.object?.name;</span>
|
|
2983
|
+
const isUpdateAuth = <span class="cstat-no" title="statement not covered" >event?.originEvent?.action === 'update' && event?.originEvent?.object && event?.originEvent?.object?.auth</span>
|
|
2986
2984
|
const isUpdateBindRoles = <span class="cstat-no" title="statement not covered" >event?.originEvent?.action === 'update' && event?.originEvent?.object && event?.originEvent?.object?.bindRoles;</span>
|
|
2987
|
-
<span class="cstat-no" title="statement not covered" > if (isDelete || isUpdateAuth || isUpdateBindRoles || isAuthView
|
|
2985
|
+
<span class="cstat-no" title="statement not covered" > if (isDelete || isUpdateAuth || isUpdateBindRoles || isAuthView) {</span>
|
|
2988
2986
|
<span class="cstat-no" title="statement not covered" > hasBackEnd = true;</span>
|
|
2989
2987
|
// const app = emitTarget.app;
|
|
2990
2988
|
// const diffArr: string[] = [];
|
|
@@ -3004,12 +3002,9 @@ async function <span class="fstat-no" title="function not covered" >doAction(</s
|
|
|
3004
3002
|
}
|
|
3005
3003
|
<span class="cstat-no" title="statement not covered" > hasFrontEnd = true;</span>
|
|
3006
3004
|
}
|
|
3007
|
-
<span class="cstat-no" title="statement not covered" >
|
|
3008
|
-
<span class="cstat-no" title="statement not covered" > if ("authDescription" in (event?.originEvent?.object || {})) {</span>
|
|
3009
|
-
<span class="cstat-no" title="statement not covered" > hasBackEnd = true;</span>
|
|
3010
|
-
} ;
|
|
3005
|
+
<span class="cstat-no" title="statement not covered" > if (emitTarget.concept === 'ViewElement') {</span>
|
|
3011
3006
|
<span class="cstat-no" title="statement not covered" > if (event?.originEvent?.object?.name) {</span>
|
|
3012
|
-
const bindDirective = <span class="cstat-no" title="statement not covered" >emitTarget.bindDirectives.find(</span>
|
|
3007
|
+
const bindDirective = (<span class="cstat-no" title="statement not covered" >emitTarget as ViewElement).bindDirectives.find(</span>
|
|
3013
3008
|
<span class="fstat-no" title="function not covered" > (i</span>tem: BindDirective) => <span class="cstat-no" title="statement not covered" >item.name === 'auth'</span>
|
|
3014
3009
|
)
|
|
3015
3010
|
<span class="cstat-no" title="statement not covered" > if (bindDirective) {</span>
|
|
@@ -3017,31 +3012,31 @@ async function <span class="fstat-no" title="function not covered" >doAction(</s
|
|
|
3017
3012
|
}
|
|
3018
3013
|
}
|
|
3019
3014
|
<span class="cstat-no" title="statement not covered" > if (event?.originEvent?.action === 'delete') {</span>
|
|
3020
|
-
const bindDirective = <span class="cstat-no" title="statement not covered" >emitTarget?.bindDirectives?.find(</span>
|
|
3015
|
+
const bindDirective = (<span class="cstat-no" title="statement not covered" >emitTarget as ViewElement)?.bindDirectives?.find(</span>
|
|
3021
3016
|
<span class="fstat-no" title="function not covered" > (i</span>tem: BindDirective) => <span class="cstat-no" title="statement not covered" >item.name === 'auth'</span>
|
|
3022
3017
|
)
|
|
3023
3018
|
<span class="cstat-no" title="statement not covered" > if (bindDirective) {</span>
|
|
3024
3019
|
<span class="cstat-no" title="statement not covered" > hasBackEnd = true</span>
|
|
3025
3020
|
}
|
|
3026
|
-
<span class="cstat-no" title="statement not covered" > loopEleAuth(emitTarget)</span>
|
|
3021
|
+
<span class="cstat-no" title="statement not covered" > loopEleAuth((emitTarget as ViewElement))</span>
|
|
3027
3022
|
}
|
|
3028
3023
|
<span class="cstat-no" title="statement not covered" > if (event?.originEvent?.action !== 'create') {</span>
|
|
3029
3024
|
<span class="cstat-no" title="statement not covered" > if (event?.originEvent?.object && event?.originEvent?.object?.bindRoles) {</span>
|
|
3030
3025
|
<span class="cstat-no" title="statement not covered" > hasBackEnd = true</span>
|
|
3031
3026
|
}
|
|
3032
3027
|
}
|
|
3033
|
-
<span class="cstat-no" title="statement not covered" > loopEle(emitTarget, true)</span>
|
|
3028
|
+
<span class="cstat-no" title="statement not covered" > loopEle((emitTarget as ViewElement), true)</span>
|
|
3034
3029
|
}
|
|
3035
3030
|
<span class="cstat-no" title="statement not covered" > if (emitTarget.concept === 'BindAttribute' && emitTarget.name === 'url') {</span>
|
|
3036
3031
|
const needUpdateBackEnd =
|
|
3037
|
-
<span class="cstat-no" title="statement not covered" >
|
|
3038
|
-
<span class="cstat-no" title="statement not covered" > if (!emitTarget.view.parentAuth && needUpdateBackEnd) {</span>
|
|
3032
|
+
(<span class="cstat-no" title="statement not covered" >emitTarget as BindAttribute)?.value?.endsWith('/import') || (emitTarget as BindAttribute)?.value?.includes('/upload/')</span>
|
|
3033
|
+
<span class="cstat-no" title="statement not covered" > if (!(emitTarget as BindAttribute).view.parentAuth && needUpdateBackEnd) {</span>
|
|
3039
3034
|
<span class="cstat-no" title="statement not covered" > hasBackEnd = true</span>
|
|
3040
3035
|
}
|
|
3041
3036
|
}
|
|
3042
3037
|
<span class="cstat-no" title="statement not covered" > if (emitTarget.concept === 'CallLogic') {</span>
|
|
3043
3038
|
const arrlist: string[] = <span class="cstat-no" title="statement not covered" >[];</span>
|
|
3044
|
-
<span class="cstat-no" title="statement not covered" > getLogic((emitTarget as CallLogic).calleeKey, emitTarget.app, arrlist);</span>
|
|
3039
|
+
<span class="cstat-no" title="statement not covered" > getLogic((emitTarget as CallLogic).calleeKey, (emitTarget as CallLogic).app, arrlist);</span>
|
|
3045
3040
|
const result = <span class="cstat-no" title="statement not covered" >arrlist.filter(<span class="fstat-no" title="function not covered" >(i</span>tem) => <span class="cstat-no" title="statement not covered" >item.startsWith('app') || item.startsWith('extensions'))</span>;</span>
|
|
3046
3041
|
// console.log(result, 'CallLogic');
|
|
3047
3042
|
<span class="cstat-no" title="statement not covered" > if (result.length) {</span>
|
|
@@ -3053,8 +3048,10 @@ async function <span class="fstat-no" title="function not covered" >doAction(</s
|
|
|
3053
3048
|
<span class="cstat-no" title="statement not covered" > hasBackEnd = true;</span>
|
|
3054
3049
|
}
|
|
3055
3050
|
}
|
|
3056
|
-
|
|
3057
|
-
<span class="cstat-no" title="statement not covered" >
|
|
3051
|
+
<span class="cstat-no" title="statement not covered" > event.eventList.forEach(<span class="fstat-no" title="function not covered" >({</span> action, riskList, path, object: objItem }: { action: string; riskList: string; path: string; object: any }) => {</span>
|
|
3052
|
+
<span class="cstat-no" title="statement not covered" > if (riskList) {</span>
|
|
3053
|
+
<span class="cstat-no" title="statement not covered" > allRiskList.push(...(riskList || []));</span>
|
|
3054
|
+
}
|
|
3058
3055
|
<span class="cstat-no" title="statement not covered" > if (Array.isArray(objItem)) {</span>
|
|
3059
3056
|
<span class="cstat-no" title="statement not covered" > if (action === 'update') {</span>
|
|
3060
3057
|
<span class="cstat-no" title="statement not covered" > actionList.push({</span>
|
|
@@ -3096,6 +3093,7 @@ async function <span class="fstat-no" title="function not covered" >doAction(</s
|
|
|
3096
3093
|
const instructList = <span class="cstat-no" title="statement not covered" >[{</span>
|
|
3097
3094
|
uuid,
|
|
3098
3095
|
actions: actionList,
|
|
3096
|
+
riskList: allRiskList
|
|
3099
3097
|
}];
|
|
3100
3098
|
const operation: Operation = <span class="cstat-no" title="statement not covered" >{</span>
|
|
3101
3099
|
type: 'doAction',
|
|
@@ -3221,7 +3219,7 @@ class TaskQueue {
|
|
|
3221
3219
|
});
|
|
3222
3220
|
|
|
3223
3221
|
// code: 401650, 检测到当前应用拉取操作已被强制结束, 用户确认后再刷新
|
|
3224
|
-
// code: 500502 msg:
|
|
3222
|
+
// code: 500502 msg: "该应用已在新tab 页打开,请刷新!" 不重试或刷新
|
|
3225
3223
|
<span class="cstat-no" title="statement not covered" > if (!error)</span>
|
|
3226
3224
|
<span class="cstat-no" title="statement not covered" > this.recover(app);</span>
|
|
3227
3225
|
else <span class="cstat-no" title="statement not covered" >if (![401650, 500502].includes(error.code)) {</span>
|
|
@@ -3307,6 +3305,35 @@ class Operation {
|
|
|
3307
3305
|
action?: string;
|
|
3308
3306
|
}
|
|
3309
3307
|
|
|
3308
|
+
// 确保操作非高危
|
|
3309
|
+
function <span class="fstat-no" title="function not covered" >ensureSafe(</span>instructList: any[]) {
|
|
3310
|
+
const riskList: any[] = <span class="cstat-no" title="statement not covered" >[]</span>
|
|
3311
|
+
<span class="cstat-no" title="statement not covered" > instructList?.forEach(<span class="fstat-no" title="function not covered" >(i</span>nstruct) => {</span>
|
|
3312
|
+
<span class="cstat-no" title="statement not covered" > if (instruct?.riskList) {</span>
|
|
3313
|
+
<span class="cstat-no" title="statement not covered" > riskList.push(...(instruct.riskList || []));</span>
|
|
3314
|
+
}
|
|
3315
|
+
<span class="cstat-no" title="statement not covered" > instruct?.actions?.forEach(<span class="fstat-no" title="function not covered" >(a</span>ctionItem: any) => {</span>
|
|
3316
|
+
const { path, action, object } = <span class="cstat-no" title="statement not covered" >actionItem || {};</span>
|
|
3317
|
+
<span class="cstat-no" title="statement not covered" > if (path === 'app') {</span>
|
|
3318
|
+
<span class="cstat-no" title="statement not covered" > switch(action) {</span>
|
|
3319
|
+
case 'create':
|
|
3320
|
+
<span class="cstat-no" title="statement not covered" > riskList.push('重复创建App');</span>
|
|
3321
|
+
<span class="cstat-no" title="statement not covered" > break;</span>
|
|
3322
|
+
case 'delete':
|
|
3323
|
+
<span class="cstat-no" title="statement not covered" > riskList.push('删除App');</span>
|
|
3324
|
+
<span class="cstat-no" title="statement not covered" > break;</span>
|
|
3325
|
+
case 'update':
|
|
3326
|
+
<span class="cstat-no" title="statement not covered" > if (object?.hasOwnProperty('id')) {</span>
|
|
3327
|
+
<span class="cstat-no" title="statement not covered" > riskList.push('修改AppId');</span>
|
|
3328
|
+
}
|
|
3329
|
+
<span class="cstat-no" title="statement not covered" > break;</span>
|
|
3330
|
+
}
|
|
3331
|
+
}
|
|
3332
|
+
});
|
|
3333
|
+
});
|
|
3334
|
+
<span class="cstat-no" title="statement not covered" > return riskList;</span>
|
|
3335
|
+
}
|
|
3336
|
+
|
|
3310
3337
|
async function <span class="fstat-no" title="function not covered" >_saveNasl(</span>options: TaskOption) {
|
|
3311
3338
|
const { app, hasFrontEnd, hasBackEnd, instructList, operationList } = <span class="cstat-no" title="statement not covered" >options;</span>
|
|
3312
3339
|
<span class="cstat-no" title="statement not covered" > app.emit('saving');</span>
|
|
@@ -3323,6 +3350,12 @@ async function <span class="fstat-no" title="function not covered" >_saveNasl(</
|
|
|
3323
3350
|
|
|
3324
3351
|
<span class="cstat-no" title="statement not covered" > if (config.storage.protocol === 'http') {</span>
|
|
3325
3352
|
<span class="cstat-no" title="statement not covered" > try {</span>
|
|
3353
|
+
const riskList = <span class="cstat-no" title="statement not covered" >ensureSafe(instructList);</span>
|
|
3354
|
+
<span class="cstat-no" title="statement not covered" > if (Array.isArray(riskList) && riskList.length) {</span>
|
|
3355
|
+
<span class="cstat-no" title="statement not covered" > throw Error(`存在以下高危操作:\n${riskList.map(<span class="fstat-no" title="function not covered" >(r</span>isk, index) => {</span>
|
|
3356
|
+
<span class="cstat-no" title="statement not covered" > return `${index + 1}.${risk};`;</span>
|
|
3357
|
+
}).join('\n')}\n请及时排查原因`);
|
|
3358
|
+
}
|
|
3326
3359
|
// 接口请求
|
|
3327
3360
|
<span class="cstat-no" title="statement not covered" > res = await storageService.batchInstruct({</span>
|
|
3328
3361
|
body: instructList,
|
|
@@ -3335,18 +3368,13 @@ async function <span class="fstat-no" title="function not covered" >_saveNasl(</
|
|
|
3335
3368
|
});
|
|
3336
3369
|
} catch (error) {
|
|
3337
3370
|
<span class="cstat-no" title="statement not covered" > err = error;</span>
|
|
3371
|
+
<span class="cstat-no" title="statement not covered" > console.error(err);</span>
|
|
3338
3372
|
}
|
|
3339
|
-
const { code, msg, result, success } = <span class="cstat-no" title="statement not covered" >err || {};</span>
|
|
3340
3373
|
<span class="cstat-no" title="statement not covered" > operationList.forEach(<span class="fstat-no" title="function not covered" >(o</span>peration) => {</span>
|
|
3341
3374
|
<span class="cstat-no" title="statement not covered" > doOperationRecord({</span>
|
|
3342
3375
|
...operation,
|
|
3343
3376
|
res,
|
|
3344
|
-
err
|
|
3345
|
-
code,
|
|
3346
|
-
msg,
|
|
3347
|
-
result,
|
|
3348
|
-
success,
|
|
3349
|
-
},
|
|
3377
|
+
err,
|
|
3350
3378
|
});
|
|
3351
3379
|
});
|
|
3352
3380
|
} else <span class="cstat-no" title="statement not covered" >if (config.storage.protocol === 'mock') {</span>
|
|
@@ -3588,7 +3616,6 @@ export async function <span class="fstat-no" title="function not covered" >loadA
|
|
|
3588
3616
|
dependencies: [],
|
|
3589
3617
|
interfaceDependencies: [],
|
|
3590
3618
|
frontends: [],
|
|
3591
|
-
metadataTypes: []
|
|
3592
3619
|
});
|
|
3593
3620
|
} else {
|
|
3594
3621
|
const json = <span class="cstat-no" title="statement not covered" >await fs.readJSON(config.storage.basePath);</span>
|
|
@@ -3679,7 +3706,7 @@ export function <span class="fstat-no" title="function not covered" >loadAppSync
|
|
|
3679
3706
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
3680
3707
|
Code coverage generated by
|
|
3681
3708
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
3682
|
-
at 2023-
|
|
3709
|
+
at 2023-10-27T11:50:55.546Z
|
|
3683
3710
|
</div>
|
|
3684
3711
|
<script src="../../../prettify.js"></script>
|
|
3685
3712
|
<script>
|