khansama-api 1.69.1 → 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 +184 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +113 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Generated by orval v7.13.2 🍺
|
|
3
3
|
* Do not edit manually.
|
|
4
4
|
* Recipe Management API
|
|
5
|
-
* OpenAPI spec version: 1.
|
|
5
|
+
* OpenAPI spec version: 1.70.0
|
|
6
6
|
*/
|
|
7
7
|
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
8
8
|
import axios from 'axios';
|
|
@@ -2520,6 +2520,37 @@ export const useDeleteRecipeRecipesRecipeIdDelete = (options) => {
|
|
|
2520
2520
|
const mutationOptions = getDeleteRecipeRecipesRecipeIdDeleteMutationOptions(options);
|
|
2521
2521
|
return useMutation(mutationOptions);
|
|
2522
2522
|
};
|
|
2523
|
+
/**
|
|
2524
|
+
* Read-only stand-ins for the recipe's ingredients (PAN-556).
|
|
2525
|
+
|
|
2526
|
+
One entry per ingredient row that has substitutes in the curated table:
|
|
2527
|
+
pantry-owned ones first ("in your pantry"), allergen- and diet-safe only
|
|
2528
|
+
(PAN-459). No AI, and the recipe is never edited.
|
|
2529
|
+
* @summary Get Recipe Substitutions
|
|
2530
|
+
*/
|
|
2531
|
+
export const getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet = (recipeId, options) => {
|
|
2532
|
+
return axios.get(`/recipes/${recipeId}/substitutions`, options);
|
|
2533
|
+
};
|
|
2534
|
+
export const getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryKey = (recipeId) => {
|
|
2535
|
+
return [
|
|
2536
|
+
`/recipes/${recipeId}/substitutions`
|
|
2537
|
+
];
|
|
2538
|
+
};
|
|
2539
|
+
export const getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryOptions = (recipeId, options) => {
|
|
2540
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
2541
|
+
const queryKey = queryOptions?.queryKey ?? getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryKey(recipeId);
|
|
2542
|
+
const queryFn = ({ signal }) => getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet(recipeId, { signal, ...axiosOptions });
|
|
2543
|
+
return { queryKey, queryFn, enabled: !!(recipeId), ...queryOptions };
|
|
2544
|
+
};
|
|
2545
|
+
/**
|
|
2546
|
+
* @summary Get Recipe Substitutions
|
|
2547
|
+
*/
|
|
2548
|
+
export function useGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet(recipeId, options) {
|
|
2549
|
+
const queryOptions = getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryOptions(recipeId, options);
|
|
2550
|
+
const query = useQuery(queryOptions);
|
|
2551
|
+
query.queryKey = queryOptions.queryKey;
|
|
2552
|
+
return query;
|
|
2553
|
+
}
|
|
2523
2554
|
/**
|
|
2524
2555
|
* Estimated per-serving macros for the recipe (PAN-450), from the USDA
|
|
2525
2556
|
FoodData Central cache. Unmatched ingredients (no USDA link, or a unit
|
|
@@ -2640,6 +2671,87 @@ export const useUndoCookCookEventsCookIdUndoPost = (options) => {
|
|
|
2640
2671
|
const mutationOptions = getUndoCookCookEventsCookIdUndoPostMutationOptions(options);
|
|
2641
2672
|
return useMutation(mutationOptions);
|
|
2642
2673
|
};
|
|
2674
|
+
/**
|
|
2675
|
+
* My note on a recipe — every field ``None`` while nothing is saved.
|
|
2676
|
+
* @summary Get Recipe Note
|
|
2677
|
+
*/
|
|
2678
|
+
export const getRecipeNoteRecipeNotesKindRecipeIdGet = (kind, recipeId, options) => {
|
|
2679
|
+
return axios.get(`/recipe-notes/${kind}/${recipeId}`, options);
|
|
2680
|
+
};
|
|
2681
|
+
export const getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryKey = (kind, recipeId) => {
|
|
2682
|
+
return [
|
|
2683
|
+
`/recipe-notes/${kind}/${recipeId}`
|
|
2684
|
+
];
|
|
2685
|
+
};
|
|
2686
|
+
export const getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryOptions = (kind, recipeId, options) => {
|
|
2687
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
2688
|
+
const queryKey = queryOptions?.queryKey ?? getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryKey(kind, recipeId);
|
|
2689
|
+
const queryFn = ({ signal }) => getRecipeNoteRecipeNotesKindRecipeIdGet(kind, recipeId, { signal, ...axiosOptions });
|
|
2690
|
+
return { queryKey, queryFn, enabled: !!(kind && recipeId), ...queryOptions };
|
|
2691
|
+
};
|
|
2692
|
+
/**
|
|
2693
|
+
* @summary Get Recipe Note
|
|
2694
|
+
*/
|
|
2695
|
+
export function useGetRecipeNoteRecipeNotesKindRecipeIdGet(kind, recipeId, options) {
|
|
2696
|
+
const queryOptions = getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryOptions(kind, recipeId, options);
|
|
2697
|
+
const query = useQuery(queryOptions);
|
|
2698
|
+
query.queryKey = queryOptions.queryKey;
|
|
2699
|
+
return query;
|
|
2700
|
+
}
|
|
2701
|
+
/**
|
|
2702
|
+
* Create or replace my note on a recipe.
|
|
2703
|
+
* @summary Save Recipe Note
|
|
2704
|
+
*/
|
|
2705
|
+
export const saveRecipeNoteRecipeNotesKindRecipeIdPut = (kind, recipeId, recipeNoteUpsert, options) => {
|
|
2706
|
+
return axios.put(`/recipe-notes/${kind}/${recipeId}`, recipeNoteUpsert, options);
|
|
2707
|
+
};
|
|
2708
|
+
export const getSaveRecipeNoteRecipeNotesKindRecipeIdPutMutationOptions = (options) => {
|
|
2709
|
+
const mutationKey = ['saveRecipeNoteRecipeNotesKindRecipeIdPut'];
|
|
2710
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2711
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2712
|
+
options
|
|
2713
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2714
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2715
|
+
const mutationFn = (props) => {
|
|
2716
|
+
const { kind, recipeId, data } = props ?? {};
|
|
2717
|
+
return saveRecipeNoteRecipeNotesKindRecipeIdPut(kind, recipeId, data, axiosOptions);
|
|
2718
|
+
};
|
|
2719
|
+
return { mutationFn, ...mutationOptions };
|
|
2720
|
+
};
|
|
2721
|
+
/**
|
|
2722
|
+
* @summary Save Recipe Note
|
|
2723
|
+
*/
|
|
2724
|
+
export const useSaveRecipeNoteRecipeNotesKindRecipeIdPut = (options) => {
|
|
2725
|
+
const mutationOptions = getSaveRecipeNoteRecipeNotesKindRecipeIdPutMutationOptions(options);
|
|
2726
|
+
return useMutation(mutationOptions);
|
|
2727
|
+
};
|
|
2728
|
+
/**
|
|
2729
|
+
* Clear my note — a no-op (empty response) when nothing is saved.
|
|
2730
|
+
* @summary Clear Recipe Note
|
|
2731
|
+
*/
|
|
2732
|
+
export const clearRecipeNoteRecipeNotesKindRecipeIdDelete = (kind, recipeId, options) => {
|
|
2733
|
+
return axios.delete(`/recipe-notes/${kind}/${recipeId}`, options);
|
|
2734
|
+
};
|
|
2735
|
+
export const getClearRecipeNoteRecipeNotesKindRecipeIdDeleteMutationOptions = (options) => {
|
|
2736
|
+
const mutationKey = ['clearRecipeNoteRecipeNotesKindRecipeIdDelete'];
|
|
2737
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2738
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2739
|
+
options
|
|
2740
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2741
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2742
|
+
const mutationFn = (props) => {
|
|
2743
|
+
const { kind, recipeId } = props ?? {};
|
|
2744
|
+
return clearRecipeNoteRecipeNotesKindRecipeIdDelete(kind, recipeId, axiosOptions);
|
|
2745
|
+
};
|
|
2746
|
+
return { mutationFn, ...mutationOptions };
|
|
2747
|
+
};
|
|
2748
|
+
/**
|
|
2749
|
+
* @summary Clear Recipe Note
|
|
2750
|
+
*/
|
|
2751
|
+
export const useClearRecipeNoteRecipeNotesKindRecipeIdDelete = (options) => {
|
|
2752
|
+
const mutationOptions = getClearRecipeNoteRecipeNotesKindRecipeIdDeleteMutationOptions(options);
|
|
2753
|
+
return useMutation(mutationOptions);
|
|
2754
|
+
};
|
|
2643
2755
|
/**
|
|
2644
2756
|
* List/search canonical ingredients (autocomplete source).
|
|
2645
2757
|
* @summary List Ingredients
|