@lcap/nasl 3.5.0-beta.4 → 3.6.0-alpha.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/shared/utils.js +1 -19
- package/out/breakpoint/shared/utils.js.map +1 -1
- package/out/breakpoint/store/core.js +1 -1
- package/out/breakpoint/store/core.js.map +1 -1
- package/out/common/BaseNode.d.ts +9 -0
- package/out/common/BaseNode.js +15 -0
- package/out/common/BaseNode.js.map +1 -1
- package/out/common/Command.js +1 -0
- package/out/common/Command.js.map +1 -1
- package/out/common/EventEmitter.d.ts +1 -1
- package/out/common/EventEmitter.js +0 -4
- package/out/common/EventEmitter.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +6 -1
- package/out/concepts/AnonymousFunction__.js +34 -16
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +29 -0
- package/out/concepts/App__.js +120 -21
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindEvent__.js +2 -2
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/BusinessComponent__.d.ts +1 -1
- package/out/concepts/BusinessComponent__.js +107 -87
- package/out/concepts/BusinessComponent__.js.map +1 -1
- package/out/concepts/CallEvent__.d.ts +4 -0
- package/out/concepts/CallEvent__.js +18 -1
- package/out/concepts/CallEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.d.ts +0 -1
- package/out/concepts/CallFunction__.js +0 -8
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/Destination__.js +3 -3
- package/out/concepts/Destination__.js.map +1 -1
- package/out/concepts/Entity__.d.ts +1 -1
- package/out/concepts/Entity__.js +2 -0
- package/out/concepts/Entity__.js.map +1 -1
- package/out/concepts/Logic__.js +15 -8
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Match__.d.ts +1 -1
- package/out/concepts/ValidationRule__.js +2 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/ViewElement__.d.ts +1 -0
- package/out/concepts/ViewElement__.js +20 -3
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.js +19 -18
- package/out/concepts/View__.js.map +1 -1
- package/out/server/extendBaseNode.js +18 -0
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/getProcesses.js +3 -3
- package/out/server/getProcesses.js.map +1 -1
- package/out/server/naslServer.js +16 -12
- package/out/server/naslServer.js.map +1 -1
- package/out/service/storage/init.js +24 -1
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genCurdMultipleKeyBlock.d.ts +27 -0
- package/out/templator/genCurdMultipleKeyBlock.js +673 -1
- package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +2 -1
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genTableBlock.d.ts +2 -0
- package/out/templator/genTableBlock.js +114 -1
- package/out/templator/genTableBlock.js.map +1 -1
- package/out/templator/genUpdateBlock.js +2 -1
- package/out/templator/genUpdateBlock.js.map +1 -1
- package/out/translator/utils.js +30 -1
- package/out/translator/utils.js.map +1 -1
- package/out/utils/index.d.ts +17 -0
- package/out/utils/index.js +184 -1
- package/out/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/breakpoint/shared/utils.ts +2 -24
- package/src/breakpoint/store/core.ts +1 -1
- package/src/common/BaseNode.ts +19 -0
- package/src/common/Command.ts +1 -0
- package/src/common/EventEmitter.ts +1 -6
- package/src/concepts/AnonymousFunction__.ts +36 -18
- package/src/concepts/App__.ts +132 -21
- package/src/concepts/BindAttribute__.ts +0 -1
- package/src/concepts/BindEvent__.ts +2 -2
- package/src/concepts/BusinessComponent__.ts +122 -98
- package/src/concepts/CallEvent__.ts +19 -2
- package/src/concepts/CallFunction__.ts +0 -11
- package/src/concepts/Destination__.ts +3 -3
- package/src/concepts/Entity__.ts +3 -1
- package/src/concepts/Logic__.ts +15 -9
- package/src/concepts/ValidationRule__.ts +6 -1
- package/src/concepts/ViewElement__.ts +26 -3
- package/src/concepts/View__.ts +19 -18
- package/src/server/extendBaseNode.ts +21 -0
- package/src/server/getProcesses.ts +3 -3
- package/src/server/naslServer.ts +17 -11
- package/src/service/storage/init.ts +31 -1
- package/src/templator/genCurdMultipleKeyBlock.ts +781 -57
- package/src/templator/genGetBlock.ts +2 -1
- package/src/templator/genTableBlock.ts +127 -2
- package/src/templator/genUpdateBlock.ts +2 -1
- package/src/translator/utils.ts +32 -1
- package/src/utils/index.ts +211 -1
- package/ts-worker/src/index.js +1 -0
package/out/server/naslServer.js
CHANGED
|
@@ -1377,9 +1377,10 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
1377
1377
|
this.logicSetWithComponentLogic = new Set();
|
|
1378
1378
|
const self = this;
|
|
1379
1379
|
const diagnostics = [];
|
|
1380
|
-
if (fileNode instanceof concepts_1.View) {
|
|
1380
|
+
if (fileNode instanceof concepts_1.View || fileNode instanceof concepts_1.BusinessComponent) {
|
|
1381
1381
|
yield* utils.wrapIteratorToGenerator(fileNode.sourceMap.entries(), function* attachView([node, value]) {
|
|
1382
|
-
|
|
1382
|
+
const likeComponent = node.getAncestor('View') || node.getAncestor('BusinessComponent');
|
|
1383
|
+
if (node instanceof concepts_1.ViewElement && likeComponent === fileNode) {
|
|
1383
1384
|
if (node.tag) {
|
|
1384
1385
|
yield* utils.wrapForEachToGenerator(node.bindAttrs, (bindAttr) => {
|
|
1385
1386
|
if ((bindAttr.model || bindAttr.sync) && bindAttr.expression) {
|
|
@@ -1423,14 +1424,14 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
1423
1424
|
});
|
|
1424
1425
|
}
|
|
1425
1426
|
}
|
|
1426
|
-
else if ((node instanceof concepts_1.Variable || node instanceof concepts_1.Return) &&
|
|
1427
|
+
else if ((node instanceof concepts_1.Variable || node instanceof concepts_1.Return) && likeComponent === fileNode) {
|
|
1427
1428
|
if (!node.typeAnnotation && !node.__TypeAnnotation) {
|
|
1428
1429
|
const nodeTypeName = node.concept === 'Return' ? '输出参数' : '局部变量';
|
|
1429
1430
|
let msg;
|
|
1430
1431
|
yield* fileNode.traverseChildrenGenerator((nodeIn) => {
|
|
1431
1432
|
if (nodeIn && (nodeIn instanceof concepts_1.BatchAssignment || (nodeIn instanceof concepts_1.Assignment && nodeIn.left?.name))) {
|
|
1432
1433
|
// 子页面内部逻辑过滤
|
|
1433
|
-
if (nodeIn.view !== fileNode)
|
|
1434
|
+
if ((nodeIn.view || nodeIn.getAncestor('BusinessComponent')) !== fileNode)
|
|
1434
1435
|
return;
|
|
1435
1436
|
// 当局部变量、输出参数属于页面内逻辑时,需过滤同页面下不同逻辑下的同名变量
|
|
1436
1437
|
if (node.logic && node.logic !== nodeIn.logic)
|
|
@@ -2512,7 +2513,7 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
2512
2513
|
yield;
|
|
2513
2514
|
}
|
|
2514
2515
|
if (!minRange) {
|
|
2515
|
-
if (fileNode instanceof concepts_1.View) {
|
|
2516
|
+
if (fileNode instanceof concepts_1.View || fileNode instanceof concepts_1.BusinessComponent) {
|
|
2516
2517
|
return { node: fileNode, item: sourceMap.get(fileNode) };
|
|
2517
2518
|
}
|
|
2518
2519
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -2897,6 +2898,9 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
2897
2898
|
}));
|
|
2898
2899
|
const results = await Promise.all(promises);
|
|
2899
2900
|
results.forEach((constRefs) => {
|
|
2901
|
+
if (constRefs.symbolDisplayString.includes('(parameter)')) {
|
|
2902
|
+
return;
|
|
2903
|
+
}
|
|
2900
2904
|
refsList = [...refsList, ...constRefs.refs];
|
|
2901
2905
|
});
|
|
2902
2906
|
}
|
|
@@ -2947,6 +2951,9 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
2947
2951
|
minRange.setTypeMethods = 'setCalleeNamespace';
|
|
2948
2952
|
minRange.newValue = `elements.${newValue}.logics`;
|
|
2949
2953
|
}
|
|
2954
|
+
if (minRange.node instanceof concepts_1.CallEvent) {
|
|
2955
|
+
minRange.setTypeMethods = 'setCalleeName';
|
|
2956
|
+
}
|
|
2950
2957
|
// 如果节点是实体修改引发calllogic修改
|
|
2951
2958
|
if (minRange.node instanceof concepts_1.CallLogic &&
|
|
2952
2959
|
(node instanceof concepts_1.Entity || node instanceof concepts_1.View || node instanceof concepts_1.Process || node instanceof concepts_1.ProcessElement)) {
|
|
@@ -3318,19 +3325,16 @@ let NaslServer = NaslServer_1 = class NaslServer {
|
|
|
3318
3325
|
if (node instanceof concepts_1.Param && minRange.node instanceof concepts_1.Interface) {
|
|
3319
3326
|
return null;
|
|
3320
3327
|
}
|
|
3321
|
-
//
|
|
3322
|
-
if (minRange.node instanceof concepts_1.View) {
|
|
3323
|
-
if (node instanceof concepts_1.View) {
|
|
3328
|
+
// 如果是被影响的是页面/业务组件
|
|
3329
|
+
if (minRange.node instanceof concepts_1.View || minRange.node instanceof concepts_1.BusinessComponent) {
|
|
3330
|
+
if (node instanceof concepts_1.View || node instanceof concepts_1.BusinessComponent) {
|
|
3324
3331
|
// 如果是子页面修改
|
|
3325
3332
|
// 父页面引起子页面改名,就可以不改了,自动同步
|
|
3333
|
+
// 页面中的业务组件,业务组件中的业务组件等都需要忽略
|
|
3326
3334
|
if (minRange.node !== node) {
|
|
3327
3335
|
return null;
|
|
3328
3336
|
}
|
|
3329
3337
|
}
|
|
3330
|
-
else if (node instanceof concepts_1.BusinessComponent) {
|
|
3331
|
-
minRange.setTypeMethods = 'setTag';
|
|
3332
|
-
minRange.newValue = `bs-${newValue}`;
|
|
3333
|
-
}
|
|
3334
3338
|
else if (!(node instanceof concepts_1.Role)) {
|
|
3335
3339
|
/**
|
|
3336
3340
|
* 无论是逻辑还是实体中的key,修改都不应该触发
|