@codacy/codacy-mcp 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +13 -0
- package/README.md +85 -0
- package/dist/index.js +85 -0
- package/dist/src/api/client/core/ApiError.js +16 -0
- package/dist/src/api/client/core/ApiRequestOptions.js +1 -0
- package/dist/src/api/client/core/ApiResult.js +1 -0
- package/dist/src/api/client/core/CancelablePromise.js +99 -0
- package/dist/src/api/client/core/OpenAPI.js +11 -0
- package/dist/src/api/client/core/request.js +285 -0
- package/dist/src/api/client/index.js +33 -0
- package/dist/src/api/client/models/AddEnterpriseAccountTokenBody.js +1 -0
- package/dist/src/api/client/models/AddOrganizationBody.js +1 -0
- package/dist/src/api/client/models/AddOrganizationResponse.js +1 -0
- package/dist/src/api/client/models/AddRepositoryBody.js +1 -0
- package/dist/src/api/client/models/AddedState.js +1 -0
- package/dist/src/api/client/models/AddedStateResponse.js +1 -0
- package/dist/src/api/client/models/AnalysisAction.js +1 -0
- package/dist/src/api/client/models/AnalysisExpectedThreshold.js +1 -0
- package/dist/src/api/client/models/AnalysisMeta.js +1 -0
- package/dist/src/api/client/models/AnalysisResultReason.js +1 -0
- package/dist/src/api/client/models/AnalysisStepExecutionMetrics.js +1 -0
- package/dist/src/api/client/models/AnalysisTool.js +1 -0
- package/dist/src/api/client/models/AnalysisToolSettings.js +1 -0
- package/dist/src/api/client/models/AnalysisToolsResponse.js +1 -0
- package/dist/src/api/client/models/ApiError.js +1 -0
- package/dist/src/api/client/models/ApiToken.js +1 -0
- package/dist/src/api/client/models/ApiTokenListResponse.js +1 -0
- package/dist/src/api/client/models/ApiTokenResponse.js +1 -0
- package/dist/src/api/client/models/ApplyCodingStandardToRepositoriesBody.js +1 -0
- package/dist/src/api/client/models/ApplyCodingStandardToRepositoriesResult.js +1 -0
- package/dist/src/api/client/models/ApplyCodingStandardToRepositoriesResultResponse.js +1 -0
- package/dist/src/api/client/models/ApplyGatePolicyToRepositoriesBody.js +1 -0
- package/dist/src/api/client/models/AuditActor.js +1 -0
- package/dist/src/api/client/models/AuditActorRole.js +1 -0
- package/dist/src/api/client/models/AuditLog.js +1 -0
- package/dist/src/api/client/models/AuditResultType.js +1 -0
- package/dist/src/api/client/models/BadGateway.js +1 -0
- package/dist/src/api/client/models/BadRequest.js +1 -0
- package/dist/src/api/client/models/Badges.js +1 -0
- package/dist/src/api/client/models/Billing.js +1 -0
- package/dist/src/api/client/models/Branch.js +1 -0
- package/dist/src/api/client/models/BranchListResponse.js +1 -0
- package/dist/src/api/client/models/BranchRequiredChecks.js +1 -0
- package/dist/src/api/client/models/BranchRequiredChecksResponse.js +1 -0
- package/dist/src/api/client/models/BuildServerAnalysisSettingRequest.js +1 -0
- package/dist/src/api/client/models/BuildServerAnalysisSettingResponse.js +1 -0
- package/dist/src/api/client/models/Category.js +1 -0
- package/dist/src/api/client/models/CategoryIssues.js +1 -0
- package/dist/src/api/client/models/CategoryOverview.js +1 -0
- package/dist/src/api/client/models/CategoryOverviewListResponse.js +1 -0
- package/dist/src/api/client/models/CheckSubmodulesResponse.js +1 -0
- package/dist/src/api/client/models/ChurnFeedback.js +1 -0
- package/dist/src/api/client/models/CloneDuplicationBlock.js +1 -0
- package/dist/src/api/client/models/ClonesResponse.js +1 -0
- package/dist/src/api/client/models/CodacyProduct.js +1 -0
- package/dist/src/api/client/models/CodeBlockLine.js +1 -0
- package/dist/src/api/client/models/CodeBlockLineListResponse.js +1 -0
- package/dist/src/api/client/models/CodingStandard.js +1 -0
- package/dist/src/api/client/models/CodingStandardCategoriesPresets.js +1 -0
- package/dist/src/api/client/models/CodingStandardInfo.js +1 -0
- package/dist/src/api/client/models/CodingStandardMeta.js +1 -0
- package/dist/src/api/client/models/CodingStandardRepositoriesListResponse.js +1 -0
- package/dist/src/api/client/models/CodingStandardResponse.js +1 -0
- package/dist/src/api/client/models/CodingStandardTool.js +1 -0
- package/dist/src/api/client/models/CodingStandardToolsListResponse.js +1 -0
- package/dist/src/api/client/models/CodingStandardsListResponse.js +1 -0
- package/dist/src/api/client/models/Commit.js +1 -0
- package/dist/src/api/client/models/CommitAnalysisStats.js +1 -0
- package/dist/src/api/client/models/CommitAnalysisStatsListResponse.js +1 -0
- package/dist/src/api/client/models/CommitDeltaIssue.js +1 -0
- package/dist/src/api/client/models/CommitDeltaIssuesResponse.js +1 -0
- package/dist/src/api/client/models/CommitDeltaStatistics.js +1 -0
- package/dist/src/api/client/models/CommitDetails.js +1 -0
- package/dist/src/api/client/models/CommitDetailsV2.js +1 -0
- package/dist/src/api/client/models/CommitFileClone.js +1 -0
- package/dist/src/api/client/models/CommitIdentification.js +1 -0
- package/dist/src/api/client/models/CommitIssue.js +1 -0
- package/dist/src/api/client/models/CommitReference.js +1 -0
- package/dist/src/api/client/models/CommitUuidRequest.js +1 -0
- package/dist/src/api/client/models/CommitWithAnalysis.js +1 -0
- package/dist/src/api/client/models/CommitWithAnalysisListResponse.js +1 -0
- package/dist/src/api/client/models/CommitWithBranches.js +1 -0
- package/dist/src/api/client/models/ConfigurationStatusResponse.js +1 -0
- package/dist/src/api/client/models/ConfigurePattern.js +1 -0
- package/dist/src/api/client/models/ConfigureToolBody.js +1 -0
- package/dist/src/api/client/models/ConfiguredLoginIntegration.js +1 -0
- package/dist/src/api/client/models/ConfiguredLoginIntegrationListResponse.js +1 -0
- package/dist/src/api/client/models/ConfiguredParameter.js +1 -0
- package/dist/src/api/client/models/ConfiguredParametersList.js +1 -0
- package/dist/src/api/client/models/ConfiguredPattern.js +1 -0
- package/dist/src/api/client/models/ConfiguredPatternListMeta.js +1 -0
- package/dist/src/api/client/models/ConfiguredPatternResponse.js +1 -0
- package/dist/src/api/client/models/ConfiguredPatternsListResponse.js +1 -0
- package/dist/src/api/client/models/Conflict.js +1 -0
- package/dist/src/api/client/models/Count.js +1 -0
- package/dist/src/api/client/models/Coverage.js +1 -0
- package/dist/src/api/client/models/CoverageAnalysis.js +1 -0
- package/dist/src/api/client/models/CoveragePullRequestCommitDetail.js +1 -0
- package/dist/src/api/client/models/CoveragePullRequestResponse.js +1 -0
- package/dist/src/api/client/models/CoverageReport.js +1 -0
- package/dist/src/api/client/models/CoverageReportResponse.js +1 -0
- package/dist/src/api/client/models/CreateCodingStandardBody.js +1 -0
- package/dist/src/api/client/models/CreateCodingStandardPresetBody.js +1 -0
- package/dist/src/api/client/models/CreateGatePolicyBody.js +1 -0
- package/dist/src/api/client/models/DastTool.js +1 -0
- package/dist/src/api/client/models/DastToolResultsFormat.js +1 -0
- package/dist/src/api/client/models/DeleteDormantAccountsResponse.js +1 -0
- package/dist/src/api/client/models/DeltaType.js +1 -0
- package/dist/src/api/client/models/DependenciesOverviewOfSbomRepositories.js +1 -0
- package/dist/src/api/client/models/DependenciesSummaryOfSbomRepository.js +1 -0
- package/dist/src/api/client/models/DeprecatedRepositoryQualitySettings.js +1 -0
- package/dist/src/api/client/models/DeprecatedRepositoryQualitySettingsResponse.js +1 -0
- package/dist/src/api/client/models/DiffCoverage.js +1 -0
- package/dist/src/api/client/models/DiffLineHit.js +1 -0
- package/dist/src/api/client/models/DiffResponse.js +1 -0
- package/dist/src/api/client/models/DimensionsFilter.js +1 -0
- package/dist/src/api/client/models/DormantAccountInfo.js +1 -0
- package/dist/src/api/client/models/DuplicationTool.js +1 -0
- package/dist/src/api/client/models/DuplicationToolListResponse.js +1 -0
- package/dist/src/api/client/models/EnterpriseAccountToken.js +1 -0
- package/dist/src/api/client/models/EnterpriseAccountTokenListResponse.js +1 -0
- package/dist/src/api/client/models/EnterpriseEntity.js +1 -0
- package/dist/src/api/client/models/EnterpriseListResponse.js +1 -0
- package/dist/src/api/client/models/EnterpriseOrganization.js +1 -0
- package/dist/src/api/client/models/EnterpriseOrganizationsResponse.js +1 -0
- package/dist/src/api/client/models/EnterpriseUserRole.js +1 -0
- package/dist/src/api/client/models/EntityFilter.js +1 -0
- package/dist/src/api/client/models/FileAnalysisListResponse.js +1 -0
- package/dist/src/api/client/models/FileClone.js +1 -0
- package/dist/src/api/client/models/FileClonesResponse.js +1 -0
- package/dist/src/api/client/models/FileCoverage.js +1 -0
- package/dist/src/api/client/models/FileCoverageAnalysis.js +1 -0
- package/dist/src/api/client/models/FileDeltaAnalysis.js +1 -0
- package/dist/src/api/client/models/FileDeltaCoverageAnalysis.js +1 -0
- package/dist/src/api/client/models/FileDeltaQualityAnalysis.js +1 -0
- package/dist/src/api/client/models/FileDiffCoverage.js +1 -0
- package/dist/src/api/client/models/FileExtensions.js +1 -0
- package/dist/src/api/client/models/FileExtensionsBody.js +1 -0
- package/dist/src/api/client/models/FileExtensionsResponse.js +1 -0
- package/dist/src/api/client/models/FileExtensionsUpdate.js +1 -0
- package/dist/src/api/client/models/FileInformationWithAnalysis.js +1 -0
- package/dist/src/api/client/models/FileListResponse.js +1 -0
- package/dist/src/api/client/models/FileMetadata.js +1 -0
- package/dist/src/api/client/models/FileMetrics.js +1 -0
- package/dist/src/api/client/models/FileQualityInfo.js +1 -0
- package/dist/src/api/client/models/FileStateBody.js +1 -0
- package/dist/src/api/client/models/FileWithAnalysisInfo.js +1 -0
- package/dist/src/api/client/models/FirstAnalysisOverview.js +1 -0
- package/dist/src/api/client/models/FirstAnalysisOverviewResponse.js +1 -0
- package/dist/src/api/client/models/Forbidden.js +1 -0
- package/dist/src/api/client/models/GatePoliciesListResponse.js +1 -0
- package/dist/src/api/client/models/GatePolicy.js +1 -0
- package/dist/src/api/client/models/GatePolicyMeta.js +1 -0
- package/dist/src/api/client/models/GatePolicySummarized.js +1 -0
- package/dist/src/api/client/models/GetEnterpriseResponse.js +1 -0
- package/dist/src/api/client/models/GetFileCoverageResponse.js +1 -0
- package/dist/src/api/client/models/GetGatePolicyResultResponse.js +1 -0
- package/dist/src/api/client/models/GetIssueResponse.js +1 -0
- package/dist/src/api/client/models/GitProviderAppPermissions.js +1 -0
- package/dist/src/api/client/models/GroupMetricFilter.js +1 -0
- package/dist/src/api/client/models/GroupedMetricValue.js +1 -0
- package/dist/src/api/client/models/HasQuickfixSuggestionsResponse.js +1 -0
- package/dist/src/api/client/models/HealthCheck.js +1 -0
- package/dist/src/api/client/models/HealthCheckResponse.js +1 -0
- package/dist/src/api/client/models/HeartbeatRequest.js +1 -0
- package/dist/src/api/client/models/HeartbeatResponse.js +1 -0
- package/dist/src/api/client/models/IgnoreSRMItemBody.js +1 -0
- package/dist/src/api/client/models/IgnoredIssue.js +1 -0
- package/dist/src/api/client/models/IgnoredIssuesListResponse.js +1 -0
- package/dist/src/api/client/models/Integration.js +1 -0
- package/dist/src/api/client/models/IntegrationListResponse.js +1 -0
- package/dist/src/api/client/models/InternalServerError.js +1 -0
- package/dist/src/api/client/models/IssueStateBody.js +1 -0
- package/dist/src/api/client/models/IssueStatus.js +1 -0
- package/dist/src/api/client/models/IssuesOverview.js +1 -0
- package/dist/src/api/client/models/IssuesOverviewCounts.js +1 -0
- package/dist/src/api/client/models/IssuesOverviewResponse.js +1 -0
- package/dist/src/api/client/models/JiraIntegration.js +1 -0
- package/dist/src/api/client/models/JiraIntegrationResponse.js +1 -0
- package/dist/src/api/client/models/JoinMode.js +1 -0
- package/dist/src/api/client/models/JoinModeRequest.js +1 -0
- package/dist/src/api/client/models/JoinResponse.js +1 -0
- package/dist/src/api/client/models/JoinStatus.js +1 -0
- package/dist/src/api/client/models/Language.js +1 -0
- package/dist/src/api/client/models/LanguageListResponse.js +1 -0
- package/dist/src/api/client/models/LeaveOrgCheckResult.js +1 -0
- package/dist/src/api/client/models/LeaveOrgProblem.js +1 -0
- package/dist/src/api/client/models/License.js +1 -0
- package/dist/src/api/client/models/LicenseResponse.js +1 -0
- package/dist/src/api/client/models/ListPeopleResponse.js +1 -0
- package/dist/src/api/client/models/ListRepositoriesFollowingGatePolicyResultResponse.js +1 -0
- package/dist/src/api/client/models/ListRequestsToJoinResponse.js +1 -0
- package/dist/src/api/client/models/LogsResponse.js +1 -0
- package/dist/src/api/client/models/Membership.js +1 -0
- package/dist/src/api/client/models/MembershipPrivileges.js +1 -0
- package/dist/src/api/client/models/MembershipPrivilegesBody.js +1 -0
- package/dist/src/api/client/models/MethodNotAllowed.js +1 -0
- package/dist/src/api/client/models/MetricFilter.js +1 -0
- package/dist/src/api/client/models/MetricFilterBody.js +1 -0
- package/dist/src/api/client/models/MetricGroup.js +1 -0
- package/dist/src/api/client/models/MetricGroupBy.js +1 -0
- package/dist/src/api/client/models/MetricValue.js +1 -0
- package/dist/src/api/client/models/MetricValueResponse.js +1 -0
- package/dist/src/api/client/models/MetricsTool.js +1 -0
- package/dist/src/api/client/models/MetricsToolListResponse.js +1 -0
- package/dist/src/api/client/models/NotFound.js +1 -0
- package/dist/src/api/client/models/NotImplemented.js +1 -0
- package/dist/src/api/client/models/OpenFindingsCount.js +1 -0
- package/dist/src/api/client/models/Organization.js +1 -0
- package/dist/src/api/client/models/OrganizationBillingInformation.js +1 -0
- package/dist/src/api/client/models/OrganizationBillingInformationResponse.js +1 -0
- package/dist/src/api/client/models/OrganizationBillingPlan.js +1 -0
- package/dist/src/api/client/models/OrganizationListResponse.js +1 -0
- package/dist/src/api/client/models/OrganizationOnboardingProgressResponse.js +1 -0
- package/dist/src/api/client/models/OrganizationOnboardingStep.js +1 -0
- package/dist/src/api/client/models/OrganizationPaywall.js +1 -0
- package/dist/src/api/client/models/OrganizationProductBillingPlan.js +1 -0
- package/dist/src/api/client/models/OrganizationResponse.js +1 -0
- package/dist/src/api/client/models/OrganizationType.js +1 -0
- package/dist/src/api/client/models/OrganizationWithMeta.js +1 -0
- package/dist/src/api/client/models/OrganizationWithMetaResponse.js +1 -0
- package/dist/src/api/client/models/PaginationInfo.js +1 -0
- package/dist/src/api/client/models/Parameter.js +1 -0
- package/dist/src/api/client/models/ParameterList.js +1 -0
- package/dist/src/api/client/models/Pattern.js +1 -0
- package/dist/src/api/client/models/PatternConfiguration.js +1 -0
- package/dist/src/api/client/models/PatternDetails.js +1 -0
- package/dist/src/api/client/models/PatternListResponse.js +1 -0
- package/dist/src/api/client/models/PatternResponse.js +1 -0
- package/dist/src/api/client/models/PatternsCount.js +1 -0
- package/dist/src/api/client/models/PaymentProvider.js +1 -0
- package/dist/src/api/client/models/PaymentRequired.js +1 -0
- package/dist/src/api/client/models/Paywall.js +1 -0
- package/dist/src/api/client/models/PeriodEnum.js +1 -0
- package/dist/src/api/client/models/PeriodGroupMetricFilterBody.js +1 -0
- package/dist/src/api/client/models/PeriodGroupedMetricValuesResponse.js +1 -0
- package/dist/src/api/client/models/PeriodMetricFilterBody.js +1 -0
- package/dist/src/api/client/models/Permission.js +1 -0
- package/dist/src/api/client/models/Person.js +1 -0
- package/dist/src/api/client/models/ProblemLink.js +1 -0
- package/dist/src/api/client/models/ProductPaywall.js +1 -0
- package/dist/src/api/client/models/ProductSubscription.js +1 -0
- package/dist/src/api/client/models/ProjectCommitStat.js +1 -0
- package/dist/src/api/client/models/Provider.js +1 -0
- package/dist/src/api/client/models/ProviderIntegration.js +1 -0
- package/dist/src/api/client/models/ProviderIntegrationListResponse.js +1 -0
- package/dist/src/api/client/models/ProviderIntegrationSettingsBody.js +1 -0
- package/dist/src/api/client/models/ProviderIntegrationSettingsPatchBody.js +1 -0
- package/dist/src/api/client/models/PullRequest.js +1 -0
- package/dist/src/api/client/models/PullRequestCoverage.js +1 -0
- package/dist/src/api/client/models/PullRequestCoverageReport.js +1 -0
- package/dist/src/api/client/models/PullRequestFilesCoverageResponse.js +1 -0
- package/dist/src/api/client/models/PullRequestIssuesResponse.js +1 -0
- package/dist/src/api/client/models/PullRequestOwner.js +1 -0
- package/dist/src/api/client/models/PullRequestWithAnalysis.js +1 -0
- package/dist/src/api/client/models/PullRequestWithAnalysisListResponse.js +1 -0
- package/dist/src/api/client/models/PullRequestWithCoverage.js +1 -0
- package/dist/src/api/client/models/PullRequestWithCoverageResponse.js +1 -0
- package/dist/src/api/client/models/QualityAnalysis.js +1 -0
- package/dist/src/api/client/models/QualityGate.js +1 -0
- package/dist/src/api/client/models/QualitySettingsResponse.js +1 -0
- package/dist/src/api/client/models/QualitySettingsWithGatePolicy.js +1 -0
- package/dist/src/api/client/models/QuickfixPatchResponse.js +1 -0
- package/dist/src/api/client/models/Reason.js +1 -0
- package/dist/src/api/client/models/RemovePeopleBody.js +1 -0
- package/dist/src/api/client/models/RemovePeopleEmailStatus.js +1 -0
- package/dist/src/api/client/models/RemovePeopleResponse.js +1 -0
- package/dist/src/api/client/models/RepositoriesOverviewOfSbomDependency.js +1 -0
- package/dist/src/api/client/models/Repository.js +1 -0
- package/dist/src/api/client/models/RepositoryConflictsResponse.js +1 -0
- package/dist/src/api/client/models/RepositoryFilter.js +1 -0
- package/dist/src/api/client/models/RepositoryGatePolicy.js +1 -0
- package/dist/src/api/client/models/RepositoryIdentification.js +1 -0
- package/dist/src/api/client/models/RepositoryIdentificationV2.js +1 -0
- package/dist/src/api/client/models/RepositoryIntegrationSettings.js +1 -0
- package/dist/src/api/client/models/RepositoryLanguage.js +1 -0
- package/dist/src/api/client/models/RepositoryLanguageResponse.js +1 -0
- package/dist/src/api/client/models/RepositoryLanguageUpdate.js +1 -0
- package/dist/src/api/client/models/RepositoryLanguagesBody.js +1 -0
- package/dist/src/api/client/models/RepositoryListResponse.js +1 -0
- package/dist/src/api/client/models/RepositoryProblem.js +1 -0
- package/dist/src/api/client/models/RepositoryQualitySettings.js +1 -0
- package/dist/src/api/client/models/RepositoryQualitySettingsResponse.js +1 -0
- package/dist/src/api/client/models/RepositoryResponse.js +1 -0
- package/dist/src/api/client/models/RepositorySuggestedAuthor.js +1 -0
- package/dist/src/api/client/models/RepositorySuggestedAuthorsResponse.js +1 -0
- package/dist/src/api/client/models/RepositorySummary.js +1 -0
- package/dist/src/api/client/models/RepositorySummaryOfSbomDependency.js +1 -0
- package/dist/src/api/client/models/RepositoryToolConflictsResponse.js +1 -0
- package/dist/src/api/client/models/RepositoryWithAnalysis.js +1 -0
- package/dist/src/api/client/models/RepositoryWithAnalysisListResponse.js +1 -0
- package/dist/src/api/client/models/RepositoryWithAnalysisResponse.js +1 -0
- package/dist/src/api/client/models/RequestToJoin.js +1 -0
- package/dist/src/api/client/models/SRMCategoryIssueCount.js +1 -0
- package/dist/src/api/client/models/SRMDASTReportUploadResponse.js +1 -0
- package/dist/src/api/client/models/SRMDashboard.js +1 -0
- package/dist/src/api/client/models/SRMDashboardCategoriesResponse.js +1 -0
- package/dist/src/api/client/models/SRMDashboardHistoryResponse.js +1 -0
- package/dist/src/api/client/models/SRMDashboardRepositoriesResponse.js +1 -0
- package/dist/src/api/client/models/SRMDashboardResponse.js +1 -0
- package/dist/src/api/client/models/SRMDastReport.js +1 -0
- package/dist/src/api/client/models/SRMDastReportResponse.js +1 -0
- package/dist/src/api/client/models/SRMDastReportState.js +1 -0
- package/dist/src/api/client/models/SRMHistoryDataPoint.js +1 -0
- package/dist/src/api/client/models/SRMRepositoryIssueCount.js +1 -0
- package/dist/src/api/client/models/SbomDependenciesOverview.js +1 -0
- package/dist/src/api/client/models/SbomDependencySummary.js +1 -0
- package/dist/src/api/client/models/SearchOrganizationRepositoriesWithAnalysis.js +1 -0
- package/dist/src/api/client/models/SearchRepositoriesOfSbomDependencyBody.js +1 -0
- package/dist/src/api/client/models/SearchRepositoriesOfSbomDependencyResponse.js +1 -0
- package/dist/src/api/client/models/SearchRepositoryIssuesBody.js +1 -0
- package/dist/src/api/client/models/SearchRepositoryIssuesListResponse.js +1 -0
- package/dist/src/api/client/models/SearchSRMDashboard.js +1 -0
- package/dist/src/api/client/models/SearchSRMDashboardCategories.js +1 -0
- package/dist/src/api/client/models/SearchSRMDashboardHistory.js +1 -0
- package/dist/src/api/client/models/SearchSRMDashboardRepositories.js +1 -0
- package/dist/src/api/client/models/SearchSRMItems.js +1 -0
- package/dist/src/api/client/models/SearchSbomDependenciesBody.js +1 -0
- package/dist/src/api/client/models/SearchSbomDependenciesResponse.js +1 -0
- package/dist/src/api/client/models/SearchSbomRepositoriesBody.js +1 -0
- package/dist/src/api/client/models/SearchSbomRepositoriesResponse.js +1 -0
- package/dist/src/api/client/models/Seat.js +1 -0
- package/dist/src/api/client/models/SeatsResponse.js +1 -0
- package/dist/src/api/client/models/SecurityCategoriesResponse.js +1 -0
- package/dist/src/api/client/models/SecurityComponent.js +1 -0
- package/dist/src/api/client/models/SecurityComponentsResponse.js +1 -0
- package/dist/src/api/client/models/SecurityDashboardMetrics.js +1 -0
- package/dist/src/api/client/models/SecurityDashboardResponse.js +1 -0
- package/dist/src/api/client/models/SecurityManager.js +1 -0
- package/dist/src/api/client/models/SecurityManagerBody.js +1 -0
- package/dist/src/api/client/models/SecurityManagersResponse.js +1 -0
- package/dist/src/api/client/models/SecurityRepositoriesResponse.js +1 -0
- package/dist/src/api/client/models/SegmentEntry.js +1 -0
- package/dist/src/api/client/models/SegmentEntryDeprecated.js +1 -0
- package/dist/src/api/client/models/SegmentKeyWithId.js +1 -0
- package/dist/src/api/client/models/SegmentsKeysIdsResponse.js +1 -0
- package/dist/src/api/client/models/SegmentsKeysResponse.js +1 -0
- package/dist/src/api/client/models/SegmentsResponse.js +1 -0
- package/dist/src/api/client/models/SegmentsResponseDeprecated.js +1 -0
- package/dist/src/api/client/models/SegmentsSyncStatusResponse.js +1 -0
- package/dist/src/api/client/models/SetDefaultCodingStandardBody.js +1 -0
- package/dist/src/api/client/models/SeverityLevel.js +1 -0
- package/dist/src/api/client/models/SlackIntegration.js +1 -0
- package/dist/src/api/client/models/SlackIntegrationRequest.js +1 -0
- package/dist/src/api/client/models/SlackIntegrationResponse.js +1 -0
- package/dist/src/api/client/models/SrmEffortToFix.js +1 -0
- package/dist/src/api/client/models/SrmIgnoredBody.js +1 -0
- package/dist/src/api/client/models/SrmItem.js +1 -0
- package/dist/src/api/client/models/SrmItemResponse.js +1 -0
- package/dist/src/api/client/models/SrmItemsResponse.js +1 -0
- package/dist/src/api/client/models/SrmItemsSortBy.js +1 -0
- package/dist/src/api/client/models/SrmLikelihood.js +1 -0
- package/dist/src/api/client/models/SrmPriority.js +1 -0
- package/dist/src/api/client/models/SrmPriorityMapping.js +1 -0
- package/dist/src/api/client/models/SrmSource.js +1 -0
- package/dist/src/api/client/models/SrmStatus.js +1 -0
- package/dist/src/api/client/models/SshKeySettingResponse.js +1 -0
- package/dist/src/api/client/models/StandardParameterConflict.js +1 -0
- package/dist/src/api/client/models/StandardPatternConflict.js +1 -0
- package/dist/src/api/client/models/SuggestedAuthor.js +1 -0
- package/dist/src/api/client/models/SuggestedAuthorsResponse.js +1 -0
- package/dist/src/api/client/models/SyncProviderSettingOrganizationResponse.js +1 -0
- package/dist/src/api/client/models/SyncProviderSettingResponse.js +1 -0
- package/dist/src/api/client/models/Tax.js +1 -0
- package/dist/src/api/client/models/TimerangeMetricFilterBody.js +1 -0
- package/dist/src/api/client/models/TimerangeMetricValue.js +1 -0
- package/dist/src/api/client/models/TimerangeMetricValuesResponse.js +1 -0
- package/dist/src/api/client/models/Tool.js +1 -0
- package/dist/src/api/client/models/ToolConfiguration.js +1 -0
- package/dist/src/api/client/models/ToolListResponse.js +1 -0
- package/dist/src/api/client/models/ToolPatternsOverview.js +1 -0
- package/dist/src/api/client/models/ToolPatternsOverviewCounts.js +1 -0
- package/dist/src/api/client/models/ToolPatternsOverviewResponse.js +1 -0
- package/dist/src/api/client/models/ToolReference.js +1 -0
- package/dist/src/api/client/models/Unauthorized.js +1 -0
- package/dist/src/api/client/models/UnprocessableEntity.js +1 -0
- package/dist/src/api/client/models/UpdateGatePolicyBody.js +1 -0
- package/dist/src/api/client/models/UpdatePatternsBody.js +1 -0
- package/dist/src/api/client/models/UpdateRepositoryBranchConfigurationBody.js +1 -0
- package/dist/src/api/client/models/User.js +1 -0
- package/dist/src/api/client/models/UserBody.js +1 -0
- package/dist/src/api/client/models/UserResponse.js +1 -0
- package/dist/src/api/client/models/UserRole.js +1 -0
- package/dist/src/api/client/models/Version.js +1 -0
- package/dist/src/api/client/models/Visibility.js +1 -0
- package/dist/src/api/client/models/accountIdentifierParam.js +1 -0
- package/dist/src/api/client/models/baseCommitUuid.js +1 -0
- package/dist/src/api/client/models/branchNameParam.js +1 -0
- package/dist/src/api/client/models/branchNamePathParam.js +1 -0
- package/dist/src/api/client/models/branchStatusParam.js +1 -0
- package/dist/src/api/client/models/branchesSortParam.js +1 -0
- package/dist/src/api/client/models/categoriesParam.js +1 -0
- package/dist/src/api/client/models/codingStandardIdParam.js +1 -0
- package/dist/src/api/client/models/commitId.js +1 -0
- package/dist/src/api/client/models/commitUuid.js +1 -0
- package/dist/src/api/client/models/commitUuidParam.js +1 -0
- package/dist/src/api/client/models/commitUuidSchema.js +1 -0
- package/dist/src/api/client/models/cursorParam.js +1 -0
- package/dist/src/api/client/models/daysParam.js +1 -0
- package/dist/src/api/client/models/directionParam.js +1 -0
- package/dist/src/api/client/models/enabledPatternParam.js +1 -0
- package/dist/src/api/client/models/endLineParam.js +1 -0
- package/dist/src/api/client/models/enterpriseNameParam.js +1 -0
- package/dist/src/api/client/models/fileIdParam.js +1 -0
- package/dist/src/api/client/models/filesSearchFilter.js +1 -0
- package/dist/src/api/client/models/filesSortParam.js +1 -0
- package/dist/src/api/client/models/fromParam.js +1 -0
- package/dist/src/api/client/models/gatePolicyId.js +1 -0
- package/dist/src/api/client/models/headCommitUuid.js +1 -0
- package/dist/src/api/client/models/installationIdParam.js +1 -0
- package/dist/src/api/client/models/issueParam.js +1 -0
- package/dist/src/api/client/models/issueStatusParam.js +1 -0
- package/dist/src/api/client/models/languagesFilterParam.js +1 -0
- package/dist/src/api/client/models/limitParam.js +1 -0
- package/dist/src/api/client/models/metricNameParam.js +1 -0
- package/dist/src/api/client/models/oauthCodeParam.js +1 -0
- package/dist/src/api/client/models/onlyMembersParam.js +1 -0
- package/dist/src/api/client/models/onlyPotentialParam.js +1 -0
- package/dist/src/api/client/models/patternIdParam.js +1 -0
- package/dist/src/api/client/models/patternsSortParam.js +1 -0
- package/dist/src/api/client/models/providerParam.js +1 -0
- package/dist/src/api/client/models/pullRequestNumberParam.js +1 -0
- package/dist/src/api/client/models/recommendedPatternParam.js +1 -0
- package/dist/src/api/client/models/remoteOrganizationNameParam.js +1 -0
- package/dist/src/api/client/models/repositoriesParam.js +1 -0
- package/dist/src/api/client/models/repositoryFilterParam.js +1 -0
- package/dist/src/api/client/models/repositoryNameParam.js +1 -0
- package/dist/src/api/client/models/resultDataIdParam.js +1 -0
- package/dist/src/api/client/models/searchParam.js +1 -0
- package/dist/src/api/client/models/segmentKeyPathParam.js +1 -0
- package/dist/src/api/client/models/segmentsParam.js +1 -0
- package/dist/src/api/client/models/severityLevelsParam.js +1 -0
- package/dist/src/api/client/models/sourceCodingStandardParam.js +1 -0
- package/dist/src/api/client/models/sourceRepositoryParam.js +1 -0
- package/dist/src/api/client/models/srmItemIdParam.js +1 -0
- package/dist/src/api/client/models/srmItemsSortByParam.js +1 -0
- package/dist/src/api/client/models/srmPriorityParam.js +1 -0
- package/dist/src/api/client/models/srmScanTypeParam.js +1 -0
- package/dist/src/api/client/models/srmSecurityCategoryParam.js +1 -0
- package/dist/src/api/client/models/srmStatusParam.js +1 -0
- package/dist/src/api/client/models/startLineParam.js +1 -0
- package/dist/src/api/client/models/toParam.js +1 -0
- package/dist/src/api/client/models/tokenIdParam.js +1 -0
- package/dist/src/api/client/models/toolUuidParam.js +1 -0
- package/dist/src/api/client/models/userId.js +1 -0
- package/dist/src/api/client/services/AccountService.js +248 -0
- package/dist/src/api/client/services/AdminService.js +65 -0
- package/dist/src/api/client/services/AnalysisService.js +1216 -0
- package/dist/src/api/client/services/AppService.js +26 -0
- package/dist/src/api/client/services/BillingService.js +30 -0
- package/dist/src/api/client/services/CodingStandardsService.js +430 -0
- package/dist/src/api/client/services/ConfigurationService.js +426 -0
- package/dist/src/api/client/services/CoverageService.js +156 -0
- package/dist/src/api/client/services/EnterpriseService.js +196 -0
- package/dist/src/api/client/services/FileService.js +87 -0
- package/dist/src/api/client/services/GatePoliciesService.js +235 -0
- package/dist/src/api/client/services/HealthService.js +20 -0
- package/dist/src/api/client/services/IntegrationsService.js +46 -0
- package/dist/src/api/client/services/LanguageSettingsService.js +56 -0
- package/dist/src/api/client/services/LanguagesService.js +21 -0
- package/dist/src/api/client/services/MetricsService.js +161 -0
- package/dist/src/api/client/services/OrganizationService.js +670 -0
- package/dist/src/api/client/services/PeopleService.js +167 -0
- package/dist/src/api/client/services/ReportsService.js +51 -0
- package/dist/src/api/client/services/RepositoryService.js +1098 -0
- package/dist/src/api/client/services/SbomService.js +97 -0
- package/dist/src/api/client/services/SecurityService.js +454 -0
- package/dist/src/api/client/services/SegmentsService.js +165 -0
- package/dist/src/api/client/services/SessionService.js +23 -0
- package/dist/src/api/client/services/ToolsService.js +104 -0
- package/dist/src/api/client/services/VersionService.js +20 -0
- package/package.json +60 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Copyright 2023 Codacy.
|
|
2
|
+
|
|
3
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
you may not use this file except in compliance with the License.
|
|
5
|
+
You may obtain a copy of the License at
|
|
6
|
+
|
|
7
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
|
|
9
|
+
Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
See the License for the specific language governing permissions and
|
|
13
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# Codacy MCP Server
|
|
2
|
+
|
|
3
|
+
MCP Server for the Codacy API, enabling access to repositories, files, quality, coverage, security and more.
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
## Setup
|
|
10
|
+
|
|
11
|
+
### Personal API Access Token
|
|
12
|
+
|
|
13
|
+
Get your Codacy's Account API Token from your [Codacy Account](https://app.codacy.com/account/access-management).
|
|
14
|
+
|
|
15
|
+
### Usage with Claude Desktop
|
|
16
|
+
|
|
17
|
+
To use this with Claude Desktop, add the following to your `claude_desktop_config.json`:
|
|
18
|
+
|
|
19
|
+
#### Docker
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"mcpServers": {
|
|
24
|
+
"codacy": {
|
|
25
|
+
"command": "docker",
|
|
26
|
+
"args": ["run", "-i", "--rm", "-e", "CODACY_ACCOUNT_TOKEN", "mcp/codacy"],
|
|
27
|
+
"env": {
|
|
28
|
+
"CODACY_ACCOUNT_TOKEN": "<YOUR_TOKEN>"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### NPX
|
|
36
|
+
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"mcpServers": {
|
|
40
|
+
"codacy": {
|
|
41
|
+
"command": "npx",
|
|
42
|
+
"args": ["-y", "@codacy/codacy-mcp"],
|
|
43
|
+
"env": {
|
|
44
|
+
"CODACY_ACCOUNT_TOKEN": "<YOUR_TOKEN>"
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### Node (when using NVM)
|
|
52
|
+
|
|
53
|
+
When using NVM, NPX won't work. You can use Node directly:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"mcpServers": {
|
|
58
|
+
"codacy": {
|
|
59
|
+
"command": "/Users/yourusername/.nvm/versions/node/vXX.X.X/bin/node",
|
|
60
|
+
"args": ["/path-to/codacy-mcp/dist/index.js"],
|
|
61
|
+
"env": {
|
|
62
|
+
"CODACY_ACCOUNT_TOKEN": "<YOUR_TOKEN>"
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Build
|
|
70
|
+
|
|
71
|
+
Local:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm run build
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Docker build:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
docker build -t mcp/codacy -f src/codacy/Dockerfile .
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## License
|
|
84
|
+
|
|
85
|
+
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
3
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
5
|
+
import { OpenAPI, OrganizationService } from './src/api/client/index.js';
|
|
6
|
+
OpenAPI.BASE = 'https://app.codacy.com/api/v3';
|
|
7
|
+
OpenAPI.HEADERS = {
|
|
8
|
+
'api-token': process.env.CODACY_ACCOUNT_TOKEN || '',
|
|
9
|
+
};
|
|
10
|
+
const server = new Server({
|
|
11
|
+
name: 'codacy-mcp-server',
|
|
12
|
+
version: '0.1.0',
|
|
13
|
+
}, {
|
|
14
|
+
capabilities: {
|
|
15
|
+
tools: {},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
// Tool definitions
|
|
19
|
+
const listOrganizationRepositoriesTool = {
|
|
20
|
+
name: 'codacy_list_repositories',
|
|
21
|
+
description: 'List repositories in an organization with pagination',
|
|
22
|
+
inputSchema: {
|
|
23
|
+
type: 'object',
|
|
24
|
+
properties: {
|
|
25
|
+
provider: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: "Organization's git provider: GitHub (gh), GitLab (gl) or BitBucket (bb). Accepted values: gh, gl, bb.",
|
|
28
|
+
},
|
|
29
|
+
organization: {
|
|
30
|
+
type: 'string',
|
|
31
|
+
description: 'Organization name',
|
|
32
|
+
},
|
|
33
|
+
cursor: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
description: 'Pagination cursor for next page of results',
|
|
36
|
+
},
|
|
37
|
+
limit: {
|
|
38
|
+
type: 'number',
|
|
39
|
+
description: 'Maximum number of results to return (default 100, max 100)',
|
|
40
|
+
default: 100,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
const listOrganizationRepositoriesHandler = async (args) => {
|
|
46
|
+
const { provider, organization, limit, cursor } = args;
|
|
47
|
+
return await OrganizationService.listOrganizationRepositories(provider, organization, cursor, limit);
|
|
48
|
+
};
|
|
49
|
+
// Register tools
|
|
50
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
51
|
+
return {
|
|
52
|
+
tools: [listOrganizationRepositoriesTool],
|
|
53
|
+
};
|
|
54
|
+
});
|
|
55
|
+
// Register request handlers
|
|
56
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
57
|
+
try {
|
|
58
|
+
if (!request.params.arguments) {
|
|
59
|
+
throw new Error('Arguments are required');
|
|
60
|
+
}
|
|
61
|
+
switch (request.params.name) {
|
|
62
|
+
case 'codacy_list_repositories': {
|
|
63
|
+
const result = await listOrganizationRepositoriesHandler(request.params.arguments);
|
|
64
|
+
return {
|
|
65
|
+
content: [{ type: 'text', text: JSON.stringify(result, null, 2) }],
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
default:
|
|
69
|
+
throw new Error(`Unknown tool: ${request.params.name}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
console.error(error);
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
async function runServer() {
|
|
78
|
+
const transport = new StdioServerTransport();
|
|
79
|
+
await server.connect(transport);
|
|
80
|
+
console.error('Codacy MCP Server running on stdio');
|
|
81
|
+
}
|
|
82
|
+
runServer().catch(error => {
|
|
83
|
+
console.error('Fatal error in main():', error);
|
|
84
|
+
process.exit(1);
|
|
85
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export class ApiError extends Error {
|
|
2
|
+
url;
|
|
3
|
+
status;
|
|
4
|
+
statusText;
|
|
5
|
+
body;
|
|
6
|
+
request;
|
|
7
|
+
constructor(request, response, message) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.name = 'ApiError';
|
|
10
|
+
this.url = response.url;
|
|
11
|
+
this.status = response.status;
|
|
12
|
+
this.statusText = response.statusText;
|
|
13
|
+
this.body = response.body;
|
|
14
|
+
this.request = request;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do no edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
export class CancelError extends Error {
|
|
6
|
+
constructor(message) {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = 'CancelError';
|
|
9
|
+
}
|
|
10
|
+
get isCancelled() {
|
|
11
|
+
return true;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class CancelablePromise {
|
|
15
|
+
#isResolved;
|
|
16
|
+
#isRejected;
|
|
17
|
+
#isCancelled;
|
|
18
|
+
#cancelHandlers;
|
|
19
|
+
#promise;
|
|
20
|
+
#resolve;
|
|
21
|
+
#reject;
|
|
22
|
+
constructor(executor) {
|
|
23
|
+
this.#isResolved = false;
|
|
24
|
+
this.#isRejected = false;
|
|
25
|
+
this.#isCancelled = false;
|
|
26
|
+
this.#cancelHandlers = [];
|
|
27
|
+
this.#promise = new Promise((resolve, reject) => {
|
|
28
|
+
this.#resolve = resolve;
|
|
29
|
+
this.#reject = reject;
|
|
30
|
+
const onResolve = (value) => {
|
|
31
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
this.#isResolved = true;
|
|
35
|
+
if (this.#resolve)
|
|
36
|
+
this.#resolve(value);
|
|
37
|
+
};
|
|
38
|
+
const onReject = (reason) => {
|
|
39
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.#isRejected = true;
|
|
43
|
+
if (this.#reject)
|
|
44
|
+
this.#reject(reason);
|
|
45
|
+
};
|
|
46
|
+
const onCancel = (cancelHandler) => {
|
|
47
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.#cancelHandlers.push(cancelHandler);
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(onCancel, 'isResolved', {
|
|
53
|
+
get: () => this.#isResolved,
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(onCancel, 'isRejected', {
|
|
56
|
+
get: () => this.#isRejected,
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(onCancel, 'isCancelled', {
|
|
59
|
+
get: () => this.#isCancelled,
|
|
60
|
+
});
|
|
61
|
+
return executor(onResolve, onReject, onCancel);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
get [Symbol.toStringTag]() {
|
|
65
|
+
return "Cancellable Promise";
|
|
66
|
+
}
|
|
67
|
+
then(onFulfilled, onRejected) {
|
|
68
|
+
return this.#promise.then(onFulfilled, onRejected);
|
|
69
|
+
}
|
|
70
|
+
catch(onRejected) {
|
|
71
|
+
return this.#promise.catch(onRejected);
|
|
72
|
+
}
|
|
73
|
+
finally(onFinally) {
|
|
74
|
+
return this.#promise.finally(onFinally);
|
|
75
|
+
}
|
|
76
|
+
cancel() {
|
|
77
|
+
if (this.#isResolved || this.#isRejected || this.#isCancelled) {
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
this.#isCancelled = true;
|
|
81
|
+
if (this.#cancelHandlers.length) {
|
|
82
|
+
try {
|
|
83
|
+
for (const cancelHandler of this.#cancelHandlers) {
|
|
84
|
+
cancelHandler();
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
console.warn('Cancellation threw an error', error);
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
this.#cancelHandlers.length = 0;
|
|
93
|
+
if (this.#reject)
|
|
94
|
+
this.#reject(new CancelError('Request aborted'));
|
|
95
|
+
}
|
|
96
|
+
get isCancelled() {
|
|
97
|
+
return this.#isCancelled;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const OpenAPI = {
|
|
2
|
+
BASE: 'https://app.codacy.com/api/v3',
|
|
3
|
+
VERSION: '3.1.0',
|
|
4
|
+
WITH_CREDENTIALS: false,
|
|
5
|
+
CREDENTIALS: 'include',
|
|
6
|
+
TOKEN: undefined,
|
|
7
|
+
USERNAME: undefined,
|
|
8
|
+
PASSWORD: undefined,
|
|
9
|
+
HEADERS: undefined,
|
|
10
|
+
ENCODE_PATH: undefined,
|
|
11
|
+
};
|
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do no edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
import { ApiError } from './ApiError.js';
|
|
6
|
+
import { CancelablePromise } from './CancelablePromise.js';
|
|
7
|
+
export const isDefined = (value) => {
|
|
8
|
+
return value !== undefined && value !== null;
|
|
9
|
+
};
|
|
10
|
+
export const isString = (value) => {
|
|
11
|
+
return typeof value === 'string';
|
|
12
|
+
};
|
|
13
|
+
export const isStringWithValue = (value) => {
|
|
14
|
+
return isString(value) && value !== '';
|
|
15
|
+
};
|
|
16
|
+
export const isBlob = (value) => {
|
|
17
|
+
return (typeof value === 'object' &&
|
|
18
|
+
typeof value.type === 'string' &&
|
|
19
|
+
typeof value.stream === 'function' &&
|
|
20
|
+
typeof value.arrayBuffer === 'function' &&
|
|
21
|
+
typeof value.constructor === 'function' &&
|
|
22
|
+
typeof value.constructor.name === 'string' &&
|
|
23
|
+
/^(Blob|File)$/.test(value.constructor.name) &&
|
|
24
|
+
/^(Blob|File)$/.test(value[Symbol.toStringTag]));
|
|
25
|
+
};
|
|
26
|
+
export const isFormData = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
return value instanceof FormData;
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const base64 = (str) => {
|
|
35
|
+
try {
|
|
36
|
+
return btoa(str);
|
|
37
|
+
}
|
|
38
|
+
catch (err) {
|
|
39
|
+
// @ts-ignore
|
|
40
|
+
return Buffer.from(str).toString('base64');
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
export const getQueryString = (params) => {
|
|
44
|
+
const qs = [];
|
|
45
|
+
const append = (key, value) => {
|
|
46
|
+
qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
|
|
47
|
+
};
|
|
48
|
+
const process = (key, value) => {
|
|
49
|
+
if (isDefined(value)) {
|
|
50
|
+
if (Array.isArray(value)) {
|
|
51
|
+
value.forEach(v => {
|
|
52
|
+
process(key, v);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
else if (typeof value === 'object') {
|
|
56
|
+
Object.entries(value).forEach(([k, v]) => {
|
|
57
|
+
process(`${key}[${k}]`, v);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
append(key, value);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
Object.entries(params).forEach(([key, value]) => {
|
|
66
|
+
process(key, value);
|
|
67
|
+
});
|
|
68
|
+
if (qs.length > 0) {
|
|
69
|
+
return `?${qs.join('&')}`;
|
|
70
|
+
}
|
|
71
|
+
return '';
|
|
72
|
+
};
|
|
73
|
+
const getUrl = (config, options) => {
|
|
74
|
+
const encoder = config.ENCODE_PATH || encodeURI;
|
|
75
|
+
const path = options.url
|
|
76
|
+
.replace('{api-version}', config.VERSION)
|
|
77
|
+
.replace(/{(.*?)}/g, (substring, group) => {
|
|
78
|
+
if (options.path?.hasOwnProperty(group)) {
|
|
79
|
+
return encoder(String(options.path[group]));
|
|
80
|
+
}
|
|
81
|
+
return substring;
|
|
82
|
+
});
|
|
83
|
+
const url = `${config.BASE}${path}`;
|
|
84
|
+
if (options.query) {
|
|
85
|
+
return `${url}${getQueryString(options.query)}`;
|
|
86
|
+
}
|
|
87
|
+
return url;
|
|
88
|
+
};
|
|
89
|
+
export const getFormData = (options) => {
|
|
90
|
+
if (options.formData) {
|
|
91
|
+
const formData = new FormData();
|
|
92
|
+
const process = (key, value) => {
|
|
93
|
+
if (isString(value) || isBlob(value)) {
|
|
94
|
+
formData.append(key, value);
|
|
95
|
+
}
|
|
96
|
+
else {
|
|
97
|
+
formData.append(key, JSON.stringify(value));
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
Object.entries(options.formData)
|
|
101
|
+
.filter(([_, value]) => isDefined(value))
|
|
102
|
+
.forEach(([key, value]) => {
|
|
103
|
+
if (Array.isArray(value)) {
|
|
104
|
+
value.forEach(v => process(key, v));
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
process(key, value);
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
return formData;
|
|
111
|
+
}
|
|
112
|
+
return undefined;
|
|
113
|
+
};
|
|
114
|
+
export const resolve = async (options, resolver) => {
|
|
115
|
+
if (typeof resolver === 'function') {
|
|
116
|
+
return resolver(options);
|
|
117
|
+
}
|
|
118
|
+
return resolver;
|
|
119
|
+
};
|
|
120
|
+
export const getHeaders = async (config, options) => {
|
|
121
|
+
const [token, username, password, additionalHeaders] = await Promise.all([
|
|
122
|
+
resolve(options, config.TOKEN),
|
|
123
|
+
resolve(options, config.USERNAME),
|
|
124
|
+
resolve(options, config.PASSWORD),
|
|
125
|
+
resolve(options, config.HEADERS),
|
|
126
|
+
]);
|
|
127
|
+
const headers = Object.entries({
|
|
128
|
+
Accept: 'application/json',
|
|
129
|
+
...additionalHeaders,
|
|
130
|
+
...options.headers,
|
|
131
|
+
})
|
|
132
|
+
.filter(([_, value]) => isDefined(value))
|
|
133
|
+
.reduce((headers, [key, value]) => ({
|
|
134
|
+
...headers,
|
|
135
|
+
[key]: String(value),
|
|
136
|
+
}), {});
|
|
137
|
+
if (isStringWithValue(token)) {
|
|
138
|
+
headers['Authorization'] = `Bearer ${token}`;
|
|
139
|
+
}
|
|
140
|
+
if (isStringWithValue(username) && isStringWithValue(password)) {
|
|
141
|
+
const credentials = base64(`${username}:${password}`);
|
|
142
|
+
headers['Authorization'] = `Basic ${credentials}`;
|
|
143
|
+
}
|
|
144
|
+
if (options.body) {
|
|
145
|
+
if (options.mediaType) {
|
|
146
|
+
headers['Content-Type'] = options.mediaType;
|
|
147
|
+
}
|
|
148
|
+
else if (isBlob(options.body)) {
|
|
149
|
+
headers['Content-Type'] = options.body.type || 'application/octet-stream';
|
|
150
|
+
}
|
|
151
|
+
else if (isString(options.body)) {
|
|
152
|
+
headers['Content-Type'] = 'text/plain';
|
|
153
|
+
}
|
|
154
|
+
else if (!isFormData(options.body)) {
|
|
155
|
+
headers['Content-Type'] = 'application/json';
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return new Headers(headers);
|
|
159
|
+
};
|
|
160
|
+
export const getRequestBody = (options) => {
|
|
161
|
+
if (options.body !== undefined) {
|
|
162
|
+
if (options.mediaType?.includes('/json')) {
|
|
163
|
+
return JSON.stringify(options.body);
|
|
164
|
+
}
|
|
165
|
+
else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
|
|
166
|
+
return options.body;
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
return JSON.stringify(options.body);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return undefined;
|
|
173
|
+
};
|
|
174
|
+
export const sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
|
|
175
|
+
const controller = new AbortController();
|
|
176
|
+
const request = {
|
|
177
|
+
headers,
|
|
178
|
+
body: body ?? formData,
|
|
179
|
+
method: options.method,
|
|
180
|
+
signal: options.abortSignal ?? controller.signal,
|
|
181
|
+
};
|
|
182
|
+
if (config.WITH_CREDENTIALS) {
|
|
183
|
+
request.credentials = config.CREDENTIALS;
|
|
184
|
+
}
|
|
185
|
+
onCancel(() => controller.abort());
|
|
186
|
+
return await fetch(url, request);
|
|
187
|
+
};
|
|
188
|
+
export const getResponseHeader = (response, responseHeader) => {
|
|
189
|
+
if (responseHeader) {
|
|
190
|
+
const content = response.headers.get(responseHeader);
|
|
191
|
+
if (isString(content)) {
|
|
192
|
+
return content;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
return undefined;
|
|
196
|
+
};
|
|
197
|
+
export const getResponseBody = async (response) => {
|
|
198
|
+
if (response.status !== 204) {
|
|
199
|
+
try {
|
|
200
|
+
const contentType = response.headers.get('Content-Type');
|
|
201
|
+
if (contentType) {
|
|
202
|
+
const jsonTypes = ['application/json', 'application/problem+json'];
|
|
203
|
+
const isJSON = jsonTypes.some(type => contentType.toLowerCase().startsWith(type));
|
|
204
|
+
if (isJSON) {
|
|
205
|
+
return await response.json();
|
|
206
|
+
}
|
|
207
|
+
else {
|
|
208
|
+
return await response.text();
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
console.error(error);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return undefined;
|
|
217
|
+
};
|
|
218
|
+
export const catchErrorCodes = (options, result) => {
|
|
219
|
+
const errors = {
|
|
220
|
+
400: 'Bad Request',
|
|
221
|
+
401: 'Unauthorized',
|
|
222
|
+
403: 'Forbidden',
|
|
223
|
+
404: 'Not Found',
|
|
224
|
+
500: 'Internal Server Error',
|
|
225
|
+
502: 'Bad Gateway',
|
|
226
|
+
503: 'Service Unavailable',
|
|
227
|
+
...options.errors,
|
|
228
|
+
};
|
|
229
|
+
const error = errors[result.status];
|
|
230
|
+
if (error) {
|
|
231
|
+
throw new ApiError(options, result, error);
|
|
232
|
+
}
|
|
233
|
+
if (!result.ok) {
|
|
234
|
+
const errorStatus = result.status ?? 'unknown';
|
|
235
|
+
const errorStatusText = result.statusText ?? 'unknown';
|
|
236
|
+
const errorBody = (() => {
|
|
237
|
+
try {
|
|
238
|
+
return JSON.stringify(result.body, null, 2);
|
|
239
|
+
}
|
|
240
|
+
catch (e) {
|
|
241
|
+
return undefined;
|
|
242
|
+
}
|
|
243
|
+
})();
|
|
244
|
+
throw new ApiError(options, result, `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`);
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Request method
|
|
249
|
+
* @param config The OpenAPI configuration object
|
|
250
|
+
* @param options The request options from the service
|
|
251
|
+
* @returns CancelablePromise<T>
|
|
252
|
+
* @throws ApiError
|
|
253
|
+
*/
|
|
254
|
+
export const request = (config, options) => {
|
|
255
|
+
return new CancelablePromise(async (resolve, reject, onCancel) => {
|
|
256
|
+
try {
|
|
257
|
+
const url = getUrl(config, options);
|
|
258
|
+
const formData = getFormData(options);
|
|
259
|
+
const body = getRequestBody(options);
|
|
260
|
+
const headers = await getHeaders(config, options);
|
|
261
|
+
if (!onCancel.isCancelled) {
|
|
262
|
+
const response = await sendRequest(config, options, url, body, formData, headers, onCancel);
|
|
263
|
+
const responseBody = await getResponseBody(response);
|
|
264
|
+
const responseHeader = getResponseHeader(response, options.responseHeader);
|
|
265
|
+
const result = {
|
|
266
|
+
url,
|
|
267
|
+
ok: response.ok,
|
|
268
|
+
status: response.status,
|
|
269
|
+
statusText: response.statusText,
|
|
270
|
+
body: responseHeader ?? responseBody,
|
|
271
|
+
};
|
|
272
|
+
catchErrorCodes(options, result);
|
|
273
|
+
resolve(result.body);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
catch (error) {
|
|
277
|
+
if (error instanceof Error && error.name === 'AbortError') {
|
|
278
|
+
return;
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
reject(error);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/* generated using openapi-typescript-codegen -- do no edit */
|
|
2
|
+
/* istanbul ignore file */
|
|
3
|
+
/* tslint:disable */
|
|
4
|
+
/* eslint-disable */
|
|
5
|
+
export { ApiError as OpenAPIError } from './core/ApiError.js';
|
|
6
|
+
export { CancelablePromise, CancelError } from './core/CancelablePromise.js';
|
|
7
|
+
export { OpenAPI } from './core/OpenAPI.js';
|
|
8
|
+
export { AccountService } from './services/AccountService.js';
|
|
9
|
+
export { AdminService } from './services/AdminService.js';
|
|
10
|
+
export { AnalysisService } from './services/AnalysisService.js';
|
|
11
|
+
export { AppService } from './services/AppService.js';
|
|
12
|
+
export { BillingService } from './services/BillingService.js';
|
|
13
|
+
export { CodingStandardsService } from './services/CodingStandardsService.js';
|
|
14
|
+
export { ConfigurationService } from './services/ConfigurationService.js';
|
|
15
|
+
export { CoverageService } from './services/CoverageService.js';
|
|
16
|
+
export { EnterpriseService } from './services/EnterpriseService.js';
|
|
17
|
+
export { FileService } from './services/FileService.js';
|
|
18
|
+
export { GatePoliciesService } from './services/GatePoliciesService.js';
|
|
19
|
+
export { HealthService } from './services/HealthService.js';
|
|
20
|
+
export { IntegrationsService } from './services/IntegrationsService.js';
|
|
21
|
+
export { LanguagesService } from './services/LanguagesService.js';
|
|
22
|
+
export { LanguageSettingsService } from './services/LanguageSettingsService.js';
|
|
23
|
+
export { MetricsService } from './services/MetricsService.js';
|
|
24
|
+
export { OrganizationService } from './services/OrganizationService.js';
|
|
25
|
+
export { PeopleService } from './services/PeopleService.js';
|
|
26
|
+
export { ReportsService } from './services/ReportsService.js';
|
|
27
|
+
export { RepositoryService } from './services/RepositoryService.js';
|
|
28
|
+
export { SbomService } from './services/SbomService.js';
|
|
29
|
+
export { SecurityService } from './services/SecurityService.js';
|
|
30
|
+
export { SegmentsService } from './services/SegmentsService.js';
|
|
31
|
+
export { SessionService } from './services/SessionService.js';
|
|
32
|
+
export { ToolsService } from './services/ToolsService.js';
|
|
33
|
+
export { VersionService } from './services/VersionService.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|