Skip to content

v0.1.3

Choose a tag to compare

@cyanheads cyanheads released this 25 May 01:45
v0.1.3
7ff0132

Security fix, field-test bug fixes, input validation, code simplification

API key moved to X-Api-Key header (was query param — visible in error URLs and logs). Six bugs fixed from field-test pass: empty/whitespace query, quantity-without-unit, negative FDC IDs, negative comparison quantity, nutrient reference ID collisions, and duplicate entries.

Security:

  • API key moved from query param to X-Api-Key request header in fetchFdc()

Fixed:

  • usda_search_foods: whitespace-only query now fails with query_empty
  • usda_get_food: quantity without unit now throws quantity_without_unit
  • usda_get_food / usda_get_foods / usda_compare_foods: fdcId/fdcIds schema enforces min(1)
  • usda_compare_foods: quantity schema enforces .positive()
  • Nutrient reference: Lactose ID corrected to 1011, Galactose to 1075; duplicate Sucrose (1010) and Vitamin C (1123) entries removed

Changed:

  • Tool and resource descriptions clarified across all 5 tools and 2 resources
  • Code simplified: barrel exports, spread syntax, unused params removed

61 tests pass; bun run devcheck clean.