UNPKG

deepsource-mcp-server

Version:
60 lines (59 loc) 1.86 kB
/** * @fileoverview Projects client for the DeepSource API * This module provides functionality for working with DeepSource projects. */ import { BaseDeepSourceClient } from './base-client.js'; import { DeepSourceProject } from '../models/projects.js'; import { ProjectKey } from '../types/branded.js'; /** * Client for interacting with DeepSource projects API * @class * @extends BaseDeepSourceClient * @public */ export declare class ProjectsClient extends BaseDeepSourceClient { /** * Fetches a list of all accessible DeepSource projects * @returns Promise that resolves to an array of DeepSourceProject objects * @throws {ClassifiedError} When the API request fails * @public */ listProjects(): Promise<DeepSourceProject[]>; /** * Extracts viewer data from the API response, handling different response formats * @private */ private extractViewerData; /** * Extracts account edges from viewer data * @private */ private extractAccountsFromViewer; /** * Processes all accounts to extract and transform repositories into DeepSource projects * @private */ private processAccountsForRepositories; /** * Processes repositories for a single account * @private */ private processAccountRepositories; /** * Processes a single repository and converts it to a DeepSource project * @private */ private processRepository; /** * Handles errors that occur during project listing * @private */ private handleListProjectsError; /** * Checks if a project exists * @param projectKey The project key to check * @returns Promise that resolves to true if the project exists, false otherwise * @public */ projectExists(projectKey: ProjectKey): Promise<boolean>; }