@codacy/codacy-mcp
Version:
Codacy MCP server
88 lines (87 loc) • 3.9 kB
JavaScript
import { OpenAPI } from '../core/OpenAPI.js';
import { request as __request } from '../core/request.js';
export class FileService {
/**
* @deprecated
* Get the list of supported file extensions associated with each language 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 FileExtensionsResponse Successful operation
* @throws ApiError
*/
static getFileExtensionsSettings(provider, remoteOrganizationName, repositoryName, abortSignal) {
return __request(OpenAPI, {
method: 'GET',
url: '/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions',
path: {
'provider': provider,
'remoteOrganizationName': remoteOrganizationName,
'repositoryName': repositoryName,
},
abortSignal,
errors: {
400: `Bad Request`,
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
409: `Conflict`,
500: `Internal Server Error`,
},
});
}
/**
* @deprecated
* Update the custom file extensions for a repository
* @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param requestBody * @returns void
* @throws ApiError
*/
static patchFileExtensionsSettings(provider, remoteOrganizationName, repositoryName, requestBody, abortSignal) {
return __request(OpenAPI, {
method: 'PATCH',
url: '/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/settings/file-extensions',
path: {
'provider': provider,
'remoteOrganizationName': remoteOrganizationName,
'repositoryName': repositoryName,
},
abortSignal,
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad Request`,
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
409: `Conflict`,
500: `Internal Server Error`,
},
});
}
/**
* Returns a code block from a file
* @param provider Git provider* @param remoteOrganizationName Organization name on the Git provider* @param repositoryName Repository name on the Git provider organization* @param fileId Identifier of a file in a specific commit* @param startLine Line number where the code block starts* @param endLine Line number where the code block ends * @returns CodeBlockLineListResponse Successful operation
* @throws ApiError
*/
static getCodeBlock(provider, remoteOrganizationName, repositoryName, fileId, startLine, endLine, abortSignal) {
return __request(OpenAPI, {
method: 'GET',
url: '/organizations/{provider}/{remoteOrganizationName}/repositories/{repositoryName}/files/{fileId}/source',
path: {
'provider': provider,
'remoteOrganizationName': remoteOrganizationName,
'repositoryName': repositoryName,
'fileId': fileId,
},
query: {
'startLine': startLine,
'endLine': endLine,
},
abortSignal,
errors: {
400: `Bad Request`,
401: `Unauthorized`,
403: `Forbidden`,
404: `Not Found`,
500: `Internal Server Error`,
},
});
}
}