@debugg-ai/debugg-ai-mcp
Version:
Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.
42 lines (41 loc) • 1.29 kB
JavaScript
import { createCoverageService } from "./coverage.js";
import { createE2esService } from "./e2es.js";
import { createIssuesService } from "./issues.js";
import { createReposService } from "./repos.js";
import { AxiosTransport } from "../utils/axiosTransport.js";
export class DebuggAIServerClient {
userApiKey;
tx;
url;
// Public “sub‑APIs”
repos;
issues;
coverage;
e2es;
constructor(userApiKey) {
this.userApiKey = userApiKey;
this.init();
}
async init() {
const serverUrl = await this.getServerUrl();
console.error("Server URL:", serverUrl);
this.url = new URL(serverUrl);
this.tx = new AxiosTransport({ baseUrl: serverUrl, apiKey: this.userApiKey });
this.repos = createReposService(this.tx);
this.issues = createIssuesService(this.tx);
this.coverage = createCoverageService(this.tx);
this.e2es = createE2esService(this.tx);
}
/**
* Get the server URL based on the deployment environment
* @returns The server URL
*/
async getServerUrl() {
if (process.env.ENVIRONMENT === "local") {
return "https://debuggai-backend.ngrok.app";
}
else {
return "https://api.debugg.ai";
}
}
}