Repository navigation
Feat/insights csv - #26
Merged
Merged
Conversation
GET /api/insights/export?report=gaps|questions|moments|daily|sessions returns the full list (up to 1000 rows) as a UTF-8 CSV with a BOM, under the same organizer/demo rules as /api/insights. Learner-typed cells that would run as a spreadsheet formula get a leading quote (CSV injection). Each Insights card gets a CSV download link. API.md, openapi.yaml, SECURITY.md, OBSERVABILITY.md.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 of 6 tasks
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase
No phase doc: enterprise readiness (organizers take Insights into their own reports).
Summary
GET /api/insights/export?report=gaps|questions|moments|daily|sessions: the full list (up to 1000 rows) astext/csv; charset=utf-8with a byte-order mark (Excel opens Hindi questions correctly), as an attachment namedpravaha-<report>-<date>.csv(India date),Cache-Control: private, no-store./api/insights: organizers get everything; the demo Studio gets the same filtered aggregates.= + - @, a tab or a carriage return get a leading'.getInsightstakeslimit/sessionsLimit(Studio unchanged at 10/6). API.md, openapi.yaml, SECURITY.md, OBSERVABILITY.md (insights.export).How to verify
pravaha-questions-<date>.csvand opens in Excel/Sheets with the Hindi question intact.<preview>/api/insights/export?report=nope→400 invalid_report.Checklist
tests/unit/csv.test.ts: quoting, formula neutralising, each report)pnpm lint,pnpm typecheck,pnpm testpass.envvalues in this diffdocs/GIT_WORKFLOW.md)