UNPKG

deepsource-mcp-server

Version:
60 lines (59 loc) 1.93 kB
/** * @fileoverview Base client for interacting with the DeepSource API * This module provides a base client class with core functionality. */ import { AxiosInstance } from 'axios'; import { GraphQLResponse } from '../types/graphql-responses.js'; /** * Configuration options for the DeepSource client * @public */ export interface DeepSourceClientConfig { /** The base URL for the API */ baseURL?: string; /** Request timeout in milliseconds */ timeout?: number; /** Custom headers to include in requests */ headers?: Record<string, string>; } /** * Base client for DeepSource API with core HTTP functionality * @class * @public */ export declare class BaseDeepSourceClient { /** * HTTP client for making API requests to DeepSource * @protected */ protected client: AxiosInstance; /** * Logger instance for the client * @protected */ protected logger: import("../utils/logging/logger.js").Logger; /** * Creates a new BaseDeepSourceClient instance * @param apiKey - The DeepSource API key for authentication * @param config - Optional configuration options * @throws {Error} When apiKey is not provided * @public */ constructor(apiKey: string, config?: DeepSourceClientConfig); /** * Execute a GraphQL query against the DeepSource API * @param query The GraphQL query to execute * @returns The query response data * @throws {ClassifiedError} When the query fails * @protected */ protected executeGraphQL<T>(query: string): Promise<GraphQLResponse<T>>; /** * Execute a GraphQL mutation against the DeepSource API * @param mutation The GraphQL mutation to execute * @returns The mutation response data * @throws {ClassifiedError} When the mutation fails * @protected */ protected executeGraphQLMutation<T>(mutation: string): Promise<T>; }