@lcap/nasl 3.7.0-beta.3 → 3.7.0-beta.5

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 (624) hide show
  1. package/dist/README.md +97 -0
  2. package/dist/index.d.ts +26 -0
  3. package/dist/index.js +397 -0
  4. package/dist/index.js.map +1 -0
  5. package/dist/package.json +91 -0
  6. package/dist/src/automate/engine/index.d.ts +4 -0
  7. package/dist/src/automate/engine/operators.d.ts +26 -0
  8. package/dist/src/automate/engine/uniqueName.d.ts +12 -0
  9. package/dist/src/automate/engine/utils.d.ts +25 -0
  10. package/dist/src/automate/engine/viewCache.d.ts +19 -0
  11. package/dist/src/automate/template/myProcess.d.ts +10 -0
  12. package/dist/src/automate/upgrader/2.12.d.ts +7 -0
  13. package/dist/src/automate/upgrader/2.14-components.d.ts +1115 -0
  14. package/dist/src/automate/upgrader/2.14.d.ts +10 -0
  15. package/dist/src/automate/upgrader/2.14.old.d.ts +1 -0
  16. package/dist/src/automate/upgrader/2.16.d.ts +10 -0
  17. package/dist/src/automate/upgrader/2.17.d.ts +21 -0
  18. package/dist/src/automate/upgrader/2.18.d.ts +10 -0
  19. package/dist/src/automate/upgrader/2.20.d.ts +17 -0
  20. package/dist/src/bak/translator.d.ts +1 -0
  21. package/dist/src/breakpoint/generator/AfterStartNode.d.ts +7 -0
  22. package/dist/src/breakpoint/generator/BeforeEndNode.d.ts +7 -0
  23. package/dist/src/breakpoint/generator/BreakpointNode.d.ts +20 -0
  24. package/dist/src/breakpoint/generator/CallbackNode.d.ts +4 -0
  25. package/dist/src/breakpoint/generator/FragmentNode.d.ts +4 -0
  26. package/dist/src/breakpoint/generator/index.d.ts +4 -0
  27. package/dist/src/breakpoint/index.d.ts +3 -0
  28. package/dist/src/breakpoint/shared/constants.d.ts +37 -0
  29. package/dist/src/breakpoint/shared/index.d.ts +3 -0
  30. package/dist/src/breakpoint/shared/operations.d.ts +10 -0
  31. package/dist/src/breakpoint/shared/socket.d.ts +48 -0
  32. package/dist/src/breakpoint/shared/utils.d.ts +27 -0
  33. package/dist/src/breakpoint/store/core.d.ts +80 -0
  34. package/dist/src/breakpoint/store/dock.d.ts +1 -0
  35. package/dist/src/breakpoint/store/index.d.ts +2 -0
  36. package/dist/src/common/BaseNode.d.ts +384 -0
  37. package/dist/src/common/Command.d.ts +21 -0
  38. package/dist/src/common/ComponentAPI.d.ts +112 -0
  39. package/dist/src/common/EventEmitter.d.ts +61 -0
  40. package/dist/src/common/Messager.d.ts +91 -0
  41. package/dist/src/common/asyncFuncMap.d.ts +2 -0
  42. package/dist/src/common/index.d.ts +4 -0
  43. package/dist/src/common/utils.d.ts +2 -0
  44. package/dist/src/concepts/Abort__.d.ts +31 -0
  45. package/dist/src/concepts/AbstractInterface__.d.ts +25 -0
  46. package/dist/src/concepts/Anchor__.d.ts +42 -0
  47. package/dist/src/concepts/AnonymousFunction__.d.ts +144 -0
  48. package/dist/src/concepts/App__.d.ts +1711 -0
  49. package/dist/src/concepts/Argument__.d.ts +64 -0
  50. package/dist/src/concepts/Assignee__.d.ts +294 -0
  51. package/dist/src/concepts/AssignmentLine__.d.ts +43 -0
  52. package/dist/src/concepts/Assignment__.d.ts +57 -0
  53. package/dist/src/concepts/Attribute__.d.ts +75 -0
  54. package/dist/src/concepts/AuthInterface__.d.ts +38 -0
  55. package/dist/src/concepts/AuthLogicForCallInterface__.d.ts +145 -0
  56. package/dist/src/concepts/AuthLogic__.d.ts +69 -0
  57. package/dist/src/concepts/BackendVariable__.d.ts +118 -0
  58. package/dist/src/concepts/Backend__.d.ts +127 -0
  59. package/dist/src/concepts/BaseSetter__.d.ts +25 -0
  60. package/dist/src/concepts/BatchAssignment__.d.ts +244 -0
  61. package/dist/src/concepts/BinaryExpression__.d.ts +61 -0
  62. package/dist/src/concepts/BindAttribute__.d.ts +284 -0
  63. package/dist/src/concepts/BindDirective__.d.ts +156 -0
  64. package/dist/src/concepts/BindEvent__.d.ts +246 -0
  65. package/dist/src/concepts/BindStyle__.d.ts +127 -0
  66. package/dist/src/concepts/Block__.d.ts +88 -0
  67. package/dist/src/concepts/BooleanLiteral__.d.ts +44 -0
  68. package/dist/src/concepts/BusinessComponent__.d.ts +640 -0
  69. package/dist/src/concepts/BusinessLogic__.d.ts +44 -0
  70. package/dist/src/concepts/CallAuthInterface__.d.ts +132 -0
  71. package/dist/src/concepts/CallConnector__.d.ts +55 -0
  72. package/dist/src/concepts/CallEvent__.d.ts +100 -0
  73. package/dist/src/concepts/CallFunction__.d.ts +171 -0
  74. package/dist/src/concepts/CallInterface__.d.ts +143 -0
  75. package/dist/src/concepts/CallLogic__.d.ts +224 -0
  76. package/dist/src/concepts/CallQueryComponent__.d.ts +383 -0
  77. package/dist/src/concepts/CapsulesSetter__.d.ts +109 -0
  78. package/dist/src/concepts/Comment__.d.ts +41 -0
  79. package/dist/src/concepts/CompletionProperty__.d.ts +87 -0
  80. package/dist/src/concepts/ConfigGroup__.d.ts +121 -0
  81. package/dist/src/concepts/ConfigPropertyValue__.d.ts +42 -0
  82. package/dist/src/concepts/ConfigProperty__.d.ts +147 -0
  83. package/dist/src/concepts/Configuration__.d.ts +120 -0
  84. package/dist/src/concepts/Connection__.d.ts +159 -0
  85. package/dist/src/concepts/ConnectorLogic__.d.ts +33 -0
  86. package/dist/src/concepts/ConnectorTriggerLauncher__.d.ts +44 -0
  87. package/dist/src/concepts/ConnectorTrigger__.d.ts +76 -0
  88. package/dist/src/concepts/Connector__.d.ts +532 -0
  89. package/dist/src/concepts/Constant__.d.ts +94 -0
  90. package/dist/src/concepts/CountersignPolicy__.d.ts +29 -0
  91. package/dist/src/concepts/DataSource__.d.ts +163 -0
  92. package/dist/src/concepts/DatabaseTypeAnnotation__.d.ts +35 -0
  93. package/dist/src/concepts/DefaultValue__.d.ts +94 -0
  94. package/dist/src/concepts/Destination__.d.ts +150 -0
  95. package/dist/src/concepts/End__.d.ts +30 -0
  96. package/dist/src/concepts/EntityIndex__.d.ts +93 -0
  97. package/dist/src/concepts/EntityProperty__.d.ts +255 -0
  98. package/dist/src/concepts/Entity__.d.ts +332 -0
  99. package/dist/src/concepts/EnumItem__.d.ts +83 -0
  100. package/dist/src/concepts/EnumSelectSetter__.d.ts +109 -0
  101. package/dist/src/concepts/Enum__.d.ts +133 -0
  102. package/dist/src/concepts/EventDeclaration__.d.ts +41 -0
  103. package/dist/src/concepts/Event__.d.ts +149 -0
  104. package/dist/src/concepts/ExternalDestination__.d.ts +63 -0
  105. package/dist/src/concepts/ForEachStatement__.d.ts +126 -0
  106. package/dist/src/concepts/FrontendLibrary__.d.ts +208 -0
  107. package/dist/src/concepts/FrontendType__.d.ts +304 -0
  108. package/dist/src/concepts/FrontendVariable__.d.ts +41 -0
  109. package/dist/src/concepts/Frontend__.d.ts +389 -0
  110. package/dist/src/concepts/Function__.d.ts +399 -0
  111. package/dist/src/concepts/I18nInfo__.d.ts +47 -0
  112. package/dist/src/concepts/IconSetter__.d.ts +29 -0
  113. package/dist/src/concepts/Identifier__.d.ts +66 -0
  114. package/dist/src/concepts/IfStatement__.d.ts +155 -0
  115. package/dist/src/concepts/ImageSetter__.d.ts +25 -0
  116. package/dist/src/concepts/ImportedInterface__.d.ts +29 -0
  117. package/dist/src/concepts/InputSetter__.d.ts +29 -0
  118. package/dist/src/concepts/Integration__.d.ts +127 -0
  119. package/dist/src/concepts/InterfaceParam__.d.ts +119 -0
  120. package/dist/src/concepts/InterfaceTriggerEvent__.d.ts +34 -0
  121. package/dist/src/concepts/Interface__.d.ts +323 -0
  122. package/dist/src/concepts/JSBlock__.d.ts +38 -0
  123. package/dist/src/concepts/JavaLogic__.d.ts +50 -0
  124. package/dist/src/concepts/LogicDeclaration__.d.ts +289 -0
  125. package/dist/src/concepts/LogicItem__.d.ts +171 -0
  126. package/dist/src/concepts/Logic__.d.ts +632 -0
  127. package/dist/src/concepts/MatchCase__.d.ts +264 -0
  128. package/dist/src/concepts/Match__.d.ts +122 -0
  129. package/dist/src/concepts/MemberExpression__.d.ts +64 -0
  130. package/dist/src/concepts/MetadataType__.d.ts +220 -0
  131. package/dist/src/concepts/MicroApp__.d.ts +53 -0
  132. package/dist/src/concepts/Module__.d.ts +1142 -0
  133. package/dist/src/concepts/MsgTriggerEvent__.d.ts +138 -0
  134. package/dist/src/concepts/MsgTriggerLauncher__.d.ts +119 -0
  135. package/dist/src/concepts/MultiApprovalPolicy__.d.ts +25 -0
  136. package/dist/src/concepts/Namespace__.d.ts +1060 -0
  137. package/dist/src/concepts/NewComposite__.d.ts +346 -0
  138. package/dist/src/concepts/NewList__.d.ts +135 -0
  139. package/dist/src/concepts/NewMap__.d.ts +226 -0
  140. package/dist/src/concepts/New__.d.ts +30 -0
  141. package/dist/src/concepts/NullLiteral__.d.ts +36 -0
  142. package/dist/src/concepts/NumberInputSetter__.d.ts +45 -0
  143. package/dist/src/concepts/NumericLiteral__.d.ts +53 -0
  144. package/dist/src/concepts/OqlQueryComponent__.d.ts +67 -0
  145. package/dist/src/concepts/OverriddenLogic__.d.ts +615 -0
  146. package/dist/src/concepts/Paginate__.d.ts +59 -0
  147. package/dist/src/concepts/ParamWithGroup__.d.ts +44 -0
  148. package/dist/src/concepts/Param__.d.ts +140 -0
  149. package/dist/src/concepts/Point__.d.ts +33 -0
  150. package/dist/src/concepts/ProcessComponent__.d.ts +214 -0
  151. package/dist/src/concepts/ProcessElement__.d.ts +620 -0
  152. package/dist/src/concepts/ProcessOutcome__.d.ts +35 -0
  153. package/dist/src/concepts/ProcessOutcomes__.d.ts +35 -0
  154. package/dist/src/concepts/Process__.d.ts +605 -0
  155. package/dist/src/concepts/PropDeclaration__.d.ts +99 -0
  156. package/dist/src/concepts/PropertySelectSetter__.d.ts +25 -0
  157. package/dist/src/concepts/QueryAggregateExpression__.d.ts +50 -0
  158. package/dist/src/concepts/QueryFieldExpression__.d.ts +66 -0
  159. package/dist/src/concepts/QueryFromExpression__.d.ts +107 -0
  160. package/dist/src/concepts/QueryGroupByExpression__.d.ts +46 -0
  161. package/dist/src/concepts/QueryJoinExpression__.d.ts +194 -0
  162. package/dist/src/concepts/QueryLimitExpression__.d.ts +46 -0
  163. package/dist/src/concepts/QueryOrderByExpression__.d.ts +57 -0
  164. package/dist/src/concepts/QuerySelectExpression__.d.ts +213 -0
  165. package/dist/src/concepts/Rect__.d.ts +41 -0
  166. package/dist/src/concepts/Return__.d.ts +120 -0
  167. package/dist/src/concepts/Role__.d.ts +58 -0
  168. package/dist/src/concepts/SelectMembers__.d.ts +134 -0
  169. package/dist/src/concepts/SequentialPolicy__.d.ts +25 -0
  170. package/dist/src/concepts/SetterOption__.d.ts +49 -0
  171. package/dist/src/concepts/SlotDeclaration__.d.ts +213 -0
  172. package/dist/src/concepts/Slot__.d.ts +53 -0
  173. package/dist/src/concepts/SqlQueryComponent__.d.ts +63 -0
  174. package/dist/src/concepts/Start__.d.ts +30 -0
  175. package/dist/src/concepts/StaticString__.d.ts +49 -0
  176. package/dist/src/concepts/StringInterpolation__.d.ts +122 -0
  177. package/dist/src/concepts/StringLiteral__.d.ts +51 -0
  178. package/dist/src/concepts/StructureProperty__.d.ts +119 -0
  179. package/dist/src/concepts/Structure__.d.ts +243 -0
  180. package/dist/src/concepts/SwitchCase__.d.ts +91 -0
  181. package/dist/src/concepts/SwitchSetter__.d.ts +25 -0
  182. package/dist/src/concepts/SwitchStatement__.d.ts +90 -0
  183. package/dist/src/concepts/ThemeVariable__.d.ts +29 -0
  184. package/dist/src/concepts/Theme__.d.ts +39 -0
  185. package/dist/src/concepts/Transactional__.d.ts +85 -0
  186. package/dist/src/concepts/TriggerEvent__.d.ts +42 -0
  187. package/dist/src/concepts/TriggerLauncher__.d.ts +76 -0
  188. package/dist/src/concepts/TypeAnnotation__.d.ts +303 -0
  189. package/dist/src/concepts/TypeParam__.d.ts +34 -0
  190. package/dist/src/concepts/UnaryExpression__.d.ts +45 -0
  191. package/dist/src/concepts/Unparsed__.d.ts +41 -0
  192. package/dist/src/concepts/UseComponent__.d.ts +33 -0
  193. package/dist/src/concepts/ValidationRule__.d.ts +133 -0
  194. package/dist/src/concepts/Variable__.d.ts +137 -0
  195. package/dist/src/concepts/ViewBlockWithImage__.d.ts +33 -0
  196. package/dist/src/concepts/ViewBlock__.d.ts +37 -0
  197. package/dist/src/concepts/ViewComponentDeclaration__.d.ts +721 -0
  198. package/dist/src/concepts/ViewElement__.d.ts +652 -0
  199. package/dist/src/concepts/View__.d.ts +728 -0
  200. package/dist/src/concepts/WhileStatement__.d.ts +94 -0
  201. package/dist/src/concepts/basics/constants.d.ts +1 -0
  202. package/dist/src/concepts/basics/stdlib/index.d.ts +16 -0
  203. package/dist/src/concepts/basics/stdlib/nasl.auth.d.ts +9 -0
  204. package/dist/src/concepts/basics/stdlib/nasl.browser.d.ts +5 -0
  205. package/dist/src/concepts/basics/stdlib/nasl.collection.d.ts +9 -0
  206. package/dist/src/concepts/basics/stdlib/nasl.configuration.d.ts +9 -0
  207. package/dist/src/concepts/basics/stdlib/nasl.core.d.ts +7 -0
  208. package/dist/src/concepts/basics/stdlib/nasl.event.d.ts +5 -0
  209. package/dist/src/concepts/basics/stdlib/nasl.http.d.ts +9 -0
  210. package/dist/src/concepts/basics/stdlib/nasl.interface.d.ts +9 -0
  211. package/dist/src/concepts/basics/stdlib/nasl.io.d.ts +5 -0
  212. package/dist/src/concepts/basics/stdlib/nasl.logging.d.ts +5 -0
  213. package/dist/src/concepts/basics/stdlib/nasl.process.d.ts +9 -0
  214. package/dist/src/concepts/basics/stdlib/nasl.ui.d.ts +9 -0
  215. package/dist/src/concepts/basics/stdlib/nasl.util.d.ts +6 -0
  216. package/dist/src/concepts/basics/stdlib/nasl.validation.d.ts +5 -0
  217. package/dist/src/concepts/basics/stdlib/reference2TypeAnnotationList.d.ts +4 -0
  218. package/dist/src/concepts/basics/stdlib/timeZone.d.ts +5 -0
  219. package/dist/src/concepts/basics/types/coreTypeList.d.ts +2 -0
  220. package/dist/src/concepts/basics/types/index.d.ts +17 -0
  221. package/dist/src/concepts/index.d.ts +7 -0
  222. package/dist/src/concepts/index__.d.ts +156 -0
  223. package/dist/src/concepts/utils/asserts.d.ts +7825 -0
  224. package/dist/src/concepts/utils/quick-info.d.ts +13 -0
  225. package/dist/src/concepts/utils/types.d.ts +510 -0
  226. package/dist/src/config.d.ts +52 -0
  227. package/dist/src/decorators/index.d.ts +67 -0
  228. package/dist/src/decorators/promise.d.ts +7 -0
  229. package/dist/src/enums/KEYWORDS.d.ts +6 -0
  230. package/dist/src/enums/LEVEL_NAME_MAP.d.ts +26 -0
  231. package/dist/src/eventBus.d.ts +3 -0
  232. package/dist/src/generator/compileComponent.d.ts +11 -0
  233. package/dist/src/generator/genBundleFiles.d.ts +37 -0
  234. package/dist/src/generator/genHash.d.ts +7 -0
  235. package/dist/src/generator/genMetaData.d.ts +31 -0
  236. package/dist/src/generator/icestark.d.ts +2 -0
  237. package/dist/src/generator/index.d.ts +7 -0
  238. package/dist/src/generator/microApp.d.ts +2 -0
  239. package/dist/src/generator/permission.d.ts +14 -0
  240. package/dist/src/generator/qiankun.d.ts +2 -0
  241. package/dist/src/generator/release-body/body.d.ts +42 -0
  242. package/dist/src/generator/release-body/data.d.ts +45 -0
  243. package/dist/src/generator/release-body/index.d.ts +2 -0
  244. package/dist/src/generator/release-body/internal.d.ts +622 -0
  245. package/dist/src/generator/release-body/types.d.ts +57 -0
  246. package/dist/src/generator/release-body/utils.d.ts +418 -0
  247. package/dist/src/generator/release-body/validation.d.ts +3 -0
  248. package/dist/src/generator/styleReplacer.d.ts +3 -0
  249. package/dist/src/index.d.ts +14 -0
  250. package/dist/src/manager/diagnostic.d.ts +39 -0
  251. package/dist/src/manager/stepRecorder.d.ts +20 -0
  252. package/dist/src/natural/componentData.d.ts +31 -0
  253. package/dist/src/natural/genNaturalTS.d.ts +241 -0
  254. package/dist/src/natural/index.d.ts +6 -0
  255. package/dist/src/natural/naslStdlibMap.d.ts +1 -0
  256. package/dist/src/natural/prompt/analyzeClaims.d.ts +1 -0
  257. package/dist/src/natural/prompt/analyzeFormatOutput.d.ts +1 -0
  258. package/dist/src/natural/prompt/analyzeTasks.d.ts +1 -0
  259. package/dist/src/natural/prompt/executeClaims.d.ts +1 -0
  260. package/dist/src/natural/transformTSCode.d.ts +7 -0
  261. package/dist/src/sentry/index.d.ts +34 -0
  262. package/dist/src/server/createUiTs.d.ts +17 -0
  263. package/dist/src/server/entity2LogicNamespace.d.ts +10 -0
  264. package/dist/src/server/event.d.ts +30 -0
  265. package/dist/src/server/extendBaseNode.d.ts +1 -0
  266. package/dist/src/server/formatTsUtils.d.ts +36 -0
  267. package/dist/src/server/getConnector.d.ts +15 -0
  268. package/dist/src/server/getExtensionModules.d.ts +3 -0
  269. package/dist/src/server/getFunctions.d.ts +3 -0
  270. package/dist/src/server/getInterfaces.d.ts +2 -0
  271. package/dist/src/server/getLogging.d.ts +1 -0
  272. package/dist/src/server/getLogics.d.ts +5 -0
  273. package/dist/src/server/getMemberIdentifier.d.ts +17 -0
  274. package/dist/src/server/getProcessComponents.d.ts +2 -0
  275. package/dist/src/server/getProcesses.d.ts +33 -0
  276. package/dist/src/server/getScope.d.ts +13 -0
  277. package/dist/src/server/getValidates.d.ts +3 -0
  278. package/dist/src/server/index.d.ts +5 -0
  279. package/dist/src/server/naslServer.d.ts +391 -0
  280. package/dist/src/server/naslStdlibMap.d.ts +2 -0
  281. package/dist/src/server/process2LogicNamespace.d.ts +26 -0
  282. package/dist/src/server/translator.d.ts +26 -0
  283. package/dist/src/service/creator/add.configs.d.ts +1 -0
  284. package/dist/src/service/creator/errHandles.d.ts +18 -0
  285. package/dist/src/service/creator/index.d.ts +1 -0
  286. package/dist/src/service/datasource/api.d.ts +12 -0
  287. package/dist/src/service/datasource/index.d.ts +2 -0
  288. package/dist/src/service/logic/api.d.ts +9 -0
  289. package/dist/src/service/logic/checktypeSocket.d.ts +5 -0
  290. package/dist/src/service/logic/index.d.ts +2 -0
  291. package/dist/src/service/storage/api.d.ts +54 -0
  292. package/dist/src/service/storage/index.d.ts +2 -0
  293. package/dist/src/service/storage/init.d.ts +105 -0
  294. package/dist/src/service/storage/jsoner.d.ts +36 -0
  295. package/dist/src/service/storage/map.d.ts +4 -0
  296. package/dist/src/service/storage/service.d.ts +25 -0
  297. package/dist/src/service/storage/storagePoint.d.ts +17 -0
  298. package/dist/src/service/video/BaseService.d.ts +7 -0
  299. package/dist/src/service/video/MainCallbackService.d.ts +12 -0
  300. package/dist/src/service/video/VideoTranscribe.d.ts +15 -0
  301. package/dist/src/service/video/publishService.d.ts +1 -0
  302. package/dist/src/templator/genCallComponentLogic.d.ts +17 -0
  303. package/dist/src/templator/genCreateBlock.d.ts +10 -0
  304. package/dist/src/templator/genCurdEditMultipleKeyBlock.d.ts +8 -0
  305. package/dist/src/templator/genCurdMultipleKeyBlock.d.ts +61 -0
  306. package/dist/src/templator/genEditTableBlock.d.ts +51 -0
  307. package/dist/src/templator/genEnumSelectBlock.d.ts +10 -0
  308. package/dist/src/templator/genGetBlock.d.ts +6 -0
  309. package/dist/src/templator/genGridViewBlock.d.ts +55 -0
  310. package/dist/src/templator/genListViewBlock.d.ts +19 -0
  311. package/dist/src/templator/genQueryComponent.d.ts +34 -0
  312. package/dist/src/templator/genSelectBlock.d.ts +45 -0
  313. package/dist/src/templator/genTableBlock.d.ts +55 -0
  314. package/dist/src/templator/genUpdateBlock.d.ts +6 -0
  315. package/dist/src/templator/index.d.ts +19 -0
  316. package/dist/src/templator/utils.d.ts +683 -0
  317. package/dist/src/translator/constant.d.ts +6 -0
  318. package/dist/src/translator/index.d.ts +3 -0
  319. package/dist/src/translator/types.d.ts +85 -0
  320. package/dist/src/translator/utils.d.ts +47 -0
  321. package/dist/src/utils/cookie.d.ts +9 -0
  322. package/dist/src/utils/create.d.ts +2 -0
  323. package/dist/src/utils/env.d.ts +2 -0
  324. package/dist/src/utils/file.d.ts +33 -0
  325. package/dist/src/utils/i18nInfo.d.ts +5 -0
  326. package/dist/src/utils/index.d.ts +72 -0
  327. package/dist/src/utils/logger.d.ts +8 -0
  328. package/dist/src/utils/sortTsString.d.ts +1 -0
  329. package/dist/src/utils/string.d.ts +64 -0
  330. package/dist/src/utils/time-slicing/constant.d.ts +35 -0
  331. package/dist/src/utils/time-slicing/controller.d.ts +53 -0
  332. package/dist/src/utils/time-slicing/index.d.ts +5 -0
  333. package/dist/src/utils/time-slicing/page-state.d.ts +2 -0
  334. package/dist/src/utils/time-slicing/performance.d.ts +11 -0
  335. package/dist/src/utils/time-slicing/runner.d.ts +12 -0
  336. package/dist/src/utils/time-slicing/tool.d.ts +24 -0
  337. package/dist/src/utils/time-slicing/utils.d.ts +62 -0
  338. package/dist/src/utils/time-slicing/wrapper.d.ts +18 -0
  339. package/dist/src/utils/traverse.d.ts +36 -0
  340. package/dist/src/utils/types.d.ts +13 -0
  341. package/dist/src/utils/window.d.ts +7 -0
  342. package/dist/test/concepts/anonymous-function/constant.d.ts +2 -0
  343. package/dist/test/concepts/anonymous-function/toEmbeddedTS.spec.d.ts +1 -0
  344. package/dist/test/concepts/anonymous-function/toJS.spec.d.ts +1 -0
  345. package/dist/test/concepts/anonymous-function/toVue.spec.d.ts +1 -0
  346. package/dist/test/concepts/assignment/constant.d.ts +2 -0
  347. package/dist/test/concepts/assignment/toEmbeddedTS.spec.d.ts +1 -0
  348. package/dist/test/concepts/assignment/toJS.spec.d.ts +1 -0
  349. package/dist/test/concepts/assignment/toVue.spec.d.ts +1 -0
  350. package/dist/test/concepts/batch-assignment/constant.d.ts +2 -0
  351. package/dist/test/concepts/batch-assignment/toEmbeddedTS.spec.d.ts +1 -0
  352. package/dist/test/concepts/batch-assignment/toJS.spec.d.ts +1 -0
  353. package/dist/test/concepts/batch-assignment/toVue.spec.d.ts +1 -0
  354. package/dist/test/concepts/binary-expression/constant.d.ts +2 -0
  355. package/dist/test/concepts/binary-expression/getQuickInfoOffset.spec.d.ts +1 -0
  356. package/dist/test/concepts/binary-expression/toEmbeddedTS.spec.d.ts +1 -0
  357. package/dist/test/concepts/binary-expression/toJS.spec.d.ts +1 -0
  358. package/dist/test/concepts/binary-expression/toVue.spec.d.ts +1 -0
  359. package/dist/test/concepts/boolean-literal/constant.d.ts +2 -0
  360. package/dist/test/concepts/boolean-literal/toEmbeddedTS.spec.d.ts +1 -0
  361. package/dist/test/concepts/boolean-literal/toJS.spec.d.ts +1 -0
  362. package/dist/test/concepts/boolean-literal/toVue.spec.d.ts +1 -0
  363. package/dist/test/concepts/call-function/constant.d.ts +2 -0
  364. package/dist/test/concepts/call-function/getQuickInfoOffset.spec.d.ts +1 -0
  365. package/dist/test/concepts/call-function/toEmbeddedTS.spec.d.ts +1 -0
  366. package/dist/test/concepts/call-function/toJS.spec.d.ts +1 -0
  367. package/dist/test/concepts/call-interface/constant.d.ts +2 -0
  368. package/dist/test/concepts/call-interface/getQuickInfoOffset.spec.d.ts +1 -0
  369. package/dist/test/concepts/call-interface/toEmbeddedTS.spec.d.ts +1 -0
  370. package/dist/test/concepts/call-interface/toJS.spec.d.ts +1 -0
  371. package/dist/test/concepts/call-logic/constant.d.ts +2 -0
  372. package/dist/test/concepts/call-logic/getQuickInfoOffset.spec.d.ts +1 -0
  373. package/dist/test/concepts/call-logic/toEmbeddedTS.spec.d.ts +1 -0
  374. package/dist/test/concepts/call-logic/toJS.spec.d.ts +1 -0
  375. package/dist/test/concepts/call-logic/toUI.spec.d.ts +1 -0
  376. package/dist/test/concepts/call-logic/toVue.spec.d.ts +1 -0
  377. package/dist/test/concepts/call-logic/toVueDesigner.spec.d.ts +1 -0
  378. package/dist/test/concepts/data-source/constant.d.ts +2 -0
  379. package/dist/test/concepts/data-source/toEmbeddedTS.spec.d.ts +1 -0
  380. package/dist/test/concepts/data-source/toEmbeddedTSFile.spec.d.ts +1 -0
  381. package/dist/test/concepts/entity/constant.d.ts +2 -0
  382. package/dist/test/concepts/entity/toEmbeddedTS.spec.d.ts +1 -0
  383. package/dist/test/concepts/entity/toEmbeddedTSFile.spec.d.ts +1 -0
  384. package/dist/test/concepts/identifier/constant.d.ts +2 -0
  385. package/dist/test/concepts/identifier/toEmbeddedTS.spec.d.ts +1 -0
  386. package/dist/test/concepts/identifier/toJS.spec.d.ts +1 -0
  387. package/dist/test/concepts/identifier/toVue.spec.d.ts +1 -0
  388. package/dist/test/concepts/match/constant.d.ts +2 -0
  389. package/dist/test/concepts/match/toEmbeddedTS.spec.d.ts +1 -0
  390. package/dist/test/concepts/match/toJS.spec.d.ts +1 -0
  391. package/dist/test/concepts/member-expression/constant.d.ts +2 -0
  392. package/dist/test/concepts/member-expression/toEmbeddedTS.spec.d.ts +1 -0
  393. package/dist/test/concepts/member-expression/toJS.spec.d.ts +1 -0
  394. package/dist/test/concepts/member-expression/toVue.spec.d.ts +1 -0
  395. package/dist/test/concepts/new-composite/constant.d.ts +2 -0
  396. package/dist/test/concepts/new-composite/getQuickInfoOffset.spec.d.ts +1 -0
  397. package/dist/test/concepts/new-composite/toEmbeddedTS.spec.d.ts +1 -0
  398. package/dist/test/concepts/new-composite/toJS.spec.d.ts +1 -0
  399. package/dist/test/concepts/new-list/constant.d.ts +2 -0
  400. package/dist/test/concepts/new-list/getQuickInfoOffset.spec.d.ts +1 -0
  401. package/dist/test/concepts/new-list/toEmbeddedTS.spec.d.ts +1 -0
  402. package/dist/test/concepts/new-list/toJS.spec.d.ts +1 -0
  403. package/dist/test/concepts/new-map/constant.d.ts +2 -0
  404. package/dist/test/concepts/new-map/getQuickInfoOffset.spec.d.ts +1 -0
  405. package/dist/test/concepts/new-map/toEmbeddedTS.spec.d.ts +1 -0
  406. package/dist/test/concepts/new-map/toJS.spec.d.ts +1 -0
  407. package/dist/test/concepts/null-literal/constant.d.ts +2 -0
  408. package/dist/test/concepts/null-literal/toEmbeddedTS.spec.d.ts +1 -0
  409. package/dist/test/concepts/null-literal/toJS.spec.d.ts +1 -0
  410. package/dist/test/concepts/null-literal/toVue.spec.d.ts +1 -0
  411. package/dist/test/concepts/numeric-literal/constant.d.ts +2 -0
  412. package/dist/test/concepts/numeric-literal/toEmbeddedTS.spec.d.ts +1 -0
  413. package/dist/test/concepts/numeric-literal/toJS.spec.d.ts +1 -0
  414. package/dist/test/concepts/numeric-literal/toVue.spec.d.ts +1 -0
  415. package/dist/test/concepts/string-literal/constant.d.ts +2 -0
  416. package/dist/test/concepts/string-literal/toEmbeddedTS.spec.d.ts +1 -0
  417. package/dist/test/concepts/string-literal/toJS.spec.d.ts +1 -0
  418. package/dist/test/concepts/string-literal/toVue.spec.d.ts +1 -0
  419. package/dist/test/concepts/utils.d.ts +13 -0
  420. package/dist/test/concepts/validation-rule/constant.d.ts +2 -0
  421. package/dist/test/concepts/validation-rule/toEmbeddedTS.spec.d.ts +1 -0
  422. package/dist/test/concepts/validation-rule/toJS.spec.d.ts +1 -0
  423. package/dist/test/concepts/validation-rule/validation-rule.spec.d.ts +1 -0
  424. package/dist/test/concepts/view-element/constant.d.ts +2 -0
  425. package/dist/test/concepts/view-element/toEmbeddedTS.spec.d.ts +1 -0
  426. package/dist/test/concepts/view-element/toVue.spec.d.ts +1 -0
  427. package/dist/test/setup.d.ts +1 -0
  428. package/dist/test/time-slicing/runner.spec.d.ts +1 -0
  429. package/dist/test/time-slicing/time-slicing-nodejs.spec.d.ts +1 -0
  430. package/dist/test/time-slicing/utils.d.ts +1 -0
  431. package/dist/test/time-slicing/wrapper.spec.d.ts +1 -0
  432. package/out/automate/engine/utils.js +1 -1
  433. package/out/automate/engine/utils.js.map +1 -1
  434. package/out/breakpoint/store/core.js +1 -7
  435. package/out/breakpoint/store/core.js.map +1 -1
  436. package/out/common/BaseNode.js +1 -1
  437. package/out/common/BaseNode.js.map +1 -1
  438. package/out/concepts/App__.d.ts +5 -1
  439. package/out/concepts/App__.js +30 -14
  440. package/out/concepts/App__.js.map +1 -1
  441. package/out/concepts/Argument__.js +5 -0
  442. package/out/concepts/Argument__.js.map +1 -1
  443. package/out/concepts/AuthLogicForCallInterface__.d.ts +1 -0
  444. package/out/concepts/AuthLogicForCallInterface__.js +15 -4
  445. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -1
  446. package/out/concepts/BindAttribute__.js +1 -1
  447. package/out/concepts/BindAttribute__.js.map +1 -1
  448. package/out/concepts/BindDirective__.js +1 -1
  449. package/out/concepts/BindDirective__.js.map +1 -1
  450. package/out/concepts/CallAuthInterface__.js +5 -1
  451. package/out/concepts/CallAuthInterface__.js.map +1 -1
  452. package/out/concepts/CallInterface__.d.ts +9 -1
  453. package/out/concepts/CallInterface__.js +105 -16
  454. package/out/concepts/CallInterface__.js.map +1 -1
  455. package/out/concepts/Connection__.d.ts +2 -1
  456. package/out/concepts/ConnectorLogic__.d.ts +33 -0
  457. package/out/concepts/ConnectorLogic__.js +69 -0
  458. package/out/concepts/ConnectorLogic__.js.map +1 -0
  459. package/out/concepts/ConnectorTriggerLauncher__.d.ts +44 -0
  460. package/out/concepts/ConnectorTriggerLauncher__.js +99 -0
  461. package/out/concepts/ConnectorTriggerLauncher__.js.map +1 -0
  462. package/out/concepts/ConnectorTrigger__.d.ts +5 -4
  463. package/out/concepts/ConnectorTrigger__.js +39 -4
  464. package/out/concepts/ConnectorTrigger__.js.map +1 -1
  465. package/out/concepts/Connector__.d.ts +1 -0
  466. package/out/concepts/Connector__.js +5 -0
  467. package/out/concepts/Connector__.js.map +1 -1
  468. package/out/concepts/End__.js +1 -0
  469. package/out/concepts/End__.js.map +1 -1
  470. package/out/concepts/EnumItem__.js +1 -1
  471. package/out/concepts/EnumItem__.js.map +1 -1
  472. package/out/concepts/InterfaceTriggerEvent__.d.ts +34 -0
  473. package/out/concepts/InterfaceTriggerEvent__.js +72 -0
  474. package/out/concepts/InterfaceTriggerEvent__.js.map +1 -0
  475. package/out/concepts/Interface__.d.ts +3 -3
  476. package/out/concepts/Interface__.js +7 -6
  477. package/out/concepts/Interface__.js.map +1 -1
  478. package/out/concepts/LogicItem__.d.ts +5 -0
  479. package/out/concepts/LogicItem__.js +6 -0
  480. package/out/concepts/LogicItem__.js.map +1 -1
  481. package/out/concepts/Logic__.d.ts +1 -1
  482. package/out/concepts/Logic__.js +5 -1
  483. package/out/concepts/Logic__.js.map +1 -1
  484. package/out/concepts/MatchCase__.js.map +1 -1
  485. package/out/concepts/Module__.js +1 -0
  486. package/out/concepts/Module__.js.map +1 -1
  487. package/out/concepts/MsgTriggerLauncher__.d.ts +3 -10
  488. package/out/concepts/MsgTriggerLauncher__.js +6 -19
  489. package/out/concepts/MsgTriggerLauncher__.js.map +1 -1
  490. package/out/concepts/OqlQueryComponent__.js +2 -1
  491. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  492. package/out/concepts/Param__.d.ts +1 -1
  493. package/out/concepts/Param__.js.map +1 -1
  494. package/out/concepts/Structure__.js +4 -4
  495. package/out/concepts/Structure__.js.map +1 -1
  496. package/out/concepts/TriggerEvent__.d.ts +2 -2
  497. package/out/concepts/TriggerEvent__.js +1 -1
  498. package/out/concepts/TriggerEvent__.js.map +1 -1
  499. package/out/concepts/TriggerLauncher__.d.ts +1 -1
  500. package/out/concepts/TriggerLauncher__.js +18 -1
  501. package/out/concepts/TriggerLauncher__.js.map +1 -1
  502. package/out/concepts/ViewElement__.d.ts +1 -0
  503. package/out/concepts/ViewElement__.js +7 -0
  504. package/out/concepts/ViewElement__.js.map +1 -1
  505. package/out/concepts/basics/stdlib/nasl.browser.js +42 -0
  506. package/out/concepts/basics/stdlib/nasl.browser.js.map +1 -1
  507. package/out/concepts/basics/stdlib/nasl.configuration.js +8 -0
  508. package/out/concepts/basics/stdlib/nasl.configuration.js.map +1 -1
  509. package/out/concepts/basics/stdlib/nasl.util.js +217 -1
  510. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  511. package/out/concepts/index__.d.ts +3 -0
  512. package/out/concepts/index__.js +3 -0
  513. package/out/concepts/index__.js.map +1 -1
  514. package/out/concepts/utils/asserts.d.ts +145 -17
  515. package/out/concepts/utils/asserts.js +212 -39
  516. package/out/concepts/utils/asserts.js.map +1 -1
  517. package/out/concepts/utils/types.d.ts +15 -4
  518. package/out/generator/genBundleFiles.js +15 -2
  519. package/out/generator/genBundleFiles.js.map +1 -1
  520. package/out/generator/genMetaData.js +1 -0
  521. package/out/generator/genMetaData.js.map +1 -1
  522. package/out/generator/permission.js +1 -0
  523. package/out/generator/permission.js.map +1 -1
  524. package/out/generator/release-body/body.d.ts +1 -0
  525. package/out/generator/release-body/body.js +7 -4
  526. package/out/generator/release-body/body.js.map +1 -1
  527. package/out/generator/release-body/data.d.ts +1 -0
  528. package/out/generator/release-body/data.js +10 -7
  529. package/out/generator/release-body/data.js.map +1 -1
  530. package/out/generator/release-body/internal.d.ts +1 -0
  531. package/out/generator/release-body/internal.js.map +1 -1
  532. package/out/generator/release-body/types.d.ts +2 -0
  533. package/out/manager/diagnostic.d.ts +6 -2
  534. package/out/manager/diagnostic.js +28 -23
  535. package/out/manager/diagnostic.js.map +1 -1
  536. package/out/natural/prompt/analyzeClaims.js +2 -0
  537. package/out/natural/prompt/analyzeClaims.js.map +1 -1
  538. package/out/natural/prompt/analyzeFormatOutput.js +1 -0
  539. package/out/natural/prompt/analyzeFormatOutput.js.map +1 -1
  540. package/out/natural/prompt/analyzeTasks.js +3 -1
  541. package/out/natural/prompt/analyzeTasks.js.map +1 -1
  542. package/out/natural/prompt/executeClaims.js +4 -0
  543. package/out/natural/prompt/executeClaims.js.map +1 -1
  544. package/out/natural/transformTSCode.js +32 -4
  545. package/out/natural/transformTSCode.js.map +1 -1
  546. package/out/server/extendBaseNode.js +36 -3
  547. package/out/server/extendBaseNode.js.map +1 -1
  548. package/out/server/formatTsUtils.d.ts +1 -1
  549. package/out/server/formatTsUtils.js +7 -3
  550. package/out/server/formatTsUtils.js.map +1 -1
  551. package/out/server/getConnector.d.ts +4 -4
  552. package/out/server/getConnector.js +3 -3
  553. package/out/server/getConnector.js.map +1 -1
  554. package/out/server/getExtensionModules.d.ts +1 -1
  555. package/out/server/getLogics.js +20 -6
  556. package/out/server/getLogics.js.map +1 -1
  557. package/out/server/naslServer.d.ts +5 -4
  558. package/out/server/naslServer.js +133 -59
  559. package/out/server/naslServer.js.map +1 -1
  560. package/out/service/storage/init.js +2 -2
  561. package/out/service/storage/init.js.map +1 -1
  562. package/out/utils/index.d.ts +5 -0
  563. package/out/utils/index.js +36 -1
  564. package/out/utils/index.js.map +1 -1
  565. package/package.json +1 -1
  566. package/sandbox/stdlib/nasl.browser.ts +5 -0
  567. package/sandbox/stdlib/nasl.util.ts +3 -1
  568. package/src/automate/engine/utils.js +1 -1
  569. package/src/breakpoint/store/core.ts +2 -7
  570. package/src/common/BaseNode.ts +1 -1
  571. package/src/concepts/App__.ts +32 -16
  572. package/src/concepts/Argument__.ts +6 -0
  573. package/src/concepts/AuthLogicForCallInterface__.ts +15 -4
  574. package/src/concepts/BindAttribute__.ts +1 -1
  575. package/src/concepts/BindDirective__.ts +1 -1
  576. package/src/concepts/CallAuthInterface__.ts +8 -1
  577. package/src/concepts/CallInterface__.ts +121 -16
  578. package/src/concepts/Connection__.ts +1 -1
  579. package/src/concepts/ConnectorLogic__.ts +84 -0
  580. package/src/concepts/ConnectorTriggerLauncher__.ts +117 -0
  581. package/src/concepts/ConnectorTrigger__.ts +38 -5
  582. package/src/concepts/Connector__.ts +6 -0
  583. package/src/concepts/End__.ts +1 -0
  584. package/src/concepts/EnumItem__.ts +1 -1
  585. package/src/concepts/InterfaceTriggerEvent__.ts +88 -0
  586. package/src/concepts/Interface__.ts +9 -8
  587. package/src/concepts/LogicItem__.ts +7 -0
  588. package/src/concepts/Logic__.ts +7 -2
  589. package/src/concepts/MatchCase__.ts +1 -0
  590. package/src/concepts/Module__.ts +2 -1
  591. package/src/concepts/MsgTriggerLauncher__.ts +7 -23
  592. package/src/concepts/OqlQueryComponent__.ts +18 -17
  593. package/src/concepts/Param__.ts +2 -1
  594. package/src/concepts/Structure__.ts +4 -4
  595. package/src/concepts/TriggerEvent__.ts +3 -3
  596. package/src/concepts/TriggerLauncher__.ts +19 -2
  597. package/src/concepts/ViewElement__.ts +11 -1
  598. package/src/concepts/basics/stdlib/nasl.browser.ts +42 -0
  599. package/src/concepts/basics/stdlib/nasl.configuration.ts +8 -0
  600. package/src/concepts/basics/stdlib/nasl.util.ts +217 -1
  601. package/src/concepts/index__.ts +3 -0
  602. package/src/concepts/utils/asserts.ts +212 -24
  603. package/src/concepts/utils/types.ts +25 -6
  604. package/src/generator/genBundleFiles.ts +14 -4
  605. package/src/generator/genMetaData.ts +1 -0
  606. package/src/generator/permission.ts +1 -0
  607. package/src/generator/release-body/body.ts +9 -5
  608. package/src/generator/release-body/data.ts +10 -7
  609. package/src/generator/release-body/internal.ts +1 -0
  610. package/src/generator/release-body/types.ts +2 -0
  611. package/src/manager/diagnostic.ts +35 -31
  612. package/src/natural/prompt/analyzeClaims.ts +2 -0
  613. package/src/natural/prompt/analyzeFormatOutput.ts +1 -0
  614. package/src/natural/prompt/analyzeTasks.ts +3 -1
  615. package/src/natural/prompt/executeClaims.ts +4 -0
  616. package/src/natural/transformTSCode.ts +33 -5
  617. package/src/server/extendBaseNode.ts +35 -4
  618. package/src/server/formatTsUtils.ts +6 -3
  619. package/src/server/getConnector.ts +7 -7
  620. package/src/server/getLogics.ts +21 -6
  621. package/src/server/naslServer.ts +144 -63
  622. package/src/service/storage/init.ts +2 -2
  623. package/src/utils/index.ts +36 -1
  624. package/ts-worker/src/index.js +4 -3
@@ -1,7 +1,7 @@
1
- import CallConnector from '../concepts/CallConnector__';
2
- import { App } from '..';
3
- import Connector from '../concepts/Connector__';
4
- import Connection from '../concepts/Connection__';
1
+ import type CallConnector from '../concepts/CallConnector__';
2
+ import type { App } from '..';
3
+ import type Connector from '../concepts/Connector__';
4
+ import type Connection from '../concepts/Connection__';
5
5
 
6
6
  export function getConnections(node: CallConnector) {
7
7
  const app = node?.rootNode as App;
@@ -91,11 +91,11 @@ function notifyTsWorkToUpdateConnections(app: App, connector: Connector) {
91
91
  }
92
92
 
93
93
  export function publishConnector(app: App, connector: Connector) {
94
- const dependenciesNames = app.dependencies.map((dep) => dep.name);
94
+ const dependenciesNames = app.connectorDependencies.map((dep) => dep.name);
95
95
  // 已经存在,直接更新
96
96
  if (dependenciesNames.includes(connector.name)) {
97
- const connectorIndex = app.dependencies.findIndex((dep) => dep.name === connector.name);
98
- const oldConnector = app.dependencies[connectorIndex] as Connector;
97
+ const connectorIndex = app.connectorDependencies.findIndex((dep) => dep.name === connector.name);
98
+ const oldConnector = app.connectorDependencies[connectorIndex] as Connector;
99
99
  app.removeConnector(oldConnector);
100
100
  // 由于 CallInterface 会在setTimeout 中处理删除Interface
101
101
  // 为了防止误删已经增加的。需要同样做一个延迟操作
@@ -147,7 +147,7 @@ function getElementsMethods(likeComponent: View | BusinessComponent, parentNodeN
147
147
  }
148
148
  const viewElement = new Namespace({
149
149
  title: toHump(item.name),
150
- logics: eleLogis.filter(e => e).map((item: Logic) => Logic.from(item.toJSON())),
150
+ logics: eleLogis.filter(e => e?.toJSON).map((item: Logic) => Logic.from(item.toJSON())),
151
151
  path,
152
152
  originConcept: 'ViewElement',
153
153
  });
@@ -185,8 +185,12 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
185
185
  pItem.originConcept = 'Process';
186
186
  return pItem;
187
187
  });
188
- const dependencies = app.dependencies; //.filter((d) => d.enable);
189
- const extensions = app.dependencies
188
+ // 连接器 相关迁移到了 conenctorDependencies 下,因此这边需要扩展
189
+ const dependencies = [
190
+ ...app.dependencies,
191
+ ...(app.connectorDependencies || [])
192
+ ]; //.filter((d) => d.enable);
193
+ const extensions = [...app.dependencies, ...(app.connectorDependencies || [])]
190
194
  .map((dep) => moduleToLogicNamesapce(dep, app.overriddenLogics))
191
195
  .filter((item) => item.logics && item.logics.length);
192
196
  const dependEntityNs: Namespace[] = [];
@@ -310,10 +314,14 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
310
314
  'getIsMiniApp',
311
315
  'navigateToUserInfo',
312
316
  'getWeChatHeadImg',
317
+ 'getWeChatLocation',
313
318
  'getWeChatNickName',
314
319
  'getWeChatPhone',
315
320
  'getWeChatOpenid',
316
321
  'navigateToUserPhone',
322
+ 'navigateToScanCode',
323
+ 'getWeChatScanCode',
324
+ 'navigateToLocation'
317
325
  ].includes(item.name)
318
326
  ),
319
327
  expanded: false,
@@ -398,7 +406,7 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
398
406
  title: '微信',
399
407
  logics: getStdlibNamespace()
400
408
  .findChild('browser')
401
- .logics.filter((item) => ['navigateToUserInfo', 'getWeChatHeadImg', 'getWeChatNickName', 'getWeChatOpenid', 'navigateToUserPhone', 'getWeChatPhone'].includes(item.name)),
409
+ .logics.filter((item) => ['navigateToUserInfo', 'getWeChatHeadImg', 'getWeChatNickName', 'getWeChatOpenid', 'navigateToUserPhone', 'getWeChatPhone','navigateToScanCode','getWeChatScanCode','navigateToLocation','getWeChatLocation'].includes(item.name)),
402
410
  expanded: false,
403
411
  })
404
412
  );
@@ -469,8 +477,15 @@ export function getLogicsSync(node: CallLogic | BindEvent | Identifier | Logic,
469
477
  result.push(systemTree);
470
478
  }
471
479
  return result;
472
- } else if (node?.concept === 'Identifier') {
473
- const extensions = app.dependencies
480
+ }
481
+ if (node?.concept === 'Identifier') {
482
+ // 之前 连接器 Connector 相关也存在与 app.dependencies 下,
483
+ // 现在迁移到 app.connectorDependencies 下,
484
+ // 为保证上下游逻辑与之前保持一致,这边做相应的扩展
485
+ const extensions = [
486
+ ...app.dependencies,
487
+ ...(app.connectorDependencies || [])
488
+ ]
474
489
  .map((dep) => moduleToLogicNamesapce(dep, app.overriddenLogics))
475
490
  .filter((item) => item.logics && item.logics.length);
476
491
  const tree = new Namespace({
@@ -92,7 +92,10 @@ import {
92
92
  BusinessComponent,
93
93
  CallEvent,
94
94
  Paginate,
95
+ MsgTriggerLauncher,
96
+ ConnectorTrigger,
95
97
  FrontendType,
98
+ InterfaceParam,
96
99
  } from '../concepts';
97
100
 
98
101
  import * as utils from '../utils';
@@ -112,7 +115,7 @@ import { EventEmitter } from '../common/EventEmitter';
112
115
  import { traverse, FileNode } from '../utils';
113
116
  import { withQueueExecute } from '../decorators';
114
117
  import { getNodeByNodeCallee } from '../automate/engine/utils';
115
- import { isConnection, isConnector } from '../concepts/utils/asserts';
118
+ import { isConnection, isConnector, isMsgTriggerEvent } from '../concepts/utils/asserts';
116
119
 
117
120
  const EmbeddedTSFileLineMap: { [name: string]: number } = {
118
121
  Entity: 3,
@@ -294,10 +297,17 @@ class NaslServer {
294
297
  // worker = new Worker(path.join(__dirname, '../../../src/static/ts-worker.js'));
295
298
  /// #endif
296
299
  /// #if process.env.BUILD_TARGET !== 'node'
297
- if (globalThis.window)
298
- // For TS build
299
- /* !!!如果改动这里需要看下关联的对应文件:webpack/ts-worker/loader.js */
300
- this.worker = new Worker('/ts-worker.js');
300
+ if (globalThis.window){
301
+ const source = require('!!raw-loader!../../../../public/ts-worker/1.0.0.js').default;
302
+ const createWorker = (code = '') => {
303
+ const content = [code];
304
+ const bold = new Blob(content);
305
+ const url = URL.createObjectURL(bold);
306
+ const worker = new Worker(url);
307
+ return worker;
308
+ };
309
+ this.worker = createWorker(source);
310
+ }
301
311
  /// #endif
302
312
 
303
313
  this.http = opt.http;
@@ -318,7 +328,7 @@ class NaslServer {
318
328
  getSender: () => this.worker as any,
319
329
  handleMessage: async ({ data }: any) => {
320
330
  if (data && data.event === 'publishDiagnostics') {
321
- const records = await this._resolveDiagnosticRecords(data.records);
331
+ const records = await this._resolveDiagnosticRecords(data.records, data.versions);
322
332
  await this.diagnosticManager.pushAll(records);
323
333
  try {
324
334
  // 结束诊断和标注
@@ -542,7 +552,7 @@ class NaslServer {
542
552
 
543
553
  for (const frontendType of (frontendTypes || [])) {
544
554
  yield* getTsFile(frontendType, 'frontendType');
545
- for (const dep of frontendType.componentDependencies) {
555
+ for (const dep of (frontendType.componentDependencies || [])) {
546
556
  results.push(...(yield* self.contentToFile(dep)));
547
557
  }
548
558
  for (const frontend of frontendType.frontends) {
@@ -606,6 +616,11 @@ class NaslServer {
606
616
  fileContent: result.code,
607
617
  }));
608
618
 
619
+ // 全量生成TS文件,因此清空版本记录
620
+ files.forEach((f)=>{
621
+ this.diagnosticManager.deleteVersionByFilePath(f.file);
622
+ });
623
+
609
624
  await this.writeFiles(files);
610
625
  this._debugInFileStorage(app, files);
611
626
  // 修改名称回调
@@ -623,6 +638,7 @@ class NaslServer {
623
638
  const otherModules = [
624
639
  ...app.integration?.connectors ?? [],
625
640
  ...app.dependencies ?? [],
641
+ ...app.connectorDependencies ?? [],
626
642
  ...app.interfaceDependencies ?? [],
627
643
  ];
628
644
 
@@ -702,17 +718,17 @@ class NaslServer {
702
718
 
703
719
  /// #if process.env.NODE_ENV === 'development'
704
720
  // 首次尝试请求
705
- await this.http.post(url, openFiles[0]).catch(() => (this.openDebugEmbedded = false));
721
+ await this.http.post(`/proxy/nasl-storage/api/App/debugEmbedded?id=${ app.id}`, openFiles[0]).catch(() => (this.openDebugEmbedded = false));
706
722
  if (this.openDebugEmbedded && globalThis.window) {
707
723
  // For TS build
708
724
  try {
709
725
  let canDebug = true;
710
- await this.http.post(url, openFiles[0]).catch(() => (canDebug = false));
726
+ await this.http.post(`/proxy/nasl-storage/api/App/debugEmbedded?id=${ app.id}`, openFiles[0]).catch(() => (canDebug = false));
711
727
 
712
728
  if (canDebug) {
713
729
  await Promise.all(
714
730
  openFiles.map(async (file) => {
715
- const res = await this.http.post(url, file);
731
+ const res = await this.http.post(`/proxy/nasl-storage/api/App/debugEmbedded?id=${ app.id}`, file);
716
732
  return res.data;
717
733
  })
718
734
  );
@@ -1011,13 +1027,11 @@ class NaslServer {
1011
1027
  }
1012
1028
 
1013
1029
  getDiagnosticRecordsAndPushAll(fileNames?: Array<string>) {
1014
- // invokeCommand('naslServer:startWork');
1015
- // TODO:
1016
- // const versions = fileNames?.map((x) => {
1017
- // return this.diagnosticManager.incrementVersionByFilePath(x);
1018
- // });
1019
- // return this.messager.requestCommand('getDiagnosticRecords', fileNames, versions);
1020
- return this.messager.requestCommand('getDiagnosticRecords', fileNames);
1030
+ invokeCommand('naslServer:startWork');
1031
+ const versions = fileNames?.map((x) => {
1032
+ return this.diagnosticManager.incrementVersionByFilePath(x);
1033
+ });
1034
+ return this.messager.requestCommand('getDiagnosticRecords', fileNames, versions);
1021
1035
  }
1022
1036
 
1023
1037
  /**
@@ -1028,7 +1042,18 @@ class NaslServer {
1028
1042
  node.tsErrorDetail = tsErrorDetail;
1029
1043
  }
1030
1044
 
1031
- private *_resolveDiagnosticRecordsWithGenerator(records: Array<DiagnosticRecord>) {
1045
+ private *_resolveDiagnosticRecordsWithGenerator(records: Array<DiagnosticRecord>, versions: number[] | undefined) {
1046
+ // 这个操作几乎没有性能开销,在主线程完成即可
1047
+ // 保证每个文件的record的版本正确,防止竞态
1048
+ // 若版本不符合,则忽略此record
1049
+ records = records.filter((x, index) => {
1050
+ const requestVersion = versions?.[index] ?? 0;
1051
+ if (!x.filePath) {
1052
+ return true;
1053
+ }
1054
+ return this.diagnosticManager.getVersionByFilePath(x.filePath) === requestVersion;
1055
+ });
1056
+
1032
1057
  // 热更新类型标注
1033
1058
  if (records.length) {
1034
1059
  yield* this._incrementalAnnotationJSONWithGenerator(records);
@@ -1222,6 +1247,7 @@ class NaslServer {
1222
1247
  });
1223
1248
 
1224
1249
  this.logger.timeEnd('处理诊断数据');
1250
+ this.logger.timeEnd('语言服务变更');
1225
1251
 
1226
1252
  return records;
1227
1253
  }
@@ -1232,8 +1258,8 @@ class NaslServer {
1232
1258
  * @returns 过滤或者转换后的诊断结果
1233
1259
  */
1234
1260
  @withQueueExecute('diagnostic')
1235
- private _resolveDiagnosticRecords(records: Array<DiagnosticRecord>) {
1236
- return utils.timeSlicingWithGenerator(this._resolveDiagnosticRecordsWithGenerator(records));
1261
+ private _resolveDiagnosticRecords(records: Array<DiagnosticRecord>, versions: number[] | undefined) {
1262
+ return utils.timeSlicingWithGenerator(this._resolveDiagnosticRecordsWithGenerator(records, versions));
1237
1263
  }
1238
1264
 
1239
1265
  /**
@@ -1617,20 +1643,19 @@ class NaslServer {
1617
1643
  /** 是否被 触发器依赖, 如果存在,返回第一个触发器对应的名称 */
1618
1644
  isRefedByTriggerAndReturnFirstRef(fileNode: BaseNode): Promise<{
1619
1645
  isRefedByTrigger: boolean;
1620
- fRefName: string;
1646
+ fRefNames: string[];
1621
1647
  }> {
1622
1648
  return this._isHaveRef(fileNode).then((refs) => {
1623
1649
  const basePath = TriggerLauncher.getEmbeddedFileBasePath(fileNode.rootNode as App);
1624
1650
  let flag = false;
1625
- let fRefName = '';
1651
+ let fRefNames = [];
1626
1652
  try {
1627
1653
  for (const ref of refs) {
1628
1654
  const { file } = ref;
1629
1655
  if (file.startsWith(basePath)) {
1630
1656
  flag = true;
1631
1657
  // file: /embedded/tttta/triggerLaunchers/订阅配置_asd.ts
1632
- fRefName = file.split(basePath)[1].split('.')[0];
1633
- break;
1658
+ fRefNames.push(file.split(basePath)[1].split('.')[0]);
1634
1659
  }
1635
1660
  }
1636
1661
  } catch (error) {
@@ -1638,7 +1663,7 @@ class NaslServer {
1638
1663
  }
1639
1664
  return {
1640
1665
  isRefedByTrigger: flag,
1641
- fRefName,
1666
+ fRefNames,
1642
1667
  };
1643
1668
  });
1644
1669
  // const refs = await this._isHaveRef(fileNode);
@@ -1667,29 +1692,29 @@ class NaslServer {
1667
1692
  /**
1668
1693
  * 是否符合 触发器规则
1669
1694
  * 规则:
1670
- * 1. 入参仅有一个,且必须为string类型
1671
- * 2. 不允许有返回值
1672
1695
  */
1673
- isTriggerRule(fileNode: BaseNode): boolean {
1674
- const { sourceMap } = fileNode;
1675
- let paramsLength = 0;
1676
- let returnLength = 0;
1696
+ isTriggerRule(fileNode: Logic, fRefNames: string[]) {
1697
+ const app = fileNode.rootNode as App;
1698
+ const targetLaunchers = app.triggerLaunchers?.filter((triggerLauncher) => fRefNames.includes(triggerLauncher.name));
1677
1699
  let flag = true;
1678
- sourceMap.forEach((_, k) => {
1679
- if (k instanceof Param) {
1680
- paramsLength++;
1681
- const typeAnnotation = k.typeAnnotation || k.__TypeAnnotation;
1682
- const { typeKind, typeName, typeNamespace } = typeAnnotation || {};
1683
- const isString = typeKind === 'primitive' && typeName === 'String' && typeNamespace === 'nasl.core';
1684
- if (!isString) {
1700
+ let errorFRefNames: string[] = [];
1701
+ targetLaunchers?.forEach((triggerLauncher: MsgTriggerLauncher) => {
1702
+ const targetMsgTrigger = triggerLauncher?.connection?.connector?.triggers?.find((trigger: ConnectorTrigger) => isMsgTriggerEvent(trigger.triggerEvent));
1703
+ if (targetMsgTrigger) {
1704
+ const callBackLogic = targetMsgTrigger.triggerEvent.callBackLogic as unknown as TypeAnnotation;
1705
+ const { returnType, typeArguments } = callBackLogic;
1706
+ const sameInReturn = utils.isSameInType(returnType, fileNode.returns?.map((re) => re.typeAnnotation));
1707
+ const sameInParams = utils.isSameInType(typeArguments, fileNode.params?.map((param) => param.typeAnnotation));
1708
+ if (!sameInReturn || !sameInParams) {
1685
1709
  flag = false;
1710
+ errorFRefNames.push(triggerLauncher.name);
1686
1711
  }
1687
1712
  }
1688
- if (k instanceof Return) {
1689
- returnLength ++;
1690
- }
1691
- });
1692
- return paramsLength === 1 && flag && returnLength === 0;
1713
+ })
1714
+ return {
1715
+ isTriggerRule: flag,
1716
+ errorFRefNames,
1717
+ };
1693
1718
  }
1694
1719
 
1695
1720
  /**
@@ -2180,15 +2205,62 @@ class NaslServer {
2180
2205
  }
2181
2206
  }
2182
2207
  else if (fileNode instanceof Logic || fileNode instanceof OverriddenLogic) {
2183
- const { isRefedByTrigger, fRefName } = yield this.isRefedByTriggerAndReturnFirstRef(fileNode);
2184
-
2185
- if (isRefedByTrigger && !this.isTriggerRule(fileNode)) {
2186
- const diagnostic = {
2187
- node: fileNode,
2188
- severity: 'error',
2189
- message: `${fileNode.name} 已被Kafka消息订阅配置 ${fRefName} 引用:该逻辑入参只有一个入参,入参类型为string;且不允许存在返回值。否则会导致无法接收Kafka消息`,
2190
- };
2191
- diagnostics.push(diagnostic);
2208
+ const { isRefedByTrigger, fRefNames } = yield this.isRefedByTriggerAndReturnFirstRef(fileNode);
2209
+ if (fileNode instanceof Logic && fileNode?.exportInterface) {
2210
+ let isSame = true;
2211
+ const itf = (fileNode.exportInterface as Interface);
2212
+ const { params: logicParams, returns: logicReturns } = fileNode;
2213
+ const { params: itfParams, returns: itfReturns } = itf;
2214
+ if (logicParams?.length !== itfParams?.length || logicReturns?.length !== itfReturns?.length) {
2215
+ isSame = false;
2216
+ }
2217
+ if (isSame && logicParams?.length === itfParams?.length) {
2218
+ const logicParamMap = logicParams?.reduce<Record<string, TypeAnnotation>>((acc, param) => {
2219
+ acc[param.name] = param.typeAnnotation
2220
+ return acc
2221
+ }, {})
2222
+ itfParams.forEach((param: InterfaceParam) => {
2223
+ const logicParam = logicParamMap?.[param.name]
2224
+ if (!logicParam) {
2225
+ isSame = false;
2226
+ return;
2227
+ } else if (!logicParam.isSame(param.typeAnnotation)) {
2228
+ isSame = false;
2229
+ return;
2230
+ }
2231
+ });
2232
+ }
2233
+ if (isSame && logicReturns?.length === itfReturns?.length && logicReturns?.length > 0) {
2234
+ if (logicReturns[0].name !== itfReturns[0].name) {
2235
+ isSame = false;
2236
+ } else if (!logicReturns[0]?.typeAnnotation?.isSame?.(itfReturns[0]?.typeAnnotation)) {
2237
+ isSame = false;
2238
+ }
2239
+ }
2240
+ if (!isSame) {
2241
+ const diagnostic = {
2242
+ node: fileNode,
2243
+ severity: 'error',
2244
+ message: `逻辑已变更,请确认请求类型无误后重新导出${'${event}'}`,
2245
+ events: [{
2246
+ key: 'exportInterface',
2247
+ label: '接口配置',
2248
+ params: fileNode,
2249
+ }]
2250
+ };
2251
+ diagnostics.push(diagnostic);
2252
+ }
2253
+ }
2254
+ if (isRefedByTrigger) {
2255
+ const { isTriggerRule, errorFRefNames } = this.isTriggerRule(fileNode as Logic, fRefNames);
2256
+ if (!isTriggerRule) {
2257
+ const diagnostic = {
2258
+ node: fileNode,
2259
+ severity: 'error',
2260
+ message: `${fileNode.name} 已被消息订阅配置 ${errorFRefNames.join(',')} 引用,但出入参数类型不匹配,或数量不一致`,
2261
+ };
2262
+ diagnostics.push(diagnostic);
2263
+ }
2192
2264
  }
2193
2265
 
2194
2266
  yield* utils.wrapIteratorToGenerator(fileNode.sourceMap.entries(), function* wrapIterator([node, value]) {
@@ -2734,8 +2806,14 @@ class NaslServer {
2734
2806
  * @returns 处理后的结果
2735
2807
  */
2736
2808
  private *_resolveDiagnosticWithGenerator(diagnostic: tsProtocol.DiagnosticWithFileName, fileNode: FileNode, record: DiagnosticRecord) {
2809
+ // 连接器只校验编辑态的连接器
2810
+ if (fileNode?.getAncestor('Connector') && !fileNode.getAncestor('Integration')) {
2811
+ return;
2812
+ }
2813
+
2737
2814
  // 拓展模块中的翻译先过滤掉,因为有错用户也不能修改
2738
- if (((fileNode as any).module || (fileNode as any).connector) && !(fileNode instanceof ConfigProperty)) {
2815
+ // module属性下也可以拿到 connector,所以要过滤掉
2816
+ if (((fileNode as any).module && (fileNode as any).module.concept !== 'Connector') && !(fileNode instanceof ConfigProperty)) {
2739
2817
  return;
2740
2818
  }
2741
2819
  if (fileNode.concept === 'OverriddenLogic' && diagnostic.text === `'__LogicEmpty' is declared but its value is never read.`) {
@@ -2928,11 +3006,11 @@ class NaslServer {
2928
3006
  refsList = [...refsList, ...newRefs.refs];
2929
3007
  }
2930
3008
  }
2931
- // 根据 moduleName 中是否存在 dependencies 来判断是否为稳定态的Connector
2932
- const isStable = moduleName.includes(`/embedded/${appName}/dependencies`);
3009
+ // 根据 moduleName 中是否存在 connectorDependencies 来判断是否为稳定态的Connector
3010
+ const isStable = moduleName.includes(`/embedded/${appName}/connectorDependencies`);
2933
3011
  // 根据 item 的 file 去重
2934
3012
  refsList = refsList.filter((item, index, arr) => {
2935
- const tempStable = item.file.includes(`/embedded/${appName}/dependencies`); // 约定
3013
+ const tempStable = item.file.includes(`/embedded/${appName}/connectorDependencies`); // 约定
2936
3014
  const isGlobalLogic = item.file.includes(`/embedded/${appName}/logics`); // 约定
2937
3015
  // 关于 isGlobalLogic 单独判断的说明:
2938
3016
  // 全局逻辑与Connector 有直接关联的只有两种情况
@@ -4376,6 +4454,7 @@ class NaslServer {
4376
4454
  if (this.changeStackList?.length) {
4377
4455
  throw new Error(`当前还有${this.changeStackList.length}个文件还在执行更新操作`);
4378
4456
  }
4457
+ this.logger.time('全量标注');
4379
4458
  const nodes: QuickInfoNodes = [];
4380
4459
  this.file2NodeMap.forEach((fileNode, filePath) => {
4381
4460
  // 先不排除view,传递给后端的时候,去除views下的标注
@@ -4389,12 +4468,11 @@ class NaslServer {
4389
4468
  });
4390
4469
  }
4391
4470
  });
4392
- this.logger.time('全量标注');
4393
4471
  const typesMap = await this.getQuickInfoNodesTypeMap(nodes, true);
4394
- this.logger.timeEnd('全量标注');
4395
4472
 
4396
4473
  const json = app.toJSON();
4397
- this.logger.info(json)
4474
+
4475
+ this.logger.timeEnd('全量标注');
4398
4476
 
4399
4477
  if (releaseFlag) {
4400
4478
  // 全量标注后对json进行一些修改,为了服务端翻译处理
@@ -5030,10 +5108,9 @@ class NaslServer {
5030
5108
  }
5031
5109
 
5032
5110
  async receiveHandleChange($event: EventPayload) {
5033
- if (!this.performance) {
5034
- invokeCommand('naslServer:startWork');
5035
- }
5111
+ invokeCommand('naslServer:startWork');
5036
5112
 
5113
+ this.logger.time('语言服务变更');
5037
5114
  this.singleFileChangeIng = true;
5038
5115
  // 行为
5039
5116
  const { action, oldObject = {}, object = {} } = $event;
@@ -5080,12 +5157,15 @@ class NaslServer {
5080
5157
  return;
5081
5158
  }
5082
5159
 
5083
- // debugger;
5084
5160
  if (process.env.NODE_ENV === 'development') {
5085
5161
  this.logger.time('重新生成 TS 文件');
5086
5162
  }
5087
5163
 
5088
5164
  const fileTsPath = fileNode.getEmbeddedFilePath();
5165
+
5166
+ // 递增ts文件版本号
5167
+ this.diagnosticManager.incrementVersionByFilePath(fileTsPath);
5168
+
5089
5169
  const result = await utils.timeSlicingWithGenerator(fileNode.toEmbeddedTSFile());
5090
5170
 
5091
5171
  if (process.env.NODE_ENV === 'development') {
@@ -5143,6 +5223,7 @@ class NaslServer {
5143
5223
  if (process.env.NODE_ENV === 'development') {
5144
5224
  console.info('校验以下文件', Array.from(this.filesToCheck));
5145
5225
  }
5226
+
5146
5227
  await this.getDiagnosticRecordsAndPushAll(Array.from(this.filesToCheck));
5147
5228
  this.filesToCheck.clear();
5148
5229
  }
@@ -481,7 +481,7 @@ async function doAction(app: any, actionItem: any) {
481
481
  const _path: string = event.originEvent.path;
482
482
  const _root = _path.split('.')?.[1] || '';
483
483
  const breakabled = isBreakpointEvent(event);
484
- if (['backend', 'overriddenLogics', 'dataSources', 'processes', 'roles', 'logics', 'enums', 'structures', 'interfaces', 'interfaceDependencies', 'configuration', 'dependencies', 'authLogics', 'authLogicsForCallInterface', 'triggerLaunchers', 'connections'].some((item) => _root.startsWith(item))) {
484
+ if (['backend', 'overriddenLogics', 'dataSources', 'processes', 'roles', 'logics', 'enums', 'structures', 'interfaces', 'interfaceDependencies', 'configuration', 'dependencies', 'authLogics', 'authLogicsForCallInterface', 'triggerLaunchers', 'connections', 'connectorDependencies'].some((item) => _root.startsWith(item))) {
485
485
  if (!breakabled) {
486
486
  hasBackEnd = true;
487
487
  }
@@ -989,7 +989,7 @@ async function _saveNasl(options: TaskOption) {
989
989
  spaces: 4,
990
990
  });
991
991
  }
992
- app.emit('saved', err);
992
+ app.emit?.('saved', err);
993
993
  return err;
994
994
  }
995
995
 
@@ -1,6 +1,6 @@
1
1
  import { compare } from 'compare-versions';
2
2
  import { BaseNode, LogicItem, AnonymousFunction, Param } from '..';
3
- import type { ForEachStatement, Logic, View } from '..';
3
+ import type { ForEachStatement, Logic, TypeAnnotation, View } from '..';
4
4
  import * as types from '../concepts/utils/types';
5
5
  import { getConceptPropertyMap } from '../decorators/index';
6
6
  import { traverse } from './traverse';
@@ -447,3 +447,38 @@ export function hasParamNameOfAnonymousFunction({
447
447
  const paramNames = new Set([...ancestorParamNames.values(), ...anonymousFnNodesParams.values()]);
448
448
  return paramNames.has(newName);
449
449
  }
450
+
451
+ /**
452
+ * 目标类型列表是否和源类型列表一致
453
+ */
454
+ export function isSameInType(source: TypeAnnotation[], target: TypeAnnotation[]): boolean {
455
+ if (source?.length !== target?.length) {
456
+ return false;
457
+ }
458
+ let flag = true;
459
+ source.forEach((item, index) => {
460
+ let { typeKind: sTypeKind, typeName: sTypeName, typeNamespace: sTypeNamespace } = item || {};
461
+ let { typeKind: tTypeKind, typeName: tTypeName, typeNamespace: tTypeNamespace } = target[index] || {};
462
+ // 范型不需要做对比
463
+ // 范型目前处理为string
464
+ if (sTypeKind === 'typeParam' || tTypeKind === 'typeParam') {
465
+ if (sTypeKind === 'typeParam') {
466
+ sTypeKind = 'primitive';
467
+ sTypeName = 'String';
468
+ sTypeNamespace = 'nasl.core';
469
+ }
470
+ if (tTypeKind === 'typeParam') {
471
+ tTypeKind = 'primitive';
472
+ tTypeName = 'String';
473
+ tTypeNamespace = 'nasl.core';
474
+ }
475
+ if (sTypeKind !== tTypeKind || sTypeName !== tTypeName || sTypeNamespace !== tTypeNamespace) {
476
+ flag = false;
477
+ }
478
+ }
479
+ if (sTypeKind !== tTypeKind || sTypeName !== tTypeName || sTypeNamespace !== tTypeNamespace) {
480
+ flag = false;
481
+ }
482
+ });
483
+ return flag;
484
+ }
@@ -234,7 +234,7 @@ const context = {
234
234
  console.error(e);
235
235
  }
236
236
  },
237
- publishDiagnostics(remain) {
237
+ publishDiagnostics(remain, versions) {
238
238
  webHost.diagnosticRecords = [];
239
239
  for (let i = 0; i < remain; i++) {
240
240
  try {
@@ -250,6 +250,7 @@ const context = {
250
250
  this.messager.sendData({
251
251
  event: 'publishDiagnostics',
252
252
  records: webHost.diagnosticRecords,
253
+ versions
253
254
  });
254
255
  },
255
256
  geterr(files = []) {
@@ -257,7 +258,7 @@ const context = {
257
258
  // count++;
258
259
  // }, 10)
259
260
  },
260
- getDiagnosticRecords(filePaths = this.system.readDirectory('/embedded')) {
261
+ getDiagnosticRecords(filePaths = this.system.readDirectory('/embedded'), versions = []) {
261
262
  this._clearTimeout();
262
263
  this.session.executeCommand({
263
264
  seq: seq++,
@@ -271,7 +272,7 @@ const context = {
271
272
  webHost.diagnosticRecords = [];
272
273
  // this._reduceDiagnosticQueue(filePaths.length);
273
274
  // return webHost.diagnosticRecords;
274
- this.publishDiagnostics(filePaths.length);
275
+ this.publishDiagnostics(filePaths.length, versions);
275
276
  return [];
276
277
  },
277
278
  fileReferences(filePath) {