khansama-api 1.69.1 → 1.71.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.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.69.1
5
+ * OpenAPI spec version: 1.71.0
6
6
  */
7
7
  import { useMutation, useQuery } from '@tanstack/react-query';
8
8
  import axios from 'axios';
@@ -783,6 +783,9 @@ export const createPantryItemPantryItemsPost = (bodyCreatePantryItemPantryItemsP
783
783
  if (bodyCreatePantryItemPantryItemsPost.ingredient_id !== undefined && bodyCreatePantryItemPantryItemsPost.ingredient_id !== null) {
784
784
  formData.append(`ingredient_id`, bodyCreatePantryItemPantryItemsPost.ingredient_id.toString());
785
785
  }
786
+ if (bodyCreatePantryItemPantryItemsPost.is_staple !== undefined) {
787
+ formData.append(`is_staple`, bodyCreatePantryItemPantryItemsPost.is_staple.toString());
788
+ }
786
789
  if (bodyCreatePantryItemPantryItemsPost.image !== undefined && bodyCreatePantryItemPantryItemsPost.image !== null) {
787
790
  formData.append(`image`, bodyCreatePantryItemPantryItemsPost.image);
788
791
  }
@@ -971,6 +974,35 @@ export function useGetQuickCheckItemsPantryItemsQuickCheckGet(options) {
971
974
  query.queryKey = queryOptions.queryKey;
972
975
  return query;
973
976
  }
977
+ /**
978
+ * The household's staples that need restocking (PAN-565): used up,
979
+ marked finished (low/gone level), or under the household's per-item
980
+ minimum. Each one offers a one-tap add to the shopping list.
981
+ * @summary Get Running Low Staples
982
+ */
983
+ export const getRunningLowStaplesPantryItemsStaplesRunningLowGet = (options) => {
984
+ return axios.get(`/pantry-items/staples/running-low`, options);
985
+ };
986
+ export const getGetRunningLowStaplesPantryItemsStaplesRunningLowGetQueryKey = () => {
987
+ return [
988
+ `/pantry-items/staples/running-low`
989
+ ];
990
+ };
991
+ export const getGetRunningLowStaplesPantryItemsStaplesRunningLowGetQueryOptions = (options) => {
992
+ const { query: queryOptions, axios: axiosOptions } = options ?? {};
993
+ const queryKey = queryOptions?.queryKey ?? getGetRunningLowStaplesPantryItemsStaplesRunningLowGetQueryKey();
994
+ const queryFn = ({ signal }) => getRunningLowStaplesPantryItemsStaplesRunningLowGet({ signal, ...axiosOptions });
995
+ return { queryKey, queryFn, ...queryOptions };
996
+ };
997
+ /**
998
+ * @summary Get Running Low Staples
999
+ */
1000
+ export function useGetRunningLowStaplesPantryItemsStaplesRunningLowGet(options) {
1001
+ const queryOptions = getGetRunningLowStaplesPantryItemsStaplesRunningLowGetQueryOptions(options);
1002
+ const query = useQuery(queryOptions);
1003
+ query.queryKey = queryOptions.queryKey;
1004
+ return query;
1005
+ }
974
1006
  /**
975
1007
  * @summary Get Inventory Events
976
1008
  */
@@ -1067,6 +1099,9 @@ export const updatePantryItemPantryItemsItemIdPut = (itemId, bodyUpdatePantryIte
1067
1099
  if (bodyUpdatePantryItemPantryItemsItemIdPut.clear_icon_tint !== undefined && bodyUpdatePantryItemPantryItemsItemIdPut.clear_icon_tint !== null) {
1068
1100
  formData.append(`clear_icon_tint`, bodyUpdatePantryItemPantryItemsItemIdPut.clear_icon_tint);
1069
1101
  }
1102
+ if (bodyUpdatePantryItemPantryItemsItemIdPut.is_staple !== undefined && bodyUpdatePantryItemPantryItemsItemIdPut.is_staple !== null) {
1103
+ formData.append(`is_staple`, bodyUpdatePantryItemPantryItemsItemIdPut.is_staple.toString());
1104
+ }
1070
1105
  if (bodyUpdatePantryItemPantryItemsItemIdPut.image !== undefined && bodyUpdatePantryItemPantryItemsItemIdPut.image !== null) {
1071
1106
  formData.append(`image`, bodyUpdatePantryItemPantryItemsItemIdPut.image);
1072
1107
  }
@@ -1231,6 +1266,36 @@ export const useUndoLevelLowStockPantryItemsItemIdLevelUndoPost = (options) => {
1231
1266
  const mutationOptions = getUndoLevelLowStockPantryItemsItemIdLevelUndoPostMutationOptions(options);
1232
1267
  return useMutation(mutationOptions);
1233
1268
  };
1269
+ /**
1270
+ * The Running low strip's one tap (PAN-565): put the staple on the
1271
+ household's shopping list, deduplicated — a tap never duplicates what is
1272
+ already waiting there. Deliberately not automatic: staples are excluded
1273
+ from the level change's auto-add.
1274
+ * @summary Add Running Low Staple
1275
+ */
1276
+ export const addRunningLowStaplePantryItemsItemIdAddToShoppingListPost = (itemId, options) => {
1277
+ return axios.post(`/pantry-items/${itemId}/add-to-shopping-list`, undefined, options);
1278
+ };
1279
+ export const getAddRunningLowStaplePantryItemsItemIdAddToShoppingListPostMutationOptions = (options) => {
1280
+ const mutationKey = ['addRunningLowStaplePantryItemsItemIdAddToShoppingListPost'];
1281
+ const { mutation: mutationOptions, axios: axiosOptions } = options ?
1282
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
1283
+ options
1284
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
1285
+ : { mutation: { mutationKey, }, axios: undefined };
1286
+ const mutationFn = (props) => {
1287
+ const { itemId } = props ?? {};
1288
+ return addRunningLowStaplePantryItemsItemIdAddToShoppingListPost(itemId, axiosOptions);
1289
+ };
1290
+ return { mutationFn, ...mutationOptions };
1291
+ };
1292
+ /**
1293
+ * @summary Add Running Low Staple
1294
+ */
1295
+ export const useAddRunningLowStaplePantryItemsItemIdAddToShoppingListPost = (options) => {
1296
+ const mutationOptions = getAddRunningLowStaplePantryItemsItemIdAddToShoppingListPostMutationOptions(options);
1297
+ return useMutation(mutationOptions);
1298
+ };
1234
1299
  /**
1235
1300
  * Confirm an item is still there; optionally correct its expiry and level.
1236
1301
  * @summary Verify Pantry Item
@@ -2520,6 +2585,37 @@ export const useDeleteRecipeRecipesRecipeIdDelete = (options) => {
2520
2585
  const mutationOptions = getDeleteRecipeRecipesRecipeIdDeleteMutationOptions(options);
2521
2586
  return useMutation(mutationOptions);
2522
2587
  };
2588
+ /**
2589
+ * Read-only stand-ins for the recipe's ingredients (PAN-556).
2590
+
2591
+ One entry per ingredient row that has substitutes in the curated table:
2592
+ pantry-owned ones first ("in your pantry"), allergen- and diet-safe only
2593
+ (PAN-459). No AI, and the recipe is never edited.
2594
+ * @summary Get Recipe Substitutions
2595
+ */
2596
+ export const getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet = (recipeId, options) => {
2597
+ return axios.get(`/recipes/${recipeId}/substitutions`, options);
2598
+ };
2599
+ export const getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryKey = (recipeId) => {
2600
+ return [
2601
+ `/recipes/${recipeId}/substitutions`
2602
+ ];
2603
+ };
2604
+ export const getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryOptions = (recipeId, options) => {
2605
+ const { query: queryOptions, axios: axiosOptions } = options ?? {};
2606
+ const queryKey = queryOptions?.queryKey ?? getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryKey(recipeId);
2607
+ const queryFn = ({ signal }) => getRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet(recipeId, { signal, ...axiosOptions });
2608
+ return { queryKey, queryFn, enabled: !!(recipeId), ...queryOptions };
2609
+ };
2610
+ /**
2611
+ * @summary Get Recipe Substitutions
2612
+ */
2613
+ export function useGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGet(recipeId, options) {
2614
+ const queryOptions = getGetRecipeSubstitutionsRecipesRecipeIdSubstitutionsGetQueryOptions(recipeId, options);
2615
+ const query = useQuery(queryOptions);
2616
+ query.queryKey = queryOptions.queryKey;
2617
+ return query;
2618
+ }
2523
2619
  /**
2524
2620
  * Estimated per-serving macros for the recipe (PAN-450), from the USDA
2525
2621
  FoodData Central cache. Unmatched ingredients (no USDA link, or a unit
@@ -2640,6 +2736,87 @@ export const useUndoCookCookEventsCookIdUndoPost = (options) => {
2640
2736
  const mutationOptions = getUndoCookCookEventsCookIdUndoPostMutationOptions(options);
2641
2737
  return useMutation(mutationOptions);
2642
2738
  };
2739
+ /**
2740
+ * My note on a recipe — every field ``None`` while nothing is saved.
2741
+ * @summary Get Recipe Note
2742
+ */
2743
+ export const getRecipeNoteRecipeNotesKindRecipeIdGet = (kind, recipeId, options) => {
2744
+ return axios.get(`/recipe-notes/${kind}/${recipeId}`, options);
2745
+ };
2746
+ export const getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryKey = (kind, recipeId) => {
2747
+ return [
2748
+ `/recipe-notes/${kind}/${recipeId}`
2749
+ ];
2750
+ };
2751
+ export const getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryOptions = (kind, recipeId, options) => {
2752
+ const { query: queryOptions, axios: axiosOptions } = options ?? {};
2753
+ const queryKey = queryOptions?.queryKey ?? getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryKey(kind, recipeId);
2754
+ const queryFn = ({ signal }) => getRecipeNoteRecipeNotesKindRecipeIdGet(kind, recipeId, { signal, ...axiosOptions });
2755
+ return { queryKey, queryFn, enabled: !!(kind && recipeId), ...queryOptions };
2756
+ };
2757
+ /**
2758
+ * @summary Get Recipe Note
2759
+ */
2760
+ export function useGetRecipeNoteRecipeNotesKindRecipeIdGet(kind, recipeId, options) {
2761
+ const queryOptions = getGetRecipeNoteRecipeNotesKindRecipeIdGetQueryOptions(kind, recipeId, options);
2762
+ const query = useQuery(queryOptions);
2763
+ query.queryKey = queryOptions.queryKey;
2764
+ return query;
2765
+ }
2766
+ /**
2767
+ * Create or replace my note on a recipe.
2768
+ * @summary Save Recipe Note
2769
+ */
2770
+ export const saveRecipeNoteRecipeNotesKindRecipeIdPut = (kind, recipeId, recipeNoteUpsert, options) => {
2771
+ return axios.put(`/recipe-notes/${kind}/${recipeId}`, recipeNoteUpsert, options);
2772
+ };
2773
+ export const getSaveRecipeNoteRecipeNotesKindRecipeIdPutMutationOptions = (options) => {
2774
+ const mutationKey = ['saveRecipeNoteRecipeNotesKindRecipeIdPut'];
2775
+ const { mutation: mutationOptions, axios: axiosOptions } = options ?
2776
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
2777
+ options
2778
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2779
+ : { mutation: { mutationKey, }, axios: undefined };
2780
+ const mutationFn = (props) => {
2781
+ const { kind, recipeId, data } = props ?? {};
2782
+ return saveRecipeNoteRecipeNotesKindRecipeIdPut(kind, recipeId, data, axiosOptions);
2783
+ };
2784
+ return { mutationFn, ...mutationOptions };
2785
+ };
2786
+ /**
2787
+ * @summary Save Recipe Note
2788
+ */
2789
+ export const useSaveRecipeNoteRecipeNotesKindRecipeIdPut = (options) => {
2790
+ const mutationOptions = getSaveRecipeNoteRecipeNotesKindRecipeIdPutMutationOptions(options);
2791
+ return useMutation(mutationOptions);
2792
+ };
2793
+ /**
2794
+ * Clear my note — a no-op (empty response) when nothing is saved.
2795
+ * @summary Clear Recipe Note
2796
+ */
2797
+ export const clearRecipeNoteRecipeNotesKindRecipeIdDelete = (kind, recipeId, options) => {
2798
+ return axios.delete(`/recipe-notes/${kind}/${recipeId}`, options);
2799
+ };
2800
+ export const getClearRecipeNoteRecipeNotesKindRecipeIdDeleteMutationOptions = (options) => {
2801
+ const mutationKey = ['clearRecipeNoteRecipeNotesKindRecipeIdDelete'];
2802
+ const { mutation: mutationOptions, axios: axiosOptions } = options ?
2803
+ options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
2804
+ options
2805
+ : { ...options, mutation: { ...options.mutation, mutationKey } }
2806
+ : { mutation: { mutationKey, }, axios: undefined };
2807
+ const mutationFn = (props) => {
2808
+ const { kind, recipeId } = props ?? {};
2809
+ return clearRecipeNoteRecipeNotesKindRecipeIdDelete(kind, recipeId, axiosOptions);
2810
+ };
2811
+ return { mutationFn, ...mutationOptions };
2812
+ };
2813
+ /**
2814
+ * @summary Clear Recipe Note
2815
+ */
2816
+ export const useClearRecipeNoteRecipeNotesKindRecipeIdDelete = (options) => {
2817
+ const mutationOptions = getClearRecipeNoteRecipeNotesKindRecipeIdDeleteMutationOptions(options);
2818
+ return useMutation(mutationOptions);
2819
+ };
2643
2820
  /**
2644
2821
  * List/search canonical ingredients (autocomplete source).
2645
2822
  * @summary List Ingredients
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "khansama-api",
3
- "version": "1.69.1",
3
+ "version": "1.71.0",
4
4
  "description": "Auto-generated TypeScript client for Khansama API — TanStack Query hooks + Axios",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",