(owner: string, repo: string, path = '')
| 128 | } |
| 129 | |
| 130 | async getRepositoryContents(owner: string, repo: string, path = ''): Promise<RepoContent[]> { |
| 131 | try { |
| 132 | const response = await axios.get(`${this.baseURL}/repos/${owner}/${repo}/contents/${path}`, { |
| 133 | headers: this.getHeaders() |
| 134 | }); |
| 135 | |
| 136 | return Array.isArray(response.data) ? response.data : [response.data]; |
| 137 | } catch (error) { |
| 138 | console.error('GitHub contents error:', error); |
| 139 | return []; |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | async getFileContent(owner: string, repo: string, path: string): Promise<string | null> { |
| 144 | try { |
no test coverage detected