ThatAIguyA world of ideas

THE CONSCIOUSNESS ATLAS
Read. Experiment. Follow the evidence.

ConsciousnessLearn · Explore · Joseph Anady

Janady13/llms-txt-hub / apps/web/app/api/debug/github-contributions/route.ts

Source identity, revision, and recovered contents.

GitHub sourceSource text recovered

Source identity

FieldRecorded value
Source typeGitHub source
Original recordJanady13/llms-txt-hub / apps/web/app/api/debug/github-contributions/route.ts
DateNot specified in source
RepositoryJanady13/llms-txt-hub
Revisione0f4bf978d4df168369c7601d9c5f5ea89e84377
Branchmain
Path or archive memberapps/web/app/api/debug/github-contributions/route.ts
Original SHA-256eefa04c449e792005e367a3437b3ab22487590c9468d57eb5203f34a3e9a8574
Git blob SHAaea2aadc7ef042bd15c7218f8d3af86f4b73c70d
Reading-copy SHA-256eefa04c449e792005e367a3437b3ab22487590c9468d57eb5203f34a3e9a8574

Original source ↗

Recovered source transcript

import { createHash } from 'node:crypto' import { logger } from '@thedaviddias/logging' import { type NextRequest, NextResponse } from 'next/server' import { ensureDebugAccess } from '@/app/api/debug/_utils' import { getUserContributions } from '@/lib/github-contributions' /** * Creates a SHA-256 hash of the username for logging purposes * * @param username - The username to hash * @returns The hex digest of the username hash */ function hashUsername(username: string | null | undefined): string { const input = username || '' return createHash('sha256').update(input).digest('hex') } /** * GET handler for debugging GitHub contributions fetching * * @param request - NextRequest with username query parameter * @returns Promise resolving to NextResponse with contributions data or error */ export async function GET(request: NextRequest) { const access = await ensureDebugAccess(request) if (!access.ok) { return access.response } const { searchParams } = new URL(request.url) const username = searchParams.get('username') if (!username) { return NextResponse.json({ error: 'Username parameter required' }, { status: 400 }) } try { logger.info('Debug: Fetching GitHub contributions', { data: { usernameHash: hashUsername(username) }, tags: { type: 'debug', component: 'github-contributions' } }) const contributions = await getUserContributions(username) return NextResponse.json({ username, contributions, timestamp: new Date().toISOString() }) } catch (error) { logger.error('Debug: Error fetching GitHub contributions', { data: { usernameHash: hashUsername(username), error: error instanceof Error ? error.message : 'Unknown error' }, tags: { type: 'debug', component: 'github-contributions', error: 'fetch-failed' } }) const errorResponse: { error: string timestamp: string details?: string } = { error: 'Failed to fetch contributions', timestamp: new Date().toISOString() } // Only include error details in development if (process.env.NODE_ENV !== 'production') { errorResponse.details = error instanceof Error ? error.message : 'Unknown error' } return NextResponse.json(errorResponse, { status: 500, headers: { 'Cache-Control': 'no-store' } }) } }

Search equations, builds, manuscript text, and recovered sources.