Structs§
- Cooklang
Ingredient - Daily
Summary - Daily
Target - Export
Data - Export
Meal Entry - Export
Recipe - Export
Recipe Ingredient - Export
Target - Export
Weight Entry - Food
- Import
Summary - Legacy
Export Target - Legacy export target without
day_of_week(for backward compatibility with old exports). - Meal
Entry - Meal
Group - NewFood
- NewMeal
Entry - NewWeight
Entry - Recent
Food - Recipe
- Recipe
Detail - Recipe
Ingredient - Sync
Payload - Sync
Push Request - Sync
Tombstone - Update
Meal Entry - Weight
Entry
Constants§
- MEAL_
TYPES - VALID_
TOMBSTONE_ TABLES - Valid table names for sync tombstones.
Functions§
- convert_
to_ grams - Convert a quantity with a unit to grams.
Volume-based conversions assume water density (1 ml = 1 g).
Returns
(grams, is_approximate)whereis_approximateis true for volume conversions. - validate_
export_ meal_ entry - Validate an exported/synced meal entry:
meal_type,serving_g, and date format. - validate_
export_ recipe - Validate an exported/synced recipe: portions must be positive.
- validate_
export_ recipe_ ingredient - Validate an exported/synced recipe ingredient: quantity must be positive.
- validate_
export_ target - Validate an exported/synced target: day 0-6, calories > 0, macro split if present.
- validate_
export_ weight_ entry - Validate an exported/synced weight entry: weight > 0, valid date.
- validate_
food_ data - Validate imported food data: name must not be empty, calories must not be negative.
- validate_
macro_ split - validate_
meal_ entry_ data - Validate an imported meal entry:
meal_typeandserving_g. - validate_
meal_ type - validate_
tombstone - Validate a sync tombstone:
table_namemust be in the allowed list,deleted_atmust be valid RFC 3339, and future timestamps are capped to now.