-
Notifications
You must be signed in to change notification settings - Fork 4
agent: @U0AJM7X8FBR build a feature that would go viral if demoed on TikTok. Th #336
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: test
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -8,11 +8,16 @@ import { getPrivyLoginsHandler } from "@/lib/admins/privy/getPrivyLoginsHandler" | |||||||||||||||||
| * Returns Privy login statistics for the requested time period. | ||||||||||||||||||
| * Supports daily (last 24h), weekly (last 7 days), and monthly (last 30 days) periods. | ||||||||||||||||||
| * Requires admin authentication. | ||||||||||||||||||
| * | ||||||||||||||||||
| * @param request | ||||||||||||||||||
| */ | ||||||||||||||||||
| export async function GET(request: NextRequest): Promise<NextResponse> { | ||||||||||||||||||
| return getPrivyLoginsHandler(request); | ||||||||||||||||||
| } | ||||||||||||||||||
|
|
||||||||||||||||||
| /** | ||||||||||||||||||
| * | ||||||||||||||||||
| */ | ||||||||||||||||||
|
Comment on lines
+18
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replace empty JSDoc block with a meaningful description. Suggested doc improvement-/**
- *
- */
+/**
+ * CORS preflight handler for /api/admins/privy.
+ *
+ * `@returns` 204 response with CORS headers.
+ */📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||
| export async function OPTIONS(): Promise<NextResponse> { | ||||||||||||||||||
| return new NextResponse(null, { status: 204, headers: getCorsHeaders() }); | ||||||||||||||||||
| } | ||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import type { NextRequest } from "next/server"; | ||
| import { NextResponse } from "next/server"; | ||
| import { getCorsHeaders } from "@/lib/networking/getCorsHeaders"; | ||
| import { generateCampaignHandler } from "@/lib/launch/generateCampaignHandler"; | ||
|
|
||
| /** | ||
| * OPTIONS handler for CORS preflight requests. | ||
| * | ||
| * @returns Empty 200 response with CORS headers. | ||
| */ | ||
| export async function OPTIONS() { | ||
| return new NextResponse(null, { | ||
| status: 200, | ||
| headers: getCorsHeaders(), | ||
| }); | ||
| } | ||
|
|
||
| /** | ||
| * POST /api/launch | ||
| * | ||
| * Streams an AI-generated music release campaign given artist and song details. | ||
| * Returns a text/plain stream with XML-style section markers that the client | ||
| * parses to render each campaign section in real-time. | ||
| * | ||
| * Authentication: x-api-key header OR Authorization: Bearer token required. | ||
| * | ||
| * Request body: | ||
| * - artist_name: string (required) — the artist's name | ||
| * - song_name: string (required) — the song or album name | ||
| * - genre: string (required) — musical genre | ||
| * - release_date: string (required) — release date (any format) | ||
| * - description: string (optional) — additional context for the AI | ||
| * | ||
| * Response: streaming text with section markers: | ||
| * [SECTION:press_release]...[/SECTION:press_release] | ||
| * [SECTION:spotify_pitch]...[/SECTION:spotify_pitch] | ||
| * [SECTION:instagram_captions]...[/SECTION:instagram_captions] | ||
| * [SECTION:tiktok_hooks]...[/SECTION:tiktok_hooks] | ||
| * [SECTION:fan_newsletter]...[/SECTION:fan_newsletter] | ||
| * [SECTION:curator_email]...[/SECTION:curator_email] | ||
| * | ||
| * @param request - The incoming request | ||
| * @returns Streaming text response or error | ||
| */ | ||
| export async function POST(request: NextRequest): Promise<Response> { | ||
| return generateCampaignHandler(request); | ||
| } | ||
|
Comment on lines
+45
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for test files covering the launch endpoint
echo "=== Looking for launch-related test files ==="
fd -e test.ts -e spec.ts launch
echo ""
echo "=== Searching for tests referencing /api/launch ==="
rg -l "api/launch" --glob "*test*" --glob "*spec*"
echo ""
echo "=== Searching for generateCampaignHandler tests ==="
rg -l "generateCampaignHandler" --glob "*test*" --glob "*spec*"Repository: recoupable/api Length of output: 257 🏁 Script executed: # Search for all test files in the repository
find . -type f \( -name "*.test.ts" -o -name "*.spec.ts" -o -name "*.integration.ts" -o -name "*.e2e.ts" \) | head -30Repository: recoupable/api Length of output: 1735 🏁 Script executed: # Check the structure of app/api directory and look for test patterns
fd -t f -e ts -e tsx "app/api" | grep -i testRepository: recoupable/api Length of output: 391 🏁 Script executed: # Search for where generateCampaignHandler is defined and if it has any tests
rg "generateCampaignHandler" -A 5 -B 2 | head -50Repository: recoupable/api Length of output: 1573 🏁 Script executed: # Check if launch route test file exists
ls -la app/api/launch/__tests__/ 2>/dev/null || echo "Directory does not exist"
# Search for any test files in launch directory
find app/api/launch -name "*.test.ts" -o -name "*.spec.ts" 2>/dev/null || echo "No test files found"
# Confirm the pattern - check if other api endpoints have __tests__ directories with route.test.ts
ls -1 app/api/*/__tests__/route.test.ts 2>/dev/null | head -5Repository: recoupable/api Length of output: 127 🏁 Script executed: # Get more details on the generateCampaignHandler implementation to understand what needs testing
cat -n lib/launch/generateCampaignHandler.ts | head -60Repository: recoupable/api Length of output: 1549 Add integration tests for the /api/launch endpoint covering all success and error paths. Integration tests are missing for this route handler. The codebase has 🤖 Prompt for AI Agents |
||
|
|
||
| export const dynamic = "force-dynamic"; | ||
| export const fetchCache = "force-no-store"; | ||
| export const revalidate = 0; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix redundant/ambiguous JSDoc param annotation.
@param params.paramsis unclear and overlaps with@param params. Keep one clear param entry for the destructured route params object.Suggested JSDoc cleanup
📝 Committable suggestion
🤖 Prompt for AI Agents