MCPcopy Index your code
hub / github.com/gitify-app/gitify / createOctokitClientUncached

Function createOctokitClientUncached

src/renderer/utils/api/octokit.ts:79–100  ·  view source on GitHub ↗
(
  account: Account,
  type: APIClientType,
)

Source from the content-addressed store, hash-verified

77 * @returns A fresh authenticated Octokit instance
78 */
79export 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

Callers 3

octokit.test.tsFile · 0.90
createOctokitClientFunction · 0.85

Calls 4

decryptValueFunction · 0.90
getAppVersionFunction · 0.90
getGitHubAPIBaseUrlFunction · 0.90
toStringMethod · 0.80

Tested by

no test coverage detected