@lcap/nasl 2.22.1 → 2.22.2-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/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 +200 -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 +31 -0
- package/out/breakpoint/shared/constants.js +91 -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 +23 -0
- package/out/breakpoint/shared/utils.js +165 -0
- package/out/breakpoint/shared/utils.js.map +1 -0
- package/out/breakpoint/store/core.d.ts +32 -0
- package/out/breakpoint/store/core.js +388 -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/Command.js +1 -1
- package/out/common/Command.js.map +1 -1
- package/out/common/asyncFuncMap.d.ts +2 -0
- package/out/common/asyncFuncMap.js +16 -0
- package/out/common/asyncFuncMap.js.map +1 -0
- package/out/concepts/AnonymousFunction__.js +11 -9
- package/out/concepts/AnonymousFunction__.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/CallAuthInterface__.d.ts +126 -0
- package/out/concepts/CallAuthInterface__.js +408 -0
- package/out/concepts/CallAuthInterface__.js.map +1 -0
- package/out/concepts/CallConnector__.d.ts +42 -0
- package/out/concepts/CallConnector__.js +198 -0
- package/out/concepts/CallConnector__.js.map +1 -0
- package/out/concepts/ConnectorTrigger__.d.ts +78 -0
- package/out/concepts/ConnectorTrigger__.js +155 -0
- package/out/concepts/ConnectorTrigger__.js.map +1 -0
- package/out/concepts/Connector__.d.ts +464 -0
- package/out/concepts/Connector__.js +698 -0
- package/out/concepts/Connector__.js.map +1 -0
- package/out/concepts/Destination__.js +6 -4
- package/out/concepts/Destination__.js.map +1 -1
- 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/Match__.js +25 -6
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/MsgTriggerEvent__.d.ts +137 -0
- package/out/concepts/MsgTriggerEvent__.js +228 -0
- package/out/concepts/MsgTriggerEvent__.js.map +1 -0
- package/out/concepts/MsgTriggerLauncher__.d.ts +118 -0
- package/out/concepts/MsgTriggerLauncher__.js +204 -0
- package/out/concepts/MsgTriggerLauncher__.js.map +1 -0
- 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__.js +1 -1
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/StringLiteral__.js +5 -1
- package/out/concepts/StringLiteral__.js.map +1 -1
- package/out/concepts/TriggerEvent__.d.ts +120 -0
- package/out/concepts/TriggerEvent__.js +222 -0
- package/out/concepts/TriggerEvent__.js.map +1 -0
- package/out/concepts/TriggerLauncher__.d.ts +88 -0
- package/out/concepts/TriggerLauncher__.js +235 -0
- package/out/concepts/TriggerLauncher__.js.map +1 -0
- 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/types__.d.ts +124 -0
- package/out/concepts/types__.js +3 -0
- package/out/concepts/types__.js.map +1 -0
- package/out/server/getConnector.d.ts +11 -0
- package/out/server/getConnector.js +42 -0
- package/out/server/getConnector.js.map +1 -0
- package/out/server/naslServer.js +55 -0
- package/out/server/naslServer.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/templator/genCreateBlock.js +2 -1
- package/out/templator/genCreateBlock.js.map +1 -1
- package/out/templator/genCurdEditMultipleKeyBlock.js +6 -3
- package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.js +4 -2
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genEditTableBlock.js +2 -1
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/package.json +2 -2
- package/src/common/Command.ts +1 -1
- package/src/common/dist/Command.js +39 -0
- package/src/concepts/AnonymousFunction__.ts +13 -11
- package/src/concepts/Destination__.ts +7 -5
- package/src/concepts/Match__.ts +24 -6
- package/src/concepts/Param__.ts +1 -1
- package/src/concepts/StringLiteral__.ts +5 -1
- package/src/concepts/dist/App__.js +2204 -0
- package/src/concepts/dist/CallLogic__.js +1149 -0
- package/src/concepts/dist/Destination__.js +756 -0
- package/src/concepts/dist/Entity__.js +729 -0
- package/src/concepts/dist/Logic__.js +1612 -0
- package/src/concepts/dist/Match__.js +768 -0
- package/src/concepts/dist/MsgTriggerEvent__.js +245 -0
- package/src/concepts/dist/OqlQueryComponent__.js +377 -0
- package/src/concepts/dist/Param__.js +1 -1
- package/src/concepts/dist/StringLiteral__.js +158 -0
- package/src/generator/dist/genBundleFiles.js +15 -4
- package/src/generator/dist/genReleaseBody.js +501 -0
- package/src/server/dist/naslServer.js +76 -6
- package/src/server/naslServer.ts +54 -0
- package/src/service/creator/errHandles.js +8 -3
- package/src/service/storage/dist/init.js +34 -32
- package/src/templator/genCreateBlock.ts +2 -1
- package/src/templator/genCurdEditMultipleKeyBlock.ts +6 -3
- package/src/templator/genCurdMultipleKeyBlock.ts +4 -2
- package/src/templator/genEditTableBlock.ts +2 -1
- package/src/templator/genUpdateBlock.ts +2 -1
- package/test/examples/qzbusiness.json +1 -98265
|
@@ -762,15 +762,17 @@ export class Destination extends LogicItem {
|
|
|
762
762
|
return this.viewNamespace + '.' + this.viewName;
|
|
763
763
|
}
|
|
764
764
|
get completeArguments() {
|
|
765
|
-
const node = this.viewNode;
|
|
766
|
-
|
|
765
|
+
const node = this.viewNode as View;
|
|
766
|
+
const logicParam: Map<string, Param> = new Map();
|
|
767
767
|
const Arguments: Argument[] = [];
|
|
768
768
|
if (node?.params) {
|
|
769
|
-
|
|
769
|
+
node.params.forEach((param) => {
|
|
770
|
+
logicParam.set(param.name, param);
|
|
771
|
+
});
|
|
770
772
|
}
|
|
771
773
|
if (this.arguments?.length) {
|
|
772
|
-
this.arguments.forEach((arg
|
|
773
|
-
const param = logicParam
|
|
774
|
+
this.arguments.forEach((arg) => {
|
|
775
|
+
const param = logicParam.get(arg.keyword);
|
|
774
776
|
// 取到是不是必填放入参数中
|
|
775
777
|
const newArg = Argument.from(arg);
|
|
776
778
|
if (param && !newArg.expression) {
|
package/src/concepts/Match__.ts
CHANGED
|
@@ -453,17 +453,27 @@ export class Match extends LogicItem {
|
|
|
453
453
|
}));
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
+
// body的暂存数组
|
|
456
457
|
const bodys: any[] = [];
|
|
458
|
+
// 最后一项的body
|
|
459
|
+
let lastCaseBody;
|
|
457
460
|
if (Array.isArray(this.cases) && this.cases.length) {
|
|
458
|
-
|
|
461
|
+
// 将原分支body中存在的内容拿出来
|
|
462
|
+
this.cases.forEach((caseItem, index) => {
|
|
459
463
|
const { body } = caseItem || {};
|
|
460
464
|
if (Array.isArray(body) && body.length) {
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
+
// “其他”分支单独处理
|
|
466
|
+
if (index < this.cases.length - 1) {
|
|
467
|
+
bodys.push({
|
|
468
|
+
body,
|
|
469
|
+
isMatchedTypeEnumable: currTypeAnnotation ? isMatchedTypeEnumable : true,
|
|
470
|
+
});
|
|
471
|
+
} else {
|
|
472
|
+
lastCaseBody = body;
|
|
473
|
+
}
|
|
465
474
|
}
|
|
466
475
|
});
|
|
476
|
+
// 将原分支body中存在的内容拿出来赋到新的分支中去
|
|
467
477
|
bodys.forEach(({ body, isMatchedTypeEnumable }, index) => {
|
|
468
478
|
let caseItem = cases[index];
|
|
469
479
|
if (!caseItem) {
|
|
@@ -477,8 +487,16 @@ export class Match extends LogicItem {
|
|
|
477
487
|
});
|
|
478
488
|
});
|
|
479
489
|
}
|
|
490
|
+
// 如果分支项存在时,加上“其他”项
|
|
480
491
|
if (cases.length) {
|
|
481
|
-
|
|
492
|
+
const otherCase = new MatchCase();
|
|
493
|
+
// “其他”项body存在内容时,给新的分支上加上内容
|
|
494
|
+
if (lastCaseBody) {
|
|
495
|
+
otherCase.update({
|
|
496
|
+
body: lastCaseBody,
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
cases.push(otherCase);
|
|
482
500
|
}
|
|
483
501
|
this.update({
|
|
484
502
|
cases,
|
package/src/concepts/Param__.ts
CHANGED
|
@@ -307,7 +307,7 @@ export class Param extends BaseNode {
|
|
|
307
307
|
parsedValue = tryJSONParse(defaultValue) ?? defaultValue;
|
|
308
308
|
}
|
|
309
309
|
}
|
|
310
|
-
code += `${this.name}
|
|
310
|
+
code += `${this.name} !== undefined ? ${this.name} : (this.$route.query.hasOwnProperty('${this.name}') ? this.$genInitFromSchema('${typeAnnotation?.sortedTypeKey}', this.$route.query.${this.name}) : ${JSON.stringify(this.defaultValue)})`;
|
|
311
311
|
|
|
312
312
|
if (needGenInitFromSchema) {
|
|
313
313
|
code += `)`;
|
|
@@ -65,7 +65,11 @@ export class StringLiteral extends LogicItem {
|
|
|
65
65
|
code = `\`${this.value}\``;
|
|
66
66
|
if (options?.finalCode !== false) {
|
|
67
67
|
code = `\`${this.value.replace(/['"`\\]/g, (m) => {
|
|
68
|
-
|
|
68
|
+
let escape = '\\\\';
|
|
69
|
+
escape = '\\\\';
|
|
70
|
+
/// #if process.env.BUILD_TARGET === 'node'
|
|
71
|
+
escape = '\\';
|
|
72
|
+
/// #endif
|
|
69
73
|
if (m === '\\') {
|
|
70
74
|
return `${escape}${escape}`;
|
|
71
75
|
} else {
|