MCPcopy Create free account
hub / github.com/SIMARSINGHRAYAT/Gitzo / validateToken

Function validateToken

src/utils/github.ts:33–49  ·  view source on GitHub ↗
(token: string)

Source from the content-addressed store, hash-verified

31 Accept: 'application/vnd.github.v3+json',
32 'X-GitHub-Api-Version': API_VERSION,
33 ...(options?.headers || {}),
34 },
35 });
36 return res;
37 } catch (err) {
38 const message = err instanceof Error ? err.message : 'Network request failed';
39 throw new Error(`NETWORK_ERROR: ${message}`);
40 }
41}
42
43export async function fetchAllRepos(token: string): Promise<GitHubRepo[]> {
44 const allRepos: GitHubRepo[] = [];
45 let page = 1;
46 while (page <= 10) {
47 const res = await ghFetch(
48 `/user/repos?per_page=100&page=${page}&sort=updated&affiliation=owner,collaborator,organization_member`,
49 token
50 );
51 if (!res.ok) break;
52 const data = await res.json();

Callers 1

AppFunction · 0.90

Calls 2

ghFetchFunction · 0.85
detectTokenTypeFunction · 0.85

Tested by

no test coverage detected