UNPKG

@codacy/codacy-mcp

Version:

Codacy MCP server

105 lines (104 loc) 3.55 kB
import { OpenAPI } from '../core/OpenAPI.js'; import { request as __request } from '../core/request.js'; export class ToolsService { /** * Retrieves the list of tools * Lists the available tools in Codacy * @param cursor Cursor to [specify a batch of results to request](https://docs.codacy.com/codacy-api/using-the-codacy-api/#using-pagination)* @param limit Maximum number of items to return * @returns ToolListResponse Successful operation * @throws ApiError */ static listTools(cursor, limit = 100, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/tools', query: { 'cursor': cursor, 'limit': limit, }, abortSignal, errors: { 400: `Bad Request`, 500: `Internal Server Error`, }, }); } /** * Retrieve the list of tool patterns * Lists the available patterns for the given tool * @param toolUuid Tool unique identifier* @param cursor Cursor to [specify a batch of results to request](https://docs.codacy.com/codacy-api/using-the-codacy-api/#using-pagination)* @param limit Maximum number of items to return * @returns PatternListResponse Successful operations * @throws ApiError */ static listPatterns(toolUuid, cursor, limit = 100, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/tools/{toolUuid}/patterns', path: { 'toolUuid': toolUuid, }, query: { 'cursor': cursor, 'limit': limit, }, abortSignal, errors: { 400: `Bad Request`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Retrieve a tool pattern * Get the definition of a specific pattern * @param toolUuid Tool unique identifier* @param patternId Pattern identifier * @returns PatternResponse Successful operation * @throws ApiError */ static getPattern(toolUuid, patternId, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/tools/{toolUuid}/patterns/{patternId}', path: { 'toolUuid': toolUuid, 'patternId': patternId, }, abortSignal, errors: { 400: `Bad Request`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Retrieves the list of tools * Lists the available duplication tools in Codacy * @returns DuplicationToolListResponse Successful operation * @throws ApiError */ static listDuplicationTools(abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/duplicationTools', abortSignal, errors: { 500: `Internal Server Error`, }, }); } /** * Retrieves the list of tools * Lists the available metrics tools in Codacy * @returns MetricsToolListResponse Successful operation * @throws ApiError */ static listMetricsTools(abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/metricsTools', abortSignal, errors: { 500: `Internal Server Error`, }, }); } }