@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.
- package/dist/auth/auth-utils.d.ts +130 -0
- package/dist/auth/auth-utils.d.ts.map +1 -0
- package/dist/auth/auth-utils.js +600 -0
- package/dist/auth/auth-utils.js.map +1 -0
- package/dist/auth/jwks-provider.d.ts +9 -0
- package/dist/auth/jwks-provider.d.ts.map +1 -0
- package/dist/auth/jwks-provider.js +56 -0
- package/dist/auth/jwks-provider.js.map +1 -0
- package/dist/auth/token-utils.d.ts +40 -0
- package/dist/auth/token-utils.d.ts.map +1 -0
- package/dist/auth/token-utils.js +162 -0
- package/dist/auth/token-utils.js.map +1 -0
- package/dist/client/MCPClient.js +5 -4
- package/dist/client/MCPClient.js.map +1 -1
- package/dist/config/auth-config.d.ts +16 -0
- package/dist/config/auth-config.d.ts.map +1 -0
- package/dist/config/auth-config.js +107 -0
- package/dist/config/auth-config.js.map +1 -0
- package/dist/constant/constant.d.ts +20 -0
- package/dist/constant/constant.d.ts.map +1 -0
- package/dist/constant/constant.js +24 -0
- package/dist/constant/constant.js.map +1 -0
- package/dist/database/async-datastore.d.ts +6 -0
- package/dist/database/async-datastore.d.ts.map +1 -0
- package/dist/database/async-datastore.js +15 -0
- package/dist/database/async-datastore.js.map +1 -0
- package/dist/database/database-utils.d.ts +6 -0
- package/dist/database/database-utils.d.ts.map +1 -0
- package/dist/database/database-utils.js +29 -0
- package/dist/database/database-utils.js.map +1 -0
- package/dist/database/datastore.d.ts +164 -0
- package/dist/database/datastore.d.ts.map +1 -0
- package/dist/{parsers/types/index.js → database/datastore.js} +1 -0
- package/dist/database/datastore.js.map +1 -0
- package/dist/database/factory.d.ts +4 -0
- package/dist/database/factory.d.ts.map +1 -0
- package/dist/database/factory.js +32 -0
- package/dist/database/factory.js.map +1 -0
- package/dist/database/jdbc-manager.d.ts +49 -0
- package/dist/database/jdbc-manager.d.ts.map +1 -0
- package/dist/database/jdbc-manager.js +50 -0
- package/dist/database/jdbc-manager.js.map +1 -0
- package/dist/database/sqlite-manager.d.ts +46 -44
- package/dist/database/sqlite-manager.d.ts.map +1 -1
- package/dist/database/sqlite-manager.js +492 -42
- package/dist/database/sqlite-manager.js.map +1 -1
- package/dist/database/supabase-manager.d.ts +58 -0
- package/dist/database/supabase-manager.d.ts.map +1 -0
- package/dist/database/supabase-manager.js +432 -0
- package/dist/database/supabase-manager.js.map +1 -0
- package/dist/generators/MCPServerGenerator.d.ts +103 -20
- package/dist/generators/MCPServerGenerator.d.ts.map +1 -1
- package/dist/generators/MCPServerGenerator.js +6930 -128
- package/dist/generators/MCPServerGenerator.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/integrated-mcp-server-new.d.ts +14 -2
- package/dist/integrated-mcp-server-new.d.ts.map +1 -1
- package/dist/integrated-mcp-server-new.js +270 -180
- package/dist/integrated-mcp-server-new.js.map +1 -1
- package/dist/mcp-core/McpCoreService.d.ts +63 -0
- package/dist/mcp-core/McpCoreService.d.ts.map +1 -0
- package/dist/mcp-core/McpCoreService.js +492 -0
- package/dist/mcp-core/McpCoreService.js.map +1 -0
- package/dist/parsers/CsvParser.d.ts +1 -1
- package/dist/parsers/CsvParser.d.ts.map +1 -1
- package/dist/parsers/CsvParser.js +3 -2
- package/dist/parsers/CsvParser.js.map +1 -1
- package/dist/parsers/DatabaseParser.d.ts.map +1 -1
- package/dist/parsers/DatabaseParser.js +9 -8
- package/dist/parsers/DatabaseParser.js.map +1 -1
- package/dist/parsers/ExcelParser.d.ts +15 -0
- package/dist/parsers/ExcelParser.d.ts.map +1 -1
- package/dist/parsers/ExcelParser.js +287 -21
- package/dist/parsers/ExcelParser.js.map +1 -1
- package/dist/parsers/WebPageParser.d.ts +5 -0
- package/dist/parsers/WebPageParser.d.ts.map +1 -0
- package/dist/parsers/WebPageParser.js +35 -0
- package/dist/parsers/WebPageParser.js.map +1 -0
- package/dist/parsers/index.d.ts +3 -2
- package/dist/parsers/index.d.ts.map +1 -1
- package/dist/parsers/index.js +19 -16
- package/dist/parsers/index.js.map +1 -1
- package/dist/server/api/askApi.d.ts +41 -0
- package/dist/server/api/askApi.d.ts.map +1 -0
- package/dist/server/api/askApi.js +479 -0
- package/dist/server/api/askApi.js.map +1 -0
- package/dist/server/api/authApi.d.ts +101 -0
- package/dist/server/api/authApi.d.ts.map +1 -0
- package/dist/server/api/authApi.js +1472 -0
- package/dist/server/api/authApi.js.map +1 -0
- package/dist/server/api/authProperty.d.ts +18 -0
- package/dist/server/api/authProperty.d.ts.map +1 -0
- package/dist/server/api/authProperty.js +41 -0
- package/dist/server/api/authProperty.js.map +1 -0
- package/dist/server/api/configApi.d.ts +15 -0
- package/dist/server/api/configApi.d.ts.map +1 -0
- package/dist/server/api/configApi.js +42 -0
- package/dist/server/api/configApi.js.map +1 -0
- package/dist/server/api/databaseApi.d.ts +14 -0
- package/dist/server/api/databaseApi.d.ts.map +1 -0
- package/dist/server/api/databaseApi.js +111 -0
- package/dist/server/api/databaseApi.js.map +1 -0
- package/dist/server/api/directoryApi.d.ts +9 -0
- package/dist/server/api/directoryApi.d.ts.map +1 -0
- package/dist/server/api/directoryApi.js +103 -0
- package/dist/server/api/directoryApi.js.map +1 -0
- package/dist/server/api/generateApi.d.ts +24 -0
- package/dist/server/api/generateApi.d.ts.map +1 -0
- package/dist/server/api/generateApi.js +457 -0
- package/dist/server/api/generateApi.js.map +1 -0
- package/dist/server/api/healthApi.d.ts +9 -0
- package/dist/server/api/healthApi.d.ts.map +1 -0
- package/dist/server/api/healthApi.js +15 -0
- package/dist/server/api/healthApi.js.map +1 -0
- package/dist/server/api/indexApi.d.ts +21 -0
- package/dist/server/api/indexApi.d.ts.map +1 -0
- package/dist/server/api/indexApi.js +61 -0
- package/dist/server/api/indexApi.js.map +1 -0
- package/dist/server/api/logsApi.d.ts +12 -0
- package/dist/server/api/logsApi.d.ts.map +1 -0
- package/dist/server/api/logsApi.js +37 -0
- package/dist/server/api/logsApi.js.map +1 -0
- package/dist/server/api/mcpApi.d.ts +20 -0
- package/dist/server/api/mcpApi.d.ts.map +1 -0
- package/dist/server/api/mcpApi.js +120 -0
- package/dist/server/api/mcpApi.js.map +1 -0
- package/dist/server/api/nameApi.d.ts +21 -0
- package/dist/server/api/nameApi.d.ts.map +1 -0
- package/dist/server/api/nameApi.js +42 -0
- package/dist/server/api/nameApi.js.map +1 -0
- package/dist/server/api/parseApi.d.ts +9 -0
- package/dist/server/api/parseApi.d.ts.map +1 -0
- package/dist/server/api/parseApi.js +3245 -0
- package/dist/server/api/parseApi.js.map +1 -0
- package/dist/server/api/serverApi.d.ts +44 -0
- package/dist/server/api/serverApi.d.ts.map +1 -0
- package/dist/server/api/serverApi.js +417 -0
- package/dist/server/api/serverApi.js.map +1 -0
- package/dist/{dynamic-mcp-executor.d.ts → server/dynamic-mcp-executor.d.ts} +4 -5
- package/dist/server/dynamic-mcp-executor.d.ts.map +1 -0
- package/dist/server/dynamic-mcp-executor.js +62 -0
- package/dist/server/dynamic-mcp-executor.js.map +1 -0
- package/dist/server/port-utils.d.ts +14 -0
- package/dist/server/port-utils.d.ts.map +1 -0
- package/dist/server/port-utils.js +31 -0
- package/dist/server/port-utils.js.map +1 -0
- package/dist/server/server-utils.d.ts +13 -0
- package/dist/server/server-utils.d.ts.map +1 -0
- package/dist/server/server-utils.js +72 -0
- package/dist/server/server-utils.js.map +1 -0
- package/dist/{web → server}/server.d.ts +1 -0
- package/dist/server/server.d.ts.map +1 -0
- package/dist/server/server.js +535 -0
- package/dist/server/server.js.map +1 -0
- package/dist/server/tool-executer.d.ts +101 -0
- package/dist/server/tool-executer.d.ts.map +1 -0
- package/dist/server/tool-executer.js +6198 -0
- package/dist/server/tool-executer.js.map +1 -0
- package/dist/types/index.d.ts +1197 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1028 -0
- package/dist/types/index.js.map +1 -1
- package/dist/upload/upload-utils.d.ts +4 -0
- package/dist/upload/upload-utils.d.ts.map +1 -0
- package/dist/upload/upload-utils.js +29 -0
- package/dist/upload/upload-utils.js.map +1 -0
- package/dist/utils/deployment-util.d.ts +14 -0
- package/dist/utils/deployment-util.d.ts.map +1 -0
- package/dist/utils/deployment-util.js +46 -0
- package/dist/utils/deployment-util.js.map +1 -0
- package/dist/utils/logger.d.ts +15 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +56 -0
- package/dist/utils/logger.js.map +1 -0
- package/package.json +18 -6
- package/quickmcp-direct-stdio.js +176 -187
- package/src/web/public/app.js +15370 -1471
- package/src/web/public/authorization.html +868 -0
- package/src/web/public/database-tables.html +283 -547
- package/src/web/public/how-to-use.html +446 -462
- package/src/web/public/how-to-use.js +4 -4
- package/src/web/public/images/app/activepieces.png +0 -0
- package/src/web/public/images/app/airtable.png +0 -0
- package/src/web/public/images/app/androidstudio.png +0 -0
- package/src/web/public/images/app/antigravity.png +0 -0
- package/src/web/public/images/app/applenotes.png +0 -0
- package/src/web/public/images/app/applereminders.png +0 -0
- package/src/web/public/images/app/asana.png +0 -0
- package/src/web/public/images/app/azureai.png +0 -0
- package/src/web/public/images/app/bash.png +0 -0
- package/src/web/public/images/app/bearnotes.png +0 -0
- package/src/web/public/images/app/bitbucket.png +0 -0
- package/src/web/public/images/app/claude.png +0 -0
- package/src/web/public/images/app/cli.png +0 -0
- package/src/web/public/images/app/clickup.png +0 -0
- package/src/web/public/images/app/cohere.png +0 -0
- package/src/web/public/images/app/confluence.png +0 -0
- package/src/web/public/images/app/confluence2.png +0 -0
- package/src/web/public/images/app/curl.png +0 -0
- package/src/web/public/images/app/curl_mini.png +0 -0
- package/src/web/public/images/app/cursor.png +0 -0
- package/src/web/public/images/app/db2.png +0 -0
- package/src/web/public/images/app/deepseek.png +0 -0
- package/src/web/public/images/app/discord.png +0 -0
- package/src/web/public/images/app/docker.png +0 -0
- package/src/web/public/images/app/dockerhub.png +0 -0
- package/src/web/public/images/app/dropbox.png +0 -0
- package/src/web/public/images/app/elasticsearch.png +0 -0
- package/src/web/public/images/app/facebook.png +0 -0
- package/src/web/public/images/app/falai.png +0 -0
- package/src/web/public/images/app/fireworks.png +0 -0
- package/src/web/public/images/app/gdrive.png +0 -0
- package/src/web/public/images/app/gemini.png +0 -0
- package/src/web/public/images/app/github.png +0 -0
- package/src/web/public/images/app/githubcopilot.png +0 -0
- package/src/web/public/images/app/gitlab.png +0 -0
- package/src/web/public/images/app/gmail.png +0 -0
- package/src/web/public/images/app/googlecalender.png +0 -0
- package/src/web/public/images/app/googledocs.png +0 -0
- package/src/web/public/images/app/googlesheets.png +0 -0
- package/src/web/public/images/app/gradle.png +0 -0
- package/src/web/public/images/app/grafana.png +0 -0
- package/src/web/public/images/app/graphql.png +0 -0
- package/src/web/public/images/app/grok.png +0 -0
- package/src/web/public/images/app/groq.png +0 -0
- package/src/web/public/images/app/hazelcast.png +0 -0
- package/src/web/public/images/app/huggingface.png +0 -0
- package/src/web/public/images/app/imessage.png +0 -0
- package/src/web/public/images/app/instagram.png +0 -0
- package/src/web/public/images/app/intellij.png +0 -0
- package/src/web/public/images/app/jenkins.png +0 -0
- package/src/web/public/images/app/jira.png +0 -0
- package/src/web/public/images/app/kafka.png +0 -0
- package/src/web/public/images/app/kubernetes.png +0 -0
- package/src/web/public/images/app/linear.png +0 -0
- package/src/web/public/images/app/linkedin.png +0 -0
- package/src/web/public/images/app/llama.png +0 -0
- package/src/web/public/images/app/make.png +0 -0
- package/src/web/public/images/app/maven.png +0 -0
- package/src/web/public/images/app/mcp.png +0 -0
- package/src/web/public/images/app/microsoftteams.png +0 -0
- package/src/web/public/images/app/mistral.png +0 -0
- package/src/web/public/images/app/monday.png +0 -0
- package/src/web/public/images/app/mongodb.png +0 -0
- package/src/web/public/images/app/mssql.png +0 -0
- package/src/web/public/images/app/mysql.png +0 -0
- package/src/web/public/images/app/n8n.png +0 -0
- package/src/web/public/images/app/notion.png +0 -0
- package/src/web/public/images/app/npm.png +0 -0
- package/src/web/public/images/app/nuget.png +0 -0
- package/src/web/public/images/app/obsidian.png +0 -0
- package/src/web/public/images/app/openai.png +0 -0
- package/src/web/public/images/app/openrouter.png +0 -0
- package/src/web/public/images/app/opensearch.png +0 -0
- package/src/web/public/images/app/openshift.png +0 -0
- package/src/web/public/images/app/oracle.png +0 -0
- package/src/web/public/images/app/perplexity.png +0 -0
- package/src/web/public/images/app/pipedream.png +0 -0
- package/src/web/public/images/app/postgresql.png +0 -0
- package/src/web/public/images/app/powershell.png +0 -0
- package/src/web/public/images/app/prometheus.png +0 -0
- package/src/web/public/images/app/reddit.png +0 -0
- package/src/web/public/images/app/redis.png +0 -0
- package/src/web/public/images/app/rss.png +0 -0
- package/src/web/public/images/app/signal.png +0 -0
- package/src/web/public/images/app/slack.png +0 -0
- package/src/web/public/images/app/soap.png +0 -0
- package/src/web/public/images/app/sqlite.png +0 -0
- package/src/web/public/images/app/supabase.png +0 -0
- package/src/web/public/images/app/telegram.png +0 -0
- package/src/web/public/images/app/things3.png +0 -0
- package/src/web/public/images/app/threads.png +0 -0
- package/src/web/public/images/app/tiktok.png +0 -0
- package/src/web/public/images/app/together.png +0 -0
- package/src/web/public/images/app/trello.png +0 -0
- package/src/web/public/images/app/vscode.png +0 -0
- package/src/web/public/images/app/webhook.png +0 -0
- package/src/web/public/images/app/webpage.png +0 -0
- package/src/web/public/images/app/whatsappbusiness.png +0 -0
- package/src/web/public/images/app/windsorf.png +0 -0
- package/src/web/public/images/app/x.png +0 -0
- package/src/web/public/images/app/youtube.png +0 -0
- package/src/web/public/images/app/zapier.png +0 -0
- package/src/web/public/images/app/zededitor.png +0 -0
- package/src/web/public/images/app/zoom.png +0 -0
- package/src/web/public/images/avatar-anon.svg +4 -0
- package/src/web/public/images/favicon.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step0.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step1.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step2.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step3.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step4.png +0 -0
- package/src/web/public/images/install/chatgpt-web/step5.png +0 -0
- package/src/web/public/images/readme/1-generate-servers.png +0 -0
- package/src/web/public/images/readme/2-database-connection.png +0 -0
- package/src/web/public/images/readme/2-file-upload.png +0 -0
- package/src/web/public/images/readme/3-data-preview.png +0 -0
- package/src/web/public/images/readme/4-data-preview2.png +0 -0
- package/src/web/public/images/readme/5-server-configuration.png +0 -0
- package/src/web/public/images/readme/6-server-generated-modal.png +0 -0
- package/src/web/public/images/readme/7-generated-servers.png +0 -0
- package/src/web/public/images/readme/8-generated-servers-view-details.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.23.51.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.24.59.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.05.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.14.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.21.png +0 -0
- package/src/web/public/images/readme/Screenshot 2025-10-09 at 20.25.36.png +0 -0
- package/src/web/public/index.html +4685 -488
- package/src/web/public/landing.html +1638 -0
- package/src/web/public/logger.js +31 -0
- package/src/web/public/login.html +372 -0
- package/src/web/public/manage-servers.html +121 -188
- package/src/web/public/pricing.html +537 -0
- package/src/web/public/quick-ask.html +133 -0
- package/src/web/public/quickmcp-styles.css +708 -0
- package/src/web/public/roles.html +177 -0
- package/src/web/public/shared.js +736 -3
- package/src/web/public/sidebar.js +414 -0
- package/src/web/public/test-servers.html +605 -221
- package/src/web/public/users.html +191 -0
- package/dist/client/MCPClientUnified.d.ts +0 -31
- package/dist/client/MCPClientUnified.d.ts.map +0 -1
- package/dist/client/MCPClientUnified.js +0 -275
- package/dist/client/MCPClientUnified.js.map +0 -1
- package/dist/client/MCPTestRunnerUnified.d.ts +0 -48
- package/dist/client/MCPTestRunnerUnified.d.ts.map +0 -1
- package/dist/client/MCPTestRunnerUnified.js +0 -183
- package/dist/client/MCPTestRunnerUnified.js.map +0 -1
- package/dist/database/json-manager.d.ts +0 -55
- package/dist/database/json-manager.d.ts.map +0 -1
- package/dist/database/json-manager.js +0 -128
- package/dist/database/json-manager.js.map +0 -1
- package/dist/dynamic-mcp-executor.d.ts.map +0 -1
- package/dist/dynamic-mcp-executor.js +0 -274
- package/dist/dynamic-mcp-executor.js.map +0 -1
- package/dist/generators/MCPServerGenerator-new.d.ts +0 -37
- package/dist/generators/MCPServerGenerator-new.d.ts.map +0 -1
- package/dist/generators/MCPServerGenerator-new.js +0 -287
- package/dist/generators/MCPServerGenerator-new.js.map +0 -1
- package/dist/generators/database/sqlite-manager.d.ts +0 -52
- package/dist/generators/database/sqlite-manager.js +0 -143
- package/dist/generators/generators/MCPServerGenerator.d.ts +0 -37
- package/dist/generators/generators/MCPServerGenerator.js +0 -396
- package/dist/integrated-mcp-server.d.ts +0 -25
- package/dist/integrated-mcp-server.d.ts.map +0 -1
- package/dist/integrated-mcp-server.js +0 -541
- package/dist/integrated-mcp-server.js.map +0 -1
- package/dist/mcp-inspector-server.d.ts +0 -3
- package/dist/mcp-inspector-server.d.ts.map +0 -1
- package/dist/mcp-inspector-server.js +0 -119
- package/dist/mcp-inspector-server.js.map +0 -1
- package/dist/mcp-sdk-server.d.ts +0 -3
- package/dist/mcp-sdk-server.d.ts.map +0 -1
- package/dist/mcp-sdk-server.js +0 -90
- package/dist/mcp-sdk-server.js.map +0 -1
- package/dist/mcp-server.d.ts +0 -3
- package/dist/mcp-server.d.ts.map +0 -1
- package/dist/mcp-server.js +0 -300
- package/dist/mcp-server.js.map +0 -1
- package/dist/parsers/parsers/ExcelParser.js +0 -118
- package/dist/quickmcp-unified-bridge.d.ts +0 -13
- package/dist/quickmcp-unified-bridge.d.ts.map +0 -1
- package/dist/quickmcp-unified-bridge.js +0 -176
- package/dist/quickmcp-unified-bridge.js.map +0 -1
- package/dist/sqlite-manager.js +0 -145
- package/dist/test-app.d.ts +0 -2
- package/dist/test-app.d.ts.map +0 -1
- package/dist/test-app.js +0 -119
- package/dist/test-app.js.map +0 -1
- package/dist/transport/base-transport.d.ts +0 -21
- package/dist/transport/base-transport.d.ts.map +0 -1
- package/dist/transport/base-transport.js +0 -16
- package/dist/transport/base-transport.js.map +0 -1
- package/dist/transport/index.d.ts +0 -10
- package/dist/transport/index.d.ts.map +0 -1
- package/dist/transport/index.js +0 -12
- package/dist/transport/index.js.map +0 -1
- package/dist/transport/sse-transport.d.ts +0 -13
- package/dist/transport/sse-transport.d.ts.map +0 -1
- package/dist/transport/sse-transport.js +0 -106
- package/dist/transport/sse-transport.js.map +0 -1
- package/dist/transport/stdio-transport.d.ts +0 -8
- package/dist/transport/stdio-transport.d.ts.map +0 -1
- package/dist/transport/stdio-transport.js +0 -53
- package/dist/transport/stdio-transport.js.map +0 -1
- package/dist/transport/streamable-http-transport.d.ts +0 -15
- package/dist/transport/streamable-http-transport.d.ts.map +0 -1
- package/dist/transport/streamable-http-transport.js +0 -151
- package/dist/transport/streamable-http-transport.js.map +0 -1
- package/dist/web/client/MCPClient.js +0 -348
- package/dist/web/client/MCPTestRunner.js +0 -317
- package/dist/web/database/json-manager.js +0 -124
- package/dist/web/database/sqlite-manager.js +0 -146
- package/dist/web/dynamic-mcp-executor.js +0 -443
- package/dist/web/generators/MCPServerGenerator-new.js +0 -284
- package/dist/web/generators/MCPServerGenerator.js +0 -566
- package/dist/web/integrated-mcp-server-new.js +0 -394
- package/dist/web/parsers/CsvParser.js +0 -144
- package/dist/web/parsers/DatabaseParser.js +0 -637
- package/dist/web/parsers/ExcelParser.js +0 -180
- package/dist/web/parsers/index.js +0 -152
- package/dist/web/server.d.ts.map +0 -1
- package/dist/web/server.js +0 -790
- package/dist/web/server.js.map +0 -1
- package/dist/web/types/index.js +0 -2
- package/dist/web/web/server.js +0 -860
- package/src/web/public/modern-styles.css +0 -946
- package/src/web/public/shared-styles.css +0 -2091
- /package/src/web/public/images/{1-claude-quickmcp-stdio.png → readme/1-claude-quickmcp-stdio.png} +0 -0
- /package/src/web/public/images/{2-claude-tools.png → readme/2-claude-tools.png} +0 -0
- /package/src/web/public/images/{3-claude-developer-settings.png → readme/3-claude-developer-settings.png} +0 -0
- /package/src/web/public/images/{4-claude-config.png → readme/4-claude-config.png} +0 -0
- /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;
|