import type { RecipesRecipe, RecipesIngredient, RecipesFoodItem, RecipesRecipeNutrition, RecipesTag, RecipesRecipeTag, RecipesRecipeFavorite, RecipesRecipeCollection, RecipesCollectionRecipe, RecipesEnrichmentJob, RecipesMealSchedule, RecipesScheduledMeal, RecipesNutritionSummary, RecipesShoppingList, RecipesShoppingListItem } from "../_internal/types.gen"; import type { RequestOptions } from "../base-client"; import { RequestBuilder } from "../request-builder"; /** Attributes accepted when creating a recipe. */ export interface CreateRecipeAttributes { workspace_id: string; contact_id?: string; application_id?: string; title: string; description?: string; instructions?: string; source_type?: "owned" | "external" | "imported"; source_uri?: string; source_provider?: string; prep_time_minutes?: number; cook_time_minutes?: number; total_time_minutes?: number; servings?: number; difficulty?: "easy" | "medium" | "hard"; cuisine_type?: string; image_url?: string; image_urls?: string[]; metadata?: Record; } /** Attributes accepted when importing an external recipe. */ export interface ImportRecipeAttributes { workspace_id: string; contact_id?: string; application_id?: string; title: string; description?: string; instructions?: string; source_uri?: string; source_url?: string; source_name?: string; source_provider?: string; /** Write-only — raw connector response stored server-side but never returned in API responses. */ source_data?: Record; prep_time_minutes?: number; cook_time_minutes?: number; total_time_minutes?: number; servings?: number; difficulty?: "easy" | "medium" | "hard"; cuisine_type?: string; image_url?: string; image_urls?: string[]; metadata?: Record; } /** Error entry in a bulk import failure. */ export interface BulkImportError { index?: number; errors?: Array<{ field?: string; message?: string; code?: string; }>; } /** Result of a bulk import operation. */ export interface BulkImportResult { imported: RecipesRecipe[]; failed: BulkImportError[]; } /** Attributes accepted when updating a recipe. */ export interface UpdateRecipeAttributes { title?: string; description?: string; instructions?: string; prep_time_minutes?: number; cook_time_minutes?: number; total_time_minutes?: number; servings?: number; difficulty?: "easy" | "medium" | "hard"; cuisine_type?: string; image_url?: string; image_urls?: string[]; metadata?: Record; } /** Attributes accepted when creating an ingredient. */ export interface CreateIngredientAttributes { recipe_id: string; food_item_id?: string; name: string; quantity?: number; unit?: string; preparation_note?: string; sort_order?: number; food_group?: string; } /** Attributes accepted when updating an ingredient. */ export interface UpdateIngredientAttributes { food_item_id?: string; name?: string; quantity?: number; unit?: string; preparation_note?: string; sort_order?: number; food_group?: string; } /** Attributes accepted when creating a food item. */ export interface CreateFoodItemAttributes { application_id: string; name: string; external_id?: string; external_source?: string; nutrition_per_100g?: Record; food_group?: string; allergens?: string[]; default_unit?: string; unit_conversions?: Record; } /** Attributes accepted when updating a food item. */ export interface UpdateFoodItemAttributes { name?: string; nutrition_per_100g?: Record; food_group?: string; allergens?: string[]; default_unit?: string; unit_conversions?: Record; } /** Attributes accepted when creating recipe nutrition. */ export interface CreateRecipeNutritionAttributes { recipe_id: string; source?: "computed" | "external" | "manual"; calories?: number; protein_g?: number; carbs_g?: number; fat_g?: number; fiber_g?: number; sugar_g?: number; sodium_mg?: number; full_nutrients?: Record; } /** Attributes accepted when updating recipe nutrition. */ export interface UpdateRecipeNutritionAttributes { source?: "computed" | "external" | "manual"; calories?: number; protein_g?: number; carbs_g?: number; fat_g?: number; fiber_g?: number; sugar_g?: number; sodium_mg?: number; full_nutrients?: Record; } /** Attributes accepted when creating a tag. */ export interface CreateTagAttributes { application_id: string; category: "cuisine" | "diet" | "health" | "course" | "technique" | "custom"; name: string; metadata?: Record; } /** Attributes accepted when updating a tag. */ export interface UpdateTagAttributes { name?: string; category?: "cuisine" | "diet" | "health" | "course" | "technique" | "custom"; metadata?: Record; } /** Attributes accepted when creating a recipe-tag association. */ export interface CreateRecipeTagAttributes { recipe_id: string; tag_id: string; } /** Attributes accepted when creating a recipe favorite. */ export interface CreateRecipeFavoriteAttributes { workspace_id: string; contact_id?: string; recipe_id: string; notes?: string; meal_type?: string; /** Integer rating value. */ rating?: number; } /** Attributes accepted when updating a recipe favorite. */ export interface UpdateRecipeFavoriteAttributes { notes?: string; meal_type?: string; /** Integer rating value. */ rating?: number; } /** Attributes accepted when creating a recipe collection. */ export interface CreateRecipeCollectionAttributes { workspace_id: string; contact_id?: string; name: string; description?: string; scope?: "workspace" | "contact"; metadata?: Record; } /** Attributes accepted when updating a recipe collection. */ export interface UpdateRecipeCollectionAttributes { name?: string; description?: string; metadata?: Record; } /** Attributes accepted when adding a recipe to a collection. */ export interface CreateCollectionRecipeAttributes { collection_id: string; recipe_id: string; sort_order?: number; } /** Attributes accepted when updating a collection recipe. */ export interface UpdateCollectionRecipeAttributes { sort_order?: number; } /** Attributes accepted when creating a meal schedule. */ export interface CreateMealScheduleAttributes { workspace_id: string; contact_id?: string; name: string; start_date?: string; end_date?: string; status?: "draft" | "active" | "completed"; } /** Attributes accepted when updating a meal schedule. */ export interface UpdateMealScheduleAttributes { name?: string; start_date?: string; end_date?: string; status?: "draft" | "active" | "completed"; } /** Attributes accepted when creating a scheduled meal. */ export interface CreateScheduledMealAttributes { meal_schedule_id: string; recipe_id: string; date: string; meal_type: "breakfast" | "lunch" | "dinner" | "snack"; servings?: number; } /** Attributes accepted when updating a scheduled meal. */ export interface UpdateScheduledMealAttributes { date?: string; meal_type?: "breakfast" | "lunch" | "dinner" | "snack"; servings?: number; } /** Attributes accepted when creating a shopping list. */ export interface CreateShoppingListAttributes { workspace_id: string; contact_id?: string; meal_schedule_id?: string; name: string; status?: "draft" | "active" | "completed"; } /** Attributes accepted when updating a shopping list. */ export interface UpdateShoppingListAttributes { name?: string; status?: "draft" | "active" | "completed"; } /** Attributes accepted when creating a shopping list item. */ export interface CreateShoppingListItemAttributes { shopping_list_id: string; name: string; total_quantity?: number; unit?: string; food_group?: string; checked?: boolean; } /** Attributes accepted when updating a shopping list item. */ export interface UpdateShoppingListItemAttributes { name?: string; total_quantity?: number; unit?: string; food_group?: string; checked?: boolean; } export type ListOptions = { page?: number; pageSize?: number; } & RequestOptions; /** Options for listing recipe collections. */ export interface CollectionListOptions extends ListOptions { /** Filter to a specific contact's collections. */ contactId?: string; /** Filter by collection scope. */ scope?: "workspace" | "contact"; /** Sort field(s). Prefix with '-' for descending (e.g. '-inserted_at'). */ sort?: string; } export type RecipesAPI = ReturnType; export declare function createRecipesNamespace(rb: RequestBuilder): { /** Get a recipe by ID. */ get(id: string, options?: RequestOptions): Promise; /** List recipes in a workspace (optional status filter, created_by filter). */ list(workspaceId: string, options?: ListOptions & { filter?: { status?: string; created_by?: string; }; }): Promise; /** List recipes for a contact in a workspace. */ listByContact(workspaceId: string, contactId: string, options?: ListOptions): Promise; /** List published recipes for a workspace. */ listPublished(workspaceId: string, options?: ListOptions): Promise; /** Create a recipe. */ create(attrs: CreateRecipeAttributes, options?: RequestOptions): Promise; /** Import an external recipe. */ import(attrs: ImportRecipeAttributes, options?: RequestOptions): Promise; /** * Bulk import recipes with dedup via source_uri. * * @param recipes - Array of recipe attribute maps * @param options - Request options * @returns Object with `imported` and `failed` arrays */ bulkImport(recipes: ImportRecipeAttributes[], options?: RequestOptions): Promise; /** Update a recipe. */ update(id: string, attrs: UpdateRecipeAttributes, options?: RequestOptions): Promise; /** * Re-enqueue AI enrichment for a recipe. * Resets enrichment_status to pending and triggers the enrichment pipeline. * * @param id - Recipe ID * @param options - Request options * @returns The updated recipe */ reEnrich(id: string, options?: RequestOptions): Promise; /** Archive a recipe. */ archive(id: string, options?: RequestOptions): Promise; /** Restore an archived recipe. */ restore(id: string, options?: RequestOptions): Promise; /** Delete a recipe. */ delete(id: string, options?: RequestOptions): Promise; ingredients: { /** Get an ingredient by ID. */ get(id: string, options?: RequestOptions): Promise; /** List ingredients for a recipe. */ list(recipeId: string, options?: ListOptions): Promise; /** Create an ingredient. */ create(attrs: CreateIngredientAttributes, options?: RequestOptions): Promise; /** Update an ingredient. */ update(id: string, attrs: UpdateIngredientAttributes, options?: RequestOptions): Promise; /** Delete an ingredient. */ delete(id: string, options?: RequestOptions): Promise; }; foodItems: { /** Get a food item by ID. */ get(id: string, options?: RequestOptions): Promise; /** List food items for an application. */ list(applicationId: string, options?: ListOptions): Promise; /** Create a food item. */ create(attrs: CreateFoodItemAttributes, options?: RequestOptions): Promise; /** Update a food item. */ update(id: string, attrs: UpdateFoodItemAttributes, options?: RequestOptions): Promise; /** Delete a food item. */ delete(id: string, options?: RequestOptions): Promise; }; nutrition: { /** Get recipe nutrition by ID. */ get(id: string, options?: RequestOptions): Promise; /** Get nutrition data for a recipe by recipe ID. */ getByRecipe(recipeId: string, options?: ListOptions): Promise; /** Create recipe nutrition. */ create(attrs: CreateRecipeNutritionAttributes, options?: RequestOptions): Promise; /** Update recipe nutrition. */ update(id: string, attrs: UpdateRecipeNutritionAttributes, options?: RequestOptions): Promise; }; tags: { /** Get a tag by ID. */ get(id: string, options?: RequestOptions): Promise; /** List tags for an application. */ list(applicationId: string, options?: ListOptions): Promise; /** Create a tag. */ create(attrs: CreateTagAttributes, options?: RequestOptions): Promise; /** Update a tag. */ update(id: string, attrs: UpdateTagAttributes, options?: RequestOptions): Promise; /** Delete a tag. */ delete(id: string, options?: RequestOptions): Promise; }; recipeTags: { /** Get a recipe-tag association by ID. */ get(id: string, options?: RequestOptions): Promise; /** List recipe-tag associations for a recipe. */ listByRecipe(recipeId: string, options?: ListOptions): Promise; /** Create a recipe-tag association (upsert). */ create(attrs: CreateRecipeTagAttributes, options?: RequestOptions): Promise; /** Delete a recipe-tag association. */ delete(id: string, options?: RequestOptions): Promise; }; favorites: { /** Get a favorite by ID. */ get(id: string, options?: RequestOptions): Promise; /** List favorites for a workspace. */ list(workspaceId: string, options?: ListOptions): Promise; /** List favorites for a recipe. */ listByRecipe(recipeId: string, options?: ListOptions): Promise; /** Create a recipe favorite. */ create(attrs: CreateRecipeFavoriteAttributes, options?: RequestOptions): Promise; /** Update a recipe favorite. */ update(id: string, attrs: UpdateRecipeFavoriteAttributes, options?: RequestOptions): Promise; /** Delete a recipe favorite. */ delete(id: string, options?: RequestOptions): Promise; }; collections: { /** Get a collection by ID. */ get(id: string, options?: RequestOptions): Promise; /** List collections for a workspace with optional filters. */ list(workspaceId: string, options?: CollectionListOptions): Promise; /** Create a recipe collection. */ create(attrs: CreateRecipeCollectionAttributes, options?: RequestOptions): Promise; /** Update a recipe collection. */ update(id: string, attrs: UpdateRecipeCollectionAttributes, options?: RequestOptions): Promise; /** Delete a recipe collection. */ delete(id: string, options?: RequestOptions): Promise; recipes: { /** Get a collection recipe entry by ID. */ get(id: string, options?: RequestOptions): Promise; /** List recipes in a collection. */ list(collectionId: string, options?: ListOptions): Promise; /** Add a recipe to a collection. */ create(attrs: CreateCollectionRecipeAttributes, options?: RequestOptions): Promise; /** Update sort order of a collection recipe. */ update(id: string, attrs: UpdateCollectionRecipeAttributes, options?: RequestOptions): Promise; /** Remove a recipe from a collection. */ delete(id: string, options?: RequestOptions): Promise; }; }; enrichmentJobs: { /** Get an enrichment job by ID. */ get(id: string, options?: RequestOptions): Promise; /** List enrichment jobs for a recipe. */ list(recipeId: string, options?: ListOptions): Promise; }; mealSchedules: { /** Get a meal schedule by ID. */ get(id: string, options?: RequestOptions): Promise; /** List meal schedules for a workspace. */ list(workspaceId: string, options?: ListOptions): Promise; /** Create a meal schedule. */ create(attrs: CreateMealScheduleAttributes, options?: RequestOptions): Promise; /** Update a meal schedule. */ update(id: string, attrs: UpdateMealScheduleAttributes, options?: RequestOptions): Promise; /** Delete a meal schedule. */ delete(id: string, options?: RequestOptions): Promise; meals: { /** Get a scheduled meal by ID. */ get(id: string, options?: RequestOptions): Promise; /** List scheduled meals for a meal schedule. */ list(mealScheduleId: string, options?: ListOptions): Promise; /** Create a scheduled meal. */ create(attrs: CreateScheduledMealAttributes, options?: RequestOptions): Promise; /** Update a scheduled meal. */ update(id: string, attrs: UpdateScheduledMealAttributes, options?: RequestOptions): Promise; /** Delete a scheduled meal. */ delete(id: string, options?: RequestOptions): Promise; }; nutritionSummaries: { /** Get a nutrition summary by ID. */ get(id: string, options?: RequestOptions): Promise; /** List nutrition summaries for a meal schedule. */ list(mealScheduleId: string, options?: ListOptions): Promise; }; }; shoppingLists: { /** Get a shopping list by ID. */ get(id: string, options?: RequestOptions): Promise; /** List shopping lists for a workspace. */ list(workspaceId: string, options?: ListOptions): Promise; /** Create a shopping list. */ create(attrs: CreateShoppingListAttributes, options?: RequestOptions): Promise; /** Update a shopping list. */ update(id: string, attrs: UpdateShoppingListAttributes, options?: RequestOptions): Promise; /** Delete a shopping list. */ delete(id: string, options?: RequestOptions): Promise; /** * Generate a shopping list from a meal schedule. * Aggregates all ingredients from scheduled meals. * * @param mealScheduleId - MealSchedule UUID * @param workspaceId - Workspace UUID * @param options - Request options * @returns Generated shopping list record */ generate(mealScheduleId: string, workspaceId: string, options?: RequestOptions): Promise; /** * Regenerate an existing shopping list from its linked meal schedule. * Deletes existing items and recreates from current scheduled meals. * * @param shoppingListId - ShoppingList UUID * @param workspaceId - Workspace UUID * @param options - Request options * @returns Regenerated shopping list record */ regenerate(shoppingListId: string, workspaceId: string, options?: RequestOptions): Promise; items: { /** Get a shopping list item by ID. */ get(id: string, options?: RequestOptions): Promise; /** List items in a shopping list. */ list(shoppingListId: string, options?: ListOptions): Promise; /** Create a shopping list item. */ create(attrs: CreateShoppingListItemAttributes, options?: RequestOptions): Promise; /** Update a shopping list item. */ update(id: string, attrs: UpdateShoppingListItemAttributes, options?: RequestOptions): Promise; /** Delete a shopping list item. */ delete(id: string, options?: RequestOptions): Promise; }; }; }; //# sourceMappingURL=recipes.d.ts.map