@lcap/nasl 3.5.0-beta.4 → 3.6.0-alpha.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 (238) hide show
  1. package/out/bak/translator.js +39 -119
  2. package/out/bak/translator.js.map +1 -1
  3. package/out/breakpoint/generator/BreakpointNode.d.ts +0 -3
  4. package/out/breakpoint/generator/BreakpointNode.js +0 -9
  5. package/out/breakpoint/generator/BreakpointNode.js.map +1 -1
  6. package/out/breakpoint/shared/constants.js +0 -1
  7. package/out/breakpoint/shared/constants.js.map +1 -1
  8. package/out/breakpoint/shared/utils.js +7 -31
  9. package/out/breakpoint/shared/utils.js.map +1 -1
  10. package/out/common/BaseNode.d.ts +13 -1
  11. package/out/common/BaseNode.js +52 -23
  12. package/out/common/BaseNode.js.map +1 -1
  13. package/out/common/Command.js +1 -0
  14. package/out/common/Command.js.map +1 -1
  15. package/out/common/EventEmitter.d.ts +1 -1
  16. package/out/common/EventEmitter.js +0 -4
  17. package/out/common/EventEmitter.js.map +1 -1
  18. package/out/concepts/App__.d.ts +76 -51
  19. package/out/concepts/App__.js +190 -87
  20. package/out/concepts/App__.js.map +1 -1
  21. package/out/concepts/BackendVariable__.js +2 -10
  22. package/out/concepts/BackendVariable__.js.map +1 -1
  23. package/out/concepts/BindAttribute__.js +6 -16
  24. package/out/concepts/BindAttribute__.js.map +1 -1
  25. package/out/concepts/BindDirective__.d.ts +0 -1
  26. package/out/concepts/BindDirective__.js +4 -19
  27. package/out/concepts/BindDirective__.js.map +1 -1
  28. package/out/concepts/BindEvent__.d.ts +1 -3
  29. package/out/concepts/BindEvent__.js +13 -38
  30. package/out/concepts/BindEvent__.js.map +1 -1
  31. package/out/concepts/CallFunction__.js +2 -10
  32. package/out/concepts/CallFunction__.js.map +1 -1
  33. package/out/concepts/CallLogic__.d.ts +0 -2
  34. package/out/concepts/CallLogic__.js +27 -38
  35. package/out/concepts/CallLogic__.js.map +1 -1
  36. package/out/concepts/Constant__.js +6 -7
  37. package/out/concepts/Constant__.js.map +1 -1
  38. package/out/concepts/Destination__.d.ts +1 -1
  39. package/out/concepts/Destination__.js +4 -6
  40. package/out/concepts/Destination__.js.map +1 -1
  41. package/out/concepts/End__.js +1 -2
  42. package/out/concepts/End__.js.map +1 -1
  43. package/out/concepts/Entity__.d.ts +1 -1
  44. package/out/concepts/Entity__.js +2 -0
  45. package/out/concepts/Entity__.js.map +1 -1
  46. package/out/concepts/Event__.d.ts +0 -14
  47. package/out/concepts/Event__.js +0 -61
  48. package/out/concepts/Event__.js.map +1 -1
  49. package/out/concepts/Frontend__.d.ts +88 -0
  50. package/out/concepts/Frontend__.js +143 -1
  51. package/out/concepts/Frontend__.js.map +1 -1
  52. package/out/concepts/Identifier__.d.ts +0 -5
  53. package/out/concepts/Identifier__.js +9 -19
  54. package/out/concepts/Identifier__.js.map +1 -1
  55. package/out/concepts/LogicItem__.d.ts +1 -1
  56. package/out/concepts/LogicItem__.js.map +1 -1
  57. package/out/concepts/Logic__.d.ts +1 -3
  58. package/out/concepts/Logic__.js +13 -16
  59. package/out/concepts/Logic__.js.map +1 -1
  60. package/out/concepts/MemberExpression__.d.ts +1 -1
  61. package/out/concepts/MemberExpression__.js +3 -3
  62. package/out/concepts/MemberExpression__.js.map +1 -1
  63. package/out/concepts/NewComposite__.js.map +1 -1
  64. package/out/concepts/Param__.js +3 -11
  65. package/out/concepts/Param__.js.map +1 -1
  66. package/out/concepts/ProcessElement__.js +1 -9
  67. package/out/concepts/ProcessElement__.js.map +1 -1
  68. package/out/concepts/Return__.js +9 -17
  69. package/out/concepts/Return__.js.map +1 -1
  70. package/out/concepts/Variable__.js +8 -17
  71. package/out/concepts/Variable__.js.map +1 -1
  72. package/out/concepts/ViewElement__.d.ts +2 -17
  73. package/out/concepts/ViewElement__.js +31 -143
  74. package/out/concepts/ViewElement__.js.map +1 -1
  75. package/out/concepts/View__.js +6 -6
  76. package/out/concepts/View__.js.map +1 -1
  77. package/out/concepts/index__.d.ts +0 -5
  78. package/out/concepts/index__.js +0 -5
  79. package/out/concepts/index__.js.map +1 -1
  80. package/out/concepts/utils/asserts.d.ts +3 -258
  81. package/out/concepts/utils/asserts.js +13 -351
  82. package/out/concepts/utils/asserts.js.map +1 -1
  83. package/out/concepts/utils/types.d.ts +3 -20
  84. package/out/generator/genBundleFiles.js +11 -25
  85. package/out/generator/genBundleFiles.js.map +1 -1
  86. package/out/generator/genReleaseBody.js +3 -12
  87. package/out/generator/genReleaseBody.js.map +1 -1
  88. package/out/generator/permission.js +3 -3
  89. package/out/generator/permission.js.map +1 -1
  90. package/out/natural/transformTSCode.js +1 -1
  91. package/out/natural/transformTSCode.js.map +1 -1
  92. package/out/server/extendBaseNode.js +22 -6
  93. package/out/server/extendBaseNode.js.map +1 -1
  94. package/out/server/getLogics.js +27 -62
  95. package/out/server/getLogics.js.map +1 -1
  96. package/out/server/getMemberIdentifier.js +1 -6
  97. package/out/server/getMemberIdentifier.js.map +1 -1
  98. package/out/server/naslServer.js +11 -28
  99. package/out/server/naslServer.js.map +1 -1
  100. package/out/server/translator.js +1 -6
  101. package/out/server/translator.js.map +1 -1
  102. package/out/service/storage/init.js +26 -2
  103. package/out/service/storage/init.js.map +1 -1
  104. package/out/templator/genCreateBlock.js +6 -6
  105. package/out/templator/genCreateBlock.js.map +1 -1
  106. package/out/templator/genCurdEditMultipleKeyBlock.js +16 -16
  107. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  108. package/out/templator/genCurdMultipleKeyBlock.d.ts +27 -0
  109. package/out/templator/genCurdMultipleKeyBlock.js +709 -37
  110. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  111. package/out/templator/genGetBlock.js +4 -4
  112. package/out/templator/genGetBlock.js.map +1 -1
  113. package/out/templator/genGridViewBlock.js +12 -12
  114. package/out/templator/genGridViewBlock.js.map +1 -1
  115. package/out/templator/genListViewBlock.js +4 -4
  116. package/out/templator/genListViewBlock.js.map +1 -1
  117. package/out/templator/genSelectBlock.js +3 -3
  118. package/out/templator/genSelectBlock.js.map +1 -1
  119. package/out/templator/genTableBlock.d.ts +2 -0
  120. package/out/templator/genTableBlock.js +124 -11
  121. package/out/templator/genTableBlock.js.map +1 -1
  122. package/out/templator/genUpdateBlock.js +8 -8
  123. package/out/templator/genUpdateBlock.js.map +1 -1
  124. package/out/templator/utils.d.ts +2 -2
  125. package/out/templator/utils.js.map +1 -1
  126. package/out/translator/utils.js +18 -0
  127. package/out/translator/utils.js.map +1 -1
  128. package/out/utils/i18nInfo.js +2 -7
  129. package/out/utils/i18nInfo.js.map +1 -1
  130. package/package.json +2 -2
  131. package/src/bak/translator.js +43 -121
  132. package/src/breakpoint/generator/BreakpointNode.ts +0 -12
  133. package/src/breakpoint/shared/constants.ts +0 -1
  134. package/src/breakpoint/shared/utils.ts +10 -37
  135. package/src/common/BaseNode.ts +60 -22
  136. package/src/common/Command.ts +1 -0
  137. package/src/common/EventEmitter.ts +1 -6
  138. package/src/concepts/App__.ts +251 -139
  139. package/src/concepts/BackendVariable__.ts +2 -10
  140. package/src/concepts/BindAttribute__.ts +6 -15
  141. package/src/concepts/BindDirective__.ts +4 -19
  142. package/src/concepts/BindEvent__.ts +12 -40
  143. package/src/concepts/CallFunction__.ts +2 -10
  144. package/src/concepts/CallLogic__.ts +32 -45
  145. package/src/concepts/Constant__.ts +7 -5
  146. package/src/concepts/Destination__.ts +4 -6
  147. package/src/concepts/End__.ts +0 -1
  148. package/src/concepts/Entity__.ts +3 -1
  149. package/src/concepts/Event__.ts +0 -70
  150. package/src/concepts/Frontend__.ts +251 -3
  151. package/src/concepts/Identifier__.ts +13 -29
  152. package/src/concepts/LogicItem__.ts +0 -1
  153. package/src/concepts/Logic__.ts +14 -21
  154. package/src/concepts/MemberExpression__.ts +3 -3
  155. package/src/concepts/NewComposite__.ts +6 -4
  156. package/src/concepts/Param__.ts +3 -11
  157. package/src/concepts/ProcessElement__.ts +1 -8
  158. package/src/concepts/Return__.ts +12 -15
  159. package/src/concepts/Variable__.ts +9 -17
  160. package/src/concepts/ViewElement__.ts +54 -166
  161. package/src/concepts/View__.ts +6 -8
  162. package/src/concepts/index__.ts +0 -5
  163. package/src/concepts/utils/asserts.ts +4 -367
  164. package/src/concepts/utils/types.ts +0 -28
  165. package/src/generator/genBundleFiles.ts +15 -33
  166. package/src/generator/genReleaseBody.ts +3 -14
  167. package/src/generator/permission.ts +6 -8
  168. package/src/natural/transformTSCode.ts +1 -1
  169. package/src/server/extendBaseNode.ts +41 -22
  170. package/src/server/getLogics.ts +41 -79
  171. package/src/server/getMemberIdentifier.ts +1 -7
  172. package/src/server/naslServer.ts +12 -30
  173. package/src/server/translator.ts +1 -7
  174. package/src/service/storage/init.ts +33 -2
  175. package/src/templator/genCreateBlock.ts +6 -6
  176. package/src/templator/genCurdEditMultipleKeyBlock.ts +16 -16
  177. package/src/templator/genCurdMultipleKeyBlock.ts +817 -93
  178. package/src/templator/genGetBlock.ts +4 -4
  179. package/src/templator/genGridViewBlock.ts +12 -12
  180. package/src/templator/genListViewBlock.ts +4 -4
  181. package/src/templator/genSelectBlock.ts +3 -3
  182. package/src/templator/genTableBlock.ts +137 -12
  183. package/src/templator/genUpdateBlock.ts +8 -8
  184. package/src/templator/utils.ts +2 -2
  185. package/src/translator/utils.ts +20 -0
  186. package/src/utils/i18nInfo.ts +2 -7
  187. package/test/concepts/call-function/fixtures/from-string.json +59 -68
  188. package/test/concepts/call-function/fixtures/to-string-global-tz.json +58 -67
  189. package/test/concepts/call-function/fixtures/to-string-no-tz.json +48 -57
  190. package/test/concepts/call-function/fixtures/to-string-user-tz.json +60 -69
  191. package/test/concepts/call-function/fixtures/to-string-utc-tz.json +60 -69
  192. package/test/concepts/call-interface/fixtures/only-interface.json +72 -81
  193. package/test/concepts/call-interface/fixtures/with-body-complex-argument.json +214 -223
  194. package/test/concepts/call-interface/fixtures/with-body-no-argument.json +76 -85
  195. package/test/concepts/call-interface/fixtures/with-body-simple-argument.json +91 -100
  196. package/test/concepts/call-interface/fixtures/with-headers-no-argument.json +79 -88
  197. package/test/concepts/call-interface/fixtures/with-headers.json +81 -90
  198. package/test/concepts/call-interface/fixtures/with-query-no-argument.json +79 -88
  199. package/test/concepts/call-interface/fixtures/with-query.json +81 -90
  200. package/test/concepts/call-logic/__snapshots__/getQuickInfoOffset.spec.ts.snap +2 -4
  201. package/test/concepts/call-logic/fixtures/entries-get-with-arguments.json +95 -104
  202. package/test/concepts/call-logic/fixtures/entries-update-with-arguments.json +200 -209
  203. package/test/concepts/call-logic/fixtures/global-logic-argument-no-expression.json +88 -97
  204. package/test/concepts/call-logic/fixtures/global-logic-argument-some-expression.json +115 -124
  205. package/test/concepts/call-logic/fixtures/json-deserialize.json +111 -120
  206. package/test/concepts/call-logic/fixtures/json-serialize-with-string.json +115 -124
  207. package/test/concepts/call-logic/fixtures/json-serialize.json +115 -124
  208. package/test/concepts/call-logic/fixtures/view-buildin-logic-with-argument.json +82 -91
  209. package/test/concepts/call-logic/fixtures/view-component-logic-no-argument.json +79 -88
  210. package/test/concepts/call-logic/fixtures/view-component-with-validation.json +135 -144
  211. package/test/concepts/identifier/fixtures/view-variable.json +136 -145
  212. package/test/concepts/view-element/__snapshots__/toVue.spec.ts.snap +1 -1
  213. package/test/concepts/view-element/fixtures/default-login.json +212 -221
  214. package/test/concepts/view-element/fixtures/default-not-found.json +174 -183
  215. package/test/concepts/view-element/fixtures/with-role-auth.json +82 -91
  216. package/test/concepts/view-element/fixtures/with-table.json +1834 -1843
  217. package/test/concepts/view-element/toVue.spec.ts +0 -1
  218. package/ts-worker/package.json +1 -1
  219. package/out/concepts/BusinessComponent__.d.ts +0 -641
  220. package/out/concepts/BusinessComponent__.js +0 -1901
  221. package/out/concepts/BusinessComponent__.js.map +0 -1
  222. package/out/concepts/BusinessLogic__.d.ts +0 -38
  223. package/out/concepts/BusinessLogic__.js +0 -358
  224. package/out/concepts/BusinessLogic__.js.map +0 -1
  225. package/out/concepts/CallEvent__.d.ts +0 -97
  226. package/out/concepts/CallEvent__.js +0 -263
  227. package/out/concepts/CallEvent__.js.map +0 -1
  228. package/out/concepts/FrontendType__.d.ts +0 -308
  229. package/out/concepts/FrontendType__.js +0 -605
  230. package/out/concepts/FrontendType__.js.map +0 -1
  231. package/out/concepts/ParamWithGroup__.d.ts +0 -39
  232. package/out/concepts/ParamWithGroup__.js +0 -85
  233. package/out/concepts/ParamWithGroup__.js.map +0 -1
  234. package/src/concepts/BusinessComponent__.ts +0 -2669
  235. package/src/concepts/BusinessLogic__.ts +0 -376
  236. package/src/concepts/CallEvent__.ts +0 -334
  237. package/src/concepts/FrontendType__.ts +0 -919
  238. package/src/concepts/ParamWithGroup__.ts +0 -101
@@ -1,7 +1,6 @@
1
1
  import type { App } from '../App__';
2
2
  import type { Module } from '../Module__';
3
3
  import type { Namespace } from '../Namespace__';
4
- import type { FrontendType } from '../FrontendType__';
5
4
  import type { Frontend } from '../Frontend__';
6
5
  import type { Backend } from '../Backend__';
7
6
  import type { Integration } from '../Integration__';
@@ -25,7 +24,6 @@ import type { BindDirective } from '../BindDirective__';
25
24
  import type { BindEvent } from '../BindEvent__';
26
25
  import type { BindStyle } from '../BindStyle__';
27
26
  import type { ViewComponent } from '../ViewComponent__';
28
- import type { BusinessComponent } from '../BusinessComponent__';
29
27
  import type { Attribute } from '../Attribute__';
30
28
  import type { Event } from '../Event__';
31
29
  import type { Slot } from '../Slot__';
@@ -33,12 +31,10 @@ import type { Theme } from '../Theme__';
33
31
  import type { StaticString } from '../StaticString__';
34
32
  import type { Logic } from '../Logic__';
35
33
  import type { AuthLogic } from '../AuthLogic__';
36
- import type { BusinessLogic } from '../BusinessLogic__';
37
34
  import type { AuthLogicForCallInterface } from '../AuthLogicForCallInterface__';
38
35
  import type { OverriddenLogic } from '../OverriddenLogic__';
39
36
  import type { AbstractInterface } from '../AbstractInterface__';
40
37
  import type { Param } from '../Param__';
41
- import type { ParamWithGroup } from '../ParamWithGroup__';
42
38
  import type { Return } from '../Return__';
43
39
  import type { Variable } from '../Variable__';
44
40
  import type { BackendVariable } from '../BackendVariable__';
@@ -64,7 +60,6 @@ import type { Assignment } from '../Assignment__';
64
60
  import type { BatchAssignment } from '../BatchAssignment__';
65
61
  import type { Comment } from '../Comment__';
66
62
  import type { CallLogic } from '../CallLogic__';
67
- import type { CallEvent } from '../CallEvent__';
68
63
  import type { CallFunction } from '../CallFunction__';
69
64
  import type { CallInterface } from '../CallInterface__';
70
65
  import type { Destination } from '../Destination__';
@@ -218,21 +213,6 @@ export function isStrictNamespace(node: unknown): node is Namespace {
218
213
  return isBaseNode(node) && node.concept === 'Namespace';
219
214
  }
220
215
 
221
- /**
222
- * 严格判断输入为 FrontendType 节点
223
- *
224
- * @description 仅判断节点本身,不包含继承类
225
- * @example
226
- * ```ts
227
- * if (isStrictFrontendType(node)) {
228
- * // 在这个花括号内,node 的类型为 FrontendType
229
- * }
230
- * ```
231
- */
232
- export function isStrictFrontendType(node: unknown): node is FrontendType {
233
- return isBaseNode(node) && node.concept === 'FrontendType';
234
- }
235
-
236
216
  /**
237
217
  * 严格判断输入为 Frontend 节点
238
218
  *
@@ -578,21 +558,6 @@ export function isStrictViewComponent(node: unknown): node is ViewComponent {
578
558
  return isBaseNode(node) && node.concept === 'ViewComponent';
579
559
  }
580
560
 
581
- /**
582
- * 严格判断输入为 BusinessComponent 节点
583
- *
584
- * @description 仅判断节点本身,不包含继承类
585
- * @example
586
- * ```ts
587
- * if (isStrictBusinessComponent(node)) {
588
- * // 在这个花括号内,node 的类型为 BusinessComponent
589
- * }
590
- * ```
591
- */
592
- export function isStrictBusinessComponent(node: unknown): node is BusinessComponent {
593
- return isBaseNode(node) && node.concept === 'BusinessComponent';
594
- }
595
-
596
561
  /**
597
562
  * 严格判断输入为 Attribute 节点
598
563
  *
@@ -698,21 +663,6 @@ export function isStrictAuthLogic(node: unknown): node is AuthLogic {
698
663
  return isBaseNode(node) && node.concept === 'AuthLogic';
699
664
  }
700
665
 
701
- /**
702
- * 严格判断输入为 BusinessLogic 节点
703
- *
704
- * @description 仅判断节点本身,不包含继承类
705
- * @example
706
- * ```ts
707
- * if (isStrictBusinessLogic(node)) {
708
- * // 在这个花括号内,node 的类型为 BusinessLogic
709
- * }
710
- * ```
711
- */
712
- export function isStrictBusinessLogic(node: unknown): node is BusinessLogic {
713
- return isBaseNode(node) && node.concept === 'BusinessLogic';
714
- }
715
-
716
666
  /**
717
667
  * 严格判断输入为 AuthLogicForCallInterface 节点
718
668
  *
@@ -758,21 +708,6 @@ export function isStrictParam(node: unknown): node is Param {
758
708
  return isBaseNode(node) && node.concept === 'Param';
759
709
  }
760
710
 
761
- /**
762
- * 严格判断输入为 ParamWithGroup 节点
763
- *
764
- * @description 仅判断节点本身,不包含继承类
765
- * @example
766
- * ```ts
767
- * if (isStrictParamWithGroup(node)) {
768
- * // 在这个花括号内,node 的类型为 ParamWithGroup
769
- * }
770
- * ```
771
- */
772
- export function isStrictParamWithGroup(node: unknown): node is ParamWithGroup {
773
- return isBaseNode(node) && node.concept === 'ParamWithGroup';
774
- }
775
-
776
711
  /**
777
712
  * 严格判断输入为 Return 节点
778
713
  *
@@ -1118,21 +1053,6 @@ export function isStrictCallLogic(node: unknown): node is CallLogic {
1118
1053
  return isBaseNode(node) && node.concept === 'CallLogic';
1119
1054
  }
1120
1055
 
1121
- /**
1122
- * 严格判断输入为 CallEvent 节点
1123
- *
1124
- * @description 仅判断节点本身,不包含继承类
1125
- * @example
1126
- * ```ts
1127
- * if (isStrictCallEvent(node)) {
1128
- * // 在这个花括号内,node 的类型为 CallEvent
1129
- * }
1130
- * ```
1131
- */
1132
- export function isStrictCallEvent(node: unknown): node is CallEvent {
1133
- return isBaseNode(node) && node.concept === 'CallEvent';
1134
- }
1135
-
1136
1056
  /**
1137
1057
  * 严格判断输入为 CallFunction 节点
1138
1058
  *
@@ -2251,27 +2171,6 @@ export function isNamespace(node: unknown): node is Namespace {
2251
2171
  );
2252
2172
  }
2253
2173
 
2254
- /**
2255
- * 判断输入为 FrontendType 节点实例
2256
- *
2257
- * @description 包含节点类以及节点继承类的判断
2258
- * @description 等价于`instanceof`运算,FrontendType 节点没有继承类,此判断等价于`isStrictFrontendType`
2259
- * @example
2260
- * ```ts
2261
- * if (isFrontendType(node)) {
2262
- * // 在这个花括号内,node 的类型是 FrontendType 或者 FrontendType 继承类型
2263
- * }
2264
- * ```
2265
- */
2266
- export function isFrontendType(node: unknown): node is FrontendType {
2267
- return (
2268
- isBaseNode(node) &&
2269
- (
2270
- node.concept === 'FrontendType'
2271
- )
2272
- );
2273
- }
2274
-
2275
2174
  /**
2276
2175
  * 判断输入为 Frontend 节点实例
2277
2176
  *
@@ -2755,27 +2654,6 @@ export function isViewComponent(node: unknown): node is ViewComponent {
2755
2654
  );
2756
2655
  }
2757
2656
 
2758
- /**
2759
- * 判断输入为 BusinessComponent 节点实例
2760
- *
2761
- * @description 包含节点类以及节点继承类的判断
2762
- * @description 等价于`instanceof`运算,BusinessComponent 节点没有继承类,此判断等价于`isStrictBusinessComponent`
2763
- * @example
2764
- * ```ts
2765
- * if (isBusinessComponent(node)) {
2766
- * // 在这个花括号内,node 的类型是 BusinessComponent 或者 BusinessComponent 继承类型
2767
- * }
2768
- * ```
2769
- */
2770
- export function isBusinessComponent(node: unknown): node is BusinessComponent {
2771
- return (
2772
- isBaseNode(node) &&
2773
- (
2774
- node.concept === 'BusinessComponent'
2775
- )
2776
- );
2777
- }
2778
-
2779
2657
  /**
2780
2658
  * 判断输入为 Attribute 节点实例
2781
2659
  *
@@ -2899,7 +2777,6 @@ export function isLogic(node: unknown): node is Type.LogicNode {
2899
2777
  (
2900
2778
  node.concept === 'Logic' ||
2901
2779
  node.concept === 'AuthLogic' ||
2902
- node.concept === 'BusinessLogic' ||
2903
2780
  node.concept === 'AuthLogicForCallInterface'
2904
2781
  )
2905
2782
  );
@@ -2927,27 +2804,6 @@ export function isAuthLogic(node: unknown): node is Type.AuthLogicNode {
2927
2804
  );
2928
2805
  }
2929
2806
 
2930
- /**
2931
- * 判断输入为 BusinessLogic 节点实例
2932
- *
2933
- * @description 包含节点类以及节点继承类的判断
2934
- * @description 等价于`instanceof`运算,BusinessLogic 节点没有继承类,此判断等价于`isStrictBusinessLogic`
2935
- * @example
2936
- * ```ts
2937
- * if (isBusinessLogic(node)) {
2938
- * // 在这个花括号内,node 的类型是 BusinessLogic 或者 BusinessLogic 继承类型
2939
- * }
2940
- * ```
2941
- */
2942
- export function isBusinessLogic(node: unknown): node is BusinessLogic {
2943
- return (
2944
- isBaseNode(node) &&
2945
- (
2946
- node.concept === 'BusinessLogic'
2947
- )
2948
- );
2949
- }
2950
-
2951
2807
  /**
2952
2808
  * 判断输入为 AuthLogicForCallInterface 节点实例
2953
2809
  *
@@ -3018,7 +2874,7 @@ export function isAbstractInterface(node: unknown): node is Type.AbstractInterfa
3018
2874
  * 判断输入为 Param 节点实例
3019
2875
  *
3020
2876
  * @description 包含节点类以及节点继承类的判断
3021
- * @description 等价于`instanceof`运算
2877
+ * @description 等价于`instanceof`运算,Param 节点没有继承类,此判断等价于`isStrictParam`
3022
2878
  * @example
3023
2879
  * ```ts
3024
2880
  * if (isParam(node)) {
@@ -3026,33 +2882,11 @@ export function isAbstractInterface(node: unknown): node is Type.AbstractInterfa
3026
2882
  * }
3027
2883
  * ```
3028
2884
  */
3029
- export function isParam(node: unknown): node is Type.ParamNode {
2885
+ export function isParam(node: unknown): node is Param {
3030
2886
  return (
3031
2887
  isBaseNode(node) &&
3032
2888
  (
3033
- node.concept === 'Param' ||
3034
- node.concept === 'ParamWithGroup'
3035
- )
3036
- );
3037
- }
3038
-
3039
- /**
3040
- * 判断输入为 ParamWithGroup 节点实例
3041
- *
3042
- * @description 包含节点类以及节点继承类的判断
3043
- * @description 等价于`instanceof`运算,ParamWithGroup 节点没有继承类,此判断等价于`isStrictParamWithGroup`
3044
- * @example
3045
- * ```ts
3046
- * if (isParamWithGroup(node)) {
3047
- * // 在这个花括号内,node 的类型是 ParamWithGroup 或者 ParamWithGroup 继承类型
3048
- * }
3049
- * ```
3050
- */
3051
- export function isParamWithGroup(node: unknown): node is ParamWithGroup {
3052
- return (
3053
- isBaseNode(node) &&
3054
- (
3055
- node.concept === 'ParamWithGroup'
2889
+ node.concept === 'Param'
3056
2890
  )
3057
2891
  );
3058
2892
  }
@@ -3193,7 +3027,6 @@ export function isLogicItem(node: unknown): node is Type.LogicItemNode {
3193
3027
  node.concept === 'BatchAssignment' ||
3194
3028
  node.concept === 'Comment' ||
3195
3029
  node.concept === 'CallLogic' ||
3196
- node.concept === 'CallEvent' ||
3197
3030
  node.concept === 'CallFunction' ||
3198
3031
  node.concept === 'CallInterface' ||
3199
3032
  node.concept === 'Destination' ||
@@ -3643,27 +3476,6 @@ export function isCallLogic(node: unknown): node is Type.CallLogicNode {
3643
3476
  );
3644
3477
  }
3645
3478
 
3646
- /**
3647
- * 判断输入为 CallEvent 节点实例
3648
- *
3649
- * @description 包含节点类以及节点继承类的判断
3650
- * @description 等价于`instanceof`运算,CallEvent 节点没有继承类,此判断等价于`isStrictCallEvent`
3651
- * @example
3652
- * ```ts
3653
- * if (isCallEvent(node)) {
3654
- * // 在这个花括号内,node 的类型是 CallEvent 或者 CallEvent 继承类型
3655
- * }
3656
- * ```
3657
- */
3658
- export function isCallEvent(node: unknown): node is CallEvent {
3659
- return (
3660
- isBaseNode(node) &&
3661
- (
3662
- node.concept === 'CallEvent'
3663
- )
3664
- );
3665
- }
3666
-
3667
3479
  /**
3668
3480
  * 判断输入为 CallFunction 节点实例
3669
3481
  *
@@ -5194,23 +5006,6 @@ export function assertStrictNamespace(node: unknown): asserts node is Namespace
5194
5006
  }
5195
5007
  }
5196
5008
 
5197
- /**
5198
- * 严格断言为 FrontendType 节点
5199
- *
5200
- * @description 仅断言节点本身,不包含继承类
5201
- * @example
5202
- * ```ts
5203
- * assertStrictFrontendType(node);
5204
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 FrontendType 类型
5205
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
5206
- * ```
5207
- */
5208
- export function assertStrictFrontendType(node: unknown): asserts node is FrontendType {
5209
- if (!isStrictFrontendType(node)) {
5210
- throw new Error(`FrontendType 节点严格断言失败`);
5211
- }
5212
- }
5213
-
5214
5009
  /**
5215
5010
  * 严格断言为 Frontend 节点
5216
5011
  *
@@ -5602,23 +5397,6 @@ export function assertStrictViewComponent(node: unknown): asserts node is ViewCo
5602
5397
  }
5603
5398
  }
5604
5399
 
5605
- /**
5606
- * 严格断言为 BusinessComponent 节点
5607
- *
5608
- * @description 仅断言节点本身,不包含继承类
5609
- * @example
5610
- * ```ts
5611
- * assertStrictBusinessComponent(node);
5612
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 BusinessComponent 类型
5613
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
5614
- * ```
5615
- */
5616
- export function assertStrictBusinessComponent(node: unknown): asserts node is BusinessComponent {
5617
- if (!isStrictBusinessComponent(node)) {
5618
- throw new Error(`BusinessComponent 节点严格断言失败`);
5619
- }
5620
- }
5621
-
5622
5400
  /**
5623
5401
  * 严格断言为 Attribute 节点
5624
5402
  *
@@ -5738,23 +5516,6 @@ export function assertStrictAuthLogic(node: unknown): asserts node is AuthLogic
5738
5516
  }
5739
5517
  }
5740
5518
 
5741
- /**
5742
- * 严格断言为 BusinessLogic 节点
5743
- *
5744
- * @description 仅断言节点本身,不包含继承类
5745
- * @example
5746
- * ```ts
5747
- * assertStrictBusinessLogic(node);
5748
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 BusinessLogic 类型
5749
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
5750
- * ```
5751
- */
5752
- export function assertStrictBusinessLogic(node: unknown): asserts node is BusinessLogic {
5753
- if (!isStrictBusinessLogic(node)) {
5754
- throw new Error(`BusinessLogic 节点严格断言失败`);
5755
- }
5756
- }
5757
-
5758
5519
  /**
5759
5520
  * 严格断言为 AuthLogicForCallInterface 节点
5760
5521
  *
@@ -5806,23 +5567,6 @@ export function assertStrictParam(node: unknown): asserts node is Param {
5806
5567
  }
5807
5568
  }
5808
5569
 
5809
- /**
5810
- * 严格断言为 ParamWithGroup 节点
5811
- *
5812
- * @description 仅断言节点本身,不包含继承类
5813
- * @example
5814
- * ```ts
5815
- * assertStrictParamWithGroup(node);
5816
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 ParamWithGroup 类型
5817
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
5818
- * ```
5819
- */
5820
- export function assertStrictParamWithGroup(node: unknown): asserts node is ParamWithGroup {
5821
- if (!isStrictParamWithGroup(node)) {
5822
- throw new Error(`ParamWithGroup 节点严格断言失败`);
5823
- }
5824
- }
5825
-
5826
5570
  /**
5827
5571
  * 严格断言为 Return 节点
5828
5572
  *
@@ -6214,23 +5958,6 @@ export function assertStrictCallLogic(node: unknown): asserts node is CallLogic
6214
5958
  }
6215
5959
  }
6216
5960
 
6217
- /**
6218
- * 严格断言为 CallEvent 节点
6219
- *
6220
- * @description 仅断言节点本身,不包含继承类
6221
- * @example
6222
- * ```ts
6223
- * assertStrictCallEvent(node);
6224
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 CallEvent 类型
6225
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
6226
- * ```
6227
- */
6228
- export function assertStrictCallEvent(node: unknown): asserts node is CallEvent {
6229
- if (!isStrictCallEvent(node)) {
6230
- throw new Error(`CallEvent 节点严格断言失败`);
6231
- }
6232
- }
6233
-
6234
5961
  /**
6235
5962
  * 严格断言为 CallFunction 节点
6236
5963
  *
@@ -7479,24 +7206,6 @@ export function assertNamespace(node: unknown): asserts node is Namespace {
7479
7206
  }
7480
7207
  }
7481
7208
 
7482
- /**
7483
- * 断言为 FrontendType 节点
7484
- *
7485
- * @description 包含节点类以及节点继承类的判断
7486
- * @description 节点没有继承类时,等价于`assertStrictFrontendType`方法
7487
- * @example
7488
- * ```ts
7489
- * assertFrontendType(node);
7490
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 FrontendType 或者 FrontendType 继承类型
7491
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
7492
- * ```
7493
- */
7494
- export function assertFrontendType(node: unknown): asserts node is FrontendType {
7495
- if (!isFrontendType(node)) {
7496
- throw new Error(`FrontendType 节点断言失败`);
7497
- }
7498
- }
7499
-
7500
7209
  /**
7501
7210
  * 断言为 Frontend 节点
7502
7211
  *
@@ -7911,24 +7620,6 @@ export function assertViewComponent(node: unknown): asserts node is ViewComponen
7911
7620
  }
7912
7621
  }
7913
7622
 
7914
- /**
7915
- * 断言为 BusinessComponent 节点
7916
- *
7917
- * @description 包含节点类以及节点继承类的判断
7918
- * @description 节点没有继承类时,等价于`assertStrictBusinessComponent`方法
7919
- * @example
7920
- * ```ts
7921
- * assertBusinessComponent(node);
7922
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 BusinessComponent 或者 BusinessComponent 继承类型
7923
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
7924
- * ```
7925
- */
7926
- export function assertBusinessComponent(node: unknown): asserts node is BusinessComponent {
7927
- if (!isBusinessComponent(node)) {
7928
- throw new Error(`BusinessComponent 节点断言失败`);
7929
- }
7930
- }
7931
-
7932
7623
  /**
7933
7624
  * 断言为 Attribute 节点
7934
7625
  *
@@ -8055,24 +7746,6 @@ export function assertAuthLogic(node: unknown): asserts node is Type.AuthLogicNo
8055
7746
  }
8056
7747
  }
8057
7748
 
8058
- /**
8059
- * 断言为 BusinessLogic 节点
8060
- *
8061
- * @description 包含节点类以及节点继承类的判断
8062
- * @description 节点没有继承类时,等价于`assertStrictBusinessLogic`方法
8063
- * @example
8064
- * ```ts
8065
- * assertBusinessLogic(node);
8066
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 BusinessLogic 或者 BusinessLogic 继承类型
8067
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
8068
- * ```
8069
- */
8070
- export function assertBusinessLogic(node: unknown): asserts node is BusinessLogic {
8071
- if (!isBusinessLogic(node)) {
8072
- throw new Error(`BusinessLogic 节点断言失败`);
8073
- }
8074
- }
8075
-
8076
7749
  /**
8077
7750
  * 断言为 AuthLogicForCallInterface 节点
8078
7751
  *
@@ -8139,30 +7812,12 @@ export function assertAbstractInterface(node: unknown): asserts node is Type.Abs
8139
7812
  * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
8140
7813
  * ```
8141
7814
  */
8142
- export function assertParam(node: unknown): asserts node is Type.ParamNode {
7815
+ export function assertParam(node: unknown): asserts node is Param {
8143
7816
  if (!isParam(node)) {
8144
7817
  throw new Error(`Param 节点断言失败`);
8145
7818
  }
8146
7819
  }
8147
7820
 
8148
- /**
8149
- * 断言为 ParamWithGroup 节点
8150
- *
8151
- * @description 包含节点类以及节点继承类的判断
8152
- * @description 节点没有继承类时,等价于`assertStrictParamWithGroup`方法
8153
- * @example
8154
- * ```ts
8155
- * assertParamWithGroup(node);
8156
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 ParamWithGroup 或者 ParamWithGroup 继承类型
8157
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
8158
- * ```
8159
- */
8160
- export function assertParamWithGroup(node: unknown): asserts node is ParamWithGroup {
8161
- if (!isParamWithGroup(node)) {
8162
- throw new Error(`ParamWithGroup 节点断言失败`);
8163
- }
8164
- }
8165
-
8166
7821
  /**
8167
7822
  * 断言为 Return 节点
8168
7823
  *
@@ -8613,24 +8268,6 @@ export function assertCallLogic(node: unknown): asserts node is Type.CallLogicNo
8613
8268
  }
8614
8269
  }
8615
8270
 
8616
- /**
8617
- * 断言为 CallEvent 节点
8618
- *
8619
- * @description 包含节点类以及节点继承类的判断
8620
- * @description 节点没有继承类时,等价于`assertStrictCallEvent`方法
8621
- * @example
8622
- * ```ts
8623
- * assertCallEvent(node);
8624
- * // 当前作用域内,断言语句之后,node 的类型都将会被断言为 CallEvent 或者 CallEvent 继承类型
8625
- * // 断言失败会抛出错误,所以此函数是用在必须要严格限定节点类型的地方
8626
- * ```
8627
- */
8628
- export function assertCallEvent(node: unknown): asserts node is CallEvent {
8629
- if (!isCallEvent(node)) {
8630
- throw new Error(`CallEvent 节点断言失败`);
8631
- }
8632
- }
8633
-
8634
8271
  /**
8635
8272
  * 断言为 CallFunction 节点
8636
8273
  *