@lcap/nasl 3.5.0-beta.3 → 3.5.0-beta.5

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 (289) hide show
  1. package/out/breakpoint/store/core.js +1 -1
  2. package/out/breakpoint/store/core.js.map +1 -1
  3. package/out/common/BaseNode.d.ts +7 -0
  4. package/out/common/BaseNode.js +15 -2
  5. package/out/common/BaseNode.js.map +1 -1
  6. package/out/concepts/AnonymousFunction__.d.ts +1 -0
  7. package/out/concepts/AnonymousFunction__.js +34 -16
  8. package/out/concepts/AnonymousFunction__.js.map +1 -1
  9. package/out/concepts/Argument__.d.ts +1 -0
  10. package/out/concepts/Argument__.js +28 -8
  11. package/out/concepts/Argument__.js.map +1 -1
  12. package/out/concepts/Assignment__.js +5 -7
  13. package/out/concepts/Assignment__.js.map +1 -1
  14. package/out/concepts/BatchAssignment__.js +5 -3
  15. package/out/concepts/BatchAssignment__.js.map +1 -1
  16. package/out/concepts/BinaryExpression__.d.ts +1 -0
  17. package/out/concepts/BinaryExpression__.js +30 -13
  18. package/out/concepts/BinaryExpression__.js.map +1 -1
  19. package/out/concepts/BindAttribute__.js +11 -3
  20. package/out/concepts/BindAttribute__.js.map +1 -1
  21. package/out/concepts/BindDirective__.js +3 -3
  22. package/out/concepts/BindDirective__.js.map +1 -1
  23. package/out/concepts/BindEvent__.js +2 -2
  24. package/out/concepts/BindEvent__.js.map +1 -1
  25. package/out/concepts/BooleanLiteral__.d.ts +1 -0
  26. package/out/concepts/BooleanLiteral__.js +6 -0
  27. package/out/concepts/BooleanLiteral__.js.map +1 -1
  28. package/out/concepts/BusinessComponent__.d.ts +4 -2
  29. package/out/concepts/BusinessComponent__.js +128 -89
  30. package/out/concepts/BusinessComponent__.js.map +1 -1
  31. package/out/concepts/CallConnector__.d.ts +1 -0
  32. package/out/concepts/CallConnector__.js +6 -0
  33. package/out/concepts/CallConnector__.js.map +1 -1
  34. package/out/concepts/CallEvent__.d.ts +4 -0
  35. package/out/concepts/CallEvent__.js +19 -2
  36. package/out/concepts/CallEvent__.js.map +1 -1
  37. package/out/concepts/CallFunction__.d.ts +1 -0
  38. package/out/concepts/CallFunction__.js +62 -8
  39. package/out/concepts/CallFunction__.js.map +1 -1
  40. package/out/concepts/CallInterface__.js +31 -22
  41. package/out/concepts/CallInterface__.js.map +1 -1
  42. package/out/concepts/CallLogic__.js +49 -38
  43. package/out/concepts/CallLogic__.js.map +1 -1
  44. package/out/concepts/CallQueryComponent__.d.ts +2 -0
  45. package/out/concepts/CallQueryComponent__.js +94 -8
  46. package/out/concepts/CallQueryComponent__.js.map +1 -1
  47. package/out/concepts/DefaultValue__.d.ts +1 -0
  48. package/out/concepts/DefaultValue__.js +7 -1
  49. package/out/concepts/DefaultValue__.js.map +1 -1
  50. package/out/concepts/Destination__.d.ts +1 -1
  51. package/out/concepts/Destination__.js +34 -22
  52. package/out/concepts/Destination__.js.map +1 -1
  53. package/out/concepts/EntityProperty__.d.ts +1 -0
  54. package/out/concepts/EntityProperty__.js +26 -2
  55. package/out/concepts/EntityProperty__.js.map +1 -1
  56. package/out/concepts/Entity__.d.ts +1 -0
  57. package/out/concepts/Entity__.js +25 -0
  58. package/out/concepts/Entity__.js.map +1 -1
  59. package/out/concepts/EnumItem__.d.ts +1 -0
  60. package/out/concepts/EnumItem__.js +12 -0
  61. package/out/concepts/EnumItem__.js.map +1 -1
  62. package/out/concepts/Enum__.d.ts +1 -0
  63. package/out/concepts/Enum__.js +16 -2
  64. package/out/concepts/Enum__.js.map +1 -1
  65. package/out/concepts/Event__.d.ts +4 -0
  66. package/out/concepts/Event__.js +12 -0
  67. package/out/concepts/Event__.js.map +1 -1
  68. package/out/concepts/ForEachStatement__.js +10 -16
  69. package/out/concepts/ForEachStatement__.js.map +1 -1
  70. package/out/concepts/FrontendType__.js +1 -0
  71. package/out/concepts/FrontendType__.js.map +1 -1
  72. package/out/concepts/Identifier__.d.ts +2 -0
  73. package/out/concepts/Identifier__.js +21 -0
  74. package/out/concepts/Identifier__.js.map +1 -1
  75. package/out/concepts/JSBlock__.js +1 -1
  76. package/out/concepts/JSBlock__.js.map +1 -1
  77. package/out/concepts/LogicItem__.d.ts +6 -0
  78. package/out/concepts/LogicItem__.js +11 -1
  79. package/out/concepts/LogicItem__.js.map +1 -1
  80. package/out/concepts/Logic__.js +24 -23
  81. package/out/concepts/Logic__.js.map +1 -1
  82. package/out/concepts/MatchCase__.js +5 -5
  83. package/out/concepts/MatchCase__.js.map +1 -1
  84. package/out/concepts/Match__.js +1 -1
  85. package/out/concepts/Match__.js.map +1 -1
  86. package/out/concepts/MemberExpression__.d.ts +1 -0
  87. package/out/concepts/MemberExpression__.js +13 -3
  88. package/out/concepts/MemberExpression__.js.map +1 -1
  89. package/out/concepts/NewComposite__.js +3 -3
  90. package/out/concepts/NewComposite__.js.map +1 -1
  91. package/out/concepts/NewList__.js +4 -4
  92. package/out/concepts/NewList__.js.map +1 -1
  93. package/out/concepts/NewMap__.d.ts +1 -1
  94. package/out/concepts/NewMap__.js +6 -5
  95. package/out/concepts/NewMap__.js.map +1 -1
  96. package/out/concepts/NullLiteral__.d.ts +2 -0
  97. package/out/concepts/NullLiteral__.js +12 -0
  98. package/out/concepts/NullLiteral__.js.map +1 -1
  99. package/out/concepts/NumericLiteral__.d.ts +1 -0
  100. package/out/concepts/NumericLiteral__.js +7 -1
  101. package/out/concepts/NumericLiteral__.js.map +1 -1
  102. package/out/concepts/OqlQueryComponent__.js +4 -2
  103. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  104. package/out/concepts/Param__.d.ts +1 -0
  105. package/out/concepts/Param__.js +41 -0
  106. package/out/concepts/Param__.js.map +1 -1
  107. package/out/concepts/ProcessElement__.js +9 -1
  108. package/out/concepts/ProcessElement__.js.map +1 -1
  109. package/out/concepts/QueryAggregateExpression__.d.ts +2 -0
  110. package/out/concepts/QueryAggregateExpression__.js +16 -0
  111. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  112. package/out/concepts/QueryFieldExpression__.d.ts +2 -0
  113. package/out/concepts/QueryFieldExpression__.js +33 -0
  114. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  115. package/out/concepts/QueryFromExpression__.d.ts +2 -0
  116. package/out/concepts/QueryFromExpression__.js +27 -0
  117. package/out/concepts/QueryFromExpression__.js.map +1 -1
  118. package/out/concepts/QueryGroupByExpression__.d.ts +2 -0
  119. package/out/concepts/QueryGroupByExpression__.js +13 -1
  120. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  121. package/out/concepts/QueryJoinExpression__.d.ts +2 -0
  122. package/out/concepts/QueryJoinExpression__.js +37 -0
  123. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  124. package/out/concepts/QueryLimitExpression__.d.ts +2 -0
  125. package/out/concepts/QueryLimitExpression__.js +16 -0
  126. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  127. package/out/concepts/QueryOrderByExpression__.d.ts +2 -0
  128. package/out/concepts/QueryOrderByExpression__.js +22 -0
  129. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  130. package/out/concepts/QuerySelectExpression__.d.ts +3 -0
  131. package/out/concepts/QuerySelectExpression__.js +41 -0
  132. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  133. package/out/concepts/SelectMembers__.d.ts +1 -0
  134. package/out/concepts/SelectMembers__.js +7 -0
  135. package/out/concepts/SelectMembers__.js.map +1 -1
  136. package/out/concepts/SqlQueryComponent__.js +4 -2
  137. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  138. package/out/concepts/StringInterpolation__.d.ts +1 -0
  139. package/out/concepts/StringInterpolation__.js +20 -2
  140. package/out/concepts/StringInterpolation__.js.map +1 -1
  141. package/out/concepts/StringLiteral__.d.ts +1 -0
  142. package/out/concepts/StringLiteral__.js +21 -1
  143. package/out/concepts/StringLiteral__.js.map +1 -1
  144. package/out/concepts/StructureProperty__.d.ts +1 -0
  145. package/out/concepts/StructureProperty__.js +19 -0
  146. package/out/concepts/StructureProperty__.js.map +1 -1
  147. package/out/concepts/Structure__.d.ts +1 -0
  148. package/out/concepts/Structure__.js +22 -7
  149. package/out/concepts/Structure__.js.map +1 -1
  150. package/out/concepts/SwitchCase__.js +1 -1
  151. package/out/concepts/SwitchCase__.js.map +1 -1
  152. package/out/concepts/TypeAnnotation__.d.ts +1 -0
  153. package/out/concepts/TypeAnnotation__.js +42 -1
  154. package/out/concepts/TypeAnnotation__.js.map +1 -1
  155. package/out/concepts/TypeParam__.d.ts +2 -1
  156. package/out/concepts/TypeParam__.js +7 -1
  157. package/out/concepts/TypeParam__.js.map +1 -1
  158. package/out/concepts/Unparsed__.js +1 -1
  159. package/out/concepts/Unparsed__.js.map +1 -1
  160. package/out/concepts/ValidationRule__.js +2 -1
  161. package/out/concepts/ValidationRule__.js.map +1 -1
  162. package/out/concepts/ViewElement__.d.ts +1 -0
  163. package/out/concepts/ViewElement__.js +72 -59
  164. package/out/concepts/ViewElement__.js.map +1 -1
  165. package/out/concepts/View__.d.ts +2 -1
  166. package/out/concepts/View__.js +6 -19
  167. package/out/concepts/View__.js.map +1 -1
  168. package/out/generator/genBundleFiles.d.ts +1 -0
  169. package/out/generator/genBundleFiles.js +4 -1
  170. package/out/generator/genBundleFiles.js.map +1 -1
  171. package/out/natural/genNaturalTS.d.ts +4 -1
  172. package/out/natural/genNaturalTS.js +38 -1
  173. package/out/natural/genNaturalTS.js.map +1 -1
  174. package/out/natural/transformTSCode.js +52 -41
  175. package/out/natural/transformTSCode.js.map +1 -1
  176. package/out/server/formatTsUtils.js +10 -9
  177. package/out/server/formatTsUtils.js.map +1 -1
  178. package/out/server/getFunctions.js +3 -3
  179. package/out/server/getFunctions.js.map +1 -1
  180. package/out/server/getProcesses.js +3 -3
  181. package/out/server/getProcesses.js.map +1 -1
  182. package/out/server/naslServer.js +52 -17
  183. package/out/server/naslServer.js.map +1 -1
  184. package/out/server/translator.js +8 -0
  185. package/out/server/translator.js.map +1 -1
  186. package/out/templator/genCurdEditMultipleKeyBlock.js +1 -1
  187. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  188. package/out/templator/genGetBlock.js +2 -1
  189. package/out/templator/genGetBlock.js.map +1 -1
  190. package/out/templator/genUpdateBlock.js +2 -1
  191. package/out/templator/genUpdateBlock.js.map +1 -1
  192. package/out/templator/utils.js +3 -3
  193. package/out/templator/utils.js.map +1 -1
  194. package/out/translator/types.d.ts +2 -0
  195. package/out/translator/utils.d.ts +2 -1
  196. package/out/translator/utils.js +44 -7
  197. package/out/translator/utils.js.map +1 -1
  198. package/out/utils/string.js +2 -2
  199. package/out/utils/string.js.map +1 -1
  200. package/out/utils/time-slicing/performance.js +3 -3
  201. package/out/utils/time-slicing/performance.js.map +1 -1
  202. package/package.json +2 -2
  203. package/src/breakpoint/store/core.ts +1 -1
  204. package/src/common/BaseNode.ts +17 -3
  205. package/src/concepts/AnonymousFunction__.ts +24 -9
  206. package/src/concepts/Argument__.ts +28 -6
  207. package/src/concepts/Assignment__.ts +5 -7
  208. package/src/concepts/BatchAssignment__.ts +6 -3
  209. package/src/concepts/BinaryExpression__.ts +30 -13
  210. package/src/concepts/BindAttribute__.ts +10 -3
  211. package/src/concepts/BindDirective__.ts +3 -3
  212. package/src/concepts/BindEvent__.ts +2 -2
  213. package/src/concepts/BooleanLiteral__.ts +5 -0
  214. package/src/concepts/BusinessComponent__.ts +144 -100
  215. package/src/concepts/CallConnector__.ts +5 -0
  216. package/src/concepts/CallEvent__.ts +20 -3
  217. package/src/concepts/CallFunction__.ts +54 -8
  218. package/src/concepts/CallInterface__.ts +31 -24
  219. package/src/concepts/CallLogic__.ts +48 -37
  220. package/src/concepts/CallQueryComponent__.ts +101 -8
  221. package/src/concepts/DefaultValue__.ts +6 -1
  222. package/src/concepts/Destination__.ts +32 -22
  223. package/src/concepts/EntityProperty__.ts +30 -2
  224. package/src/concepts/Entity__.ts +29 -0
  225. package/src/concepts/EnumItem__.ts +17 -0
  226. package/src/concepts/Enum__.ts +19 -2
  227. package/src/concepts/Event__.ts +13 -0
  228. package/src/concepts/ForEachStatement__.ts +10 -20
  229. package/src/concepts/FrontendType__.ts +1 -0
  230. package/src/concepts/Identifier__.ts +19 -0
  231. package/src/concepts/JSBlock__.ts +1 -1
  232. package/src/concepts/LogicItem__.ts +13 -1
  233. package/src/concepts/Logic__.ts +24 -24
  234. package/src/concepts/MatchCase__.ts +5 -5
  235. package/src/concepts/Match__.ts +1 -1
  236. package/src/concepts/MemberExpression__.ts +12 -3
  237. package/src/concepts/NewComposite__.ts +7 -9
  238. package/src/concepts/NewList__.ts +4 -4
  239. package/src/concepts/NewMap__.ts +6 -5
  240. package/src/concepts/NullLiteral__.ts +10 -0
  241. package/src/concepts/NumericLiteral__.ts +6 -1
  242. package/src/concepts/OqlQueryComponent__.ts +4 -2
  243. package/src/concepts/Param__.ts +39 -0
  244. package/src/concepts/ProcessElement__.ts +8 -1
  245. package/src/concepts/QueryAggregateExpression__.ts +15 -0
  246. package/src/concepts/QueryFieldExpression__.ts +34 -0
  247. package/src/concepts/QueryFromExpression__.ts +29 -0
  248. package/src/concepts/QueryGroupByExpression__.ts +11 -1
  249. package/src/concepts/QueryJoinExpression__.ts +39 -0
  250. package/src/concepts/QueryLimitExpression__.ts +14 -0
  251. package/src/concepts/QueryOrderByExpression__.ts +23 -0
  252. package/src/concepts/QuerySelectExpression__.ts +55 -0
  253. package/src/concepts/SelectMembers__.ts +7 -0
  254. package/src/concepts/SqlQueryComponent__.ts +4 -2
  255. package/src/concepts/StringInterpolation__.ts +18 -2
  256. package/src/concepts/StringLiteral__.ts +20 -1
  257. package/src/concepts/StructureProperty__.ts +22 -0
  258. package/src/concepts/Structure__.ts +24 -7
  259. package/src/concepts/SwitchCase__.ts +1 -1
  260. package/src/concepts/TypeAnnotation__.ts +37 -1
  261. package/src/concepts/TypeParam__.ts +6 -1
  262. package/src/concepts/Unparsed__.ts +1 -1
  263. package/src/concepts/ValidationRule__.ts +6 -1
  264. package/src/concepts/ViewElement__.ts +74 -58
  265. package/src/concepts/View__.ts +6 -19
  266. package/src/generator/genBundleFiles.ts +6 -1
  267. package/src/natural/genNaturalTS.ts +41 -0
  268. package/src/natural/transformTSCode.ts +50 -42
  269. package/src/server/formatTsUtils.ts +16 -11
  270. package/src/server/getFunctions.ts +3 -3
  271. package/src/server/getProcesses.ts +3 -3
  272. package/src/server/naslServer.ts +56 -18
  273. package/src/server/translator.ts +7 -0
  274. package/src/templator/genCurdEditMultipleKeyBlock.ts +1 -1
  275. package/src/templator/genGetBlock.ts +2 -1
  276. package/src/templator/genUpdateBlock.ts +2 -1
  277. package/src/templator/utils.ts +3 -3
  278. package/src/translator/types.ts +4 -0
  279. package/src/translator/utils.ts +73 -34
  280. package/src/utils/string.ts +2 -2
  281. package/src/utils/time-slicing/performance.ts +3 -3
  282. package/test/concepts/call-interface/__snapshots__/getQuickInfoOffset.spec.ts.snap +3 -3
  283. package/test/concepts/call-interface/__snapshots__/toEmbeddedTS.spec.ts.snap +3 -3
  284. package/test/concepts/view-element/__snapshots__/toEmbeddedTS.spec.ts.snap +199 -0
  285. package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +127 -6
  286. package/test/concepts/view-element/fixtures/table-data-source-calllogic-with-server-validation.json +2074 -0
  287. package/test/concepts/view-element/toVue.spec.ts +0 -1
  288. package/ts-worker/package.json +1 -1
  289. package/ts-worker/src/index.js +1 -0
@@ -274,6 +274,25 @@ export class Identifier extends LogicItem {
274
274
  return self.namespace ? `${self.namespace}.${self.name}` : self.name || '__IDENTIFIER__';
275
275
  }
276
276
 
277
+ @withSourceMap()
278
+ toNaturalTS(state = createCompilerState()): string {
279
+ if (this.name === undefined)
280
+ console.log(this.toJSON(), this.parentNode.toJSON(), this.nodePath)
281
+
282
+ if (this.namespace) {
283
+ const namespace = this.namespace.replace(/^app\.frontendTypes\.(.+?\.)variables\.$/, '$1');
284
+ const name = Number.isInteger(Number(this.name)) ? `[${this.name}]` : this.name.includes('-') ? `['${this.name}']` : `.${this.name}`;
285
+ return `${namespace}${name}`;
286
+ } else {
287
+ return this.name;
288
+ }
289
+ }
290
+
291
+ @withSourceMap()
292
+ toTextualNASL(state = createCompilerState()): string {
293
+ return this.namespace ? `${this.namespace}.${this.name}` : this.name;
294
+ }
295
+
277
296
  // 方便快速取值
278
297
  getValue() {
279
298
  // 实体逻辑 deleteBy/updateBy 的 filter 参数的回调函数的参数:_
@@ -97,7 +97,7 @@ export class JSBlock extends LogicItem {
97
97
 
98
98
  @withSourceMap()
99
99
  toNaturalTS(): string {
100
- return ``;
100
+ return '__STATEMENT__';
101
101
  }
102
102
 
103
103
  toBrief(): string {
@@ -4,6 +4,7 @@ import {
4
4
  createCompilerState,
5
5
  withSourceMapGenerator,
6
6
  withGenerator,
7
+ withSourceMap,
7
8
  TranslatorGenerator,
8
9
  } from '../translator';
9
10
  import { ElementToVueOptions } from './ViewElement__';
@@ -342,8 +343,19 @@ export class LogicItem extends BaseNode {
342
343
  * @param state 编译状态
343
344
  * @returns 生成的代码
344
345
  */
346
+ // @withSourceMap()
345
347
  toNaturalTS(state = createCompilerState()): string {
346
- return runSync(this.toEmbeddedTS(state));
348
+ return this.toTS(state);
349
+ }
350
+
351
+ /**
352
+ * 生成文本化代码
353
+ * @param state 编译状态
354
+ * @returns 生成的代码
355
+ */
356
+ // @withSourceMap()
357
+ toTextualNASL(state = createCompilerState()): string {
358
+ return '[编译方法未实现]';
347
359
  }
348
360
 
349
361
  delete() {
@@ -2066,11 +2066,11 @@ export class Logic extends BaseNode {
2066
2066
  toNaturalTS(state = createCompilerState(), prefix?: string, logicName?: string, currentNode?: BaseNode): string {
2067
2067
  // 如果传了不要前缀那就为空, 要不用传进来的,要是都没有就默认导出
2068
2068
  let code = '';
2069
- if (currentNode === this) {
2070
- code += `\n${indent(state.tabSize)}/**
2071
- ${indent(state.tabSize)} * 当前逻辑
2072
- ${indent(state.tabSize)} */\n`;
2073
- }
2069
+ // if (currentNode === this) {
2070
+ // code += `\n${indent(state.tabSize)}/**
2071
+ // ${indent(state.tabSize)} * 当前逻辑
2072
+ // ${indent(state.tabSize)} */\n`;
2073
+ // }
2074
2074
  if (!logicName) {
2075
2075
  const { name, parentNode } = this;
2076
2076
  if (parentNode?.concept === 'View') {
@@ -2107,22 +2107,22 @@ ${indent(state.tabSize)} */\n`;
2107
2107
  code += ')';
2108
2108
 
2109
2109
  // 需要类型推导的局部变量/返回值需要调整申明顺序
2110
- const advanceMap: Map<Return | Variable, Assignment | BatchAssignment> = new Map();
2111
- this.traverseChildren((el) => {
2112
- if (el && (asserts.isBatchAssignment(el) || (asserts.isAssignment(el) && el.left?.name))) {
2113
- const jsCode = el.toJS();
2114
- const advanceVar = this.variables?.find(
2115
- (variable) => !variable.typeAnnotation && jsCode.includes(`${variable.name} = `),
2116
- );
2117
- if (advanceVar && !advanceMap.get(advanceVar)) {
2118
- advanceMap.set(advanceVar, el);
2119
- }
2120
- const advanceRn = this.returns?.find((ret) => !ret.typeAnnotation && jsCode.includes(`${ret.name} = `));
2121
- if (advanceRn && !advanceMap.get(advanceRn)) {
2122
- advanceMap.set(advanceRn, el);
2123
- }
2124
- }
2125
- });
2110
+ // const advanceMap: Map<Return | Variable, Assignment | BatchAssignment> = new Map();
2111
+ // this.traverseChildren((el) => {
2112
+ // if (el && (asserts.isBatchAssignment(el) || (asserts.isAssignment(el) && el.left?.name))) {
2113
+ // const jsCode = el.toJS();
2114
+ // const advanceVar = this.variables?.find(
2115
+ // (variable) => !variable.typeAnnotation && jsCode.includes(`${variable.name} = `),
2116
+ // );
2117
+ // if (advanceVar && !advanceMap.get(advanceVar)) {
2118
+ // advanceMap.set(advanceVar, el);
2119
+ // }
2120
+ // const advanceRn = this.returns?.find((ret) => !ret.typeAnnotation && jsCode.includes(`${ret.name} = `));
2121
+ // if (advanceRn && !advanceMap.get(advanceRn)) {
2122
+ // advanceMap.set(advanceRn, el);
2123
+ // }
2124
+ // }
2125
+ // });
2126
2126
 
2127
2127
  // 兼容 return 没有类型情况
2128
2128
  if (this.returns.length && this.returns[0].typeAnnotation) {
@@ -2146,14 +2146,14 @@ ${indent(state.tabSize)} */\n`;
2146
2146
  });
2147
2147
 
2148
2148
  if (!this.body.length && this.returns.length) {
2149
- if (!state.focusedNodePath || `${this.nodePath}.body[0]` === state.focusedNodePath)
2150
- code += `${indent(state.tabSize + 1)}// 当前位置\n`;
2149
+ // if (!state.focusedNodePath || `${this.nodePath}.body[0]` === state.focusedNodePath)
2150
+ // code += `${indent(state.tabSize + 1)}// 当前位置\n`;
2151
2151
  code += `${indent(state.tabSize + 1)}return ${this.returns[0].name};\n`;
2152
2152
  } else {
2153
2153
  this.body.forEach((item) => {
2154
2154
  let partialCode = '';
2155
2155
 
2156
- if (!state.focusedNodePath && item.concept === 'End') code += `${indent(state.tabSize + 1)}// 当前位置\n`;
2156
+ // if (!state.focusedNodePath && item.concept === 'End') code += `${indent(state.tabSize + 1)}// 当前位置\n`;
2157
2157
  if (item.toNaturalTS) {
2158
2158
  partialCode = item.toNaturalTS(shiftState(state, code, { tabSize: state.tabSize + 1 }));
2159
2159
  } else if (item.toEmbeddedTS) {
@@ -880,11 +880,11 @@ export class MatchCase extends LogicItem {
880
880
  }
881
881
 
882
882
  @withSourceMap()
883
- toNaturalTS(state = createCompilerState(), index?: number, parentCode?: string): string {
883
+ toNaturalTS(state = createCompilerState(), index = 0, parentCode?: string): string {
884
884
  let code = '\n';
885
885
 
886
886
  const parentNode = this.parentNode as Match;
887
- const length = parentNode?.cases?.length;
887
+ const length = parentNode?.cases?.length || 0;
888
888
 
889
889
  if (length > 1) {
890
890
  if (index !== length - 1) {
@@ -923,7 +923,7 @@ export class MatchCase extends LogicItem {
923
923
 
924
924
  if (Array.isArray(this.body)) {
925
925
  this.body.forEach((logicItem, bodyIndex) => {
926
- if (bodyIndex === this.body.length - 1 && logicItem.concept !== 'Assignment') {
926
+ if (bodyIndex === this.body.length - 1 && (this.parentNode as Match)?.isExpression) {
927
927
  code += indent(state.tabSize);
928
928
  code += `return `;
929
929
  }
@@ -941,7 +941,7 @@ export class MatchCase extends LogicItem {
941
941
  code += indent(state.tabSize);
942
942
  code += 'else {\n';
943
943
  this.body.forEach((logicItem, bodyIndex) => {
944
- if (bodyIndex === this.body.length - 1 && logicItem.concept !== 'Assignment') {
944
+ if (bodyIndex === this.body.length - 1 && (this.parentNode as Match)?.isExpression) {
945
945
  code += indent(state.tabSize);
946
946
  code += `return `;
947
947
  }
@@ -957,7 +957,7 @@ export class MatchCase extends LogicItem {
957
957
  }
958
958
  } else {
959
959
  this.body.forEach((logicItem, bodyIndex) => {
960
- if (bodyIndex === this.body.length - 1 && logicItem.concept !== 'Assignment') {
960
+ if (bodyIndex === this.body.length - 1 && (this.parentNode as Match)?.isExpression) {
961
961
  code += indent(state.tabSize);
962
962
  code += `return `;
963
963
  }
@@ -824,7 +824,7 @@ export class Match extends LogicItem {
824
824
  !['NewMap', 'NewList'].includes(this.parentNode.concept) &&
825
825
  this.parentKey !== 'returnExpression'
826
826
  ) {
827
- code += ';\n';
827
+ code += '\n';
828
828
  }
829
829
  return code;
830
830
  }
@@ -532,9 +532,9 @@ export class MemberExpression extends LogicItem {
532
532
  @withSourceMap()
533
533
  toNaturalTS(state = createCompilerState()): string {
534
534
  let code = '';
535
- const leftCode = this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '';
536
- code += this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '';
537
- code += this.property ? this.property.toNaturalTS(shiftState(state, code, { inline: true })) : '';
535
+ const leftCode = this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '__IDENTIFIER__';
536
+ code += this.object ? `${this.object.toNaturalTS(shiftState(state, code, { inline: true }))}.` : '__IDENTIFIER__';
537
+ code += this.property ? this.property.toNaturalTS(shiftState(state, code, { inline: true })) : '__IDENTIFIER__';
538
538
  // 就说明这是一个枚举取值操作,直接啊app.enums.color.red 要转成字符串
539
539
  // 解决枚举可能全是数字的问题
540
540
  // app.enums.color || extensions.tool.enums.color
@@ -546,6 +546,15 @@ export class MemberExpression extends LogicItem {
546
546
  return code;
547
547
  }
548
548
 
549
+ @withSourceMap()
550
+ toTextualNASL(state = createCompilerState()): string {
551
+ let code = '';
552
+ // const leftCode = this.object ? `${this.object.toTextualNASL(shiftState(state, code, { inline: true }))}.` : '';
553
+ code += this.object ? `${this.object.toTextualNASL(shiftState(state, code, { inline: true }))}.` : '__IDENTIFIER__';
554
+ code += this.property ? this.property.toTextualNASL(shiftState(state, code, { inline: true })) : '__IDENTIFIER__';
555
+ return code;
556
+ }
557
+
549
558
  get lastObject() {
550
559
  let tempNode: any = this;
551
560
  while (tempNode?.object?.concept === 'MemberExpression') {
@@ -1179,13 +1179,11 @@ export class NewComposite extends LogicItem {
1179
1179
  } else if (typeAnnotation.typeKind !== 'anonymousStructure') {
1180
1180
  // 实体、数据结构默认值使用new时需要改成vue.prototype才能获取到方法
1181
1181
  if (state?.getVuePrototype) {
1182
- code += `const obj = Vue.prototype.$genInitFromSchema('${
1183
- typeAnnotation.sortedTypeKey
1184
- }', Vue.prototype.$utils['New'](${typeAnnotation.toJS(state)}));\n`;
1182
+ code += `const obj = Vue.prototype.$genInitFromSchema('${typeAnnotation.sortedTypeKey
1183
+ }', Vue.prototype.$utils['New'](${typeAnnotation.toJS(state)}));\n`;
1185
1184
  } else {
1186
- code += `const obj = this.$genInitFromSchema('${
1187
- typeAnnotation.sortedTypeKey
1188
- }', this.$utils['New'](${typeAnnotation.toJS(state)}));\n`;
1185
+ code += `const obj = this.$genInitFromSchema('${typeAnnotation.sortedTypeKey
1186
+ }', this.$utils['New'](${typeAnnotation.toJS(state)}));\n`;
1189
1187
  }
1190
1188
  const rightMap = new Map();
1191
1189
  this.assignmentLines.forEach(({ leftIndex, rightIndex }) => {
@@ -1432,18 +1430,18 @@ export class NewComposite extends LogicItem {
1432
1430
  let code = 'nasl.util.';
1433
1431
  code +=
1434
1432
  this?.typeAnnotation?.typeKind === 'anonymousStructure'
1435
- ? 'NewAnonymityStructure'
1433
+ ? 'NewAnonymousStructure'
1436
1434
  : `NewEntity<${this?.typeAnnotation?.typeName || '__IDENTIFIER__'}>`;
1437
1435
  let params = '';
1438
1436
  this?.properties?.forEach((item, index) => {
1439
1437
  if (item) {
1440
1438
  params += `${item?.toNaturalTS()}: ${this?.rights?.[index]?.expression?.toNaturalTS()}`;
1441
1439
  if (index !== this.properties.length - 1) {
1442
- params += ';';
1440
+ params += ', ';
1443
1441
  }
1444
1442
  }
1445
1443
  });
1446
- code += `(${params ? `{${params}}` : '__IDENTIFIER__'})`;
1444
+ code += `(${params ? `{ ${params} }` : ''})`;
1447
1445
  return code;
1448
1446
  }
1449
1447
 
@@ -508,16 +508,16 @@ export class NewList extends LogicItem {
508
508
  let code = '';
509
509
  const typeAnnotation =
510
510
  this?.typeAnnotation?.typeArguments?.map((item) => item?.toNaturalTS())?.join(', ') || '__IDENTIFIER__';
511
- let params = '';
511
+ let paramStr = '';
512
512
  this?.items?.forEach((item, index) => {
513
513
  if (item) {
514
- params += item.toNaturalTS(shiftState(state, code, { inline: true }));
514
+ paramStr += item.toNaturalTS(shiftState(state, code, { inline: true }));
515
515
  if (index !== this.items.length - 1) {
516
- params += ', ';
516
+ paramStr += ', ';
517
517
  }
518
518
  }
519
519
  });
520
- code += `nasl.util.NewList<${typeAnnotation}>(${params ? `{${params}}` : '__IDENTIFIER__'})`;
520
+ code += `nasl.util.NewList<${typeAnnotation}>(${paramStr ? `[${paramStr}]` : '[]'})`;
521
521
  return code;
522
522
  }
523
523
 
@@ -742,20 +742,21 @@ export class NewMap extends LogicItem {
742
742
  }
743
743
 
744
744
  @withSourceMap()
745
- toNaturalTS(): string {
745
+ toNaturalTS(state = createCompilerState()): string {
746
746
  let code = '';
747
747
  const typeAnnotation =
748
- this?.typeAnnotation?.typeArguments?.map((item) => item?.toNaturalTS())?.join(', ') || '__IDENTIFIER__';
748
+ this?.typeAnnotation?.typeArguments?.map((item) => item?.toNaturalTS(shiftState(state, code, { inline: true })))?.join(', ') || '__IDENTIFIER__';
749
749
  let params = '';
750
750
  this?.keys?.forEach((item, index) => {
751
751
  if (item) {
752
- params += `${item?.toNaturalTS()}: ${this?.values?.[index]?.toNaturalTS()}`;
752
+ const key = item?.toNaturalTS(shiftState(state, code, { inline: true, tabSize: state.tabSize + 1 })) || '__IDENTIFIER__';
753
+ params += `${item?.concept.endsWith('Literal') ? key : `[${key}]`}: ${this?.values?.[index]?.toNaturalTS(shiftState(state, code, { inline: true }))}`;
753
754
  if (index !== this.keys.length - 1) {
754
- params += ';';
755
+ params += ', ';
755
756
  }
756
757
  }
757
758
  });
758
- code += `nasl.util.NewMap<${typeAnnotation}>(${params ? `{${params}}` : '__IDENTIFIER__'})`;
759
+ code += `nasl.util.NewMap<${typeAnnotation}>(${params ? `{ ${params} }` : '{}'})`;
759
760
  return code;
760
761
  }
761
762
 
@@ -78,6 +78,16 @@ export class NullLiteral extends LogicItem {
78
78
  return 'null';
79
79
  }
80
80
 
81
+ @withSourceMap()
82
+ toNaturalTS(state = createCompilerState()): string {
83
+ return 'null';
84
+ }
85
+
86
+ @withSourceMap()
87
+ toTextualNASL(state = createCompilerState()): string {
88
+ return 'null';
89
+ }
90
+
81
91
  getValue() {
82
92
  return 'null';
83
93
  }
@@ -158,7 +158,12 @@ export class NumericLiteral extends LogicItem {
158
158
 
159
159
  @withSourceMap()
160
160
  toNaturalTS(): string {
161
- return this.value;
161
+ return '' + this.value;
162
+ }
163
+
164
+ @withSourceMap()
165
+ toTextualNASL(): string {
166
+ return '' + this.value;
162
167
  }
163
168
 
164
169
  changeType(value: string | number) {
@@ -319,8 +319,10 @@ export class OqlQueryComponent extends LogicItem {
319
319
 
320
320
  @withSourceMap()
321
321
  toNaturalTS(state = createCompilerState()): string {
322
- const code: string = `nasl.oql.query(\`${this.code}\`)`;
323
- return code;
322
+ const code = this.code
323
+ .replace(/\.(\d+)\}/g, '[$1]}')
324
+ .replace(/`/g, '\\`'); // 处理枚举 TS 转不回来的情况 ${app.enums.NetStatusEnum.1}
325
+ return `nasl.oql.query(\`${code}\`)`;
324
326
  }
325
327
 
326
328
  // 从服务端获取 SQL -> TS 的翻译和 sourceMap
@@ -480,6 +480,45 @@ export class Param extends BaseNode {
480
480
  return code;
481
481
  }
482
482
 
483
+ @withSourceMap()
484
+ toTextualNASL(state = createCompilerState(), dontType?: boolean): string {
485
+ let code = this.name;
486
+ // 回调函数类的参数
487
+ if (this?.typeAnnotation?.typeKind === 'function') {
488
+ code += ':{(';
489
+ const paramTypes = this.typeAnnotation?.typeArguments || [];
490
+ paramTypes.forEach((type, index) => {
491
+ code += `type${index + 1}:${type.toTextualNASL(shiftState(state, code))}`;
492
+ if (index !== paramTypes.length - 1) {
493
+ code += ',';
494
+ } else {
495
+ code += ')';
496
+ }
497
+ });
498
+ code += ':';
499
+ const returnTypes = this.typeAnnotation?.returnType || [];
500
+ returnTypes.forEach((type) => {
501
+ code += type.toTextualNASL(shiftState(state, code));
502
+ });
503
+ code += '}';
504
+ return code;
505
+ }
506
+
507
+ if (asserts.isFunction(this.defaultExpression) || asserts.isAnonymousFunction(this.defaultExpression)) {
508
+ code += this.required ? ': ' : '?: ';
509
+ code += runSync(this.defaultExpression.toEmbeddedTSDefinition(shiftState(state, code)));
510
+ } else if (!dontType && this.typeAnnotation) {
511
+ code += ': ';
512
+ code += this.typeAnnotation.toTextualNASL(shiftState(state, code));
513
+ if (this.typeAnnotation?.typeKind !== 'primitive' && this.defaultValue) {
514
+ if (this.isEnum()) {
515
+ code += `= ${this.typeAnnotation.typeKey}['${this.defaultValue}']`;
516
+ }
517
+ }
518
+ }
519
+ return code;
520
+ }
521
+
483
522
  @withSourceMapGenerator
484
523
  *toEmbeddedNameTS(state?: TranslatorState) {
485
524
  return `${this.name}`;
@@ -1915,7 +1915,14 @@ export class ProcessElement extends BaseNode {
1915
1915
  if (Array.isArray(self.bindEvents)) {
1916
1916
  yield* wrapForEach(self.bindEvents, function* warpForEachGenerator(bindEvent) {
1917
1917
  // 任务完成时可以拿到输出参数
1918
- const currentPrevCode = bindEvent.name === 'OnClose' ? prevCodeClose : prevCode;
1918
+ let currentPrevCode: any;
1919
+ if(bindEvent.name !== 'OnClose') {
1920
+ currentPrevCode = prevCode;
1921
+ // 除了任务完成时的逻辑,其他逻辑拿不到自己任务下的输出参数,所以不需要__ProcessIdentification__标注
1922
+ currentPrevCode = currentPrevCode.replace('__ProcessIdentification__', '');
1923
+ } else {
1924
+ currentPrevCode = prevCodeClose;
1925
+ }
1919
1926
  code += `${tab1}${bindEvent.name}: () => [\n`;
1920
1927
  yield* wrapForEach(bindEvent.logics, function* warpForEachGenerator(logic) {
1921
1928
  code += `${yield* logic.toEmbeddedTSInProcess(
@@ -166,6 +166,21 @@ export class QueryAggregateExpression extends LogicItem {
166
166
  });
167
167
  }
168
168
 
169
+ @withSourceMap()
170
+ toNaturalTS(state = createCompilerState()): string {
171
+ let code = `${this.asName}: ${this.aggregateName}(${this.aggregateParam.toTextualNASL(state)})`;
172
+ return code;
173
+ }
174
+
175
+ @withSourceMap()
176
+ toTextualNASL(state = createCompilerState()): string {
177
+ let code = `${this.aggregateName}(${this.aggregateParam.toTextualNASL(state)})`;
178
+ if (this.asName)
179
+ code += ` AS ${this.asName}`;
180
+
181
+ return code;
182
+ }
183
+
169
184
  //================================================================================
170
185
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
171
186
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -8,6 +8,7 @@ import {
8
8
  TranslatorGenerator,
9
9
  } from '../translator';
10
10
  import type CallQueryComponent from './CallQueryComponent__';
11
+ import { firstLowerCase } from '../utils';
11
12
  //================================================================================
12
13
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
13
14
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -158,6 +159,39 @@ export class QueryFieldExpression extends LogicItem {
158
159
  return '__QueryFieldExpression__';
159
160
  }
160
161
 
162
+ @withSourceMap()
163
+ toNaturalTS(state = createCompilerState(), genAs: boolean = false): string {
164
+ let code = '';
165
+
166
+ if (genAs) {
167
+ if (this.isDotStar)
168
+ code += `${this.asName || firstLowerCase(this.entityAsName) || '__IDENTIFIER__'}: ${this.entityAsName || '__IDENTIFIER__'}`;
169
+ else
170
+ code += `${this.asName || this.propertyName || '__IDENTIFIER__'}: ${this.entityAsName || '__IDENTIFIER__'}.${this.propertyName || '__IDENTIFIER__'}`;
171
+ } else {
172
+ if (this.isDotStar)
173
+ code += `${this.entityAsName || '__IDENTIFIER__'}`;
174
+ else
175
+ code += `${this.entityAsName || '__IDENTIFIER__'}.${this.propertyName || '__IDENTIFIER__'}`;
176
+ }
177
+
178
+ return code;
179
+ }
180
+
181
+ @withSourceMap()
182
+ toTextualNASL(state = createCompilerState(), genAs: boolean = false): string {
183
+ let code = '';
184
+ if (this.isDotStar)
185
+ code += `${this.entityAsName}.*`;
186
+ else
187
+ code += `${this.entityAsName}.${this.propertyName}`;
188
+
189
+ if (this.asName && genAs)
190
+ code += ` AS ${this.asName}`;
191
+
192
+ return code;
193
+ }
194
+
161
195
  toBrief(): string {
162
196
  return this.getValue();
163
197
  }
@@ -286,6 +286,35 @@ export class QueryFromExpression extends LogicItem {
286
286
  return code;
287
287
  }
288
288
 
289
+ @withSourceMap()
290
+ toNaturalTS(state = createCompilerState()): string {
291
+ const simpleEntityKey = this.entityName + 'Entity';
292
+ let code = `FROM(${simpleEntityKey}, ${this.asName || this.entityName} => $`;
293
+
294
+ if (this.joinParts.length) {
295
+ this.joinParts.forEach((joinPart) => {
296
+ code += '\n';
297
+ code += joinPart.toNaturalTS(state);
298
+ });
299
+ }
300
+
301
+ return code;
302
+ }
303
+
304
+ @withSourceMap()
305
+ toTextualNASL(state = createCompilerState()): string {
306
+ let code = `FROM ${this.entityKey}`;
307
+
308
+ if (this.joinParts.length) {
309
+ this.joinParts.forEach((joinPart) => {
310
+ code += '\n';
311
+ code += joinPart.toTextualNASL(state);
312
+ });
313
+ }
314
+
315
+ return code;
316
+ }
317
+
289
318
  //================================================================================
290
319
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
291
320
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -158,13 +158,23 @@ export class QueryGroupByExpression extends LogicItem {
158
158
  *toEmbeddedTS(state = createCompilerState()): TranslatorGenerator {
159
159
  const self = this;
160
160
  // 判断老应用
161
- if ((self.parentNode as CallQueryComponent).isAutoInfer()) {
161
+ if ((self.parentNode as CallQueryComponent)?.isAutoInfer()) {
162
162
  // 2.11版本后 分组使用别名
163
163
  return `__${(self.groupElement as QueryFieldExpression).asName || 'EMPTY_GROUP_BY_ALIAS__'}`;
164
164
  }
165
165
  return yield* (self.groupElement as QueryFieldExpression).toEmbeddedTS();
166
166
  }
167
167
 
168
+ @withSourceMap()
169
+ toNaturalTS(state = createCompilerState()): string {
170
+ return (this.groupElement as QueryFieldExpression).toNaturalTS(state);
171
+ }
172
+
173
+ @withSourceMap()
174
+ toTextualNASL(state = createCompilerState()): string {
175
+ return (this.groupElement as QueryFieldExpression).toTextualNASL(state);
176
+ }
177
+
168
178
  //================================================================================
169
179
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
170
180
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -509,6 +509,45 @@ export class QueryJoinExpression extends LogicItem {
509
509
  return code;
510
510
  }
511
511
 
512
+ @withSourceMap()
513
+ toNaturalTS(state = createCompilerState()): string {
514
+ const simpleEntityKey = this.entityName + 'Entity';
515
+ let code = `.${this.joinType}_JOIN(${simpleEntityKey}, ${this.asName || this.entityName} => ON(() => `;
516
+ this.onExpressions.forEach((on) => {
517
+ code += on.toNaturalTS(shiftState(state, code, { inline: true }));
518
+ });
519
+ code += ')';
520
+
521
+ if (this.joinParts.length) {
522
+ this.joinParts.forEach((joinPart) => {
523
+ code += '\n';
524
+ code += joinPart.toNaturalTS(state);
525
+ });
526
+ }
527
+
528
+ return code;
529
+ }
530
+
531
+ @withSourceMap()
532
+ toTextualNASL(state = createCompilerState()): string {
533
+ let code = `${this.joinType} JOIN ${this.entityKey}`;
534
+ if (this.asName)
535
+ code += ` AS ${this.asName}`;
536
+ code += ' ON ';
537
+ this.onExpressions.forEach((on) => {
538
+ code += on.toTextualNASL(shiftState(state, code, { inline: true }));
539
+ });
540
+
541
+ if (this.joinParts.length) {
542
+ this.joinParts.forEach((joinPart) => {
543
+ code += '\n';
544
+ code += joinPart.toTextualNASL(state);
545
+ });
546
+ }
547
+
548
+ return code;
549
+ }
550
+
512
551
  //================================================================================
513
552
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
514
553
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -194,6 +194,20 @@ export class QueryLimitExpression extends LogicItem {
194
194
  return code;
195
195
  }
196
196
 
197
+ @withSourceMap()
198
+ toNaturalTS(state = createCompilerState()): string {
199
+ let pageElement = this.pageElement.toTextualNASL(state);
200
+ let pageSizeElement = this.pageSizeElement.toTextualNASL(state);
201
+ return `[${pageElement}, ${pageSizeElement}]`;
202
+ }
203
+
204
+ @withSourceMap()
205
+ toTextualNASL(state = createCompilerState()): string {
206
+ let pageElement = this.pageElement.concept === 'Identifier' ? `\${${this.pageElement.toTextualNASL(state)}}` : this.pageElement.toTextualNASL(state);
207
+ let pageSizeElement = this.pageSizeElement.concept === 'Identifier' ? `\${${this.pageSizeElement.toTextualNASL(state)}}` : this.pageSizeElement.toTextualNASL(state);
208
+ return `${pageElement}, ${pageSizeElement}`;
209
+ }
210
+
197
211
  //================================================================================
198
212
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
199
213
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓