( account: Account, type: APIClientType, )
| 77 | * @returns A fresh authenticated Octokit instance |
| 78 | */ |
| 79 | export async function createOctokitClientUncached( |
| 80 | account: Account, |
| 81 | type: APIClientType, |
| 82 | ): Promise<OctokitClient> { |
| 83 | const decryptedToken = await decryptValue(account.token); |
| 84 | |
| 85 | const version = await getAppVersion(); |
| 86 | const userAgent = `${APPLICATION.NAME}/${version}`; |
| 87 | |
| 88 | const baseUrl = getGitHubAPIBaseUrl(account.hostname, type) |
| 89 | .toString() |
| 90 | .replace(/\/$/, ''); |
| 91 | |
| 92 | return new OctokitWithPlugins({ |
| 93 | auth: decryptedToken, |
| 94 | baseUrl: baseUrl, |
| 95 | userAgent: userAgent, |
| 96 | retry: { |
| 97 | retries: 1, |
| 98 | }, |
| 99 | }); |
| 100 | } |
| 101 | |
| 102 | /** |
| 103 | * Calculate client cache key for account and api type |
no test coverage detected