@lcap/nasl-concepts 3.13.2-rc.5 → 3.14.0-beta.10

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 (166) hide show
  1. package/out/common/BaseNode.d.ts +15 -3
  2. package/out/common/BaseNode.d.ts.map +1 -1
  3. package/out/common/BaseNode.js +111 -21
  4. package/out/common/BaseNode.js.map +1 -1
  5. package/out/concepts/App__.d.ts.map +1 -1
  6. package/out/concepts/App__.js +4 -2
  7. package/out/concepts/App__.js.map +1 -1
  8. package/out/concepts/Argument__.d.ts.map +1 -1
  9. package/out/concepts/Argument__.js.map +1 -1
  10. package/out/concepts/AuthInterface__.d.ts.map +1 -1
  11. package/out/concepts/AuthInterface__.js.map +1 -1
  12. package/out/concepts/BindAttribute__.js +1 -1
  13. package/out/concepts/CallEvent__.d.ts +3 -0
  14. package/out/concepts/CallEvent__.d.ts.map +1 -1
  15. package/out/concepts/CallEvent__.js +13 -0
  16. package/out/concepts/CallEvent__.js.map +1 -1
  17. package/out/concepts/CallFunction__.js +2 -2
  18. package/out/concepts/CallLogic__.d.ts +4 -1
  19. package/out/concepts/CallLogic__.d.ts.map +1 -1
  20. package/out/concepts/CallLogic__.js +28 -4
  21. package/out/concepts/CallLogic__.js.map +1 -1
  22. package/out/concepts/CallQueryComponent__.d.ts +1 -1
  23. package/out/concepts/Connection__.d.ts +1 -0
  24. package/out/concepts/Connection__.d.ts.map +1 -1
  25. package/out/concepts/Connection__.js +3 -0
  26. package/out/concepts/Connection__.js.map +1 -1
  27. package/out/concepts/DataSource__.js +1 -1
  28. package/out/concepts/DataSource__.js.map +1 -1
  29. package/out/concepts/DefaultValue__.d.ts +1 -0
  30. package/out/concepts/DefaultValue__.d.ts.map +1 -1
  31. package/out/concepts/DefaultValue__.js +12 -1
  32. package/out/concepts/DefaultValue__.js.map +1 -1
  33. package/out/concepts/Entity__.d.ts.map +1 -1
  34. package/out/concepts/Entity__.js.map +1 -1
  35. package/out/concepts/EnumItem__.d.ts +2 -0
  36. package/out/concepts/EnumItem__.d.ts.map +1 -1
  37. package/out/concepts/EnumItem__.js +23 -0
  38. package/out/concepts/EnumItem__.js.map +1 -1
  39. package/out/concepts/Enum__.d.ts +1 -0
  40. package/out/concepts/Enum__.d.ts.map +1 -1
  41. package/out/concepts/Enum__.js +11 -0
  42. package/out/concepts/Enum__.js.map +1 -1
  43. package/out/concepts/FrontendVariable__.d.ts.map +1 -1
  44. package/out/concepts/FrontendVariable__.js.map +1 -1
  45. package/out/concepts/Frontend__.d.ts +1 -1
  46. package/out/concepts/Frontend__.d.ts.map +1 -1
  47. package/out/concepts/Frontend__.js +5 -3
  48. package/out/concepts/Frontend__.js.map +1 -1
  49. package/out/concepts/Identifier__.d.ts +2 -1
  50. package/out/concepts/Identifier__.d.ts.map +1 -1
  51. package/out/concepts/Identifier__.js +1 -1
  52. package/out/concepts/Identifier__.js.map +1 -1
  53. package/out/concepts/InterfaceParam__.d.ts +1 -0
  54. package/out/concepts/InterfaceParam__.d.ts.map +1 -1
  55. package/out/concepts/InterfaceParam__.js.map +1 -1
  56. package/out/concepts/Interface__.d.ts +1 -0
  57. package/out/concepts/Interface__.d.ts.map +1 -1
  58. package/out/concepts/Interface__.js +12 -1
  59. package/out/concepts/Interface__.js.map +1 -1
  60. package/out/concepts/Logic__.d.ts +3 -0
  61. package/out/concepts/Logic__.d.ts.map +1 -1
  62. package/out/concepts/Logic__.js +18 -0
  63. package/out/concepts/Logic__.js.map +1 -1
  64. package/out/concepts/Match__.d.ts +1 -0
  65. package/out/concepts/Match__.d.ts.map +1 -1
  66. package/out/concepts/Match__.js +24 -15
  67. package/out/concepts/Match__.js.map +1 -1
  68. package/out/concepts/Module__.d.ts.map +1 -1
  69. package/out/concepts/Module__.js +0 -17
  70. package/out/concepts/Module__.js.map +1 -1
  71. package/out/concepts/Param__.d.ts +2 -0
  72. package/out/concepts/Param__.d.ts.map +1 -1
  73. package/out/concepts/Param__.js +12 -1
  74. package/out/concepts/Param__.js.map +1 -1
  75. package/out/concepts/QueryFieldExpression__.d.ts +4 -0
  76. package/out/concepts/QueryFieldExpression__.d.ts.map +1 -1
  77. package/out/concepts/QueryFieldExpression__.js +6 -0
  78. package/out/concepts/QueryFieldExpression__.js.map +1 -1
  79. package/out/concepts/QueryFromExpression__.d.ts.map +1 -1
  80. package/out/concepts/QueryFromExpression__.js +1 -6
  81. package/out/concepts/QueryFromExpression__.js.map +1 -1
  82. package/out/concepts/QueryJoinExpression__.d.ts.map +1 -1
  83. package/out/concepts/QueryJoinExpression__.js +1 -6
  84. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  85. package/out/concepts/Return__.d.ts +1 -0
  86. package/out/concepts/Return__.d.ts.map +1 -1
  87. package/out/concepts/Return__.js +12 -1
  88. package/out/concepts/Return__.js.map +1 -1
  89. package/out/concepts/StringInterpolation__.js +2 -2
  90. package/out/concepts/StructureProperty__.d.ts +5 -1
  91. package/out/concepts/StructureProperty__.d.ts.map +1 -1
  92. package/out/concepts/StructureProperty__.js +15 -2
  93. package/out/concepts/StructureProperty__.js.map +1 -1
  94. package/out/concepts/Structure__.d.ts +1 -0
  95. package/out/concepts/Structure__.d.ts.map +1 -1
  96. package/out/concepts/Structure__.js +12 -1
  97. package/out/concepts/Structure__.js.map +1 -1
  98. package/out/concepts/TypeAnnotation__.d.ts +47 -4
  99. package/out/concepts/TypeAnnotation__.d.ts.map +1 -1
  100. package/out/concepts/TypeAnnotation__.js +86 -10
  101. package/out/concepts/TypeAnnotation__.js.map +1 -1
  102. package/out/concepts/TypeParam__.d.ts +6 -0
  103. package/out/concepts/TypeParam__.d.ts.map +1 -1
  104. package/out/concepts/TypeParam__.js +15 -1
  105. package/out/concepts/TypeParam__.js.map +1 -1
  106. package/out/concepts/Variable__.d.ts +1 -0
  107. package/out/concepts/Variable__.d.ts.map +1 -1
  108. package/out/concepts/Variable__.js +11 -0
  109. package/out/concepts/Variable__.js.map +1 -1
  110. package/out/concepts/View__.d.ts +1 -1
  111. package/out/concepts/View__.d.ts.map +1 -1
  112. package/out/concepts/View__.js +10 -12
  113. package/out/concepts/View__.js.map +1 -1
  114. package/out/index.d.ts +2 -1
  115. package/out/index.d.ts.map +1 -1
  116. package/out/index.js +10 -1
  117. package/out/index.js.map +1 -1
  118. package/out/semantics/localVarCollector.d.ts +11 -5
  119. package/out/semantics/localVarCollector.d.ts.map +1 -1
  120. package/out/semantics/localVarCollector.js +75 -5
  121. package/out/semantics/localVarCollector.js.map +1 -1
  122. package/out/semantics/semanticData.d.ts +22 -21
  123. package/out/semantics/semanticData.d.ts.map +1 -1
  124. package/out/semantics/semanticData.js +142 -224
  125. package/out/semantics/semanticData.js.map +1 -1
  126. package/out/service/annotation.d.ts +2 -8
  127. package/out/service/annotation.d.ts.map +1 -1
  128. package/out/service/annotation.js +1 -99
  129. package/out/service/annotation.js.map +1 -1
  130. package/out/service/file-module.d.ts +59 -0
  131. package/out/service/file-module.d.ts.map +1 -0
  132. package/out/service/file-module.js +341 -0
  133. package/out/service/file-module.js.map +1 -0
  134. package/out/service/formatTsUtils.d.ts +2 -2
  135. package/out/service/formatTsUtils.d.ts.map +1 -1
  136. package/out/service/formatTsUtils.js +43 -49
  137. package/out/service/formatTsUtils.js.map +1 -1
  138. package/out/service/genSlotVarRef.d.ts +4 -1
  139. package/out/service/genSlotVarRef.d.ts.map +1 -1
  140. package/out/service/genSlotVarRef.js +22 -12
  141. package/out/service/genSlotVarRef.js.map +1 -1
  142. package/out/service/getConnector.d.ts.map +1 -1
  143. package/out/service/getConnector.js +2 -9
  144. package/out/service/getConnector.js.map +1 -1
  145. package/out/service/getLogics.d.ts.map +1 -1
  146. package/out/service/getLogics.js +1 -0
  147. package/out/service/getLogics.js.map +1 -1
  148. package/out/service/getMemberIdentifier.d.ts +0 -1
  149. package/out/service/getMemberIdentifier.d.ts.map +1 -1
  150. package/out/service/getMemberIdentifier.js +19 -37
  151. package/out/service/getMemberIdentifier.js.map +1 -1
  152. package/out/service/getProcessesV2.js +2 -2
  153. package/out/service/getProcessesV2.js.map +1 -1
  154. package/out/service/index.d.ts +2 -0
  155. package/out/service/index.d.ts.map +1 -1
  156. package/out/service/index.js +2 -0
  157. package/out/service/index.js.map +1 -1
  158. package/out/service/transform.d.ts +2 -2
  159. package/out/service/transform.js +3 -3
  160. package/out/utils/node.d.ts +6 -1
  161. package/out/utils/node.d.ts.map +1 -1
  162. package/out/utils/node.js +56 -1
  163. package/out/utils/node.js.map +1 -1
  164. package/out/utils/traverse.js +1 -1
  165. package/out/utils/traverse.js.map +1 -1
  166. package/package.json +5 -5
@@ -1,106 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getModuleSubTreeData = exports.traverseChildrenByModule = exports.hasModuleNested = exports.isIgnoreFullAnnotationFileNode = exports.isIgnoreAnnotationFileNode = exports.getFileNodesByNasl = void 0;
3
+ exports.getModuleSubTreeData = exports.traverseChildrenByModule = exports.hasModuleNested = exports.isIgnoreFullAnnotationFileNode = exports.isIgnoreAnnotationFileNode = void 0;
4
4
  const concepts_1 = require("../concepts");
5
5
  const utils_1 = require("../utils");
6
- function getModuleNodesByNaslModule(module) {
7
- const modules = [];
8
- // 禁用的依赖库不生成代码 区分 undefined 和 false
9
- if (concepts_1.asserts.isModule(module) && module.type === 'extension' && module.enable === false) {
10
- return [];
11
- }
12
- const { structures = [], metadataTypes = [], frontendTypes = [], interfaces = [], enums = [], logics = [], authLogics = [], authLogicsForCallInterface = [], processes = [], processV2s = [], dataSources = [], triggerLaunchers = [], connections = [], roles = [], overriddenLogics = [], backend, configuration, } = module;
13
- const { namespaces = [], triggers = [], } = module;
14
- const { frontends = [] } = module;
15
- const pushModule = (nodes, concept) => {
16
- for (const node of nodes ?? []) {
17
- if (!concept || concepts_1.asserts[`is${concept}`](node)) {
18
- modules.push(node);
19
- }
20
- }
21
- };
22
- const concat = (arr, key) => {
23
- return arr.reduce((ans, item) => ans.concat(item[key]), []);
24
- };
25
- const view2Module = (views) => {
26
- if (!views || views.length === 0) {
27
- return;
28
- }
29
- pushModule(views);
30
- for (const view of views) {
31
- if (view?.children) {
32
- view2Module(view?.children);
33
- }
34
- }
35
- };
36
- pushModule(structures);
37
- pushModule(metadataTypes);
38
- if (concepts_1.asserts.isApp(module)) {
39
- pushModule(overriddenLogics, 'OverriddenLogic');
40
- pushModule(backend?.variables ?? []);
41
- for (const frontendType of (frontendTypes || [])) {
42
- pushModule([frontendType]);
43
- for (const dep of (frontendType.componentDependencies || [])) {
44
- modules.push(...getModuleNodesByNaslModule(dep));
45
- }
46
- for (const frontend of frontendType.frontends) {
47
- pushModule([frontend]);
48
- pushModule(frontend.variables);
49
- pushModule(concat(frontend.bindEvents, 'logics'));
50
- view2Module(frontend.views);
51
- }
52
- pushModule(frontendType.businessComponents);
53
- }
54
- }
55
- else {
56
- pushModule(concat(frontends, 'logics'));
57
- }
58
- pushModule(dataSources);
59
- pushModule(concat(dataSources, 'entities'));
60
- pushModule(interfaces);
61
- pushModule(enums);
62
- pushModule(logics);
63
- pushModule(authLogics, 'Logic');
64
- pushModule(authLogicsForCallInterface, 'Logic');
65
- pushModule(processes);
66
- pushModule(processV2s);
67
- if (concepts_1.asserts.isConnector(module)) {
68
- pushModule(triggerLaunchers);
69
- pushModule(concat(namespaces, 'logics'));
70
- pushModule(triggers);
71
- }
72
- if (concepts_1.asserts.isApp(module)) {
73
- pushModule(roles);
74
- pushModule(connections);
75
- pushModule(triggerLaunchers);
76
- }
77
- for (const group of configuration?.groups ?? []) {
78
- if (group.name === 'custom') {
79
- pushModule(group?.properties ?? []);
80
- }
81
- }
82
- return modules;
83
- }
84
- /**
85
- * 从 Nasl 中生成文件节点列表
86
- *
87
- * @description 这里的模块,严格对应到单个 TS 文件
88
- */
89
- function getFileNodesByNasl(app) {
90
- const modules = [];
91
- const naslModules = [
92
- app,
93
- ...app.integration?.connectors ?? [],
94
- ...app.dependencies ?? [],
95
- ...app.connectorDependencies ?? [],
96
- ...app.interfaceDependencies ?? [],
97
- ];
98
- for (const item of naslModules) {
99
- modules.push(...getModuleNodesByNaslModule(item));
100
- }
101
- return modules;
102
- }
103
- exports.getFileNodesByNasl = getFileNodesByNasl;
104
6
  /**
105
7
  * 不需要标注的节点
106
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"annotation.js","sourceRoot":"","sources":["../../src/service/annotation.ts"],"names":[],"mappings":";;;AAAA,0CASqB;AAErB,oCAGkB;AAElB,SAAS,0BAA0B,CAAC,MAAgC;IAClE,MAAM,OAAO,GAAiB,EAAE,CAAC;IAEjC,mCAAmC;IACnC,IAAI,kBAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,IAAI,KAAK,WAAW,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK,EAAE,CAAC;QACvF,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,EACJ,UAAU,GAAG,EAAE,EACf,aAAa,GAAG,EAAE,EAClB,aAAa,GAAG,EAAE,EAClB,UAAU,GAAG,EAAE,EACf,KAAK,GAAG,EAAE,EACV,MAAM,GAAG,EAAE,EACX,UAAU,GAAG,EAAE,EACf,0BAA0B,GAAG,EAAE,EAC/B,SAAS,GAAG,EAAE,EACd,UAAU,GAAG,EAAE,EACf,WAAW,GAAG,EAAE,EAChB,gBAAgB,GAAG,EAAE,EACrB,WAAW,GAAG,EAAE,EAChB,KAAK,GAAG,EAAE,EACV,gBAAgB,GAAG,EAAE,EACrB,OAAO,EACP,aAAa,GACd,GAAG,MAAa,CAAC;IAElB,MAAM,EACJ,UAAU,GAAG,EAAE,EACf,QAAQ,GAAG,EAAE,GACd,GAAG,MAAmB,CAAC;IAExB,MAAM,EACJ,SAAS,GAAG,EAAE,EACf,GAAG,MAAgB,CAAC;IAErB,MAAM,UAAU,GAAG,CAAC,KAAmB,EAAE,OAA2B,EAAE,EAAE;QACtE,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,EAAE,EAAE,CAAC;YAC/B,IAAI,CA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AAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAhCD,4DAgCC;AAGD;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,IAA8C;IACjF,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;QAC3B,OAAO;YACL,cAAc,EAAE,IAAI,CAAC,WAAW,IAAI,CAAC,CAAC;YACtC,KAAK,EAAE,CAAC;SACT,CAAC;IACJ,CAAC;IAED,IAAI,cAAc,GAAG,CAAC,CAAC,CAAC;IACxB,IAAI,KAAK,GAAG,CAAC,CAAC;IAEd,wBAAwB,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QAC7C,KAAK,EAAE,CAAC;QACR,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,WAAW,GAAG,cAAc,EAAE,CAAC;YAC5D,cAAc,GAAG,KAAK,CAAC,WAAW,CAAC;QACrC,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,cAAc;QACd,KAAK;KACN,CAAC;AACJ,CAAC;AAtBD,oDAsBC"}
@@ -0,0 +1,59 @@
1
+ import { type App, type Module, type SyntaxNode, type Connector } from '../concepts';
2
+ import type { Embedded, NASLObject } from '@lcap/nasl-types';
3
+ interface FileModuleData {
4
+ /** 当前模块数据 */
5
+ nasl: object;
6
+ /** 根节点路径 */
7
+ nodePath: string;
8
+ /** 若是在数组中,它在上级节点中的下标 */
9
+ parentIndex?: number;
10
+ /** 上级节点的 key */
11
+ parentKey?: string;
12
+ /** 上级节点的路径 */
13
+ parentNodePath?: string;
14
+ /** 当前节点修改的时间 */
15
+ _changedTime?: string;
16
+ }
17
+ /**
18
+ * 从根节点开始搜索所有模块节点
19
+ */
20
+ export declare function getFileNodesWithoutDependencies(module1: App | Module | Connector): SyntaxNode[];
21
+ export declare function getFileNodesWithoutDependencies(module1: NASLObject.AppObject | NASLObject.ModuleObject | NASLObject.ConnectorObject): SyntaxNode[];
22
+ /** 从任意对象开始搜索所有模块节点 */
23
+ export declare function getFileNodesByAnyObject(): void;
24
+ /**
25
+ * 获取所有缓存模块节点
26
+ *
27
+ * @description 匹配后端缓存规则
28
+ */
29
+ export declare function getFileModuleNodesByNasl(module1: App | NASLObject.AppObject): FileModuleData[];
30
+ /**
31
+ * 获取前端翻译文件节点
32
+ *
33
+ * @description 匹配前端翻译规则
34
+ */
35
+ export declare function getFileModuleNodesByNaslInIde(module1: App | NASLObject.AppObject): FileModuleData[];
36
+ /**
37
+ * 判断节点是否是文件节点
38
+ *
39
+ * @description 匹配后端缓存规则
40
+ */
41
+ export declare function checkNodeIsFileModule(node: SyntaxNode): boolean;
42
+ /**
43
+ * 判断节点是否是"文件节点"
44
+ */
45
+ export declare function checkNodeIsFileModuleInIde(node: SyntaxNode): boolean;
46
+ export declare function getNodeFileModule(node: any): any;
47
+ /**
48
+ * 从 Nasl 中生成文件节点列表
49
+ *
50
+ * @description 这里的模块,严格对应到单个 TS 文件
51
+ */
52
+ export declare function getFileNodesByNasl(app: App): SyntaxNode[];
53
+ export declare function getFileNodesByNasl(app: NASLObject.AppObject): Embedded.FileNode<SyntaxNode>[];
54
+ /**
55
+ * 获取当前节点所属的文件节点
56
+ */
57
+ export declare const getFileNode: (node: SyntaxNode) => SyntaxNode | undefined | null;
58
+ export {};
59
+ //# sourceMappingURL=file-module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-module.d.ts","sourceRoot":"","sources":["../../src/service/file-module.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,GAAG,EAER,KAAK,MAAM,EACX,KAAK,UAAU,EACf,KAAK,SAAS,EAGf,MAAM,aAAa,CAAC;AAErB,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI7D,UAAU,cAAc;IACtB,aAAa;IACb,IAAI,EAAE,MAAM,CAAC;IACb,YAAY;IACZ,QAAQ,EAAE,MAAM,CAAC;I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ports.getFileNode = exports.getFileNodesByNasl = exports.getNodeFileModule = exports.checkNodeIsFileModuleInIde = exports.checkNodeIsFileModule = exports.getFileModuleNodesByNaslInIde = exports.getFileModuleNodesByNasl = exports.getFileNodesByAnyObject = exports.getFileNodesWithoutDependencies = void 0;
4
+ const utils_1 = require("../utils");
5
+ function getFileNodesWithoutDependencies(module1) {
6
+ // @ts-ignore
7
+ const module = (module1.__v_raw ?? module1);
8
+ const modules = [];
9
+ // 禁用的依赖库不生成代码 区分 undefined 和 false
10
+ if (module.concept === 'Module' && module.type === 'extension' && module.enable === false) {
11
+ return [];
12
+ }
13
+ const { structures = [], metadataTypes = [], frontendTypes = [], interfaces = [], enums = [], logics = [], authLogics = [], authLogicsForCallInterface = [], processes = [], processV2s = [], dataSources = [], triggerLaunchers = [], connections = [], roles = [], overriddenLogics = [], backend, configuration, preferenceMap = {}, } = module;
14
+ const { namespaces = [], triggers = [], dependencies = [], } = module;
15
+ const { frontends = [], } = module;
16
+ const pushModule = (nodes, concept) => {
17
+ for (const node of nodes ?? []) {
18
+ if (!concept || node.concept === concept) {
19
+ modules.push(node);
20
+ }
21
+ }
22
+ };
23
+ const concat = (arr, key) => {
24
+ return arr.reduce((ans, item) => ans.concat(item[key]), []);
25
+ };
26
+ const view2Module = (views) => {
27
+ if (!views || views.length === 0) {
28
+ return;
29
+ }
30
+ pushModule(views);
31
+ for (const view of views) {
32
+ if (view?.children) {
33
+ view2Module(view?.children);
34
+ }
35
+ }
36
+ };
37
+ pushModule(structures);
38
+ // 启用元数据时才翻译
39
+ if ((module.concept === 'App' && String(preferenceMap.metadataTypeEnable) === 'true') ||
40
+ ((module.concept === 'Module' && module.type === 'sharedApp'))) {
41
+ pushModule(metadataTypes);
42
+ }
43
+ if (module.concept === 'App') {
44
+ pushModule(overriddenLogics, 'OverriddenLogic');
45
+ pushModule(backend?.variables ?? []);
46
+ for (const frontendType of (frontendTypes || [])) {
47
+ pushModule([frontendType]);
48
+ for (const dep of (frontendType.componentDependencies || [])) {
49
+ modules.push(...getFileNodesWithoutDependencies(dep));
50
+ }
51
+ for (const frontend of frontendType.frontends) {
52
+ pushModule([frontend]);
53
+ pushModule(frontend.variables);
54
+ pushModule(concat(frontend.bindEvents, 'logics'));
55
+ view2Module(frontend.views);
56
+ }
57
+ pushModule(frontendType.businessComponents);
58
+ }
59
+ }
60
+ else {
61
+ pushModule(concat(frontends, 'logics'));
62
+ }
63
+ pushModule(dataSources);
64
+ pushModule(concat(dataSources, 'entities'));
65
+ pushModule(interfaces);
66
+ pushModule(enums);
67
+ pushModule(logics);
68
+ pushModule(authLogics);
69
+ pushModule(authLogicsForCallInterface);
70
+ pushModule(processes);
71
+ pushModule(processV2s);
72
+ if (module.concept === 'Connector') {
73
+ pushModule(triggerLaunchers);
74
+ pushModule(concat(namespaces, 'logics'));
75
+ pushModule(triggers);
76
+ pushModule(dependencies);
77
+ }
78
+ if (module.concept === 'App') {
79
+ pushModule(roles);
80
+ pushModule(connections);
81
+ pushModule(triggerLaunchers);
82
+ }
83
+ for (const group of configuration?.groups ?? []) {
84
+ const transformGroupName = ['custom', 'auth', 'fileStorage', 'system'];
85
+ if (transformGroupName.includes(group.name)) {
86
+ pushModule(group?.properties ?? []);
87
+ }
88
+ }
89
+ return modules;
90
+ }
91
+ exports.getFileNodesWithoutDependencies = getFileNodesWithoutDependencies;
92
+ /** 从任意对象开始搜索所有模块节点 */
93
+ function getFileNodesByAnyObject() {
94
+ }
95
+ exports.getFileNodesByAnyObject = getFileNodesByAnyObject;
96
+ const isFileModuleAndSkipChild = {
97
+ isFileModule: true,
98
+ skipChild: true,
99
+ };
100
+ const isFileModuleAndNotSkipChild = {
101
+ isFileModule: true,
102
+ skipChild: false,
103
+ };
104
+ /** 服务端缓存规则 */
105
+ const fileModuleNodeAssert = {
106
+ App: isFileModuleAndNotSkipChild,
107
+ Module: isFileModuleAndNotSkipChild,
108
+ Connector: isFileModuleAndNotSkipChild,
109
+ Structure: isFileModuleAndSkipChild,
110
+ Entity: isFileModuleAndSkipChild,
111
+ Interface: isFileModuleAndSkipChild,
112
+ AuthInterface: isFileModuleAndSkipChild,
113
+ MicroserviceInterface: isFileModuleAndSkipChild,
114
+ Enum: isFileModuleAndSkipChild,
115
+ AuthLogic: isFileModuleAndSkipChild,
116
+ AuthLogicForCallInterface: isFileModuleAndSkipChild,
117
+ Process: isFileModuleAndSkipChild,
118
+ ProcessV2: isFileModuleAndSkipChild,
119
+ TriggerLauncher: isFileModuleAndSkipChild,
120
+ ConnectorTrigger: isFileModuleAndSkipChild,
121
+ Dependency: isFileModuleAndSkipChild,
122
+ Role: isFileModuleAndSkipChild,
123
+ Connection: isFileModuleAndSkipChild,
124
+ OverriddenLogic: isFileModuleAndSkipChild,
125
+ DataSource: isFileModuleAndNotSkipChild,
126
+ FrontendType: isFileModuleAndNotSkipChild,
127
+ Frontend: isFileModuleAndNotSkipChild,
128
+ FrontendLibrary: isFileModuleAndNotSkipChild,
129
+ BusinessComponent: isFileModuleAndSkipChild,
130
+ ConnectorLogic: isFileModuleAndSkipChild,
131
+ ConfigGroup: isFileModuleAndSkipChild,
132
+ View: isFileModuleAndNotSkipChild,
133
+ Logic: {
134
+ ...isFileModuleAndSkipChild,
135
+ // 非页面逻辑 非流程逻辑
136
+ check: (path, context) => {
137
+ const parentConcept = context?.parentNode?.concept;
138
+ if (parentConcept) {
139
+ return !(['View', 'BindEvent', 'ProcessElementV2'].includes(parentConcept));
140
+ }
141
+ return !path.includes('.views[');
142
+ },
143
+ },
144
+ ViewElement: {
145
+ isFileModule: false,
146
+ skipChild: true,
147
+ },
148
+ Param: {
149
+ isFileModule: false,
150
+ skipChild: true,
151
+ },
152
+ };
153
+ /** 前端翻译规则 */
154
+ const fileModuleNodeAssertInIde = {
155
+ ...fileModuleNodeAssert,
156
+ ConfigGroup: undefined,
157
+ App: undefined,
158
+ FrontendLibrary: undefined,
159
+ BackendVariable: isFileModuleAndSkipChild,
160
+ FrontendVariable: isFileModuleAndSkipChild,
161
+ MetadataType: isFileModuleAndSkipChild,
162
+ Role: isFileModuleAndSkipChild,
163
+ Logic: {
164
+ ...isFileModuleAndSkipChild,
165
+ check: (path, context) => {
166
+ const parentConcept = context?.parentNode?.concept;
167
+ // 非页面逻辑,非流程逻辑
168
+ if (parentConcept === 'View' || parentConcept === 'ProcessElementV2') {
169
+ return false;
170
+ }
171
+ // 事件
172
+ if (parentConcept === 'BindEvent') {
173
+ const grandParentConcept = context?.parentNode?.parentNode?.concept;
174
+ // 端事件是模块
175
+ if (grandParentConcept === 'Frontend') {
176
+ return true;
177
+ }
178
+ // 流程事件不是模块
179
+ else if (grandParentConcept === 'ProcessDefinitionV2') {
180
+ return false;
181
+ }
182
+ }
183
+ // 兜底判定,非逻辑也非流程
184
+ return !(path.includes('.views[') || path.includes('.processV2s['));
185
+ },
186
+ },
187
+ ConfigProperty: {
188
+ ...isFileModuleAndSkipChild,
189
+ check: (path, { parentNode }) => {
190
+ const transformGroupName = ['custom', 'auth', 'fileStorage', 'system'];
191
+ return parentNode.concept === 'ConfigGroup' && transformGroupName.includes(parentNode.name);
192
+ },
193
+ },
194
+ };
195
+ /**
196
+ * 获取所有缓存模块节点
197
+ *
198
+ * @description 匹配后端缓存规则
199
+ */
200
+ function getFileModuleNodesByNasl(module1) {
201
+ // @ts-ignore
202
+ const module = (module1.__v_raw ?? module1);
203
+ const results = [];
204
+ (0, utils_1.fastTraverseNaslObjectWithPruning)(module, (node, path, context) => {
205
+ const assertData = fileModuleNodeAssert[node.concept];
206
+ if (!assertData?.isFileModule) {
207
+ return assertData?.skipChild;
208
+ }
209
+ if (!assertData.check ||
210
+ assertData.check(path, context)) {
211
+ results.push({
212
+ nasl: node,
213
+ nodePath: path,
214
+ parentIndex: node.name ? undefined : context.index,
215
+ parentKey: context?.parentKey, // app的话,就没有,其余应该都有
216
+ parentNodePath: context?.parentPath,
217
+ _changedTime: node._changedTime,
218
+ });
219
+ if (assertData.skipChild) {
220
+ return true;
221
+ }
222
+ }
223
+ });
224
+ return results;
225
+ }
226
+ exports.getFileModuleNodesByNasl = getFileModuleNodesByNasl;
227
+ /**
228
+ * 获取前端翻译文件节点
229
+ *
230
+ * @description 匹配前端翻译规则
231
+ */
232
+ function getFileModuleNodesByNaslInIde(module1) {
233
+ // @ts-ignore
234
+ const module = (module1.__v_raw ?? module1);
235
+ const metadataTypeEnable = ((module.concept === 'App' && String(module?.preferenceMap?.metadataTypeEnable) === 'true') ||
236
+ ((module.concept === 'Module' && module.type === 'sharedApp')));
237
+ const results = [];
238
+ (0, utils_1.fastTraverseNaslObjectWithPruning)(module, (node, path, context) => {
239
+ const assertData = fileModuleNodeAssertInIde[node.concept];
240
+ if (!assertData?.isFileModule) {
241
+ return assertData?.skipChild;
242
+ }
243
+ // metaData type 的情况需要进一步判断
244
+ if (node.concept === 'MetadataType' && !metadataTypeEnable) {
245
+ return true;
246
+ }
247
+ if (!assertData.check ||
248
+ assertData.check(path, context)) {
249
+ results.push({
250
+ nasl: node,
251
+ nodePath: path,
252
+ parentIndex: node.name ? undefined : context.index,
253
+ parentKey: context.parentKey,
254
+ parentNodePath: context.parentPath,
255
+ });
256
+ if (assertData.skipChild) {
257
+ return true;
258
+ }
259
+ }
260
+ });
261
+ return results;
262
+ }
263
+ exports.getFileModuleNodesByNaslInIde = getFileModuleNodesByNaslInIde;
264
+ /**
265
+ * 判断节点是否是文件节点
266
+ *
267
+ * @description 匹配后端缓存规则
268
+ */
269
+ function checkNodeIsFileModule(node) {
270
+ const assertData = fileModuleNodeAssert[node.concept];
271
+ if (assertData?.isFileModule) {
272
+ if (!assertData.check || assertData.check(node.nodePath, node)) {
273
+ return true;
274
+ }
275
+ }
276
+ return false;
277
+ }
278
+ exports.checkNodeIsFileModule = checkNodeIsFileModule;
279
+ /**
280
+ * 判断节点是否是"文件节点"
281
+ */
282
+ function checkNodeIsFileModuleInIde(node) {
283
+ const assertData = fileModuleNodeAssertInIde[node.concept];
284
+ if (assertData?.isFileModule) {
285
+ if (!assertData.check || assertData.check(node.nodePath, node)) {
286
+ return true;
287
+ }
288
+ }
289
+ if (node.concept === 'MetadataType') {
290
+ const { app } = node;
291
+ const metadataTypeEnable = String(app?.preferenceMap?.metadataTypeEnable) === 'true';
292
+ if (metadataTypeEnable) {
293
+ return true;
294
+ }
295
+ }
296
+ return false;
297
+ }
298
+ exports.checkNodeIsFileModuleInIde = checkNodeIsFileModuleInIde;
299
+ function getNodeFileModule(node) {
300
+ while (node?.concept) {
301
+ if (checkNodeIsFileModule(node)) {
302
+ return node;
303
+ }
304
+ node = node.parentNode;
305
+ }
306
+ return node;
307
+ }
308
+ exports.getNodeFileModule = getNodeFileModule;
309
+ function getFileNodesByNasl(app) {
310
+ const modules = [];
311
+ const naslModules = [
312
+ app,
313
+ ...app.integration?.connectors ?? [],
314
+ ...app.dependencies ?? [],
315
+ ...app.connectorDependencies ?? [],
316
+ ...app.interfaceDependencies ?? [],
317
+ ...app.sharedAppDependencies ?? [],
318
+ ];
319
+ for (const item of naslModules) {
320
+ modules.push(...getFileNodesWithoutDependencies(item));
321
+ }
322
+ return modules;
323
+ }
324
+ exports.getFileNodesByNasl = getFileNodesByNasl;
325
+ /**
326
+ * 获取当前节点所属的文件节点
327
+ */
328
+ const getFileNode = (node) => {
329
+ let result = toRaw(node);
330
+ while (result) {
331
+ if (checkNodeIsFileModuleInIde(result)) {
332
+ return result;
333
+ }
334
+ result = toRaw(result.parentNode);
335
+ }
336
+ return result;
337
+ };
338
+ exports.getFileNode = getFileNode;
339
+ // @ts-expect-error
340
+ const toRaw = (node) => node?.__v_raw ?? node;
341
+ //# sourceMappingURL=file-module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-module.js","sourceRoot":"","sources":["../../src/service/file-module.ts"],"names":[],"mappings":";;;AASA,oCAA8E;AAyB9E,SAAgB,+BAA+B,CAAC,OAAuB;IACrE,aAAa;IACb,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,CAA6B,CAAC;IACxE,MAAM,OAAO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A0C,CAAC;AACpD,CAAC;AAhBD,gDAgBC;AAED;;GAEG;AACI,MAAM,WAAW,GAAG,CAAC,IAAgB,EAAiC,EAAE;IAC3E,IAAI,MAAM,GAAkC,KAAK,CAAC,IAAI,CAAC,CAAC;IAExD,OAAO,MAAM,EAAE,CAAC;QACZ,IAAI,0BAA0B,CAAC,MAAM,CAAC,EAAE,CAAC;YACrC,OAAO,MAAM,CAAC;QAClB,CAAC;QAED,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,MAAM,CAAC;AAClB,CAAC,CAAA;AAXY,QAAA,WAAW,eAWvB;AAED,mBAAmB;AACnB,MAAM,KAAK,GAAG,CAAqB,IAAO,EAAiB,EAAE,CAAC,IAAI,EAAE,OAAO,IAAI,IAAI,CAAC"}
@@ -1,4 +1,4 @@
1
- import { Identifier, TypeAnnotation, MemberExpression, CompletionProperty, Logic, ConfigProperty, Interface, BackendVariable, AuthLogic, AuthLogicForCallInterface, SubLogic, Variable, Param, Return, SyntaxNode, OverriddenLogic, AuthInterface, ConnectorLogic } from '../concepts';
1
+ import { Identifier, TypeAnnotation, MemberExpression, CompletionProperty, Logic, ConfigProperty, Interface, BackendVariable, AuthLogic, AuthLogicForCallInterface, SubLogic, Variable, Param, Return, SyntaxNode, OverriddenLogic, AuthInterface, ConnectorLogic, FrontendVariable } from '../concepts';
2
2
  interface variableItem {
3
3
  text: string;
4
4
  completionDetail: any;
@@ -33,7 +33,7 @@ type LogicLike = SubLogic | Logic | AuthLogic | OverriddenLogic | Interface | Au
33
33
  export declare const genIdentSelectorNodeData: (ctxLogicLike: LogicLike | undefined) => (v: Variable | Param | Return) => CompletionProperty;
34
34
  export declare function formatVariableData(data: unknown | variableItem[], node: SyntaxNode, parent?: any): CompletionProperty[];
35
35
  export declare function formatBackendVariables(variables: Array<BackendVariable>): CompletionProperty[];
36
- export declare function formatFrontEndVariables(frontEndVariables: Array<Variable>): CompletionProperty[];
36
+ export declare const formatFrontEndVariable: (v: FrontendVariable) => CompletionProperty;
37
37
  export declare function formatConfigProperties(configProperties: Array<ConfigProperty>, isView: Boolean): any;
38
38
  export {};
39
39
  //# sourceMappingURL=formatTsUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"formatTsUtils.d.ts","sourceRoot":"","sources":["../../src/service/formatTsUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EAId,gBAAgB,EAChB,kBAAkB,EAClB,KAAK,EACL,cAAc,EAGd,SAAS,EACT,eAAe,EACf,SAAS,EACT,yBAAyB,EAKzB,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,EACN,UAAU,EACV,eAAe,EACf,aAAa,EACb,cAAc,EACf,MAAM,aAAa,CAAC;AAKrB,UAAU,YAAY;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,GAAG,CAAC;IACtB,QAAQ,CAAC,EAAE,YAAY,EAAE,GAAG,GAAG,CAAC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,gBAAgB,GAAG,UAAU,CAAC;CAC3C;AA0BD;;;;GAIG;AACH,wBAAiB,mBAAmB,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,GAAG,EAAE,cAAc,EAAE,GAAG,CAAC,CA8DlG;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,cAAc,CA4BnG;AAoED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,CA6BvE;AACD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,WAEzC;AAiBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,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