MCPcopy
hub / github.com/ahmedkhaleel2004/gitdiagram / getGithubData

Function getGithubData

src/server/generate/github.ts:167–192  ·  view source on GitHub ↗
(
  username: string,
  repo: string,
  githubPat?: string,
  signal?: AbortSignal,
)

Source from the content-addressed store, hash-verified

165}
166
167export async function getGithubData(
168 username: string,
169 repo: string,
170 githubPat?: string,
171 signal?: AbortSignal,
172): Promise<GithubData> {
173 const headers = await getGitHubApiHeaders({ githubPat });
174 const { defaultBranch, isPrivate, stargazerCount } = await getRepoMetadata(
175 username,
176 repo,
177 headers,
178 signal,
179 );
180 const [fileTree, readme] = await Promise.all([
181 getFileTree(username, repo, defaultBranch, headers, signal),
182 getReadme(username, repo, headers, signal),
183 ]);
184
185 return {
186 defaultBranch,
187 fileTree,
188 readme,
189 isPrivate,
190 stargazerCount,
191 };
192}

Callers 2

POSTFunction · 0.90
runFunction · 0.90

Calls 4

getGitHubApiHeadersFunction · 0.90
getRepoMetadataFunction · 0.85
getFileTreeFunction · 0.85
getReadmeFunction · 0.85

Tested by

no test coverage detected