@lcap/nasl 4.4.0-beta.3 → 4.4.0-beta.30

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 (268) hide show
  1. package/out/generator/genBundleFiles.d.ts +2 -0
  2. package/out/generator/genBundleFiles.d.ts.map +1 -1
  3. package/out/generator/genBundleFiles.js +77 -12
  4. package/out/generator/genBundleFiles.js.map +1 -1
  5. package/out/generator/icestark.d.ts +1 -1
  6. package/out/generator/icestark.d.ts.map +1 -1
  7. package/out/generator/icestark.js +6 -1
  8. package/out/generator/icestark.js.map +1 -1
  9. package/out/generator/qiankun.d.ts +1 -1
  10. package/out/generator/qiankun.d.ts.map +1 -1
  11. package/out/generator/qiankun.js +9 -3
  12. package/out/generator/qiankun.js.map +1 -1
  13. package/out/generator/release-body/body.d.ts +0 -1
  14. package/out/generator/release-body/body.d.ts.map +1 -1
  15. package/out/generator/release-body/body.js +1 -390
  16. package/out/generator/release-body/body.js.map +1 -1
  17. package/out/generator/release-body/data.d.ts.map +1 -1
  18. package/out/generator/release-body/data.js +38 -11
  19. package/out/generator/release-body/data.js.map +1 -1
  20. package/out/generator/release-body/internal.d.ts +1 -0
  21. package/out/generator/release-body/internal.d.ts.map +1 -1
  22. package/out/generator/release-body/internal.js.map +1 -1
  23. package/out/generator/release-body/share-content.js +1 -1
  24. package/out/generator/release-body/share-content.js.map +1 -1
  25. package/out/generator/release-body/types.d.ts +2 -0
  26. package/out/generator/release-body/types.d.ts.map +1 -1
  27. package/out/generator/release-body/utils.d.ts +1 -0
  28. package/out/generator/release-body/utils.d.ts.map +1 -1
  29. package/out/generator/release-body/utils.js +2 -1
  30. package/out/generator/release-body/utils.js.map +1 -1
  31. package/out/generator/templates/chunk.js +1 -1
  32. package/out/generator/templates/runtime.js +2 -2
  33. package/out/generator/wujie.d.ts +1 -1
  34. package/out/generator/wujie.d.ts.map +1 -1
  35. package/out/generator/wujie.js +6 -1
  36. package/out/generator/wujie.js.map +1 -1
  37. package/out/natural/exports/nasl2Files.d.ts +34 -0
  38. package/out/natural/exports/nasl2Files.d.ts.map +1 -0
  39. package/out/natural/exports/nasl2Files.js +237 -0
  40. package/out/natural/exports/nasl2Files.js.map +1 -0
  41. package/out/natural/{transform2BatchActions.d.ts → exports/transform2BatchActions.d.ts} +20 -2
  42. package/out/natural/exports/transform2BatchActions.d.ts.map +1 -0
  43. package/out/natural/exports/transform2BatchActions.js +1233 -0
  44. package/out/natural/exports/transform2BatchActions.js.map +1 -0
  45. package/out/natural/index.d.ts +12 -12
  46. package/out/natural/index.d.ts.map +1 -1
  47. package/out/natural/index.js +12 -14
  48. package/out/natural/index.js.map +1 -1
  49. package/out/natural/{genNaturalTS.d.ts → old/getContext/genNaturalTS.d.ts} +12 -12
  50. package/out/natural/old/getContext/genNaturalTS.d.ts.map +1 -0
  51. package/out/natural/{genNaturalTS.js → old/getContext/genNaturalTS.js} +65 -65
  52. package/out/natural/old/getContext/genNaturalTS.js.map +1 -0
  53. package/out/natural/old/getContext/genTextualNASL.d.ts.map +1 -0
  54. package/out/natural/old/getContext/genTextualNASL.js.map +1 -0
  55. package/out/natural/{getContext → old/getContext}/getUILib.d.ts +1 -1
  56. package/out/natural/old/getContext/getUILib.d.ts.map +1 -0
  57. package/out/natural/{getContext → old/getContext}/getUILib.js +14 -14
  58. package/out/natural/old/getContext/getUILib.js.map +1 -0
  59. package/out/natural/{getContext → old/getContext}/index.d.ts +3 -3
  60. package/out/natural/old/getContext/index.d.ts.map +1 -0
  61. package/out/natural/{getContext → old/getContext}/index.js +4 -4
  62. package/out/natural/old/getContext/index.js.map +1 -0
  63. package/out/natural/old/getContext/naslStdlibMap.d.ts.map +1 -0
  64. package/out/natural/{getContext → old/getContext}/naslStdlibMap.js +10 -10
  65. package/out/natural/old/getContext/naslStdlibMap.js.map +1 -0
  66. package/out/natural/{transformTS2UI.d.ts → old/parser/transformTS2UI.d.ts} +2 -2
  67. package/out/natural/old/parser/transformTS2UI.d.ts.map +1 -0
  68. package/out/natural/{transformTS2UI.js → old/parser/transformTS2UI.js} +13 -14
  69. package/out/natural/old/parser/transformTS2UI.js.map +1 -0
  70. package/out/natural/{transformTSCode.d.ts → old/parser/transformTSCode.d.ts} +1 -1
  71. package/out/natural/old/parser/transformTSCode.d.ts.map +1 -0
  72. package/out/natural/{transformTSCode.js → old/parser/transformTSCode.js} +32 -8
  73. package/out/natural/old/parser/transformTSCode.js.map +1 -0
  74. package/out/natural/{tools.d.ts → old/tools.d.ts} +0 -4
  75. package/out/natural/old/tools.d.ts.map +1 -0
  76. package/out/natural/{tools.js → old/tools.js} +7 -25
  77. package/out/natural/old/tools.js.map +1 -0
  78. package/out/natural/{parseNaturalTS.d.ts → parser/parseNaturalTS.d.ts} +9 -2
  79. package/out/natural/parser/parseNaturalTS.d.ts.map +1 -0
  80. package/out/natural/{parseNaturalTS.js → parser/parseNaturalTS.js} +119 -38
  81. package/out/natural/parser/parseNaturalTS.js.map +1 -0
  82. package/out/natural/{parseNaturalTSXView.d.ts → parser/parseNaturalTSXView.d.ts} +1 -2
  83. package/out/natural/parser/parseNaturalTSXView.d.ts.map +1 -0
  84. package/out/natural/{parseNaturalTSXView.js → parser/parseNaturalTSXView.js} +181 -139
  85. package/out/natural/parser/parseNaturalTSXView.js.map +1 -0
  86. package/out/natural/transforms/checker/checkDataQueryCalleeNameOrder.d.ts +7 -0
  87. package/out/natural/transforms/checker/checkDataQueryCalleeNameOrder.d.ts.map +1 -0
  88. package/out/natural/transforms/checker/checkDataQueryCalleeNameOrder.js +38 -0
  89. package/out/natural/transforms/checker/checkDataQueryCalleeNameOrder.js.map +1 -0
  90. package/out/natural/transforms/checker/checkDefaultValue.d.ts +14 -0
  91. package/out/natural/transforms/checker/checkDefaultValue.d.ts.map +1 -0
  92. package/out/natural/transforms/checker/checkDefaultValue.js +39 -0
  93. package/out/natural/transforms/checker/checkDefaultValue.js.map +1 -0
  94. package/out/natural/transforms/checker/checkLcapEntity.d.ts +16 -0
  95. package/out/natural/transforms/checker/checkLcapEntity.d.ts.map +1 -0
  96. package/out/natural/transforms/checker/checkLcapEntity.js +337 -0
  97. package/out/natural/transforms/checker/checkLcapEntity.js.map +1 -0
  98. package/out/natural/transforms/checker/checkValidationCalleeName.d.ts +3 -0
  99. package/out/natural/transforms/checker/checkValidationCalleeName.d.ts.map +1 -0
  100. package/out/natural/transforms/checker/checkValidationCalleeName.js +88 -0
  101. package/out/natural/transforms/checker/checkValidationCalleeName.js.map +1 -0
  102. package/out/natural/transforms/checker/checkViewElement.d.ts +29 -0
  103. package/out/natural/transforms/checker/checkViewElement.d.ts.map +1 -0
  104. package/out/natural/transforms/checker/checkViewElement.js +618 -0
  105. package/out/natural/transforms/checker/checkViewElement.js.map +1 -0
  106. package/out/natural/transforms/checker/index.d.ts +19 -0
  107. package/out/natural/transforms/checker/index.d.ts.map +1 -0
  108. package/out/natural/transforms/checker/index.js +30 -0
  109. package/out/natural/transforms/checker/index.js.map +1 -0
  110. package/out/natural/transforms/transform2Entity.d.ts +13 -1
  111. package/out/natural/transforms/transform2Entity.d.ts.map +1 -1
  112. package/out/natural/transforms/transform2Entity.js +172 -17
  113. package/out/natural/transforms/transform2Entity.js.map +1 -1
  114. package/out/natural/transforms/transform2Enum.d.ts +1 -1
  115. package/out/natural/transforms/transform2Enum.d.ts.map +1 -1
  116. package/out/natural/transforms/transform2Enum.js +5 -1
  117. package/out/natural/transforms/transform2Enum.js.map +1 -1
  118. package/out/natural/transforms/transform2GlobalLogicDeclaration.d.ts +2 -2
  119. package/out/natural/transforms/transform2GlobalLogicDeclaration.d.ts.map +1 -1
  120. package/out/natural/transforms/transform2GlobalLogicDeclaration.js +18 -4
  121. package/out/natural/transforms/transform2GlobalLogicDeclaration.js.map +1 -1
  122. package/out/natural/transforms/transform2Logic.d.ts +4 -4
  123. package/out/natural/transforms/transform2Logic.d.ts.map +1 -1
  124. package/out/natural/transforms/transform2Logic.js +58 -17
  125. package/out/natural/transforms/transform2Logic.js.map +1 -1
  126. package/out/natural/transforms/transform2LogicItem.d.ts +11 -4
  127. package/out/natural/transforms/transform2LogicItem.d.ts.map +1 -1
  128. package/out/natural/transforms/transform2LogicItem.js +279 -178
  129. package/out/natural/transforms/transform2LogicItem.js.map +1 -1
  130. package/out/natural/transforms/transform2MetadataType.d.ts +1 -1
  131. package/out/natural/transforms/transform2MetadataType.d.ts.map +1 -1
  132. package/out/natural/transforms/transform2MetadataType.js +1 -1
  133. package/out/natural/transforms/transform2MetadataType.js.map +1 -1
  134. package/out/natural/transforms/transform2Param.d.ts +4 -0
  135. package/out/natural/transforms/transform2Param.d.ts.map +1 -0
  136. package/out/natural/transforms/transform2Param.js +114 -0
  137. package/out/natural/transforms/transform2Param.js.map +1 -0
  138. package/out/natural/transforms/transform2Structure.d.ts +1 -1
  139. package/out/natural/transforms/transform2Structure.d.ts.map +1 -1
  140. package/out/natural/transforms/transform2Structure.js +13 -2
  141. package/out/natural/transforms/transform2Structure.js.map +1 -1
  142. package/out/natural/transforms/transform2TypeAnnotation.d.ts +1 -1
  143. package/out/natural/transforms/transform2TypeAnnotation.d.ts.map +1 -1
  144. package/out/natural/transforms/transform2TypeAnnotation.js +3 -3
  145. package/out/natural/transforms/transform2TypeAnnotation.js.map +1 -1
  146. package/out/natural/transforms/transform2ValidationRule.d.ts +2 -2
  147. package/out/natural/transforms/transform2ValidationRule.d.ts.map +1 -1
  148. package/out/natural/transforms/transform2ValidationRule.js +6 -1
  149. package/out/natural/transforms/transform2ValidationRule.js.map +1 -1
  150. package/out/natural/transforms/transform2Variable.d.ts +4 -3
  151. package/out/natural/transforms/transform2Variable.d.ts.map +1 -1
  152. package/out/natural/transforms/transform2Variable.js +57 -6
  153. package/out/natural/transforms/transform2Variable.js.map +1 -1
  154. package/out/natural/transforms/transformThemeAndStyle.d.ts +5 -2
  155. package/out/natural/transforms/transformThemeAndStyle.d.ts.map +1 -1
  156. package/out/natural/transforms/transformThemeAndStyle.js +26 -13
  157. package/out/natural/transforms/transformThemeAndStyle.js.map +1 -1
  158. package/out/natural/transforms/utils/createComponentLookupMap.d.ts +32 -0
  159. package/out/natural/transforms/utils/createComponentLookupMap.d.ts.map +1 -0
  160. package/out/natural/transforms/utils/createComponentLookupMap.js +57 -0
  161. package/out/natural/transforms/utils/createComponentLookupMap.js.map +1 -0
  162. package/out/natural/transforms/utils/iconNames.d.ts +2 -0
  163. package/out/natural/transforms/utils/iconNames.d.ts.map +1 -0
  164. package/out/natural/transforms/utils/iconNames.js +299 -0
  165. package/out/natural/transforms/utils/iconNames.js.map +1 -0
  166. package/out/natural/transforms/utils/misc.d.ts +16 -0
  167. package/out/natural/transforms/utils/misc.d.ts.map +1 -0
  168. package/out/natural/transforms/utils/misc.js +240 -0
  169. package/out/natural/transforms/utils/misc.js.map +1 -0
  170. package/out/natural/transforms/utils/normalizeNode.d.ts +3 -0
  171. package/out/natural/transforms/utils/normalizeNode.d.ts.map +1 -0
  172. package/out/natural/transforms/utils/normalizeNode.js +15 -0
  173. package/out/natural/transforms/utils/normalizeNode.js.map +1 -0
  174. package/out/natural/transforms/utils/parseDecorator.d.ts +74 -0
  175. package/out/natural/transforms/utils/parseDecorator.d.ts.map +1 -0
  176. package/out/natural/transforms/utils/parseDecorator.js +252 -0
  177. package/out/natural/transforms/utils/parseDecorator.js.map +1 -0
  178. package/out/natural/transforms/utils/transform2Directory.d.ts +59 -0
  179. package/out/natural/transforms/utils/transform2Directory.d.ts.map +1 -0
  180. package/out/natural/transforms/utils/transform2Directory.js +229 -0
  181. package/out/natural/transforms/utils/transform2Directory.js.map +1 -0
  182. package/out/natural/{transforms/utils.d.ts → utils/index.d.ts} +35 -18
  183. package/out/natural/utils/index.d.ts.map +1 -0
  184. package/out/natural/utils/index.js +206 -0
  185. package/out/natural/utils/index.js.map +1 -0
  186. package/out/natural/utils/nasl-file-types.d.ts +45 -0
  187. package/out/natural/utils/nasl-file-types.d.ts.map +1 -0
  188. package/out/natural/utils/nasl-file-types.js +131 -0
  189. package/out/natural/utils/nasl-file-types.js.map +1 -0
  190. package/out/server/OQL/sqlDbTypes.json +717 -0
  191. package/out/server/createUiTs.d.ts +0 -1
  192. package/out/server/createUiTs.d.ts.map +1 -1
  193. package/out/server/createUiTs.js +1 -118
  194. package/out/server/createUiTs.js.map +1 -1
  195. package/out/server/extendBaseNode.d.ts.map +1 -1
  196. package/out/server/extendBaseNode.js +17 -0
  197. package/out/server/extendBaseNode.js.map +1 -1
  198. package/out/server/findReference.js +1 -1
  199. package/out/server/findReference.js.map +1 -1
  200. package/out/server/naslServer.d.ts +0 -1
  201. package/out/server/naslServer.d.ts.map +1 -1
  202. package/out/server/naslServer.js +66 -55
  203. package/out/server/naslServer.js.map +1 -1
  204. package/out/server/translator.js.map +1 -1
  205. package/out/service/autofix/rules/rule-convert-incompatible-assignment-to-union.js.map +1 -1
  206. package/out/service/creator/add.configs.js +1 -1
  207. package/out/service/creator/add.configs.js.map +1 -1
  208. package/out/service/storage/init.d.ts +1 -1
  209. package/out/service/storage/init.d.ts.map +1 -1
  210. package/out/service/storage/init.js +26 -9
  211. package/out/service/storage/init.js.map +1 -1
  212. package/out/service/storage/specTools.d.ts +20 -8
  213. package/out/service/storage/specTools.d.ts.map +1 -1
  214. package/out/service/storage/specTools.js +157 -5
  215. package/out/service/storage/specTools.js.map +1 -1
  216. package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.d.ts +4 -0
  217. package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.d.ts.map +1 -1
  218. package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.js +20 -1
  219. package/out/templator/block2nasl/jsx2nasl/transform-func2nasl.js.map +1 -1
  220. package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.d.ts.map +1 -1
  221. package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.js +28 -1
  222. package/out/templator/block2nasl/jsx2nasl/transform-tsx2nasl.js.map +1 -1
  223. package/out/templator/block2nasl/transformBlock2Nasl.js +2 -2
  224. package/out/templator/block2nasl/transformBlock2Nasl.js.map +1 -1
  225. package/out/templator/block2nasl/viewMergeBlock.js +3 -2
  226. package/out/templator/block2nasl/viewMergeBlock.js.map +1 -1
  227. package/out/utils/can-i-use.d.ts.map +1 -1
  228. package/out/utils/can-i-use.js +1 -0
  229. package/out/utils/can-i-use.js.map +1 -1
  230. package/package.json +9 -9
  231. package/sandbox/stdlib/nasl.core.ts +2 -0
  232. package/sandbox/stdlib/nasl.io.ts +1 -1
  233. package/sandbox/stdlib/nasl.oql.ts +2 -0
  234. package/sandbox/stdlib/nasl.util.ts +1 -1
  235. package/sandbox/stdlib/nasl.validation.ts +50 -14
  236. package/out/natural/genNaturalTS.d.ts.map +0 -1
  237. package/out/natural/genNaturalTS.js.map +0 -1
  238. package/out/natural/genTextualNASL.d.ts.map +0 -1
  239. package/out/natural/genTextualNASL.js.map +0 -1
  240. package/out/natural/getContext/getUILib.d.ts.map +0 -1
  241. package/out/natural/getContext/getUILib.js.map +0 -1
  242. package/out/natural/getContext/index.d.ts.map +0 -1
  243. package/out/natural/getContext/index.js.map +0 -1
  244. package/out/natural/getContext/nasl2Files.d.ts +0 -15
  245. package/out/natural/getContext/nasl2Files.d.ts.map +0 -1
  246. package/out/natural/getContext/nasl2Files.js +0 -75
  247. package/out/natural/getContext/nasl2Files.js.map +0 -1
  248. package/out/natural/getContext/naslStdlibMap.d.ts.map +0 -1
  249. package/out/natural/getContext/naslStdlibMap.js.map +0 -1
  250. package/out/natural/parseNaturalTS.d.ts.map +0 -1
  251. package/out/natural/parseNaturalTS.js.map +0 -1
  252. package/out/natural/parseNaturalTSXView.d.ts.map +0 -1
  253. package/out/natural/parseNaturalTSXView.js.map +0 -1
  254. package/out/natural/tools.d.ts.map +0 -1
  255. package/out/natural/tools.js.map +0 -1
  256. package/out/natural/transform2BatchActions.d.ts.map +0 -1
  257. package/out/natural/transform2BatchActions.js +0 -387
  258. package/out/natural/transform2BatchActions.js.map +0 -1
  259. package/out/natural/transformTS2UI.d.ts.map +0 -1
  260. package/out/natural/transformTS2UI.js.map +0 -1
  261. package/out/natural/transformTSCode.d.ts.map +0 -1
  262. package/out/natural/transformTSCode.js.map +0 -1
  263. package/out/natural/transforms/utils.d.ts.map +0 -1
  264. package/out/natural/transforms/utils.js +0 -407
  265. package/out/natural/transforms/utils.js.map +0 -1
  266. /package/out/natural/{genTextualNASL.d.ts → old/getContext/genTextualNASL.d.ts} +0 -0
  267. /package/out/natural/{genTextualNASL.js → old/getContext/genTextualNASL.js} +0 -0
  268. /package/out/natural/{getContext → old/getContext}/naslStdlibMap.d.ts +0 -0
@@ -0,0 +1,74 @@
1
+ import { babelTypes, naslTypes, type ParseNaturalTSState } from '../../utils';
2
+ /**
3
+ * 从装饰器对象表达式中提取指定的属性
4
+ */
5
+ export declare function pickDecoratorObject(objectExpression: babelTypes.ObjectExpression, keys: Set<string>, mappings: Record<string, string>, parseState: ParseNaturalTSState): Record<string, any>;
6
+ /**
7
+ * 装饰器处理器配置接口
8
+ */
9
+ export interface DecoratorHandler<K extends string = never> {
10
+ name: string;
11
+ allowedKeys?: Set<K>;
12
+ mappings?: {
13
+ [Key in K]?: string;
14
+ };
15
+ customHandler?: (decorator: babelTypes.Decorator, target: naslTypes.BaseNode, parseState: ParseNaturalTSState) => void;
16
+ }
17
+ /**
18
+ * Entity 装饰器处理器配置
19
+ */
20
+ export declare const ENTITY_DECORATOR: DecoratorHandler<'title' | 'uuid' | 'tableName' | 'origin' | 'directory'>;
21
+ /**
22
+ * EntityProperty 装饰器处理器配置
23
+ */
24
+ export declare const ENTITY_PROPERTY_DECORATOR: DecoratorHandler<'title' | 'description' | 'uuid' | 'columnName' | 'required' | 'primaryKey' | 'dbType' | 'rules' | 'generationRule' | 'sequence'>;
25
+ /**
26
+ * EntityRelation 装饰器处理器配置(特殊处理)
27
+ */
28
+ export declare const ENTITY_RELATION_DECORATOR: DecoratorHandler;
29
+ /**
30
+ * Enum 装饰器处理器配置
31
+ */
32
+ export declare const ENUM_DECORATOR: DecoratorHandler<'title' | 'description' | 'directory'>;
33
+ /**
34
+ * Structure 装饰器处理器配置
35
+ */
36
+ export declare const STRUCTURE_DECORATOR: DecoratorHandler<'title' | 'directory'>;
37
+ /**
38
+ * Logic 装饰器处理器配置(服务端全局逻辑)
39
+ */
40
+ export declare const LOGIC_DECORATOR: DecoratorHandler<'description' | 'transactional' | 'directory'>;
41
+ /**
42
+ * Logic 装饰器处理器配置(View 中的前端逻辑)
43
+ */
44
+ export declare const VIEW_LOGIC_DECORATOR: DecoratorHandler<'description' | 'directory'>;
45
+ /**
46
+ * Variable 装饰器处理器配置(普通变量)
47
+ */
48
+ export declare const VARIABLE_DECORATOR: DecoratorHandler<'description' | 'autoInferType'>;
49
+ /**
50
+ * BackendVariable 装饰器处理器配置(后端全局变量)
51
+ */
52
+ export declare const BACKEND_VARIABLE_DECORATOR: DecoratorHandler<'description'>;
53
+ /**
54
+ * FrontendVariable 装饰器处理器配置(前端全局变量)
55
+ */
56
+ export declare const FRONTEND_VARIABLE_DECORATOR: DecoratorHandler<'description' | 'localStorage'>;
57
+ /**
58
+ * Variable 装饰器处理器配置(View 中的变量)
59
+ */
60
+ export declare const VIEW_VARIABLE_DECORATOR: DecoratorHandler<'description' | 'directory' | 'autoInferType'>;
61
+ /**
62
+ * StructureProperty 装饰器处理器配置
63
+ */
64
+ export declare const STRUCTURE_PROPERTY_DECORATOR: DecoratorHandler<'title' | 'description' | 'jsonName'>;
65
+ /**
66
+ * Return 装饰器处理器配置(Logic 中的返回变量)
67
+ */
68
+ export declare const RETURN_DECORATOR: DecoratorHandler<'description' | 'autoInferType'>;
69
+ /**
70
+ * 统一的装饰器处理函数
71
+ * 根据配置的处理器列表处理所有装饰器
72
+ */
73
+ export declare function processDecoratorsByConfig(decorators: babelTypes.Decorator[] | undefined, handlers: DecoratorHandler<string>[], target: naslTypes.BaseNode, parseState: ParseNaturalTSState): void;
74
+ //# sourceMappingURL=parseDecorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseDecorator.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EF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,CAAC,OAAO,GAAG,WAAW,CAMvE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,gBAAgB,CAAC,aAAa,GAAG,eAAe,GAAG,WAAW,CAG3F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,gBAAgB,CAAC,aAAa,GAAG,WAAW,CAG9E,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,CAAC,aAAa,GAAG,eAAe,CAGhF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,gBAAgB,CAAC,aAAa,CAGtE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,gBAAgB,CAAC,aAAa,GAAG,cAAc,CAMxF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,gBAAgB,CAAC,aAAa,GAAG,WAAW,GAAG,eAAe,CAGnG,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,4BAA4B,EAAE,gBAAgB,CAAC,OAAO,GAAG,aAAa,GAAG,UAAU,CAM/F,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,aAAa,GAAG,eAAe,CAG9E,CAAC;AAEF;;;GAGG;AACH,wBAAgB,yBAAyB,CACrC,UAAU,EAAE,UAAU,CAAC,SAAS,EAAE,GAAG,SAAS,EAC9C,QAAQ,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAAE,EACpC,MAAM,EAAE,SAAS,CAAC,QAAQ,EAC1B,UAAU,EAAE,mBAAmB,GAChC,IAAI,CAmCN"}
@@ -0,0 +1,252 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.processDecoratorsByConfig = exports.RETURN_DECORATOR = exports.STRUCTURE_PROPERTY_DECORATOR = exports.VIEW_VARIABLE_DECORATOR = exports.FRONTEND_VARIABLE_DECORATOR = exports.BACKEND_VARIABLE_DECORATOR = exports.VARIABLE_DECORATOR = exports.VIEW_LOGIC_DECORATOR = exports.LOGIC_DECORATOR = exports.STRUCTURE_DECORATOR = exports.ENUM_DECORATOR = exports.ENTITY_RELATION_DECORATOR = exports.ENTITY_PROPERTY_DECORATOR = exports.ENTITY_DECORATOR = exports.pickDecoratorObject = void 0;
4
+ const utils_1 = require("../../utils");
5
+ const transform2Entity_1 = require("../transform2Entity");
6
+ const transform2Directory_1 = require("./transform2Directory");
7
+ /**
8
+ * 从装饰器对象表达式中提取指定的属性
9
+ */
10
+ function pickDecoratorObject(objectExpression, keys, mappings, parseState) {
11
+ mappings = mappings || {};
12
+ const result = {};
13
+ objectExpression.properties.forEach((item) => {
14
+ if (item.type === 'ObjectProperty' && item.key.type === 'Identifier' && keys.has(item.key.name)) {
15
+ let value;
16
+ if (item.value.type === 'NullLiteral') {
17
+ value = null;
18
+ }
19
+ else if (item.value.type === 'BooleanLiteral') {
20
+ value = item.value.value;
21
+ }
22
+ else if (item.value.type === 'StringLiteral') {
23
+ // directory 字段需要特殊处理
24
+ if (item.key.name === 'directory') {
25
+ const directoryInfo = (0, transform2Directory_1.parseDirectoryValue)(item.value.value, parseState);
26
+ value = directoryInfo;
27
+ }
28
+ else {
29
+ value = item.value.value;
30
+ }
31
+ }
32
+ else if (item.value.type === 'NumericLiteral') {
33
+ value = item.value.value;
34
+ }
35
+ else if (item.key.name === 'dbType') {
36
+ if (item.value.type === 'Identifier' || item.value.type === 'CallExpression') {
37
+ value = (0, transform2Entity_1.transform2DatabaseTypeAnnotation)(item.value, parseState);
38
+ }
39
+ else {
40
+ return (0, utils_1.throwError)(parseState, '不支持的 dbType 类型:' + (0, utils_1.generate)(item).code);
41
+ }
42
+ }
43
+ else if (item.key.name === 'rules') {
44
+ if (item.value.type === 'ArrayExpression') {
45
+ value = (0, transform2Entity_1.transform2ValidationRules)(item.value, parseState);
46
+ }
47
+ else {
48
+ return (0, utils_1.throwError)(parseState, '不支持的 rules 类型,应为调用表达式数组(如 [min(0), max(100)]):' + (0, utils_1.generate)(item).code);
49
+ }
50
+ }
51
+ else {
52
+ return (0, utils_1.throwError)(parseState, '不支持的装饰器对象属性值:' + (0, utils_1.generate)(item).code);
53
+ }
54
+ const propStr = mappings[item.key.name] || item.key.name;
55
+ result[propStr] = value;
56
+ }
57
+ else {
58
+ return (0, utils_1.throwError)(parseState, '不支持的装饰器对象属性:' + (0, utils_1.generate)(item).code);
59
+ }
60
+ });
61
+ return result;
62
+ }
63
+ exports.pickDecoratorObject = pickDecoratorObject;
64
+ /**
65
+ * Entity 装饰器处理器配置
66
+ */
67
+ exports.ENTITY_DECORATOR = {
68
+ name: 'Entity',
69
+ allowedKeys: new Set(['title', 'uuid', 'tableName', 'origin', 'directory']),
70
+ mappings: {
71
+ title: 'description',
72
+ },
73
+ };
74
+ /**
75
+ * EntityProperty 装饰器处理器配置
76
+ */
77
+ exports.ENTITY_PROPERTY_DECORATOR = {
78
+ name: 'EntityProperty',
79
+ allowedKeys: new Set([
80
+ 'title',
81
+ 'description',
82
+ 'uuid',
83
+ 'columnName',
84
+ 'required',
85
+ 'primaryKey',
86
+ 'dbType',
87
+ 'rules',
88
+ 'generationRule',
89
+ 'sequence',
90
+ ]),
91
+ mappings: {
92
+ title: 'label',
93
+ dbType: 'databaseTypeAnnotation',
94
+ },
95
+ };
96
+ /**
97
+ * EntityRelation 装饰器处理器配置(特殊处理)
98
+ */
99
+ exports.ENTITY_RELATION_DECORATOR = {
100
+ name: 'EntityRelation',
101
+ customHandler: (decorator, property, parseState) => {
102
+ const decoratorExpression = decorator.expression;
103
+ if (decoratorExpression.type === 'CallExpression') {
104
+ const decoratorsNode = decoratorExpression.typeParameters;
105
+ if (decoratorsNode.params && decoratorsNode.params[0].type === 'TSIndexedAccessType') {
106
+ const releationNode = decoratorsNode.params[0];
107
+ const relationProperty = (0, utils_1.generate)(releationNode.indexType).code || '';
108
+ const objectTypeName = releationNode.objectType.typeName;
109
+ const relationEntity = (0, utils_1.generate)(objectTypeName.right).code || '';
110
+ const relationNamespace = (0, utils_1.generate)(objectTypeName.left).code || '';
111
+ property.relationNamespace = relationNamespace;
112
+ property.relationEntity = relationEntity;
113
+ property.relationProperty = relationProperty.replace(/[']/g, '');
114
+ }
115
+ const arg = decoratorExpression.arguments[0];
116
+ if (arg && arg.type === 'StringLiteral') {
117
+ property.deleteRule = arg.value.toLowerCase();
118
+ }
119
+ else {
120
+ property.deleteRule = 'protect';
121
+ }
122
+ }
123
+ else {
124
+ (0, utils_1.throwError)(parseState, 'EntityRelation 不支持这种装饰器写法', decorator);
125
+ }
126
+ },
127
+ };
128
+ /**
129
+ * Enum 装饰器处理器配置
130
+ */
131
+ exports.ENUM_DECORATOR = {
132
+ name: 'Enum',
133
+ allowedKeys: new Set(['title', 'description', 'directory']),
134
+ mappings: {
135
+ title: 'description',
136
+ },
137
+ };
138
+ /**
139
+ * Structure 装饰器处理器配置
140
+ */
141
+ exports.STRUCTURE_DECORATOR = {
142
+ name: 'Structure',
143
+ allowedKeys: new Set(['title', 'directory']),
144
+ mappings: {
145
+ title: 'description',
146
+ },
147
+ };
148
+ /**
149
+ * Logic 装饰器处理器配置(服务端全局逻辑)
150
+ */
151
+ exports.LOGIC_DECORATOR = {
152
+ name: 'Logic',
153
+ allowedKeys: new Set(['description', 'transactional', 'directory']),
154
+ };
155
+ /**
156
+ * Logic 装饰器处理器配置(View 中的前端逻辑)
157
+ */
158
+ exports.VIEW_LOGIC_DECORATOR = {
159
+ name: 'Logic',
160
+ allowedKeys: new Set(['description', 'directory']),
161
+ };
162
+ /**
163
+ * Variable 装饰器处理器配置(普通变量)
164
+ */
165
+ exports.VARIABLE_DECORATOR = {
166
+ name: 'Variable',
167
+ allowedKeys: new Set(['description', 'autoInferType']),
168
+ };
169
+ /**
170
+ * BackendVariable 装饰器处理器配置(后端全局变量)
171
+ */
172
+ exports.BACKEND_VARIABLE_DECORATOR = {
173
+ name: 'BackendVariable',
174
+ allowedKeys: new Set(['description']),
175
+ };
176
+ /**
177
+ * FrontendVariable 装饰器处理器配置(前端全局变量)
178
+ */
179
+ exports.FRONTEND_VARIABLE_DECORATOR = {
180
+ name: 'FrontendVariable',
181
+ allowedKeys: new Set(['description', 'localStorage']),
182
+ mappings: {
183
+ localStorage: 'localCache',
184
+ },
185
+ };
186
+ /**
187
+ * Variable 装饰器处理器配置(View 中的变量)
188
+ */
189
+ exports.VIEW_VARIABLE_DECORATOR = {
190
+ name: 'Variable',
191
+ allowedKeys: new Set(['description', 'directory', 'autoInferType']),
192
+ };
193
+ /**
194
+ * StructureProperty 装饰器处理器配置
195
+ */
196
+ exports.STRUCTURE_PROPERTY_DECORATOR = {
197
+ name: 'StructureProperty',
198
+ allowedKeys: new Set(['title', 'description', 'jsonName']),
199
+ mappings: {
200
+ title: 'label',
201
+ },
202
+ };
203
+ /**
204
+ * Return 装饰器处理器配置(Logic 中的返回变量)
205
+ */
206
+ exports.RETURN_DECORATOR = {
207
+ name: 'Return',
208
+ allowedKeys: new Set(['description', 'autoInferType']),
209
+ };
210
+ /**
211
+ * 统一的装饰器处理函数
212
+ * 根据配置的处理器列表处理所有装饰器
213
+ */
214
+ function processDecoratorsByConfig(decorators, handlers, target, parseState) {
215
+ if (!decorators || decorators.length === 0)
216
+ return;
217
+ decorators.forEach((decorator) => {
218
+ handlers.forEach((handler) => {
219
+ const decoratorExpression = decorator.expression;
220
+ // 检查是否匹配当前处理器
221
+ if (decoratorExpression.type === 'CallExpression' &&
222
+ decoratorExpression.callee.type === 'Identifier' &&
223
+ decoratorExpression.callee.name === handler.name) {
224
+ // 优先使用自定义处理器
225
+ if (handler.customHandler) {
226
+ handler.customHandler(decorator, target, parseState);
227
+ }
228
+ else if (handler.allowedKeys) { // 使用通用属性提取逻辑
229
+ const decoratorArgs = decoratorExpression.arguments[0];
230
+ if (decoratorArgs) {
231
+ if (decoratorArgs.type === 'ObjectExpression') {
232
+ const decoratorProps = pickDecoratorObject(decoratorArgs, handler.allowedKeys, handler.mappings, parseState);
233
+ Object.keys(decoratorProps).forEach(key => {
234
+ if (decoratorProps[key] !== undefined) {
235
+ // directory 属性使用临时属性名,避免与只读 getter 冲突
236
+ const propName = key === 'directory' ? '_directoryInfo' : key;
237
+ target[propName] = decoratorProps[key];
238
+ }
239
+ });
240
+ }
241
+ else {
242
+ (0, utils_1.throwError)(parseState, '不支持的装饰器参数形式,应该使用对象表达式', decoratorArgs);
243
+ }
244
+ }
245
+ }
246
+ }
247
+ // ignore other decorators
248
+ });
249
+ });
250
+ }
251
+ exports.processDecoratorsByConfig = processDecoratorsByConfig;
252
+ //# sourceMappingURL=parseDecorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseDecorator.js","sourceRoot":"","sources":["../../../../src/natural/transforms/utils/parseDecorator.ts"],"names":[],"mappings":";;;AAAA,uCAAoG;AACpG,0DAAkG;AAClG,+DAA4D;AAE5D;;GAEG;AACH,SAAgB,mBAAmB,CAAC,gBAA6C,EAAE,IAAiB,EAAE,QAAgC,EAAE,UAA+B;IACrK,QAAQ,GAAG,QAAQ,IAAI,EAAE,CAAC;IAC1B,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC3C,IAAI,IAAI,CAAC,IAAI,KAAK,gBAAgB,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,YAAY,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAChG,IAAI,KAAU,CAAC;YACf,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,aAAa,EAAE,CAAC;gBACtC,KAAK,GAAG,IAAI,CAAC;YACf,CAAC;iBAAM,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,gBAAgB,EAAE,CAAC;gBAChD,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,KA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AAO,CAAC,aAAa,EAAE,CAAC;oBACxB,OAAO,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;gBACzD,CAAC;qBAAM,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC,aAAa;oBAC3C,MAAM,aAAa,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;oBACvD,IAAI,aAAa,EAAE,CAAC;wBAChB,IAAI,aAAa,CAAC,IAAI,KAAK,kBAAkB,EAAE,CAAC;4BAC5C,MAAM,cAAc,GAAG,mBAAmB,CAAC,aAAa,EAAE,OAAO,CAAC,WAAW,EAAE,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;4BAC7G,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;gCACtC,IAAI,cAAc,CAAC,GAAG,CAAC,KAAK,SAAS,EAAE,CAAC;oCACpC,sCAAsC;oCACtC,MAAM,QAAQ,GAAG,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC;oCAC7D,MAAc,CAAC,QAAQ,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC;gCACpD,CAAC;4BACL,CAAC,CAAC,CAAC;wBACP,CAAC;6BAAM,CAAC;4BACJ,IAAA,kBAAU,EAAC,UAAU,EAAE,uBAAuB,EAAE,aAAa,CAAC,CAAC;wBACnE,CAAC;oBACL,CAAC;gBACL,CAAC;YACL,CAAC;YACD,0BAA0B;QAC9B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC;AAxCD,8DAwCC"}
@@ -0,0 +1,59 @@
1
+ import { naslTypes, type ParseNaturalTSState } from '../../utils';
2
+ /**
3
+ * 解析的目录信息
4
+ */
5
+ export interface DirectoryInfo {
6
+ name: string;
7
+ title?: string;
8
+ }
9
+ /**
10
+ * 目录范围类型,根据装饰器名称决定
11
+ */
12
+ export type DirectoryScope = 'Logic' | 'Enum' | 'Structure' | 'Entity' | 'View';
13
+ /**
14
+ * 从字符串解析目录信息
15
+ * 支持格式:
16
+ * - name(title) - 包含标题的格式
17
+ * - name - 纯名称格式
18
+ *
19
+ * name 必须以小写字母开头,由小写字母、数字或下划线组成
20
+ *
21
+ * @param directoryValue - 目录字符串值
22
+ * @param parseState - 解析状态
23
+ * @returns 解析后的目录信息
24
+ */
25
+ export declare function parseDirectoryValue(directoryValue: string, parseState: ParseNaturalTSState): DirectoryInfo;
26
+ /**
27
+ * 根据装饰器名称获取目录范围
28
+ * @param decoratorName - 装饰器名称(Logic、Enum、Structure、Entity)
29
+ * @returns 目录范围
30
+ */
31
+ export declare function getDirectoryScopeFromDecorator(decoratorName: string): DirectoryScope;
32
+ /**
33
+ * 查找或创建目录(统一方法)
34
+ * 根据 directory 信息和范围类型,在对应的父节点中查找或创建目录
35
+ *
36
+ * @param appOrView - NASL 应用实例或 View 实例
37
+ * @param directoryInfo - 目录信息
38
+ * @param scope - 目录范围(Logic、Enum、Structure、Entity、View)
39
+ * @returns 找到或创建的目录实例
40
+ */
41
+ export declare function findOrCreateDirectory(appOrView: naslTypes.App | naslTypes.View, directoryInfo: DirectoryInfo, scope: DirectoryScope): naslTypes.Directory;
42
+ /**
43
+ * 将节点添加到指定目录(统一方法)
44
+ * @param directory - 目标目录
45
+ * @param node - 要添加的节点
46
+ * @param scope - 目录范围,用于确定正确的 namespace
47
+ * @param dataSourceName - 数据源名称(仅 Entity 类型需要)
48
+ */
49
+ export declare function addNodeToDirectory(directory: naslTypes.Directory, node: naslTypes.Entity | naslTypes.Logic | naslTypes.Enum | naslTypes.Structure | naslTypes.Variable, scope: DirectoryScope, dataSourceName?: string): void;
50
+ /**
51
+ * 处理节点的 directory 信息(统一方法)
52
+ * 如果节点有 _directoryInfo 临时属性,则在对应的父目录中创建或查找目录,并添加引用
53
+ *
54
+ * @param appOrView - NASL 应用实例或 View 实例
55
+ * @param node - 要处理的节点
56
+ * @param scope - 目录范围(Logic、Enum、Structure、Entity、View)
57
+ */
58
+ export declare function handleDirectory(appOrView: naslTypes.App | naslTypes.View, node: naslTypes.Entity | naslTypes.Logic | naslTypes.Enum | naslTypes.Structure | naslTypes.Variable, scope: DirectoryScope): void;
59
+ //# sourceMappingURL=transform2Directory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform2Directory.d.ts","sourceRoot":"","sources":["../../../../src/natural/transforms/utils/transform2Directory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAc,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEhF;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,mBAAmB,GAC9B,aAAa,CAyBf;AAED;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc,CAMpF;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,SAAS,CAAC,GAAG,GAAG,SAAS,CAAC,IAAI,EACzC,aAAa,EAAE,aAAa,EAC5B,KAAK,EAAE,cAAc,GACpB,SAAS,CAAC,SAAS,CAiGrB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,SAAS,EAAE,SAAS,CAAC,SAAS,EAC9B,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,QAAQ,EACpG,KAAK,EAAE,cAAc,EACrB,cAAc,CAAC,EAAE,MAAM,GACtB,IAAI,CA2CN;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,SAAS,CAAC,GAAG,GAAG,SAAS,CAAC,IAAI,EACzC,IAAI,EAAE,SAAS,CAAC,MAAM,GAAG,SAAS,CAAC,KAAK,GAAG,SAAS,CAAC,IAAI,GAAG,SAAS,CAAC,SAAS,GAAG,SAAS,CAAC,QAAQ,EACpG,KAAK,EAAE,cAAc,GACpB,IAAI,CAeN"}
@@ -0,0 +1,229 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.handleDirectory = exports.addNodeToDirectory = exports.findOrCreateDirectory = exports.getDirectoryScopeFromDecorator = exports.parseDirectoryValue = void 0;
4
+ const utils_1 = require("../../utils");
5
+ /**
6
+ * 从字符串解析目录信息
7
+ * 支持格式:
8
+ * - name(title) - 包含标题的格式
9
+ * - name - 纯名称格式
10
+ *
11
+ * name 必须以小写字母开头,由小写字母、数字或下划线组成
12
+ *
13
+ * @param directoryValue - 目录字符串值
14
+ * @param parseState - 解析状态
15
+ * @returns 解析后的目录信息
16
+ */
17
+ function parseDirectoryValue(directoryValue, parseState) {
18
+ // 验证格式: name(title) 或 name
19
+ // name 必须以小写字母开头,由小写字母、数字或下划线组成
20
+ const nameRegex = /^[a-z][a-z0-9_]*$/;
21
+ const nameWithTitleRegex = /^([a-z][a-z0-9_]*)\((.+)\)$/;
22
+ let name;
23
+ let title;
24
+ // 尝试匹配 name(title) 格式
25
+ const matchWithTitle = directoryValue.match(nameWithTitleRegex);
26
+ if (matchWithTitle) {
27
+ name = matchWithTitle[1];
28
+ title = matchWithTitle[2];
29
+ }
30
+ else if (nameRegex.test(directoryValue)) {
31
+ // 匹配纯 name 格式
32
+ name = directoryValue;
33
+ }
34
+ else {
35
+ return (0, utils_1.throwError)(parseState, `directory 格式不正确:"${directoryValue}"。正确格式为 "name(title)" 或 "name",其中 name 必须以小写字母开头,由小写字母、数字或下划线组成`);
36
+ }
37
+ return { name, title };
38
+ }
39
+ exports.parseDirectoryValue = parseDirectoryValue;
40
+ /**
41
+ * 根据装饰器名称获取目录范围
42
+ * @param decoratorName - 装饰器名称(Logic、Enum、Structure、Entity)
43
+ * @returns 目录范围
44
+ */
45
+ function getDirectoryScopeFromDecorator(decoratorName) {
46
+ const validScopes = ['Logic', 'Enum', 'Structure', 'Entity'];
47
+ if (validScopes.includes(decoratorName)) {
48
+ return decoratorName;
49
+ }
50
+ throw new Error(`不支持的装饰器类型:${decoratorName}`);
51
+ }
52
+ exports.getDirectoryScopeFromDecorator = getDirectoryScopeFromDecorator;
53
+ /**
54
+ * 查找或创建目录(统一方法)
55
+ * 根据 directory 信息和范围类型,在对应的父节点中查找或创建目录
56
+ *
57
+ * @param appOrView - NASL 应用实例或 View 实例
58
+ * @param directoryInfo - 目录信息
59
+ * @param scope - 目录范围(Logic、Enum、Structure、Entity、View)
60
+ * @returns 找到或创建的目录实例
61
+ */
62
+ function findOrCreateDirectory(appOrView, directoryInfo, scope) {
63
+ let parentDirectories;
64
+ let parentNode;
65
+ let rootDirectoryName;
66
+ // 根据范围确定父目录列表和父节点
67
+ if (scope === 'View') {
68
+ // View:目录直接存储在 view.directories 中
69
+ const view = appOrView;
70
+ parentDirectories = view.directories || [];
71
+ parentNode = view;
72
+ }
73
+ else {
74
+ // App 类型的处理
75
+ const app = appOrView;
76
+ switch (scope) {
77
+ case 'Logic':
78
+ // 逻辑目录存储在 app.directories 中,需要找到名为 'LOGICS' 的目录
79
+ rootDirectoryName = 'LOGICS';
80
+ parentDirectories = app.directories.filter((dir) => dir.name === 'LOGICS');
81
+ parentNode = app;
82
+ break;
83
+ case 'Enum':
84
+ // 枚举目录存储在 app.directories 中,需要找到名为 'ENUMS' 的目录
85
+ rootDirectoryName = 'ENUMS';
86
+ parentDirectories = app.directories.filter((dir) => dir.name === 'ENUMS');
87
+ parentNode = app;
88
+ break;
89
+ case 'Structure':
90
+ // 结构目录存储在 app.directories 中,需要找到名为 'STRUCTURES' 的目录
91
+ rootDirectoryName = 'STRUCTURES';
92
+ parentDirectories = app.directories.filter((dir) => dir.name === 'STRUCTURES');
93
+ parentNode = app;
94
+ break;
95
+ case 'Entity':
96
+ // 实体目录存储在数据源的 directories 中
97
+ if (app.dataSources && app.dataSources.length > 0) {
98
+ parentDirectories = app.dataSources[0].directories || [];
99
+ parentNode = app.dataSources[0];
100
+ }
101
+ else {
102
+ throw new Error('找不到数据源,无法创建实体目录');
103
+ }
104
+ break;
105
+ default:
106
+ throw new Error(`不支持的目录范围:${scope}`);
107
+ }
108
+ // 如果没有找到根目录(Logic、Enum、Structure),使用 App 的 addDirectory 方法创建根目录
109
+ if (rootDirectoryName && parentDirectories.length === 0) {
110
+ const rootDirectory = app.addDirectory({
111
+ name: rootDirectoryName,
112
+ });
113
+ parentDirectories = [rootDirectory];
114
+ }
115
+ }
116
+ // 在父目录列表中查找匹配的目录
117
+ let targetDirectory;
118
+ if (scope === 'View' || scope === 'Entity') {
119
+ // View 和 Entity:直接在 parentDirectories 中查找
120
+ targetDirectory = parentDirectories.find((dir) => dir.name === directoryInfo.name);
121
+ }
122
+ else {
123
+ // Logic、Enum、Structure:在父目录的 children 中查找
124
+ for (const parent of parentDirectories) {
125
+ if (parent.children) {
126
+ targetDirectory = parent.children.find((child) => child.name === directoryInfo.name);
127
+ if (targetDirectory) {
128
+ break;
129
+ }
130
+ }
131
+ }
132
+ }
133
+ // 如果找不到,创建新目录
134
+ if (!targetDirectory) {
135
+ if (scope === 'View' || scope === 'Entity') {
136
+ // View 和 Entity:直接在父节点下创建
137
+ targetDirectory = parentNode.addDirectory({
138
+ name: directoryInfo.name,
139
+ title: directoryInfo.title,
140
+ });
141
+ }
142
+ else if (parentDirectories.length > 0) {
143
+ // Logic、Enum、Structure:在父目录的 children 中创建
144
+ const parent = parentDirectories[0];
145
+ targetDirectory = parent.addDirectory({
146
+ name: directoryInfo.name,
147
+ title: directoryInfo.title,
148
+ });
149
+ }
150
+ }
151
+ return targetDirectory;
152
+ }
153
+ exports.findOrCreateDirectory = findOrCreateDirectory;
154
+ /**
155
+ * 将节点添加到指定目录(统一方法)
156
+ * @param directory - 目标目录
157
+ * @param node - 要添加的节点
158
+ * @param scope - 目录范围,用于确定正确的 namespace
159
+ * @param dataSourceName - 数据源名称(仅 Entity 类型需要)
160
+ */
161
+ function addNodeToDirectory(directory, node, scope, dataSourceName) {
162
+ // 根据 scope 确定正确的 namespace
163
+ let namespace;
164
+ switch (scope) {
165
+ case 'Logic':
166
+ namespace = 'app.logics';
167
+ break;
168
+ case 'Enum':
169
+ namespace = 'app.enums';
170
+ break;
171
+ case 'Structure':
172
+ namespace = 'app.structures';
173
+ break;
174
+ case 'Entity':
175
+ // Entity 的 namespace 需要包含数据源名称
176
+ const dsName = dataSourceName || node.dataSource?.name || 'defaultDS';
177
+ namespace = `app.dataSources.${dsName}.entities`;
178
+ break;
179
+ case 'View':
180
+ // View 中的变量和逻辑,namespace 为空
181
+ namespace = '';
182
+ break;
183
+ default:
184
+ namespace = '';
185
+ }
186
+ // 检查是否已存在同名引用
187
+ const existingDef = directory.definitions?.find((def) => def.name === node.name && (scope === 'View' ? def.referredConcept === node.concept : true));
188
+ if (existingDef) {
189
+ // 更新现有引用的属性
190
+ existingDef.referredConcept = node.concept;
191
+ existingDef.namespace = namespace;
192
+ }
193
+ else {
194
+ // 使用 Directory 的 addReferredDefinition 方法添加新引用
195
+ directory.addReferredDefinition({
196
+ name: node.name,
197
+ referredConcept: node.concept,
198
+ namespace: namespace,
199
+ });
200
+ }
201
+ }
202
+ exports.addNodeToDirectory = addNodeToDirectory;
203
+ /**
204
+ * 处理节点的 directory 信息(统一方法)
205
+ * 如果节点有 _directoryInfo 临时属性,则在对应的父目录中创建或查找目录,并添加引用
206
+ *
207
+ * @param appOrView - NASL 应用实例或 View 实例
208
+ * @param node - 要处理的节点
209
+ * @param scope - 目录范围(Logic、Enum、Structure、Entity、View)
210
+ */
211
+ function handleDirectory(appOrView, node, scope) {
212
+ // 从临时属性 _directoryInfo 读取 directory 信息
213
+ const directoryInfo = node._directoryInfo;
214
+ if (directoryInfo) {
215
+ try {
216
+ const directory = findOrCreateDirectory(appOrView, directoryInfo, scope);
217
+ addNodeToDirectory(directory, node, scope);
218
+ // 处理完后删除节点上的临时属性,避免序列化时包含
219
+ delete node._directoryInfo;
220
+ }
221
+ catch (error) {
222
+ // 目录处理失败时记录错误但不中断流程
223
+ const scopeDesc = scope === 'View' ? 'View directory' : 'directory';
224
+ console.warn(`处理 ${scopeDesc} 失败: ${error.message}`, node.name);
225
+ }
226
+ }
227
+ }
228
+ exports.handleDirectory = handleDirectory;
229
+ //# sourceMappingURL=transform2Directory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform2Directory.js","sourceRoot":"","sources":["../../../../src/natural/transforms/utils/transform2Directory.ts"],"names":[],"mappings":";;;AAAA,uCAA8E;AAe9E;;;;;;;;;;;GAWG;AACH,SAAgB,mBAAmB,CACjC,cAAsB,EACtB,UAA+B;IAE/B,2BAA2B;IAC3B,gCAAgC;IAChC,MAAM,SAAS,GAAG,mBAAmB,CAAC;IACtC,MAAM,kBAAkB,GAAG,6BAA6B,CAAC;IAEzD,IAAI,IAAY,CAAC;IACjB,IAAI,KAAyB,CAAC;IAE9B,sBAAsB;IACtB,MAAM,cAAc,GAAG,cAAc,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;IAChE,IAAI,cAAc,EAAE,CAAC;QACnB,IAAI,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;QACzB,KAAK,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC;SAAM,IAAI,SAAS,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAC1C,cAAc;QACd,IAAI,GAAG,cAAc,CAAC;IACxB,CAAC;SAAM,CAAC;QACN,OAAO,IAAA,kBAAU,EACf,UAAU,EACV,oBAAoB,cAAc,iEAAiE,CAC3F,CAAC;IACb,CAAC;IAED,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