@lcap/nasl 0.3.12-beta.1 → 0.3.12

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.
Files changed (62) hide show
  1. package/out/service/logic/checktypeSocket.d.ts +5 -0
  2. package/out/service/logic/checktypeSocket.js +55 -0
  3. package/out/service/logic/checktypeSocket.js.map +1 -0
  4. package/out/service/logic/index.d.ts +3 -0
  5. package/out/service/logic/index.js +4 -1
  6. package/out/service/logic/index.js.map +1 -1
  7. package/out/types/app/App.d.ts +3 -1
  8. package/out/types/app/App.js +17 -0
  9. package/out/types/app/App.js.map +1 -1
  10. package/out/types/app/Service.d.ts +1 -0
  11. package/out/types/app/Service.js +36 -3
  12. package/out/types/app/Service.js.map +1 -1
  13. package/out/types/data/Entity.d.ts +5 -0
  14. package/out/types/data/Entity.js +13 -0
  15. package/out/types/data/Entity.js.map +1 -1
  16. package/out/types/data/Enum.d.ts +4 -0
  17. package/out/types/data/Enum.js +7 -0
  18. package/out/types/data/Enum.js.map +1 -1
  19. package/out/types/data/Module.d.ts +34 -0
  20. package/out/types/data/Module.js +53 -0
  21. package/out/types/data/Module.js.map +1 -0
  22. package/out/types/data/Structure.d.ts +4 -0
  23. package/out/types/data/Structure.js +7 -0
  24. package/out/types/data/Structure.js.map +1 -1
  25. package/out/types/data/genBlock/index.d.ts +0 -2
  26. package/out/types/data/genBlock/index.js +0 -2
  27. package/out/types/data/genBlock/index.js.map +1 -1
  28. package/out/types/index.d.ts +2 -0
  29. package/out/types/index.js +5 -2
  30. package/out/types/index.js.map +1 -1
  31. package/out/types/logic/Logic.d.ts +4 -0
  32. package/out/types/logic/Logic.js +7 -0
  33. package/out/types/logic/Logic.js.map +1 -1
  34. package/out/types/logic/LogicItem.js +17 -10
  35. package/out/types/logic/LogicItem.js.map +1 -1
  36. package/out/types/logic/Param.js +1 -1
  37. package/out/types/logic/Param.js.map +1 -1
  38. package/out/types/logic/translator.js +8 -1
  39. package/out/types/logic/translator.js.map +1 -1
  40. package/out/types/process/ProcessParam.js +1 -1
  41. package/out/types/process/ProcessParam.js.map +1 -1
  42. package/package.json +2 -1
  43. package/src/service/logic/checktypeSocket.js +49 -0
  44. package/src/service/logic/index.js +3 -0
  45. package/src/service/modules/api.js +20 -0
  46. package/src/service/modules/index.js +6 -0
  47. package/src/types/app/App.ts +17 -2
  48. package/src/types/app/Service.ts +39 -4
  49. package/src/types/data/Entity.ts +17 -6
  50. package/src/types/data/Enum.ts +5 -0
  51. package/src/types/data/Module.ts +51 -0
  52. package/src/types/data/Structure.ts +5 -0
  53. package/src/types/data/dataTypes.ts +24 -4
  54. package/src/types/data/genBlock/index.ts +0 -2
  55. package/src/types/index.ts +2 -0
  56. package/src/types/logic/Logic.ts +5 -0
  57. package/src/types/logic/LogicItem.ts +20 -13
  58. package/src/types/logic/Param.ts +1 -1
  59. package/src/types/logic/translator.js +8 -1
  60. package/src/types/process/ProcessParam.ts +1 -1
  61. package/src/types/data/genBlock/genCurdBlock.ts +0 -654
  62. package/src/types/data/genBlock/genCurdEditTableBlock.ts +0 -581
@@ -1,6 +1,6 @@
1
1
  import { immutable, excludedInJSON, action } from '../decorators';
2
2
  import { config, typeCheck, utils, Vertex, LEVEL_ENUM, Logic, Schema, ActionOptions, ACTION_MODE } from '..';
3
- import { logicService } from '../../service/logic';
3
+ import { logicService, checkTypeClient } from '../../service/logic';
4
4
  import { traverse } from '../utils';
5
5
  import { vertexsMap } from '../cacheData';
6
6
  import { getSchemaOfExpressionNode } from './tools';
@@ -1051,20 +1051,27 @@ export class LogicItem extends Vertex {
1051
1051
  }
1052
1052
 
1053
1053
  private async _checkType(node: LogicItem) {
1054
- const res = await logicService.checkType({
1055
- query: {
1054
+ if (checkTypeClient.connect) {
1055
+ checkTypeClient.client.emit('checktype', {
1056
+ id: node.id,
1057
+ type: 'logicItem',
1056
1058
  logicId: this.logic && this.logic.id,
1057
- loItemId: node.id,
1058
- },
1059
- });
1060
- if (res) {
1061
- res.logicId = this.logic && this.logic.id;
1062
- typeCheck.pushAll([res]);
1063
-
1064
- LogicItem.assignTypeCheckResult(node, res);
1059
+ });
1065
1060
  }
1066
-
1067
- return res;
1061
+ // const res = await logicService.checkType({
1062
+ // query: {
1063
+ // logicId: this.logic && this.logic.id,
1064
+ // loItemId: node.id,
1065
+ // },
1066
+ // });
1067
+ // if (res) {
1068
+ // res.logicId = this.logic && this.logic.id;
1069
+ // typeCheck.pushAll([res]);
1070
+
1071
+ // LogicItem.assignTypeCheckResult(node, res);
1072
+ // }
1073
+
1074
+ // return res;
1068
1075
  }
1069
1076
 
1070
1077
  static assignTypeCheckResult(logicItem: LogicItem | LogicItem[], typeCheckResult: any) {
@@ -96,7 +96,7 @@ export class Param extends BaseVariable {
96
96
  config.defaultApp?.emit('saved');
97
97
 
98
98
  // 更新所有调用此Logic的LogicItem
99
- // await this.logic.callLogicUpdate();
99
+ await this.logic.callLogicUpdate();
100
100
  return this;
101
101
  }
102
102
  /**
@@ -604,7 +604,14 @@ export default function (source) {
604
604
  }
605
605
 
606
606
  if (node.type === 'BuiltInFunction') {
607
- const params = (node.builtInFuncParams || []).map((param) => generateNode(param.builtInFuncParamValue));
607
+ let params = (node.builtInFuncParams || []).map((param) => generateNode(param.builtInFuncParamValue));
608
+ if (node.calleeCode === 'Split') {
609
+ // Bug-34789: 参考 url 转义规则对 ' 转义
610
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent
611
+ params = params.map((param) => (param.replace(/'(.*)'/, (match, p1) => `'${p1.replace(/'/g, '%27')}'`)));
612
+ if (params.find((param) => param.includes('%27')))
613
+ return `this.$utils['${node.calleeCode}'](${params.join(',')}).map((item) => item.replace(/%27/g, "'"))`;
614
+ }
608
615
  return `this.$utils['${node.calleeCode}'](${params.join(',')})`;
609
616
  }
610
617
 
@@ -68,7 +68,7 @@ export class ProcessParam extends Param {
68
68
  config.defaultApp?.emit('saved');
69
69
 
70
70
  // 更新所有调用此Logic的LogicItem
71
- // await this.process.launchProcessInterface.logic.callLogicUpdate();
71
+ await this.process.launchProcessInterface.logic.callLogicUpdate();
72
72
  return this;
73
73
  }
74
74
  /**