@lcap/nasl 2.22.0-beta.0 → 2.22.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/automate/engine/operators.d.ts +9 -0
- package/out/automate/engine/viewCache.d.ts +1 -0
- package/out/automate/template/myProcess.d.ts +1 -0
- package/out/common/BaseNode.d.ts +1 -0
- package/out/common/BaseNode.js +7 -1
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.d.ts +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/Anchor__.js.map +1 -1
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +22 -0
- package/out/concepts/App__.js +78 -12
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Argument__.js.map +1 -1
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/AssignmentLine__.js.map +1 -1
- package/out/concepts/Assignment__.js.map +1 -1
- package/out/concepts/Attribute__.js.map +1 -1
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BinaryExpression__.js.map +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindDirective__.js.map +1 -1
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BindStyle__.js.map +1 -1
- package/out/concepts/BooleanLiteral__.js.map +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +9 -1
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +2 -1
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.d.ts +2 -0
- package/out/concepts/CallQueryComponent__.js +76 -24
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/Comment__.js.map +1 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/ConfigGroup__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/ConfigProperty__.d.ts +4 -0
- package/out/concepts/ConfigProperty__.js +18 -1
- package/out/concepts/ConfigProperty__.js.map +1 -1
- package/out/concepts/Configuration__.js.map +1 -1
- package/out/concepts/Constant__.js.map +1 -1
- package/out/concepts/DataElement__.js.map +1 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/DatabaseTypeAnnotation__.js.map +1 -1
- package/out/concepts/Destination__.js +2 -2
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/End__.js.map +1 -1
- package/out/concepts/EntityIndex__.d.ts +1 -1
- package/out/concepts/EntityIndex__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +7 -2
- package/out/concepts/EntityProperty__.js +100 -1
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +2 -1
- package/out/concepts/Entity__.js +30 -1
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/EnumItem__.js.map +1 -1
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Event__.js.map +1 -1
- package/out/concepts/ExternalDestination__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/FrontendLibrary__.js.map +1 -1
- package/out/concepts/Frontend__.js.map +1 -1
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Identifier__.js +7 -0
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/IfStatement__.js +2 -2
- package/out/concepts/IfStatement__.js.map +1 -1
- package/out/concepts/Integration__.d.ts +53 -0
- package/out/concepts/Integration__.js +143 -0
- package/out/concepts/Integration__.js.map +1 -0
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/JSBlock__.js.map +1 -1
- package/out/concepts/JavaLogic__.d.ts +42 -0
- package/out/concepts/JavaLogic__.js +122 -0
- package/out/concepts/JavaLogic__.js.map +1 -0
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.js +12 -7
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/Match__.js +11 -6
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/MicroApp__.d.ts +51 -0
- package/out/concepts/MicroApp__.js +113 -0
- package/out/concepts/MicroApp__.js.map +1 -0
- package/out/concepts/Module__.d.ts +20 -9
- package/out/concepts/Module__.js +72 -14
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/Namespace__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +1 -1
- package/out/concepts/NewComposite__.js +25 -11
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/concepts/NewList__.js.map +1 -1
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/New__.js.map +1 -1
- package/out/concepts/NullLiteral__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.js +1 -1
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.d.ts +1 -0
- package/out/concepts/Param__.js +5 -0
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Point__.js.map +1 -1
- package/out/concepts/ProcessComponent__.js.map +1 -1
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.js.map +1 -1
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/QueryAggregateExpression__.js.map +1 -1
- package/out/concepts/QueryFieldExpression__.js.map +1 -1
- package/out/concepts/QueryFromExpression__.js.map +1 -1
- package/out/concepts/QueryGroupByExpression__.js.map +1 -1
- package/out/concepts/QueryJoinExpression__.js.map +1 -1
- package/out/concepts/QueryLimitExpression__.js.map +1 -1
- package/out/concepts/QueryOrderByExpression__.js.map +1 -1
- package/out/concepts/QuerySelectExpression__.d.ts +104 -16
- package/out/concepts/QuerySelectExpression__.js +99 -9
- package/out/concepts/QuerySelectExpression__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/Slot__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/Start__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/SwitchCase__.js +2 -2
- package/out/concepts/SwitchCase__.js.map +1 -1
- package/out/concepts/SwitchStatement__.js.map +1 -1
- package/out/concepts/Theme__.js.map +1 -1
- package/out/concepts/Transactional__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +8 -3
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/TypeParam__.js.map +1 -1
- package/out/concepts/UnaryExpression__.js.map +1 -1
- package/out/concepts/Unparsed__.js.map +1 -1
- package/out/concepts/UseComponent__.js.map +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewBlock__.js.map +1 -1
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +26 -6
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -1
- package/out/concepts/View__.js +3 -1
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/WhileStatement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +15 -0
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +94 -0
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +3 -0
- package/out/concepts/index__.js +3 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/config.d.ts +1 -1
- package/out/decorators/index.d.ts +2 -2
- package/out/generator/genBundleFiles.js +20 -3
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/generator/genReleaseBody.js +2 -2
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/icestark.d.ts +2 -0
- package/out/generator/icestark.js +48 -0
- package/out/generator/icestark.js.map +1 -0
- package/out/generator/microApp.d.ts +2 -0
- package/out/generator/microApp.js +35 -0
- package/out/generator/microApp.js.map +1 -0
- package/out/generator/permission.d.ts +1 -1
- package/out/generator/permission.js +0 -13
- package/out/generator/permission.js.map +1 -1
- package/out/generator/qiankun.d.ts +2 -0
- package/out/generator/qiankun.js +52 -0
- package/out/generator/qiankun.js.map +1 -0
- package/out/index.d.ts +1 -0
- package/out/index.js +1 -0
- package/out/index.js.map +1 -1
- package/out/manager/stepRecorder.d.ts +20 -0
- package/out/manager/stepRecorder.js +110 -0
- package/out/manager/stepRecorder.js.map +1 -0
- package/out/sentry/index.d.ts +5 -4
- package/out/sentry/index.js +9 -2
- package/out/sentry/index.js.map +1 -1
- package/out/server/formatTsUtils.d.ts +1 -1
- package/out/server/formatTsUtils.js +40 -14
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.js +38 -6
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +5 -4
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.d.ts +3 -3
- package/out/server/getScope.d.ts +1 -1
- package/out/server/naslServer.d.ts +7 -3
- package/out/server/naslServer.js +271 -102
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +25 -7
- package/out/server/translator.js.map +1 -1
- package/out/service/storage/init.d.ts +3 -3
- package/out/service/storage/init.js +6 -0
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCreateBlock.js +6 -1
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genQueryComponent.js +20 -6
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genUpdateBlock.js +7 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/templator/utils.d.ts +16 -0
- package/out/templator/utils.js +2 -0
- package/out/templator/utils.js.map +1 -1
- package/out/translator/index.d.ts +1 -1
- package/out/translator/lsp.d.ts +3 -3
- package/out/utils/index.d.ts +4 -4
- package/package.json +68 -68
- package/sandbox/stdlib/nasl.ui.ts +16 -11
- package/sandbox/stdlib/nasl.util.ts +4 -0
- package/sandbox/stdlib/nasl.validation.ts +2 -2
- package/src/automate/upgrader/2.17.js +1 -1
- package/src/common/BaseNode.ts +10 -2
- package/src/concepts/App__.ts +90 -46
- package/src/concepts/CallInterface__.ts +9 -1
- package/src/concepts/CallLogic__.ts +2 -1
- package/src/concepts/CallQueryComponent__.ts +73 -82
- package/src/concepts/ConfigProperty__.ts +18 -1
- package/src/concepts/Destination__.ts +2 -20
- package/src/concepts/EntityProperty__.ts +102 -8
- package/src/concepts/Entity__.ts +31 -8
- package/src/concepts/Identifier__.ts +9 -2
- package/src/concepts/IfStatement__.ts +2 -2
- package/src/concepts/Integration__.ts +162 -0
- package/src/concepts/JavaLogic__.ts +129 -0
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +12 -45
- package/src/concepts/Match__.ts +10 -5
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/MicroApp__.ts +118 -0
- package/src/concepts/Module__.ts +106 -79
- package/src/concepts/NewComposite__.ts +23 -11
- package/src/concepts/OqlQueryComponent__.ts +1 -1
- package/src/concepts/Param__.ts +3 -0
- package/src/concepts/QueryFieldExpression__.ts +0 -7
- package/src/concepts/QuerySelectExpression__.ts +206 -30
- package/src/concepts/SwitchCase__.ts +2 -2
- package/src/concepts/TypeAnnotation__.ts +8 -42
- package/src/concepts/ViewElement__.ts +24 -6
- package/src/concepts/View__.ts +3 -24
- package/src/concepts/basics/stdlib/nasl.ui.ts +15 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +94 -0
- package/src/concepts/index__.ts +3 -0
- package/src/generator/genBundleFiles.ts +22 -4
- package/src/generator/genReleaseBody.ts +2 -2
- package/src/generator/icestark.ts +45 -0
- package/src/generator/microApp.ts +32 -0
- package/src/generator/permission.ts +1 -15
- package/src/generator/qiankun.ts +49 -0
- package/src/index.ts +1 -0
- package/src/manager/stepRecorder.ts +112 -0
- package/src/sentry/index.ts +8 -2
- package/src/server/formatTsUtils.ts +44 -16
- package/src/server/getLogics.ts +41 -6
- package/src/server/getMemberIdentifier.ts +5 -4
- package/src/server/naslServer.ts +271 -101
- package/src/server/translator.ts +25 -7
- package/src/service/storage/init.ts +7 -0
- package/src/templator/genCreateBlock.ts +6 -1
- package/src/templator/genQueryComponent.ts +22 -8
- package/src/templator/genUpdateBlock.ts +7 -1
- package/src/templator/utils.ts +2 -0
- package/ts-worker/src/index.js +1 -4
- package/src/manager/history.ts +0 -0
- package/src/manager/problem.ts +0 -0
|
@@ -103,8 +103,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
103
103
|
@property()
|
|
104
104
|
ideVersion: string = undefined;
|
|
105
105
|
|
|
106
|
-
|
|
107
|
-
|
|
108
106
|
/**
|
|
109
107
|
* @param source 需要合并的部分参数
|
|
110
108
|
*/
|
|
@@ -121,7 +119,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
121
119
|
return super.from(source, parentNode, parentKey) as CallQueryComponent;
|
|
122
120
|
}
|
|
123
121
|
|
|
124
|
-
|
|
125
122
|
/**
|
|
126
123
|
* 设置select
|
|
127
124
|
*/
|
|
@@ -221,10 +218,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
221
218
|
});
|
|
222
219
|
}
|
|
223
220
|
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
221
|
/**
|
|
229
222
|
* 插入逻辑项
|
|
230
223
|
* @internal
|
|
@@ -257,8 +250,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
257
250
|
return logicItem;
|
|
258
251
|
}
|
|
259
252
|
|
|
260
|
-
|
|
261
|
-
|
|
262
253
|
/**
|
|
263
254
|
* 插入逻辑项
|
|
264
255
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -281,8 +272,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
281
272
|
return node;
|
|
282
273
|
}
|
|
283
274
|
|
|
284
|
-
|
|
285
|
-
|
|
286
275
|
/**
|
|
287
276
|
* 添加逻辑项
|
|
288
277
|
* @internal
|
|
@@ -302,8 +291,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
302
291
|
return this._insertItemInWherePlaygroundAt(options as any, index);
|
|
303
292
|
}
|
|
304
293
|
|
|
305
|
-
|
|
306
|
-
|
|
307
294
|
/**
|
|
308
295
|
* 添加逻辑项
|
|
309
296
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -327,8 +314,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
327
314
|
return node;
|
|
328
315
|
}
|
|
329
316
|
|
|
330
|
-
|
|
331
|
-
|
|
332
317
|
/**
|
|
333
318
|
* 插入查询分组
|
|
334
319
|
* @internal
|
|
@@ -361,8 +346,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
361
346
|
return queryGroupByExpression;
|
|
362
347
|
}
|
|
363
348
|
|
|
364
|
-
|
|
365
|
-
|
|
366
349
|
/**
|
|
367
350
|
* 插入查询分组
|
|
368
351
|
* @param queryGroupByExpressionOptions 查询分组参数
|
|
@@ -385,8 +368,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
385
368
|
return node;
|
|
386
369
|
}
|
|
387
370
|
|
|
388
|
-
|
|
389
|
-
|
|
390
371
|
/**
|
|
391
372
|
* 添加查询分组
|
|
392
373
|
* @internal
|
|
@@ -406,8 +387,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
406
387
|
return this._insertQueryGroupByExpressionInGroupByAt(options as any, index);
|
|
407
388
|
}
|
|
408
389
|
|
|
409
|
-
|
|
410
|
-
|
|
411
390
|
/**
|
|
412
391
|
* 添加查询分组
|
|
413
392
|
* @param queryGroupByExpressionOptions 查询分组参数
|
|
@@ -431,8 +410,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
431
410
|
return node;
|
|
432
411
|
}
|
|
433
412
|
|
|
434
|
-
|
|
435
|
-
|
|
436
413
|
/**
|
|
437
414
|
* 插入逻辑项
|
|
438
415
|
* @internal
|
|
@@ -465,8 +442,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
465
442
|
return logicItem;
|
|
466
443
|
}
|
|
467
444
|
|
|
468
|
-
|
|
469
|
-
|
|
470
445
|
/**
|
|
471
446
|
* 插入逻辑项
|
|
472
447
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -489,8 +464,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
489
464
|
return node;
|
|
490
465
|
}
|
|
491
466
|
|
|
492
|
-
|
|
493
|
-
|
|
494
467
|
/**
|
|
495
468
|
* 添加逻辑项
|
|
496
469
|
* @internal
|
|
@@ -510,8 +483,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
510
483
|
return this._insertItemInHavingPlaygroundAt(options as any, index);
|
|
511
484
|
}
|
|
512
485
|
|
|
513
|
-
|
|
514
|
-
|
|
515
486
|
/**
|
|
516
487
|
* 添加逻辑项
|
|
517
488
|
* @param logicItemOptions 逻辑项参数
|
|
@@ -535,8 +506,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
535
506
|
return node;
|
|
536
507
|
}
|
|
537
508
|
|
|
538
|
-
|
|
539
|
-
|
|
540
509
|
/**
|
|
541
510
|
* 插入查询排序子句
|
|
542
511
|
* @internal
|
|
@@ -569,8 +538,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
569
538
|
return queryOrderByExpression;
|
|
570
539
|
}
|
|
571
540
|
|
|
572
|
-
|
|
573
|
-
|
|
574
541
|
/**
|
|
575
542
|
* 插入查询排序子句
|
|
576
543
|
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
@@ -593,8 +560,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
593
560
|
return node;
|
|
594
561
|
}
|
|
595
562
|
|
|
596
|
-
|
|
597
|
-
|
|
598
563
|
/**
|
|
599
564
|
* 添加查询排序子句
|
|
600
565
|
* @internal
|
|
@@ -614,8 +579,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
614
579
|
return this._insertQueryOrderByExpressionInOrderByAt(options as any, index);
|
|
615
580
|
}
|
|
616
581
|
|
|
617
|
-
|
|
618
|
-
|
|
619
582
|
/**
|
|
620
583
|
* 添加查询排序子句
|
|
621
584
|
* @param queryOrderByExpressionOptions 查询排序子句参数
|
|
@@ -639,9 +602,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
639
602
|
return node;
|
|
640
603
|
}
|
|
641
604
|
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
605
|
/**
|
|
646
606
|
* 删除类型标注
|
|
647
607
|
* @param name 类型标注名称
|
|
@@ -690,8 +650,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
690
650
|
return params;
|
|
691
651
|
}
|
|
692
652
|
|
|
693
|
-
|
|
694
|
-
|
|
695
653
|
/**
|
|
696
654
|
* 删除查询选择子句
|
|
697
655
|
* @param name 查询选择子句名称
|
|
@@ -717,8 +675,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
717
675
|
return select.delete();
|
|
718
676
|
}
|
|
719
677
|
|
|
720
|
-
|
|
721
|
-
|
|
722
678
|
/**
|
|
723
679
|
* 删除查询 From 子句
|
|
724
680
|
* @param name 查询 From 子句名称
|
|
@@ -744,8 +700,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
744
700
|
return from.delete();
|
|
745
701
|
}
|
|
746
702
|
|
|
747
|
-
|
|
748
|
-
|
|
749
703
|
/**
|
|
750
704
|
* 删除逻辑项
|
|
751
705
|
* @param name 逻辑项名称
|
|
@@ -771,8 +725,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
771
725
|
return where.delete();
|
|
772
726
|
}
|
|
773
727
|
|
|
774
|
-
|
|
775
|
-
|
|
776
728
|
/**
|
|
777
729
|
* 删除逻辑项
|
|
778
730
|
* @param logicItem 已有的逻辑项实例
|
|
@@ -780,12 +732,10 @@ export class CallQueryComponent extends LogicItem {
|
|
|
780
732
|
removeItemInWherePlayground(logicItem: LogicItem): void;
|
|
781
733
|
|
|
782
734
|
removeItemInWherePlayground(options: LogicItem) {
|
|
783
|
-
|
|
735
|
+
const logicItem: LogicItem = options;
|
|
784
736
|
return logicItem.delete();
|
|
785
737
|
}
|
|
786
738
|
|
|
787
|
-
|
|
788
|
-
|
|
789
739
|
/**
|
|
790
740
|
* 删除查询分组
|
|
791
741
|
* @param queryGroupByExpression 已有的查询分组实例
|
|
@@ -793,12 +743,10 @@ export class CallQueryComponent extends LogicItem {
|
|
|
793
743
|
removeQueryGroupByExpressionInGroupBy(queryGroupByExpression: QueryGroupByExpression): void;
|
|
794
744
|
|
|
795
745
|
removeQueryGroupByExpressionInGroupBy(options: QueryGroupByExpression) {
|
|
796
|
-
|
|
746
|
+
const queryGroupByExpression: QueryGroupByExpression = options;
|
|
797
747
|
return queryGroupByExpression.delete();
|
|
798
748
|
}
|
|
799
749
|
|
|
800
|
-
|
|
801
|
-
|
|
802
750
|
/**
|
|
803
751
|
* 删除逻辑项
|
|
804
752
|
* @param name 逻辑项名称
|
|
@@ -824,8 +772,6 @@ export class CallQueryComponent extends LogicItem {
|
|
|
824
772
|
return having.delete();
|
|
825
773
|
}
|
|
826
774
|
|
|
827
|
-
|
|
828
|
-
|
|
829
775
|
/**
|
|
830
776
|
* 删除逻辑项
|
|
831
777
|
* @param logicItem 已有的逻辑项实例
|
|
@@ -833,12 +779,10 @@ export class CallQueryComponent extends LogicItem {
|
|
|
833
779
|
removeItemInHavingPlayground(logicItem: LogicItem): void;
|
|
834
780
|
|
|
835
781
|
removeItemInHavingPlayground(options: LogicItem) {
|
|
836
|
-
|
|
782
|
+
const logicItem: LogicItem = options;
|
|
837
783
|
return logicItem.delete();
|
|
838
784
|
}
|
|
839
785
|
|
|
840
|
-
|
|
841
|
-
|
|
842
786
|
/**
|
|
843
787
|
* 删除查询排序子句
|
|
844
788
|
* @param queryOrderByExpression 已有的查询排序子句实例
|
|
@@ -846,12 +790,10 @@ export class CallQueryComponent extends LogicItem {
|
|
|
846
790
|
removeQueryOrderByExpressionInOrderBy(queryOrderByExpression: QueryOrderByExpression): void;
|
|
847
791
|
|
|
848
792
|
removeQueryOrderByExpressionInOrderBy(options: QueryOrderByExpression) {
|
|
849
|
-
|
|
793
|
+
const queryOrderByExpression: QueryOrderByExpression = options;
|
|
850
794
|
return queryOrderByExpression.delete();
|
|
851
795
|
}
|
|
852
796
|
|
|
853
|
-
|
|
854
|
-
|
|
855
797
|
/**
|
|
856
798
|
* 删除查询分页子句
|
|
857
799
|
* @param name 查询分页子句名称
|
|
@@ -984,8 +926,14 @@ export class CallQueryComponent extends LogicItem {
|
|
|
984
926
|
// })`;
|
|
985
927
|
}
|
|
986
928
|
|
|
929
|
+
// 2.11版本,自动推断返回类型
|
|
987
930
|
isAutoInfer() {
|
|
988
|
-
return this.ideVersion === '2.11';
|
|
931
|
+
return this.ideVersion === '2.11' || this.ideVersion === '2.22';
|
|
932
|
+
}
|
|
933
|
+
// 2.22版本,实体支持列筛选 2.11版本不支持列筛选,需要运维select.selectElements
|
|
934
|
+
get entityPropertySelectable() {
|
|
935
|
+
return false; // 回滚功能
|
|
936
|
+
// return this.ideVersion === '2.22';
|
|
989
937
|
}
|
|
990
938
|
|
|
991
939
|
@withSourceMap()
|
|
@@ -1020,7 +968,7 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1020
968
|
});
|
|
1021
969
|
}
|
|
1022
970
|
// 聚合属性别名
|
|
1023
|
-
this.select.
|
|
971
|
+
this.select.selectAggregateElements.forEach((item, index, array) => {
|
|
1024
972
|
code += indent((state?.tabSize || 0) + 1);
|
|
1025
973
|
const { asName, aggregateName, aggregateParam } = item;
|
|
1026
974
|
if (asName)
|
|
@@ -1048,11 +996,19 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1048
996
|
multipleErrorType: '__WHERE_MULTIPLE_CONDITION__',
|
|
1049
997
|
});
|
|
1050
998
|
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
code,
|
|
1054
|
-
|
|
1055
|
-
|
|
999
|
+
if (this.select.selectAggregateElements.length) {
|
|
1000
|
+
// 聚合属性
|
|
1001
|
+
code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectAggregateElements, {
|
|
1002
|
+
code,
|
|
1003
|
+
state,
|
|
1004
|
+
});
|
|
1005
|
+
} else {
|
|
1006
|
+
// select实体字段
|
|
1007
|
+
code = this.toEmbeddedTSOfSubPart('SELECT', this.select.selectFieldElements.filter((node) => !node.isDotStar), {
|
|
1008
|
+
code,
|
|
1009
|
+
state,
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1056
1012
|
|
|
1057
1013
|
// 分组属性(Group by)
|
|
1058
1014
|
code = this.toEmbeddedTSOfSubPart('GROUP_BY', this.groupBy, {
|
|
@@ -1088,6 +1044,7 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1088
1044
|
&& this.parentNode.concept !== 'Assignment'
|
|
1089
1045
|
&& this.parentNode.concept !== 'ForEachStatement'
|
|
1090
1046
|
&& this.parentNode.concept !== 'SelectMembers'
|
|
1047
|
+
&& this.parentNode.concept !== 'UnaryExpression'
|
|
1091
1048
|
&& this.parentNode.concept !== 'BinaryExpression'
|
|
1092
1049
|
&& this.parentNode.concept !== 'StringInterpolation'
|
|
1093
1050
|
&& this.parentNode.concept !== 'MemberExpression'
|
|
@@ -1104,15 +1061,37 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1104
1061
|
|
|
1105
1062
|
const entityName = node.entityName;
|
|
1106
1063
|
const entityNamespace = node.entityNamespace;
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1064
|
+
// 生成整个实体类型 { entity1: Entity1 } 在2.11属于默认情况;在2.22勾选实体节点(isDotStar=true)时
|
|
1065
|
+
if (!this.entityPropertySelectable || this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.isDotStar)) {
|
|
1066
|
+
properties.push(StructureProperty.from({
|
|
1067
|
+
name: utils.firstLowerCase(entityName),
|
|
1068
|
+
typeAnnotation: TypeAnnotation.from({
|
|
1069
|
+
concept: 'TypeAnnotation',
|
|
1070
|
+
typeKind: 'reference',
|
|
1071
|
+
typeName: entityName,
|
|
1072
|
+
typeNamespace: entityNamespace,
|
|
1073
|
+
}),
|
|
1074
|
+
}));
|
|
1075
|
+
} else if (this.select.selectFieldElements.some((item) => item.entityAsName === entityName && item.propertyName)) {
|
|
1076
|
+
// 2.22 选择字段时,生成选择字段的匿名数据结构 { entity1: { prop1, prop2 } }
|
|
1077
|
+
const entity: Entity = this.app.findNodeByCompleteName(entityNamespace + '.' + entityName);
|
|
1078
|
+
properties.push(StructureProperty.from({
|
|
1079
|
+
name: utils.firstLowerCase(entityName),
|
|
1080
|
+
typeAnnotation: TypeAnnotation.from({
|
|
1081
|
+
concept: 'TypeAnnotation',
|
|
1082
|
+
typeKind: 'anonymousStructure',
|
|
1083
|
+
properties: this.select.selectFieldElements
|
|
1084
|
+
.filter((sel) => sel.entityAsName === entityName && sel.propertyName)
|
|
1085
|
+
.map((item) => {
|
|
1086
|
+
const property = entity.properties.find((prop) => prop.name === item.propertyName);
|
|
1087
|
+
return property && StructureProperty.from({
|
|
1088
|
+
name: item.propertyName,
|
|
1089
|
+
typeAnnotation: TypeAnnotation.from(property.typeAnnotation),
|
|
1090
|
+
});
|
|
1091
|
+
}).filter(Boolean),
|
|
1092
|
+
}),
|
|
1093
|
+
}));
|
|
1094
|
+
} else { /* 实体或属性都不选择时,不生成数据结构 */ }
|
|
1116
1095
|
|
|
1117
1096
|
for (const sub of node.joinParts) {
|
|
1118
1097
|
this.genPropertiesFrom(sub, properties);
|
|
@@ -1146,7 +1125,7 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1146
1125
|
}
|
|
1147
1126
|
|
|
1148
1127
|
genPropertyListOfAggregate(node: CallQueryComponent, entities: Entity[]) {
|
|
1149
|
-
return node.select.
|
|
1128
|
+
return node.select.selectAggregateElements
|
|
1150
1129
|
.filter((item) => item.aggregateName && item.asName)
|
|
1151
1130
|
.map((item) => {
|
|
1152
1131
|
let typeName;
|
|
@@ -1225,7 +1204,7 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1225
1204
|
}
|
|
1226
1205
|
|
|
1227
1206
|
const groupBy = this.groupBy;
|
|
1228
|
-
const selectElements = this.select.
|
|
1207
|
+
const selectElements = this.select.selectAggregateElements;
|
|
1229
1208
|
let structureName;
|
|
1230
1209
|
let typeAnnotation;
|
|
1231
1210
|
|
|
@@ -1356,7 +1335,7 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1356
1335
|
typeNamespace: 'nasl.core',
|
|
1357
1336
|
}, this, 'typeAnnotation');
|
|
1358
1337
|
} else {
|
|
1359
|
-
// 2.2
|
|
1338
|
+
// 2.2 多聚合:`{ Structure }`
|
|
1360
1339
|
typeAnnotation = TypeAnnotation.from({
|
|
1361
1340
|
concept: 'TypeAnnotation',
|
|
1362
1341
|
typeKind: 'anonymousStructure',
|
|
@@ -1364,7 +1343,7 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1364
1343
|
}, this, 'typeAnnotation');
|
|
1365
1344
|
}
|
|
1366
1345
|
} else {
|
|
1367
|
-
// 2.3
|
|
1346
|
+
// 2.3 无分组&&无聚合 (默认情况):`{ list: List<Structure>, total: Long }`
|
|
1368
1347
|
typeAnnotation = TypeAnnotation.from({
|
|
1369
1348
|
concept: 'TypeAnnotation',
|
|
1370
1349
|
typeKind: 'anonymousStructure',
|
|
@@ -1587,6 +1566,18 @@ export class CallQueryComponent extends LogicItem {
|
|
|
1587
1566
|
});
|
|
1588
1567
|
return contentVariables;
|
|
1589
1568
|
}
|
|
1569
|
+
// 临时升级脚本
|
|
1570
|
+
// 将所有from的实体,在selectElements中初始化一个isDotStar=true的QueryFieldExpression
|
|
1571
|
+
initFieldSelectElement(node: CallQueryComponent = this) {
|
|
1572
|
+
const loop = (from: QueryFromExpression | QueryJoinExpression) => {
|
|
1573
|
+
node.select.addQueryFieldExpressionInSelectElements({
|
|
1574
|
+
entityAsName: from.entityName,
|
|
1575
|
+
isDotStar: true,
|
|
1576
|
+
});
|
|
1577
|
+
from.joinParts?.forEach(loop);
|
|
1578
|
+
};
|
|
1579
|
+
loop(node.from);
|
|
1580
|
+
}
|
|
1590
1581
|
//================================================================================
|
|
1591
1582
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
1592
1583
|
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { TranslatorState, withSourceMap, createCompilerState, indent } from '../translator';
|
|
2
2
|
import ConfigGroup from './ConfigGroup__';
|
|
3
3
|
import Namespace from './Namespace__';
|
|
4
|
+
import View from './View__';
|
|
4
5
|
|
|
5
6
|
//================================================================================
|
|
6
7
|
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
@@ -46,6 +47,12 @@ export class ConfigProperty extends BaseNode {
|
|
|
46
47
|
@property('ConfigPropertyValue')
|
|
47
48
|
values: Array<ConfigPropertyValue> = [];
|
|
48
49
|
|
|
50
|
+
/**
|
|
51
|
+
* isPrivate
|
|
52
|
+
*/
|
|
53
|
+
@property()
|
|
54
|
+
isPrivate: boolean = undefined;
|
|
55
|
+
|
|
49
56
|
/**
|
|
50
57
|
* 祖先 App
|
|
51
58
|
*/
|
|
@@ -335,7 +342,17 @@ export class ConfigProperty extends BaseNode {
|
|
|
335
342
|
|
|
336
343
|
@withSourceMap()
|
|
337
344
|
toEmbeddedTS(state?: TranslatorState): string {
|
|
338
|
-
let
|
|
345
|
+
let modifier;
|
|
346
|
+
if (this.isPrivate) {
|
|
347
|
+
modifier = 'private';
|
|
348
|
+
} else {
|
|
349
|
+
modifier = '';
|
|
350
|
+
}
|
|
351
|
+
let code = `class Custom${this.name} {
|
|
352
|
+
${modifier} static FrontEnd${this.name}: nasl.core.String
|
|
353
|
+
static BackEnd${this.name}: nasl.core.String
|
|
354
|
+
};`;
|
|
355
|
+
|
|
339
356
|
if (this.parentNode.name === 'custom') {
|
|
340
357
|
this.values.forEach((value) => {
|
|
341
358
|
code += indent((state?.tabSize || 0) + 1);
|
|
@@ -66,8 +66,6 @@ export class Destination extends LogicItem {
|
|
|
66
66
|
@property()
|
|
67
67
|
target: string = '_self';
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
69
|
/**
|
|
72
70
|
* @param source 需要合并的部分参数
|
|
73
71
|
*/
|
|
@@ -84,7 +82,6 @@ export class Destination extends LogicItem {
|
|
|
84
82
|
return super.from(source, parentNode, parentKey) as Destination;
|
|
85
83
|
}
|
|
86
84
|
|
|
87
|
-
|
|
88
85
|
/**
|
|
89
86
|
* 设置viewNamespace
|
|
90
87
|
*/
|
|
@@ -136,10 +133,6 @@ export class Destination extends LogicItem {
|
|
|
136
133
|
});
|
|
137
134
|
}
|
|
138
135
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
136
|
/**
|
|
144
137
|
* 插入实际参数
|
|
145
138
|
* @internal
|
|
@@ -172,8 +165,6 @@ export class Destination extends LogicItem {
|
|
|
172
165
|
return argument;
|
|
173
166
|
}
|
|
174
167
|
|
|
175
|
-
|
|
176
|
-
|
|
177
168
|
/**
|
|
178
169
|
* 插入实际参数
|
|
179
170
|
* @param argumentOptions 实际参数参数
|
|
@@ -196,8 +187,6 @@ export class Destination extends LogicItem {
|
|
|
196
187
|
return node;
|
|
197
188
|
}
|
|
198
189
|
|
|
199
|
-
|
|
200
|
-
|
|
201
190
|
/**
|
|
202
191
|
* 添加实际参数
|
|
203
192
|
* @internal
|
|
@@ -217,8 +206,6 @@ export class Destination extends LogicItem {
|
|
|
217
206
|
return this._insertArgumentAt(options as any, index);
|
|
218
207
|
}
|
|
219
208
|
|
|
220
|
-
|
|
221
|
-
|
|
222
209
|
/**
|
|
223
210
|
* 添加实际参数
|
|
224
211
|
* @param argumentOptions 实际参数参数
|
|
@@ -242,9 +229,6 @@ export class Destination extends LogicItem {
|
|
|
242
229
|
return node;
|
|
243
230
|
}
|
|
244
231
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
232
|
/**
|
|
249
233
|
* 删除实际参数
|
|
250
234
|
* @param argument 已有的实际参数实例
|
|
@@ -252,12 +236,10 @@ export class Destination extends LogicItem {
|
|
|
252
236
|
removeArgumentInArguments(argument: Argument): void;
|
|
253
237
|
|
|
254
238
|
removeArgumentInArguments(options: Argument) {
|
|
255
|
-
|
|
239
|
+
const argument: Argument = options;
|
|
256
240
|
return argument.delete();
|
|
257
241
|
}
|
|
258
242
|
|
|
259
|
-
|
|
260
|
-
|
|
261
243
|
/**
|
|
262
244
|
* 删除锚点参数
|
|
263
245
|
* @param name 锚点参数名称
|
|
@@ -636,7 +618,7 @@ export class Destination extends LogicItem {
|
|
|
636
618
|
}
|
|
637
619
|
});
|
|
638
620
|
}
|
|
639
|
-
if (this.viewNode) {
|
|
621
|
+
if (this.viewNode && this.viewNode.frontend) {
|
|
640
622
|
return `${this.viewNode.frontend.basePath}/${viewNameAttr.join('/')}`;
|
|
641
623
|
}
|
|
642
624
|
return `/${viewNameAttr.join('/')}`;
|