* Get repository information
(owner: string, repo: string)
| 89 | * Get repository information |
| 90 | */ |
| 91 | async getRepoInfo(owner: string, repo: string): Promise<GitHubRepoInfo> { |
| 92 | try { |
| 93 | const { data } = await this.octokit.repos.get({ owner, repo }); |
| 94 | const parsed = GitHubRepoInfoSchema.safeParse(data); |
| 95 | if (!parsed.success) { |
| 96 | throw new GitHubClientError( |
| 97 | `Invalid repository info response: ${formatError(parsed.error)}`, |
| 98 | ); |
| 99 | } |
| 100 | return parsed.data; |
| 101 | } catch (error) { |
| 102 | throw this.handleError(error); |
| 103 | } |
| 104 | } |
| 105 | |
| 106 | /** |
| 107 | * List contents of a directory in a repository |
no test coverage detected