khansama-api 1.69.0 → 1.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1515,6 +1515,24 @@ export interface IngredientAutocompleteItem {
1515
1515
  source: IngredientAutocompleteItemSource;
1516
1516
  usage_count?: IngredientAutocompleteItemUsageCount;
1517
1517
  }
1518
+ export type IngredientSubstituteOfferRatio = number | null;
1519
+ export type IngredientSubstituteOfferNote = string | null;
1520
+ /**
1521
+ * One stand-in for a recipe ingredient (PAN-556).
1522
+
1523
+ From the curated ``ingredient_substitution`` table: ``ratio`` is "1 unit
1524
+ of the original ≈ ``ratio`` units of the substitute" and the app scales it
1525
+ with the servings slider. ``in_pantry`` marks a substitute the household
1526
+ already holds (the app lists those first and badges them).
1527
+ */
1528
+ export interface IngredientSubstituteOffer {
1529
+ ingredient_id: number;
1530
+ name: string;
1531
+ ratio?: IngredientSubstituteOfferRatio;
1532
+ note?: IngredientSubstituteOfferNote;
1533
+ context?: string;
1534
+ in_pantry?: boolean;
1535
+ }
1518
1536
  export type InventoryEventKindEnum = typeof InventoryEventKindEnum[keyof typeof InventoryEventKindEnum];
1519
1537
  export declare const InventoryEventKindEnum: {
1520
1538
  readonly added: "added";
@@ -1689,6 +1707,7 @@ export type LibraryRecipeDetailImage = string | null;
1689
1707
  export type LibraryRecipeDetailTotalMinutes = number | null;
1690
1708
  export type LibraryRecipeDetailSource = RecipeSourceEnum | null;
1691
1709
  export type LibraryRecipeDetailForkedFrom = number | null;
1710
+ export type LibraryRecipeDetailLastMadeAt = string | null;
1692
1711
  /**
1693
1712
  * GET /library/recipes/{kind}/{id}: the list item plus ingredients and steps.
1694
1713
  */
@@ -1705,6 +1724,8 @@ export interface LibraryRecipeDetail {
1705
1724
  likes_count?: number;
1706
1725
  saved_count?: number;
1707
1726
  liked_by_me?: boolean;
1727
+ times_made?: number;
1728
+ last_made_at?: LibraryRecipeDetailLastMadeAt;
1708
1729
  ingredients?: CatalogRecipeIngredientOut[];
1709
1730
  steps?: string[];
1710
1731
  }
@@ -1717,6 +1738,7 @@ export type LibraryRecipeSummaryImage = string | null;
1717
1738
  export type LibraryRecipeSummaryTotalMinutes = number | null;
1718
1739
  export type LibraryRecipeSummarySource = RecipeSourceEnum | null;
1719
1740
  export type LibraryRecipeSummaryForkedFrom = number | null;
1741
+ export type LibraryRecipeSummaryLastMadeAt = string | null;
1720
1742
  /**
1721
1743
  * One recipe in the unified library (catalog or public user recipe).
1722
1744
  */
@@ -1733,6 +1755,8 @@ export interface LibraryRecipeSummary {
1733
1755
  likes_count?: number;
1734
1756
  saved_count?: number;
1735
1757
  liked_by_me?: boolean;
1758
+ times_made?: number;
1759
+ last_made_at?: LibraryRecipeSummaryLastMadeAt;
1736
1760
  }
1737
1761
  /**
1738
1762
  * !67 shelves — mutually exclusive with ``sort`` (title).
@@ -1889,6 +1913,7 @@ export declare const ListRecipeRefKind: {
1889
1913
  export type ListRecipeRefImageUrl = string | null;
1890
1914
  export type ListRecipeRefCuisine = string | null;
1891
1915
  export type ListRecipeRefServings = number | null;
1916
+ export type ListRecipeRefLastMadeAt = string | null;
1892
1917
  /**
1893
1918
  * The recipe half of a list item (user recipe or catalog recipe).
1894
1919
  */
@@ -1899,6 +1924,8 @@ export interface ListRecipeRef {
1899
1924
  image_url?: ListRecipeRefImageUrl;
1900
1925
  cuisine?: ListRecipeRefCuisine;
1901
1926
  servings?: ListRecipeRefServings;
1927
+ times_made?: number;
1928
+ last_made_at?: ListRecipeRefLastMadeAt;
1902
1929
  }
1903
1930
  /**
1904
1931
  * Every item id of the list, in the wanted order.
@@ -2746,12 +2773,25 @@ export type RecipeIngredientResponseUnit = string | null;
2746
2773
  export type RecipeIngredientResponsePantryItemId = number | null;
2747
2774
  export type RecipeIngredientResponseIngredientId = number | null;
2748
2775
  export interface RecipeIngredientResponse {
2776
+ id: number;
2749
2777
  name: string;
2750
2778
  quantity: number;
2751
2779
  unit?: RecipeIngredientResponseUnit;
2752
2780
  pantry_item_id?: RecipeIngredientResponsePantryItemId;
2753
2781
  ingredient_id?: RecipeIngredientResponseIngredientId;
2754
2782
  }
2783
+ export type RecipeIngredientSubstitutionsIngredientId = number | null;
2784
+ /**
2785
+ * The substitutes offered for one recipe-ingredient row (PAN-556).
2786
+
2787
+ Rows without any offer are absent from the endpoint's response; the row is
2788
+ identified by ``ingredient_row_id`` (``RecipeIngredientResponse.id``).
2789
+ */
2790
+ export interface RecipeIngredientSubstitutions {
2791
+ ingredient_row_id: number;
2792
+ ingredient_id?: RecipeIngredientSubstitutionsIngredientId;
2793
+ substitutes?: IngredientSubstituteOffer[];
2794
+ }
2755
2795
  export type RecipeMacrosResponseNote = string | null;
2756
2796
  /**
2757
2797
  * Estimated per-serving macros for one recipe (``GET /recipes/{id}/macros``).
@@ -2784,6 +2824,30 @@ export declare const RecipeModerationStatusEnum: {
2784
2824
  readonly pending_review: "pending_review";
2785
2825
  readonly hidden: "hidden";
2786
2826
  };
2827
+ export type RecipeNoteResponseText = string | null;
2828
+ export type RecipeNoteResponseCreatedAt = string | null;
2829
+ export type RecipeNoteResponseUpdatedAt = string | null;
2830
+ /**
2831
+ * My private note on one recipe (GET /recipe-notes/{kind}/{recipe_id}).
2832
+
2833
+ With no note saved yet every field is ``None``, so the app does not need
2834
+ to special-case a 404 for a recipe that simply has no note.
2835
+ */
2836
+ export interface RecipeNoteResponse {
2837
+ text?: RecipeNoteResponseText;
2838
+ created_at?: RecipeNoteResponseCreatedAt;
2839
+ updated_at?: RecipeNoteResponseUpdatedAt;
2840
+ }
2841
+ /**
2842
+ * PUT /recipe-notes/{kind}/{recipe_id}: create or replace my private note.
2843
+ */
2844
+ export interface RecipeNoteUpsert {
2845
+ /**
2846
+ * @minLength 1
2847
+ * @maxLength 500
2848
+ */
2849
+ text: string;
2850
+ }
2787
2851
  export type RecipePinnedNoteResponseAuthorName = string | null;
2788
2852
  /**
2789
2853
  * The pinned note in a recipe detail response (visible to anyone who
@@ -2835,6 +2899,8 @@ export type RecipeResponseModerationStatus = RecipeModerationStatusEnum | null;
2835
2899
  export type RecipeResponseModerationReason = string | null;
2836
2900
  export type RecipeResponsePinnedNote = RecipePinnedNoteResponse | null;
2837
2901
  export type RecipeResponseProfileFit = ProfileFit | null;
2902
+ export type RecipeResponseMyNote = string | null;
2903
+ export type RecipeResponseLastMadeAt = string | null;
2838
2904
  export interface RecipeResponse {
2839
2905
  id: number;
2840
2906
  name: string;
@@ -2859,6 +2925,9 @@ export interface RecipeResponse {
2859
2925
  pinned_note?: RecipeResponsePinnedNote;
2860
2926
  source_images?: RecipeSourceImageResponse[];
2861
2927
  profile_fit?: RecipeResponseProfileFit;
2928
+ my_note?: RecipeResponseMyNote;
2929
+ times_made?: number;
2930
+ last_made_at?: RecipeResponseLastMadeAt;
2862
2931
  }
2863
2932
  export type RecipeSourceEnum = typeof RecipeSourceEnum[keyof typeof RecipeSourceEnum];
2864
2933
  export declare const RecipeSourceEnum: {
@@ -5795,6 +5864,33 @@ export declare const useDeleteRecipeRecipesRecipeIdDelete: <TError = AxiosError<
5795
5864
  }) => UseMutationResult<Awaited<ReturnType<typeof deleteRecipeRecipesRecipeIdDelete>>, TError, {
5796
5865
  recipeId: number;
5797
5866
  }, TContext>;
5867
+ /**
5868
+ * Read-only stand-ins for the recipe's ingredients (PAN-556).
5869
+
5870
+ One entry per ingredient row that has substitutes in the curated table:
5871
+ pantry-owned ones first ("in your pantry"), allergen- and diet-safe only
5872
+ (PAN-459). No AI, and the recipe is never edited.
5873
+ * @summary Get Recipe Substitutions
5874
+ */
5875
+ export declare const getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet: (recipeId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<RecipeIngredientSubstitutions[]>>;
5876
+ export declare const getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryKey: (recipeId?: number) => readonly ["/recipes/undefined/substitutions" | `/recipes/${number}/substitutions`];
5877
+ export declare const getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryOptions: <TData = Awaited<ReturnType<typeof getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet>>, TError = AxiosError<HTTPValidationError>>(recipeId: number, options?: {
5878
+ query?: UseQueryOptions<Awaited<ReturnType<typeof getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet>>, TError, TData>;
5879
+ axios?: AxiosRequestConfig;
5880
+ }) => UseQueryOptions<Awaited<ReturnType<typeof getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet>>, TError, TData> & {
5881
+ queryKey: QueryKey;
5882
+ };
5883
+ export type GetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryResult = NonNullable<Awaited<ReturnType<typeof getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet>>>;
5884
+ export type GetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryError = AxiosError<HTTPValidationError>;
5885
+ /**
5886
+ * @summary Get Recipe Substitutions
5887
+ */
5888
+ export declare function useGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet<TData = Awaited<ReturnType<typeof getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet>>, TError = AxiosError<HTTPValidationError>>(recipeId: number, options?: {
5889
+ query?: UseQueryOptions<Awaited<ReturnType<typeof getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet>>, TError, TData>;
5890
+ axios?: AxiosRequestConfig;
5891
+ }): UseQueryResult<TData, TError> & {
5892
+ queryKey: QueryKey;
5893
+ };
5798
5894
  /**
5799
5895
  * Estimated per-serving macros for the recipe (PAN-450), from the USDA
5800
5896
  FoodData Central cache. Unmatched ingredients (no USDA link, or a unit
@@ -5916,6 +6012,94 @@ export declare const useUndoCookCookEventsCookIdUndoPost: <TError = AxiosError<H
5916
6012
  }) => UseMutationResult<Awaited<ReturnType<typeof undoCookCookEventsCookIdUndoPost>>, TError, {
5917
6013
  cookId: string;
5918
6014
  }, TContext>;
6015
+ /**
6016
+ * My note on a recipe — every field ``None`` while nothing is saved.
6017
+ * @summary Get Recipe Note
6018
+ */
6019
+ export declare const getRecipeNoteRecipeNotesKindRecipeIdGet: (kind: "user" | "catalog", recipeId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<RecipeNoteResponse>>;
6020
+ export declare const getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryKey: (kind?: "user" | "catalog", recipeId?: number) => readonly ["/recipe-notes/undefined/undefined" | `/recipe-notes/undefined/${number}` | "/recipe-notes/user/undefined" | `/recipe-notes/user/${number}` | "/recipe-notes/catalog/undefined" | `/recipe-notes/catalog/${number}`];
6021
+ export declare const getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryOptions: <TData = Awaited<ReturnType<typeof getRecipeNoteRecipeNotesKindRecipeIdGet>>, TError = AxiosError<HTTPValidationError>>(kind: "user" | "catalog", recipeId: number, options?: {
6022
+ query?: UseQueryOptions<Awaited<ReturnType<typeof getRecipeNoteRecipeNotesKindRecipeIdGet>>, TError, TData>;
6023
+ axios?: AxiosRequestConfig;
6024
+ }) => UseQueryOptions<Awaited<ReturnType<typeof getRecipeNoteRecipeNotesKindRecipeIdGet>>, TError, TData> & {
6025
+ queryKey: QueryKey;
6026
+ };
6027
+ export type GetRecipeNoteRecipeNotesKindRecipeIdGetQueryResult = NonNullable<Awaited<ReturnType<typeof getRecipeNoteRecipeNotesKindRecipeIdGet>>>;
6028
+ export type GetRecipeNoteRecipeNotesKindRecipeIdGetQueryError = AxiosError<HTTPValidationError>;
6029
+ /**
6030
+ * @summary Get Recipe Note
6031
+ */
6032
+ export declare function useGetRecipeNoteRecipeNotesKindRecipeIdGet<TData = Awaited<ReturnType<typeof getRecipeNoteRecipeNotesKindRecipeIdGet>>, TError = AxiosError<HTTPValidationError>>(kind: 'user' | 'catalog', recipeId: number, options?: {
6033
+ query?: UseQueryOptions<Awaited<ReturnType<typeof getRecipeNoteRecipeNotesKindRecipeIdGet>>, TError, TData>;
6034
+ axios?: AxiosRequestConfig;
6035
+ }): UseQueryResult<TData, TError> & {
6036
+ queryKey: QueryKey;
6037
+ };
6038
+ /**
6039
+ * Create or replace my note on a recipe.
6040
+ * @summary Save Recipe Note
6041
+ */
6042
+ export declare const saveRecipeNoteRecipeNotesKindRecipeIdPut: (kind: "user" | "catalog", recipeId: number, recipeNoteUpsert: RecipeNoteUpsert, options?: AxiosRequestConfig) => Promise<AxiosResponse<RecipeNoteResponse>>;
6043
+ export declare const getSaveRecipeNoteRecipeNotesKindRecipeIdPutMutationOptions: <TError = AxiosError<HTTPValidationError>, TContext = unknown>(options?: {
6044
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof saveRecipeNoteRecipeNotesKindRecipeIdPut>>, TError, {
6045
+ kind: "user" | "catalog";
6046
+ recipeId: number;
6047
+ data: RecipeNoteUpsert;
6048
+ }, TContext>;
6049
+ axios?: AxiosRequestConfig;
6050
+ }) => UseMutationOptions<Awaited<ReturnType<typeof saveRecipeNoteRecipeNotesKindRecipeIdPut>>, TError, {
6051
+ kind: "user" | "catalog";
6052
+ recipeId: number;
6053
+ data: RecipeNoteUpsert;
6054
+ }, TContext>;
6055
+ export type SaveRecipeNoteRecipeNotesKindRecipeIdPutMutationResult = NonNullable<Awaited<ReturnType<typeof saveRecipeNoteRecipeNotesKindRecipeIdPut>>>;
6056
+ export type SaveRecipeNoteRecipeNotesKindRecipeIdPutMutationBody = RecipeNoteUpsert;
6057
+ export type SaveRecipeNoteRecipeNotesKindRecipeIdPutMutationError = AxiosError<HTTPValidationError>;
6058
+ /**
6059
+ * @summary Save Recipe Note
6060
+ */
6061
+ export declare const useSaveRecipeNoteRecipeNotesKindRecipeIdPut: <TError = AxiosError<HTTPValidationError>, TContext = unknown>(options?: {
6062
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof saveRecipeNoteRecipeNotesKindRecipeIdPut>>, TError, {
6063
+ kind: "user" | "catalog";
6064
+ recipeId: number;
6065
+ data: RecipeNoteUpsert;
6066
+ }, TContext>;
6067
+ axios?: AxiosRequestConfig;
6068
+ }) => UseMutationResult<Awaited<ReturnType<typeof saveRecipeNoteRecipeNotesKindRecipeIdPut>>, TError, {
6069
+ kind: "user" | "catalog";
6070
+ recipeId: number;
6071
+ data: RecipeNoteUpsert;
6072
+ }, TContext>;
6073
+ /**
6074
+ * Clear my note — a no-op (empty response) when nothing is saved.
6075
+ * @summary Clear Recipe Note
6076
+ */
6077
+ export declare const clearRecipeNoteRecipeNotesKindRecipeIdDelete: (kind: "user" | "catalog", recipeId: number, options?: AxiosRequestConfig) => Promise<AxiosResponse<RecipeNoteResponse>>;
6078
+ export declare const getClearRecipeNoteRecipeNotesKindRecipeIdDeleteMutationOptions: <TError = AxiosError<HTTPValidationError>, TContext = unknown>(options?: {
6079
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof clearRecipeNoteRecipeNotesKindRecipeIdDelete>>, TError, {
6080
+ kind: "user" | "catalog";
6081
+ recipeId: number;
6082
+ }, TContext>;
6083
+ axios?: AxiosRequestConfig;
6084
+ }) => UseMutationOptions<Awaited<ReturnType<typeof clearRecipeNoteRecipeNotesKindRecipeIdDelete>>, TError, {
6085
+ kind: "user" | "catalog";
6086
+ recipeId: number;
6087
+ }, TContext>;
6088
+ export type ClearRecipeNoteRecipeNotesKindRecipeIdDeleteMutationResult = NonNullable<Awaited<ReturnType<typeof clearRecipeNoteRecipeNotesKindRecipeIdDelete>>>;
6089
+ export type ClearRecipeNoteRecipeNotesKindRecipeIdDeleteMutationError = AxiosError<HTTPValidationError>;
6090
+ /**
6091
+ * @summary Clear Recipe Note
6092
+ */
6093
+ export declare const useClearRecipeNoteRecipeNotesKindRecipeIdDelete: <TError = AxiosError<HTTPValidationError>, TContext = unknown>(options?: {
6094
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof clearRecipeNoteRecipeNotesKindRecipeIdDelete>>, TError, {
6095
+ kind: "user" | "catalog";
6096
+ recipeId: number;
6097
+ }, TContext>;
6098
+ axios?: AxiosRequestConfig;
6099
+ }) => UseMutationResult<Awaited<ReturnType<typeof clearRecipeNoteRecipeNotesKindRecipeIdDelete>>, TError, {
6100
+ kind: "user" | "catalog";
6101
+ recipeId: number;
6102
+ }, TContext>;
5919
6103
  /**
5920
6104
  * List/search canonical ingredients (autocomplete source).
5921
6105
  * @summary List Ingredients