Skip to content

feat(routes-f): add sudoku, country lookup, csv parser, and mime lookup APIs#714

Merged
davedumto merged 1 commit intoStreamFi-x:devfrom
Themancalledpg:codex/feat-routes-f-sudoku-country-csv-mime
Apr 28, 2026
Merged

feat(routes-f): add sudoku, country lookup, csv parser, and mime lookup APIs#714
davedumto merged 1 commit intoStreamFi-x:devfrom
Themancalledpg:codex/feat-routes-f-sudoku-country-csv-mime

Conversation

@Themancalledpg
Copy link
Copy Markdown
Contributor

Description

Implements four new scoped routes-f APIs in one PR: sudoku grid validation, country info lookup, CSV parsing (RFC 4180 quote handling), and MIME lookup with reverse mapping and suggestions.

Closes #655
Closes #665
Closes #660
Closes #664

Changes proposed

What were you told to do?

Add four new endpoints under app/api/routes-f/ only, each with route logic and tests, and keep the implementation fully self-contained within that folder.

What did I do?

Sudoku validator (/api/routes-f/sudoku)

  • Added POST endpoint to validate 9x9 sudoku grids with row, column, and 3x3 box duplicate detection.
  • Returns { valid, complete, conflicts } where complete is true only when grid is full and valid.
  • Rejects malformed grids with 400.
  • Added tests for valid complete, valid partial, and each conflict type.

Country lookup (/api/routes-f/country)

  • Added GET endpoint for ?code= and ?name= lookups, plus list-all when no params are provided.
  • Added bundled dataset of 60 countries inside the route folder.
  • Supports case-insensitive lookups by alpha2, alpha3, numeric code, and partial name.
  • Returns required country fields including flag_emoji.
  • Added tests for all lookup modes and partial matching.

CSV parser (/api/routes-f/csv-parse)

  • Added POST endpoint with csv, optional has_header (default true) and delimiter (default ,).
  • Implemented inline parser (no CSV library) supporting quoted fields, escaped quotes, and embedded newlines.
  • Added numeric auto-coercion and 10MB input cap.
  • Rejects ragged rows with 400 and offending row indexes in the error message.
  • Added tests for quotes, embedded newlines, custom delimiter, and ragged rows.

MIME lookup (/api/routes-f/mime)

  • Added GET endpoint for lookup by ?extension= or ?mime=.
  • Bundled 179 MIME mappings with required categories in-folder.
  • Unknown lookups return 404 with suggestions.
  • Added tests for both lookup directions and common MIME types.

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • This PR does not contain plagiarized content.
  • The title and description of the PR is clear and explains the approach.
  • I am making a pull request against the main branch (left side).
  • My commit messages styles matches our requested structure.
  • My code additions will fail neither code linting checks nor unit test.
  • I am only making changes to files I was requested to.

Screenshots / Testing Evidence

Did not run tests per request. Verification performed via code-level checks for scope, required response shapes, dataset counts, and endpoint behavior coverage in added unit tests.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 28, 2026

@Codex-Agent is attempting to deploy a commit to the david's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 28, 2026

@Themancalledpg 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! 🚀

Learn more about application limits

@davedumto davedumto merged commit 3d840a0 into StreamFi-x:dev Apr 28, 2026
4 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants