feat(api): add public demo scenario manifest endpoint#101
Conversation
|
@OG-wura is attempting to deploy a commit to the emrekayat's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@OG-wura Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Thanks for the PR. I rechecked the merge ref from the maintainer account. The functional checks pass: git diff --check main...pr-101-merge
npm run test --workspace @query402/shared
npm run test --workspace @query402/api -- src/routes/public.test.ts
npm run typecheck --workspace @query402/api
npm run typecheck --workspace @query402/webResults: shared tests pass (12), public route tests pass (17), API typecheck passes, and web typecheck passes. I cannot merge this exact PR yet because |
# Conflicts: # apps/api/src/routes/public.test.ts # apps/api/src/routes/public.ts # package-lock.json
34145ed to
eecd924
Compare
|
done |
Close #80
PR description:
Summary
Adds a public read-only endpoint
GET /api/scenariosthat returns the canonical demo scenarios supported by the app. This helps reviewers and demo runners reproduce the exact demo path without needing internal documentation.Changes
packages/shared/src/schemas.ts— AddeddemoScenarioSchemaanddemoScenarioManifestSchemaZod schemaspackages/shared/src/types.ts— AddedDemoScenarioandDemoScenarioManifestinterfacesapps/api/src/routes/public.ts— AddedGET /api/scenariosendpoint returning 3 scenarios (one per mode) with stable hardcoded manifest dataapps/web/src/lib/api.ts— AddedfetchDemoScenarios()helper for optional web integrationapps/api/src/routes/public.test.ts— 5 tests covering response shape, all three modes, stability on repeated calls, and confirming no provider execution occursManifest contents
{ "scenarios": [ { "id": "search-provider-comparison", "mode": "search", "recommendedProvider": "search.basic", "sampleQuery": "latest stellar x402 updates", "expectedEvidenceFields": ["providerId","providerName","priceUsd","latencyMs","timestamp","traceId","items","source","execution"], "worksInDemoMode": true, "worksInRealMode": true }, { "id": "news-payment-flow", "mode": "news", "recommendedProvider": "news.fast", "sampleQuery": "stablecoin micropayments", "expectedEvidenceFields": ["providerId","providerName","priceUsd","latencyMs","timestamp","traceId","items","source","execution"], "worksInDemoMode": true, "worksInRealMode": true }, { "id": "scrape-result-display", "mode": "scrape", "recommendedProvider": "scrape.page", "sampleQuery": "https://developers.stellar.org", "expectedEvidenceFields": ["providerId","providerName","priceUsd","latencyMs","timestamp","traceId","items","source","execution"], "worksInDemoMode": true, "worksInRealMode": true } ] } Verification - Endpoint returns JSON without requiring payment or credentials - No provider execution occurs when fetching the manifest - All 5 new tests pass - All existing passing tests continue to pass