UNPKG

@codacy/codacy-mcp

Version:

Codacy MCP server

912 lines (911 loc) 65.5 kB
import { OpenAPI } from '../core/OpenAPI.js'; import { request as __request } from '../core/request.js'; export class AnalysisService { /** * List an organization repositories with analysis information for the authenticated user. * List an organization repositories with analysis information for the authenticated user. For Bitbucket you must URL encode the cursor before using it in subsequent API calls, as the pagination comes directly from the Git provider. * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @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* @param search Filter the results searching by this string.* @param repositories Deprecated, use [SearchOrganizationRepositoriesWithAnalysis](#searchorganizationrepositorieswithanalysis) instead* @param segments Filter by a comma separated list of segment ids. * @returns RepositoryWithAnalysisListResponse Successful operation * @throws ApiError */ static listOrganizationRepositoriesWithAnalysis(provider, remoteOrganizationName, cursor, limit = 100, search, repositories, segments, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, }, query: { 'cursor': cursor, 'limit': limit, 'search': search, 'repositories': repositories, 'segments': segments, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, 502: `Bad Gateway`, }, }); } /** * Search organization repositories with analysis information for the authenticated user. * For Bitbucket you must URL encode the cursor before using it in subsequent API calls, as the pagination comes directly from the Git provider. * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param requestBody Search query body* @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 RepositoryWithAnalysisListResponse Successful operation * @throws ApiError */ static searchOrganizationRepositoriesWithAnalysis(provider, remoteOrganizationName, requestBody, cursor, limit = 100, abortSignal) { return __request(OpenAPI, { method: 'POST', url: '/search/analysis/organizations/{provider}/{remoteOrganizationName}/repositories', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, }, query: { 'cursor': cursor, 'limit': limit, }, abortSignal, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, 502: `Bad Gateway`, }, }); } /** * Get a repository with analysis information for the authenticated user * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param branch Name of a [repository branch enabled on Codacy](https://docs.codacy.com/repositories-configure/managing-branches/), * as returned by the endpoint [listRepositoryBranches](#listrepositorybranches). * By default, uses the main branch defined on the Codacy repository settings. * * @returns RepositoryWithAnalysisResponse Successful operation * @throws ApiError */ static getRepositoryWithAnalysis(provider, remoteOrganizationName, repositoryName, branch, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, query: { 'branch': branch, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Get analysis tools settings of a repository * **Note:** When applied to public repositories, this operation does not require authentication. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization * @returns AnalysisToolsResponse Successful operation * @throws ApiError */ static listRepositoryTools(provider, remoteOrganizationName, repositoryName, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Get tools with conflicts in a repository * Get tools with conflicts in a repository * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization * @returns RepositoryConflictsResponse Successful operation * @throws ApiError */ static listRepositoryToolConflicts(provider, remoteOrganizationName, repositoryName, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/conflicts', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Configure an analysis tool by enabling and disabling its patterns for a repository. * This endpoint will apply the changes without verifying if the repository belongs to a coding standard. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param toolUuid Tool unique identifier* @param requestBody * @returns void * @throws ApiError */ static configureTool(provider, remoteOrganizationName, repositoryName, toolUuid, requestBody, abortSignal) { return __request(OpenAPI, { method: 'PATCH', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'toolUuid': toolUuid, }, abortSignal, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 409: `Conflict`, 500: `Internal Server Error`, }, }); } /** * Patterns configuration for (repository, tool). Uses standard if applied, repository settings otherwise. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param toolUuid Tool unique identifier* @param languages Languages filter* @param categories Filter by a comma separated list of code pattern categories. The allowed values are 'Security', 'ErrorProne', 'CodeStyle', 'Compatibility', 'UnusedCode', and 'Performance'* @param severityLevels Filter by a comma separated list of code pattern severity levels. The allowed values are 'Error', 'Warning', and 'Info'* @param search Filter the results searching by this string.* @param enabled Returns only the enabled or disabled patterns.* @param recommended Returns only the recommended or non-recommended patterns.* @param sort Field used to sort the tool's code patterns. The allowed values are 'category', 'recommended', and 'severity'* @param direction Sort direction. Possible values are 'asc' (ascending) or 'desc' (descending).* @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 ConfiguredPatternsListResponse Successful operation * @throws ApiError */ static listRepositoryToolPatterns(provider, remoteOrganizationName, repositoryName, toolUuid, languages, categories, severityLevels, search, enabled, recommended, sort, direction, cursor, limit = 100, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}/patterns', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'toolUuid': toolUuid, }, query: { 'languages': languages, 'categories': categories, 'severityLevels': severityLevels, 'search': search, 'enabled': enabled, 'recommended': recommended, 'sort': sort, 'direction': direction, 'cursor': cursor, 'limit': limit, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Bulk updates the code patterns of a tool in a repository. * Use filters to specify the code patterns to update, or omit the filters to update all code patterns. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param toolUuid Tool unique identifier* @param requestBody * @param languages Languages filter* @param categories Filter by a comma separated list of code pattern categories. The allowed values are 'Security', 'ErrorProne', 'CodeStyle', 'Compatibility', 'UnusedCode', and 'Performance'* @param severityLevels Filter by a comma separated list of code pattern severity levels. The allowed values are 'Error', 'Warning', and 'Info'* @param search Filter the results searching by this string.* @param recommended Returns only the recommended or non-recommended patterns. * @returns void * @throws ApiError */ static updateRepositoryToolPatterns(provider, remoteOrganizationName, repositoryName, toolUuid, requestBody, languages, categories, severityLevels, search, recommended, abortSignal) { return __request(OpenAPI, { method: 'PATCH', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}/patterns', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'toolUuid': toolUuid, }, query: { 'languages': languages, 'categories': categories, 'severityLevels': severityLevels, 'search': search, 'recommended': recommended, }, abortSignal, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not Found`, 409: `Conflict`, 500: `Internal Server Error`, }, }); } /** * Patterns configuration for (repository, tool, pattern). Uses standard if applied, repository settings otherwise. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param toolUuid Tool unique identifier* @param patternId Pattern identifier * @returns ConfiguredPatternResponse Successful operation * @throws ApiError */ static getRepositoryToolPattern(provider, remoteOrganizationName, repositoryName, toolUuid, patternId, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}/patterns/{patternId}', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'toolUuid': toolUuid, 'patternId': patternId, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Patterns overview for tool. Uses standard if applied, repository settings otherwise. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param toolUuid Tool unique identifier* @param languages Languages filter* @param categories Filter by a comma separated list of code pattern categories. The allowed values are 'Security', 'ErrorProne', 'CodeStyle', 'Compatibility', 'UnusedCode', and 'Performance'* @param severityLevels Filter by a comma separated list of code pattern severity levels. The allowed values are 'Error', 'Warning', and 'Info'* @param search Filter the results searching by this string.* @param enabled Returns only the enabled or disabled patterns.* @param recommended Returns only the recommended or non-recommended patterns. * @returns ToolPatternsOverviewResponse Successful operation * @throws ApiError */ static toolPatternsOverview(provider, remoteOrganizationName, repositoryName, toolUuid, languages, categories, severityLevels, search, enabled, recommended, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}/patterns/overview', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'toolUuid': toolUuid, }, query: { 'languages': languages, 'categories': categories, 'severityLevels': severityLevels, 'search': search, 'enabled': enabled, 'recommended': recommended, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Patterns with Coding Standards conflicts for tool. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param toolUuid Tool unique identifier * @returns RepositoryToolConflictsResponse Successful operation * @throws ApiError */ static listRepositoryToolPatternConflicts(provider, remoteOrganizationName, repositoryName, toolUuid, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/tools/{toolUuid}/conflicts', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'toolUuid': toolUuid, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Get the analysis progress of a repository * **Note:** When applied to public repositories, this operation does not require authentication. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param branch Name of a [repository branch enabled on Codacy](https://docs.codacy.com/repositories-configure/managing-branches/), * as returned by the endpoint [listRepositoryBranches](#listrepositorybranches). * By default, uses the main branch defined on the Codacy repository settings. * * @returns FirstAnalysisOverviewResponse Successful operation * @throws ApiError */ static getFirstAnalysisOverview(provider, remoteOrganizationName, repositoryName, branch, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/analysis-progress', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, query: { 'branch': branch, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * List pull requests from a repository that the user as access to * You can search this endpoint for either `last-updated` (default), `impact` or `merged` * * **Note:** When applied to public repositories, this operation does not require authentication. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param limit Maximum number of items to return* @param cursor Cursor to [specify a batch of results to request](https://docs.codacy.com/codacy-api/using-the-codacy-api/#using-pagination)* @param search Filter the results searching by this string.* @param includeNotAnalyzed If true, also return pull requests that weren't analyzed * @returns PullRequestWithAnalysisListResponse Successful operation * @throws ApiError */ static listRepositoryPullRequests(provider, remoteOrganizationName, repositoryName, limit = 100, cursor, search, includeNotAnalyzed = false, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, query: { 'limit': limit, 'cursor': cursor, 'search': search, 'includeNotAnalyzed': includeNotAnalyzed, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Get pull request from a repository * **Note:** When applied to public repositories, this operation does not require authentication. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param pullRequestNumber Pull request number * @returns PullRequestWithAnalysis Successful operation * @throws ApiError */ static getRepositoryPullRequest(provider, remoteOrganizationName, repositoryName, pullRequestNumber, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'pullRequestNumber': pullRequestNumber, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Return analysis results for the commits in a pull request * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param pullRequestNumber Pull request number* @param limit Maximum number of items to return* @param cursor Cursor to [specify a batch of results to request](https://docs.codacy.com/codacy-api/using-the-codacy-api/#using-pagination) * @returns CommitWithAnalysisListResponse Successful operation * @throws ApiError */ static getPullRequestCommits(provider, remoteOrganizationName, repositoryName, pullRequestNumber, limit = 100, cursor, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/commits', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'pullRequestNumber': pullRequestNumber, }, query: { 'limit': limit, 'cursor': cursor, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Bypass analysis status in a pull request * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param pullRequestNumber Pull request number * @returns void * @throws ApiError */ static bypassPullRequestAnalysis(provider, remoteOrganizationName, repositoryName, pullRequestNumber, abortSignal) { return __request(OpenAPI, { method: 'POST', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/bypass', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'pullRequestNumber': pullRequestNumber, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 403: `Forbidden`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * List all coverage reports uploaded for the common ancestor commit and head commit of a pull request branch * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param pullRequestNumber Pull request number * @returns CoveragePullRequestResponse Successful operation * @throws ApiError */ static getPullRequestCoverageReports(provider, remoteOrganizationName, repositoryName, pullRequestNumber, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/coverage/status', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'pullRequestNumber': pullRequestNumber, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * List issues found in a pull request * Returns a list of issues found in a pull request. We can request either new or fixed issues. * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param pullRequestNumber Pull request number* @param status Issue status* @param onlyPotential If true, retrieves only potential issues* @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 PullRequestIssuesResponse Successful operation * @throws ApiError */ static listPullRequestIssues(provider, remoteOrganizationName, repositoryName, pullRequestNumber, status, onlyPotential, cursor, limit = 100, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/issues', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'pullRequestNumber': pullRequestNumber, }, query: { 'status': status, 'onlyPotential': onlyPotential, 'cursor': cursor, 'limit': limit, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * List duplicate code blocks found in a pull request * Returns a list of new or removed duplicate code blocks found in a pull request. * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param pullRequestNumber Pull request number* @param status Issue status* @param onlyPotential If true, retrieves only potential issues* @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 ClonesResponse Successful operation * @throws ApiError */ static listPullRequestClones(provider, remoteOrganizationName, repositoryName, pullRequestNumber, status, onlyPotential, cursor, limit = 100, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/clones', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'pullRequestNumber': pullRequestNumber, }, query: { 'status': status, 'onlyPotential': onlyPotential, 'cursor': cursor, 'limit': limit, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * List duplicate code blocks found in a commit * Returns a list of new or removed duplicate code blocks found in a commit. * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param commitUuid UUID or SHA identifier of the source commit* @param status Issue status* @param onlyPotential If true, retrieves only potential issues* @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 ClonesResponse Successful operation * @throws ApiError */ static listCommitClones(provider, remoteOrganizationName, repositoryName, commitUuid, status, onlyPotential, cursor, limit = 100, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/clones', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'commitUuid': commitUuid, }, query: { 'status': status, 'onlyPotential': onlyPotential, 'cursor': cursor, 'limit': limit, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Get analysis logs for a pull request * Returns the analysis logs for the specified pull request. * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param pullRequestNumber Pull request number * @returns LogsResponse Successful operation * @throws ApiError */ static listPullRequestLogs(provider, remoteOrganizationName, repositoryName, pullRequestNumber, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/logs', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'pullRequestNumber': pullRequestNumber, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Get analysis logs for a commit * Returns the analysis logs for the specified commit. * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param commitUuid UUID or SHA identifier of the source commit * @returns LogsResponse Successful operation * @throws ApiError */ static listCommitLogs(provider, remoteOrganizationName, repositoryName, commitUuid, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/logs', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'commitUuid': commitUuid, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * @deprecated * [Deprecated: use [getQualitySettingsForRepository](#getqualitysettingsforrepository) instead] Get quality settings for the specific repository * **Note:** When applied to public repositories, this operation does not require authentication. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization * @returns DeprecatedRepositoryQualitySettingsResponse Successful operation * @throws ApiError */ static getRepositoryQualitySettings(provider, remoteOrganizationName, repositoryName, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/quality-settings', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * List files of a commit with analysis results * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param commitUuid UUID or SHA string that identifies the commit* @param branch Name of a [repository branch enabled on Codacy](https://docs.codacy.com/repositories-configure/managing-branches/), * as returned by the endpoint [listRepositoryBranches](#listrepositorybranches). * By default, uses the main branch defined on the Codacy repository settings. * * @param filter Optional field to filter the results. The possible values are empty (default, return files changed in the commit or with coverage changes) or `withCoverageChanges` (return files with coverage changes).* @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* @param search Filter files that include this string anywhere in their relative path* @param sortColumn Field used to sort the results. The possible values are `deltaCoverage` (to sort by the coverage variation value of the files) , `totalCoverage` (to sort by the total coverage value of the files) or `filename` (default - to sort by the name of the files).* @param columnOrder Sort direction. The possible values are `asc` (ascending - default) or `desc` (descending). * @returns FileAnalysisListResponse Successful operation * @throws ApiError */ static listCommitFiles(provider, remoteOrganizationName, repositoryName, commitUuid, branch, filter, cursor, limit = 100, search, sortColumn = 'filename', columnOrder = 'asc', abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commits/{commitUuid}/files', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'commitUuid': commitUuid, }, query: { 'branch': branch, 'filter': filter, 'cursor': cursor, 'limit': limit, 'search': search, 'sortColumn': sortColumn, 'columnOrder': columnOrder, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * List files of a pull request with analysis results * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param pullRequestNumber Pull request number* @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* @param sortColumn Field used to sort the results. The possible values are `deltaCoverage` (to sort by the coverage variation value of the files) , `totalCoverage` (to sort by the total coverage value of the files) or `filename` (default - to sort by the name of the files).* @param columnOrder Sort direction. The possible values are `asc` (ascending - default) or `desc` (descending). * @returns FileAnalysisListResponse Successful operation * @throws ApiError */ static listPullRequestFiles(provider, remoteOrganizationName, repositoryName, pullRequestNumber, cursor, limit = 100, sortColumn = 'filename', columnOrder = 'asc', abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/pull-requests/{pullRequestNumber}/files', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'pullRequestNumber': pullRequestNumber, }, query: { 'cursor': cursor, 'limit': limit, 'sortColumn': sortColumn, 'columnOrder': columnOrder, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * List an organization pull requests from repositories that the user as access to * You can search this endpoint for either `last-updated` (default), `impact` or `merged` * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param limit Maximum number of items to return* @param search Filter the results searching by this string.* @param repositories Deprecated, use [SearchOrganizationRepositoriesWithAnalysis](#searchorganizationrepositorieswithanalysis) instead * @returns PullRequestWithAnalysisListResponse Successful operation * @throws ApiError */ static listOrganizationPullRequests(provider, remoteOrganizationName, limit = 100, search, repositories, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/pull-requests', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, }, query: { 'limit': limit, 'search': search, 'repositories': repositories, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Lists commit analysis statistics in the last `n` days that have analysis data * Returns the last `n` days with available data. This means that the returned days may not match the last `n` calendar days. * * **Note:** When applied to public repositories, this operation does not require authentication. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param branch Name of a [repository branch enabled on Codacy](https://docs.codacy.com/repositories-configure/managing-branches/), * as returned by the endpoint [listRepositoryBranches](#listrepositorybranches). * By default, uses the main branch defined on the Codacy repository settings. * * @param days Number of days with data to return. * @returns CommitAnalysisStatsListResponse Successful operation * @throws ApiError */ static listCommitAnalysisStats(provider, remoteOrganizationName, repositoryName, branch, days = 31, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/commit-statistics', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, query: { 'branch': branch, 'days': days, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Lists analysis category overviews for a repository that the user as access to * **Note:** When applied to public repositories, this operation does not require authentication. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param branch Name of a [repository branch enabled on Codacy](https://docs.codacy.com/repositories-configure/managing-branches/), * as returned by the endpoint [listRepositoryBranches](#listrepositorybranches). * By default, uses the main branch defined on the Codacy repository settings. * * @returns CategoryOverviewListResponse Successful operation * @throws ApiError */ static listCategoryOverviews(provider, remoteOrganizationName, repositoryName, branch, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/category-overviews', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, query: { 'branch': branch, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Returns information about an issue that Codacy found in a repository and that is still open. * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param resultDataId Identifier of an open issue. * @returns GetIssueResponse An issue found in a repository. * @throws ApiError */ static getIssue(provider, remoteOrganizationName, repositoryName, resultDataId, abortSignal) { return __request(OpenAPI, { method: 'GET', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/{resultDataId}', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, 'resultDataId': resultDataId, }, abortSignal, errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * List issues in a repository * Returns information about the issues that Codacy found in a repository as available on the [Issues page](https://docs.codacy.com/repositories/issues-view/). * Use [SearchRepositoryIssuesBody](#tocssearchrepositoryissuesbody) to filter the returned issues. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @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* @param requestBody Only return issues matching these filters * @returns SearchRepositoryIssuesListResponse List of issues in the repository * @throws ApiError */ static searchRepositoryIssues(provider, remoteOrganizationName, repositoryName, cursor, limit = 100, requestBody, abortSignal) { return __request(OpenAPI, { method: 'POST', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/search', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, query: { 'cursor': cursor, 'limit': limit, }, abortSignal, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`, }, }); } /** * Get an overview of the issues in a repository * Returns information about the number of issues that Codacy found in a repository as available on the [Issues page](https://docs.codacy.com/repositories/issues-view/). * Use [SearchRepositoryIssuesBody](#tocssearchrepositoryissuesbody) to filter the returned issues. * * @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param requestBody Only return issues matching these filters * @returns IssuesOverviewResponse Overview of the issues in the repository * @throws ApiError */ static issuesOverview(provider, remoteOrganizationName, repositoryName, requestBody, abortSignal) { return __request(OpenAPI, { method: 'POST', url: '/analysis/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/issues/overview', path: { 'provider': provider, 'remoteOrganizationName': remoteOrganizationName, 'repositoryName': repositoryName, }, abortSignal, body: requestBody, mediaType: 'application/json', errors: { 400: `Bad Request`, 401: `Unauthorized`, 404: `Not Found`, 500: `Internal Server Error`,