@lcap/nasl 2.22.0-beta.5 → 3.0.0-beta.1

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 (304) hide show
  1. package/README.md +13 -0
  2. package/docs/classes/Module.html +15 -15
  3. package/docs/classes/Namespace.html +15 -15
  4. package/docs/classes/ViewComponent.html +19 -19
  5. package/out/automate/engine/utils.js +4 -0
  6. package/out/automate/engine/utils.js.map +1 -1
  7. package/out/breakpoint/generator/AfterStartNode.d.ts +7 -0
  8. package/out/breakpoint/generator/AfterStartNode.js +27 -0
  9. package/out/breakpoint/generator/AfterStartNode.js.map +1 -0
  10. package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -0
  11. package/out/breakpoint/generator/BeforeEndNode.js +27 -0
  12. package/out/breakpoint/generator/BeforeEndNode.js.map +1 -0
  13. package/out/breakpoint/generator/BreakpointNode.d.ts +14 -0
  14. package/out/breakpoint/generator/BreakpointNode.js +166 -0
  15. package/out/breakpoint/generator/BreakpointNode.js.map +1 -0
  16. package/out/breakpoint/generator/index.d.ts +4 -0
  17. package/out/breakpoint/generator/index.js +98 -0
  18. package/out/breakpoint/generator/index.js.map +1 -0
  19. package/out/breakpoint/index.d.ts +3 -0
  20. package/out/breakpoint/index.js +20 -0
  21. package/out/breakpoint/index.js.map +1 -0
  22. package/out/breakpoint/shared/constants.d.ts +30 -0
  23. package/out/breakpoint/shared/constants.js +87 -0
  24. package/out/breakpoint/shared/constants.js.map +1 -0
  25. package/out/breakpoint/shared/index.d.ts +3 -0
  26. package/out/breakpoint/shared/index.js +33 -0
  27. package/out/breakpoint/shared/index.js.map +1 -0
  28. package/out/breakpoint/shared/operations.d.ts +10 -0
  29. package/out/breakpoint/shared/operations.js +25 -0
  30. package/out/breakpoint/shared/operations.js.map +1 -0
  31. package/out/breakpoint/shared/socket.d.ts +47 -0
  32. package/out/breakpoint/shared/socket.js +210 -0
  33. package/out/breakpoint/shared/socket.js.map +1 -0
  34. package/out/breakpoint/shared/utils.d.ts +20 -0
  35. package/out/breakpoint/shared/utils.js +133 -0
  36. package/out/breakpoint/shared/utils.js.map +1 -0
  37. package/out/breakpoint/store/core.d.ts +30 -0
  38. package/out/breakpoint/store/core.js +341 -0
  39. package/out/breakpoint/store/core.js.map +1 -0
  40. package/out/breakpoint/store/dock.d.ts +1 -0
  41. package/out/breakpoint/store/dock.js +127 -0
  42. package/out/breakpoint/store/dock.js.map +1 -0
  43. package/out/breakpoint/store/index.d.ts +2 -0
  44. package/out/breakpoint/store/index.js +19 -0
  45. package/out/breakpoint/store/index.js.map +1 -0
  46. package/out/common/BaseNode.d.ts +8 -0
  47. package/out/common/BaseNode.js +19 -0
  48. package/out/common/BaseNode.js.map +1 -1
  49. package/out/concepts/App__.d.ts +365 -16
  50. package/out/concepts/App__.js +431 -10
  51. package/out/concepts/App__.js.map +1 -1
  52. package/out/concepts/Assignment__.js +1 -1
  53. package/out/concepts/Assignment__.js.map +1 -1
  54. package/out/concepts/AuthInterface__.d.ts +37 -0
  55. package/out/concepts/AuthInterface__.js +141 -0
  56. package/out/concepts/AuthInterface__.js.map +1 -0
  57. package/out/concepts/AuthLogicForCallInterface__.d.ts +138 -0
  58. package/out/concepts/AuthLogicForCallInterface__.js +493 -0
  59. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
  60. package/out/concepts/AuthLogic__.d.ts +66 -0
  61. package/out/concepts/AuthLogic__.js +206 -0
  62. package/out/concepts/AuthLogic__.js.map +1 -0
  63. package/out/concepts/BackendVariable__.d.ts +137 -0
  64. package/out/concepts/BackendVariable__.js +422 -0
  65. package/out/concepts/BackendVariable__.js.map +1 -0
  66. package/out/concepts/Backend__.d.ts +134 -0
  67. package/out/concepts/Backend__.js +274 -0
  68. package/out/concepts/Backend__.js.map +1 -0
  69. package/out/concepts/BindAttribute__.d.ts +1 -1
  70. package/out/concepts/BindAttribute__.js +3 -1
  71. package/out/concepts/BindAttribute__.js.map +1 -1
  72. package/out/concepts/BindEvent__.d.ts +12 -0
  73. package/out/concepts/BindEvent__.js +68 -0
  74. package/out/concepts/BindEvent__.js.map +1 -1
  75. package/out/concepts/CallAuthInterface__.d.ts +126 -0
  76. package/out/concepts/CallAuthInterface__.js +408 -0
  77. package/out/concepts/CallAuthInterface__.js.map +1 -0
  78. package/out/concepts/CallInterface__.d.ts +6 -1
  79. package/out/concepts/CallInterface__.js +9 -1
  80. package/out/concepts/CallInterface__.js.map +1 -1
  81. package/out/concepts/CallLogic__.js +3 -1
  82. package/out/concepts/CallLogic__.js.map +1 -1
  83. package/out/concepts/CallQueryComponent__.js +9 -7
  84. package/out/concepts/CallQueryComponent__.js.map +1 -1
  85. package/out/concepts/Destination__.js +1 -1
  86. package/out/concepts/Destination__.js.map +1 -1
  87. package/out/concepts/End__.js +29 -2
  88. package/out/concepts/End__.js.map +1 -1
  89. package/out/concepts/EntityProperty__.js.map +1 -1
  90. package/out/concepts/Entity__.d.ts +1 -2
  91. package/out/concepts/Entity__.js +1 -31
  92. package/out/concepts/Entity__.js.map +1 -1
  93. package/out/concepts/ForEachStatement__.js +9 -4
  94. package/out/concepts/ForEachStatement__.js.map +1 -1
  95. package/out/concepts/FrontendLibrary__.d.ts +29 -29
  96. package/out/concepts/FrontendLibrary__.js +2 -2
  97. package/out/concepts/FrontendVariable__.d.ts +21 -0
  98. package/out/concepts/FrontendVariable__.js +64 -0
  99. package/out/concepts/FrontendVariable__.js.map +1 -0
  100. package/out/concepts/Frontend__.d.ts +151 -47
  101. package/out/concepts/Frontend__.js +188 -32
  102. package/out/concepts/Frontend__.js.map +1 -1
  103. package/out/concepts/Function__.js +1 -1
  104. package/out/concepts/Function__.js.map +1 -1
  105. package/out/concepts/Identifier__.js +1 -1
  106. package/out/concepts/Identifier__.js.map +1 -1
  107. package/out/concepts/Interface__.d.ts +1 -1
  108. package/out/concepts/Interface__.js.map +1 -1
  109. package/out/concepts/LogicItem__.d.ts +18 -3
  110. package/out/concepts/LogicItem__.js +22 -4
  111. package/out/concepts/LogicItem__.js.map +1 -1
  112. package/out/concepts/Logic__.d.ts +14 -9
  113. package/out/concepts/Logic__.js +43 -5
  114. package/out/concepts/Logic__.js.map +1 -1
  115. package/out/concepts/Module__.js.map +1 -1
  116. package/out/concepts/Namespace__.d.ts +29 -29
  117. package/out/concepts/Namespace__.js +2 -2
  118. package/out/concepts/NewComposite__.js +2 -2
  119. package/out/concepts/NewComposite__.js.map +1 -1
  120. package/out/concepts/OverriddenLogic__.d.ts +643 -0
  121. package/out/concepts/OverriddenLogic__.js +1602 -0
  122. package/out/concepts/OverriddenLogic__.js.map +1 -0
  123. package/out/concepts/Param__.d.ts +6 -0
  124. package/out/concepts/Param__.js +10 -0
  125. package/out/concepts/Param__.js.map +1 -1
  126. package/out/concepts/QueryFieldExpression__.d.ts +2 -0
  127. package/out/concepts/QueryFieldExpression__.js +9 -0
  128. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  129. package/out/concepts/QuerySelectExpression__.d.ts +2 -2
  130. package/out/concepts/QuerySelectExpression__.js +2 -2
  131. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  132. package/out/concepts/TypeAnnotation__.js +6 -6
  133. package/out/concepts/TypeAnnotation__.js.map +1 -1
  134. package/out/concepts/Variable__.d.ts +10 -0
  135. package/out/concepts/Variable__.js +12 -0
  136. package/out/concepts/Variable__.js.map +1 -1
  137. package/out/concepts/ViewComponent__.d.ts +33 -33
  138. package/out/concepts/ViewComponent__.js +7 -7
  139. package/out/concepts/ViewElement__.d.ts +6 -0
  140. package/out/concepts/ViewElement__.js +104 -1
  141. package/out/concepts/ViewElement__.js.map +1 -1
  142. package/out/concepts/View__.js +2 -2
  143. package/out/concepts/View__.js.map +1 -1
  144. package/out/concepts/basics/stdlib/index.js +2 -1
  145. package/out/concepts/basics/stdlib/index.js.map +1 -1
  146. package/out/concepts/basics/stdlib/nasl.auth.js +24 -0
  147. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
  148. package/out/concepts/basics/stdlib/nasl.http.d.ts +7 -0
  149. package/out/concepts/basics/stdlib/nasl.http.js +167 -0
  150. package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
  151. package/out/concepts/basics/stdlib/nasl.process.js +68 -0
  152. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
  153. package/out/concepts/basics/stdlib/nasl.ui.js +4 -19
  154. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  155. package/out/concepts/basics/stdlib/nasl.util.js +83 -17
  156. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  157. package/out/concepts/basics/types/index.d.ts +1 -0
  158. package/out/concepts/basics/types/index.js +4 -1
  159. package/out/concepts/basics/types/index.js.map +1 -1
  160. package/out/concepts/index__.d.ts +8 -0
  161. package/out/concepts/index__.js +8 -0
  162. package/out/concepts/index__.js.map +1 -1
  163. package/out/enums/KEYWORDS.js +0 -1
  164. package/out/enums/KEYWORDS.js.map +1 -1
  165. package/out/generator/genBundleFiles.d.ts +1 -0
  166. package/out/generator/genBundleFiles.js +27 -0
  167. package/out/generator/genBundleFiles.js.map +1 -1
  168. package/out/generator/genMetaData.d.ts +4 -1
  169. package/out/generator/genMetaData.js +14 -0
  170. package/out/generator/genMetaData.js.map +1 -1
  171. package/out/generator/genReleaseBody.d.ts +2 -1
  172. package/out/generator/genReleaseBody.js +2 -1
  173. package/out/generator/genReleaseBody.js.map +1 -1
  174. package/out/index.d.ts +2 -1
  175. package/out/index.js +3 -1
  176. package/out/index.js.map +1 -1
  177. package/out/server/extendBaseNode.js +16 -4
  178. package/out/server/extendBaseNode.js.map +1 -1
  179. package/out/server/formatTsUtils.d.ts +2 -1
  180. package/out/server/formatTsUtils.js +39 -4
  181. package/out/server/formatTsUtils.js.map +1 -1
  182. package/out/server/getExtensionModules.d.ts +2 -2
  183. package/out/server/getExtensionModules.js +16 -2
  184. package/out/server/getExtensionModules.js.map +1 -1
  185. package/out/server/getLogics.js +5 -5
  186. package/out/server/getLogics.js.map +1 -1
  187. package/out/server/getMemberIdentifier.d.ts +1 -0
  188. package/out/server/getMemberIdentifier.js +34 -7
  189. package/out/server/getMemberIdentifier.js.map +1 -1
  190. package/out/server/naslServer.d.ts +64 -64
  191. package/out/server/naslServer.js +249 -121
  192. package/out/server/naslServer.js.map +1 -1
  193. package/out/server/naslStdlibMap.js +2 -0
  194. package/out/server/naslStdlibMap.js.map +1 -1
  195. package/out/server/translator.d.ts +1 -0
  196. package/out/server/translator.js +67 -2
  197. package/out/server/translator.js.map +1 -1
  198. package/out/service/defaultErrorMessage.json +1 -0
  199. package/out/service/storage/api.d.ts +10 -1
  200. package/out/service/storage/api.js +6 -0
  201. package/out/service/storage/api.js.map +1 -1
  202. package/out/service/storage/init.d.ts +4 -0
  203. package/out/service/storage/init.js +55 -35
  204. package/out/service/storage/init.js.map +1 -1
  205. package/out/service/storage/service.d.ts +3 -0
  206. package/out/service/storage/service.js +14 -0
  207. package/out/service/storage/service.js.map +1 -1
  208. package/out/utils/sortTsString.d.ts +1 -0
  209. package/out/utils/sortTsString.js +36 -0
  210. package/out/utils/sortTsString.js.map +1 -0
  211. package/out/utils/traverse.js +2 -2
  212. package/out/utils/traverse.js.map +1 -1
  213. package/package.json +7 -2
  214. package/sandbox/stdlib/nasl.auth.ts +8 -4
  215. package/sandbox/stdlib/nasl.core.d.ts +206 -0
  216. package/sandbox/stdlib/nasl.core.js +1 -0
  217. package/sandbox/stdlib/nasl.core.js.map +1 -0
  218. package/sandbox/stdlib/nasl.http.ts +35 -0
  219. package/sandbox/stdlib/nasl.process.ts +13 -0
  220. package/sandbox/stdlib/nasl.ui.ts +0 -5
  221. package/src/automate/engine/utils.js +4 -1
  222. package/src/breakpoint/generator/AfterStartNode.ts +27 -0
  223. package/src/breakpoint/generator/BeforeEndNode.ts +27 -0
  224. package/src/breakpoint/generator/BreakpointNode.ts +228 -0
  225. package/src/breakpoint/generator/index.ts +114 -0
  226. package/src/breakpoint/index.ts +3 -0
  227. package/src/breakpoint/shared/constants.ts +95 -0
  228. package/src/breakpoint/shared/index.ts +3 -0
  229. package/src/breakpoint/shared/operations.ts +25 -0
  230. package/src/breakpoint/shared/socket.ts +326 -0
  231. package/src/breakpoint/shared/utils.ts +195 -0
  232. package/src/breakpoint/store/core.ts +411 -0
  233. package/src/breakpoint/store/dock.ts +166 -0
  234. package/src/breakpoint/store/index.ts +2 -0
  235. package/src/breakpoint/types/index.d.ts +19 -0
  236. package/src/common/BaseNode.ts +19 -1
  237. package/src/concepts/App__.ts +828 -26
  238. package/src/concepts/Assignment__.ts +1 -1
  239. package/src/concepts/AuthInterface__.ts +148 -0
  240. package/src/concepts/AuthLogicForCallInterface__.ts +573 -0
  241. package/src/concepts/AuthLogic__.ts +225 -0
  242. package/src/concepts/BackendVariable__.ts +466 -0
  243. package/src/concepts/Backend__.ts +347 -0
  244. package/src/concepts/BindAttribute__.ts +4 -3
  245. package/src/concepts/BindEvent__.ts +71 -2
  246. package/src/concepts/CallAuthInterface__.ts +490 -0
  247. package/src/concepts/CallInterface__.ts +10 -2
  248. package/src/concepts/CallLogic__.ts +3 -1
  249. package/src/concepts/CallQueryComponent__.ts +67 -7
  250. package/src/concepts/Destination__.ts +19 -1
  251. package/src/concepts/End__.ts +31 -3
  252. package/src/concepts/EntityProperty__.ts +6 -0
  253. package/src/concepts/Entity__.ts +8 -31
  254. package/src/concepts/ForEachStatement__.ts +9 -4
  255. package/src/concepts/FrontendLibrary__.ts +30 -30
  256. package/src/concepts/FrontendVariable__.ts +76 -0
  257. package/src/concepts/Frontend__.ts +352 -89
  258. package/src/concepts/Function__.ts +1 -1
  259. package/src/concepts/Identifier__.ts +5 -5
  260. package/src/concepts/Interface__.ts +1 -1
  261. package/src/concepts/LogicItem__.ts +26 -6
  262. package/src/concepts/Logic__.ts +86 -8
  263. package/src/concepts/Module__.ts +32 -2
  264. package/src/concepts/Namespace__.ts +30 -30
  265. package/src/concepts/NewComposite__.ts +2 -3
  266. package/src/concepts/OverriddenLogic__.ts +2165 -0
  267. package/src/concepts/Param__.ts +13 -3
  268. package/src/concepts/QueryFieldExpression__.ts +18 -0
  269. package/src/concepts/QuerySelectExpression__.ts +11 -3
  270. package/src/concepts/TypeAnnotation__.ts +45 -6
  271. package/src/concepts/Variable__.ts +14 -0
  272. package/src/concepts/ViewComponent__.ts +35 -35
  273. package/src/concepts/ViewElement__.ts +104 -1
  274. package/src/concepts/View__.ts +24 -2
  275. package/src/concepts/basics/stdlib/index.ts +2 -1
  276. package/src/concepts/basics/stdlib/nasl.auth.ts +24 -0
  277. package/src/concepts/basics/stdlib/nasl.http.ts +166 -0
  278. package/src/concepts/basics/stdlib/nasl.process.ts +68 -0
  279. package/src/concepts/basics/stdlib/nasl.ui.ts +4 -19
  280. package/src/concepts/basics/stdlib/nasl.util.ts +83 -17
  281. package/src/concepts/basics/types/index.ts +5 -4
  282. package/src/concepts/index__.ts +8 -0
  283. package/src/enums/KEYWORDS.ts +0 -1
  284. package/src/generator/genBundleFiles.ts +36 -2
  285. package/src/generator/genMetaData.ts +16 -1
  286. package/src/generator/genReleaseBody.ts +4 -1
  287. package/src/index.ts +2 -1
  288. package/src/server/extendBaseNode.ts +18 -7
  289. package/src/server/formatTsUtils.ts +37 -5
  290. package/src/server/getExtensionModules.ts +18 -3
  291. package/src/server/getLogics.ts +6 -6
  292. package/src/server/getMemberIdentifier.ts +35 -9
  293. package/src/server/naslServer.ts +250 -124
  294. package/src/server/naslStdlibMap.ts +2 -0
  295. package/src/server/translator.ts +67 -1
  296. package/src/service/defaultErrorMessage.json +1 -0
  297. package/src/service/storage/api.js +7 -1
  298. package/src/service/storage/init.ts +66 -35
  299. package/src/service/storage/service.ts +18 -2
  300. package/src/utils/sortTsString.ts +32 -0
  301. package/src/utils/traverse.ts +2 -2
  302. package/test/examples/app-simple.json +73635 -0
  303. package/ts-worker/lib/tsserver.js +3 -3
  304. package/ts-worker/package.json +1 -1
@@ -259,7 +259,7 @@ export class Param extends BaseNode {
259
259
  defaultExpression: LogicItem | Function | AnonymousFunction = undefined;
260
260
  @excludedInJSON()
261
261
  @property()
262
- options: Array<{ text?: string; value: string }> = undefined;
262
+ options: Array<{ text?: string; value: string, description?: string }> = undefined;
263
263
  @excludedInJSON()
264
264
  @property()
265
265
  useComponent: {
@@ -350,6 +350,7 @@ export class Param extends BaseNode {
350
350
  code += this.required ? ': ' : '?: ';
351
351
  code += this.defaultExpression.toEmbeddedTSDefinition(shiftState(state, code));
352
352
  } else if (!dontType && this.typeAnnotation) {
353
+ // TODO
353
354
  code += ': ';
354
355
  code += this.typeAnnotation.toEmbeddedTS(shiftState(state, code));
355
356
  // toTS暂时只需要翻译引用数据类型的,因为值都是字符串
@@ -434,8 +435,6 @@ export class Param extends BaseNode {
434
435
  this._readonly = val;
435
436
  }
436
437
 
437
-
438
-
439
438
  setnNewTypeAnnotation(oldTypeAnnotation: TypeAnnotation) {
440
439
  const json = oldTypeAnnotation.toJSON();
441
440
  const typeAnnotation = TypeAnnotation.from(json);
@@ -458,6 +457,17 @@ export class Param extends BaseNode {
458
457
  }
459
458
  }
460
459
 
460
+ /**
461
+ * 祖先 Logic
462
+ */
463
+ get AuthLogic() {
464
+ return this.getAncestor('AuthLogic') as Logic;
465
+ }
466
+
467
+ get AuthLogicForCallInterface() {
468
+ return this.getAncestor('AuthLogicForCallInterface') as Logic;
469
+ }
470
+
461
471
  //================================================================================
462
472
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
463
473
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
@@ -48,6 +48,8 @@ export class QueryFieldExpression extends LogicItem {
48
48
  @property()
49
49
  propertyName: string = undefined;
50
50
 
51
+
52
+
51
53
  /**
52
54
  * @param source 需要合并的部分参数
53
55
  */
@@ -64,6 +66,7 @@ export class QueryFieldExpression extends LogicItem {
64
66
  return super.from(source, parentNode, parentKey) as QueryFieldExpression;
65
67
  }
66
68
 
69
+
67
70
  /**
68
71
  * 设置entityAsName
69
72
  */
@@ -88,6 +91,10 @@ export class QueryFieldExpression extends LogicItem {
88
91
  });
89
92
  }
90
93
 
94
+
95
+
96
+
97
+
91
98
  //================================================================================
92
99
  // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
93
100
  // 自动生成的代码已结束。下面可以手动编写。
@@ -109,6 +116,17 @@ export class QueryFieldExpression extends LogicItem {
109
116
  };
110
117
  }
111
118
 
119
+ setEntityAsNameAndEffect(entityAsName: string) {
120
+ this.setEntityAsName(entityAsName);
121
+ this.effect();
122
+ }
123
+
124
+ effect() {
125
+ // 处理选中的此实体的 CallQueryComponent
126
+ const callQueryComponent = this.getAncestor('CallQueryComponent') as CallQueryComponent;
127
+ callQueryComponent.saveStructure();
128
+ }
129
+
112
130
  setName(asName: string) {
113
131
  this.update({ asName });
114
132
  }
@@ -37,11 +37,13 @@ export class QuerySelectExpression extends LogicItem {
37
37
  star: boolean = true;
38
38
 
39
39
  /**
40
- * 查询聚合函数列表
40
+ * selectElements
41
41
  */
42
42
  @property('QueryAggregateExpression | QueryFieldExpression')
43
43
  selectElements: Array<QueryAggregateExpression | QueryFieldExpression> = [];
44
44
 
45
+
46
+
45
47
  /**
46
48
  * @param source 需要合并的部分参数
47
49
  */
@@ -58,8 +60,9 @@ export class QuerySelectExpression extends LogicItem {
58
60
  return super.from(source, parentNode, parentKey) as QuerySelectExpression;
59
61
  }
60
62
 
63
+
61
64
  /**
62
- * 设置查询聚合函数列表
65
+ * 设置selectElements
63
66
  */
64
67
  setSelectElements(selectElements: Array<QueryAggregateExpression | QueryFieldExpression>) {
65
68
  const object = {
@@ -70,7 +73,7 @@ export class QuerySelectExpression extends LogicItem {
70
73
  });
71
74
  }
72
75
 
73
- getQueryAggregateExpressionExistingNames(excludedList: Array<QueryAggregateExpression> = []) {
76
+ getQueryAggregateExpressionExistingNames(excludedList: Array<QueryAggregateExpression> = []) {
74
77
  const excludedSet = new Set(excludedList);
75
78
  return ((this.selectElements as QueryAggregateExpression[]) || []).filter((item) => !excludedSet.has(item)).map((item) => item.name);
76
79
  }
@@ -344,6 +347,9 @@ export class QuerySelectExpression extends LogicItem {
344
347
  return node;
345
348
  }
346
349
 
350
+
351
+
352
+
347
353
  /**
348
354
  * 删除查询聚合函数
349
355
  * @param name 查询聚合函数名称
@@ -369,6 +375,8 @@ export class QuerySelectExpression extends LogicItem {
369
375
  return queryAggregateExpression.delete();
370
376
  }
371
377
 
378
+
379
+
372
380
  /**
373
381
  * 删除查询属性
374
382
  * @param name 查询属性名称
@@ -73,6 +73,7 @@ export const GENERIC_DESC: Record<string, string> = {
73
73
  Map: '从K类型到V类型的映射',
74
74
  };
75
75
 
76
+
76
77
  /**
77
78
  * 判断是否是联合类型
78
79
  * @param typeAnnotation
@@ -157,6 +158,8 @@ export class TypeAnnotation extends BaseNode {
157
158
  @property()
158
159
  ruleMap: Object = undefined;
159
160
 
161
+
162
+
160
163
  /**
161
164
  * @param source 需要合并的部分参数
162
165
  */
@@ -196,6 +199,10 @@ export class TypeAnnotation extends BaseNode {
196
199
  });
197
200
  }
198
201
 
202
+
203
+
204
+
205
+
199
206
  /**
200
207
  * 插入类型标注
201
208
  * @internal
@@ -228,6 +235,8 @@ export class TypeAnnotation extends BaseNode {
228
235
  return typeAnnotation;
229
236
  }
230
237
 
238
+
239
+
231
240
  /**
232
241
  * 插入类型标注
233
242
  * @param typeAnnotationOptions 类型标注参数
@@ -250,6 +259,8 @@ export class TypeAnnotation extends BaseNode {
250
259
  return node;
251
260
  }
252
261
 
262
+
263
+
253
264
  /**
254
265
  * 添加类型标注
255
266
  * @internal
@@ -269,6 +280,8 @@ export class TypeAnnotation extends BaseNode {
269
280
  return this._insertTypeAnnotationInTypeArgumentsAt(options as any, index);
270
281
  }
271
282
 
283
+
284
+
272
285
  /**
273
286
  * 添加类型标注
274
287
  * @param typeAnnotationOptions 类型标注参数
@@ -292,6 +305,8 @@ export class TypeAnnotation extends BaseNode {
292
305
  return node;
293
306
  }
294
307
 
308
+
309
+
295
310
  /**
296
311
  * 插入类型标注
297
312
  * @internal
@@ -324,6 +339,8 @@ export class TypeAnnotation extends BaseNode {
324
339
  return typeAnnotation;
325
340
  }
326
341
 
342
+
343
+
327
344
  /**
328
345
  * 插入类型标注
329
346
  * @param typeAnnotationOptions 类型标注参数
@@ -346,6 +363,8 @@ export class TypeAnnotation extends BaseNode {
346
363
  return node;
347
364
  }
348
365
 
366
+
367
+
349
368
  /**
350
369
  * 添加类型标注
351
370
  * @internal
@@ -365,6 +384,8 @@ export class TypeAnnotation extends BaseNode {
365
384
  return this._insertTypeAnnotationInReturnTypeAt(options as any, index);
366
385
  }
367
386
 
387
+
388
+
368
389
  /**
369
390
  * 添加类型标注
370
391
  * @param typeAnnotationOptions 类型标注参数
@@ -388,6 +409,11 @@ export class TypeAnnotation extends BaseNode {
388
409
  return node;
389
410
  }
390
411
 
412
+
413
+
414
+
415
+
416
+
391
417
  /**
392
418
  * 插入数据结构属性
393
419
  * @internal
@@ -420,6 +446,8 @@ export class TypeAnnotation extends BaseNode {
420
446
  return structureProperty;
421
447
  }
422
448
 
449
+
450
+
423
451
  /**
424
452
  * 插入数据结构属性
425
453
  * @param structurePropertyOptions 数据结构属性参数
@@ -442,6 +470,8 @@ export class TypeAnnotation extends BaseNode {
442
470
  return node;
443
471
  }
444
472
 
473
+
474
+
445
475
  /**
446
476
  * 添加数据结构属性
447
477
  * @internal
@@ -461,6 +491,8 @@ export class TypeAnnotation extends BaseNode {
461
491
  return this._insertStructurePropertyAt(options as any, index);
462
492
  }
463
493
 
494
+
495
+
464
496
  /**
465
497
  * 添加数据结构属性
466
498
  * @param structurePropertyOptions 数据结构属性参数
@@ -484,6 +516,9 @@ export class TypeAnnotation extends BaseNode {
484
516
  return node;
485
517
  }
486
518
 
519
+
520
+
521
+
487
522
  /**
488
523
  * 删除类型标注
489
524
  * @param typeAnnotation 已有的类型标注实例
@@ -491,10 +526,12 @@ export class TypeAnnotation extends BaseNode {
491
526
  removeTypeAnnotationInTypeArguments(typeAnnotation: TypeAnnotation): void;
492
527
 
493
528
  removeTypeAnnotationInTypeArguments(options: TypeAnnotation) {
494
- const typeAnnotation: TypeAnnotation = options;
529
+ let typeAnnotation: TypeAnnotation = options;
495
530
  return typeAnnotation.delete();
496
531
  }
497
532
 
533
+
534
+
498
535
  /**
499
536
  * 删除类型标注
500
537
  * @param typeAnnotation 已有的类型标注实例
@@ -502,7 +539,7 @@ export class TypeAnnotation extends BaseNode {
502
539
  removeTypeAnnotationInReturnType(typeAnnotation: TypeAnnotation): void;
503
540
 
504
541
  removeTypeAnnotationInReturnType(options: TypeAnnotation) {
505
- const typeAnnotation: TypeAnnotation = options;
542
+ let typeAnnotation: TypeAnnotation = options;
506
543
  return typeAnnotation.delete();
507
544
  }
508
545
 
@@ -529,6 +566,8 @@ export class TypeAnnotation extends BaseNode {
529
566
  return params;
530
567
  }
531
568
 
569
+
570
+
532
571
  /**
533
572
  * 删除数据结构属性
534
573
  * @param structureProperty 已有的数据结构属性实例
@@ -536,7 +575,7 @@ export class TypeAnnotation extends BaseNode {
536
575
  removeStructureProperty(structureProperty: StructureProperty): void;
537
576
 
538
577
  removeStructureProperty(options: StructureProperty) {
539
- const structureProperty: StructureProperty = options;
578
+ let structureProperty: StructureProperty = options;
540
579
  return structureProperty.delete();
541
580
  }
542
581
 
@@ -858,13 +897,13 @@ export class TypeAnnotation extends BaseNode {
858
897
  });
859
898
  return code;
860
899
  } else if (this.typeKind === 'anonymousStructure') {
861
- let code = `{ __name: "AStructure_${this.hash}", `;
900
+ let code = `{ `;
862
901
  (this.properties || []).forEach((property, i) => {
863
902
  code += `${property.name}: `;
864
903
  code += `${property.typeAnnotation ? property.typeAnnotation.toEmbeddedTS(shiftState(state, code, { inline: true, tabSize: (state?.tabSize || 0) + 1 })) : '`未知`'}`;
865
- if (i < this.properties?.length - 1)
866
- code += ', ';
904
+ code += ', ';
867
905
  });
906
+ code += `__name: "AStructure_${this.hash}" `;
868
907
  code += ' }';
869
908
  return code;
870
909
  } else {
@@ -29,6 +29,8 @@ import BaseNode from '../common/BaseNode';
29
29
  import classMap from '../common/classMap';
30
30
  import TypeAnnotation from './TypeAnnotation__';
31
31
  import Logic from './Logic__';
32
+ import AuthInterface from './AuthInterface__';
33
+ import AuthLogicForCallInterface from './AuthLogicForCallInterface__';
32
34
  import View from './View__';
33
35
  import Module from './Module__';
34
36
  import App from './App__';
@@ -113,6 +115,18 @@ export class Variable extends BaseNode {
113
115
  get process() {
114
116
  return this.getAncestor('Process') as Process;
115
117
  }
118
+ /**
119
+ * 祖先 AuthInterface
120
+ */
121
+ get AuthLogic() {
122
+ return this.getAncestor('AuthInterface') as AuthInterface;
123
+ }
124
+ /**
125
+ * 祖先 AuthLogicForCallInterface
126
+ */
127
+ get AuthLogicForCallInterface() {
128
+ return this.getAncestor('AuthLogicForCallInterface') as AuthLogicForCallInterface;
129
+ }
116
130
 
117
131
  /**
118
132
  * @param source 需要合并的部分参数
@@ -18,9 +18,9 @@ import Module from './Module__';
18
18
  import App from './App__';
19
19
 
20
20
  /**
21
- * 页面组件
21
+ * 平台类型
22
22
  */
23
- @concept('页面组件')
23
+ @concept('平台类型')
24
24
  export class ViewComponent extends BaseNode {
25
25
  /**
26
26
  * 产品概念
@@ -29,19 +29,19 @@ export class ViewComponent extends BaseNode {
29
29
  concept: 'ViewComponent' = 'ViewComponent';
30
30
 
31
31
  /**
32
- * 页面组件名称
32
+ * 平台类型名称
33
33
  */
34
34
  @property()
35
35
  name: string = undefined;
36
36
 
37
37
  /**
38
- * 页面组件标题
38
+ * 平台类型标题
39
39
  */
40
40
  @property()
41
41
  title: string = undefined;
42
42
 
43
43
  /**
44
- * 页面组件描述
44
+ * 平台类型描述
45
45
  */
46
46
  @property()
47
47
  description: string = undefined;
@@ -77,7 +77,7 @@ export class ViewComponent extends BaseNode {
77
77
  methods: Array<Logic> = [];
78
78
 
79
79
  /**
80
- * 页面组件列表
80
+ * 平台类型列表
81
81
  */
82
82
  @property('ViewComponent')
83
83
  children: Array<ViewComponent> = [];
@@ -713,23 +713,23 @@ export class ViewComponent extends BaseNode {
713
713
  }
714
714
 
715
715
  /**
716
- * 插入页面组件
716
+ * 插入平台类型
717
717
  * @internal
718
- * @param name 页面组件名称,如果不填会自动生成一个唯一名称
718
+ * @param name 平台类型名称,如果不填会自动生成一个唯一名称
719
719
  */
720
720
  _insertViewComponentAt(name: string, index: number): ViewComponent;
721
721
 
722
722
  /**
723
- * 插入页面组件
723
+ * 插入平台类型
724
724
  * @internal
725
- * @param viewComponentOptions 页面组件参数
725
+ * @param viewComponentOptions 平台类型参数
726
726
  */
727
727
  _insertViewComponentAt(viewComponentOptions: Partial<ViewComponent>, index: number): ViewComponent;
728
728
 
729
729
  /**
730
- * 插入页面组件
730
+ * 插入平台类型
731
731
  * @internal
732
- * @param viewComponent 已有的页面组件实例
732
+ * @param viewComponent 已有的平台类型实例
733
733
  */
734
734
  _insertViewComponentAt(viewComponent: ViewComponent, index: number): ViewComponent;
735
735
 
@@ -762,20 +762,20 @@ export class ViewComponent extends BaseNode {
762
762
  }
763
763
 
764
764
  /**
765
- * 插入页面组件
766
- * @param name 页面组件名称,如果不填会自动生成一个唯一名称
765
+ * 插入平台类型
766
+ * @param name 平台类型名称,如果不填会自动生成一个唯一名称
767
767
  */
768
768
  insertViewComponentAt(name: string, index: number): ViewComponent;
769
769
 
770
770
  /**
771
- * 插入页面组件
772
- * @param viewComponentOptions 页面组件参数
771
+ * 插入平台类型
772
+ * @param viewComponentOptions 平台类型参数
773
773
  */
774
774
  insertViewComponentAt(viewComponentOptions: Partial<ViewComponent>, index: number): ViewComponent;
775
775
 
776
776
  /**
777
- * 插入页面组件
778
- * @param viewComponent 已有的页面组件实例
777
+ * 插入平台类型
778
+ * @param viewComponent 已有的平台类型实例
779
779
  */
780
780
  insertViewComponentAt(viewComponent: ViewComponent, index: number): ViewComponent;
781
781
 
@@ -790,23 +790,23 @@ export class ViewComponent extends BaseNode {
790
790
  }
791
791
 
792
792
  /**
793
- * 添加页面组件
793
+ * 添加平台类型
794
794
  * @internal
795
- * @param name 页面组件名称,如果不填会自动生成一个唯一名称
795
+ * @param name 平台类型名称,如果不填会自动生成一个唯一名称
796
796
  */
797
797
  _addViewComponent(name?: string): ViewComponent;
798
798
 
799
799
  /**
800
- * 添加页面组件
800
+ * 添加平台类型
801
801
  * @internal
802
- * @param viewComponentOptions 页面组件参数
802
+ * @param viewComponentOptions 平台类型参数
803
803
  */
804
804
  _addViewComponent(viewComponentOptions: Partial<ViewComponent>): ViewComponent;
805
805
 
806
806
  /**
807
- * 添加页面组件
807
+ * 添加平台类型
808
808
  * @internal
809
- * @param viewComponent 已有的页面组件实例
809
+ * @param viewComponent 已有的平台类型实例
810
810
  */
811
811
  _addViewComponent(viewComponent: ViewComponent): ViewComponent;
812
812
 
@@ -816,21 +816,21 @@ export class ViewComponent extends BaseNode {
816
816
  }
817
817
 
818
818
  /**
819
- * 添加页面组件
819
+ * 添加平台类型
820
820
  * @internal
821
- * @param name 页面组件名称,如果不填会自动生成一个唯一名称
821
+ * @param name 平台类型名称,如果不填会自动生成一个唯一名称
822
822
  */
823
823
  addViewComponent(name?: string): ViewComponent;
824
824
 
825
825
  /**
826
- * 添加页面组件
827
- * @param viewComponentOptions 页面组件参数
826
+ * 添加平台类型
827
+ * @param viewComponentOptions 平台类型参数
828
828
  */
829
829
  addViewComponent(viewComponentOptions: Partial<ViewComponent>): ViewComponent;
830
830
 
831
831
  /**
832
- * 添加页面组件
833
- * @param viewComponent 已有的页面组件实例
832
+ * 添加平台类型
833
+ * @param viewComponent 已有的平台类型实例
834
834
  */
835
835
  addViewComponent(viewComponent: ViewComponent): ViewComponent;
836
836
 
@@ -1191,14 +1191,14 @@ export class ViewComponent extends BaseNode {
1191
1191
 
1192
1192
 
1193
1193
  /**
1194
- * 删除页面组件
1195
- * @param name 页面组件名称
1194
+ * 删除平台类型
1195
+ * @param name 平台类型名称
1196
1196
  */
1197
1197
  removeViewComponent(name: string): void;
1198
1198
 
1199
1199
  /**
1200
- * 删除页面组件
1201
- * @param viewComponent 已有的页面组件实例
1200
+ * 删除平台类型
1201
+ * @param viewComponent 已有的平台类型实例
1202
1202
  */
1203
1203
  removeViewComponent(viewComponent: ViewComponent): void;
1204
1204
 
@@ -1207,7 +1207,7 @@ export class ViewComponent extends BaseNode {
1207
1207
  if (typeof options === 'string') {
1208
1208
  viewComponent = (this.children as ViewComponent[]).find((item) => item.name === options);
1209
1209
  if (!viewComponent) {
1210
- throw new Error('找不到页面组件 ' + options);
1210
+ throw new Error('找不到平台类型 ' + options);
1211
1211
  }
1212
1212
  } else {
1213
1213
  viewComponent = options;
@@ -1406,7 +1406,7 @@ export class ViewElement extends BaseNode {
1406
1406
  }
1407
1407
 
1408
1408
  toHump(name: string): string {
1409
- return name.replace(/\-(\w)/g, (all, letter) => letter.toUpperCase());
1409
+ return name.replace(/-(\w)/g, (all, letter) => letter.toUpperCase());
1410
1410
  }
1411
1411
  toFirstUpper(name: string): string {
1412
1412
  return name.replace(/^\S/, (s) => s.toUpperCase());
@@ -2242,6 +2242,109 @@ export class ViewElement extends BaseNode {
2242
2242
  current = (index === 0 ? 'current' : 'current' + index);
2243
2243
  return current;
2244
2244
  }
2245
+
2246
+ /**
2247
+ * 计算约束样式
2248
+ */
2249
+ computeConstraintStyle(nodeRect: DOMRect, parentRect: DOMRect) {
2250
+ const constraintWidth = nodeRect.width;
2251
+ const constraintHeight = nodeRect.height;
2252
+ const constraintLeft = nodeRect.x - parentRect.x;
2253
+ const constraintTop = nodeRect.y - parentRect.y;
2254
+ const constraintRight = (parentRect.width - nodeRect.width - constraintLeft);
2255
+ const constraintBottom = (parentRect.height - nodeRect.height - constraintTop);
2256
+ const styleObj = this.parseStyleToObject(this.staticStyle);
2257
+ const { '--constraint-x': constraintHorizontal = 'left',
2258
+ '--constraint-y': constraintVertical = 'top',
2259
+ width: staticWidth = '',
2260
+ height: staticHeight = '' } = styleObj;
2261
+ let left = '';
2262
+ let right = '';
2263
+ let top = '';
2264
+ let bottom = '';
2265
+ let transform = '';
2266
+ let width = staticWidth;
2267
+ let height = staticHeight;
2268
+
2269
+ const parentWidth = constraintLeft + constraintWidth + constraintRight;
2270
+ const parentHeight = constraintTop + constraintHeight + constraintBottom;
2271
+
2272
+ if (constraintHorizontal === 'left') {
2273
+ left = constraintLeft + 'px';
2274
+ right = '';
2275
+ } else if (constraintHorizontal === 'right') {
2276
+ left = '';
2277
+ right = constraintRight + 'px';
2278
+ } else if (constraintHorizontal === 'center') {
2279
+ const offset = constraintLeft + constraintWidth / 2 - parentWidth / 2;
2280
+ left = `calc(50% ${offset > 0 ? '+' : '-'} ${Math.abs(offset)}px)`;
2281
+ right = '';
2282
+ transform = 'translateX(-50%)';
2283
+ } else if (constraintHorizontal === 'scale') {
2284
+ left = constraintLeft * 100 / parentWidth + '%';
2285
+ right = constraintRight * 100 / parentWidth + '%';
2286
+ width = 'auto';
2287
+ } else if (constraintHorizontal === 'left-right') {
2288
+ left = constraintLeft + 'px';
2289
+ right = constraintRight + 'px';
2290
+ width = 'auto';
2291
+ }
2292
+
2293
+ if (constraintVertical === 'top') {
2294
+ top = constraintTop + 'px';
2295
+ bottom = '';
2296
+ } else if (constraintVertical === 'bottom') {
2297
+ top = '';
2298
+ bottom = constraintBottom + 'px';
2299
+ } else if (constraintVertical === 'center') {
2300
+ const offset = constraintTop + constraintHeight / 2 - parentHeight / 2;
2301
+ top = `calc(50% ${offset > 0 ? '+' : '-'} ${Math.abs(offset)}px)`;
2302
+ bottom = '';
2303
+ transform = transform ? 'translate(-50%, -50%)' : 'translateY(-50%)';
2304
+ } else if (constraintVertical === 'scale') {
2305
+ top = constraintTop * 100 / parentHeight + '%';
2306
+ bottom = constraintBottom * 100 / parentHeight + '%';
2307
+ height = 'auto';
2308
+ } else if (constraintVertical === 'top-bottom') {
2309
+ top = constraintTop + 'px';
2310
+ bottom = constraintBottom + 'px';
2311
+ height = 'auto';
2312
+ }
2313
+ const newStyleObj: Record<string, any> = {
2314
+ ...styleObj,
2315
+ left,
2316
+ right,
2317
+ top,
2318
+ bottom,
2319
+ transform,
2320
+ width,
2321
+ height,
2322
+ };
2323
+ const newStaticStyle = this.stringifyStyleAttr(newStyleObj);
2324
+ this.update({
2325
+ staticStyle: newStaticStyle,
2326
+ });
2327
+ }
2328
+
2329
+ parseStyleToObject(styleStr: string = '') {
2330
+ const styleObj = styleStr.split(/;/gim).reduce((obj:Record<string, string | number>, item) => {
2331
+ // background-image:url(http://www...)
2332
+ item = item.trim();
2333
+ const pos = item.indexOf(':');
2334
+ if (pos >= 0) {
2335
+ const key = item.slice(0, pos).trim();
2336
+ const value = item.slice(pos + 1).trim();
2337
+ obj[key] = value;
2338
+ }
2339
+ return obj;
2340
+ }, {});
2341
+ return styleObj;
2342
+ }
2343
+ stringifyStyleAttr(styleObj: Record<string, string | number>) {
2344
+ return Object.keys(styleObj)
2345
+ .map((key) => `${key}:${String(styleObj[key]).trim()};`)
2346
+ .join('');
2347
+ }
2245
2348
  //================================================================================
2246
2349
  // 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
2247
2350
  // ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓