(owner: string, repo: string)
| 218 | } |
| 219 | |
| 220 | async getRepositoryStats(owner: string, repo: string) { |
| 221 | try { |
| 222 | const [repoResponse, contributorsResponse, commitsResponse] = await Promise.all([ |
| 223 | axios.get(`${this.baseURL}/repos/${owner}/${repo}`, { headers: this.getHeaders() }), |
| 224 | axios.get(`${this.baseURL}/repos/${owner}/${repo}/contributors`, { |
| 225 | headers: this.getHeaders(), |
| 226 | params: { per_page: 5 } |
| 227 | }), |
| 228 | axios.get(`${this.baseURL}/repos/${owner}/${repo}/commits`, { |
| 229 | headers: this.getHeaders(), |
| 230 | params: { per_page: 10 } |
| 231 | }) |
| 232 | ]); |
| 233 | |
| 234 | return { |
| 235 | repo: repoResponse.data, |
| 236 | topContributors: contributorsResponse.data, |
| 237 | recentCommits: commitsResponse.data |
| 238 | }; |
| 239 | } catch (error) { |
| 240 | console.error('GitHub stats error:', error); |
| 241 | return null; |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | async getReadme(repoFullName: string): Promise<string> { |
| 246 | try { |
no test coverage detected