@lcap/nasl 2.22.0-beta.5 → 3.0.0-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/README.md +13 -0
- package/docs/classes/Module.html +15 -15
- package/docs/classes/Namespace.html +15 -15
- package/docs/classes/ViewComponent.html +19 -19
- package/out/automate/engine/utils.js +4 -0
- package/out/automate/engine/utils.js.map +1 -1
- package/out/breakpoint/generator/AfterStartNode.d.ts +7 -0
- package/out/breakpoint/generator/AfterStartNode.js +27 -0
- package/out/breakpoint/generator/AfterStartNode.js.map +1 -0
- package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -0
- package/out/breakpoint/generator/BeforeEndNode.js +27 -0
- package/out/breakpoint/generator/BeforeEndNode.js.map +1 -0
- package/out/breakpoint/generator/BreakpointNode.d.ts +14 -0
- package/out/breakpoint/generator/BreakpointNode.js +166 -0
- package/out/breakpoint/generator/BreakpointNode.js.map +1 -0
- package/out/breakpoint/generator/index.d.ts +4 -0
- package/out/breakpoint/generator/index.js +98 -0
- package/out/breakpoint/generator/index.js.map +1 -0
- package/out/breakpoint/index.d.ts +3 -0
- package/out/breakpoint/index.js +20 -0
- package/out/breakpoint/index.js.map +1 -0
- package/out/breakpoint/shared/constants.d.ts +30 -0
- package/out/breakpoint/shared/constants.js +87 -0
- package/out/breakpoint/shared/constants.js.map +1 -0
- package/out/breakpoint/shared/index.d.ts +3 -0
- package/out/breakpoint/shared/index.js +33 -0
- package/out/breakpoint/shared/index.js.map +1 -0
- package/out/breakpoint/shared/operations.d.ts +10 -0
- package/out/breakpoint/shared/operations.js +25 -0
- package/out/breakpoint/shared/operations.js.map +1 -0
- package/out/breakpoint/shared/socket.d.ts +47 -0
- package/out/breakpoint/shared/socket.js +210 -0
- package/out/breakpoint/shared/socket.js.map +1 -0
- package/out/breakpoint/shared/utils.d.ts +20 -0
- package/out/breakpoint/shared/utils.js +133 -0
- package/out/breakpoint/shared/utils.js.map +1 -0
- package/out/breakpoint/store/core.d.ts +30 -0
- package/out/breakpoint/store/core.js +341 -0
- package/out/breakpoint/store/core.js.map +1 -0
- package/out/breakpoint/store/dock.d.ts +1 -0
- package/out/breakpoint/store/dock.js +127 -0
- package/out/breakpoint/store/dock.js.map +1 -0
- package/out/breakpoint/store/index.d.ts +2 -0
- package/out/breakpoint/store/index.js +19 -0
- package/out/breakpoint/store/index.js.map +1 -0
- package/out/common/BaseNode.d.ts +8 -0
- package/out/common/BaseNode.js +19 -0
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.d.ts +365 -16
- package/out/concepts/App__.js +431 -10
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Assignment__.js +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/AuthInterface__.d.ts +37 -0
- package/out/concepts/AuthInterface__.js +141 -0
- package/out/concepts/AuthInterface__.js.map +1 -0
- package/out/concepts/AuthLogicForCallInterface__.d.ts +138 -0
- package/out/concepts/AuthLogicForCallInterface__.js +493 -0
- package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
- package/out/concepts/AuthLogic__.d.ts +66 -0
- package/out/concepts/AuthLogic__.js +206 -0
- package/out/concepts/AuthLogic__.js.map +1 -0
- package/out/concepts/BackendVariable__.d.ts +137 -0
- package/out/concepts/BackendVariable__.js +422 -0
- package/out/concepts/BackendVariable__.js.map +1 -0
- package/out/concepts/Backend__.d.ts +134 -0
- package/out/concepts/Backend__.js +274 -0
- package/out/concepts/Backend__.js.map +1 -0
- package/out/concepts/BindAttribute__.d.ts +1 -1
- package/out/concepts/BindAttribute__.js +3 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindEvent__.d.ts +12 -0
- package/out/concepts/BindEvent__.js +68 -0
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/CallAuthInterface__.d.ts +126 -0
- package/out/concepts/CallAuthInterface__.js +408 -0
- package/out/concepts/CallAuthInterface__.js.map +1 -0
- package/out/concepts/CallInterface__.d.ts +6 -1
- package/out/concepts/CallInterface__.js +9 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +3 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +9 -7
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Destination__.js +1 -1
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js +29 -2
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +1 -2
- package/out/concepts/Entity__.js +1 -31
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +9 -4
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.d.ts +29 -29
- package/out/concepts/FrontendLibrary__.js +2 -2
- package/out/concepts/FrontendVariable__.d.ts +21 -0
- package/out/concepts/FrontendVariable__.js +64 -0
- package/out/concepts/FrontendVariable__.js.map +1 -0
- package/out/concepts/Frontend__.d.ts +151 -47
- package/out/concepts/Frontend__.js +188 -32
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +1 -1
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +18 -3
- package/out/concepts/LogicItem__.js +22 -4
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +14 -9
- package/out/concepts/Logic__.js +43 -5
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.d.ts +29 -29
- package/out/concepts/Namespace__.js +2 -2
- package/out/concepts/NewComposite__.js +2 -2
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/OverriddenLogic__.d.ts +643 -0
- package/out/concepts/OverriddenLogic__.js +1602 -0
- package/out/concepts/OverriddenLogic__.js.map +1 -0
- package/out/concepts/Param__.d.ts +6 -0
- package/out/concepts/Param__.js +10 -0
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.d.ts +2 -0
- package/out/concepts/QueryFieldExpression__.js +9 -0
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +2 -2
- package/out/concepts/QuerySelectExpression__.js +2 -2
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +6 -6
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +10 -0
- package/out/concepts/Variable__.js +12 -0
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.d.ts +33 -33
- package/out/concepts/ViewComponent__.js +7 -7
- package/out/concepts/ViewElement__.d.ts +6 -0
- package/out/concepts/ViewElement__.js +104 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +2 -2
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/index.js +2 -1
- package/out/concepts/basics/stdlib/index.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +24 -0
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.http.d.ts +7 -0
- package/out/concepts/basics/stdlib/nasl.http.js +167 -0
- package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
- package/out/concepts/basics/stdlib/nasl.process.js +68 -0
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +4 -19
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +83 -17
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/types/index.d.ts +1 -0
- package/out/concepts/basics/types/index.js +4 -1
- package/out/concepts/basics/types/index.js.map +1 -1
- package/out/concepts/index__.d.ts +8 -0
- package/out/concepts/index__.js +8 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/enums/KEYWORDS.js +0 -1
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.d.ts +1 -0
- package/out/generator/genBundleFiles.js +27 -0
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genMetaData.d.ts +4 -1
- package/out/generator/genMetaData.js +14 -0
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +2 -1
- package/out/generator/genReleaseBody.js +2 -1
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/index.d.ts +2 -1
- package/out/index.js +3 -1
- package/out/index.js.map +1 -1
- package/out/server/extendBaseNode.js +16 -4
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +2 -1
- package/out/server/formatTsUtils.js +39 -4
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getExtensionModules.d.ts +2 -2
- package/out/server/getExtensionModules.js +16 -2
- package/out/server/getExtensionModules.js.map +1 -1
- package/out/server/getLogics.js +5 -5
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +1 -0
- package/out/server/getMemberIdentifier.js +34 -7
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +64 -64
- package/out/server/naslServer.js +249 -121
- package/out/server/naslServer.js.map +1 -1
- package/out/server/naslStdlibMap.js +2 -0
- package/out/server/naslStdlibMap.js.map +1 -1
- package/out/server/translator.d.ts +1 -0
- package/out/server/translator.js +67 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/defaultErrorMessage.json +1 -0
- package/out/service/storage/api.d.ts +10 -1
- package/out/service/storage/api.js +6 -0
- package/out/service/storage/api.js.map +1 -1
- package/out/service/storage/init.d.ts +4 -0
- package/out/service/storage/init.js +55 -35
- package/out/service/storage/init.js.map +1 -1
- package/out/service/storage/service.d.ts +3 -0
- package/out/service/storage/service.js +14 -0
- package/out/service/storage/service.js.map +1 -1
- package/out/utils/sortTsString.d.ts +1 -0
- package/out/utils/sortTsString.js +36 -0
- package/out/utils/sortTsString.js.map +1 -0
- package/out/utils/traverse.js +2 -2
- package/out/utils/traverse.js.map +1 -1
- package/package.json +7 -2
- package/sandbox/stdlib/nasl.auth.ts +8 -4
- package/sandbox/stdlib/nasl.core.d.ts +206 -0
- package/sandbox/stdlib/nasl.core.js +1 -0
- package/sandbox/stdlib/nasl.core.js.map +1 -0
- package/sandbox/stdlib/nasl.http.ts +35 -0
- package/sandbox/stdlib/nasl.process.ts +13 -0
- package/sandbox/stdlib/nasl.ui.ts +0 -5
- package/src/automate/engine/utils.js +4 -1
- package/src/breakpoint/generator/AfterStartNode.ts +27 -0
- package/src/breakpoint/generator/BeforeEndNode.ts +27 -0
- package/src/breakpoint/generator/BreakpointNode.ts +228 -0
- package/src/breakpoint/generator/index.ts +114 -0
- package/src/breakpoint/index.ts +3 -0
- package/src/breakpoint/shared/constants.ts +95 -0
- package/src/breakpoint/shared/index.ts +3 -0
- package/src/breakpoint/shared/operations.ts +25 -0
- package/src/breakpoint/shared/socket.ts +326 -0
- package/src/breakpoint/shared/utils.ts +195 -0
- package/src/breakpoint/store/core.ts +411 -0
- package/src/breakpoint/store/dock.ts +166 -0
- package/src/breakpoint/store/index.ts +2 -0
- package/src/breakpoint/types/index.d.ts +19 -0
- package/src/common/BaseNode.ts +19 -1
- package/src/concepts/App__.ts +828 -26
- package/src/concepts/Assignment__.ts +1 -1
- package/src/concepts/AuthInterface__.ts +148 -0
- package/src/concepts/AuthLogicForCallInterface__.ts +573 -0
- package/src/concepts/AuthLogic__.ts +225 -0
- package/src/concepts/BackendVariable__.ts +466 -0
- package/src/concepts/Backend__.ts +347 -0
- package/src/concepts/BindAttribute__.ts +4 -3
- package/src/concepts/BindEvent__.ts +71 -2
- package/src/concepts/CallAuthInterface__.ts +490 -0
- package/src/concepts/CallInterface__.ts +10 -2
- package/src/concepts/CallLogic__.ts +3 -1
- package/src/concepts/CallQueryComponent__.ts +67 -7
- package/src/concepts/Destination__.ts +19 -1
- package/src/concepts/End__.ts +31 -3
- package/src/concepts/EntityProperty__.ts +6 -0
- package/src/concepts/Entity__.ts +8 -31
- package/src/concepts/ForEachStatement__.ts +9 -4
- package/src/concepts/FrontendLibrary__.ts +30 -30
- package/src/concepts/FrontendVariable__.ts +76 -0
- package/src/concepts/Frontend__.ts +352 -89
- package/src/concepts/Function__.ts +1 -1
- package/src/concepts/Identifier__.ts +5 -5
- package/src/concepts/Interface__.ts +1 -1
- package/src/concepts/LogicItem__.ts +26 -6
- package/src/concepts/Logic__.ts +86 -8
- package/src/concepts/Module__.ts +32 -2
- package/src/concepts/Namespace__.ts +30 -30
- package/src/concepts/NewComposite__.ts +2 -3
- package/src/concepts/OverriddenLogic__.ts +2165 -0
- package/src/concepts/Param__.ts +13 -3
- package/src/concepts/QueryFieldExpression__.ts +18 -0
- package/src/concepts/QuerySelectExpression__.ts +11 -3
- package/src/concepts/TypeAnnotation__.ts +45 -6
- package/src/concepts/Variable__.ts +14 -0
- package/src/concepts/ViewComponent__.ts +35 -35
- package/src/concepts/ViewElement__.ts +104 -1
- package/src/concepts/View__.ts +24 -2
- package/src/concepts/basics/stdlib/index.ts +2 -1
- package/src/concepts/basics/stdlib/nasl.auth.ts +24 -0
- package/src/concepts/basics/stdlib/nasl.http.ts +166 -0
- package/src/concepts/basics/stdlib/nasl.process.ts +68 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +4 -19
- package/src/concepts/basics/stdlib/nasl.util.ts +83 -17
- package/src/concepts/basics/types/index.ts +5 -4
- package/src/concepts/index__.ts +8 -0
- package/src/enums/KEYWORDS.ts +0 -1
- package/src/generator/genBundleFiles.ts +36 -2
- package/src/generator/genMetaData.ts +16 -1
- package/src/generator/genReleaseBody.ts +4 -1
- package/src/index.ts +2 -1
- package/src/server/extendBaseNode.ts +18 -7
- package/src/server/formatTsUtils.ts +37 -5
- package/src/server/getExtensionModules.ts +18 -3
- package/src/server/getLogics.ts +6 -6
- package/src/server/getMemberIdentifier.ts +35 -9
- package/src/server/naslServer.ts +250 -124
- package/src/server/naslStdlibMap.ts +2 -0
- package/src/server/translator.ts +67 -1
- package/src/service/defaultErrorMessage.json +1 -0
- package/src/service/storage/api.js +7 -1
- package/src/service/storage/init.ts +66 -35
- package/src/service/storage/service.ts +18 -2
- package/src/utils/sortTsString.ts +32 -0
- package/src/utils/traverse.ts +2 -2
- package/test/examples/app-simple.json +73635 -0
- package/ts-worker/lib/tsserver.js +3 -3
- package/ts-worker/package.json +1 -1
|
@@ -103,6 +103,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
103
103
|
@property()
|
|
104
104
|
ideVersion: string = undefined;
|
|
105
105
|
|
|
106
|
+
|
|
107
|
+
|
|
106
108
|
/**
|
|
107
109
|
* @param source 需要合并的部分参数
|
|
108
110
|
*/
|
|
@@ -119,6 +121,7 @@ export class CallQueryComponent extends LogicItem {
|
|
|
119
121
|
return super.from(source, parentNode, parentKey) as CallQueryComponent;
|
|
120
122
|
}
|
|
121
123
|
|
|
124
|
+
|
|
122
125
|
/**
|
|
123
126
|
* 设置select
|
|
124
127
|
*/
|
|
@@ -218,6 +221,10 @@ export class CallQueryComponent extends LogicItem {
|
|
|
218
221
|
});
|
|
219
222
|
}
|
|
220
223
|
|
|
224
|
+
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
221
228
|
/**
|
|
222
229
|
* 插入逻辑项
|
|
223
230
|
* @internal
|
|
@@ -250,6 +257,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
250
257
|
return logicItem;
|
|
251
258
|
}
|
|
252
259
|
|
|
260
|
+
|
|
261
|
+
|
|
253
262
|
/**
|
|
254
263
|
* 插入逻辑项
|
|
255
264
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -272,6 +281,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
272
281
|
return node;
|
|
273
282
|
}
|
|
274
283
|
|
|
284
|
+
|
|
285
|
+
|
|
275
286
|
/**
|
|
276
287
|
* 添加逻辑项
|
|
277
288
|
* @internal
|
|
@@ -291,6 +302,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
291
302
|
return this._insertItemInWherePlaygroundAt(options as any, index);
|
|
292
303
|
}
|
|
293
304
|
|
|
305
|
+
|
|
306
|
+
|
|
294
307
|
/**
|
|
295
308
|
* 添加逻辑项
|
|
296
309
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -314,6 +327,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
314
327
|
return node;
|
|
315
328
|
}
|
|
316
329
|
|
|
330
|
+
|
|
331
|
+
|
|
317
332
|
/**
|
|
318
333
|
* 插入查询分组
|
|
319
334
|
* @internal
|
|
@@ -346,6 +361,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
346
361
|
return queryGroupByExpression;
|
|
347
362
|
}
|
|
348
363
|
|
|
364
|
+
|
|
365
|
+
|
|
349
366
|
/**
|
|
350
367
|
* 插入查询分组
|
|
351
368
|
* @param queryGroupByExpressionOptions 查询分组参数
|
|
@@ -368,6 +385,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
368
385
|
return node;
|
|
369
386
|
}
|
|
370
387
|
|
|
388
|
+
|
|
389
|
+
|
|
371
390
|
/**
|
|
372
391
|
* 添加查询分组
|
|
373
392
|
* @internal
|
|
@@ -387,6 +406,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
387
406
|
return this._insertQueryGroupByExpressionInGroupByAt(options as any, index);
|
|
388
407
|
}
|
|
389
408
|
|
|
409
|
+
|
|
410
|
+
|
|
390
411
|
/**
|
|
391
412
|
* 添加查询分组
|
|
392
413
|
* @param queryGroupByExpressionOptions 查询分组参数
|
|
@@ -410,6 +431,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
410
431
|
return node;
|
|
411
432
|
}
|
|
412
433
|
|
|
434
|
+
|
|
435
|
+
|
|
413
436
|
/**
|
|
414
437
|
* 插入逻辑项
|
|
415
438
|
* @internal
|
|
@@ -442,6 +465,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
442
465
|
return logicItem;
|
|
443
466
|
}
|
|
444
467
|
|
|
468
|
+
|
|
469
|
+
|
|
445
470
|
/**
|
|
446
471
|
* 插入逻辑项
|
|
447
472
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -464,6 +489,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
464
489
|
return node;
|
|
465
490
|
}
|
|
466
491
|
|
|
492
|
+
|
|
493
|
+
|
|
467
494
|
/**
|
|
468
495
|
* 添加逻辑项
|
|
469
496
|
* @internal
|
|
@@ -483,6 +510,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
483
510
|
return this._insertItemInHavingPlaygroundAt(options as any, index);
|
|
484
511
|
}
|
|
485
512
|
|
|
513
|
+
|
|
514
|
+
|
|
486
515
|
/**
|
|
487
516
|
* 添加逻辑项
|
|
488
517
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -506,6 +535,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
506
535
|
return node;
|
|
507
536
|
}
|
|
508
537
|
|
|
538
|
+
|
|
539
|
+
|
|
509
540
|
/**
|
|
510
541
|
* 插入查询排序子句
|
|
511
542
|
* @internal
|
|
@@ -538,6 +569,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
538
569
|
return queryOrderByExpression;
|
|
539
570
|
}
|
|
540
571
|
|
|
572
|
+
|
|
573
|
+
|
|
541
574
|
/**
|
|
542
575
|
* 插入查询排序子句
|
|
543
576
|
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
@@ -560,6 +593,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
560
593
|
return node;
|
|
561
594
|
}
|
|
562
595
|
|
|
596
|
+
|
|
597
|
+
|
|
563
598
|
/**
|
|
564
599
|
* 添加查询排序子句
|
|
565
600
|
* @internal
|
|
@@ -579,6 +614,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
579
614
|
return this._insertQueryOrderByExpressionInOrderByAt(options as any, index);
|
|
580
615
|
}
|
|
581
616
|
|
|
617
|
+
|
|
618
|
+
|
|
582
619
|
/**
|
|
583
620
|
* 添加查询排序子句
|
|
584
621
|
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
@@ -602,6 +639,9 @@ export class CallQueryComponent extends LogicItem {
|
|
|
602
639
|
return node;
|
|
603
640
|
}
|
|
604
641
|
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
|
|
605
645
|
/**
|
|
606
646
|
* 删除类型标注
|
|
607
647
|
* @param name 类型标注名称
|
|
@@ -650,6 +690,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
650
690
|
return params;
|
|
651
691
|
}
|
|
652
692
|
|
|
693
|
+
|
|
694
|
+
|
|
653
695
|
/**
|
|
654
696
|
* 删除查询选择子句
|
|
655
697
|
* @param name 查询选择子句名称
|
|
@@ -675,6 +717,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
675
717
|
return select.delete();
|
|
676
718
|
}
|
|
677
719
|
|
|
720
|
+
|
|
721
|
+
|
|
678
722
|
/**
|
|
679
723
|
* 删除查询 From 子句
|
|
680
724
|
* @param name 查询 From 子句名称
|
|
@@ -700,6 +744,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
700
744
|
return from.delete();
|
|
701
745
|
}
|
|
702
746
|
|
|
747
|
+
|
|
748
|
+
|
|
703
749
|
/**
|
|
704
750
|
* 删除逻辑项
|
|
705
751
|
* @param name 逻辑项名称
|
|
@@ -725,6 +771,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
725
771
|
return where.delete();
|
|
726
772
|
}
|
|
727
773
|
|
|
774
|
+
|
|
775
|
+
|
|
728
776
|
/**
|
|
729
777
|
* 删除逻辑项
|
|
730
778
|
* @param logicItem 已有的逻辑项实例
|
|
@@ -732,10 +780,12 @@ export class CallQueryComponent extends LogicItem {
|
|
|
732
780
|
removeItemInWherePlayground(logicItem: LogicItem): void;
|
|
733
781
|
|
|
734
782
|
removeItemInWherePlayground(options: LogicItem) {
|
|
735
|
-
|
|
783
|
+
let logicItem: LogicItem = options;
|
|
736
784
|
return logicItem.delete();
|
|
737
785
|
}
|
|
738
786
|
|
|
787
|
+
|
|
788
|
+
|
|
739
789
|
/**
|
|
740
790
|
* 删除查询分组
|
|
741
791
|
* @param queryGroupByExpression 已有的查询分组实例
|
|
@@ -743,10 +793,12 @@ export class CallQueryComponent extends LogicItem {
|
|
|
743
793
|
removeQueryGroupByExpressionInGroupBy(queryGroupByExpression: QueryGroupByExpression): void;
|
|
744
794
|
|
|
745
795
|
removeQueryGroupByExpressionInGroupBy(options: QueryGroupByExpression) {
|
|
746
|
-
|
|
796
|
+
let queryGroupByExpression: QueryGroupByExpression = options;
|
|
747
797
|
return queryGroupByExpression.delete();
|
|
748
798
|
}
|
|
749
799
|
|
|
800
|
+
|
|
801
|
+
|
|
750
802
|
/**
|
|
751
803
|
* 删除逻辑项
|
|
752
804
|
* @param name 逻辑项名称
|
|
@@ -772,6 +824,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
772
824
|
return having.delete();
|
|
773
825
|
}
|
|
774
826
|
|
|
827
|
+
|
|
828
|
+
|
|
775
829
|
/**
|
|
776
830
|
* 删除逻辑项
|
|
777
831
|
* @param logicItem 已有的逻辑项实例
|
|
@@ -779,10 +833,12 @@ export class CallQueryComponent extends LogicItem {
|
|
|
779
833
|
removeItemInHavingPlayground(logicItem: LogicItem): void;
|
|
780
834
|
|
|
781
835
|
removeItemInHavingPlayground(options: LogicItem) {
|
|
782
|
-
|
|
836
|
+
let logicItem: LogicItem = options;
|
|
783
837
|
return logicItem.delete();
|
|
784
838
|
}
|
|
785
839
|
|
|
840
|
+
|
|
841
|
+
|
|
786
842
|
/**
|
|
787
843
|
* 删除查询排序子句
|
|
788
844
|
* @param queryOrderByExpression 已有的查询排序子句实例
|
|
@@ -790,10 +846,12 @@ export class CallQueryComponent extends LogicItem {
|
|
|
790
846
|
removeQueryOrderByExpressionInOrderBy(queryOrderByExpression: QueryOrderByExpression): void;
|
|
791
847
|
|
|
792
848
|
removeQueryOrderByExpressionInOrderBy(options: QueryOrderByExpression) {
|
|
793
|
-
|
|
849
|
+
let queryOrderByExpression: QueryOrderByExpression = options;
|
|
794
850
|
return queryOrderByExpression.delete();
|
|
795
851
|
}
|
|
796
852
|
|
|
853
|
+
|
|
854
|
+
|
|
797
855
|
/**
|
|
798
856
|
* 删除查询分页子句
|
|
799
857
|
* @param name 查询分页子句名称
|
|
@@ -1074,7 +1132,7 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1074
1132
|
} else if (this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.propertyName)) {
|
|
1075
1133
|
// 2.22 选择字段时,生成选择字段的匿名数据结构 { entity1: { prop1, prop2 } }
|
|
1076
1134
|
const entity: Entity = this.app.findNodeByCompleteName(entityNamespace + '.' + entityName);
|
|
1077
|
-
properties.push(StructureProperty.from({
|
|
1135
|
+
entity && properties.push(StructureProperty.from({
|
|
1078
1136
|
name: utils.firstLowerCase(entityName),
|
|
1079
1137
|
typeAnnotation: TypeAnnotation.from({
|
|
1080
1138
|
concept: 'TypeAnnotation',
|
|
@@ -1182,9 +1240,10 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1182
1240
|
}
|
|
1183
1241
|
|
|
1184
1242
|
genStructure(structureName?: string, properties: any[] = []) {
|
|
1243
|
+
const logic = this.logic || this.AuthLogic || this.AuthLogicForCallInterface;
|
|
1185
1244
|
return Structure.from({
|
|
1186
1245
|
concept: 'Structure',
|
|
1187
|
-
name: structureName || this.typeAnnotation?.typeName || `${utils.firstUpperCase(
|
|
1246
|
+
name: structureName || this.typeAnnotation?.typeName || `${utils.firstUpperCase(logic.name)}Structure`,
|
|
1188
1247
|
origin: 'CallQueryComponent',
|
|
1189
1248
|
properties,
|
|
1190
1249
|
});
|
|
@@ -1222,7 +1281,8 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1222
1281
|
}
|
|
1223
1282
|
}
|
|
1224
1283
|
|
|
1225
|
-
|
|
1284
|
+
const logic = this.logic || this.AuthLogic || this.AuthLogicForCallInterface;
|
|
1285
|
+
structureName = structureName || utils.unique(`${utils.firstUpperCase(logic.name)}Structure`, this.app.getStructureExistingNames());
|
|
1226
1286
|
const groupByLength = groupBy.filter((item) => (item.groupElement as QueryFieldExpression)?.propertyName && (item.groupElement as QueryFieldExpression).asName).length;
|
|
1227
1287
|
const aggregateLength = selectElements.filter((item) => item.aggregateName && item.asName).length;
|
|
1228
1288
|
|
|
@@ -66,6 +66,8 @@ export class Destination extends LogicItem {
|
|
|
66
66
|
@property()
|
|
67
67
|
target: string = '_self';
|
|
68
68
|
|
|
69
|
+
|
|
70
|
+
|
|
69
71
|
/**
|
|
70
72
|
* @param source 需要合并的部分参数
|
|
71
73
|
*/
|
|
@@ -82,6 +84,7 @@ export class Destination extends LogicItem {
|
|
|
82
84
|
return super.from(source, parentNode, parentKey) as Destination;
|
|
83
85
|
}
|
|
84
86
|
|
|
87
|
+
|
|
85
88
|
/**
|
|
86
89
|
* 设置viewNamespace
|
|
87
90
|
*/
|
|
@@ -133,6 +136,10 @@ export class Destination extends LogicItem {
|
|
|
133
136
|
});
|
|
134
137
|
}
|
|
135
138
|
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
136
143
|
/**
|
|
137
144
|
* 插入实际参数
|
|
138
145
|
* @internal
|
|
@@ -165,6 +172,8 @@ export class Destination extends LogicItem {
|
|
|
165
172
|
return argument;
|
|
166
173
|
}
|
|
167
174
|
|
|
175
|
+
|
|
176
|
+
|
|
168
177
|
/**
|
|
169
178
|
* 插入实际参数
|
|
170
179
|
* @param argumentOptions 实际参数参数
|
|
@@ -187,6 +196,8 @@ export class Destination extends LogicItem {
|
|
|
187
196
|
return node;
|
|
188
197
|
}
|
|
189
198
|
|
|
199
|
+
|
|
200
|
+
|
|
190
201
|
/**
|
|
191
202
|
* 添加实际参数
|
|
192
203
|
* @internal
|
|
@@ -206,6 +217,8 @@ export class Destination extends LogicItem {
|
|
|
206
217
|
return this._insertArgumentAt(options as any, index);
|
|
207
218
|
}
|
|
208
219
|
|
|
220
|
+
|
|
221
|
+
|
|
209
222
|
/**
|
|
210
223
|
* 添加实际参数
|
|
211
224
|
* @param argumentOptions 实际参数参数
|
|
@@ -229,6 +242,9 @@ export class Destination extends LogicItem {
|
|
|
229
242
|
return node;
|
|
230
243
|
}
|
|
231
244
|
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
|
|
232
248
|
/**
|
|
233
249
|
* 删除实际参数
|
|
234
250
|
* @param argument 已有的实际参数实例
|
|
@@ -236,10 +252,12 @@ export class Destination extends LogicItem {
|
|
|
236
252
|
removeArgumentInArguments(argument: Argument): void;
|
|
237
253
|
|
|
238
254
|
removeArgumentInArguments(options: Argument) {
|
|
239
|
-
|
|
255
|
+
let argument: Argument = options;
|
|
240
256
|
return argument.delete();
|
|
241
257
|
}
|
|
242
258
|
|
|
259
|
+
|
|
260
|
+
|
|
243
261
|
/**
|
|
244
262
|
* 删除锚点参数
|
|
245
263
|
* @param name 锚点参数名称
|
package/src/concepts/End__.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { TranslatorState, indent } from '../translator';
|
|
2
|
+
import Return from './Return__';
|
|
3
|
+
import Logic from './Logic__';
|
|
2
4
|
//================================================================================
|
|
3
5
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
4
6
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -71,9 +73,35 @@ export class End extends LogicItem {
|
|
|
71
73
|
|
|
72
74
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
73
75
|
let code = '';
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
76
|
+
let ret;
|
|
77
|
+
let logic;
|
|
78
|
+
switch (this.parentNode.concept) {
|
|
79
|
+
case 'Logic':
|
|
80
|
+
ret = this.logic.returns[0];
|
|
81
|
+
break;
|
|
82
|
+
case 'AuthLogic':
|
|
83
|
+
ret = this.AuthLogic.returns[0];
|
|
84
|
+
break;
|
|
85
|
+
case 'AuthLogicForCallInterface':
|
|
86
|
+
// 导出接口鉴权参数返回值固定为下面逻辑;
|
|
87
|
+
ret = `${indent((state?.tabSize || 0))}let ${this.parentNode.name}Result: ApiReturn; \n ${indent((state?.tabSize || 0))}return ${this.parentNode.name}Result;\n`;
|
|
88
|
+
break;
|
|
89
|
+
case 'OverriddenLogic':
|
|
90
|
+
ret = this.OverriddenLogic.returns[0];
|
|
91
|
+
break;
|
|
92
|
+
default:
|
|
93
|
+
// 旧逻辑默认走这里,
|
|
94
|
+
// 期望后期可以直接走完整的case, default 直接抛出异常好更明确定位错误
|
|
95
|
+
logic = logic = this.parentNode.getAncestor('Logic')
|
|
96
|
+
|| this.parentNode.getAncestor('AuthLogic')
|
|
97
|
+
|| this.parentNode.getAncestor('AuthLogicForCallInterface')
|
|
98
|
+
|| this.parentNode.getAncestor('OverriddenLogic');
|
|
99
|
+
ret = (logic as Logic).returns[0];
|
|
100
|
+
}
|
|
101
|
+
if (ret && this.parentNode.concept === 'AuthLogicForCallInterface') {
|
|
102
|
+
code += ret;
|
|
103
|
+
} else if (ret && this.parentNode.concept !== 'AuthLogicForCallInterface') {
|
|
104
|
+
code += indent((state?.tabSize || 0)) + 'return ' + (ret as Return).name + ';';
|
|
77
105
|
} else {
|
|
78
106
|
code += indent((state?.tabSize || 0)) + 'return;';
|
|
79
107
|
}
|
|
@@ -286,6 +286,10 @@ export class EntityProperty extends BaseNode {
|
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
288
|
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
289
293
|
/**
|
|
290
294
|
* 删除类型标注
|
|
291
295
|
* @param name 类型标注名称
|
|
@@ -334,6 +338,8 @@ export class EntityProperty extends BaseNode {
|
|
|
334
338
|
return params;
|
|
335
339
|
}
|
|
336
340
|
|
|
341
|
+
|
|
342
|
+
|
|
337
343
|
/**
|
|
338
344
|
* 删除数据库存储类型
|
|
339
345
|
* @param name 数据库存储类型名称
|
package/src/concepts/Entity__.ts
CHANGED
|
@@ -130,7 +130,7 @@ export class Entity extends BaseNode {
|
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
getPropertyExistingNames(excludedList: Array<EntityProperty> = []) {
|
|
134
134
|
const excludedSet = new Set(excludedList);
|
|
135
135
|
return ((this.properties as EntityProperty[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
136
136
|
}
|
|
@@ -271,6 +271,7 @@ export class Entity extends BaseNode {
|
|
|
271
271
|
return node;
|
|
272
272
|
}
|
|
273
273
|
|
|
274
|
+
|
|
274
275
|
getEntityIndexExistingNames(excludedList: Array<EntityIndex> = []) {
|
|
275
276
|
const excludedSet = new Set(excludedList);
|
|
276
277
|
return ((this.indexes as EntityIndex[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
|
|
@@ -412,6 +413,9 @@ export class Entity extends BaseNode {
|
|
|
412
413
|
return node;
|
|
413
414
|
}
|
|
414
415
|
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+
|
|
415
419
|
/**
|
|
416
420
|
* 删除实体属性
|
|
417
421
|
* @param name 实体属性名称
|
|
@@ -460,6 +464,8 @@ export class Entity extends BaseNode {
|
|
|
460
464
|
return params;
|
|
461
465
|
}
|
|
462
466
|
|
|
467
|
+
|
|
468
|
+
|
|
463
469
|
/**
|
|
464
470
|
* 删除实体索引
|
|
465
471
|
* @param name 实体索引名称
|
|
@@ -530,7 +536,7 @@ export class Entity extends BaseNode {
|
|
|
530
536
|
/**
|
|
531
537
|
* 设置实体表名并修改表名
|
|
532
538
|
*/
|
|
533
|
-
|
|
539
|
+
setName(name: string) {
|
|
534
540
|
const object: any = {
|
|
535
541
|
name,
|
|
536
542
|
};
|
|
@@ -547,14 +553,10 @@ export class Entity extends BaseNode {
|
|
|
547
553
|
|
|
548
554
|
this.name = oldName;
|
|
549
555
|
this.tableName = oldTableName;
|
|
550
|
-
this.app?.emit('collect:start', { actionMsg: '修改实体名' });
|
|
551
|
-
const refs = await this.findUsage();
|
|
552
556
|
this.update({
|
|
553
557
|
...object,
|
|
554
558
|
field: 'name',
|
|
555
559
|
});
|
|
556
|
-
this._effect(refs);
|
|
557
|
-
this.app?.emit('collect:end');
|
|
558
560
|
}
|
|
559
561
|
/**
|
|
560
562
|
* 设置实体表名
|
|
@@ -563,7 +565,6 @@ export class Entity extends BaseNode {
|
|
|
563
565
|
const object = {
|
|
564
566
|
tableName,
|
|
565
567
|
};
|
|
566
|
-
console.log(123123123);
|
|
567
568
|
|
|
568
569
|
const oldTableName = this.tableName;
|
|
569
570
|
this.tableName = tableName;
|
|
@@ -670,30 +671,6 @@ export class Entity extends BaseNode {
|
|
|
670
671
|
// 重命名 properties columnName
|
|
671
672
|
this.formatPropertyColumnName();
|
|
672
673
|
}
|
|
673
|
-
async _effect(refs: any = []) {
|
|
674
|
-
// 处理选中的此实体的 CallQueryComponent
|
|
675
|
-
const callQueryComponents: Set<CallQueryComponent> = new Set();
|
|
676
|
-
refs.forEach((val: any) => {
|
|
677
|
-
const loopFindNode = (item: any) => {
|
|
678
|
-
if (item.children) {
|
|
679
|
-
item.children.forEach((i: any) => loopFindNode(i));
|
|
680
|
-
} else {
|
|
681
|
-
const target = item.node?.getAncestor('CallQueryComponent');
|
|
682
|
-
if (target) {
|
|
683
|
-
callQueryComponents.add(target);
|
|
684
|
-
}
|
|
685
|
-
}
|
|
686
|
-
};
|
|
687
|
-
loopFindNode(val);
|
|
688
|
-
});
|
|
689
|
-
callQueryComponents.forEach((node) => {
|
|
690
|
-
const targetField = node.select.selectFieldElements.find((item) => item.entityAsName === this.name);
|
|
691
|
-
if (targetField) {
|
|
692
|
-
// 更新数据结构
|
|
693
|
-
node.saveStructure();
|
|
694
|
-
}
|
|
695
|
-
});
|
|
696
|
-
}
|
|
697
674
|
|
|
698
675
|
public static getDefaultOptions() {
|
|
699
676
|
return {
|
|
@@ -511,10 +511,15 @@ export class ForEachStatement extends LogicItem {
|
|
|
511
511
|
const list = this.each ? this.each.toJS(shiftState(state, code, {
|
|
512
512
|
tabSize: 0,
|
|
513
513
|
})) : '';
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
code +=
|
|
517
|
-
code += `
|
|
514
|
+
const random = Math.random();
|
|
515
|
+
const number = Math.round(random * 10000);
|
|
516
|
+
code += `var $forEachListVariable${number} = ${list};\n`;
|
|
517
|
+
code += `var $forEachStartVariable${number} = ${this.start && this.start.toJS() ? this.start.toJS() : ''};\n`;
|
|
518
|
+
code += `var $forEachEndVariable${number} = ${this.end && this.end.toJS() ? this.end.toJS() : ''};\n`;
|
|
519
|
+
code += `if(Array.isArray($forEachListVariable${number})) {\n`;
|
|
520
|
+
code += `for (let ${this.index.name} = $forEachStartVariable${number}; `;
|
|
521
|
+
code += `${this.index.name} < $forEachEndVariable${number}; ${this.index.name}++) {\n`;
|
|
522
|
+
code += `const ${this.item.name} = $forEachListVariable${number}[${this.index.name}];\n`;
|
|
518
523
|
if (Array.isArray(this.body)) {
|
|
519
524
|
this.body.forEach((logicItem) => {
|
|
520
525
|
code
|