@lcap/nasl 2.13.0-beta.2 → 2.13.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/out/concepts/BindAttribute__.js +7 -4
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/CompletionProperty__.d.ts +0 -1
- package/out/concepts/CompletionProperty__.js +0 -1
- package/out/concepts/CompletionProperty__.js.map +1 -1
- package/out/concepts/DataSource__.js +1 -0
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/Destination__.js +6 -1
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/Entity__.js +1 -0
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Enum__.js +1 -0
- package/out/concepts/Enum__.js.map +1 -1
- package/out/concepts/Function__.d.ts +2 -1
- package/out/concepts/Function__.js +0 -28
- package/out/concepts/Function__.js.map +1 -1
- package/out/concepts/Interface__.js +1 -0
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/Logic__.js +1 -0
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/ProcessElement__.d.ts +4 -0
- package/out/concepts/ProcessElement__.js +31 -0
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/Process__.js +1 -0
- package/out/concepts/Process__.js.map +1 -1
- package/out/concepts/Role__.js +1 -0
- package/out/concepts/Role__.js.map +1 -1
- package/out/concepts/Structure__.js +1 -0
- package/out/concepts/Structure__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.js +3 -14
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +1 -0
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.collection.js +12 -0
- package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +187 -5
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js +1 -1
- package/out/concepts/basics/stdlib/reference2TypeAnnotationList.js.map +1 -1
- package/out/enums/KEYWORDS.d.ts +1 -0
- package/out/enums/KEYWORDS.js +16 -1
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genBundleFiles.js +25 -1
- package/out/generator/genBundleFiles.js.map +1 -1
- package/out/server/getLogics.js +18 -17
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.d.ts +9 -0
- package/out/server/getMemberIdentifier.js +98 -34
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/getProcesses.js +9 -18
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.d.ts +48 -0
- package/out/server/naslServer.js +56 -11
- package/out/server/naslServer.js.map +1 -1
- package/out/templator/genQueryComponent.js +8 -8
- package/out/templator/genQueryComponent.js.map +1 -1
- package/package.json +1 -1
- package/src/concepts/BindAttribute__.ts +7 -24
- package/src/concepts/CompletionProperty__.ts +0 -1
- package/src/concepts/DataSource__.ts +1 -0
- package/src/concepts/Destination__.ts +6 -1
- package/src/concepts/Entity__.ts +1 -0
- package/src/concepts/Enum__.ts +1 -0
- package/src/concepts/Interface__.ts +1 -0
- package/src/concepts/Logic__.ts +1 -0
- package/src/concepts/ProcessElement__.ts +35 -1
- package/src/concepts/Process__.ts +1 -0
- package/src/concepts/Role__.ts +1 -0
- package/src/concepts/Structure__.ts +1 -0
- package/src/concepts/TypeAnnotation__.ts +3 -30
- package/src/concepts/ViewElement__.ts +1 -19
- package/src/concepts/View__.ts +1 -0
- package/src/concepts/basics/stdlib/nasl.collection.ts +12 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +187 -5
- package/src/concepts/basics/stdlib/reference2TypeAnnotationList.ts +1 -1
- package/src/enums/KEYWORDS.ts +16 -0
- package/src/generator/genBundleFiles.ts +24 -1
- package/src/server/getLogics.ts +18 -17
- package/src/server/getMemberIdentifier.ts +92 -32
- package/src/server/getProcesses.ts +10 -19
- package/src/server/naslServer.ts +57 -11
- package/src/templator/genQueryComponent.ts +8 -8
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Constant from '@nasl/concepts/Constant__';
|
|
2
2
|
import { CompletionProperty, Process, ProcessElement, Namespace, Logic, TypeAnnotation, Return, Variable, StructureProperty, Param, Identifier, MemberExpression, LogicItem, App, BaseNode, Structure, Entity, EntityProperty } from '..';
|
|
3
3
|
import { getNodeByNodeCallee } from '../automate/engine/utils';
|
|
4
|
+
import { isNoChildType, nextFindTypeChild } from './getMemberIdentifier';
|
|
4
5
|
function alphaUpper(name: string) {
|
|
5
6
|
if (!name) {
|
|
6
7
|
return '';
|
|
@@ -250,20 +251,20 @@ export function genCompletionProperty(prefix: string[] = []):(v: Variable | Para
|
|
|
250
251
|
if (t.length) {
|
|
251
252
|
prevalue = `${t.join('.')}.`;
|
|
252
253
|
}
|
|
253
|
-
const
|
|
254
|
-
const
|
|
254
|
+
const noChildType = isNoChildType(v.typeAnnotation.typeKey);
|
|
255
|
+
const item = {
|
|
255
256
|
expression: m || p,
|
|
256
|
-
noFurther: !hasChild,
|
|
257
257
|
name: v.name,
|
|
258
258
|
value: prevalue + v.name,
|
|
259
|
+
};
|
|
259
260
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
cp.icon = v.concept;
|
|
263
|
-
|
|
264
|
-
if (hasChild) {
|
|
265
|
-
cp.children = [new CompletionProperty()];
|
|
261
|
+
if (!noChildType) {
|
|
262
|
+
nextFindTypeChild(v.typeAnnotation.typeKey, item, null, v);
|
|
266
263
|
}
|
|
264
|
+
|
|
265
|
+
const cp = new CompletionProperty(item);
|
|
266
|
+
console.log(cp.value, v);
|
|
267
|
+
cp.icon = v.concept;
|
|
267
268
|
return cp;
|
|
268
269
|
};
|
|
269
270
|
}
|
|
@@ -307,7 +308,6 @@ export function getProcessVariableSuggestions(node: Logic, abandonConstant: bool
|
|
|
307
308
|
const cp = new CompletionProperty({
|
|
308
309
|
name: us.name,
|
|
309
310
|
value: us.name,
|
|
310
|
-
noFurther: true,
|
|
311
311
|
children: [
|
|
312
312
|
...us.returns.map(genCompletionProperty([process.name, us.name])),
|
|
313
313
|
...(abandonConstant ? [] : us.constants.map(genCompletionProperty([process.name, us.name]))),
|
|
@@ -321,7 +321,6 @@ export function getProcessVariableSuggestions(node: Logic, abandonConstant: bool
|
|
|
321
321
|
const processVariables = new CompletionProperty({
|
|
322
322
|
name: process.name,
|
|
323
323
|
value: process.name,
|
|
324
|
-
noFurther: true,
|
|
325
324
|
children: [
|
|
326
325
|
...process.params.map(genCompletionProperty([process.name])),
|
|
327
326
|
...process.returns.map(genCompletionProperty([process.name])),
|
|
@@ -335,7 +334,6 @@ export function getProcessVariableSuggestions(node: Logic, abandonConstant: bool
|
|
|
335
334
|
name: processElem.name,
|
|
336
335
|
value: processElem.name,
|
|
337
336
|
icon: processElem.type,
|
|
338
|
-
noFurther: true,
|
|
339
337
|
children: processElem.variables.map(genCompletionProperty([process.name, processElem.name])),
|
|
340
338
|
});
|
|
341
339
|
scopeVariable.isProcess = true;
|
|
@@ -348,7 +346,6 @@ export function getProcessVariableSuggestions(node: Logic, abandonConstant: bool
|
|
|
348
346
|
name: processElem.name,
|
|
349
347
|
value: processElem.name,
|
|
350
348
|
icon: processElem.type,
|
|
351
|
-
noFurther: true,
|
|
352
349
|
children: processElem.constants.map(genCompletionProperty([process.name, processElem.name])),
|
|
353
350
|
});
|
|
354
351
|
scopeVariable.isProcess = true;
|
|
@@ -360,7 +357,6 @@ export function getProcessVariableSuggestions(node: Logic, abandonConstant: bool
|
|
|
360
357
|
name: processElem.name,
|
|
361
358
|
value: processElem.name,
|
|
362
359
|
icon: processElem.type,
|
|
363
|
-
noFurther: true,
|
|
364
360
|
children: [
|
|
365
361
|
...processElem.variables.map(genCompletionProperty([process.name, processElem.name])),
|
|
366
362
|
...processElem.returns.map(genCompletionProperty([process.name, processElem.name])),
|
|
@@ -457,7 +453,6 @@ export function getProcessVariableSuggestionsAll(node: ProcessElement) {
|
|
|
457
453
|
const cp = new CompletionProperty({
|
|
458
454
|
name: us.name,
|
|
459
455
|
value: us.name,
|
|
460
|
-
noFurther: true,
|
|
461
456
|
children: [
|
|
462
457
|
...us.returns.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, us.name], [])),
|
|
463
458
|
...us.constants.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, us.name], [])),
|
|
@@ -472,7 +467,6 @@ export function getProcessVariableSuggestionsAll(node: ProcessElement) {
|
|
|
472
467
|
const processVariables = new CompletionProperty({
|
|
473
468
|
name: process.name,
|
|
474
469
|
value: process.name,
|
|
475
|
-
noFurther: true,
|
|
476
470
|
children: [
|
|
477
471
|
...process.params.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name], [])),
|
|
478
472
|
...process.returns.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name], [])),
|
|
@@ -487,7 +481,6 @@ export function getProcessVariableSuggestionsAll(node: ProcessElement) {
|
|
|
487
481
|
name: processElem.name,
|
|
488
482
|
value: processElem.name,
|
|
489
483
|
icon: processElem.type,
|
|
490
|
-
noFurther: true,
|
|
491
484
|
children: processElem.variables.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, processElem.name], [])),
|
|
492
485
|
});
|
|
493
486
|
scopeVariable.expanded = true;
|
|
@@ -501,7 +494,6 @@ export function getProcessVariableSuggestionsAll(node: ProcessElement) {
|
|
|
501
494
|
name: processElem.name,
|
|
502
495
|
value: processElem.name,
|
|
503
496
|
icon: processElem.type,
|
|
504
|
-
noFurther: true,
|
|
505
497
|
children: processElem.constants.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, processElem.name], [])),
|
|
506
498
|
});
|
|
507
499
|
scopeVariable.expanded = true;
|
|
@@ -514,7 +506,6 @@ export function getProcessVariableSuggestionsAll(node: ProcessElement) {
|
|
|
514
506
|
name: processElem.name,
|
|
515
507
|
value: processElem.name,
|
|
516
508
|
icon: processElem.type,
|
|
517
|
-
noFurther: true,
|
|
518
509
|
children: [
|
|
519
510
|
...processElem.variables.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, processElem.name], [])),
|
|
520
511
|
...processElem.returns.map(node => deduceTypeAnnotation(app, node, node.typeAnnotation, [process.name, processElem.name], [])),
|
package/src/server/naslServer.ts
CHANGED
|
@@ -146,7 +146,6 @@ const naslServer = {
|
|
|
146
146
|
structure.sourceMap = result.sourceMap;
|
|
147
147
|
this.file2NodeMap.set(result.filePath, structure);
|
|
148
148
|
} catch (err) {
|
|
149
|
-
console.log(err);
|
|
150
149
|
}
|
|
151
150
|
});
|
|
152
151
|
(module as App).dataSources?.forEach((dataSource) => {
|
|
@@ -158,7 +157,6 @@ const naslServer = {
|
|
|
158
157
|
dataSource.sourceMap = result.sourceMap;
|
|
159
158
|
this.file2NodeMap.set(result.filePath, dataSource);
|
|
160
159
|
} catch (err) {
|
|
161
|
-
console.log(err);
|
|
162
160
|
}
|
|
163
161
|
dataSource.entities.forEach((entity) => {
|
|
164
162
|
try {
|
|
@@ -168,7 +166,6 @@ const naslServer = {
|
|
|
168
166
|
entity.sourceMap = result.sourceMap;
|
|
169
167
|
this.file2NodeMap.set(result.filePath, entity);
|
|
170
168
|
} catch (err) {
|
|
171
|
-
console.log(err);
|
|
172
169
|
}
|
|
173
170
|
});
|
|
174
171
|
});
|
|
@@ -181,7 +178,6 @@ const naslServer = {
|
|
|
181
178
|
_interface.sourceMap = result.sourceMap;
|
|
182
179
|
this.file2NodeMap.set(result.filePath, _interface);
|
|
183
180
|
} catch (err) {
|
|
184
|
-
console.log(err);
|
|
185
181
|
}
|
|
186
182
|
});
|
|
187
183
|
module.enums.forEach((_enum) => {
|
|
@@ -192,7 +188,6 @@ const naslServer = {
|
|
|
192
188
|
_enum.sourceMap = result.sourceMap;
|
|
193
189
|
this.file2NodeMap.set(result.filePath, _enum);
|
|
194
190
|
} catch (err) {
|
|
195
|
-
console.log(err);
|
|
196
191
|
}
|
|
197
192
|
});
|
|
198
193
|
module.logics.forEach((logic) => {
|
|
@@ -204,7 +199,6 @@ const naslServer = {
|
|
|
204
199
|
logic.sourceMap = result.sourceMap;
|
|
205
200
|
this.file2NodeMap.set(result.filePath, logic);
|
|
206
201
|
} catch (err) {
|
|
207
|
-
console.log(err);
|
|
208
202
|
}
|
|
209
203
|
});
|
|
210
204
|
|
|
@@ -218,7 +212,6 @@ const naslServer = {
|
|
|
218
212
|
process.sourceMap = result.sourceMap;
|
|
219
213
|
this.file2NodeMap.set(result.filePath, process);
|
|
220
214
|
} catch (err) {
|
|
221
|
-
console.log(err);
|
|
222
215
|
}
|
|
223
216
|
});
|
|
224
217
|
|
|
@@ -231,7 +224,6 @@ const naslServer = {
|
|
|
231
224
|
role.sourceMap = result.sourceMap;
|
|
232
225
|
this.file2NodeMap.set(result.filePath, role);
|
|
233
226
|
} catch (err) {
|
|
234
|
-
console.log(err);
|
|
235
227
|
}
|
|
236
228
|
});
|
|
237
229
|
}
|
|
@@ -249,7 +241,6 @@ const naslServer = {
|
|
|
249
241
|
naslServer.view2TSFile(view.children, results);
|
|
250
242
|
}
|
|
251
243
|
} catch (err) {
|
|
252
|
-
console.log(err);
|
|
253
244
|
}
|
|
254
245
|
});
|
|
255
246
|
}
|
|
@@ -391,6 +382,11 @@ const naslServer = {
|
|
|
391
382
|
});
|
|
392
383
|
return typeList;
|
|
393
384
|
},
|
|
385
|
+
/**
|
|
386
|
+
* 获取 Convert 的可选类型
|
|
387
|
+
* @param node 传入当前已经选择的变量
|
|
388
|
+
* @returns 可以选择的类型数组
|
|
389
|
+
*/
|
|
394
390
|
async getTypeQuickinfo(node: BaseNode) {
|
|
395
391
|
if (node && node instanceof BaseNode) {
|
|
396
392
|
const callFunction = node.parentNode.parentNode;
|
|
@@ -478,9 +474,20 @@ const naslServer = {
|
|
|
478
474
|
}
|
|
479
475
|
return '';
|
|
480
476
|
},
|
|
477
|
+
/**
|
|
478
|
+
* ts的 quickInfo方法,查询指定位置的详情
|
|
479
|
+
* @param args 文件信息数组
|
|
480
|
+
* @returns 查询到的
|
|
481
|
+
*/
|
|
481
482
|
_getTypeQuickinfo(args: any) {
|
|
482
483
|
return this.messager.requestCommand('quickInfo', args) as unknown as { responseRequired: boolean; response: tsProtocol.QuickInfoResponseBody };
|
|
483
484
|
},
|
|
485
|
+
/**
|
|
486
|
+
* 获取已经选中的内容的 下一级的内容
|
|
487
|
+
* @param node 已经选中的内容
|
|
488
|
+
* @param noFilterList 不过滤的key 的数据
|
|
489
|
+
* @returns 可以选择的数据数组
|
|
490
|
+
*/
|
|
484
491
|
getSelectNextCompletion(node: BaseNode, noFilterList?: Array<string>) {
|
|
485
492
|
const { currentSource, fileNode } = naslServer.getCurrentSource(node);
|
|
486
493
|
// console.log(currentSource, fileNode);
|
|
@@ -500,6 +507,11 @@ const naslServer = {
|
|
|
500
507
|
_getSelectNextCompletion(args: any) {
|
|
501
508
|
return this.messager.requestCommand('getSelectNextCompletion', args);
|
|
502
509
|
},
|
|
510
|
+
/**
|
|
511
|
+
* 获取诊断信息
|
|
512
|
+
* @param fileNames 多个文件名
|
|
513
|
+
* @returns 诊断结果
|
|
514
|
+
*/
|
|
503
515
|
async getDiagnosticRecords(fileNames?: Array<string>): Promise<Array<DiagnosticRecord>> {
|
|
504
516
|
const records = (await this.messager.requestCommand('getDiagnosticRecords', fileNames)) as Array<DiagnosticRecord>;
|
|
505
517
|
return this._resolveDiagnosticRecords(records);
|
|
@@ -508,6 +520,11 @@ const naslServer = {
|
|
|
508
520
|
const records = await this.getDiagnosticRecords(fileNames);
|
|
509
521
|
// diagnosticManager.pushAll(records);
|
|
510
522
|
},
|
|
523
|
+
/**
|
|
524
|
+
* 处理诊断结果
|
|
525
|
+
* @param records 结果
|
|
526
|
+
* @returns 过滤或者转换后的诊断结果
|
|
527
|
+
*/
|
|
511
528
|
_resolveDiagnosticRecords(records: Array<DiagnosticRecord>) {
|
|
512
529
|
records.forEach((record) => {
|
|
513
530
|
const node = this.file2NodeMap.get(record.filePath);
|
|
@@ -552,6 +569,11 @@ const naslServer = {
|
|
|
552
569
|
|
|
553
570
|
return records;
|
|
554
571
|
},
|
|
572
|
+
/**
|
|
573
|
+
* 额外的诊断
|
|
574
|
+
* @param fileNode 文件级别的节点
|
|
575
|
+
* @returns 诊断结果
|
|
576
|
+
*/
|
|
555
577
|
_attachDiagnostics(fileNode: BaseNode): Diagnostic[] {
|
|
556
578
|
const diagnostics: Diagnostic[] = [];
|
|
557
579
|
if (fileNode instanceof View) {
|
|
@@ -656,6 +678,12 @@ const naslServer = {
|
|
|
656
678
|
}, 2000);
|
|
657
679
|
}
|
|
658
680
|
},
|
|
681
|
+
/**
|
|
682
|
+
* 单个问题的诊断处理
|
|
683
|
+
* @param diagnostic 诊断问题
|
|
684
|
+
* @param fileNode 页面节点
|
|
685
|
+
* @returns 处理后的结果
|
|
686
|
+
*/
|
|
659
687
|
_resolveDiagnostic(diagnostic: tsProtocol.DiagnosticWithFileName, fileNode: FileNode): Diagnostic {
|
|
660
688
|
const minRange = this._findMinRange(diagnostic, fileNode);
|
|
661
689
|
const tsErrorDetail = {
|
|
@@ -676,6 +704,12 @@ const naslServer = {
|
|
|
676
704
|
};
|
|
677
705
|
}
|
|
678
706
|
},
|
|
707
|
+
/**
|
|
708
|
+
* 通过节点诊断反过来查找节点
|
|
709
|
+
* @param diagnostic 诊断信息
|
|
710
|
+
* @param fileNode 文件级别节点
|
|
711
|
+
* @returns 找到的节点
|
|
712
|
+
*/
|
|
679
713
|
_findMinRange(diagnostic: tsProtocol.DiagnosticWithFileName | tsProtocol.ReferencesResponseItem, fileNode: FileNode) {
|
|
680
714
|
let minRange: MinRange;
|
|
681
715
|
const sourceMap: SourceMap = fileNode.sourceMap;
|
|
@@ -717,6 +751,11 @@ const naslServer = {
|
|
|
717
751
|
}
|
|
718
752
|
return minRange;
|
|
719
753
|
},
|
|
754
|
+
/**
|
|
755
|
+
* 查看当前节点是不是有引用
|
|
756
|
+
* @param node 节点
|
|
757
|
+
* @returns 查找到的数组
|
|
758
|
+
*/
|
|
720
759
|
async _isHaveRef(node: BaseNode) {
|
|
721
760
|
const { currentSource, fileNode } = naslServer.getCurrentSource(node);
|
|
722
761
|
let refsList: tsProtocol.ReferencesResponseItem[] = [];
|
|
@@ -1223,7 +1262,10 @@ const naslServer = {
|
|
|
1223
1262
|
}
|
|
1224
1263
|
// params修改 查找View不需要修改
|
|
1225
1264
|
// 逻辑改名,触发了在定义里面的,element定义,的值,直接掠过
|
|
1226
|
-
|
|
1265
|
+
/**
|
|
1266
|
+
修改枚举名 引发查找到view ,以为viewElement有一个类型,但是渲染了两次,就过滤掉找到view的 内容
|
|
1267
|
+
*/
|
|
1268
|
+
if (minRange.node instanceof View && (node instanceof Logic || node instanceof Param || node instanceof Enum)) {
|
|
1227
1269
|
/**
|
|
1228
1270
|
* 这里过滤一下,一些查找引用,重复的内容,直接屏蔽掉,防止操作重复
|
|
1229
1271
|
* 因为在生成的时候 ,可能弄了一些副作用的引用
|
|
@@ -1246,6 +1288,10 @@ const naslServer = {
|
|
|
1246
1288
|
if (minRange.node instanceof Logic && node !== minRange.node) {
|
|
1247
1289
|
return null;
|
|
1248
1290
|
}
|
|
1291
|
+
|
|
1292
|
+
if (node instanceof Param && minRange.node instanceof Interface) {
|
|
1293
|
+
return null;
|
|
1294
|
+
}
|
|
1249
1295
|
} else {
|
|
1250
1296
|
console.log('没找到节点需要排查');
|
|
1251
1297
|
console.log(record, fileNode.sourceMap);
|
|
@@ -1449,7 +1495,7 @@ const naslServer = {
|
|
|
1449
1495
|
* @returns 当前节点,最后输出所有节点
|
|
1450
1496
|
*/
|
|
1451
1497
|
_recursionCreateResult(root: QuoteNode, map: Map<QuoteNode, Array<QuoteNode>>) {
|
|
1452
|
-
const children = map.get(root).map((item: QuoteNode) => naslServer._recursionCreateResult(item, map));
|
|
1498
|
+
const children = (map.get(root) || []).map((item: QuoteNode) => naslServer._recursionCreateResult(item, map));
|
|
1453
1499
|
if (children && children.length) {
|
|
1454
1500
|
root.children = children;
|
|
1455
1501
|
}
|
|
@@ -251,14 +251,6 @@ export async function joinEntity(callQueryComponent: CallQueryComponent, entity:
|
|
|
251
251
|
propertyName: joinInfo.rightProperty.name,
|
|
252
252
|
}),
|
|
253
253
|
}));
|
|
254
|
-
const structureProperty = StructureProperty.from(NaslNode.StructureProperty({
|
|
255
|
-
name: utils.firstLowerCase(entity.name),
|
|
256
|
-
typeAnnotation: NaslTypeAnnotation.Reference({
|
|
257
|
-
typeNamespace: entity.getNamespace(),
|
|
258
|
-
typeName: entity.name,
|
|
259
|
-
}),
|
|
260
|
-
}), recordStructure, 'properties');
|
|
261
|
-
recordStructure.addProperty(structureProperty);
|
|
262
254
|
} else {
|
|
263
255
|
queryJoinExpression.onExpressions.push(NaslLogicItem.BinaryExpression({
|
|
264
256
|
operator: '==',
|
|
@@ -274,6 +266,14 @@ export async function joinEntity(callQueryComponent: CallQueryComponent, entity:
|
|
|
274
266
|
}),
|
|
275
267
|
}));
|
|
276
268
|
}
|
|
269
|
+
const structureProperty = StructureProperty.from(NaslNode.StructureProperty({
|
|
270
|
+
name: utils.firstLowerCase(entity.name),
|
|
271
|
+
typeAnnotation: NaslTypeAnnotation.Reference({
|
|
272
|
+
typeNamespace: entity.getNamespace(),
|
|
273
|
+
typeName: entity.name,
|
|
274
|
+
}),
|
|
275
|
+
}), recordStructure, 'properties');
|
|
276
|
+
recordStructure.addProperty(structureProperty);
|
|
277
277
|
const newJoinPartLogicItem = QueryJoinExpression.from(queryJoinExpression, callQueryComponent, 'joinParts');
|
|
278
278
|
from.addJoinPart(newJoinPartLogicItem);
|
|
279
279
|
callQueryComponent.saveStructure();
|