{
  "repo": "tidbcloud/ecosystem-service",
  "binary": "server",
  "binary_path": "cmd/server/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "services": [],
  "extensions": {
    "http_routes": [
      {
        "path": "/metrics",
        "method": "GET",
        "handler": "promhttp.Handler",
        "description": "Prometheus metrics endpoint",
        "name_key": "HTTP GET /metrics"
      },
      {
        "path": "/swagger/vercel/*any",
        "method": "GET",
        "handler": "ginSwagger.WrapHandler",
        "description": "Vercel API swagger documentation",
        "name_key": "HTTP GET /swagger/vercel/*any"
      },
      {
        "path": "/swagger/git/*any",
        "method": "GET",
        "handler": "ginSwagger.WrapHandler",
        "description": "Git API swagger documentation",
        "name_key": "HTTP GET /swagger/git/*any"
      },
      {
        "path": "/swagger/connect/*any",
        "method": "GET",
        "handler": "ginSwagger.WrapHandler",
        "description": "Connect API swagger documentation",
        "name_key": "HTTP GET /swagger/connect/*any"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/vercel/connections",
        "method": "POST",
        "handler": "VercelController.AddClusterConnection",
        "description": "Add Vercel connection to TiDB cluster",
        "auth": "user_token",
        "name_key": "HTTP POST /ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/vercel/connections"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/vercel/connections",
        "method": "DELETE",
        "handler": "VercelController.DeleteClusterConnection",
        "description": "Delete Vercel connection from TiDB cluster",
        "auth": "user_token",
        "name_key": "HTTP DELETE /ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/vercel/connections"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/vercel/connections",
        "method": "GET",
        "handler": "VercelController.ListClusterConnectionsByCluster",
        "description": "List Vercel connections for a TiDB cluster",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/vercel/connections"
      },
      {
        "path": "/ecosystem/api/v1/vercel/integration/configurations/:configuration_id/connections",
        "method": "GET",
        "handler": "VercelController.ListVercelConnectionsByIntegrationConfiguration",
        "description": "List Vercel connections by integration configuration",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/vercel/integration/configurations/:configuration_id/connections"
      },
      {
        "path": "/ecosystem/api/v1/vercel/integration/configurations/:configuration_id/projects",
        "method": "GET",
        "handler": "VercelController.ListVercelProjectsByIntegrationConfiguration",
        "description": "List Vercel projects by integration configuration",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/vercel/integration/configurations/:configuration_id/projects"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/vercel/connections",
        "method": "GET",
        "handler": "VercelController.ListVercelConnectionsByOrg",
        "description": "List Vercel connections by TiDB org",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/orgs/:org_id/vercel/connections"
      },
      {
        "path": "/ecosystem/api/v1/vercel/access_token",
        "method": "POST",
        "handler": "VercelController.ExchangeIntegrationAccessToken",
        "description": "Exchange Vercel integration access token",
        "auth": "user_token",
        "name_key": "HTTP POST /ecosystem/api/v1/vercel/access_token"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/serverless/clusters",
        "method": "POST",
        "handler": "VercelController.CreateServerlessCluster",
        "description": "Create TiDB Serverless cluster for Vercel integration",
        "auth": "user_token",
        "name_key": "HTTP POST /ecosystem/api/v1/orgs/:org_id/projects/:project_id/serverless/clusters"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/dataapps/:data_app_id/vercel/connections",
        "method": "DELETE",
        "handler": "VercelController.DeleteDataAppConnection",
        "description": "Delete Vercel connection from Data App",
        "auth": "user_token",
        "name_key": "HTTP DELETE /ecosystem/api/v1/orgs/:org_id/projects/:project_id/dataapps/:data_app_id/vercel/connections"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/dataapps/:data_app_id/vercel/connections",
        "method": "POST",
        "handler": "VercelController.AddDataAppVercelConnection",
        "description": "Add Vercel connection to Data App",
        "auth": "user_token",
        "name_key": "HTTP POST /ecosystem/api/v1/orgs/:org_id/projects/:project_id/dataapps/:data_app_id/vercel/connections"
      },
      {
        "path": "/ecosystem/api/v1/vercel/webhooks",
        "method": "POST",
        "handler": "VercelController.Webhook",
        "description": "Vercel webhook handler",
        "auth": "none",
        "name_key": "HTTP POST /ecosystem/api/v1/vercel/webhooks"
      },
      {
        "path": "/ecosystem/api/v1/connect/info",
        "method": "GET",
        "handler": "ConnectController.GetConnectInfo",
        "description": "Get connect info",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/connect/info"
      },
      {
        "path": "/ecosystem/api/internal/connect/info",
        "method": "GET",
        "handler": "ConnectController.GetConnectInfo",
        "description": "Get connect info (internal API)",
        "auth": "api_key_or_access_token",
        "name_key": "HTTP GET /ecosystem/api/internal/connect/info"
      },
      {
        "path": "/ecosystem/api/internal/pingchat/chat",
        "method": "POST",
        "handler": "PingChatController.Chat",
        "description": "Chat with PingChat AI",
        "auth": "api_key_or_access_token",
        "name_key": "HTTP POST /ecosystem/api/internal/pingchat/chat"
      },
      {
        "path": "/ecosystem/api/v1/integration/github/webhooks",
        "method": "POST",
        "handler": "GitController.GitHubWebHook",
        "description": "GitHub webhook handler",
        "auth": "none",
        "name_key": "HTTP POST /ecosystem/api/v1/integration/github/webhooks"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/git/connections",
        "method": "POST",
        "handler": "GitController.AddGitConnections",
        "description": "Add Git connection to TiDB cluster",
        "auth": "user_token",
        "name_key": "HTTP POST /ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/git/connections"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/git/connections",
        "method": "DELETE",
        "handler": "GitController.DeleteGitConnections",
        "description": "Delete Git connection from TiDB cluster",
        "auth": "user_token",
        "name_key": "HTTP DELETE /ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/git/connections"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/git/connections",
        "method": "GET",
        "handler": "GitController.ListGitConnections",
        "description": "List Git connections by TiDB project",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/orgs/:org_id/projects/:project_id/git/connections"
      },
      {
        "path": "/ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/git/connections",
        "method": "GET",
        "handler": "GitController.GetGitConnections",
        "description": "Get Git connection for a TiDB cluster",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/orgs/:org_id/projects/:project_id/clusters/:cluster_id/git/connections"
      },
      {
        "path": "/ecosystem/api/v1/integration/github/accounts",
        "method": "GET",
        "handler": "GitController.GetGitHubInstallAccounts",
        "description": "Get GitHub App installation accounts",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/integration/github/accounts"
      },
      {
        "path": "/ecosystem/api/v1/integration/github/exchange-token",
        "method": "GET",
        "handler": "GitController.ExchangeGitHubToken",
        "description": "Exchange GitHub OAuth code for access token",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/integration/github/exchange-token"
      },
      {
        "path": "/ecosystem/api/v1/integration/github/search-repo-v2",
        "method": "GET",
        "handler": "GitController.GetGitHubRepoV2",
        "description": "Search GitHub repositories",
        "auth": "user_token",
        "name_key": "HTTP GET /ecosystem/api/v1/integration/github/search-repo-v2"
      }
    ],
    "runtime_components": [
      {
        "name": "AutoCleanConnections",
        "kind": "cron_job",
        "description": "Clean deleted cluster connections every 30 minutes",
        "trigger": "*/30 * * * *",
        "name_key": "Runtime AutoCleanConnections.Run"
      },
      {
        "name": "VercelMetricsJob",
        "kind": "cron_job",
        "description": "Collect Vercel connection metrics every minute",
        "trigger": "*/1 * * * *",
        "name_key": "Runtime VercelMetricsJob.Run"
      },
      {
        "name": "GitAutoClean",
        "kind": "cron_job",
        "description": "Clean deleted git connections every 10 minutes",
        "trigger": "*/10 * * * *",
        "name_key": "Runtime GitAutoClean.Run"
      },
      {
        "name": "UploadToBigquery",
        "kind": "cron_job",
        "description": "Upload Vercel connections to BigQuery daily",
        "trigger": "0 0 * * *",
        "conditions": [
          "BigQueryConfig.Enable == true"
        ],
        "name_key": "Runtime UploadToBigquery.Run"
      }
    ]
  }
}
