@lcap/nasl 3.4.0-alpha.2 → 3.4.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/out/common/BaseNode.d.ts +14 -11
  2. package/out/common/BaseNode.js +72 -52
  3. package/out/common/BaseNode.js.map +1 -1
  4. package/out/concepts/Anchor__.js +3 -1
  5. package/out/concepts/Anchor__.js.map +1 -1
  6. package/out/concepts/AnonymousFunction__.js +10 -3
  7. package/out/concepts/AnonymousFunction__.js.map +1 -1
  8. package/out/concepts/App__.js +69 -18
  9. package/out/concepts/App__.js.map +1 -1
  10. package/out/concepts/Argument__.js +3 -1
  11. package/out/concepts/Argument__.js.map +1 -1
  12. package/out/concepts/Assignee__.js +18 -5
  13. package/out/concepts/Assignee__.js.map +1 -1
  14. package/out/concepts/AssignmentLine__.js +6 -2
  15. package/out/concepts/AssignmentLine__.js.map +1 -1
  16. package/out/concepts/Assignment__.js +6 -2
  17. package/out/concepts/Assignment__.js.map +1 -1
  18. package/out/concepts/Attribute__.js +3 -1
  19. package/out/concepts/Attribute__.js.map +1 -1
  20. package/out/concepts/AuthLogicForCallInterface__.js +4 -1
  21. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  22. package/out/concepts/AuthLogic__.js.map +1 -1
  23. package/out/concepts/BackendVariable__.js +3 -1
  24. package/out/concepts/BackendVariable__.js.map +1 -1
  25. package/out/concepts/Backend__.js +4 -1
  26. package/out/concepts/Backend__.js.map +1 -1
  27. package/out/concepts/BatchAssignment__.js +11 -3
  28. package/out/concepts/BatchAssignment__.js.map +1 -1
  29. package/out/concepts/BinaryExpression__.js +6 -2
  30. package/out/concepts/BinaryExpression__.js.map +1 -1
  31. package/out/concepts/BindAttribute__.js +20 -6
  32. package/out/concepts/BindAttribute__.js.map +1 -1
  33. package/out/concepts/BindDirective__.js +7 -2
  34. package/out/concepts/BindDirective__.js.map +1 -1
  35. package/out/concepts/BindEvent__.js +8 -2
  36. package/out/concepts/BindEvent__.js.map +1 -1
  37. package/out/concepts/BindStyle__.js +7 -2
  38. package/out/concepts/BindStyle__.js.map +1 -1
  39. package/out/concepts/CallAuthInterface__.js +4 -1
  40. package/out/concepts/CallAuthInterface__.js.map +1 -1
  41. package/out/concepts/CallFunction__.js +8 -2
  42. package/out/concepts/CallFunction__.js.map +1 -1
  43. package/out/concepts/CallInterface__.d.ts +2 -1
  44. package/out/concepts/CallInterface__.js +51 -13
  45. package/out/concepts/CallInterface__.js.map +1 -1
  46. package/out/concepts/CallLogic__.js +11 -3
  47. package/out/concepts/CallLogic__.js.map +1 -1
  48. package/out/concepts/CallQueryComponent__.js +34 -10
  49. package/out/concepts/CallQueryComponent__.js.map +1 -1
  50. package/out/concepts/CompletionProperty__.js +3 -1
  51. package/out/concepts/CompletionProperty__.js.map +1 -1
  52. package/out/concepts/ConfigGroup__.js +4 -1
  53. package/out/concepts/ConfigGroup__.js.map +1 -1
  54. package/out/concepts/ConfigProperty__.js +4 -1
  55. package/out/concepts/ConfigProperty__.js.map +1 -1
  56. package/out/concepts/Configuration__.js +4 -1
  57. package/out/concepts/Configuration__.js.map +1 -1
  58. package/out/concepts/Connection__.js +4 -1
  59. package/out/concepts/Connection__.js.map +1 -1
  60. package/out/concepts/Connector__.js +26 -7
  61. package/out/concepts/Connector__.js.map +1 -1
  62. package/out/concepts/Constant__.js +3 -1
  63. package/out/concepts/Constant__.js.map +1 -1
  64. package/out/concepts/DataSource__.js +4 -1
  65. package/out/concepts/DataSource__.js.map +1 -1
  66. package/out/concepts/Destination__.js +7 -2
  67. package/out/concepts/Destination__.js.map +1 -1
  68. package/out/concepts/EntityIndex__.js +3 -1
  69. package/out/concepts/EntityIndex__.js.map +1 -1
  70. package/out/concepts/EntityProperty__.js +9 -3
  71. package/out/concepts/EntityProperty__.js.map +1 -1
  72. package/out/concepts/Entity__.js +8 -2
  73. package/out/concepts/Entity__.js.map +1 -1
  74. package/out/concepts/Enum__.js +4 -1
  75. package/out/concepts/Enum__.js.map +1 -1
  76. package/out/concepts/Event__.js +4 -1
  77. package/out/concepts/Event__.js.map +1 -1
  78. package/out/concepts/ExternalDestination__.js +6 -2
  79. package/out/concepts/ExternalDestination__.js.map +1 -1
  80. package/out/concepts/ForEachStatement__.js +19 -6
  81. package/out/concepts/ForEachStatement__.js.map +1 -1
  82. package/out/concepts/FrontendLibrary__.js +8 -2
  83. package/out/concepts/FrontendLibrary__.js.map +1 -1
  84. package/out/concepts/Frontend__.js +19 -5
  85. package/out/concepts/Frontend__.js.map +1 -1
  86. package/out/concepts/Function__.js +19 -5
  87. package/out/concepts/Function__.js.map +1 -1
  88. package/out/concepts/IfStatement__.js +11 -3
  89. package/out/concepts/IfStatement__.js.map +1 -1
  90. package/out/concepts/Integration__.js +7 -2
  91. package/out/concepts/Integration__.js.map +1 -1
  92. package/out/concepts/InterfaceParam__.js +3 -1
  93. package/out/concepts/InterfaceParam__.js.map +1 -1
  94. package/out/concepts/Interface__.js +11 -3
  95. package/out/concepts/Interface__.js.map +1 -1
  96. package/out/concepts/Logic__.js +46 -46
  97. package/out/concepts/Logic__.js.map +1 -1
  98. package/out/concepts/MatchCase__.js +8 -2
  99. package/out/concepts/MatchCase__.js.map +1 -1
  100. package/out/concepts/Match__.js +7 -2
  101. package/out/concepts/Match__.js.map +1 -1
  102. package/out/concepts/MemberExpression__.js +6 -2
  103. package/out/concepts/MemberExpression__.js.map +1 -1
  104. package/out/concepts/Module__.js +55 -14
  105. package/out/concepts/Module__.js.map +1 -1
  106. package/out/concepts/MsgTriggerEvent__.js +4 -1
  107. package/out/concepts/MsgTriggerEvent__.js.map +1 -1
  108. package/out/concepts/MsgTriggerLauncher__.js +4 -1
  109. package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
  110. package/out/concepts/Namespace__.js +48 -12
  111. package/out/concepts/Namespace__.js.map +1 -1
  112. package/out/concepts/NewComposite__.js +15 -4
  113. package/out/concepts/NewComposite__.js.map +1 -1
  114. package/out/concepts/NewList__.js +7 -2
  115. package/out/concepts/NewList__.js.map +1 -1
  116. package/out/concepts/NewMap__.js +11 -3
  117. package/out/concepts/NewMap__.js.map +1 -1
  118. package/out/concepts/NumericLiteral__.js +3 -1
  119. package/out/concepts/NumericLiteral__.js.map +1 -1
  120. package/out/concepts/OqlQueryComponent__.js +3 -1
  121. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  122. package/out/concepts/OverriddenLogic__.js +28 -8
  123. package/out/concepts/OverriddenLogic__.js.map +1 -1
  124. package/out/concepts/Param__.js +3 -1
  125. package/out/concepts/Param__.js.map +1 -1
  126. package/out/concepts/ProcessComponent__.js +8 -2
  127. package/out/concepts/ProcessComponent__.js.map +1 -1
  128. package/out/concepts/ProcessElement__.js +30 -8
  129. package/out/concepts/ProcessElement__.js.map +1 -1
  130. package/out/concepts/ProcessOutcomes__.js +3 -1
  131. package/out/concepts/ProcessOutcomes__.js.map +1 -1
  132. package/out/concepts/Process__.js +20 -5
  133. package/out/concepts/Process__.js.map +1 -1
  134. package/out/concepts/QueryAggregateExpression__.js +3 -1
  135. package/out/concepts/QueryAggregateExpression__.js.map +1 -1
  136. package/out/concepts/QueryFromExpression__.js +4 -1
  137. package/out/concepts/QueryFromExpression__.js.map +1 -1
  138. package/out/concepts/QueryGroupByExpression__.js +3 -1
  139. package/out/concepts/QueryGroupByExpression__.js.map +1 -1
  140. package/out/concepts/QueryJoinExpression__.js +8 -2
  141. package/out/concepts/QueryJoinExpression__.js.map +1 -1
  142. package/out/concepts/QueryLimitExpression__.js +6 -2
  143. package/out/concepts/QueryLimitExpression__.js.map +1 -1
  144. package/out/concepts/QueryOrderByExpression__.js +6 -2
  145. package/out/concepts/QueryOrderByExpression__.js.map +1 -1
  146. package/out/concepts/QuerySelectExpression__.js +4 -1
  147. package/out/concepts/QuerySelectExpression__.js.map +1 -1
  148. package/out/concepts/Return__.js +3 -1
  149. package/out/concepts/Return__.js.map +1 -1
  150. package/out/concepts/SelectMembers__.js +7 -2
  151. package/out/concepts/SelectMembers__.js.map +1 -1
  152. package/out/concepts/Slot__.js +3 -1
  153. package/out/concepts/Slot__.js.map +1 -1
  154. package/out/concepts/SqlQueryComponent__.js +3 -1
  155. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  156. package/out/concepts/StringInterpolation__.js +4 -1
  157. package/out/concepts/StringInterpolation__.js.map +1 -1
  158. package/out/concepts/StructureProperty__.js +3 -1
  159. package/out/concepts/StructureProperty__.js.map +1 -1
  160. package/out/concepts/Structure__.js +8 -2
  161. package/out/concepts/Structure__.js.map +1 -1
  162. package/out/concepts/SwitchCase__.js +7 -2
  163. package/out/concepts/SwitchCase__.js.map +1 -1
  164. package/out/concepts/SwitchStatement__.js +4 -1
  165. package/out/concepts/SwitchStatement__.js.map +1 -1
  166. package/out/concepts/TriggerEvent__.js +4 -1
  167. package/out/concepts/TriggerEvent__.js.map +1 -1
  168. package/out/concepts/TypeAnnotation__.js +12 -3
  169. package/out/concepts/TypeAnnotation__.js.map +1 -1
  170. package/out/concepts/UnaryExpression__.js +3 -1
  171. package/out/concepts/UnaryExpression__.js.map +1 -1
  172. package/out/concepts/ValidationRule__.js +10 -3
  173. package/out/concepts/ValidationRule__.js.map +1 -1
  174. package/out/concepts/Variable__.js +3 -1
  175. package/out/concepts/Variable__.js.map +1 -1
  176. package/out/concepts/ViewComponent__.js +24 -6
  177. package/out/concepts/ViewComponent__.js.map +1 -1
  178. package/out/concepts/ViewElement__.js +24 -7
  179. package/out/concepts/ViewElement__.js.map +1 -1
  180. package/out/concepts/View__.js +27 -7
  181. package/out/concepts/View__.js.map +1 -1
  182. package/out/concepts/WhileStatement__.js +7 -2
  183. package/out/concepts/WhileStatement__.js.map +1 -1
  184. package/out/concepts/types__.d.ts +2 -3
  185. package/out/decorators/index.d.ts +3 -3
  186. package/out/decorators/index.js +3 -1
  187. package/out/decorators/index.js.map +1 -1
  188. package/out/natural/genNaturalTS.js +1 -1
  189. package/out/natural/genNaturalTS.js.map +1 -1
  190. package/out/server/formatTsUtils.d.ts +3 -3
  191. package/out/server/getMemberIdentifier.d.ts +4 -4
  192. package/out/server/naslServer.d.ts +1 -1
  193. package/out/server/naslServer.js +4 -2
  194. package/out/server/naslServer.js.map +1 -1
  195. package/out/translator/utils.js +24 -28
  196. package/out/translator/utils.js.map +1 -1
  197. package/package.json +1 -1
  198. package/src/common/BaseNode.ts +92 -68
  199. package/src/concepts/Anchor__.ts +3 -1
  200. package/src/concepts/AnonymousFunction__.ts +10 -3
  201. package/src/concepts/App__.ts +69 -18
  202. package/src/concepts/Argument__.ts +3 -1
  203. package/src/concepts/Assignee__.ts +18 -5
  204. package/src/concepts/AssignmentLine__.ts +6 -2
  205. package/src/concepts/Assignment__.ts +6 -2
  206. package/src/concepts/Attribute__.ts +3 -1
  207. package/src/concepts/AuthLogicForCallInterface__.ts +4 -1
  208. package/src/concepts/AuthLogic__.ts +3 -0
  209. package/src/concepts/BackendVariable__.ts +3 -1
  210. package/src/concepts/Backend__.ts +4 -1
  211. package/src/concepts/BatchAssignment__.ts +11 -3
  212. package/src/concepts/BinaryExpression__.ts +6 -2
  213. package/src/concepts/BindAttribute__.ts +20 -7
  214. package/src/concepts/BindDirective__.ts +7 -2
  215. package/src/concepts/BindEvent__.ts +8 -2
  216. package/src/concepts/BindStyle__.ts +7 -2
  217. package/src/concepts/CallAuthInterface__.ts +4 -1
  218. package/src/concepts/CallFunction__.ts +8 -2
  219. package/src/concepts/CallInterface__.ts +49 -14
  220. package/src/concepts/CallLogic__.ts +11 -3
  221. package/src/concepts/CallQueryComponent__.ts +34 -10
  222. package/src/concepts/CompletionProperty__.ts +3 -1
  223. package/src/concepts/ConfigGroup__.ts +4 -1
  224. package/src/concepts/ConfigProperty__.ts +4 -1
  225. package/src/concepts/Configuration__.ts +4 -1
  226. package/src/concepts/Connection__.ts +4 -1
  227. package/src/concepts/Connector__.ts +26 -7
  228. package/src/concepts/Constant__.ts +3 -1
  229. package/src/concepts/DataSource__.ts +4 -1
  230. package/src/concepts/Destination__.ts +7 -2
  231. package/src/concepts/EntityIndex__.ts +3 -1
  232. package/src/concepts/EntityProperty__.ts +9 -3
  233. package/src/concepts/Entity__.ts +8 -2
  234. package/src/concepts/Enum__.ts +4 -1
  235. package/src/concepts/Event__.ts +4 -1
  236. package/src/concepts/ExternalDestination__.ts +6 -2
  237. package/src/concepts/ForEachStatement__.ts +19 -6
  238. package/src/concepts/FrontendLibrary__.ts +8 -2
  239. package/src/concepts/Frontend__.ts +19 -5
  240. package/src/concepts/Function__.ts +19 -5
  241. package/src/concepts/IfStatement__.ts +11 -3
  242. package/src/concepts/Integration__.ts +7 -2
  243. package/src/concepts/InterfaceParam__.ts +3 -1
  244. package/src/concepts/Interface__.ts +11 -3
  245. package/src/concepts/Logic__.ts +62 -57
  246. package/src/concepts/MatchCase__.ts +8 -2
  247. package/src/concepts/Match__.ts +7 -2
  248. package/src/concepts/MemberExpression__.ts +6 -2
  249. package/src/concepts/Module__.ts +55 -14
  250. package/src/concepts/MsgTriggerEvent__.ts +4 -1
  251. package/src/concepts/MsgTriggerLauncher__.ts +4 -1
  252. package/src/concepts/Namespace__.ts +48 -12
  253. package/src/concepts/NewComposite__.ts +15 -4
  254. package/src/concepts/NewList__.ts +7 -2
  255. package/src/concepts/NewMap__.ts +11 -3
  256. package/src/concepts/NumericLiteral__.ts +3 -1
  257. package/src/concepts/OqlQueryComponent__.ts +3 -1
  258. package/src/concepts/OverriddenLogic__.ts +28 -8
  259. package/src/concepts/Param__.ts +3 -1
  260. package/src/concepts/ProcessComponent__.ts +8 -2
  261. package/src/concepts/ProcessElement__.ts +30 -8
  262. package/src/concepts/ProcessOutcomes__.ts +3 -1
  263. package/src/concepts/Process__.ts +20 -5
  264. package/src/concepts/QueryAggregateExpression__.ts +3 -1
  265. package/src/concepts/QueryFromExpression__.ts +4 -1
  266. package/src/concepts/QueryGroupByExpression__.ts +3 -1
  267. package/src/concepts/QueryJoinExpression__.ts +8 -2
  268. package/src/concepts/QueryLimitExpression__.ts +6 -2
  269. package/src/concepts/QueryOrderByExpression__.ts +6 -2
  270. package/src/concepts/QuerySelectExpression__.ts +4 -1
  271. package/src/concepts/Return__.ts +3 -1
  272. package/src/concepts/SelectMembers__.ts +7 -2
  273. package/src/concepts/Slot__.ts +3 -1
  274. package/src/concepts/SqlQueryComponent__.ts +3 -1
  275. package/src/concepts/StringInterpolation__.ts +4 -1
  276. package/src/concepts/StructureProperty__.ts +3 -1
  277. package/src/concepts/Structure__.ts +8 -2
  278. package/src/concepts/SwitchCase__.ts +7 -2
  279. package/src/concepts/SwitchStatement__.ts +4 -1
  280. package/src/concepts/TriggerEvent__.ts +4 -1
  281. package/src/concepts/TypeAnnotation__.ts +13 -4
  282. package/src/concepts/UnaryExpression__.ts +3 -1
  283. package/src/concepts/ValidationRule__.ts +10 -3
  284. package/src/concepts/Variable__.ts +3 -1
  285. package/src/concepts/ViewComponent__.ts +24 -6
  286. package/src/concepts/ViewElement__.ts +92 -72
  287. package/src/concepts/View__.ts +27 -7
  288. package/src/concepts/WhileStatement__.ts +7 -2
  289. package/src/concepts/types__.ts +2 -4
  290. package/src/decorators/index.ts +7 -5
  291. package/src/natural/genNaturalTS.ts +1 -1
  292. package/src/server/formatTsUtils.ts +8 -8
  293. package/src/server/getMemberIdentifier.ts +4 -4
  294. package/src/server/naslServer.ts +4 -4
  295. package/src/service/storage/init.ts +2 -2
  296. package/src/translator/utils.ts +7 -9
@@ -12,7 +12,7 @@ import {
12
12
  Logic,
13
13
  ConfigProperty,
14
14
  App,
15
- SynatxNode,
15
+ SyntaxNode,
16
16
  BindAttribute,
17
17
  Interface,
18
18
  CallLogic,
@@ -278,7 +278,7 @@ function findNode(typeKey: string, node: BaseNode) {
278
278
  * @param item 当前节点的内容
279
279
  * @param node 获取变量框的位置
280
280
  */
281
- export function nextFindTypeChild(typeKey: string, item: any, node: SynatxNode) {
281
+ export function nextFindTypeChild(typeKey: string, item: any, node: SyntaxNode) {
282
282
  const newType = findNode(typeKey, node);
283
283
  if ((newType as Structure)?.properties && (newType as Structure).properties.length) {
284
284
  // 处理泛型的内容要取到值
@@ -312,7 +312,7 @@ export function nextFindTypeChild(typeKey: string, item: any, node: SynatxNode)
312
312
  lCAPRolePerMapping: dataSources.defaultDS.entities.LCAPRolePerMapping;
313
313
  }>`
314
314
  */
315
- function getAStructureScopeType(type: string, parent: any, node: SynatxNode) {
315
+ function getAStructureScopeType(type: string, parent: any, node: SyntaxNode) {
316
316
  let newType = type
317
317
  .replaceAll(' ', '')
318
318
  .replaceAll('\n', '')
@@ -412,7 +412,7 @@ function getAStructureScopeType(type: string, parent: any, node: SynatxNode) {
412
412
  total: nasl.core.Long;
413
413
  }`
414
414
  */
415
- function getAStructureObjectStringType(type: string, parent: any, node: SynatxNode) {
415
+ function getAStructureObjectStringType(type: string, parent: any, node: SyntaxNode) {
416
416
  let newType = type
417
417
  .replaceAll(' ', '')
418
418
  .replaceAll('\n', '')
@@ -467,7 +467,7 @@ function getAStructureObjectStringType(type: string, parent: any, node: SynatxNo
467
467
  completionProperty.icon = getNodeiconFromLogic(completionProperty, node);
468
468
  return completionProperty;
469
469
  }
470
- function nextObjectTypeChild(typeKey: string, item: any, node: SynatxNode) {
470
+ function nextObjectTypeChild(typeKey: string, item: any, node: SyntaxNode) {
471
471
  const newType = findNode(typeKey, node);
472
472
  if ((newType as Structure)?.properties && (newType as Structure).properties.length) {
473
473
  // 处理泛型的内容要取到值
@@ -492,7 +492,7 @@ function nextObjectTypeChild(typeKey: string, item: any, node: SynatxNode) {
492
492
  }
493
493
  }
494
494
 
495
- function getNodeTypeVariableData(nodeType: any, item: any, node: SynatxNode) {
495
+ function getNodeTypeVariableData(nodeType: any, item: any, node: SyntaxNode) {
496
496
  item.value = item.text;
497
497
  item.name = item.text;
498
498
  const parentExpression = new Identifier({ name: item.text });
@@ -589,7 +589,7 @@ function getNextFlag(typeKey: string, typeKeyMap: Map<string, number>) {
589
589
  return true;
590
590
  }
591
591
  // 格式化变量数据
592
- export function formatVariableData(data: unknown | variableItem[], node: SynatxNode, parent?: any) {
592
+ export function formatVariableData(data: unknown | variableItem[], node: SyntaxNode, parent?: any) {
593
593
  if (Array.isArray(data)) {
594
594
  let result = data.map((item) => {
595
595
  item.children = [];
@@ -688,7 +688,7 @@ export function formatVariableData(data: unknown | variableItem[], node: SynatxN
688
688
  }
689
689
 
690
690
  // 从logic获取节点的icon
691
- function getNodeiconFromLogic(completionProperty: CompletionProperty, node: SynatxNode): string {
691
+ function getNodeiconFromLogic(completionProperty: CompletionProperty, node: SyntaxNode): string {
692
692
  const { name: propName } = completionProperty;
693
693
  const { view } = node as Param;
694
694
  const logic = (node as Param).logic || (node as Param).OverriddenLogic || (node as Param).AuthLogic || (node as Param).AuthLogicForCallInterface;
@@ -11,7 +11,7 @@ import {
11
11
  LogicItem,
12
12
  Frontend,
13
13
  View,
14
- SynatxNode,
14
+ SyntaxNode,
15
15
  ViewElement,
16
16
  PAGE_COMPONENT_INCLUDE_TAG_MAP,
17
17
  } from '..';
@@ -194,7 +194,7 @@ function getCurrentLogic(
194
194
  }
195
195
  }
196
196
 
197
- export async function getMemberIdentifier(node: SynatxNode) {
197
+ export async function getMemberIdentifier(node: SyntaxNode) {
198
198
  if (node) {
199
199
  // 获取字面量
200
200
  const literals = getLiteralsIdentifier();
@@ -278,7 +278,7 @@ export function getBackendVariablesIdentifier(node: BaseNode): CompletionPropert
278
278
  return newvariables;
279
279
  }
280
280
  // 获取变量
281
- export async function getVariableIdentifier(node: SynatxNode): Promise<CompletionProperty[]> {
281
+ export async function getVariableIdentifier(node: SyntaxNode): Promise<CompletionProperty[]> {
282
282
  let completionData: CompletionProperty[] = [new CompletionProperty({})];
283
283
  // 只获取第一层内容
284
284
  const app = node.getAncestor('App');
@@ -458,7 +458,7 @@ function flatElements(elements: ViewElement[], componentList: CompletionProperty
458
458
  })
459
459
  }
460
460
  // 获取页面组件
461
- export function getPageComponentsIdentifier(node: SynatxNode): CompletionProperty[] {
461
+ export function getPageComponentsIdentifier(node: SyntaxNode): CompletionProperty[] {
462
462
  const { fileNode } = node.getCurrentSource();
463
463
  const stashElements = (fileNode as View).elements;
464
464
  const componentList: CompletionProperty[] = []
@@ -77,10 +77,8 @@ import {
77
77
  Integration,
78
78
  Backend,
79
79
  CallAuthInterface,
80
- AuthLogicForCallInterface,
81
80
  Connector,
82
81
  AuthInterface,
83
- SynatxNode,
84
82
  Connection,
85
83
  TriggerLauncher,
86
84
  CallConnector,
@@ -146,6 +144,8 @@ let isChangeInterface = false; // 判断是否导入接口
146
144
  type ActionNode = { target: Variable; typeannotation: TypeAnnotation };
147
145
  let actionArr: Array<ActionNode> = []; //用于导入接口收集更改的节点
148
146
  let timer: number | null = null; //超时器用于收集导入接口相关
147
+ // naslStdlib文件缓存;作为全局变量给多实例用复用
148
+ const __naslStdlibFileCacheMap: Map<tsProtocol.OpenRequestArgs['file'], tsProtocol.OpenRequestArgs> = new Map();
149
149
 
150
150
  // 联合类型切割取出类型
151
151
  export function getDisplayString2Type(displayString: string) {
@@ -186,7 +186,7 @@ export function getDisplayString2Type(displayString: string) {
186
186
  @sentryMonitorNaslServer
187
187
  class NaslServer {
188
188
  /** naslStdlib文件缓存 */
189
- naslStdlibFileCacheMap: Map<tsProtocol.OpenRequestArgs['file'], tsProtocol.OpenRequestArgs> = new Map();
189
+ naslStdlibFileCacheMap = __naslStdlibFileCacheMap;
190
190
 
191
191
  messager: Messager;
192
192
 
@@ -676,7 +676,7 @@ class NaslServer {
676
676
 
677
677
  // 缓存添加过的文件
678
678
  cacheFile(options: tsProtocol.OpenRequestArgs) {
679
- this.naslStdlibFileCacheMap.set(options.file, options);
679
+ __naslStdlibFileCacheMap.set(options.file, options);
680
680
  }
681
681
 
682
682
  /** u
@@ -1,4 +1,4 @@
1
- import { App, LogicItem, Logic, Module, View, ViewElement, Argument, SelectMembers, SynatxNode, BindDirective, CallLogic } from '../../concepts';
1
+ import { App, LogicItem, Logic, Module, View, ViewElement, Argument, SelectMembers, SyntaxNode, BindDirective, CallLogic } from '../../concepts';
2
2
  import { addBreakpointNodesFromApp } from '../../breakpoint';
3
3
  import { getConceptConstructor } from '../../decorators';
4
4
  import { config } from '../../config';
@@ -206,7 +206,7 @@ async function doAction(app: any, actionItem: any) {
206
206
  try {
207
207
  if (Array.isArray(list)) {
208
208
  list.forEach((event) => {
209
- const emitTarget = event?.originEvent?.target as SynatxNode;
209
+ const emitTarget = event?.originEvent?.target as SyntaxNode;
210
210
  const _path: string = event.originEvent.path;
211
211
  const _root = _path.split('.')?.[1] || '';
212
212
  if (['backend', 'overriddenLogics', 'dataSources', 'processes', 'roles', 'logics', 'enums', 'structures', 'interfaces', 'interfaceDependencies', 'configuration', 'dependencies', 'authLogics', 'authLogicsForCallInterface', 'triggerLaunchers', 'connections'].some((item) => _root.startsWith(item))) {
@@ -11,14 +11,12 @@ export const indent = (tabSize: number) => ' '.repeat(tabSize * 4);
11
11
  * 创建编译器状态
12
12
  */
13
13
  export function createCompilerState(startCode: string = '', options?: Partial<TranslatorState>) {
14
- const state: TranslatorState = Object.assign({
15
- position: {
14
+ const state: TranslatorState = {position: {
16
15
  line: 0,
17
16
  character: 0,
18
17
  offset: 0,
19
18
  },
20
- tabSize: 0,
21
- }, options);
19
+ tabSize: 0, ...options};
22
20
  if (!state.sourceMap)
23
21
  state.sourceMap = new Map<BaseNode, SourceMapItem>();
24
22
 
@@ -29,7 +27,7 @@ export function createCompilerState(startCode: string = '', options?: Partial<Tr
29
27
  * 根据代码移动位置
30
28
  */
31
29
  export function shiftPosition(pos: Position, code: string = ''): Position {
32
- const res = Object.assign({}, pos);
30
+ const res = { ...pos};
33
31
  if (code) {
34
32
  const arr = code.split('\n');
35
33
  res.offset += code.length;
@@ -48,7 +46,7 @@ export function shiftPosition(pos: Position, code: string = ''): Position {
48
46
  * 根据代码移动状态
49
47
  */
50
48
  export function shiftState(state: TranslatorState, code?: string, options?: Partial<TranslatorState>): TranslatorState {
51
- state = Object.assign({}, state);
49
+ state = { ...state};
52
50
  state.position = shiftPosition(state.position, code);
53
51
  Object.assign(state, options); // 优先 options
54
52
  return Object.freeze(state);
@@ -70,8 +68,8 @@ export function withSourceMap() {
70
68
  } catch (err) {}
71
69
  if (!state) {
72
70
  // 没有状态不生成 SourceMap
73
- return oldMethod.call(this);
74
- } else {
71
+ return oldMethod.call(this, state, ...args);
72
+ }
75
73
  // state = Object.freeze(Object.assign({
76
74
  // position: { line: 0, character: 0, offset: 0 },
77
75
  // tabSize: 0,
@@ -96,7 +94,7 @@ export function withSourceMap() {
96
94
  }));
97
95
 
98
96
  return before + code;
99
- }
97
+
100
98
  };
101
99
 
102
100
  return descriptor;