@lcap/nasl 0.3.12-beta → 0.3.12-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.
Files changed (71) 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 +5 -2
  8. package/out/types/app/App.js +19 -1
  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/genCurdEditMultipleKeyBlock.d.ts +7 -0
  26. package/out/types/data/genBlock/genCurdEditMultipleKeyBlock.js +470 -0
  27. package/out/types/data/genBlock/genCurdEditMultipleKeyBlock.js.map +1 -0
  28. package/out/types/data/genBlock/genCurdMultipleKeyBlock.d.ts +9 -0
  29. package/out/types/data/genBlock/genCurdMultipleKeyBlock.js +662 -0
  30. package/out/types/data/genBlock/genCurdMultipleKeyBlock.js.map +1 -0
  31. package/out/types/data/genBlock/index.d.ts +2 -2
  32. package/out/types/data/genBlock/index.js +2 -2
  33. package/out/types/data/genBlock/index.js.map +1 -1
  34. package/out/types/index.d.ts +2 -0
  35. package/out/types/index.js +5 -2
  36. package/out/types/index.js.map +1 -1
  37. package/out/types/logic/Logic.d.ts +4 -0
  38. package/out/types/logic/Logic.js +7 -0
  39. package/out/types/logic/Logic.js.map +1 -1
  40. package/out/types/logic/LogicItem.js +17 -10
  41. package/out/types/logic/LogicItem.js.map +1 -1
  42. package/out/types/logic/Param.js +1 -1
  43. package/out/types/logic/Param.js.map +1 -1
  44. package/out/types/logic/translator.js +8 -1
  45. package/out/types/logic/translator.js.map +1 -1
  46. package/out/types/page/View.d.ts +1 -1
  47. package/out/types/page/View.js +8 -1
  48. package/out/types/page/View.js.map +1 -1
  49. package/out/types/process/ProcessParam.js +1 -1
  50. package/out/types/process/ProcessParam.js.map +1 -1
  51. package/package.json +2 -1
  52. package/src/service/logic/checktypeSocket.js +49 -0
  53. package/src/service/logic/index.js +3 -0
  54. package/src/service/modules/api.js +20 -0
  55. package/src/service/modules/index.js +6 -0
  56. package/src/types/app/App.ts +19 -3
  57. package/src/types/app/Service.ts +39 -4
  58. package/src/types/data/Entity.ts +17 -6
  59. package/src/types/data/Enum.ts +5 -0
  60. package/src/types/data/Module.ts +51 -0
  61. package/src/types/data/Structure.ts +5 -0
  62. package/src/types/data/genBlock/{genCurdEditTableBlock.ts → genCurdEditMultipleKeyBlock.ts} +38 -151
  63. package/src/types/data/genBlock/{genCurdBlock.ts → genCurdMultipleKeyBlock.ts} +81 -70
  64. package/src/types/data/genBlock/index.ts +2 -2
  65. package/src/types/index.ts +2 -0
  66. package/src/types/logic/Logic.ts +5 -0
  67. package/src/types/logic/LogicItem.ts +20 -13
  68. package/src/types/logic/Param.ts +1 -1
  69. package/src/types/logic/translator.js +8 -1
  70. package/src/types/page/View.ts +8 -1
  71. package/src/types/process/ProcessParam.ts +1 -1
@@ -10,11 +10,11 @@ export * from './genGetBlock';
10
10
  export * from './genCreateBlock';
11
11
  export * from './genUpdateBlock';
12
12
  export * from './genSelectBlock';
13
- export * from './genCurdBlock';
14
13
  export * from './genListViewBlock';
15
14
  export * from './genGridViewBlock';
16
15
  export * from './genEditTableBlock';
17
- export * from './genCurdEditTableBlock';
16
+ export * from './genCurdMultipleKeyBlock';
17
+ export * from './genCurdEditMultipleKeyBlock';
18
18
 
19
19
  // eslint-disable-next-line prefer-const
20
20
  export let dragSource: Entity | EntityProperty = null;
@@ -9,6 +9,7 @@ export { Service, WebService, MicroService, SERVICE_TYPE } from './app/Service';
9
9
 
10
10
  export { DataNode } from './data/DataNode';
11
11
  export { GlobalLogicNode } from './data/GlobalLogicNode';
12
+ export { Module } from './data/Module';
12
13
  export { Entity, systemProperty } from './data/Entity';
13
14
  export { EntityProperty } from './data/EntityProperty';
14
15
  export { EntityIndex } from './data/EntityIndex';
@@ -84,6 +85,7 @@ export enum LEVEL_ENUM {
84
85
  dataNode = 'dataNode',
85
86
  gloablLogicNode = 'gloablLogicNode',
86
87
  category = 'category',
88
+ module = 'module',
87
89
  entity = 'entity',
88
90
  structure = 'structure',
89
91
  enum = 'enum',
@@ -144,6 +144,11 @@ export class Logic extends Vertex {
144
144
  */
145
145
  @immutable()
146
146
  public readonly moreChildrenFields: Array<string> = ['params', 'returns', 'variables'];
147
+ /**
148
+ * 归属的模块
149
+ */
150
+ @immutable()
151
+ public readonly moduleName: string = undefined;
147
152
  /**
148
153
  * @param source 需要合并的部分参数
149
154
  */
@@ -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
 
@@ -180,7 +180,11 @@ export class View extends Block {
180
180
  * 在 loadDetail 的情况下使用
181
181
  * @returns
182
182
  */
183
- load() {
183
+ load(enableCache = true) {
184
+ const isGONGHANG = utils.getGlobalEnv() === 'gonghang';
185
+ if (isGONGHANG) {
186
+ enableCache = false;
187
+ }
184
188
  // 如果有正在进行的 Promise,则直接返回它
185
189
  if (this.contentPromise)
186
190
  return this.contentPromise;
@@ -191,6 +195,9 @@ export class View extends Block {
191
195
  path: {
192
196
  id: this.id,
193
197
  },
198
+ query: {
199
+ enableCache,
200
+ },
194
201
  });
195
202
 
196
203
  const $def = result.$def;
@@ -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
  /**