MCPcopy Index your code
hub / github.com/BingyanStudio/github-analyzer / fetchUserDataEndpoint

Function fetchUserDataEndpoint

api/src/services/generateReport.ts:464–498  ·  view source on GitHub ↗
(req: BunRequest)

Source from the content-addressed store, hash-verified

462}
463
464export async function fetchUserDataEndpoint(req: BunRequest) {
465 const sessionId = req.cookies.get("session");
466 if (sessionId === null) {
467 return Response.json(
468 {
469 state: "Failed",
470 message: "Invalid session ID.",
471 },
472 {
473 status: 401,
474 }
475 );
476 }
477 const session = await sessionStore.getSession(sessionId);
478 if (session === null) {
479 return Response.json(
480 {
481 state: "Failed",
482 message: "Invalid session ID.",
483 },
484 {
485 status: 401,
486 }
487 );
488 }
489 const octokit = createOctokitFromSession(session);
490
491 const rawData = await fetchUserData(octokit);
492 const parsedData = parseUserData(rawData);
493 return Response.json({
494 state: "Success",
495 raw: rawData,
496 parsed: parsedData,
497 });
498}
499
500export async function generateReport(req: BunRequest) {
501 const sessionId = req.cookies.get("session");

Callers

nothing calls this directly

Calls 4

createOctokitFromSessionFunction · 0.90
fetchUserDataFunction · 0.85
parseUserDataFunction · 0.85
getSessionMethod · 0.45

Tested by

no test coverage detected