@lcap/nasl 3.6.4-beta.1 → 3.6.4-beta.3
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/3e8e5f5d-80b0-40bc-a120-b24c497d0731.json +1 -0
- package/.nyc_output/processinfo/3e8e5f5d-80b0-40bc-a120-b24c497d0731.json +1 -0
- package/.nyc_output/processinfo/index.json +1 -1
- package/coverage/cobertura-coverage.xml +74111 -3194
- package/out/common/BaseNode.js +3 -3
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/App__.js +1 -1
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +1 -1
- package/out/concepts/InterfaceParam__.js +2 -2
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.js +1 -1
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/NewComposite__.js +2 -2
- package/out/concepts/NewComposite__.js.map +1 -1
- package/out/generator/release-body/internal.d.ts +153 -0
- package/out/generator/release-body/utils.d.ts +1 -0
- package/out/generator/release-body/utils.js +14 -4
- package/out/generator/release-body/utils.js.map +1 -1
- package/out/natural/prompt/analyzeClaims.js +2 -0
- package/out/natural/prompt/analyzeClaims.js.map +1 -1
- package/out/natural/prompt/analyzeTasks.js +10 -9
- package/out/natural/prompt/analyzeTasks.js.map +1 -1
- package/out/natural/prompt/executeClaims.js +8 -4
- package/out/natural/prompt/executeClaims.js.map +1 -1
- package/out/natural/transformTSCode.js +7 -4
- package/out/natural/transformTSCode.js.map +1 -1
- package/out/server/formatTsUtils.js +2 -2
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/naslServer.js +2 -0
- package/out/server/naslServer.js.map +1 -1
- package/out/service/storage/init.js +1 -1
- package/out/service/storage/init.js.map +1 -1
- package/package.json +1 -1
- package/sandbox-natural/stdlib/nasl.core.ts +2 -0
- package/sandbox-natural/stdlib/nasl.util.ts +2 -0
- package/src/common/BaseNode.ts +3 -3
- package/src/concepts/App__.ts +1 -1
- package/src/concepts/InterfaceParam__.ts +2 -2
- package/src/concepts/Interface__.ts +1 -1
- package/src/concepts/NewComposite__.ts +2 -2
- package/src/generator/release-body/internal.ts +154 -0
- package/src/generator/release-body/utils.ts +17 -7
- package/src/natural/prompt/analyzeClaims.ts +2 -0
- package/src/natural/prompt/analyzeTasks.ts +10 -9
- package/src/natural/prompt/executeClaims.ts +8 -4
- package/src/natural/transformTSCode.ts +6 -4
- package/src/server/formatTsUtils.ts +2 -2
- package/src/server/naslServer.ts +2 -0
- package/src/service/storage/init.ts +1 -1
- package/.nyc_output/50a74696-517e-4e22-8a16-9eeecc5ae7c2.json +0 -1
- package/.nyc_output/processinfo/50a74696-517e-4e22-8a16-9eeecc5ae7c2.json +0 -1
|
@@ -568,7 +568,7 @@ export function transformTSCode(tsCode: string, contextLogicName: string, type?:
|
|
|
568
568
|
return new naslTypes.CallInterface({
|
|
569
569
|
calleeNamespace: generate((node.callee as any).object).code,
|
|
570
570
|
calleeName: (callee[callee.length - 1] as babelTypes.Identifier).name,
|
|
571
|
-
arguments: node?.arguments?.map((arg: any) => arg?.properties
|
|
571
|
+
arguments: node?.arguments?.map((arg: any) => arg?.properties?.map((item: any) => new naslTypes.Argument({
|
|
572
572
|
keyword: item?.key?.name,
|
|
573
573
|
expression: transformLogicNode(item?.value),
|
|
574
574
|
}))).flat() as naslTypes.Argument[],
|
|
@@ -713,7 +713,7 @@ export function transformTSCode(tsCode: string, contextLogicName: string, type?:
|
|
|
713
713
|
name: (callee?.[2] as babelTypes.Identifier)?.name,
|
|
714
714
|
}),
|
|
715
715
|
property: new naslTypes.Identifier({
|
|
716
|
-
name: (callee?.[3] as babelTypes.StringLiteral)?.value,
|
|
716
|
+
name: (callee?.[3] as babelTypes.StringLiteral)?.value || (callee?.[3] as babelTypes.Identifier)?.name,
|
|
717
717
|
}),
|
|
718
718
|
});
|
|
719
719
|
}
|
|
@@ -923,8 +923,10 @@ export function transformTSCode(tsCode: string, contextLogicName: string, type?:
|
|
|
923
923
|
let statements: babelTypes.Statement[] = [];
|
|
924
924
|
|
|
925
925
|
let func: babelTypes.FunctionDeclaration;
|
|
926
|
-
if (root.program
|
|
927
|
-
func = root.program
|
|
926
|
+
if (root.program?.body[0]?.type === 'ExportNamedDeclaration') {
|
|
927
|
+
func = root.program?.body[0]?.declaration as babelTypes.FunctionDeclaration;
|
|
928
|
+
} else {
|
|
929
|
+
func = root.program?.body[0] as babelTypes.FunctionDeclaration;
|
|
928
930
|
}
|
|
929
931
|
parameters = func.params as babelTypes.Identifier[];
|
|
930
932
|
statements = func.body.body;
|
|
@@ -734,10 +734,10 @@ function getNodeiconFromLogic(completionProperty: CompletionProperty, node: type
|
|
|
734
734
|
}
|
|
735
735
|
}
|
|
736
736
|
|
|
737
|
-
const bindAttr = node
|
|
737
|
+
const bindAttr = node?.getAncestor?.<BindAttribute>('BindAttribute');
|
|
738
738
|
|
|
739
739
|
if (bindAttr) {
|
|
740
|
-
const interfaceInstance = bindAttr
|
|
740
|
+
const interfaceInstance = bindAttr?.getAncestor?.<Interface>('Interface');
|
|
741
741
|
|
|
742
742
|
if (interfaceInstance?.params.find((item) => item.name === propName)) {
|
|
743
743
|
return 'param';
|
package/src/server/naslServer.ts
CHANGED
|
@@ -1242,6 +1242,7 @@ class NaslServer {
|
|
|
1242
1242
|
});
|
|
1243
1243
|
|
|
1244
1244
|
this.logger.timeEnd('处理诊断数据');
|
|
1245
|
+
this.logger.timeEnd('语言服务变更');
|
|
1245
1246
|
|
|
1246
1247
|
return records;
|
|
1247
1248
|
}
|
|
@@ -5056,6 +5057,7 @@ class NaslServer {
|
|
|
5056
5057
|
invokeCommand('naslServer:startWork');
|
|
5057
5058
|
}
|
|
5058
5059
|
|
|
5060
|
+
this.logger.time('语言服务变更');
|
|
5059
5061
|
this.singleFileChangeIng = true;
|
|
5060
5062
|
// 行为
|
|
5061
5063
|
const { action, oldObject = {}, object = {} } = $event;
|