@softtechai/quickmcp 1.0.16 → 1.1.0

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 (417) hide show
  1. package/dist/auth/auth-utils.d.ts +130 -0
  2. package/dist/auth/auth-utils.d.ts.map +1 -0
  3. package/dist/auth/auth-utils.js +600 -0
  4. package/dist/auth/auth-utils.js.map +1 -0
  5. package/dist/auth/jwks-provider.d.ts +9 -0
  6. package/dist/auth/jwks-provider.d.ts.map +1 -0
  7. package/dist/auth/jwks-provider.js +56 -0
  8. package/dist/auth/jwks-provider.js.map +1 -0
  9. package/dist/auth/token-utils.d.ts +40 -0
  10. package/dist/auth/token-utils.d.ts.map +1 -0
  11. package/dist/auth/token-utils.js +162 -0
  12. package/dist/auth/token-utils.js.map +1 -0
  13. package/dist/client/MCPClient.js +5 -4
  14. package/dist/client/MCPClient.js.map +1 -1
  15. package/dist/config/auth-config.d.ts +16 -0
  16. package/dist/config/auth-config.d.ts.map +1 -0
  17. package/dist/config/auth-config.js +107 -0
  18. package/dist/config/auth-config.js.map +1 -0
  19. package/dist/constant/constant.d.ts +20 -0
  20. package/dist/constant/constant.d.ts.map +1 -0
  21. package/dist/constant/constant.js +24 -0
  22. package/dist/constant/constant.js.map +1 -0
  23. package/dist/database/async-datastore.d.ts +6 -0
  24. package/dist/database/async-datastore.d.ts.map +1 -0
  25. package/dist/database/async-datastore.js +15 -0
  26. package/dist/database/async-datastore.js.map +1 -0
  27. package/dist/database/database-utils.d.ts +6 -0
  28. package/dist/database/database-utils.d.ts.map +1 -0
  29. package/dist/database/database-utils.js +29 -0
  30. package/dist/database/database-utils.js.map +1 -0
  31. package/dist/database/datastore.d.ts +164 -0
  32. package/dist/database/datastore.d.ts.map +1 -0
  33. package/dist/{parsers/types/index.js → database/datastore.js} +1 -0
  34. package/dist/database/datastore.js.map +1 -0
  35. package/dist/database/factory.d.ts +4 -0
  36. package/dist/database/factory.d.ts.map +1 -0
  37. package/dist/database/factory.js +32 -0
  38. package/dist/database/factory.js.map +1 -0
  39. package/dist/database/jdbc-manager.d.ts +49 -0
  40. package/dist/database/jdbc-manager.d.ts.map +1 -0
  41. package/dist/database/jdbc-manager.js +50 -0
  42. package/dist/database/jdbc-manager.js.map +1 -0
  43. package/dist/database/sqlite-manager.d.ts +46 -44
  44. package/dist/database/sqlite-manager.d.ts.map +1 -1
  45. package/dist/database/sqlite-manager.js +492 -42
  46. package/dist/database/sqlite-manager.js.map +1 -1
  47. package/dist/database/supabase-manager.d.ts +58 -0
  48. package/dist/database/supabase-manager.d.ts.map +1 -0
  49. package/dist/database/supabase-manager.js +432 -0
  50. package/dist/database/supabase-manager.js.map +1 -0
  51. package/dist/generators/MCPServerGenerator.d.ts +103 -20
  52. package/dist/generators/MCPServerGenerator.d.ts.map +1 -1
  53. package/dist/generators/MCPServerGenerator.js +6930 -128
  54. package/dist/generators/MCPServerGenerator.js.map +1 -1
  55. package/dist/index.d.ts +0 -1
  56. package/dist/index.d.ts.map +1 -1
  57. package/dist/index.js +8 -1
  58. package/dist/index.js.map +1 -1
  59. package/dist/integrated-mcp-server-new.d.ts +14 -2
  60. package/dist/integrated-mcp-server-new.d.ts.map +1 -1
  61. package/dist/integrated-mcp-server-new.js +270 -180
  62. package/dist/integrated-mcp-server-new.js.map +1 -1
  63. package/dist/mcp-core/McpCoreService.d.ts +63 -0
  64. package/dist/mcp-core/McpCoreService.d.ts.map +1 -0
  65. package/dist/mcp-core/McpCoreService.js +492 -0
  66. package/dist/mcp-core/McpCoreService.js.map +1 -0
  67. package/dist/parsers/CsvParser.d.ts +1 -1
  68. package/dist/parsers/CsvParser.d.ts.map +1 -1
  69. package/dist/parsers/CsvParser.js +3 -2
  70. package/dist/parsers/CsvParser.js.map +1 -1
  71. package/dist/parsers/DatabaseParser.d.ts.map +1 -1
  72. package/dist/parsers/DatabaseParser.js +9 -8
  73. package/dist/parsers/DatabaseParser.js.map +1 -1
  74. package/dist/parsers/ExcelParser.d.ts +15 -0
  75. package/dist/parsers/ExcelParser.d.ts.map +1 -1
  76. package/dist/parsers/ExcelParser.js +287 -21
  77. package/dist/parsers/ExcelParser.js.map +1 -1
  78. package/dist/parsers/WebPageParser.d.ts +5 -0
  79. package/dist/parsers/WebPageParser.d.ts.map +1 -0
  80. package/dist/parsers/WebPageParser.js +35 -0
  81. package/dist/parsers/WebPageParser.js.map +1 -0
  82. package/dist/parsers/index.d.ts +3 -2
  83. package/dist/parsers/index.d.ts.map +1 -1
  84. package/dist/parsers/index.js +19 -16
  85. package/dist/parsers/index.js.map +1 -1
  86. package/dist/server/api/askApi.d.ts +41 -0
  87. package/dist/server/api/askApi.d.ts.map +1 -0
  88. package/dist/server/api/askApi.js +479 -0
  89. package/dist/server/api/askApi.js.map +1 -0
  90. package/dist/server/api/authApi.d.ts +101 -0
  91. package/dist/server/api/authApi.d.ts.map +1 -0
  92. package/dist/server/api/authApi.js +1472 -0
  93. package/dist/server/api/authApi.js.map +1 -0
  94. package/dist/server/api/authProperty.d.ts +18 -0
  95. package/dist/server/api/authProperty.d.ts.map +1 -0
  96. package/dist/server/api/authProperty.js +41 -0
  97. package/dist/server/api/authProperty.js.map +1 -0
  98. package/dist/server/api/configApi.d.ts +15 -0
  99. package/dist/server/api/configApi.d.ts.map +1 -0
  100. package/dist/server/api/configApi.js +42 -0
  101. package/dist/server/api/configApi.js.map +1 -0
  102. package/dist/server/api/databaseApi.d.ts +14 -0
  103. package/dist/server/api/databaseApi.d.ts.map +1 -0
  104. package/dist/server/api/databaseApi.js +111 -0
  105. package/dist/server/api/databaseApi.js.map +1 -0
  106. package/dist/server/api/directoryApi.d.ts +9 -0
  107. package/dist/server/api/directoryApi.d.ts.map +1 -0
  108. package/dist/server/api/directoryApi.js +103 -0
  109. package/dist/server/api/directoryApi.js.map +1 -0
  110. package/dist/server/api/generateApi.d.ts +24 -0
  111. package/dist/server/api/generateApi.d.ts.map +1 -0
  112. package/dist/server/api/generateApi.js +457 -0
  113. package/dist/server/api/generateApi.js.map +1 -0
  114. package/dist/server/api/healthApi.d.ts +9 -0
  115. package/dist/server/api/healthApi.d.ts.map +1 -0
  116. package/dist/server/api/healthApi.js +15 -0
  117. package/dist/server/api/healthApi.js.map +1 -0
  118. package/dist/server/api/indexApi.d.ts +21 -0
  119. package/dist/server/api/indexApi.d.ts.map +1 -0
  120. package/dist/server/api/indexApi.js +61 -0
  121. package/dist/server/api/indexApi.js.map +1 -0
  122. package/dist/server/api/logsApi.d.ts +12 -0
  123. package/dist/server/api/logsApi.d.ts.map +1 -0
  124. package/dist/server/api/logsApi.js +37 -0
  125. package/dist/server/api/logsApi.js.map +1 -0
  126. package/dist/server/api/mcpApi.d.ts +20 -0
  127. package/dist/server/api/mcpApi.d.ts.map +1 -0
  128. package/dist/server/api/mcpApi.js +120 -0
  129. package/dist/server/api/mcpApi.js.map +1 -0
  130. package/dist/server/api/nameApi.d.ts +21 -0
  131. package/dist/server/api/nameApi.d.ts.map +1 -0
  132. package/dist/server/api/nameApi.js +42 -0
  133. package/dist/server/api/nameApi.js.map +1 -0
  134. package/dist/server/api/parseApi.d.ts +9 -0
  135. package/dist/server/api/parseApi.d.ts.map +1 -0
  136. package/dist/server/api/parseApi.js +3245 -0
  137. package/dist/server/api/parseApi.js.map +1 -0
  138. package/dist/server/api/serverApi.d.ts +44 -0
  139. package/dist/server/api/serverApi.d.ts.map +1 -0
  140. package/dist/server/api/serverApi.js +417 -0
  141. package/dist/server/api/serverApi.js.map +1 -0
  142. package/dist/{dynamic-mcp-executor.d.ts → server/dynamic-mcp-executor.d.ts} +4 -5
  143. package/dist/server/dynamic-mcp-executor.d.ts.map +1 -0
  144. package/dist/server/dynamic-mcp-executor.js +62 -0
  145. package/dist/server/dynamic-mcp-executor.js.map +1 -0
  146. package/dist/server/port-utils.d.ts +14 -0
  147. package/dist/server/port-utils.d.ts.map +1 -0
  148. package/dist/server/port-utils.js +31 -0
  149. package/dist/server/port-utils.js.map +1 -0
  150. package/dist/server/server-utils.d.ts +13 -0
  151. package/dist/server/server-utils.d.ts.map +1 -0
  152. package/dist/server/server-utils.js +72 -0
  153. package/dist/server/server-utils.js.map +1 -0
  154. package/dist/{web → server}/server.d.ts +1 -0
  155. package/dist/server/server.d.ts.map +1 -0
  156. package/dist/server/server.js +535 -0
  157. package/dist/server/server.js.map +1 -0
  158. package/dist/server/tool-executer.d.ts +101 -0
  159. package/dist/server/tool-executer.d.ts.map +1 -0
  160. package/dist/server/tool-executer.js +6198 -0
  161. package/dist/server/tool-executer.js.map +1 -0
  162. package/dist/types/index.d.ts +1197 -4
  163. package/dist/types/index.d.ts.map +1 -1
  164. package/dist/types/index.js +1028 -0
  165. package/dist/types/index.js.map +1 -1
  166. package/dist/upload/upload-utils.d.ts +4 -0
  167. package/dist/upload/upload-utils.d.ts.map +1 -0
  168. package/dist/upload/upload-utils.js +29 -0
  169. package/dist/upload/upload-utils.js.map +1 -0
  170. package/dist/utils/deployment-util.d.ts +14 -0
  171. package/dist/utils/deployment-util.d.ts.map +1 -0
  172. package/dist/utils/deployment-util.js +46 -0
  173. package/dist/utils/deployment-util.js.map +1 -0
  174. package/dist/utils/logger.d.ts +15 -0
  175. package/dist/utils/logger.d.ts.map +1 -0
  176. package/dist/utils/logger.js +56 -0
  177. package/dist/utils/logger.js.map +1 -0
  178. package/package.json +18 -6
  179. package/quickmcp-direct-stdio.js +176 -187
  180. package/src/web/public/app.js +15370 -1471
  181. package/src/web/public/authorization.html +868 -0
  182. package/src/web/public/database-tables.html +283 -547
  183. package/src/web/public/how-to-use.html +446 -462
  184. package/src/web/public/how-to-use.js +4 -4
  185. package/src/web/public/images/app/activepieces.png +0 -0
  186. package/src/web/public/images/app/airtable.png +0 -0
  187. package/src/web/public/images/app/androidstudio.png +0 -0
  188. package/src/web/public/images/app/antigravity.png +0 -0
  189. package/src/web/public/images/app/applenotes.png +0 -0
  190. package/src/web/public/images/app/applereminders.png +0 -0
  191. package/src/web/public/images/app/asana.png +0 -0
  192. package/src/web/public/images/app/azureai.png +0 -0
  193. package/src/web/public/images/app/bash.png +0 -0
  194. package/src/web/public/images/app/bearnotes.png +0 -0
  195. package/src/web/public/images/app/bitbucket.png +0 -0
  196. package/src/web/public/images/app/claude.png +0 -0
  197. package/src/web/public/images/app/cli.png +0 -0
  198. package/src/web/public/images/app/clickup.png +0 -0
  199. package/src/web/public/images/app/cohere.png +0 -0
  200. package/src/web/public/images/app/confluence.png +0 -0
  201. package/src/web/public/images/app/confluence2.png +0 -0
  202. package/src/web/public/images/app/curl.png +0 -0
  203. package/src/web/public/images/app/curl_mini.png +0 -0
  204. package/src/web/public/images/app/cursor.png +0 -0
  205. package/src/web/public/images/app/db2.png +0 -0
  206. package/src/web/public/images/app/deepseek.png +0 -0
  207. package/src/web/public/images/app/discord.png +0 -0
  208. package/src/web/public/images/app/docker.png +0 -0
  209. package/src/web/public/images/app/dockerhub.png +0 -0
  210. package/src/web/public/images/app/dropbox.png +0 -0
  211. package/src/web/public/images/app/elasticsearch.png +0 -0
  212. package/src/web/public/images/app/facebook.png +0 -0
  213. package/src/web/public/images/app/falai.png +0 -0
  214. package/src/web/public/images/app/fireworks.png +0 -0
  215. package/src/web/public/images/app/gdrive.png +0 -0
  216. package/src/web/public/images/app/gemini.png +0 -0
  217. package/src/web/public/images/app/github.png +0 -0
  218. package/src/web/public/images/app/githubcopilot.png +0 -0
  219. package/src/web/public/images/app/gitlab.png +0 -0
  220. package/src/web/public/images/app/gmail.png +0 -0
  221. package/src/web/public/images/app/googlecalender.png +0 -0
  222. package/src/web/public/images/app/googledocs.png +0 -0
  223. package/src/web/public/images/app/googlesheets.png +0 -0
  224. package/src/web/public/images/app/gradle.png +0 -0
  225. package/src/web/public/images/app/grafana.png +0 -0
  226. package/src/web/public/images/app/graphql.png +0 -0
  227. package/src/web/public/images/app/grok.png +0 -0
  228. package/src/web/public/images/app/groq.png +0 -0
  229. package/src/web/public/images/app/hazelcast.png +0 -0
  230. package/src/web/public/images/app/huggingface.png +0 -0
  231. package/src/web/public/images/app/imessage.png +0 -0
  232. package/src/web/public/images/app/instagram.png +0 -0
  233. package/src/web/public/images/app/intellij.png +0 -0
  234. package/src/web/public/images/app/jenkins.png +0 -0
  235. package/src/web/public/images/app/jira.png +0 -0
  236. package/src/web/public/images/app/kafka.png +0 -0
  237. package/src/web/public/images/app/kubernetes.png +0 -0
  238. package/src/web/public/images/app/linear.png +0 -0
  239. package/src/web/public/images/app/linkedin.png +0 -0
  240. package/src/web/public/images/app/llama.png +0 -0
  241. package/src/web/public/images/app/make.png +0 -0
  242. package/src/web/public/images/app/maven.png +0 -0
  243. package/src/web/public/images/app/mcp.png +0 -0
  244. package/src/web/public/images/app/microsoftteams.png +0 -0
  245. package/src/web/public/images/app/mistral.png +0 -0
  246. package/src/web/public/images/app/monday.png +0 -0
  247. package/src/web/public/images/app/mongodb.png +0 -0
  248. package/src/web/public/images/app/mssql.png +0 -0
  249. package/src/web/public/images/app/mysql.png +0 -0
  250. package/src/web/public/images/app/n8n.png +0 -0
  251. package/src/web/public/images/app/notion.png +0 -0
  252. package/src/web/public/images/app/npm.png +0 -0
  253. package/src/web/public/images/app/nuget.png +0 -0
  254. package/src/web/public/images/app/obsidian.png +0 -0
  255. package/src/web/public/images/app/openai.png +0 -0
  256. package/src/web/public/images/app/openrouter.png +0 -0
  257. package/src/web/public/images/app/opensearch.png +0 -0
  258. package/src/web/public/images/app/openshift.png +0 -0
  259. package/src/web/public/images/app/oracle.png +0 -0
  260. package/src/web/public/images/app/perplexity.png +0 -0
  261. package/src/web/public/images/app/pipedream.png +0 -0
  262. package/src/web/public/images/app/postgresql.png +0 -0
  263. package/src/web/public/images/app/powershell.png +0 -0
  264. package/src/web/public/images/app/prometheus.png +0 -0
  265. package/src/web/public/images/app/reddit.png +0 -0
  266. package/src/web/public/images/app/redis.png +0 -0
  267. package/src/web/public/images/app/rss.png +0 -0
  268. package/src/web/public/images/app/signal.png +0 -0
  269. package/src/web/public/images/app/slack.png +0 -0
  270. package/src/web/public/images/app/soap.png +0 -0
  271. package/src/web/public/images/app/sqlite.png +0 -0
  272. package/src/web/public/images/app/supabase.png +0 -0
  273. package/src/web/public/images/app/telegram.png +0 -0
  274. package/src/web/public/images/app/things3.png +0 -0
  275. package/src/web/public/images/app/threads.png +0 -0
  276. package/src/web/public/images/app/tiktok.png +0 -0
  277. package/src/web/public/images/app/together.png +0 -0
  278. package/src/web/public/images/app/trello.png +0 -0
  279. package/src/web/public/images/app/vscode.png +0 -0
  280. package/src/web/public/images/app/webhook.png +0 -0
  281. package/src/web/public/images/app/webpage.png +0 -0
  282. package/src/web/public/images/app/whatsappbusiness.png +0 -0
  283. package/src/web/public/images/app/windsorf.png +0 -0
  284. package/src/web/public/images/app/x.png +0 -0
  285. package/src/web/public/images/app/youtube.png +0 -0
  286. package/src/web/public/images/app/zapier.png +0 -0
  287. package/src/web/public/images/app/zededitor.png +0 -0
  288. package/src/web/public/images/app/zoom.png +0 -0
  289. package/src/web/public/images/avatar-anon.svg +4 -0
  290. package/src/web/public/images/favicon.png +0 -0
  291. package/src/web/public/images/install/chatgpt-web/step0.png +0 -0
  292. package/src/web/public/images/install/chatgpt-web/step1.png +0 -0
  293. package/src/web/public/images/install/chatgpt-web/step2.png +0 -0
  294. package/src/web/public/images/install/chatgpt-web/step3.png +0 -0
  295. package/src/web/public/images/install/chatgpt-web/step4.png +0 -0
  296. package/src/web/public/images/install/chatgpt-web/step5.png +0 -0
  297. package/src/web/public/images/readme/1-generate-servers.png +0 -0
  298. package/src/web/public/images/readme/2-database-connection.png +0 -0
  299. package/src/web/public/images/readme/2-file-upload.png +0 -0
  300. package/src/web/public/images/readme/3-data-preview.png +0 -0
  301. package/src/web/public/images/readme/4-data-preview2.png +0 -0
  302. package/src/web/public/images/readme/5-server-configuration.png +0 -0
  303. package/src/web/public/images/readme/6-server-generated-modal.png +0 -0
  304. package/src/web/public/images/readme/7-generated-servers.png +0 -0
  305. package/src/web/public/images/readme/8-generated-servers-view-details.png +0 -0
  306. package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.23.51.png +0 -0
  307. package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.24.59.png +0 -0
  308. package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.05.png +0 -0
  309. package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.14.png +0 -0
  310. package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.21.png +0 -0
  311. package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.36.png +0 -0
  312. package/src/web/public/index.html +4685 -488
  313. package/src/web/public/landing.html +1638 -0
  314. package/src/web/public/logger.js +31 -0
  315. package/src/web/public/login.html +372 -0
  316. package/src/web/public/manage-servers.html +121 -188
  317. package/src/web/public/pricing.html +537 -0
  318. package/src/web/public/quick-ask.html +133 -0
  319. package/src/web/public/quickmcp-styles.css +708 -0
  320. package/src/web/public/roles.html +177 -0
  321. package/src/web/public/shared.js +736 -3
  322. package/src/web/public/sidebar.js +414 -0
  323. package/src/web/public/test-servers.html +605 -221
  324. package/src/web/public/users.html +191 -0
  325. package/dist/client/MCPClientUnified.d.ts +0 -31
  326. package/dist/client/MCPClientUnified.d.ts.map +0 -1
  327. package/dist/client/MCPClientUnified.js +0 -275
  328. package/dist/client/MCPClientUnified.js.map +0 -1
  329. package/dist/client/MCPTestRunnerUnified.d.ts +0 -48
  330. package/dist/client/MCPTestRunnerUnified.d.ts.map +0 -1
  331. package/dist/client/MCPTestRunnerUnified.js +0 -183
  332. package/dist/client/MCPTestRunnerUnified.js.map +0 -1
  333. package/dist/database/json-manager.d.ts +0 -55
  334. package/dist/database/json-manager.d.ts.map +0 -1
  335. package/dist/database/json-manager.js +0 -128
  336. package/dist/database/json-manager.js.map +0 -1
  337. package/dist/dynamic-mcp-executor.d.ts.map +0 -1
  338. package/dist/dynamic-mcp-executor.js +0 -274
  339. package/dist/dynamic-mcp-executor.js.map +0 -1
  340. package/dist/generators/MCPServerGenerator-new.d.ts +0 -37
  341. package/dist/generators/MCPServerGenerator-new.d.ts.map +0 -1
  342. package/dist/generators/MCPServerGenerator-new.js +0 -287
  343. package/dist/generators/MCPServerGenerator-new.js.map +0 -1
  344. package/dist/generators/database/sqlite-manager.d.ts +0 -52
  345. package/dist/generators/database/sqlite-manager.js +0 -143
  346. package/dist/generators/generators/MCPServerGenerator.d.ts +0 -37
  347. package/dist/generators/generators/MCPServerGenerator.js +0 -396
  348. package/dist/integrated-mcp-server.d.ts +0 -25
  349. package/dist/integrated-mcp-server.d.ts.map +0 -1
  350. package/dist/integrated-mcp-server.js +0 -541
  351. package/dist/integrated-mcp-server.js.map +0 -1
  352. package/dist/mcp-inspector-server.d.ts +0 -3
  353. package/dist/mcp-inspector-server.d.ts.map +0 -1
  354. package/dist/mcp-inspector-server.js +0 -119
  355. package/dist/mcp-inspector-server.js.map +0 -1
  356. package/dist/mcp-sdk-server.d.ts +0 -3
  357. package/dist/mcp-sdk-server.d.ts.map +0 -1
  358. package/dist/mcp-sdk-server.js +0 -90
  359. package/dist/mcp-sdk-server.js.map +0 -1
  360. package/dist/mcp-server.d.ts +0 -3
  361. package/dist/mcp-server.d.ts.map +0 -1
  362. package/dist/mcp-server.js +0 -300
  363. package/dist/mcp-server.js.map +0 -1
  364. package/dist/parsers/parsers/ExcelParser.js +0 -118
  365. package/dist/quickmcp-unified-bridge.d.ts +0 -13
  366. package/dist/quickmcp-unified-bridge.d.ts.map +0 -1
  367. package/dist/quickmcp-unified-bridge.js +0 -176
  368. package/dist/quickmcp-unified-bridge.js.map +0 -1
  369. package/dist/sqlite-manager.js +0 -145
  370. package/dist/test-app.d.ts +0 -2
  371. package/dist/test-app.d.ts.map +0 -1
  372. package/dist/test-app.js +0 -119
  373. package/dist/test-app.js.map +0 -1
  374. package/dist/transport/base-transport.d.ts +0 -21
  375. package/dist/transport/base-transport.d.ts.map +0 -1
  376. package/dist/transport/base-transport.js +0 -16
  377. package/dist/transport/base-transport.js.map +0 -1
  378. package/dist/transport/index.d.ts +0 -10
  379. package/dist/transport/index.d.ts.map +0 -1
  380. package/dist/transport/index.js +0 -12
  381. package/dist/transport/index.js.map +0 -1
  382. package/dist/transport/sse-transport.d.ts +0 -13
  383. package/dist/transport/sse-transport.d.ts.map +0 -1
  384. package/dist/transport/sse-transport.js +0 -106
  385. package/dist/transport/sse-transport.js.map +0 -1
  386. package/dist/transport/stdio-transport.d.ts +0 -8
  387. package/dist/transport/stdio-transport.d.ts.map +0 -1
  388. package/dist/transport/stdio-transport.js +0 -53
  389. package/dist/transport/stdio-transport.js.map +0 -1
  390. package/dist/transport/streamable-http-transport.d.ts +0 -15
  391. package/dist/transport/streamable-http-transport.d.ts.map +0 -1
  392. package/dist/transport/streamable-http-transport.js +0 -151
  393. package/dist/transport/streamable-http-transport.js.map +0 -1
  394. package/dist/web/client/MCPClient.js +0 -348
  395. package/dist/web/client/MCPTestRunner.js +0 -317
  396. package/dist/web/database/json-manager.js +0 -124
  397. package/dist/web/database/sqlite-manager.js +0 -146
  398. package/dist/web/dynamic-mcp-executor.js +0 -443
  399. package/dist/web/generators/MCPServerGenerator-new.js +0 -284
  400. package/dist/web/generators/MCPServerGenerator.js +0 -566
  401. package/dist/web/integrated-mcp-server-new.js +0 -394
  402. package/dist/web/parsers/CsvParser.js +0 -144
  403. package/dist/web/parsers/DatabaseParser.js +0 -637
  404. package/dist/web/parsers/ExcelParser.js +0 -180
  405. package/dist/web/parsers/index.js +0 -152
  406. package/dist/web/server.d.ts.map +0 -1
  407. package/dist/web/server.js +0 -790
  408. package/dist/web/server.js.map +0 -1
  409. package/dist/web/types/index.js +0 -2
  410. package/dist/web/web/server.js +0 -860
  411. package/src/web/public/modern-styles.css +0 -946
  412. package/src/web/public/shared-styles.css +0 -2091
  413. /package/src/web/public/images/{1-claude-quickmcp-stdio.png → readme/1-claude-quickmcp-stdio.png} +0 -0
  414. /package/src/web/public/images/{2-claude-tools.png → readme/2-claude-tools.png} +0 -0
  415. /package/src/web/public/images/{3-claude-developer-settings.png → readme/3-claude-developer-settings.png} +0 -0
  416. /package/src/web/public/images/{4-claude-config.png → readme/4-claude-config.png} +0 -0
  417. /package/src/web/public/images/{5-claude-config-edit.png → readme/5-claude-config-edit.png} +0 -0
@@ -1,394 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- var __assign = (this && this.__assign) || function () {
4
- __assign = Object.assign || function(t) {
5
- for (var s, i = 1, n = arguments.length; i < n; i++) {
6
- s = arguments[i];
7
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
8
- t[p] = s[p];
9
- }
10
- return t;
11
- };
12
- return __assign.apply(this, arguments);
13
- };
14
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
- return new (P || (P = Promise))(function (resolve, reject) {
17
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
- step((generator = generator.apply(thisArg, _arguments || [])).next());
21
- });
22
- };
23
- var __generator = (this && this.__generator) || function (thisArg, body) {
24
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
25
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
26
- function verb(n) { return function (v) { return step([n, v]); }; }
27
- function step(op) {
28
- if (f) throw new TypeError("Generator is already executing.");
29
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
30
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
31
- if (y = 0, t) op = [op[0] & 2, t.value];
32
- switch (op[0]) {
33
- case 0: case 1: t = op; break;
34
- case 4: _.label++; return { value: op[1], done: false };
35
- case 5: _.label++; y = op[1]; op = [0]; continue;
36
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
37
- default:
38
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
39
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
40
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
41
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
42
- if (t[2]) _.ops.pop();
43
- _.trys.pop(); continue;
44
- }
45
- op = body.call(thisArg, _);
46
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
47
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
48
- }
49
- };
50
- var __importDefault = (this && this.__importDefault) || function (mod) {
51
- return (mod && mod.__esModule) ? mod : { "default": mod };
52
- };
53
- Object.defineProperty(exports, "__esModule", { value: true });
54
- exports.IntegratedMCPServer = void 0;
55
- var index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
56
- var types_js_1 = require("@modelcontextprotocol/sdk/types.js");
57
- var express_1 = __importDefault(require("express"));
58
- var dynamic_mcp_executor_js_1 = require("./dynamic-mcp-executor.js");
59
- var IntegratedMCPServer = /** @class */ (function () {
60
- function IntegratedMCPServer() {
61
- this.executor = new dynamic_mcp_executor_js_1.DynamicMCPExecutor();
62
- this.server = new index_js_1.Server({
63
- name: 'quickmcp-integrated-server',
64
- version: '1.0.0'
65
- });
66
- this.app = (0, express_1.default)();
67
- this.setupHandlers();
68
- this.setupWebRoutes();
69
- }
70
- IntegratedMCPServer.prototype.setupHandlers = function () {
71
- var _this = this;
72
- // List tools - dynamically from SQLite
73
- this.server.setRequestHandler(types_js_1.ListToolsRequestSchema, function () { return __awaiter(_this, void 0, void 0, function () {
74
- var tools, error_1;
75
- return __generator(this, function (_a) {
76
- switch (_a.label) {
77
- case 0:
78
- _a.trys.push([0, 2, , 3]);
79
- return [4 /*yield*/, this.executor.getAllTools()];
80
- case 1:
81
- tools = _a.sent();
82
- console.error("\uD83D\uDCCB Listed ".concat(tools.length, " dynamic tools"));
83
- return [2 /*return*/, { tools: tools }];
84
- case 2:
85
- error_1 = _a.sent();
86
- console.error('❌ Error listing tools:', error_1);
87
- return [2 /*return*/, { tools: [] }];
88
- case 3: return [2 /*return*/];
89
- }
90
- });
91
- }); });
92
- // List resources - dynamically from SQLite
93
- this.server.setRequestHandler(types_js_1.ListResourcesRequestSchema, function () { return __awaiter(_this, void 0, void 0, function () {
94
- var resources, error_2;
95
- return __generator(this, function (_a) {
96
- switch (_a.label) {
97
- case 0:
98
- _a.trys.push([0, 2, , 3]);
99
- return [4 /*yield*/, this.executor.getAllResources()];
100
- case 1:
101
- resources = _a.sent();
102
- console.log("\uD83D\uDCC2 Listed ".concat(resources.length, " dynamic resources"));
103
- return [2 /*return*/, { resources: resources }];
104
- case 2:
105
- error_2 = _a.sent();
106
- console.error('❌ Error listing resources:', error_2);
107
- return [2 /*return*/, { resources: [] }];
108
- case 3: return [2 /*return*/];
109
- }
110
- });
111
- }); });
112
- // Execute tool - dynamically via database
113
- this.server.setRequestHandler(types_js_1.CallToolRequestSchema, function (request) { return __awaiter(_this, void 0, void 0, function () {
114
- var _a, name_1, args, result, error_3;
115
- return __generator(this, function (_b) {
116
- switch (_b.label) {
117
- case 0:
118
- _b.trys.push([0, 2, , 3]);
119
- _a = request.params, name_1 = _a.name, args = _a.arguments;
120
- console.log("\uD83D\uDD27 Executing dynamic tool: ".concat(name_1));
121
- return [4 /*yield*/, this.executor.executeTool(name_1, args || {})];
122
- case 1:
123
- result = _b.sent();
124
- return [2 /*return*/, {
125
- content: [
126
- {
127
- type: 'text',
128
- text: JSON.stringify(result, null, 2)
129
- }
130
- ]
131
- }];
132
- case 2:
133
- error_3 = _b.sent();
134
- console.error("\u274C Error executing tool ".concat(request.params.name, ":"), error_3);
135
- throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, "Failed to execute tool: ".concat(error_3 instanceof Error ? error_3.message : 'Unknown error'));
136
- case 3: return [2 /*return*/];
137
- }
138
- });
139
- }); });
140
- // Read resource - dynamically via database
141
- this.server.setRequestHandler(types_js_1.ReadResourceRequestSchema, function (request) { return __awaiter(_this, void 0, void 0, function () {
142
- var uri, resourceName, result, error_4;
143
- return __generator(this, function (_a) {
144
- switch (_a.label) {
145
- case 0:
146
- _a.trys.push([0, 2, , 3]);
147
- uri = request.params.uri;
148
- console.log("\uD83D\uDCD6 Reading dynamic resource: ".concat(uri));
149
- resourceName = uri.split('://')[0];
150
- return [4 /*yield*/, this.executor.readResource(resourceName)];
151
- case 1:
152
- result = _a.sent();
153
- return [2 /*return*/, result];
154
- case 2:
155
- error_4 = _a.sent();
156
- console.error("\u274C Error reading resource ".concat(request.params.uri, ":"), error_4);
157
- throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, "Failed to read resource: ".concat(error_4 instanceof Error ? error_4.message : 'Unknown error'));
158
- case 3: return [2 /*return*/];
159
- }
160
- });
161
- }); });
162
- // Prompts - return empty for now
163
- this.server.setRequestHandler(types_js_1.ListPromptsRequestSchema, function () { return __awaiter(_this, void 0, void 0, function () {
164
- return __generator(this, function (_a) {
165
- return [2 /*return*/, { prompts: [] }];
166
- });
167
- }); });
168
- this.server.setRequestHandler(types_js_1.GetPromptRequestSchema, function (request) { return __awaiter(_this, void 0, void 0, function () {
169
- return __generator(this, function (_a) {
170
- throw new types_js_1.McpError(types_js_1.ErrorCode.MethodNotFound, "Prompt not found: ".concat(request.params.name));
171
- });
172
- }); });
173
- };
174
- IntegratedMCPServer.prototype.setupWebRoutes = function () {
175
- var _this = this;
176
- this.app.use(express_1.default.json({ limit: '50mb' }));
177
- this.app.use(express_1.default.raw({ type: '*/*', limit: '50mb' }));
178
- // Health check
179
- this.app.get('/health', function (req, res) {
180
- var stats = _this.executor.getStats();
181
- res.json(__assign(__assign({ status: 'healthy' }, stats), { timestamp: new Date().toISOString() }));
182
- });
183
- // MCP STDIO endpoint for bridge
184
- this.app.post('/api/mcp-stdio', express_1.default.raw({ type: '*/*' }), function (req, res) { return __awaiter(_this, void 0, void 0, function () {
185
- var messageData, response, _a, tools, resources, toolResult, uri, resourceName, resourceResult, error_5;
186
- var _b;
187
- return __generator(this, function (_c) {
188
- switch (_c.label) {
189
- case 0:
190
- _c.trys.push([0, 13, , 14]);
191
- messageData = void 0;
192
- if (Buffer.isBuffer(req.body)) {
193
- messageData = JSON.parse(req.body.toString());
194
- }
195
- else if (typeof req.body === 'string') {
196
- messageData = JSON.parse(req.body);
197
- }
198
- else {
199
- messageData = req.body;
200
- }
201
- console.log('🔄 Processing MCP message:', messageData.method || 'unknown');
202
- response = null;
203
- _a = messageData.method;
204
- switch (_a) {
205
- case 'initialize': return [3 /*break*/, 1];
206
- case 'tools/list': return [3 /*break*/, 2];
207
- case 'resources/list': return [3 /*break*/, 4];
208
- case 'tools/call': return [3 /*break*/, 6];
209
- case 'resources/read': return [3 /*break*/, 8];
210
- case 'notifications/initialized': return [3 /*break*/, 10];
211
- }
212
- return [3 /*break*/, 11];
213
- case 1:
214
- response = {
215
- jsonrpc: '2.0',
216
- id: messageData.id,
217
- result: {
218
- protocolVersion: '2024-11-05',
219
- serverInfo: {
220
- name: 'quickmcp-integrated',
221
- version: '1.0.0'
222
- },
223
- capabilities: {
224
- tools: {},
225
- resources: {},
226
- prompts: {}
227
- }
228
- }
229
- };
230
- return [3 /*break*/, 12];
231
- case 2: return [4 /*yield*/, this.executor.getAllTools()];
232
- case 3:
233
- tools = _c.sent();
234
- response = {
235
- jsonrpc: '2.0',
236
- id: messageData.id,
237
- result: { tools: tools }
238
- };
239
- return [3 /*break*/, 12];
240
- case 4: return [4 /*yield*/, this.executor.getAllResources()];
241
- case 5:
242
- resources = _c.sent();
243
- response = {
244
- jsonrpc: '2.0',
245
- id: messageData.id,
246
- result: { resources: resources }
247
- };
248
- return [3 /*break*/, 12];
249
- case 6: return [4 /*yield*/, this.executor.executeTool(messageData.params.name, messageData.params.arguments || {})];
250
- case 7:
251
- toolResult = _c.sent();
252
- response = {
253
- jsonrpc: '2.0',
254
- id: messageData.id,
255
- result: {
256
- content: [
257
- {
258
- type: 'text',
259
- text: JSON.stringify(toolResult, null, 2)
260
- }
261
- ]
262
- }
263
- };
264
- return [3 /*break*/, 12];
265
- case 8:
266
- uri = messageData.params.uri;
267
- resourceName = uri.split('://')[0];
268
- return [4 /*yield*/, this.executor.readResource(resourceName)];
269
- case 9:
270
- resourceResult = _c.sent();
271
- response = {
272
- jsonrpc: '2.0',
273
- id: messageData.id,
274
- result: resourceResult
275
- };
276
- return [3 /*break*/, 12];
277
- case 10:
278
- // No response for notifications
279
- console.log('🔔 MCP client initialized');
280
- return [3 /*break*/, 12];
281
- case 11:
282
- if (messageData.id) {
283
- response = {
284
- jsonrpc: '2.0',
285
- id: messageData.id,
286
- error: {
287
- code: -32601,
288
- message: "Method not found: ".concat(messageData.method)
289
- }
290
- };
291
- }
292
- _c.label = 12;
293
- case 12:
294
- if (response) {
295
- res.json(response);
296
- }
297
- else {
298
- res.status(204).end();
299
- }
300
- return [3 /*break*/, 14];
301
- case 13:
302
- error_5 = _c.sent();
303
- console.error('❌ Error processing MCP message:', error_5);
304
- res.status(500).json({
305
- jsonrpc: '2.0',
306
- id: (_b = req.body) === null || _b === void 0 ? void 0 : _b.id,
307
- error: {
308
- code: -32603,
309
- message: "Internal error: ".concat(error_5 instanceof Error ? error_5.message : 'Unknown error')
310
- }
311
- });
312
- return [3 /*break*/, 14];
313
- case 14: return [2 /*return*/];
314
- }
315
- });
316
- }); });
317
- // Stats endpoint
318
- this.app.get('/api/stats', function (req, res) {
319
- res.json(_this.executor.getStats());
320
- });
321
- };
322
- IntegratedMCPServer.prototype.start = function () {
323
- return __awaiter(this, arguments, void 0, function (port) {
324
- var httpServer;
325
- var _this = this;
326
- if (port === void 0) { port = 3001; }
327
- return __generator(this, function (_a) {
328
- httpServer = this.app.listen(port, function () {
329
- console.log("\uD83D\uDE80 QuickMCP Integrated Server running on http://localhost:".concat(port));
330
- var stats = _this.executor.getStats();
331
- console.log("\uD83D\uDCCA Managing ".concat(stats.servers, " virtual servers with ").concat(stats.tools, " tools and ").concat(stats.resources, " resources"));
332
- });
333
- // Setup SSE transport for MCP - skip for now due to compatibility issues
334
- // const transport = new SSEServerTransport('/sse', httpServer);
335
- // await this.server.connect(transport);
336
- console.log('✅ MCP server connected with dynamic SQLite-based execution (HTTP endpoints active)');
337
- // Graceful shutdown
338
- process.on('SIGINT', function () { return __awaiter(_this, void 0, void 0, function () {
339
- return __generator(this, function (_a) {
340
- switch (_a.label) {
341
- case 0:
342
- console.log('\n🔄 Shutting down QuickMCP Integrated Server...');
343
- return [4 /*yield*/, this.cleanup()];
344
- case 1:
345
- _a.sent();
346
- process.exit(0);
347
- return [2 /*return*/];
348
- }
349
- });
350
- }); });
351
- process.on('SIGTERM', function () { return __awaiter(_this, void 0, void 0, function () {
352
- return __generator(this, function (_a) {
353
- switch (_a.label) {
354
- case 0:
355
- console.log('\n🔄 Shutting down QuickMCP Integrated Server...');
356
- return [4 /*yield*/, this.cleanup()];
357
- case 1:
358
- _a.sent();
359
- process.exit(0);
360
- return [2 /*return*/];
361
- }
362
- });
363
- }); });
364
- return [2 /*return*/];
365
- });
366
- });
367
- };
368
- IntegratedMCPServer.prototype.cleanup = function () {
369
- return __awaiter(this, void 0, void 0, function () {
370
- var error_6;
371
- return __generator(this, function (_a) {
372
- switch (_a.label) {
373
- case 0:
374
- _a.trys.push([0, 3, , 4]);
375
- return [4 /*yield*/, this.server.close()];
376
- case 1:
377
- _a.sent();
378
- return [4 /*yield*/, this.executor.close()];
379
- case 2:
380
- _a.sent();
381
- console.log('✅ Cleanup completed');
382
- return [3 /*break*/, 4];
383
- case 3:
384
- error_6 = _a.sent();
385
- console.error('❌ Error during cleanup:', error_6);
386
- return [3 /*break*/, 4];
387
- case 4: return [2 /*return*/];
388
- }
389
- });
390
- });
391
- };
392
- return IntegratedMCPServer;
393
- }());
394
- exports.IntegratedMCPServer = IntegratedMCPServer;
@@ -1,144 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
36
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
37
- return new (P || (P = Promise))(function (resolve, reject) {
38
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
39
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
40
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
41
- step((generator = generator.apply(thisArg, _arguments || [])).next());
42
- });
43
- };
44
- var __generator = (this && this.__generator) || function (thisArg, body) {
45
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
46
- return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
47
- function verb(n) { return function (v) { return step([n, v]); }; }
48
- function step(op) {
49
- if (f) throw new TypeError("Generator is already executing.");
50
- while (g && (g = 0, op[0] && (_ = 0)), _) try {
51
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
52
- if (y = 0, t) op = [op[0] & 2, t.value];
53
- switch (op[0]) {
54
- case 0: case 1: t = op; break;
55
- case 4: _.label++; return { value: op[1], done: false };
56
- case 5: _.label++; y = op[1]; op = [0]; continue;
57
- case 7: op = _.ops.pop(); _.trys.pop(); continue;
58
- default:
59
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
60
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
61
- if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
62
- if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
63
- if (t[2]) _.ops.pop();
64
- _.trys.pop(); continue;
65
- }
66
- op = body.call(thisArg, _);
67
- } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
68
- if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
69
- }
70
- };
71
- Object.defineProperty(exports, "__esModule", { value: true });
72
- exports.CsvParser = void 0;
73
- var fs = __importStar(require("fs"));
74
- var csv = __importStar(require("csv-parser"));
75
- var path = __importStar(require("path"));
76
- var CsvParser = /** @class */ (function () {
77
- function CsvParser() {
78
- }
79
- CsvParser.prototype.parse = function (filePath) {
80
- return __awaiter(this, void 0, void 0, function () {
81
- var _this = this;
82
- return __generator(this, function (_a) {
83
- return [2 /*return*/, new Promise(function (resolve, reject) {
84
- var rows = [];
85
- var headers = [];
86
- fs.createReadStream(filePath)
87
- .pipe(csv.default())
88
- .on('headers', function (headerList) {
89
- headers = headerList;
90
- })
91
- .on('data', function (data) {
92
- rows.push(Object.values(data));
93
- })
94
- .on('end', function () {
95
- var dataTypes = _this.inferDataTypes(rows, headers);
96
- var fileName = path.basename(filePath, path.extname(filePath));
97
- resolve({
98
- tableName: fileName,
99
- headers: headers,
100
- rows: rows,
101
- metadata: {
102
- rowCount: rows.length,
103
- columnCount: headers.length,
104
- dataTypes: dataTypes
105
- }
106
- });
107
- })
108
- .on('error', reject);
109
- })];
110
- });
111
- });
112
- };
113
- CsvParser.prototype.inferDataTypes = function (rows, headers) {
114
- var _this = this;
115
- var dataTypes = {};
116
- headers.forEach(function (header, index) {
117
- var sample = rows.slice(0, 100).map(function (row) { return row[index]; });
118
- dataTypes[header] = _this.inferColumnType(sample);
119
- });
120
- return dataTypes;
121
- };
122
- CsvParser.prototype.inferColumnType = function (values) {
123
- var nonNullValues = values.filter(function (v) { return v !== null && v !== undefined && v !== ''; });
124
- if (nonNullValues.length === 0)
125
- return 'string';
126
- var isNumeric = nonNullValues.every(function (v) { return !isNaN(Number(v)); });
127
- var isInteger = isNumeric && nonNullValues.every(function (v) { return Number.isInteger(Number(v)); });
128
- var isBoolean = nonNullValues.every(function (v) {
129
- return v === 'true' || v === 'false' || v === '1' || v === '0';
130
- });
131
- var isDate = nonNullValues.every(function (v) { return !isNaN(Date.parse(v)); });
132
- if (isBoolean)
133
- return 'boolean';
134
- if (isInteger)
135
- return 'integer';
136
- if (isNumeric)
137
- return 'number';
138
- if (isDate)
139
- return 'date';
140
- return 'string';
141
- };
142
- return CsvParser;
143
- }());
144
- exports.CsvParser = CsvParser;