@pantry-pilot/pantry-pilot-api 1.0.2 โ 1.3.2
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 +3429 -126
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2233 -136
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,11 +2,24 @@
|
|
|
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.3.2
|
|
6
6
|
*/
|
|
7
7
|
import { useMutation, useQuery } from '@tanstack/react-query';
|
|
8
8
|
import axios from 'axios';
|
|
9
9
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
10
|
+
export const BulkMode = {
|
|
11
|
+
best_effort: 'best_effort',
|
|
12
|
+
atomic: 'atomic',
|
|
13
|
+
};
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
15
|
+
export const CatalogSourceEnum = {
|
|
16
|
+
curated: 'curated',
|
|
17
|
+
themealdb: 'themealdb',
|
|
18
|
+
recipenlg: 'recipenlg',
|
|
19
|
+
user: 'user',
|
|
20
|
+
generated: 'generated',
|
|
21
|
+
};
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
10
23
|
export const CuisineTypeEnum = {
|
|
11
24
|
italian: 'italian',
|
|
12
25
|
chinese: 'chinese',
|
|
@@ -20,6 +33,48 @@ export const CuisineTypeEnum = {
|
|
|
20
33
|
other: 'other',
|
|
21
34
|
};
|
|
22
35
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
36
|
+
export const DiscoverySortEnum = {
|
|
37
|
+
recent: 'recent',
|
|
38
|
+
top_rated: 'top_rated',
|
|
39
|
+
most_favorited: 'most_favorited',
|
|
40
|
+
};
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
42
|
+
export const HouseholdRoleEnum = {
|
|
43
|
+
owner: 'owner',
|
|
44
|
+
member: 'member',
|
|
45
|
+
};
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
47
|
+
export const IngredientAutocompleteItemMatch = {
|
|
48
|
+
prefix: 'prefix',
|
|
49
|
+
alias: 'alias',
|
|
50
|
+
fuzzy: 'fuzzy',
|
|
51
|
+
history: 'history',
|
|
52
|
+
};
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
54
|
+
export const IngredientAutocompleteItemSource = {
|
|
55
|
+
catalog: 'catalog',
|
|
56
|
+
history: 'history',
|
|
57
|
+
popular: 'popular',
|
|
58
|
+
};
|
|
59
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
60
|
+
export const InventoryEventKindEnum = {
|
|
61
|
+
added: 'added',
|
|
62
|
+
consumed: 'consumed',
|
|
63
|
+
adjusted: 'adjusted',
|
|
64
|
+
discarded: 'discarded',
|
|
65
|
+
expired: 'expired',
|
|
66
|
+
restocked: 'restocked',
|
|
67
|
+
};
|
|
68
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
69
|
+
export const InventoryEventSourceEnum = {
|
|
70
|
+
manual: 'manual',
|
|
71
|
+
vision: 'vision',
|
|
72
|
+
barcode: 'barcode',
|
|
73
|
+
receipt: 'receipt',
|
|
74
|
+
plan: 'plan',
|
|
75
|
+
system: 'system',
|
|
76
|
+
};
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
23
78
|
export const ItemTypeEnum = {
|
|
24
79
|
spices: 'spices',
|
|
25
80
|
dairy: 'dairy',
|
|
@@ -41,6 +96,31 @@ export const LocationEnum = {
|
|
|
41
96
|
other: 'other',
|
|
42
97
|
};
|
|
43
98
|
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
99
|
+
export const MealPlanKindEnum = {
|
|
100
|
+
weekly: 'weekly',
|
|
101
|
+
diet: 'diet',
|
|
102
|
+
};
|
|
103
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
104
|
+
export const MealPlanSourceEnum = {
|
|
105
|
+
manual: 'manual',
|
|
106
|
+
generated: 'generated',
|
|
107
|
+
preset: 'preset',
|
|
108
|
+
forked: 'forked',
|
|
109
|
+
};
|
|
110
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
111
|
+
export const MealPlanStatusEnum = {
|
|
112
|
+
draft: 'draft',
|
|
113
|
+
active: 'active',
|
|
114
|
+
archived: 'archived',
|
|
115
|
+
};
|
|
116
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
117
|
+
export const MealTypeEnum = {
|
|
118
|
+
breakfast: 'breakfast',
|
|
119
|
+
lunch: 'lunch',
|
|
120
|
+
dinner: 'dinner',
|
|
121
|
+
snack: 'snack',
|
|
122
|
+
};
|
|
123
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
44
124
|
export const OrderByEnum = {
|
|
45
125
|
name: 'name',
|
|
46
126
|
created_at: 'created_at',
|
|
@@ -63,6 +143,54 @@ export const QuantityUnitEnum = {
|
|
|
63
143
|
ml: 'ml',
|
|
64
144
|
liters: 'liters',
|
|
65
145
|
};
|
|
146
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
147
|
+
export const RecipeSourceEnum = {
|
|
148
|
+
manual: 'manual',
|
|
149
|
+
generated: 'generated',
|
|
150
|
+
forked: 'forked',
|
|
151
|
+
catalog_copy: 'catalog_copy',
|
|
152
|
+
};
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
154
|
+
export const ShoppingListExportFormat = {
|
|
155
|
+
text: 'text',
|
|
156
|
+
csv: 'csv',
|
|
157
|
+
deeplink: 'deeplink',
|
|
158
|
+
};
|
|
159
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
160
|
+
export const ShoppingListItemReasonEnum = {
|
|
161
|
+
manual: 'manual',
|
|
162
|
+
missing_for_plan: 'missing_for_plan',
|
|
163
|
+
expiring_soon: 'expiring_soon',
|
|
164
|
+
low_stock: 'low_stock',
|
|
165
|
+
};
|
|
166
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
167
|
+
export const ShoppingListSourceEnum = {
|
|
168
|
+
manual: 'manual',
|
|
169
|
+
plan: 'plan',
|
|
170
|
+
auto: 'auto',
|
|
171
|
+
};
|
|
172
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
173
|
+
export const ShoppingListStatusEnum = {
|
|
174
|
+
active: 'active',
|
|
175
|
+
archived: 'archived',
|
|
176
|
+
};
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
178
|
+
export const SocialTargetEnum = {
|
|
179
|
+
recipe: 'recipe',
|
|
180
|
+
meal_plan: 'meal_plan',
|
|
181
|
+
};
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
183
|
+
export const TagKindEnum = {
|
|
184
|
+
cuisine: 'cuisine',
|
|
185
|
+
diet: 'diet',
|
|
186
|
+
course: 'course',
|
|
187
|
+
meal_type: 'meal_type',
|
|
188
|
+
};
|
|
189
|
+
// eslint-disable-next-line @typescript-eslint/no-redeclare
|
|
190
|
+
export const VisibilityEnum = {
|
|
191
|
+
private: 'private',
|
|
192
|
+
public: 'public',
|
|
193
|
+
};
|
|
66
194
|
/**
|
|
67
195
|
* @summary Signup
|
|
68
196
|
*/
|
|
@@ -115,6 +243,87 @@ export const useLoginAuthLoginPost = (options) => {
|
|
|
115
243
|
const mutationOptions = getLoginAuthLoginPostMutationOptions(options);
|
|
116
244
|
return useMutation(mutationOptions);
|
|
117
245
|
};
|
|
246
|
+
/**
|
|
247
|
+
* Sign in with a Google ID token (find-or-create + link).
|
|
248
|
+
* @summary Google Login
|
|
249
|
+
*/
|
|
250
|
+
export const googleLoginAuthGooglePost = (googleLogin, options) => {
|
|
251
|
+
return axios.post(`/auth/google`, googleLogin, options);
|
|
252
|
+
};
|
|
253
|
+
export const getGoogleLoginAuthGooglePostMutationOptions = (options) => {
|
|
254
|
+
const mutationKey = ['googleLoginAuthGooglePost'];
|
|
255
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
256
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
257
|
+
options
|
|
258
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
259
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
260
|
+
const mutationFn = (props) => {
|
|
261
|
+
const { data } = props ?? {};
|
|
262
|
+
return googleLoginAuthGooglePost(data, axiosOptions);
|
|
263
|
+
};
|
|
264
|
+
return { mutationFn, ...mutationOptions };
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* @summary Google Login
|
|
268
|
+
*/
|
|
269
|
+
export const useGoogleLoginAuthGooglePost = (options) => {
|
|
270
|
+
const mutationOptions = getGoogleLoginAuthGooglePostMutationOptions(options);
|
|
271
|
+
return useMutation(mutationOptions);
|
|
272
|
+
};
|
|
273
|
+
/**
|
|
274
|
+
* Mark an email verified from a verification token (idempotent).
|
|
275
|
+
* @summary Verify Email
|
|
276
|
+
*/
|
|
277
|
+
export const verifyEmailAuthVerifyEmailPost = (verifyEmailRequest, options) => {
|
|
278
|
+
return axios.post(`/auth/verify-email`, verifyEmailRequest, options);
|
|
279
|
+
};
|
|
280
|
+
export const getVerifyEmailAuthVerifyEmailPostMutationOptions = (options) => {
|
|
281
|
+
const mutationKey = ['verifyEmailAuthVerifyEmailPost'];
|
|
282
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
283
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
284
|
+
options
|
|
285
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
286
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
287
|
+
const mutationFn = (props) => {
|
|
288
|
+
const { data } = props ?? {};
|
|
289
|
+
return verifyEmailAuthVerifyEmailPost(data, axiosOptions);
|
|
290
|
+
};
|
|
291
|
+
return { mutationFn, ...mutationOptions };
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* @summary Verify Email
|
|
295
|
+
*/
|
|
296
|
+
export const useVerifyEmailAuthVerifyEmailPost = (options) => {
|
|
297
|
+
const mutationOptions = getVerifyEmailAuthVerifyEmailPostMutationOptions(options);
|
|
298
|
+
return useMutation(mutationOptions);
|
|
299
|
+
};
|
|
300
|
+
/**
|
|
301
|
+
* Send a fresh verification link. Always 200 โ never reveals whether the account exists.
|
|
302
|
+
* @summary Resend Verification
|
|
303
|
+
*/
|
|
304
|
+
export const resendVerificationAuthResendVerificationPost = (resendVerificationRequest, options) => {
|
|
305
|
+
return axios.post(`/auth/resend-verification`, resendVerificationRequest, options);
|
|
306
|
+
};
|
|
307
|
+
export const getResendVerificationAuthResendVerificationPostMutationOptions = (options) => {
|
|
308
|
+
const mutationKey = ['resendVerificationAuthResendVerificationPost'];
|
|
309
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
310
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
311
|
+
options
|
|
312
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
313
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
314
|
+
const mutationFn = (props) => {
|
|
315
|
+
const { data } = props ?? {};
|
|
316
|
+
return resendVerificationAuthResendVerificationPost(data, axiosOptions);
|
|
317
|
+
};
|
|
318
|
+
return { mutationFn, ...mutationOptions };
|
|
319
|
+
};
|
|
320
|
+
/**
|
|
321
|
+
* @summary Resend Verification
|
|
322
|
+
*/
|
|
323
|
+
export const useResendVerificationAuthResendVerificationPost = (options) => {
|
|
324
|
+
const mutationOptions = getResendVerificationAuthResendVerificationPostMutationOptions(options);
|
|
325
|
+
return useMutation(mutationOptions);
|
|
326
|
+
};
|
|
118
327
|
/**
|
|
119
328
|
* @summary Get Current User Info
|
|
120
329
|
*/
|
|
@@ -234,9 +443,15 @@ export const createPantryItemPantryItemsPost = (bodyCreatePantryItemPantryItemsP
|
|
|
234
443
|
if (bodyCreatePantryItemPantryItemsPost.location !== undefined && bodyCreatePantryItemPantryItemsPost.location !== null) {
|
|
235
444
|
formData.append(`location`, bodyCreatePantryItemPantryItemsPost.location);
|
|
236
445
|
}
|
|
446
|
+
if (bodyCreatePantryItemPantryItemsPost.location_id !== undefined && bodyCreatePantryItemPantryItemsPost.location_id !== null) {
|
|
447
|
+
formData.append(`location_id`, bodyCreatePantryItemPantryItemsPost.location_id.toString());
|
|
448
|
+
}
|
|
237
449
|
if (bodyCreatePantryItemPantryItemsPost.notes !== undefined && bodyCreatePantryItemPantryItemsPost.notes !== null) {
|
|
238
450
|
formData.append(`notes`, bodyCreatePantryItemPantryItemsPost.notes);
|
|
239
451
|
}
|
|
452
|
+
if (bodyCreatePantryItemPantryItemsPost.ingredient_id !== undefined && bodyCreatePantryItemPantryItemsPost.ingredient_id !== null) {
|
|
453
|
+
formData.append(`ingredient_id`, bodyCreatePantryItemPantryItemsPost.ingredient_id.toString());
|
|
454
|
+
}
|
|
240
455
|
if (bodyCreatePantryItemPantryItemsPost.image !== undefined && bodyCreatePantryItemPantryItemsPost.image !== null) {
|
|
241
456
|
formData.append(`image`, bodyCreatePantryItemPantryItemsPost.image);
|
|
242
457
|
}
|
|
@@ -291,6 +506,113 @@ export function useGetPantryItemsPantryItemsGet(params, options) {
|
|
|
291
506
|
query.queryKey = queryOptions.queryKey;
|
|
292
507
|
return query;
|
|
293
508
|
}
|
|
509
|
+
/**
|
|
510
|
+
* @summary Bulk Create Pantry Items
|
|
511
|
+
*/
|
|
512
|
+
export const bulkCreatePantryItemsPantryItemsBulkPost = (pantryItemBulkCreateRequest, options) => {
|
|
513
|
+
return axios.post(`/pantry-items/bulk`, pantryItemBulkCreateRequest, options);
|
|
514
|
+
};
|
|
515
|
+
export const getBulkCreatePantryItemsPantryItemsBulkPostMutationOptions = (options) => {
|
|
516
|
+
const mutationKey = ['bulkCreatePantryItemsPantryItemsBulkPost'];
|
|
517
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
518
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
519
|
+
options
|
|
520
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
521
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
522
|
+
const mutationFn = (props) => {
|
|
523
|
+
const { data } = props ?? {};
|
|
524
|
+
return bulkCreatePantryItemsPantryItemsBulkPost(data, axiosOptions);
|
|
525
|
+
};
|
|
526
|
+
return { mutationFn, ...mutationOptions };
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* @summary Bulk Create Pantry Items
|
|
530
|
+
*/
|
|
531
|
+
export const useBulkCreatePantryItemsPantryItemsBulkPost = (options) => {
|
|
532
|
+
const mutationOptions = getBulkCreatePantryItemsPantryItemsBulkPostMutationOptions(options);
|
|
533
|
+
return useMutation(mutationOptions);
|
|
534
|
+
};
|
|
535
|
+
/**
|
|
536
|
+
* @summary Bulk Update Pantry Items
|
|
537
|
+
*/
|
|
538
|
+
export const bulkUpdatePantryItemsPantryItemsBulkPatch = (pantryItemBulkUpdateRequest, options) => {
|
|
539
|
+
return axios.patch(`/pantry-items/bulk`, pantryItemBulkUpdateRequest, options);
|
|
540
|
+
};
|
|
541
|
+
export const getBulkUpdatePantryItemsPantryItemsBulkPatchMutationOptions = (options) => {
|
|
542
|
+
const mutationKey = ['bulkUpdatePantryItemsPantryItemsBulkPatch'];
|
|
543
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
544
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
545
|
+
options
|
|
546
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
547
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
548
|
+
const mutationFn = (props) => {
|
|
549
|
+
const { data } = props ?? {};
|
|
550
|
+
return bulkUpdatePantryItemsPantryItemsBulkPatch(data, axiosOptions);
|
|
551
|
+
};
|
|
552
|
+
return { mutationFn, ...mutationOptions };
|
|
553
|
+
};
|
|
554
|
+
/**
|
|
555
|
+
* @summary Bulk Update Pantry Items
|
|
556
|
+
*/
|
|
557
|
+
export const useBulkUpdatePantryItemsPantryItemsBulkPatch = (options) => {
|
|
558
|
+
const mutationOptions = getBulkUpdatePantryItemsPantryItemsBulkPatchMutationOptions(options);
|
|
559
|
+
return useMutation(mutationOptions);
|
|
560
|
+
};
|
|
561
|
+
/**
|
|
562
|
+
* @summary Bulk Delete Pantry Items
|
|
563
|
+
*/
|
|
564
|
+
export const bulkDeletePantryItemsPantryItemsBulkDeletePost = (pantryItemBulkDeleteRequest, options) => {
|
|
565
|
+
return axios.post(`/pantry-items/bulk-delete`, pantryItemBulkDeleteRequest, options);
|
|
566
|
+
};
|
|
567
|
+
export const getBulkDeletePantryItemsPantryItemsBulkDeletePostMutationOptions = (options) => {
|
|
568
|
+
const mutationKey = ['bulkDeletePantryItemsPantryItemsBulkDeletePost'];
|
|
569
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
570
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
571
|
+
options
|
|
572
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
573
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
574
|
+
const mutationFn = (props) => {
|
|
575
|
+
const { data } = props ?? {};
|
|
576
|
+
return bulkDeletePantryItemsPantryItemsBulkDeletePost(data, axiosOptions);
|
|
577
|
+
};
|
|
578
|
+
return { mutationFn, ...mutationOptions };
|
|
579
|
+
};
|
|
580
|
+
/**
|
|
581
|
+
* @summary Bulk Delete Pantry Items
|
|
582
|
+
*/
|
|
583
|
+
export const useBulkDeletePantryItemsPantryItemsBulkDeletePost = (options) => {
|
|
584
|
+
const mutationOptions = getBulkDeletePantryItemsPantryItemsBulkDeletePostMutationOptions(options);
|
|
585
|
+
return useMutation(mutationOptions);
|
|
586
|
+
};
|
|
587
|
+
/**
|
|
588
|
+
* @summary Get Inventory Events
|
|
589
|
+
*/
|
|
590
|
+
export const getInventoryEventsPantryItemsEventsGet = (params, options) => {
|
|
591
|
+
return axios.get(`/pantry-items/events`, {
|
|
592
|
+
...options,
|
|
593
|
+
params: { ...params, ...options?.params },
|
|
594
|
+
});
|
|
595
|
+
};
|
|
596
|
+
export const getGetInventoryEventsPantryItemsEventsGetQueryKey = (params) => {
|
|
597
|
+
return [
|
|
598
|
+
`/pantry-items/events`, ...(params ? [params] : [])
|
|
599
|
+
];
|
|
600
|
+
};
|
|
601
|
+
export const getGetInventoryEventsPantryItemsEventsGetQueryOptions = (params, options) => {
|
|
602
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
603
|
+
const queryKey = queryOptions?.queryKey ?? getGetInventoryEventsPantryItemsEventsGetQueryKey(params);
|
|
604
|
+
const queryFn = ({ signal }) => getInventoryEventsPantryItemsEventsGet(params, { signal, ...axiosOptions });
|
|
605
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
606
|
+
};
|
|
607
|
+
/**
|
|
608
|
+
* @summary Get Inventory Events
|
|
609
|
+
*/
|
|
610
|
+
export function useGetInventoryEventsPantryItemsEventsGet(params, options) {
|
|
611
|
+
const queryOptions = getGetInventoryEventsPantryItemsEventsGetQueryOptions(params, options);
|
|
612
|
+
const query = useQuery(queryOptions);
|
|
613
|
+
query.queryKey = queryOptions.queryKey;
|
|
614
|
+
return query;
|
|
615
|
+
}
|
|
294
616
|
/**
|
|
295
617
|
* @summary Get Pantry Item
|
|
296
618
|
*/
|
|
@@ -340,6 +662,9 @@ export const updatePantryItemPantryItemsItemIdPut = (itemId, bodyUpdatePantryIte
|
|
|
340
662
|
if (bodyUpdatePantryItemPantryItemsItemIdPut.location !== undefined && bodyUpdatePantryItemPantryItemsItemIdPut.location !== null) {
|
|
341
663
|
formData.append(`location`, bodyUpdatePantryItemPantryItemsItemIdPut.location);
|
|
342
664
|
}
|
|
665
|
+
if (bodyUpdatePantryItemPantryItemsItemIdPut.location_id !== undefined && bodyUpdatePantryItemPantryItemsItemIdPut.location_id !== null) {
|
|
666
|
+
formData.append(`location_id`, bodyUpdatePantryItemPantryItemsItemIdPut.location_id.toString());
|
|
667
|
+
}
|
|
343
668
|
if (bodyUpdatePantryItemPantryItemsItemIdPut.notes !== undefined && bodyUpdatePantryItemPantryItemsItemIdPut.notes !== null) {
|
|
344
669
|
formData.append(`notes`, bodyUpdatePantryItemPantryItemsItemIdPut.notes);
|
|
345
670
|
}
|
|
@@ -398,85 +723,68 @@ export const useDeletePantryItemPantryItemsItemIdDelete = (options) => {
|
|
|
398
723
|
return useMutation(mutationOptions);
|
|
399
724
|
};
|
|
400
725
|
/**
|
|
401
|
-
* @summary
|
|
726
|
+
* @summary Consume Pantry Item
|
|
402
727
|
*/
|
|
403
|
-
export const
|
|
404
|
-
return axios.
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
`/recipes/recipe-image/${filename}`
|
|
409
|
-
];
|
|
728
|
+
export const consumePantryItemPantryItemsItemIdConsumePost = (itemId, consumeRequest, params, options) => {
|
|
729
|
+
return axios.post(`/pantry-items/${itemId}/consume`, consumeRequest, {
|
|
730
|
+
...options,
|
|
731
|
+
params: { ...params, ...options?.params },
|
|
732
|
+
});
|
|
410
733
|
};
|
|
411
|
-
export const
|
|
412
|
-
const
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
734
|
+
export const getConsumePantryItemPantryItemsItemIdConsumePostMutationOptions = (options) => {
|
|
735
|
+
const mutationKey = ['consumePantryItemPantryItemsItemIdConsumePost'];
|
|
736
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
737
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
738
|
+
options
|
|
739
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
740
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
741
|
+
const mutationFn = (props) => {
|
|
742
|
+
const { itemId, data, params } = props ?? {};
|
|
743
|
+
return consumePantryItemPantryItemsItemIdConsumePost(itemId, data, params, axiosOptions);
|
|
744
|
+
};
|
|
745
|
+
return { mutationFn, ...mutationOptions };
|
|
416
746
|
};
|
|
417
747
|
/**
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
export
|
|
421
|
-
const
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
return query;
|
|
425
|
-
}
|
|
748
|
+
* @summary Consume Pantry Item
|
|
749
|
+
*/
|
|
750
|
+
export const useConsumePantryItemPantryItemsItemIdConsumePost = (options) => {
|
|
751
|
+
const mutationOptions = getConsumePantryItemPantryItemsItemIdConsumePostMutationOptions(options);
|
|
752
|
+
return useMutation(mutationOptions);
|
|
753
|
+
};
|
|
426
754
|
/**
|
|
427
|
-
* @summary
|
|
755
|
+
* @summary List Storage Locations
|
|
428
756
|
*/
|
|
429
|
-
export const
|
|
430
|
-
return axios.get(`/
|
|
431
|
-
...options,
|
|
432
|
-
params: { ...params, ...options?.params },
|
|
433
|
-
});
|
|
757
|
+
export const listStorageLocationsLocationsGet = (options) => {
|
|
758
|
+
return axios.get(`/locations/`, options);
|
|
434
759
|
};
|
|
435
|
-
export const
|
|
760
|
+
export const getListStorageLocationsLocationsGetQueryKey = () => {
|
|
436
761
|
return [
|
|
437
|
-
`/
|
|
762
|
+
`/locations/`
|
|
438
763
|
];
|
|
439
764
|
};
|
|
440
|
-
export const
|
|
765
|
+
export const getListStorageLocationsLocationsGetQueryOptions = (options) => {
|
|
441
766
|
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
442
|
-
const queryKey = queryOptions?.queryKey ??
|
|
443
|
-
const queryFn = ({ signal }) =>
|
|
767
|
+
const queryKey = queryOptions?.queryKey ?? getListStorageLocationsLocationsGetQueryKey();
|
|
768
|
+
const queryFn = ({ signal }) => listStorageLocationsLocationsGet({ signal, ...axiosOptions });
|
|
444
769
|
return { queryKey, queryFn, ...queryOptions };
|
|
445
770
|
};
|
|
446
771
|
/**
|
|
447
|
-
* @summary
|
|
772
|
+
* @summary List Storage Locations
|
|
448
773
|
*/
|
|
449
|
-
export function
|
|
450
|
-
const queryOptions =
|
|
774
|
+
export function useListStorageLocationsLocationsGet(options) {
|
|
775
|
+
const queryOptions = getListStorageLocationsLocationsGetQueryOptions(options);
|
|
451
776
|
const query = useQuery(queryOptions);
|
|
452
777
|
query.queryKey = queryOptions.queryKey;
|
|
453
778
|
return query;
|
|
454
779
|
}
|
|
455
780
|
/**
|
|
456
|
-
* @summary Create
|
|
781
|
+
* @summary Create Storage Location
|
|
457
782
|
*/
|
|
458
|
-
export const
|
|
459
|
-
|
|
460
|
-
formData.append(`name`, bodyCreateRecipeRecipesPost.name);
|
|
461
|
-
formData.append(`cuisine`, bodyCreateRecipeRecipesPost.cuisine);
|
|
462
|
-
formData.append(`instructions`, bodyCreateRecipeRecipesPost.instructions);
|
|
463
|
-
formData.append(`ingredients`, bodyCreateRecipeRecipesPost.ingredients);
|
|
464
|
-
if (bodyCreateRecipeRecipesPost.prep_time !== undefined) {
|
|
465
|
-
formData.append(`prep_time`, bodyCreateRecipeRecipesPost.prep_time.toString());
|
|
466
|
-
}
|
|
467
|
-
if (bodyCreateRecipeRecipesPost.cook_time !== undefined) {
|
|
468
|
-
formData.append(`cook_time`, bodyCreateRecipeRecipesPost.cook_time.toString());
|
|
469
|
-
}
|
|
470
|
-
if (bodyCreateRecipeRecipesPost.servings !== undefined) {
|
|
471
|
-
formData.append(`servings`, bodyCreateRecipeRecipesPost.servings.toString());
|
|
472
|
-
}
|
|
473
|
-
if (bodyCreateRecipeRecipesPost.image !== undefined) {
|
|
474
|
-
formData.append(`image`, bodyCreateRecipeRecipesPost.image);
|
|
475
|
-
}
|
|
476
|
-
return axios.post(`/recipes/`, formData, options);
|
|
783
|
+
export const createStorageLocationLocationsPost = (storageLocationCreate, options) => {
|
|
784
|
+
return axios.post(`/locations/`, storageLocationCreate, options);
|
|
477
785
|
};
|
|
478
|
-
export const
|
|
479
|
-
const mutationKey = ['
|
|
786
|
+
export const getCreateStorageLocationLocationsPostMutationOptions = (options) => {
|
|
787
|
+
const mutationKey = ['createStorageLocationLocationsPost'];
|
|
480
788
|
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
481
789
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
482
790
|
options
|
|
@@ -484,108 +792,195 @@ export const getCreateRecipeRecipesPostMutationOptions = (options) => {
|
|
|
484
792
|
: { mutation: { mutationKey, }, axios: undefined };
|
|
485
793
|
const mutationFn = (props) => {
|
|
486
794
|
const { data } = props ?? {};
|
|
487
|
-
return
|
|
795
|
+
return createStorageLocationLocationsPost(data, axiosOptions);
|
|
488
796
|
};
|
|
489
797
|
return { mutationFn, ...mutationOptions };
|
|
490
798
|
};
|
|
491
799
|
/**
|
|
492
|
-
* @summary Create
|
|
800
|
+
* @summary Create Storage Location
|
|
493
801
|
*/
|
|
494
|
-
export const
|
|
495
|
-
const mutationOptions =
|
|
802
|
+
export const useCreateStorageLocationLocationsPost = (options) => {
|
|
803
|
+
const mutationOptions = getCreateStorageLocationLocationsPostMutationOptions(options);
|
|
496
804
|
return useMutation(mutationOptions);
|
|
497
805
|
};
|
|
498
806
|
/**
|
|
499
|
-
* @summary
|
|
807
|
+
* @summary Update Storage Location
|
|
500
808
|
*/
|
|
501
|
-
export const
|
|
502
|
-
return axios.
|
|
503
|
-
...options,
|
|
504
|
-
params: { ...params, ...options?.params },
|
|
505
|
-
});
|
|
809
|
+
export const updateStorageLocationLocationsLocationIdPut = (locationId, storageLocationUpdate, options) => {
|
|
810
|
+
return axios.put(`/locations/${locationId}`, storageLocationUpdate, options);
|
|
506
811
|
};
|
|
507
|
-
export const
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
812
|
+
export const getUpdateStorageLocationLocationsLocationIdPutMutationOptions = (options) => {
|
|
813
|
+
const mutationKey = ['updateStorageLocationLocationsLocationIdPut'];
|
|
814
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
815
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
816
|
+
options
|
|
817
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
818
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
819
|
+
const mutationFn = (props) => {
|
|
820
|
+
const { locationId, data } = props ?? {};
|
|
821
|
+
return updateStorageLocationLocationsLocationIdPut(locationId, data, axiosOptions);
|
|
822
|
+
};
|
|
823
|
+
return { mutationFn, ...mutationOptions };
|
|
511
824
|
};
|
|
512
|
-
|
|
825
|
+
/**
|
|
826
|
+
* @summary Update Storage Location
|
|
827
|
+
*/
|
|
828
|
+
export const useUpdateStorageLocationLocationsLocationIdPut = (options) => {
|
|
829
|
+
const mutationOptions = getUpdateStorageLocationLocationsLocationIdPutMutationOptions(options);
|
|
830
|
+
return useMutation(mutationOptions);
|
|
831
|
+
};
|
|
832
|
+
/**
|
|
833
|
+
* @summary Delete Storage Location
|
|
834
|
+
*/
|
|
835
|
+
export const deleteStorageLocationLocationsLocationIdDelete = (locationId, params, options) => {
|
|
836
|
+
return axios.delete(`/locations/${locationId}`, {
|
|
837
|
+
...options,
|
|
838
|
+
params: { ...params, ...options?.params },
|
|
839
|
+
});
|
|
840
|
+
};
|
|
841
|
+
export const getDeleteStorageLocationLocationsLocationIdDeleteMutationOptions = (options) => {
|
|
842
|
+
const mutationKey = ['deleteStorageLocationLocationsLocationIdDelete'];
|
|
843
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
844
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
845
|
+
options
|
|
846
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
847
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
848
|
+
const mutationFn = (props) => {
|
|
849
|
+
const { locationId, params } = props ?? {};
|
|
850
|
+
return deleteStorageLocationLocationsLocationIdDelete(locationId, params, axiosOptions);
|
|
851
|
+
};
|
|
852
|
+
return { mutationFn, ...mutationOptions };
|
|
853
|
+
};
|
|
854
|
+
/**
|
|
855
|
+
* @summary Delete Storage Location
|
|
856
|
+
*/
|
|
857
|
+
export const useDeleteStorageLocationLocationsLocationIdDelete = (options) => {
|
|
858
|
+
const mutationOptions = getDeleteStorageLocationLocationsLocationIdDeleteMutationOptions(options);
|
|
859
|
+
return useMutation(mutationOptions);
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* The caller's household: id, name, settings document, members, created_at.
|
|
863
|
+
* @summary Get Household
|
|
864
|
+
*/
|
|
865
|
+
export const getHouseholdHouseholdGet = (options) => {
|
|
866
|
+
return axios.get(`/household/`, options);
|
|
867
|
+
};
|
|
868
|
+
export const getGetHouseholdHouseholdGetQueryKey = () => {
|
|
869
|
+
return [
|
|
870
|
+
`/household/`
|
|
871
|
+
];
|
|
872
|
+
};
|
|
873
|
+
export const getGetHouseholdHouseholdGetQueryOptions = (options) => {
|
|
513
874
|
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
514
|
-
const queryKey = queryOptions?.queryKey ??
|
|
515
|
-
const queryFn = ({ signal }) =>
|
|
875
|
+
const queryKey = queryOptions?.queryKey ?? getGetHouseholdHouseholdGetQueryKey();
|
|
876
|
+
const queryFn = ({ signal }) => getHouseholdHouseholdGet({ signal, ...axiosOptions });
|
|
516
877
|
return { queryKey, queryFn, ...queryOptions };
|
|
517
878
|
};
|
|
518
879
|
/**
|
|
519
|
-
* @summary Get
|
|
880
|
+
* @summary Get Household
|
|
520
881
|
*/
|
|
521
|
-
export function
|
|
522
|
-
const queryOptions =
|
|
882
|
+
export function useGetHouseholdHouseholdGet(options) {
|
|
883
|
+
const queryOptions = getGetHouseholdHouseholdGetQueryOptions(options);
|
|
523
884
|
const query = useQuery(queryOptions);
|
|
524
885
|
query.queryKey = queryOptions.queryKey;
|
|
525
886
|
return query;
|
|
526
887
|
}
|
|
527
888
|
/**
|
|
528
|
-
*
|
|
889
|
+
* Partially update household name and/or settings (settings keys merge).
|
|
890
|
+
* @summary Update Household
|
|
529
891
|
*/
|
|
530
|
-
export const
|
|
531
|
-
return axios.
|
|
892
|
+
export const updateHouseholdHouseholdPatch = (householdUpdate, options) => {
|
|
893
|
+
return axios.patch(`/household/`, householdUpdate, options);
|
|
532
894
|
};
|
|
533
|
-
export const
|
|
895
|
+
export const getUpdateHouseholdHouseholdPatchMutationOptions = (options) => {
|
|
896
|
+
const mutationKey = ['updateHouseholdHouseholdPatch'];
|
|
897
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
898
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
899
|
+
options
|
|
900
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
901
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
902
|
+
const mutationFn = (props) => {
|
|
903
|
+
const { data } = props ?? {};
|
|
904
|
+
return updateHouseholdHouseholdPatch(data, axiosOptions);
|
|
905
|
+
};
|
|
906
|
+
return { mutationFn, ...mutationOptions };
|
|
907
|
+
};
|
|
908
|
+
/**
|
|
909
|
+
* @summary Update Household
|
|
910
|
+
*/
|
|
911
|
+
export const useUpdateHouseholdHouseholdPatch = (options) => {
|
|
912
|
+
const mutationOptions = getUpdateHouseholdHouseholdPatchMutationOptions(options);
|
|
913
|
+
return useMutation(mutationOptions);
|
|
914
|
+
};
|
|
915
|
+
/**
|
|
916
|
+
* List the household's members (MVP personal households: just the caller).
|
|
917
|
+
* @summary List Household Members
|
|
918
|
+
*/
|
|
919
|
+
export const listHouseholdMembersHouseholdMembersGet = (options) => {
|
|
920
|
+
return axios.get(`/household/members`, options);
|
|
921
|
+
};
|
|
922
|
+
export const getListHouseholdMembersHouseholdMembersGetQueryKey = () => {
|
|
534
923
|
return [
|
|
535
|
-
`/
|
|
924
|
+
`/household/members`
|
|
536
925
|
];
|
|
537
926
|
};
|
|
538
|
-
export const
|
|
927
|
+
export const getListHouseholdMembersHouseholdMembersGetQueryOptions = (options) => {
|
|
539
928
|
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
540
|
-
const queryKey = queryOptions?.queryKey ??
|
|
541
|
-
const queryFn = ({ signal }) =>
|
|
542
|
-
return { queryKey, queryFn,
|
|
929
|
+
const queryKey = queryOptions?.queryKey ?? getListHouseholdMembersHouseholdMembersGetQueryKey();
|
|
930
|
+
const queryFn = ({ signal }) => listHouseholdMembersHouseholdMembersGet({ signal, ...axiosOptions });
|
|
931
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
543
932
|
};
|
|
544
933
|
/**
|
|
545
|
-
* @summary
|
|
934
|
+
* @summary List Household Members
|
|
546
935
|
*/
|
|
547
|
-
export function
|
|
548
|
-
const queryOptions =
|
|
936
|
+
export function useListHouseholdMembersHouseholdMembersGet(options) {
|
|
937
|
+
const queryOptions = getListHouseholdMembersHouseholdMembersGetQueryOptions(options);
|
|
549
938
|
const query = useQuery(queryOptions);
|
|
550
939
|
query.queryKey = queryOptions.queryKey;
|
|
551
940
|
return query;
|
|
552
941
|
}
|
|
553
942
|
/**
|
|
554
|
-
*
|
|
943
|
+
* One aggregate call for the app home screen, household-scoped.
|
|
944
|
+
|
|
945
|
+
``suggested_recipes`` is the top-3 deterministic coverage ranking (P2,
|
|
946
|
+
same service as /recipes/suggestions). ``active_plan`` (P3) is the
|
|
947
|
+
household's active meal plan with today's slots โ null when no plan is
|
|
948
|
+
active.
|
|
949
|
+
* @summary Get Dashboard Summary
|
|
555
950
|
*/
|
|
556
|
-
export const
|
|
557
|
-
|
|
558
|
-
if (bodyUpdateRecipeRecipesRecipeIdPut.name !== undefined) {
|
|
559
|
-
formData.append(`name`, bodyUpdateRecipeRecipesRecipeIdPut.name);
|
|
560
|
-
}
|
|
561
|
-
if (bodyUpdateRecipeRecipesRecipeIdPut.cuisine !== undefined && bodyUpdateRecipeRecipesRecipeIdPut.cuisine !== null) {
|
|
562
|
-
formData.append(`cuisine`, bodyUpdateRecipeRecipesRecipeIdPut.cuisine);
|
|
563
|
-
}
|
|
564
|
-
if (bodyUpdateRecipeRecipesRecipeIdPut.instructions !== undefined) {
|
|
565
|
-
formData.append(`instructions`, bodyUpdateRecipeRecipesRecipeIdPut.instructions);
|
|
566
|
-
}
|
|
567
|
-
if (bodyUpdateRecipeRecipesRecipeIdPut.ingredients !== undefined) {
|
|
568
|
-
formData.append(`ingredients`, bodyUpdateRecipeRecipesRecipeIdPut.ingredients);
|
|
569
|
-
}
|
|
570
|
-
if (bodyUpdateRecipeRecipesRecipeIdPut.prep_time !== undefined) {
|
|
571
|
-
formData.append(`prep_time`, bodyUpdateRecipeRecipesRecipeIdPut.prep_time.toString());
|
|
572
|
-
}
|
|
573
|
-
if (bodyUpdateRecipeRecipesRecipeIdPut.cook_time !== undefined) {
|
|
574
|
-
formData.append(`cook_time`, bodyUpdateRecipeRecipesRecipeIdPut.cook_time.toString());
|
|
575
|
-
}
|
|
576
|
-
if (bodyUpdateRecipeRecipesRecipeIdPut.servings !== undefined) {
|
|
577
|
-
formData.append(`servings`, bodyUpdateRecipeRecipesRecipeIdPut.servings.toString());
|
|
578
|
-
}
|
|
579
|
-
if (bodyUpdateRecipeRecipesRecipeIdPut.image !== undefined) {
|
|
580
|
-
formData.append(`image`, bodyUpdateRecipeRecipesRecipeIdPut.image);
|
|
581
|
-
}
|
|
582
|
-
if (bodyUpdateRecipeRecipesRecipeIdPut.clear_image !== undefined && bodyUpdateRecipeRecipesRecipeIdPut.clear_image !== null) {
|
|
583
|
-
formData.append(`clear_image`, bodyUpdateRecipeRecipesRecipeIdPut.clear_image);
|
|
584
|
-
}
|
|
585
|
-
return axios.put(`/recipes/${recipeId}`, formData, options);
|
|
951
|
+
export const getDashboardSummaryDashboardSummaryGet = (options) => {
|
|
952
|
+
return axios.get(`/dashboard/summary`, options);
|
|
586
953
|
};
|
|
587
|
-
export const
|
|
588
|
-
|
|
954
|
+
export const getGetDashboardSummaryDashboardSummaryGetQueryKey = () => {
|
|
955
|
+
return [
|
|
956
|
+
`/dashboard/summary`
|
|
957
|
+
];
|
|
958
|
+
};
|
|
959
|
+
export const getGetDashboardSummaryDashboardSummaryGetQueryOptions = (options) => {
|
|
960
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
961
|
+
const queryKey = queryOptions?.queryKey ?? getGetDashboardSummaryDashboardSummaryGetQueryKey();
|
|
962
|
+
const queryFn = ({ signal }) => getDashboardSummaryDashboardSummaryGet({ signal, ...axiosOptions });
|
|
963
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
964
|
+
};
|
|
965
|
+
/**
|
|
966
|
+
* @summary Get Dashboard Summary
|
|
967
|
+
*/
|
|
968
|
+
export function useGetDashboardSummaryDashboardSummaryGet(options) {
|
|
969
|
+
const queryOptions = getGetDashboardSummaryDashboardSummaryGetQueryOptions(options);
|
|
970
|
+
const query = useQuery(queryOptions);
|
|
971
|
+
query.queryKey = queryOptions.queryKey;
|
|
972
|
+
return query;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Set visibility (private|public) on my own recipe (ยง5.7). 404 โ not
|
|
976
|
+
403 โ for recipes I don't own, per the private-by-default posture (ยง12).
|
|
977
|
+
* @summary Set Recipe Visibility
|
|
978
|
+
*/
|
|
979
|
+
export const setRecipeVisibilityRecipesRecipeIdVisibilityPut = (recipeId, visibilityUpdate, options) => {
|
|
980
|
+
return axios.put(`/recipes/${recipeId}/visibility`, visibilityUpdate, options);
|
|
981
|
+
};
|
|
982
|
+
export const getSetRecipeVisibilityRecipesRecipeIdVisibilityPutMutationOptions = (options) => {
|
|
983
|
+
const mutationKey = ['setRecipeVisibilityRecipesRecipeIdVisibilityPut'];
|
|
589
984
|
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
590
985
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
591
986
|
options
|
|
@@ -593,25 +988,118 @@ export const getUpdateRecipeRecipesRecipeIdPutMutationOptions = (options) => {
|
|
|
593
988
|
: { mutation: { mutationKey, }, axios: undefined };
|
|
594
989
|
const mutationFn = (props) => {
|
|
595
990
|
const { recipeId, data } = props ?? {};
|
|
596
|
-
return
|
|
991
|
+
return setRecipeVisibilityRecipesRecipeIdVisibilityPut(recipeId, data, axiosOptions);
|
|
597
992
|
};
|
|
598
993
|
return { mutationFn, ...mutationOptions };
|
|
599
994
|
};
|
|
600
995
|
/**
|
|
601
|
-
* @summary
|
|
996
|
+
* @summary Set Recipe Visibility
|
|
602
997
|
*/
|
|
603
|
-
export const
|
|
604
|
-
const mutationOptions =
|
|
998
|
+
export const useSetRecipeVisibilityRecipesRecipeIdVisibilityPut = (options) => {
|
|
999
|
+
const mutationOptions = getSetRecipeVisibilityRecipesRecipeIdVisibilityPutMutationOptions(options);
|
|
605
1000
|
return useMutation(mutationOptions);
|
|
606
1001
|
};
|
|
607
1002
|
/**
|
|
608
|
-
*
|
|
1003
|
+
* Set visibility (private|public) on a household-owned plan (ยง5.7).
|
|
1004
|
+
* @summary Set Plan Visibility
|
|
609
1005
|
*/
|
|
610
|
-
export const
|
|
611
|
-
return axios.
|
|
1006
|
+
export const setPlanVisibilityPlansPlanIdVisibilityPut = (planId, visibilityUpdate, options) => {
|
|
1007
|
+
return axios.put(`/plans/${planId}/visibility`, visibilityUpdate, options);
|
|
612
1008
|
};
|
|
613
|
-
export const
|
|
614
|
-
const mutationKey = ['
|
|
1009
|
+
export const getSetPlanVisibilityPlansPlanIdVisibilityPutMutationOptions = (options) => {
|
|
1010
|
+
const mutationKey = ['setPlanVisibilityPlansPlanIdVisibilityPut'];
|
|
1011
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1012
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1013
|
+
options
|
|
1014
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1015
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1016
|
+
const mutationFn = (props) => {
|
|
1017
|
+
const { planId, data } = props ?? {};
|
|
1018
|
+
return setPlanVisibilityPlansPlanIdVisibilityPut(planId, data, axiosOptions);
|
|
1019
|
+
};
|
|
1020
|
+
return { mutationFn, ...mutationOptions };
|
|
1021
|
+
};
|
|
1022
|
+
/**
|
|
1023
|
+
* @summary Set Plan Visibility
|
|
1024
|
+
*/
|
|
1025
|
+
export const useSetPlanVisibilityPlansPlanIdVisibilityPut = (options) => {
|
|
1026
|
+
const mutationOptions = getSetPlanVisibilityPlansPlanIdVisibilityPutMutationOptions(options);
|
|
1027
|
+
return useMutation(mutationOptions);
|
|
1028
|
+
};
|
|
1029
|
+
/**
|
|
1030
|
+
* Public recipe discovery (D3: Reddit-style). Only visibility='public'
|
|
1031
|
+
rows are ever returned; rating/favorite stats are embedded.
|
|
1032
|
+
* @summary List Public Recipes
|
|
1033
|
+
*/
|
|
1034
|
+
export const listPublicRecipesRecipesPublicGet = (params, options) => {
|
|
1035
|
+
return axios.get(`/recipes/public`, {
|
|
1036
|
+
...options,
|
|
1037
|
+
params: { ...params, ...options?.params },
|
|
1038
|
+
});
|
|
1039
|
+
};
|
|
1040
|
+
export const getListPublicRecipesRecipesPublicGetQueryKey = (params) => {
|
|
1041
|
+
return [
|
|
1042
|
+
`/recipes/public`, ...(params ? [params] : [])
|
|
1043
|
+
];
|
|
1044
|
+
};
|
|
1045
|
+
export const getListPublicRecipesRecipesPublicGetQueryOptions = (params, options) => {
|
|
1046
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1047
|
+
const queryKey = queryOptions?.queryKey ?? getListPublicRecipesRecipesPublicGetQueryKey(params);
|
|
1048
|
+
const queryFn = ({ signal }) => listPublicRecipesRecipesPublicGet(params, { signal, ...axiosOptions });
|
|
1049
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1050
|
+
};
|
|
1051
|
+
/**
|
|
1052
|
+
* @summary List Public Recipes
|
|
1053
|
+
*/
|
|
1054
|
+
export function useListPublicRecipesRecipesPublicGet(params, options) {
|
|
1055
|
+
const queryOptions = getListPublicRecipesRecipesPublicGetQueryOptions(params, options);
|
|
1056
|
+
const query = useQuery(queryOptions);
|
|
1057
|
+
query.queryKey = queryOptions.queryKey;
|
|
1058
|
+
return query;
|
|
1059
|
+
}
|
|
1060
|
+
/**
|
|
1061
|
+
* Public meal plan discovery. (Plans have no cuisine/tags fields โ those
|
|
1062
|
+
discovery filters exist on /recipes/public only.)
|
|
1063
|
+
* @summary List Public Plans
|
|
1064
|
+
*/
|
|
1065
|
+
export const listPublicPlansPlansPublicGet = (params, options) => {
|
|
1066
|
+
return axios.get(`/plans/public`, {
|
|
1067
|
+
...options,
|
|
1068
|
+
params: { ...params, ...options?.params },
|
|
1069
|
+
});
|
|
1070
|
+
};
|
|
1071
|
+
export const getListPublicPlansPlansPublicGetQueryKey = (params) => {
|
|
1072
|
+
return [
|
|
1073
|
+
`/plans/public`, ...(params ? [params] : [])
|
|
1074
|
+
];
|
|
1075
|
+
};
|
|
1076
|
+
export const getListPublicPlansPlansPublicGetQueryOptions = (params, options) => {
|
|
1077
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1078
|
+
const queryKey = queryOptions?.queryKey ?? getListPublicPlansPlansPublicGetQueryKey(params);
|
|
1079
|
+
const queryFn = ({ signal }) => listPublicPlansPlansPublicGet(params, { signal, ...axiosOptions });
|
|
1080
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1081
|
+
};
|
|
1082
|
+
/**
|
|
1083
|
+
* @summary List Public Plans
|
|
1084
|
+
*/
|
|
1085
|
+
export function useListPublicPlansPlansPublicGet(params, options) {
|
|
1086
|
+
const queryOptions = getListPublicPlansPlansPublicGetQueryOptions(params, options);
|
|
1087
|
+
const query = useQuery(queryOptions);
|
|
1088
|
+
query.queryKey = queryOptions.queryKey;
|
|
1089
|
+
return query;
|
|
1090
|
+
}
|
|
1091
|
+
/**
|
|
1092
|
+
* Copy a recipe I can see (public, or my own) into my library
|
|
1093
|
+
(D3: Spotify-playlist-style). The copy starts private, records
|
|
1094
|
+
provenance (source=forked, forked_from_recipe_id), and is fully
|
|
1095
|
+
independent of the original.
|
|
1096
|
+
* @summary Fork Recipe
|
|
1097
|
+
*/
|
|
1098
|
+
export const forkRecipeRecipesRecipeIdForkPost = (recipeId, options) => {
|
|
1099
|
+
return axios.post(`/recipes/${recipeId}/fork`, undefined, options);
|
|
1100
|
+
};
|
|
1101
|
+
export const getForkRecipeRecipesRecipeIdForkPostMutationOptions = (options) => {
|
|
1102
|
+
const mutationKey = ['forkRecipeRecipesRecipeIdForkPost'];
|
|
615
1103
|
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
616
1104
|
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
617
1105
|
options
|
|
@@ -619,15 +1107,1624 @@ export const getDeleteRecipeRecipesRecipeIdDeleteMutationOptions = (options) =>
|
|
|
619
1107
|
: { mutation: { mutationKey, }, axios: undefined };
|
|
620
1108
|
const mutationFn = (props) => {
|
|
621
1109
|
const { recipeId } = props ?? {};
|
|
622
|
-
return
|
|
1110
|
+
return forkRecipeRecipesRecipeIdForkPost(recipeId, axiosOptions);
|
|
623
1111
|
};
|
|
624
1112
|
return { mutationFn, ...mutationOptions };
|
|
625
1113
|
};
|
|
626
1114
|
/**
|
|
627
|
-
* @summary
|
|
1115
|
+
* @summary Fork Recipe
|
|
628
1116
|
*/
|
|
629
|
-
export const
|
|
630
|
-
const mutationOptions =
|
|
1117
|
+
export const useForkRecipeRecipesRecipeIdForkPost = (options) => {
|
|
1118
|
+
const mutationOptions = getForkRecipeRecipesRecipeIdForkPostMutationOptions(options);
|
|
1119
|
+
return useMutation(mutationOptions);
|
|
1120
|
+
};
|
|
1121
|
+
/**
|
|
1122
|
+
* Copy a plan I can see (public / preset / my own) into my household.
|
|
1123
|
+
User-recipe slots are forked along (so the copy stays independent);
|
|
1124
|
+
catalog references stay (global); slots pointing at recipes I cannot see
|
|
1125
|
+
become explicit skips.
|
|
1126
|
+
* @summary Fork Plan
|
|
1127
|
+
*/
|
|
1128
|
+
export const forkPlanPlansPlanIdForkPost = (planId, options) => {
|
|
1129
|
+
return axios.post(`/plans/${planId}/fork`, undefined, options);
|
|
1130
|
+
};
|
|
1131
|
+
export const getForkPlanPlansPlanIdForkPostMutationOptions = (options) => {
|
|
1132
|
+
const mutationKey = ['forkPlanPlansPlanIdForkPost'];
|
|
1133
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1134
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1135
|
+
options
|
|
1136
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1137
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1138
|
+
const mutationFn = (props) => {
|
|
1139
|
+
const { planId } = props ?? {};
|
|
1140
|
+
return forkPlanPlansPlanIdForkPost(planId, axiosOptions);
|
|
1141
|
+
};
|
|
1142
|
+
return { mutationFn, ...mutationOptions };
|
|
1143
|
+
};
|
|
1144
|
+
/**
|
|
1145
|
+
* @summary Fork Plan
|
|
1146
|
+
*/
|
|
1147
|
+
export const useForkPlanPlansPlanIdForkPost = (options) => {
|
|
1148
|
+
const mutationOptions = getForkPlanPlansPlanIdForkPostMutationOptions(options);
|
|
1149
|
+
return useMutation(mutationOptions);
|
|
1150
|
+
};
|
|
1151
|
+
/**
|
|
1152
|
+
* Favorite a recipe or plan I can see (own private + public โ ยง5.7).
|
|
1153
|
+
Idempotent: re-adding returns the existing favorite.
|
|
1154
|
+
* @summary Add Favorite
|
|
1155
|
+
*/
|
|
1156
|
+
export const addFavoriteFavoritesTargetTypeTargetIdPost = (targetType, targetId, options) => {
|
|
1157
|
+
return axios.post(`/favorites/${targetType}/${targetId}`, undefined, options);
|
|
1158
|
+
};
|
|
1159
|
+
export const getAddFavoriteFavoritesTargetTypeTargetIdPostMutationOptions = (options) => {
|
|
1160
|
+
const mutationKey = ['addFavoriteFavoritesTargetTypeTargetIdPost'];
|
|
1161
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1162
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1163
|
+
options
|
|
1164
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1165
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1166
|
+
const mutationFn = (props) => {
|
|
1167
|
+
const { targetType, targetId } = props ?? {};
|
|
1168
|
+
return addFavoriteFavoritesTargetTypeTargetIdPost(targetType, targetId, axiosOptions);
|
|
1169
|
+
};
|
|
1170
|
+
return { mutationFn, ...mutationOptions };
|
|
1171
|
+
};
|
|
1172
|
+
/**
|
|
1173
|
+
* @summary Add Favorite
|
|
1174
|
+
*/
|
|
1175
|
+
export const useAddFavoriteFavoritesTargetTypeTargetIdPost = (options) => {
|
|
1176
|
+
const mutationOptions = getAddFavoriteFavoritesTargetTypeTargetIdPostMutationOptions(options);
|
|
1177
|
+
return useMutation(mutationOptions);
|
|
1178
|
+
};
|
|
1179
|
+
/**
|
|
1180
|
+
* @summary Remove Favorite
|
|
1181
|
+
*/
|
|
1182
|
+
export const removeFavoriteFavoritesTargetTypeTargetIdDelete = (targetType, targetId, options) => {
|
|
1183
|
+
return axios.delete(`/favorites/${targetType}/${targetId}`, options);
|
|
1184
|
+
};
|
|
1185
|
+
export const getRemoveFavoriteFavoritesTargetTypeTargetIdDeleteMutationOptions = (options) => {
|
|
1186
|
+
const mutationKey = ['removeFavoriteFavoritesTargetTypeTargetIdDelete'];
|
|
1187
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1188
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1189
|
+
options
|
|
1190
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1191
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1192
|
+
const mutationFn = (props) => {
|
|
1193
|
+
const { targetType, targetId } = props ?? {};
|
|
1194
|
+
return removeFavoriteFavoritesTargetTypeTargetIdDelete(targetType, targetId, axiosOptions);
|
|
1195
|
+
};
|
|
1196
|
+
return { mutationFn, ...mutationOptions };
|
|
1197
|
+
};
|
|
1198
|
+
/**
|
|
1199
|
+
* @summary Remove Favorite
|
|
1200
|
+
*/
|
|
1201
|
+
export const useRemoveFavoriteFavoritesTargetTypeTargetIdDelete = (options) => {
|
|
1202
|
+
const mutationOptions = getRemoveFavoriteFavoritesTargetTypeTargetIdDeleteMutationOptions(options);
|
|
1203
|
+
return useMutation(mutationOptions);
|
|
1204
|
+
};
|
|
1205
|
+
/**
|
|
1206
|
+
* My favorites. Targets that went private since I favorited them are
|
|
1207
|
+
hidden (they stay valid for users who can still see them โ ยง12).
|
|
1208
|
+
* @summary List Favorites
|
|
1209
|
+
*/
|
|
1210
|
+
export const listFavoritesFavoritesGet = (params, options) => {
|
|
1211
|
+
return axios.get(`/favorites/`, {
|
|
1212
|
+
...options,
|
|
1213
|
+
params: { ...params, ...options?.params },
|
|
1214
|
+
});
|
|
1215
|
+
};
|
|
1216
|
+
export const getListFavoritesFavoritesGetQueryKey = (params) => {
|
|
1217
|
+
return [
|
|
1218
|
+
`/favorites/`, ...(params ? [params] : [])
|
|
1219
|
+
];
|
|
1220
|
+
};
|
|
1221
|
+
export const getListFavoritesFavoritesGetQueryOptions = (params, options) => {
|
|
1222
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1223
|
+
const queryKey = queryOptions?.queryKey ?? getListFavoritesFavoritesGetQueryKey(params);
|
|
1224
|
+
const queryFn = ({ signal }) => listFavoritesFavoritesGet(params, { signal, ...axiosOptions });
|
|
1225
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1226
|
+
};
|
|
1227
|
+
/**
|
|
1228
|
+
* @summary List Favorites
|
|
1229
|
+
*/
|
|
1230
|
+
export function useListFavoritesFavoritesGet(params, options) {
|
|
1231
|
+
const queryOptions = getListFavoritesFavoritesGetQueryOptions(params, options);
|
|
1232
|
+
const query = useQuery(queryOptions);
|
|
1233
|
+
query.queryKey = queryOptions.queryKey;
|
|
1234
|
+
return query;
|
|
1235
|
+
}
|
|
1236
|
+
/**
|
|
1237
|
+
* Upsert my rating (stars 1..5 + optional detailed review โ D3) on
|
|
1238
|
+
anything I can see (own private + public).
|
|
1239
|
+
* @summary Upsert Rating
|
|
1240
|
+
*/
|
|
1241
|
+
export const upsertRatingRatingsTargetTypeTargetIdPut = (targetType, targetId, ratingUpsert, options) => {
|
|
1242
|
+
return axios.put(`/ratings/${targetType}/${targetId}`, ratingUpsert, options);
|
|
1243
|
+
};
|
|
1244
|
+
export const getUpsertRatingRatingsTargetTypeTargetIdPutMutationOptions = (options) => {
|
|
1245
|
+
const mutationKey = ['upsertRatingRatingsTargetTypeTargetIdPut'];
|
|
1246
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1247
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1248
|
+
options
|
|
1249
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1250
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1251
|
+
const mutationFn = (props) => {
|
|
1252
|
+
const { targetType, targetId, data } = props ?? {};
|
|
1253
|
+
return upsertRatingRatingsTargetTypeTargetIdPut(targetType, targetId, data, axiosOptions);
|
|
1254
|
+
};
|
|
1255
|
+
return { mutationFn, ...mutationOptions };
|
|
1256
|
+
};
|
|
1257
|
+
/**
|
|
1258
|
+
* @summary Upsert Rating
|
|
1259
|
+
*/
|
|
1260
|
+
export const useUpsertRatingRatingsTargetTypeTargetIdPut = (options) => {
|
|
1261
|
+
const mutationOptions = getUpsertRatingRatingsTargetTypeTargetIdPutMutationOptions(options);
|
|
1262
|
+
return useMutation(mutationOptions);
|
|
1263
|
+
};
|
|
1264
|
+
/**
|
|
1265
|
+
* Delete my rating (review photos and their files go with it).
|
|
1266
|
+
* @summary Delete Rating
|
|
1267
|
+
*/
|
|
1268
|
+
export const deleteRatingRatingsTargetTypeTargetIdDelete = (targetType, targetId, options) => {
|
|
1269
|
+
return axios.delete(`/ratings/${targetType}/${targetId}`, options);
|
|
1270
|
+
};
|
|
1271
|
+
export const getDeleteRatingRatingsTargetTypeTargetIdDeleteMutationOptions = (options) => {
|
|
1272
|
+
const mutationKey = ['deleteRatingRatingsTargetTypeTargetIdDelete'];
|
|
1273
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1274
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1275
|
+
options
|
|
1276
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1277
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1278
|
+
const mutationFn = (props) => {
|
|
1279
|
+
const { targetType, targetId } = props ?? {};
|
|
1280
|
+
return deleteRatingRatingsTargetTypeTargetIdDelete(targetType, targetId, axiosOptions);
|
|
1281
|
+
};
|
|
1282
|
+
return { mutationFn, ...mutationOptions };
|
|
1283
|
+
};
|
|
1284
|
+
/**
|
|
1285
|
+
* @summary Delete Rating
|
|
1286
|
+
*/
|
|
1287
|
+
export const useDeleteRatingRatingsTargetTypeTargetIdDelete = (options) => {
|
|
1288
|
+
const mutationOptions = getDeleteRatingRatingsTargetTypeTargetIdDeleteMutationOptions(options);
|
|
1289
|
+
return useMutation(mutationOptions);
|
|
1290
|
+
};
|
|
1291
|
+
/**
|
|
1292
|
+
* Aggregate {average, count, my_rating} + recent reviews with their
|
|
1293
|
+
photos. 404 for targets I cannot see (ยง12 go-private rule).
|
|
1294
|
+
* @summary Get Rating Aggregate
|
|
1295
|
+
*/
|
|
1296
|
+
export const getRatingAggregateRatingsTargetTypeTargetIdGet = (targetType, targetId, options) => {
|
|
1297
|
+
return axios.get(`/ratings/${targetType}/${targetId}`, options);
|
|
1298
|
+
};
|
|
1299
|
+
export const getGetRatingAggregateRatingsTargetTypeTargetIdGetQueryKey = (targetType, targetId) => {
|
|
1300
|
+
return [
|
|
1301
|
+
`/ratings/${targetType}/${targetId}`
|
|
1302
|
+
];
|
|
1303
|
+
};
|
|
1304
|
+
export const getGetRatingAggregateRatingsTargetTypeTargetIdGetQueryOptions = (targetType, targetId, options) => {
|
|
1305
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1306
|
+
const queryKey = queryOptions?.queryKey ?? getGetRatingAggregateRatingsTargetTypeTargetIdGetQueryKey(targetType, targetId);
|
|
1307
|
+
const queryFn = ({ signal }) => getRatingAggregateRatingsTargetTypeTargetIdGet(targetType, targetId, { signal, ...axiosOptions });
|
|
1308
|
+
return { queryKey, queryFn, enabled: !!(targetType && targetId), ...queryOptions };
|
|
1309
|
+
};
|
|
1310
|
+
/**
|
|
1311
|
+
* @summary Get Rating Aggregate
|
|
1312
|
+
*/
|
|
1313
|
+
export function useGetRatingAggregateRatingsTargetTypeTargetIdGet(targetType, targetId, options) {
|
|
1314
|
+
const queryOptions = getGetRatingAggregateRatingsTargetTypeTargetIdGetQueryOptions(targetType, targetId, options);
|
|
1315
|
+
const query = useQuery(queryOptions);
|
|
1316
|
+
query.queryKey = queryOptions.queryKey;
|
|
1317
|
+
return query;
|
|
1318
|
+
}
|
|
1319
|
+
/**
|
|
1320
|
+
* Attach a photo to MY review on the target (D3 cook-along photos:
|
|
1321
|
+
optional ``step_index`` for the instruction step + optional caption).
|
|
1322
|
+
Uses the existing storage MIME/size validation (400/413).
|
|
1323
|
+
* @summary Add Rating Photo
|
|
1324
|
+
*/
|
|
1325
|
+
export const addRatingPhotoRatingsTargetTypeTargetIdPhotosPost = (targetType, targetId, bodyAddRatingPhotoRatingsTargetTypeTargetIdPhotosPost, options) => {
|
|
1326
|
+
const formData = new FormData();
|
|
1327
|
+
formData.append(`file`, bodyAddRatingPhotoRatingsTargetTypeTargetIdPhotosPost.file);
|
|
1328
|
+
if (bodyAddRatingPhotoRatingsTargetTypeTargetIdPhotosPost.step_index !== undefined && bodyAddRatingPhotoRatingsTargetTypeTargetIdPhotosPost.step_index !== null) {
|
|
1329
|
+
formData.append(`step_index`, bodyAddRatingPhotoRatingsTargetTypeTargetIdPhotosPost.step_index.toString());
|
|
1330
|
+
}
|
|
1331
|
+
if (bodyAddRatingPhotoRatingsTargetTypeTargetIdPhotosPost.caption !== undefined && bodyAddRatingPhotoRatingsTargetTypeTargetIdPhotosPost.caption !== null) {
|
|
1332
|
+
formData.append(`caption`, bodyAddRatingPhotoRatingsTargetTypeTargetIdPhotosPost.caption);
|
|
1333
|
+
}
|
|
1334
|
+
return axios.post(`/ratings/${targetType}/${targetId}/photos`, formData, options);
|
|
1335
|
+
};
|
|
1336
|
+
export const getAddRatingPhotoRatingsTargetTypeTargetIdPhotosPostMutationOptions = (options) => {
|
|
1337
|
+
const mutationKey = ['addRatingPhotoRatingsTargetTypeTargetIdPhotosPost'];
|
|
1338
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1339
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1340
|
+
options
|
|
1341
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1342
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1343
|
+
const mutationFn = (props) => {
|
|
1344
|
+
const { targetType, targetId, data } = props ?? {};
|
|
1345
|
+
return addRatingPhotoRatingsTargetTypeTargetIdPhotosPost(targetType, targetId, data, axiosOptions);
|
|
1346
|
+
};
|
|
1347
|
+
return { mutationFn, ...mutationOptions };
|
|
1348
|
+
};
|
|
1349
|
+
/**
|
|
1350
|
+
* @summary Add Rating Photo
|
|
1351
|
+
*/
|
|
1352
|
+
export const useAddRatingPhotoRatingsTargetTypeTargetIdPhotosPost = (options) => {
|
|
1353
|
+
const mutationOptions = getAddRatingPhotoRatingsTargetTypeTargetIdPhotosPostMutationOptions(options);
|
|
1354
|
+
return useMutation(mutationOptions);
|
|
1355
|
+
};
|
|
1356
|
+
/**
|
|
1357
|
+
* @summary Get Recipe Image
|
|
1358
|
+
*/
|
|
1359
|
+
export const getRecipeImageRecipesRecipeImageFilenameGet = (filename, options) => {
|
|
1360
|
+
return axios.get(`/recipes/recipe-image/${filename}`, options);
|
|
1361
|
+
};
|
|
1362
|
+
export const getGetRecipeImageRecipesRecipeImageFilenameGetQueryKey = (filename) => {
|
|
1363
|
+
return [
|
|
1364
|
+
`/recipes/recipe-image/${filename}`
|
|
1365
|
+
];
|
|
1366
|
+
};
|
|
1367
|
+
export const getGetRecipeImageRecipesRecipeImageFilenameGetQueryOptions = (filename, options) => {
|
|
1368
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1369
|
+
const queryKey = queryOptions?.queryKey ?? getGetRecipeImageRecipesRecipeImageFilenameGetQueryKey(filename);
|
|
1370
|
+
const queryFn = ({ signal }) => getRecipeImageRecipesRecipeImageFilenameGet(filename, { signal, ...axiosOptions });
|
|
1371
|
+
return { queryKey, queryFn, enabled: !!(filename), ...queryOptions };
|
|
1372
|
+
};
|
|
1373
|
+
/**
|
|
1374
|
+
* @summary Get Recipe Image
|
|
1375
|
+
*/
|
|
1376
|
+
export function useGetRecipeImageRecipesRecipeImageFilenameGet(filename, options) {
|
|
1377
|
+
const queryOptions = getGetRecipeImageRecipesRecipeImageFilenameGetQueryOptions(filename, options);
|
|
1378
|
+
const query = useQuery(queryOptions);
|
|
1379
|
+
query.queryKey = queryOptions.queryKey;
|
|
1380
|
+
return query;
|
|
1381
|
+
}
|
|
1382
|
+
/**
|
|
1383
|
+
* @summary Search Pantry Items
|
|
1384
|
+
*/
|
|
1385
|
+
export const searchPantryItemsRecipesPantrySearchGet = (params, options) => {
|
|
1386
|
+
return axios.get(`/recipes/pantry/search`, {
|
|
1387
|
+
...options,
|
|
1388
|
+
params: { ...params, ...options?.params },
|
|
1389
|
+
});
|
|
1390
|
+
};
|
|
1391
|
+
export const getSearchPantryItemsRecipesPantrySearchGetQueryKey = (params) => {
|
|
1392
|
+
return [
|
|
1393
|
+
`/recipes/pantry/search`, ...(params ? [params] : [])
|
|
1394
|
+
];
|
|
1395
|
+
};
|
|
1396
|
+
export const getSearchPantryItemsRecipesPantrySearchGetQueryOptions = (params, options) => {
|
|
1397
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1398
|
+
const queryKey = queryOptions?.queryKey ?? getSearchPantryItemsRecipesPantrySearchGetQueryKey(params);
|
|
1399
|
+
const queryFn = ({ signal }) => searchPantryItemsRecipesPantrySearchGet(params, { signal, ...axiosOptions });
|
|
1400
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1401
|
+
};
|
|
1402
|
+
/**
|
|
1403
|
+
* @summary Search Pantry Items
|
|
1404
|
+
*/
|
|
1405
|
+
export function useSearchPantryItemsRecipesPantrySearchGet(params, options) {
|
|
1406
|
+
const queryOptions = getSearchPantryItemsRecipesPantrySearchGetQueryOptions(params, options);
|
|
1407
|
+
const query = useQuery(queryOptions);
|
|
1408
|
+
query.queryKey = queryOptions.queryKey;
|
|
1409
|
+
return query;
|
|
1410
|
+
}
|
|
1411
|
+
/**
|
|
1412
|
+
* @summary Create Recipe
|
|
1413
|
+
*/
|
|
1414
|
+
export const createRecipeRecipesPost = (bodyCreateRecipeRecipesPost, options) => {
|
|
1415
|
+
const formData = new FormData();
|
|
1416
|
+
formData.append(`name`, bodyCreateRecipeRecipesPost.name);
|
|
1417
|
+
formData.append(`cuisine`, bodyCreateRecipeRecipesPost.cuisine);
|
|
1418
|
+
formData.append(`instructions`, bodyCreateRecipeRecipesPost.instructions);
|
|
1419
|
+
formData.append(`ingredients`, bodyCreateRecipeRecipesPost.ingredients);
|
|
1420
|
+
if (bodyCreateRecipeRecipesPost.prep_time !== undefined) {
|
|
1421
|
+
formData.append(`prep_time`, bodyCreateRecipeRecipesPost.prep_time.toString());
|
|
1422
|
+
}
|
|
1423
|
+
if (bodyCreateRecipeRecipesPost.cook_time !== undefined) {
|
|
1424
|
+
formData.append(`cook_time`, bodyCreateRecipeRecipesPost.cook_time.toString());
|
|
1425
|
+
}
|
|
1426
|
+
if (bodyCreateRecipeRecipesPost.servings !== undefined) {
|
|
1427
|
+
formData.append(`servings`, bodyCreateRecipeRecipesPost.servings.toString());
|
|
1428
|
+
}
|
|
1429
|
+
if (bodyCreateRecipeRecipesPost.image !== undefined) {
|
|
1430
|
+
formData.append(`image`, bodyCreateRecipeRecipesPost.image);
|
|
1431
|
+
}
|
|
1432
|
+
return axios.post(`/recipes/`, formData, options);
|
|
1433
|
+
};
|
|
1434
|
+
export const getCreateRecipeRecipesPostMutationOptions = (options) => {
|
|
1435
|
+
const mutationKey = ['createRecipeRecipesPost'];
|
|
1436
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1437
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1438
|
+
options
|
|
1439
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1440
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1441
|
+
const mutationFn = (props) => {
|
|
1442
|
+
const { data } = props ?? {};
|
|
1443
|
+
return createRecipeRecipesPost(data, axiosOptions);
|
|
1444
|
+
};
|
|
1445
|
+
return { mutationFn, ...mutationOptions };
|
|
1446
|
+
};
|
|
1447
|
+
/**
|
|
1448
|
+
* @summary Create Recipe
|
|
1449
|
+
*/
|
|
1450
|
+
export const useCreateRecipeRecipesPost = (options) => {
|
|
1451
|
+
const mutationOptions = getCreateRecipeRecipesPostMutationOptions(options);
|
|
1452
|
+
return useMutation(mutationOptions);
|
|
1453
|
+
};
|
|
1454
|
+
/**
|
|
1455
|
+
* @summary Get Recipes
|
|
1456
|
+
*/
|
|
1457
|
+
export const getRecipesRecipesGet = (params, options) => {
|
|
1458
|
+
return axios.get(`/recipes/`, {
|
|
1459
|
+
...options,
|
|
1460
|
+
params: { ...params, ...options?.params },
|
|
1461
|
+
});
|
|
1462
|
+
};
|
|
1463
|
+
export const getGetRecipesRecipesGetQueryKey = (params) => {
|
|
1464
|
+
return [
|
|
1465
|
+
`/recipes/`, ...(params ? [params] : [])
|
|
1466
|
+
];
|
|
1467
|
+
};
|
|
1468
|
+
export const getGetRecipesRecipesGetQueryOptions = (params, options) => {
|
|
1469
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1470
|
+
const queryKey = queryOptions?.queryKey ?? getGetRecipesRecipesGetQueryKey(params);
|
|
1471
|
+
const queryFn = ({ signal }) => getRecipesRecipesGet(params, { signal, ...axiosOptions });
|
|
1472
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1473
|
+
};
|
|
1474
|
+
/**
|
|
1475
|
+
* @summary Get Recipes
|
|
1476
|
+
*/
|
|
1477
|
+
export function useGetRecipesRecipesGet(params, options) {
|
|
1478
|
+
const queryOptions = getGetRecipesRecipesGetQueryOptions(params, options);
|
|
1479
|
+
const query = useQuery(queryOptions);
|
|
1480
|
+
query.queryKey = queryOptions.queryKey;
|
|
1481
|
+
return query;
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Deterministic 'what can I cook' โ coverage ranking over the catalog
|
|
1485
|
+
and the household's own recipes against its pantry (blueprint ยง5.3).
|
|
1486
|
+
Pure SQL, no LLM; this is also the no-LLM degraded path behind
|
|
1487
|
+
/ai/suggest-recipes (ยง9.1).
|
|
1488
|
+
* @summary Get Recipe Suggestions
|
|
1489
|
+
*/
|
|
1490
|
+
export const getRecipeSuggestionsRecipesSuggestionsGet = (params, options) => {
|
|
1491
|
+
return axios.get(`/recipes/suggestions`, {
|
|
1492
|
+
...options,
|
|
1493
|
+
params: { ...params, ...options?.params },
|
|
1494
|
+
});
|
|
1495
|
+
};
|
|
1496
|
+
export const getGetRecipeSuggestionsRecipesSuggestionsGetQueryKey = (params) => {
|
|
1497
|
+
return [
|
|
1498
|
+
`/recipes/suggestions`, ...(params ? [params] : [])
|
|
1499
|
+
];
|
|
1500
|
+
};
|
|
1501
|
+
export const getGetRecipeSuggestionsRecipesSuggestionsGetQueryOptions = (params, options) => {
|
|
1502
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1503
|
+
const queryKey = queryOptions?.queryKey ?? getGetRecipeSuggestionsRecipesSuggestionsGetQueryKey(params);
|
|
1504
|
+
const queryFn = ({ signal }) => getRecipeSuggestionsRecipesSuggestionsGet(params, { signal, ...axiosOptions });
|
|
1505
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1506
|
+
};
|
|
1507
|
+
/**
|
|
1508
|
+
* @summary Get Recipe Suggestions
|
|
1509
|
+
*/
|
|
1510
|
+
export function useGetRecipeSuggestionsRecipesSuggestionsGet(params, options) {
|
|
1511
|
+
const queryOptions = getGetRecipeSuggestionsRecipesSuggestionsGetQueryOptions(params, options);
|
|
1512
|
+
const query = useQuery(queryOptions);
|
|
1513
|
+
query.queryKey = queryOptions.queryKey;
|
|
1514
|
+
return query;
|
|
1515
|
+
}
|
|
1516
|
+
/**
|
|
1517
|
+
* @summary Get Recipe
|
|
1518
|
+
*/
|
|
1519
|
+
export const getRecipeRecipesRecipeIdGet = (recipeId, options) => {
|
|
1520
|
+
return axios.get(`/recipes/${recipeId}`, options);
|
|
1521
|
+
};
|
|
1522
|
+
export const getGetRecipeRecipesRecipeIdGetQueryKey = (recipeId) => {
|
|
1523
|
+
return [
|
|
1524
|
+
`/recipes/${recipeId}`
|
|
1525
|
+
];
|
|
1526
|
+
};
|
|
1527
|
+
export const getGetRecipeRecipesRecipeIdGetQueryOptions = (recipeId, options) => {
|
|
1528
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1529
|
+
const queryKey = queryOptions?.queryKey ?? getGetRecipeRecipesRecipeIdGetQueryKey(recipeId);
|
|
1530
|
+
const queryFn = ({ signal }) => getRecipeRecipesRecipeIdGet(recipeId, { signal, ...axiosOptions });
|
|
1531
|
+
return { queryKey, queryFn, enabled: !!(recipeId), ...queryOptions };
|
|
1532
|
+
};
|
|
1533
|
+
/**
|
|
1534
|
+
* @summary Get Recipe
|
|
1535
|
+
*/
|
|
1536
|
+
export function useGetRecipeRecipesRecipeIdGet(recipeId, options) {
|
|
1537
|
+
const queryOptions = getGetRecipeRecipesRecipeIdGetQueryOptions(recipeId, options);
|
|
1538
|
+
const query = useQuery(queryOptions);
|
|
1539
|
+
query.queryKey = queryOptions.queryKey;
|
|
1540
|
+
return query;
|
|
1541
|
+
}
|
|
1542
|
+
/**
|
|
1543
|
+
* @summary Update Recipe
|
|
1544
|
+
*/
|
|
1545
|
+
export const updateRecipeRecipesRecipeIdPut = (recipeId, bodyUpdateRecipeRecipesRecipeIdPut, options) => {
|
|
1546
|
+
const formData = new FormData();
|
|
1547
|
+
if (bodyUpdateRecipeRecipesRecipeIdPut.name !== undefined) {
|
|
1548
|
+
formData.append(`name`, bodyUpdateRecipeRecipesRecipeIdPut.name);
|
|
1549
|
+
}
|
|
1550
|
+
if (bodyUpdateRecipeRecipesRecipeIdPut.cuisine !== undefined && bodyUpdateRecipeRecipesRecipeIdPut.cuisine !== null) {
|
|
1551
|
+
formData.append(`cuisine`, bodyUpdateRecipeRecipesRecipeIdPut.cuisine);
|
|
1552
|
+
}
|
|
1553
|
+
if (bodyUpdateRecipeRecipesRecipeIdPut.instructions !== undefined) {
|
|
1554
|
+
formData.append(`instructions`, bodyUpdateRecipeRecipesRecipeIdPut.instructions);
|
|
1555
|
+
}
|
|
1556
|
+
if (bodyUpdateRecipeRecipesRecipeIdPut.ingredients !== undefined) {
|
|
1557
|
+
formData.append(`ingredients`, bodyUpdateRecipeRecipesRecipeIdPut.ingredients);
|
|
1558
|
+
}
|
|
1559
|
+
if (bodyUpdateRecipeRecipesRecipeIdPut.prep_time !== undefined) {
|
|
1560
|
+
formData.append(`prep_time`, bodyUpdateRecipeRecipesRecipeIdPut.prep_time.toString());
|
|
1561
|
+
}
|
|
1562
|
+
if (bodyUpdateRecipeRecipesRecipeIdPut.cook_time !== undefined) {
|
|
1563
|
+
formData.append(`cook_time`, bodyUpdateRecipeRecipesRecipeIdPut.cook_time.toString());
|
|
1564
|
+
}
|
|
1565
|
+
if (bodyUpdateRecipeRecipesRecipeIdPut.servings !== undefined) {
|
|
1566
|
+
formData.append(`servings`, bodyUpdateRecipeRecipesRecipeIdPut.servings.toString());
|
|
1567
|
+
}
|
|
1568
|
+
if (bodyUpdateRecipeRecipesRecipeIdPut.image !== undefined) {
|
|
1569
|
+
formData.append(`image`, bodyUpdateRecipeRecipesRecipeIdPut.image);
|
|
1570
|
+
}
|
|
1571
|
+
if (bodyUpdateRecipeRecipesRecipeIdPut.clear_image !== undefined && bodyUpdateRecipeRecipesRecipeIdPut.clear_image !== null) {
|
|
1572
|
+
formData.append(`clear_image`, bodyUpdateRecipeRecipesRecipeIdPut.clear_image);
|
|
1573
|
+
}
|
|
1574
|
+
return axios.put(`/recipes/${recipeId}`, formData, options);
|
|
1575
|
+
};
|
|
1576
|
+
export const getUpdateRecipeRecipesRecipeIdPutMutationOptions = (options) => {
|
|
1577
|
+
const mutationKey = ['updateRecipeRecipesRecipeIdPut'];
|
|
1578
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1579
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1580
|
+
options
|
|
1581
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1582
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1583
|
+
const mutationFn = (props) => {
|
|
1584
|
+
const { recipeId, data } = props ?? {};
|
|
1585
|
+
return updateRecipeRecipesRecipeIdPut(recipeId, data, axiosOptions);
|
|
1586
|
+
};
|
|
1587
|
+
return { mutationFn, ...mutationOptions };
|
|
1588
|
+
};
|
|
1589
|
+
/**
|
|
1590
|
+
* @summary Update Recipe
|
|
1591
|
+
*/
|
|
1592
|
+
export const useUpdateRecipeRecipesRecipeIdPut = (options) => {
|
|
1593
|
+
const mutationOptions = getUpdateRecipeRecipesRecipeIdPutMutationOptions(options);
|
|
1594
|
+
return useMutation(mutationOptions);
|
|
1595
|
+
};
|
|
1596
|
+
/**
|
|
1597
|
+
* @summary Delete Recipe
|
|
1598
|
+
*/
|
|
1599
|
+
export const deleteRecipeRecipesRecipeIdDelete = (recipeId, options) => {
|
|
1600
|
+
return axios.delete(`/recipes/${recipeId}`, options);
|
|
1601
|
+
};
|
|
1602
|
+
export const getDeleteRecipeRecipesRecipeIdDeleteMutationOptions = (options) => {
|
|
1603
|
+
const mutationKey = ['deleteRecipeRecipesRecipeIdDelete'];
|
|
1604
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1605
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1606
|
+
options
|
|
1607
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1608
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1609
|
+
const mutationFn = (props) => {
|
|
1610
|
+
const { recipeId } = props ?? {};
|
|
1611
|
+
return deleteRecipeRecipesRecipeIdDelete(recipeId, axiosOptions);
|
|
1612
|
+
};
|
|
1613
|
+
return { mutationFn, ...mutationOptions };
|
|
1614
|
+
};
|
|
1615
|
+
/**
|
|
1616
|
+
* @summary Delete Recipe
|
|
1617
|
+
*/
|
|
1618
|
+
export const useDeleteRecipeRecipesRecipeIdDelete = (options) => {
|
|
1619
|
+
const mutationOptions = getDeleteRecipeRecipesRecipeIdDeleteMutationOptions(options);
|
|
1620
|
+
return useMutation(mutationOptions);
|
|
1621
|
+
};
|
|
1622
|
+
/**
|
|
1623
|
+
* One-tap gap fill: bulk-add this recipe's missing ingredients to a
|
|
1624
|
+
shopping list (defaults to the household's active list โ ยง5.3).
|
|
1625
|
+
* @summary Add Missing To List
|
|
1626
|
+
*/
|
|
1627
|
+
export const addMissingToListRecipesRecipeIdAddMissingToListPost = (recipeId, addMissingRequest, options) => {
|
|
1628
|
+
return axios.post(`/recipes/${recipeId}/add-missing-to-list`, addMissingRequest, options);
|
|
1629
|
+
};
|
|
1630
|
+
export const getAddMissingToListRecipesRecipeIdAddMissingToListPostMutationOptions = (options) => {
|
|
1631
|
+
const mutationKey = ['addMissingToListRecipesRecipeIdAddMissingToListPost'];
|
|
1632
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1633
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1634
|
+
options
|
|
1635
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1636
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1637
|
+
const mutationFn = (props) => {
|
|
1638
|
+
const { recipeId, data } = props ?? {};
|
|
1639
|
+
return addMissingToListRecipesRecipeIdAddMissingToListPost(recipeId, data, axiosOptions);
|
|
1640
|
+
};
|
|
1641
|
+
return { mutationFn, ...mutationOptions };
|
|
1642
|
+
};
|
|
1643
|
+
/**
|
|
1644
|
+
* @summary Add Missing To List
|
|
1645
|
+
*/
|
|
1646
|
+
export const useAddMissingToListRecipesRecipeIdAddMissingToListPost = (options) => {
|
|
1647
|
+
const mutationOptions = getAddMissingToListRecipesRecipeIdAddMissingToListPostMutationOptions(options);
|
|
1648
|
+
return useMutation(mutationOptions);
|
|
1649
|
+
};
|
|
1650
|
+
/**
|
|
1651
|
+
* List/search canonical ingredients (autocomplete source).
|
|
1652
|
+
* @summary List Ingredients
|
|
1653
|
+
*/
|
|
1654
|
+
export const listIngredientsCatalogIngredientsGet = (params, options) => {
|
|
1655
|
+
return axios.get(`/catalog/ingredients/`, {
|
|
1656
|
+
...options,
|
|
1657
|
+
params: { ...params, ...options?.params },
|
|
1658
|
+
});
|
|
1659
|
+
};
|
|
1660
|
+
export const getListIngredientsCatalogIngredientsGetQueryKey = (params) => {
|
|
1661
|
+
return [
|
|
1662
|
+
`/catalog/ingredients/`, ...(params ? [params] : [])
|
|
1663
|
+
];
|
|
1664
|
+
};
|
|
1665
|
+
export const getListIngredientsCatalogIngredientsGetQueryOptions = (params, options) => {
|
|
1666
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1667
|
+
const queryKey = queryOptions?.queryKey ?? getListIngredientsCatalogIngredientsGetQueryKey(params);
|
|
1668
|
+
const queryFn = ({ signal }) => listIngredientsCatalogIngredientsGet(params, { signal, ...axiosOptions });
|
|
1669
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1670
|
+
};
|
|
1671
|
+
/**
|
|
1672
|
+
* @summary List Ingredients
|
|
1673
|
+
*/
|
|
1674
|
+
export function useListIngredientsCatalogIngredientsGet(params, options) {
|
|
1675
|
+
const queryOptions = getListIngredientsCatalogIngredientsGetQueryOptions(params, options);
|
|
1676
|
+
const query = useQuery(queryOptions);
|
|
1677
|
+
query.queryKey = queryOptions.queryKey;
|
|
1678
|
+
return query;
|
|
1679
|
+
}
|
|
1680
|
+
/**
|
|
1681
|
+
* One ingredient with its aliases and substitution edges.
|
|
1682
|
+
* @summary Get Ingredient
|
|
1683
|
+
*/
|
|
1684
|
+
export const getIngredientCatalogIngredientsIngredientIdGet = (ingredientId, options) => {
|
|
1685
|
+
return axios.get(`/catalog/ingredients/${ingredientId}`, options);
|
|
1686
|
+
};
|
|
1687
|
+
export const getGetIngredientCatalogIngredientsIngredientIdGetQueryKey = (ingredientId) => {
|
|
1688
|
+
return [
|
|
1689
|
+
`/catalog/ingredients/${ingredientId}`
|
|
1690
|
+
];
|
|
1691
|
+
};
|
|
1692
|
+
export const getGetIngredientCatalogIngredientsIngredientIdGetQueryOptions = (ingredientId, options) => {
|
|
1693
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1694
|
+
const queryKey = queryOptions?.queryKey ?? getGetIngredientCatalogIngredientsIngredientIdGetQueryKey(ingredientId);
|
|
1695
|
+
const queryFn = ({ signal }) => getIngredientCatalogIngredientsIngredientIdGet(ingredientId, { signal, ...axiosOptions });
|
|
1696
|
+
return { queryKey, queryFn, enabled: !!(ingredientId), ...queryOptions };
|
|
1697
|
+
};
|
|
1698
|
+
/**
|
|
1699
|
+
* @summary Get Ingredient
|
|
1700
|
+
*/
|
|
1701
|
+
export function useGetIngredientCatalogIngredientsIngredientIdGet(ingredientId, options) {
|
|
1702
|
+
const queryOptions = getGetIngredientCatalogIngredientsIngredientIdGetQueryOptions(ingredientId, options);
|
|
1703
|
+
const query = useQuery(queryOptions);
|
|
1704
|
+
query.queryKey = queryOptions.queryKey;
|
|
1705
|
+
return query;
|
|
1706
|
+
}
|
|
1707
|
+
/**
|
|
1708
|
+
* List catalog tags, optionally filtered by kind (cuisine|diet|course|meal_type).
|
|
1709
|
+
* @summary List Tags
|
|
1710
|
+
*/
|
|
1711
|
+
export const listTagsCatalogTagsGet = (params, options) => {
|
|
1712
|
+
return axios.get(`/catalog/tags/`, {
|
|
1713
|
+
...options,
|
|
1714
|
+
params: { ...params, ...options?.params },
|
|
1715
|
+
});
|
|
1716
|
+
};
|
|
1717
|
+
export const getListTagsCatalogTagsGetQueryKey = (params) => {
|
|
1718
|
+
return [
|
|
1719
|
+
`/catalog/tags/`, ...(params ? [params] : [])
|
|
1720
|
+
];
|
|
1721
|
+
};
|
|
1722
|
+
export const getListTagsCatalogTagsGetQueryOptions = (params, options) => {
|
|
1723
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1724
|
+
const queryKey = queryOptions?.queryKey ?? getListTagsCatalogTagsGetQueryKey(params);
|
|
1725
|
+
const queryFn = ({ signal }) => listTagsCatalogTagsGet(params, { signal, ...axiosOptions });
|
|
1726
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1727
|
+
};
|
|
1728
|
+
/**
|
|
1729
|
+
* @summary List Tags
|
|
1730
|
+
*/
|
|
1731
|
+
export function useListTagsCatalogTagsGet(params, options) {
|
|
1732
|
+
const queryOptions = getListTagsCatalogTagsGetQueryOptions(params, options);
|
|
1733
|
+
const query = useQuery(queryOptions);
|
|
1734
|
+
query.queryKey = queryOptions.queryKey;
|
|
1735
|
+
return query;
|
|
1736
|
+
}
|
|
1737
|
+
/**
|
|
1738
|
+
* Browse the recipe catalog with coverage-aware filters.
|
|
1739
|
+
* @summary List Catalog Recipes
|
|
1740
|
+
*/
|
|
1741
|
+
export const listCatalogRecipesCatalogRecipesGet = (params, options) => {
|
|
1742
|
+
return axios.get(`/catalog/recipes/`, {
|
|
1743
|
+
...options,
|
|
1744
|
+
params: { ...params, ...options?.params },
|
|
1745
|
+
});
|
|
1746
|
+
};
|
|
1747
|
+
export const getListCatalogRecipesCatalogRecipesGetQueryKey = (params) => {
|
|
1748
|
+
return [
|
|
1749
|
+
`/catalog/recipes/`, ...(params ? [params] : [])
|
|
1750
|
+
];
|
|
1751
|
+
};
|
|
1752
|
+
export const getListCatalogRecipesCatalogRecipesGetQueryOptions = (params, options) => {
|
|
1753
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1754
|
+
const queryKey = queryOptions?.queryKey ?? getListCatalogRecipesCatalogRecipesGetQueryKey(params);
|
|
1755
|
+
const queryFn = ({ signal }) => listCatalogRecipesCatalogRecipesGet(params, { signal, ...axiosOptions });
|
|
1756
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1757
|
+
};
|
|
1758
|
+
/**
|
|
1759
|
+
* @summary List Catalog Recipes
|
|
1760
|
+
*/
|
|
1761
|
+
export function useListCatalogRecipesCatalogRecipesGet(params, options) {
|
|
1762
|
+
const queryOptions = getListCatalogRecipesCatalogRecipesGetQueryOptions(params, options);
|
|
1763
|
+
const query = useQuery(queryOptions);
|
|
1764
|
+
query.queryKey = queryOptions.queryKey;
|
|
1765
|
+
return query;
|
|
1766
|
+
}
|
|
1767
|
+
/**
|
|
1768
|
+
* Full catalog recipe: linked ingredients, steps, tags, source.
|
|
1769
|
+
* @summary Get Catalog Recipe
|
|
1770
|
+
*/
|
|
1771
|
+
export const getCatalogRecipeCatalogRecipesRecipeIdGet = (recipeId, options) => {
|
|
1772
|
+
return axios.get(`/catalog/recipes/${recipeId}`, options);
|
|
1773
|
+
};
|
|
1774
|
+
export const getGetCatalogRecipeCatalogRecipesRecipeIdGetQueryKey = (recipeId) => {
|
|
1775
|
+
return [
|
|
1776
|
+
`/catalog/recipes/${recipeId}`
|
|
1777
|
+
];
|
|
1778
|
+
};
|
|
1779
|
+
export const getGetCatalogRecipeCatalogRecipesRecipeIdGetQueryOptions = (recipeId, options) => {
|
|
1780
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1781
|
+
const queryKey = queryOptions?.queryKey ?? getGetCatalogRecipeCatalogRecipesRecipeIdGetQueryKey(recipeId);
|
|
1782
|
+
const queryFn = ({ signal }) => getCatalogRecipeCatalogRecipesRecipeIdGet(recipeId, { signal, ...axiosOptions });
|
|
1783
|
+
return { queryKey, queryFn, enabled: !!(recipeId), ...queryOptions };
|
|
1784
|
+
};
|
|
1785
|
+
/**
|
|
1786
|
+
* @summary Get Catalog Recipe
|
|
1787
|
+
*/
|
|
1788
|
+
export function useGetCatalogRecipeCatalogRecipesRecipeIdGet(recipeId, options) {
|
|
1789
|
+
const queryOptions = getGetCatalogRecipeCatalogRecipesRecipeIdGetQueryOptions(recipeId, options);
|
|
1790
|
+
const query = useQuery(queryOptions);
|
|
1791
|
+
query.queryKey = queryOptions.queryKey;
|
|
1792
|
+
return query;
|
|
1793
|
+
}
|
|
1794
|
+
/**
|
|
1795
|
+
* One-tap gap fill for a catalog recipe (ยง5.3): bulk-add its missing
|
|
1796
|
+
ingredients to a shopping list (defaults to the household's active list).
|
|
1797
|
+
* @summary Add Missing Catalog Recipe To List
|
|
1798
|
+
*/
|
|
1799
|
+
export const addMissingCatalogRecipeToListCatalogRecipesRecipeIdAddMissingToListPost = (recipeId, addMissingRequest, options) => {
|
|
1800
|
+
return axios.post(`/catalog/recipes/${recipeId}/add-missing-to-list`, addMissingRequest, options);
|
|
1801
|
+
};
|
|
1802
|
+
export const getAddMissingCatalogRecipeToListCatalogRecipesRecipeIdAddMissingToListPostMutationOptions = (options) => {
|
|
1803
|
+
const mutationKey = ['addMissingCatalogRecipeToListCatalogRecipesRecipeIdAddMissingToListPost'];
|
|
1804
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1805
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1806
|
+
options
|
|
1807
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1808
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1809
|
+
const mutationFn = (props) => {
|
|
1810
|
+
const { recipeId, data } = props ?? {};
|
|
1811
|
+
return addMissingCatalogRecipeToListCatalogRecipesRecipeIdAddMissingToListPost(recipeId, data, axiosOptions);
|
|
1812
|
+
};
|
|
1813
|
+
return { mutationFn, ...mutationOptions };
|
|
1814
|
+
};
|
|
1815
|
+
/**
|
|
1816
|
+
* @summary Add Missing Catalog Recipe To List
|
|
1817
|
+
*/
|
|
1818
|
+
export const useAddMissingCatalogRecipeToListCatalogRecipesRecipeIdAddMissingToListPost = (options) => {
|
|
1819
|
+
const mutationOptions = getAddMissingCatalogRecipeToListCatalogRecipesRecipeIdAddMissingToListPostMutationOptions(options);
|
|
1820
|
+
return useMutation(mutationOptions);
|
|
1821
|
+
};
|
|
1822
|
+
/**
|
|
1823
|
+
* Copy a catalog recipe into the caller's library (provenance set).
|
|
1824
|
+
|
|
1825
|
+
This is also the persist-on-save path for grounded AI suggestions
|
|
1826
|
+
(blueprint ยง9.1 Stage 3).
|
|
1827
|
+
* @summary Save Catalog Recipe
|
|
1828
|
+
*/
|
|
1829
|
+
export const saveCatalogRecipeCatalogRecipesRecipeIdSavePost = (recipeId, options) => {
|
|
1830
|
+
return axios.post(`/catalog/recipes/${recipeId}/save`, undefined, options);
|
|
1831
|
+
};
|
|
1832
|
+
export const getSaveCatalogRecipeCatalogRecipesRecipeIdSavePostMutationOptions = (options) => {
|
|
1833
|
+
const mutationKey = ['saveCatalogRecipeCatalogRecipesRecipeIdSavePost'];
|
|
1834
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1835
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1836
|
+
options
|
|
1837
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1838
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1839
|
+
const mutationFn = (props) => {
|
|
1840
|
+
const { recipeId } = props ?? {};
|
|
1841
|
+
return saveCatalogRecipeCatalogRecipesRecipeIdSavePost(recipeId, axiosOptions);
|
|
1842
|
+
};
|
|
1843
|
+
return { mutationFn, ...mutationOptions };
|
|
1844
|
+
};
|
|
1845
|
+
/**
|
|
1846
|
+
* @summary Save Catalog Recipe
|
|
1847
|
+
*/
|
|
1848
|
+
export const useSaveCatalogRecipeCatalogRecipesRecipeIdSavePost = (options) => {
|
|
1849
|
+
const mutationOptions = getSaveCatalogRecipeCatalogRecipesRecipeIdSavePostMutationOptions(options);
|
|
1850
|
+
return useMutation(mutationOptions);
|
|
1851
|
+
};
|
|
1852
|
+
/**
|
|
1853
|
+
* Ranked name completions: household history first, then catalog
|
|
1854
|
+
prefix/substring/fuzzy, catalog tiers ordered by global linked usage.
|
|
1855
|
+
* @summary Autocomplete Ingredients
|
|
1856
|
+
*/
|
|
1857
|
+
export const autocompleteIngredientsIngredientsAutocompleteGet = (params, options) => {
|
|
1858
|
+
return axios.get(`/ingredients/autocomplete`, {
|
|
1859
|
+
...options,
|
|
1860
|
+
params: { ...params, ...options?.params },
|
|
1861
|
+
});
|
|
1862
|
+
};
|
|
1863
|
+
export const getAutocompleteIngredientsIngredientsAutocompleteGetQueryKey = (params) => {
|
|
1864
|
+
return [
|
|
1865
|
+
`/ingredients/autocomplete`, ...(params ? [params] : [])
|
|
1866
|
+
];
|
|
1867
|
+
};
|
|
1868
|
+
export const getAutocompleteIngredientsIngredientsAutocompleteGetQueryOptions = (params, options) => {
|
|
1869
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1870
|
+
const queryKey = queryOptions?.queryKey ?? getAutocompleteIngredientsIngredientsAutocompleteGetQueryKey(params);
|
|
1871
|
+
const queryFn = ({ signal }) => autocompleteIngredientsIngredientsAutocompleteGet(params, { signal, ...axiosOptions });
|
|
1872
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1873
|
+
};
|
|
1874
|
+
/**
|
|
1875
|
+
* @summary Autocomplete Ingredients
|
|
1876
|
+
*/
|
|
1877
|
+
export function useAutocompleteIngredientsIngredientsAutocompleteGet(params, options) {
|
|
1878
|
+
const queryOptions = getAutocompleteIngredientsIngredientsAutocompleteGetQueryOptions(params, options);
|
|
1879
|
+
const query = useQuery(queryOptions);
|
|
1880
|
+
query.queryKey = queryOptions.queryKey;
|
|
1881
|
+
return query;
|
|
1882
|
+
}
|
|
1883
|
+
/**
|
|
1884
|
+
* List the household's plans plus the system presets.
|
|
1885
|
+
* @summary List Plans
|
|
1886
|
+
*/
|
|
1887
|
+
export const listPlansPlansGet = (params, options) => {
|
|
1888
|
+
return axios.get(`/plans/`, {
|
|
1889
|
+
...options,
|
|
1890
|
+
params: { ...params, ...options?.params },
|
|
1891
|
+
});
|
|
1892
|
+
};
|
|
1893
|
+
export const getListPlansPlansGetQueryKey = (params) => {
|
|
1894
|
+
return [
|
|
1895
|
+
`/plans/`, ...(params ? [params] : [])
|
|
1896
|
+
];
|
|
1897
|
+
};
|
|
1898
|
+
export const getListPlansPlansGetQueryOptions = (params, options) => {
|
|
1899
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
1900
|
+
const queryKey = queryOptions?.queryKey ?? getListPlansPlansGetQueryKey(params);
|
|
1901
|
+
const queryFn = ({ signal }) => listPlansPlansGet(params, { signal, ...axiosOptions });
|
|
1902
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
1903
|
+
};
|
|
1904
|
+
/**
|
|
1905
|
+
* @summary List Plans
|
|
1906
|
+
*/
|
|
1907
|
+
export function useListPlansPlansGet(params, options) {
|
|
1908
|
+
const queryOptions = getListPlansPlansGetQueryOptions(params, options);
|
|
1909
|
+
const query = useQuery(queryOptions);
|
|
1910
|
+
query.queryKey = queryOptions.queryKey;
|
|
1911
|
+
return query;
|
|
1912
|
+
}
|
|
1913
|
+
/**
|
|
1914
|
+
* Create an empty plan, or copy one from a template/preset (template_id).
|
|
1915
|
+
* @summary Create Plan
|
|
1916
|
+
*/
|
|
1917
|
+
export const createPlanPlansPost = (mealPlanCreate, options) => {
|
|
1918
|
+
return axios.post(`/plans/`, mealPlanCreate, options);
|
|
1919
|
+
};
|
|
1920
|
+
export const getCreatePlanPlansPostMutationOptions = (options) => {
|
|
1921
|
+
const mutationKey = ['createPlanPlansPost'];
|
|
1922
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1923
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1924
|
+
options
|
|
1925
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1926
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1927
|
+
const mutationFn = (props) => {
|
|
1928
|
+
const { data } = props ?? {};
|
|
1929
|
+
return createPlanPlansPost(data, axiosOptions);
|
|
1930
|
+
};
|
|
1931
|
+
return { mutationFn, ...mutationOptions };
|
|
1932
|
+
};
|
|
1933
|
+
/**
|
|
1934
|
+
* @summary Create Plan
|
|
1935
|
+
*/
|
|
1936
|
+
export const useCreatePlanPlansPost = (options) => {
|
|
1937
|
+
const mutationOptions = getCreatePlanPlansPostMutationOptions(options);
|
|
1938
|
+
return useMutation(mutationOptions);
|
|
1939
|
+
};
|
|
1940
|
+
/**
|
|
1941
|
+
* Agentic grounded plan generation (ยง9.2): deterministic retrieval once
|
|
1942
|
+
per plan against the household pantry, per-slot filters, LLM assigns
|
|
1943
|
+
candidates to slots; persisted as a status=draft plan in one transaction.
|
|
1944
|
+
* @summary Generate Plan
|
|
1945
|
+
*/
|
|
1946
|
+
export const generatePlanPlansGeneratePost = (planGenerateRequest, options) => {
|
|
1947
|
+
return axios.post(`/plans/generate`, planGenerateRequest, options);
|
|
1948
|
+
};
|
|
1949
|
+
export const getGeneratePlanPlansGeneratePostMutationOptions = (options) => {
|
|
1950
|
+
const mutationKey = ['generatePlanPlansGeneratePost'];
|
|
1951
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1952
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1953
|
+
options
|
|
1954
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1955
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1956
|
+
const mutationFn = (props) => {
|
|
1957
|
+
const { data } = props ?? {};
|
|
1958
|
+
return generatePlanPlansGeneratePost(data, axiosOptions);
|
|
1959
|
+
};
|
|
1960
|
+
return { mutationFn, ...mutationOptions };
|
|
1961
|
+
};
|
|
1962
|
+
/**
|
|
1963
|
+
* @summary Generate Plan
|
|
1964
|
+
*/
|
|
1965
|
+
export const useGeneratePlanPlansGeneratePost = (options) => {
|
|
1966
|
+
const mutationOptions = getGeneratePlanPlansGeneratePostMutationOptions(options);
|
|
1967
|
+
return useMutation(mutationOptions);
|
|
1968
|
+
};
|
|
1969
|
+
/**
|
|
1970
|
+
* Copy a system preset into the household (status=draft); optionally
|
|
1971
|
+
generate its starter grocery list (ยง10) in the same transaction.
|
|
1972
|
+
* @summary Adopt Preset
|
|
1973
|
+
*/
|
|
1974
|
+
export const adoptPresetPlansPresetsPresetIdAdoptPost = (presetId, params, options) => {
|
|
1975
|
+
return axios.post(`/plans/presets/${presetId}/adopt`, undefined, {
|
|
1976
|
+
...options,
|
|
1977
|
+
params: { ...params, ...options?.params },
|
|
1978
|
+
});
|
|
1979
|
+
};
|
|
1980
|
+
export const getAdoptPresetPlansPresetsPresetIdAdoptPostMutationOptions = (options) => {
|
|
1981
|
+
const mutationKey = ['adoptPresetPlansPresetsPresetIdAdoptPost'];
|
|
1982
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
1983
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
1984
|
+
options
|
|
1985
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
1986
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
1987
|
+
const mutationFn = (props) => {
|
|
1988
|
+
const { presetId, params } = props ?? {};
|
|
1989
|
+
return adoptPresetPlansPresetsPresetIdAdoptPost(presetId, params, axiosOptions);
|
|
1990
|
+
};
|
|
1991
|
+
return { mutationFn, ...mutationOptions };
|
|
1992
|
+
};
|
|
1993
|
+
/**
|
|
1994
|
+
* @summary Adopt Preset
|
|
1995
|
+
*/
|
|
1996
|
+
export const useAdoptPresetPlansPresetsPresetIdAdoptPost = (options) => {
|
|
1997
|
+
const mutationOptions = getAdoptPresetPlansPresetsPresetIdAdoptPostMutationOptions(options);
|
|
1998
|
+
return useMutation(mutationOptions);
|
|
1999
|
+
};
|
|
2000
|
+
/**
|
|
2001
|
+
* One plan with its slots (eager-loaded).
|
|
2002
|
+
* @summary Get Plan
|
|
2003
|
+
*/
|
|
2004
|
+
export const getPlanPlansPlanIdGet = (planId, options) => {
|
|
2005
|
+
return axios.get(`/plans/${planId}`, options);
|
|
2006
|
+
};
|
|
2007
|
+
export const getGetPlanPlansPlanIdGetQueryKey = (planId) => {
|
|
2008
|
+
return [
|
|
2009
|
+
`/plans/${planId}`
|
|
2010
|
+
];
|
|
2011
|
+
};
|
|
2012
|
+
export const getGetPlanPlansPlanIdGetQueryOptions = (planId, options) => {
|
|
2013
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
2014
|
+
const queryKey = queryOptions?.queryKey ?? getGetPlanPlansPlanIdGetQueryKey(planId);
|
|
2015
|
+
const queryFn = ({ signal }) => getPlanPlansPlanIdGet(planId, { signal, ...axiosOptions });
|
|
2016
|
+
return { queryKey, queryFn, enabled: !!(planId), ...queryOptions };
|
|
2017
|
+
};
|
|
2018
|
+
/**
|
|
2019
|
+
* @summary Get Plan
|
|
2020
|
+
*/
|
|
2021
|
+
export function useGetPlanPlansPlanIdGet(planId, options) {
|
|
2022
|
+
const queryOptions = getGetPlanPlansPlanIdGetQueryOptions(planId, options);
|
|
2023
|
+
const query = useQuery(queryOptions);
|
|
2024
|
+
query.queryKey = queryOptions.queryKey;
|
|
2025
|
+
return query;
|
|
2026
|
+
}
|
|
2027
|
+
/**
|
|
2028
|
+
* Rename / change status / move week_start / change visibility.
|
|
2029
|
+
* @summary Update Plan
|
|
2030
|
+
*/
|
|
2031
|
+
export const updatePlanPlansPlanIdPut = (planId, mealPlanUpdate, options) => {
|
|
2032
|
+
return axios.put(`/plans/${planId}`, mealPlanUpdate, options);
|
|
2033
|
+
};
|
|
2034
|
+
export const getUpdatePlanPlansPlanIdPutMutationOptions = (options) => {
|
|
2035
|
+
const mutationKey = ['updatePlanPlansPlanIdPut'];
|
|
2036
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2037
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2038
|
+
options
|
|
2039
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2040
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2041
|
+
const mutationFn = (props) => {
|
|
2042
|
+
const { planId, data } = props ?? {};
|
|
2043
|
+
return updatePlanPlansPlanIdPut(planId, data, axiosOptions);
|
|
2044
|
+
};
|
|
2045
|
+
return { mutationFn, ...mutationOptions };
|
|
2046
|
+
};
|
|
2047
|
+
/**
|
|
2048
|
+
* @summary Update Plan
|
|
2049
|
+
*/
|
|
2050
|
+
export const useUpdatePlanPlansPlanIdPut = (options) => {
|
|
2051
|
+
const mutationOptions = getUpdatePlanPlansPlanIdPutMutationOptions(options);
|
|
2052
|
+
return useMutation(mutationOptions);
|
|
2053
|
+
};
|
|
2054
|
+
/**
|
|
2055
|
+
* @summary Delete Plan
|
|
2056
|
+
*/
|
|
2057
|
+
export const deletePlanPlansPlanIdDelete = (planId, options) => {
|
|
2058
|
+
return axios.delete(`/plans/${planId}`, options);
|
|
2059
|
+
};
|
|
2060
|
+
export const getDeletePlanPlansPlanIdDeleteMutationOptions = (options) => {
|
|
2061
|
+
const mutationKey = ['deletePlanPlansPlanIdDelete'];
|
|
2062
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2063
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2064
|
+
options
|
|
2065
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2066
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2067
|
+
const mutationFn = (props) => {
|
|
2068
|
+
const { planId } = props ?? {};
|
|
2069
|
+
return deletePlanPlansPlanIdDelete(planId, axiosOptions);
|
|
2070
|
+
};
|
|
2071
|
+
return { mutationFn, ...mutationOptions };
|
|
2072
|
+
};
|
|
2073
|
+
/**
|
|
2074
|
+
* @summary Delete Plan
|
|
2075
|
+
*/
|
|
2076
|
+
export const useDeletePlanPlansPlanIdDelete = (options) => {
|
|
2077
|
+
const mutationOptions = getDeletePlanPlansPlanIdDeleteMutationOptions(options);
|
|
2078
|
+
return useMutation(mutationOptions);
|
|
2079
|
+
};
|
|
2080
|
+
/**
|
|
2081
|
+
* The plan editor's workhorse (ยง5.5): create/update/delete slot cells
|
|
2082
|
+
with per-item results. Items without id create; with id update (or delete
|
|
2083
|
+
with _delete=true).
|
|
2084
|
+
* @summary Bulk Update Slots
|
|
2085
|
+
*/
|
|
2086
|
+
export const bulkUpdateSlotsPlansPlanIdSlotsBulkPatch = (planId, planSlotBulkRequest, options) => {
|
|
2087
|
+
return axios.patch(`/plans/${planId}/slots/bulk`, planSlotBulkRequest, options);
|
|
2088
|
+
};
|
|
2089
|
+
export const getBulkUpdateSlotsPlansPlanIdSlotsBulkPatchMutationOptions = (options) => {
|
|
2090
|
+
const mutationKey = ['bulkUpdateSlotsPlansPlanIdSlotsBulkPatch'];
|
|
2091
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2092
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2093
|
+
options
|
|
2094
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2095
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2096
|
+
const mutationFn = (props) => {
|
|
2097
|
+
const { planId, data } = props ?? {};
|
|
2098
|
+
return bulkUpdateSlotsPlansPlanIdSlotsBulkPatch(planId, data, axiosOptions);
|
|
2099
|
+
};
|
|
2100
|
+
return { mutationFn, ...mutationOptions };
|
|
2101
|
+
};
|
|
2102
|
+
/**
|
|
2103
|
+
* @summary Bulk Update Slots
|
|
2104
|
+
*/
|
|
2105
|
+
export const useBulkUpdateSlotsPlansPlanIdSlotsBulkPatch = (options) => {
|
|
2106
|
+
const mutationOptions = getBulkUpdateSlotsPlansPlanIdSlotsBulkPatchMutationOptions(options);
|
|
2107
|
+
return useMutation(mutationOptions);
|
|
2108
|
+
};
|
|
2109
|
+
/**
|
|
2110
|
+
* draft โ active, validating every slot is filled or explicitly skip.
|
|
2111
|
+
* @summary Activate Plan
|
|
2112
|
+
*/
|
|
2113
|
+
export const activatePlanPlansPlanIdActivatePost = (planId, options) => {
|
|
2114
|
+
return axios.post(`/plans/${planId}/activate`, undefined, options);
|
|
2115
|
+
};
|
|
2116
|
+
export const getActivatePlanPlansPlanIdActivatePostMutationOptions = (options) => {
|
|
2117
|
+
const mutationKey = ['activatePlanPlansPlanIdActivatePost'];
|
|
2118
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2119
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2120
|
+
options
|
|
2121
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2122
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2123
|
+
const mutationFn = (props) => {
|
|
2124
|
+
const { planId } = props ?? {};
|
|
2125
|
+
return activatePlanPlansPlanIdActivatePost(planId, axiosOptions);
|
|
2126
|
+
};
|
|
2127
|
+
return { mutationFn, ...mutationOptions };
|
|
2128
|
+
};
|
|
2129
|
+
/**
|
|
2130
|
+
* @summary Activate Plan
|
|
2131
|
+
*/
|
|
2132
|
+
export const useActivatePlanPlansPlanIdActivatePost = (options) => {
|
|
2133
|
+
const mutationOptions = getActivatePlanPlansPlanIdActivatePostMutationOptions(options);
|
|
2134
|
+
return useMutation(mutationOptions);
|
|
2135
|
+
};
|
|
2136
|
+
/**
|
|
2137
|
+
* Derive the grocery list from plan gaps (ยง10): aggregated slot recipe
|
|
2138
|
+
ingredients scaled by servings, minus on-hand pantry quantities under the
|
|
2139
|
+
same-family unit rules โ bulk-added with reason=missing_for_plan.
|
|
2140
|
+
* @summary Derive Grocery List
|
|
2141
|
+
*/
|
|
2142
|
+
export const deriveGroceryListPlansPlanIdGroceryListPost = (planId, planGroceryListRequest, options) => {
|
|
2143
|
+
return axios.post(`/plans/${planId}/grocery-list`, planGroceryListRequest, options);
|
|
2144
|
+
};
|
|
2145
|
+
export const getDeriveGroceryListPlansPlanIdGroceryListPostMutationOptions = (options) => {
|
|
2146
|
+
const mutationKey = ['deriveGroceryListPlansPlanIdGroceryListPost'];
|
|
2147
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2148
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2149
|
+
options
|
|
2150
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2151
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2152
|
+
const mutationFn = (props) => {
|
|
2153
|
+
const { planId, data } = props ?? {};
|
|
2154
|
+
return deriveGroceryListPlansPlanIdGroceryListPost(planId, data, axiosOptions);
|
|
2155
|
+
};
|
|
2156
|
+
return { mutationFn, ...mutationOptions };
|
|
2157
|
+
};
|
|
2158
|
+
/**
|
|
2159
|
+
* @summary Derive Grocery List
|
|
2160
|
+
*/
|
|
2161
|
+
export const useDeriveGroceryListPlansPlanIdGroceryListPost = (options) => {
|
|
2162
|
+
const mutationOptions = getDeriveGroceryListPlansPlanIdGroceryListPostMutationOptions(options);
|
|
2163
|
+
return useMutation(mutationOptions);
|
|
2164
|
+
};
|
|
2165
|
+
/**
|
|
2166
|
+
* @summary List Shopping Lists
|
|
2167
|
+
*/
|
|
2168
|
+
export const listShoppingListsShoppingListsGet = (params, options) => {
|
|
2169
|
+
return axios.get(`/shopping-lists/`, {
|
|
2170
|
+
...options,
|
|
2171
|
+
params: { ...params, ...options?.params },
|
|
2172
|
+
});
|
|
2173
|
+
};
|
|
2174
|
+
export const getListShoppingListsShoppingListsGetQueryKey = (params) => {
|
|
2175
|
+
return [
|
|
2176
|
+
`/shopping-lists/`, ...(params ? [params] : [])
|
|
2177
|
+
];
|
|
2178
|
+
};
|
|
2179
|
+
export const getListShoppingListsShoppingListsGetQueryOptions = (params, options) => {
|
|
2180
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
2181
|
+
const queryKey = queryOptions?.queryKey ?? getListShoppingListsShoppingListsGetQueryKey(params);
|
|
2182
|
+
const queryFn = ({ signal }) => listShoppingListsShoppingListsGet(params, { signal, ...axiosOptions });
|
|
2183
|
+
return { queryKey, queryFn, ...queryOptions };
|
|
2184
|
+
};
|
|
2185
|
+
/**
|
|
2186
|
+
* @summary List Shopping Lists
|
|
2187
|
+
*/
|
|
2188
|
+
export function useListShoppingListsShoppingListsGet(params, options) {
|
|
2189
|
+
const queryOptions = getListShoppingListsShoppingListsGetQueryOptions(params, options);
|
|
2190
|
+
const query = useQuery(queryOptions);
|
|
2191
|
+
query.queryKey = queryOptions.queryKey;
|
|
2192
|
+
return query;
|
|
2193
|
+
}
|
|
2194
|
+
/**
|
|
2195
|
+
* @summary Create Shopping List
|
|
2196
|
+
*/
|
|
2197
|
+
export const createShoppingListShoppingListsPost = (shoppingListCreate, options) => {
|
|
2198
|
+
return axios.post(`/shopping-lists/`, shoppingListCreate, options);
|
|
2199
|
+
};
|
|
2200
|
+
export const getCreateShoppingListShoppingListsPostMutationOptions = (options) => {
|
|
2201
|
+
const mutationKey = ['createShoppingListShoppingListsPost'];
|
|
2202
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2203
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2204
|
+
options
|
|
2205
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2206
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2207
|
+
const mutationFn = (props) => {
|
|
2208
|
+
const { data } = props ?? {};
|
|
2209
|
+
return createShoppingListShoppingListsPost(data, axiosOptions);
|
|
2210
|
+
};
|
|
2211
|
+
return { mutationFn, ...mutationOptions };
|
|
2212
|
+
};
|
|
2213
|
+
/**
|
|
2214
|
+
* @summary Create Shopping List
|
|
2215
|
+
*/
|
|
2216
|
+
export const useCreateShoppingListShoppingListsPost = (options) => {
|
|
2217
|
+
const mutationOptions = getCreateShoppingListShoppingListsPostMutationOptions(options);
|
|
2218
|
+
return useMutation(mutationOptions);
|
|
2219
|
+
};
|
|
2220
|
+
/**
|
|
2221
|
+
* @summary Get Shopping List
|
|
2222
|
+
*/
|
|
2223
|
+
export const getShoppingListShoppingListsListIdGet = (listId, options) => {
|
|
2224
|
+
return axios.get(`/shopping-lists/${listId}`, options);
|
|
2225
|
+
};
|
|
2226
|
+
export const getGetShoppingListShoppingListsListIdGetQueryKey = (listId) => {
|
|
2227
|
+
return [
|
|
2228
|
+
`/shopping-lists/${listId}`
|
|
2229
|
+
];
|
|
2230
|
+
};
|
|
2231
|
+
export const getGetShoppingListShoppingListsListIdGetQueryOptions = (listId, options) => {
|
|
2232
|
+
const { query: queryOptions, axios: axiosOptions } = options ?? {};
|
|
2233
|
+
const queryKey = queryOptions?.queryKey ?? getGetShoppingListShoppingListsListIdGetQueryKey(listId);
|
|
2234
|
+
const queryFn = ({ signal }) => getShoppingListShoppingListsListIdGet(listId, { signal, ...axiosOptions });
|
|
2235
|
+
return { queryKey, queryFn, enabled: !!(listId), ...queryOptions };
|
|
2236
|
+
};
|
|
2237
|
+
/**
|
|
2238
|
+
* @summary Get Shopping List
|
|
2239
|
+
*/
|
|
2240
|
+
export function useGetShoppingListShoppingListsListIdGet(listId, options) {
|
|
2241
|
+
const queryOptions = getGetShoppingListShoppingListsListIdGetQueryOptions(listId, options);
|
|
2242
|
+
const query = useQuery(queryOptions);
|
|
2243
|
+
query.queryKey = queryOptions.queryKey;
|
|
2244
|
+
return query;
|
|
2245
|
+
}
|
|
2246
|
+
/**
|
|
2247
|
+
* Rename a list or change its status (active|archived).
|
|
2248
|
+
* @summary Update Shopping List
|
|
2249
|
+
*/
|
|
2250
|
+
export const updateShoppingListShoppingListsListIdPut = (listId, shoppingListUpdate, options) => {
|
|
2251
|
+
return axios.put(`/shopping-lists/${listId}`, shoppingListUpdate, options);
|
|
2252
|
+
};
|
|
2253
|
+
export const getUpdateShoppingListShoppingListsListIdPutMutationOptions = (options) => {
|
|
2254
|
+
const mutationKey = ['updateShoppingListShoppingListsListIdPut'];
|
|
2255
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2256
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2257
|
+
options
|
|
2258
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2259
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2260
|
+
const mutationFn = (props) => {
|
|
2261
|
+
const { listId, data } = props ?? {};
|
|
2262
|
+
return updateShoppingListShoppingListsListIdPut(listId, data, axiosOptions);
|
|
2263
|
+
};
|
|
2264
|
+
return { mutationFn, ...mutationOptions };
|
|
2265
|
+
};
|
|
2266
|
+
/**
|
|
2267
|
+
* @summary Update Shopping List
|
|
2268
|
+
*/
|
|
2269
|
+
export const useUpdateShoppingListShoppingListsListIdPut = (options) => {
|
|
2270
|
+
const mutationOptions = getUpdateShoppingListShoppingListsListIdPutMutationOptions(options);
|
|
2271
|
+
return useMutation(mutationOptions);
|
|
2272
|
+
};
|
|
2273
|
+
/**
|
|
2274
|
+
* @summary Delete Shopping List
|
|
2275
|
+
*/
|
|
2276
|
+
export const deleteShoppingListShoppingListsListIdDelete = (listId, options) => {
|
|
2277
|
+
return axios.delete(`/shopping-lists/${listId}`, options);
|
|
2278
|
+
};
|
|
2279
|
+
export const getDeleteShoppingListShoppingListsListIdDeleteMutationOptions = (options) => {
|
|
2280
|
+
const mutationKey = ['deleteShoppingListShoppingListsListIdDelete'];
|
|
2281
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2282
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2283
|
+
options
|
|
2284
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2285
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2286
|
+
const mutationFn = (props) => {
|
|
2287
|
+
const { listId } = props ?? {};
|
|
2288
|
+
return deleteShoppingListShoppingListsListIdDelete(listId, axiosOptions);
|
|
2289
|
+
};
|
|
2290
|
+
return { mutationFn, ...mutationOptions };
|
|
2291
|
+
};
|
|
2292
|
+
/**
|
|
2293
|
+
* @summary Delete Shopping List
|
|
2294
|
+
*/
|
|
2295
|
+
export const useDeleteShoppingListShoppingListsListIdDelete = (options) => {
|
|
2296
|
+
const mutationOptions = getDeleteShoppingListShoppingListsListIdDeleteMutationOptions(options);
|
|
2297
|
+
return useMutation(mutationOptions);
|
|
2298
|
+
};
|
|
2299
|
+
/**
|
|
2300
|
+
* One-click order export (ยง10): the list's unchecked items as a grouped
|
|
2301
|
+
text checklist, CSV rows, or a provider deeplink.
|
|
2302
|
+
* @summary Export Shopping List
|
|
2303
|
+
*/
|
|
2304
|
+
export const exportShoppingListShoppingListsListIdExportPost = (listId, shoppingListExportRequest, options) => {
|
|
2305
|
+
return axios.post(`/shopping-lists/${listId}/export`, shoppingListExportRequest, options);
|
|
2306
|
+
};
|
|
2307
|
+
export const getExportShoppingListShoppingListsListIdExportPostMutationOptions = (options) => {
|
|
2308
|
+
const mutationKey = ['exportShoppingListShoppingListsListIdExportPost'];
|
|
2309
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2310
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2311
|
+
options
|
|
2312
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2313
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2314
|
+
const mutationFn = (props) => {
|
|
2315
|
+
const { listId, data } = props ?? {};
|
|
2316
|
+
return exportShoppingListShoppingListsListIdExportPost(listId, data, axiosOptions);
|
|
2317
|
+
};
|
|
2318
|
+
return { mutationFn, ...mutationOptions };
|
|
2319
|
+
};
|
|
2320
|
+
/**
|
|
2321
|
+
* @summary Export Shopping List
|
|
2322
|
+
*/
|
|
2323
|
+
export const useExportShoppingListShoppingListsListIdExportPost = (options) => {
|
|
2324
|
+
const mutationOptions = getExportShoppingListShoppingListsListIdExportPostMutationOptions(options);
|
|
2325
|
+
return useMutation(mutationOptions);
|
|
2326
|
+
};
|
|
2327
|
+
/**
|
|
2328
|
+
* @summary Add Shopping List Item
|
|
2329
|
+
*/
|
|
2330
|
+
export const addShoppingListItemShoppingListsListIdItemsPost = (listId, shoppingListItemCreate, options) => {
|
|
2331
|
+
return axios.post(`/shopping-lists/${listId}/items`, shoppingListItemCreate, options);
|
|
2332
|
+
};
|
|
2333
|
+
export const getAddShoppingListItemShoppingListsListIdItemsPostMutationOptions = (options) => {
|
|
2334
|
+
const mutationKey = ['addShoppingListItemShoppingListsListIdItemsPost'];
|
|
2335
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2336
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2337
|
+
options
|
|
2338
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2339
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2340
|
+
const mutationFn = (props) => {
|
|
2341
|
+
const { listId, data } = props ?? {};
|
|
2342
|
+
return addShoppingListItemShoppingListsListIdItemsPost(listId, data, axiosOptions);
|
|
2343
|
+
};
|
|
2344
|
+
return { mutationFn, ...mutationOptions };
|
|
2345
|
+
};
|
|
2346
|
+
/**
|
|
2347
|
+
* @summary Add Shopping List Item
|
|
2348
|
+
*/
|
|
2349
|
+
export const useAddShoppingListItemShoppingListsListIdItemsPost = (options) => {
|
|
2350
|
+
const mutationOptions = getAddShoppingListItemShoppingListsListIdItemsPostMutationOptions(options);
|
|
2351
|
+
return useMutation(mutationOptions);
|
|
2352
|
+
};
|
|
2353
|
+
/**
|
|
2354
|
+
* Bulk add items (plan gaps, preset starters) โ ยง4.2 conventions with
|
|
2355
|
+
client_ref idempotency.
|
|
2356
|
+
* @summary Bulk Add Shopping List Items
|
|
2357
|
+
*/
|
|
2358
|
+
export const bulkAddShoppingListItemsShoppingListsListIdItemsBulkPost = (listId, shoppingListItemBulkCreateRequest, options) => {
|
|
2359
|
+
return axios.post(`/shopping-lists/${listId}/items/bulk`, shoppingListItemBulkCreateRequest, options);
|
|
2360
|
+
};
|
|
2361
|
+
export const getBulkAddShoppingListItemsShoppingListsListIdItemsBulkPostMutationOptions = (options) => {
|
|
2362
|
+
const mutationKey = ['bulkAddShoppingListItemsShoppingListsListIdItemsBulkPost'];
|
|
2363
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2364
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2365
|
+
options
|
|
2366
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2367
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2368
|
+
const mutationFn = (props) => {
|
|
2369
|
+
const { listId, data } = props ?? {};
|
|
2370
|
+
return bulkAddShoppingListItemsShoppingListsListIdItemsBulkPost(listId, data, axiosOptions);
|
|
2371
|
+
};
|
|
2372
|
+
return { mutationFn, ...mutationOptions };
|
|
2373
|
+
};
|
|
2374
|
+
/**
|
|
2375
|
+
* @summary Bulk Add Shopping List Items
|
|
2376
|
+
*/
|
|
2377
|
+
export const useBulkAddShoppingListItemsShoppingListsListIdItemsBulkPost = (options) => {
|
|
2378
|
+
const mutationOptions = getBulkAddShoppingListItemsShoppingListsListIdItemsBulkPostMutationOptions(options);
|
|
2379
|
+
return useMutation(mutationOptions);
|
|
2380
|
+
};
|
|
2381
|
+
/**
|
|
2382
|
+
* Bulk update/check items; ``check_all=true`` is the one-tap check-all.
|
|
2383
|
+
* @summary Bulk Update Shopping List Items
|
|
2384
|
+
*/
|
|
2385
|
+
export const bulkUpdateShoppingListItemsShoppingListsListIdItemsBulkPatch = (listId, shoppingListItemBulkUpdateRequest, options) => {
|
|
2386
|
+
return axios.patch(`/shopping-lists/${listId}/items/bulk`, shoppingListItemBulkUpdateRequest, options);
|
|
2387
|
+
};
|
|
2388
|
+
export const getBulkUpdateShoppingListItemsShoppingListsListIdItemsBulkPatchMutationOptions = (options) => {
|
|
2389
|
+
const mutationKey = ['bulkUpdateShoppingListItemsShoppingListsListIdItemsBulkPatch'];
|
|
2390
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2391
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2392
|
+
options
|
|
2393
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2394
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2395
|
+
const mutationFn = (props) => {
|
|
2396
|
+
const { listId, data } = props ?? {};
|
|
2397
|
+
return bulkUpdateShoppingListItemsShoppingListsListIdItemsBulkPatch(listId, data, axiosOptions);
|
|
2398
|
+
};
|
|
2399
|
+
return { mutationFn, ...mutationOptions };
|
|
2400
|
+
};
|
|
2401
|
+
/**
|
|
2402
|
+
* @summary Bulk Update Shopping List Items
|
|
2403
|
+
*/
|
|
2404
|
+
export const useBulkUpdateShoppingListItemsShoppingListsListIdItemsBulkPatch = (options) => {
|
|
2405
|
+
const mutationOptions = getBulkUpdateShoppingListItemsShoppingListsListIdItemsBulkPatchMutationOptions(options);
|
|
2406
|
+
return useMutation(mutationOptions);
|
|
2407
|
+
};
|
|
2408
|
+
/**
|
|
2409
|
+
* @summary Bulk Delete Shopping List Items
|
|
2410
|
+
*/
|
|
2411
|
+
export const bulkDeleteShoppingListItemsShoppingListsListIdItemsBulkDeletePost = (listId, shoppingListItemBulkDeleteRequest, options) => {
|
|
2412
|
+
return axios.post(`/shopping-lists/${listId}/items/bulk-delete`, shoppingListItemBulkDeleteRequest, options);
|
|
2413
|
+
};
|
|
2414
|
+
export const getBulkDeleteShoppingListItemsShoppingListsListIdItemsBulkDeletePostMutationOptions = (options) => {
|
|
2415
|
+
const mutationKey = ['bulkDeleteShoppingListItemsShoppingListsListIdItemsBulkDeletePost'];
|
|
2416
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2417
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2418
|
+
options
|
|
2419
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2420
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2421
|
+
const mutationFn = (props) => {
|
|
2422
|
+
const { listId, data } = props ?? {};
|
|
2423
|
+
return bulkDeleteShoppingListItemsShoppingListsListIdItemsBulkDeletePost(listId, data, axiosOptions);
|
|
2424
|
+
};
|
|
2425
|
+
return { mutationFn, ...mutationOptions };
|
|
2426
|
+
};
|
|
2427
|
+
/**
|
|
2428
|
+
* @summary Bulk Delete Shopping List Items
|
|
2429
|
+
*/
|
|
2430
|
+
export const useBulkDeleteShoppingListItemsShoppingListsListIdItemsBulkDeletePost = (options) => {
|
|
2431
|
+
const mutationOptions = getBulkDeleteShoppingListItemsShoppingListsListIdItemsBulkDeletePostMutationOptions(options);
|
|
2432
|
+
return useMutation(mutationOptions);
|
|
2433
|
+
};
|
|
2434
|
+
/**
|
|
2435
|
+
* @summary Update Shopping List Item
|
|
2436
|
+
*/
|
|
2437
|
+
export const updateShoppingListItemShoppingListsListIdItemsItemIdPatch = (listId, itemId, shoppingListItemUpdate, options) => {
|
|
2438
|
+
return axios.patch(`/shopping-lists/${listId}/items/${itemId}`, shoppingListItemUpdate, options);
|
|
2439
|
+
};
|
|
2440
|
+
export const getUpdateShoppingListItemShoppingListsListIdItemsItemIdPatchMutationOptions = (options) => {
|
|
2441
|
+
const mutationKey = ['updateShoppingListItemShoppingListsListIdItemsItemIdPatch'];
|
|
2442
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2443
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2444
|
+
options
|
|
2445
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2446
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2447
|
+
const mutationFn = (props) => {
|
|
2448
|
+
const { listId, itemId, data } = props ?? {};
|
|
2449
|
+
return updateShoppingListItemShoppingListsListIdItemsItemIdPatch(listId, itemId, data, axiosOptions);
|
|
2450
|
+
};
|
|
2451
|
+
return { mutationFn, ...mutationOptions };
|
|
2452
|
+
};
|
|
2453
|
+
/**
|
|
2454
|
+
* @summary Update Shopping List Item
|
|
2455
|
+
*/
|
|
2456
|
+
export const useUpdateShoppingListItemShoppingListsListIdItemsItemIdPatch = (options) => {
|
|
2457
|
+
const mutationOptions = getUpdateShoppingListItemShoppingListsListIdItemsItemIdPatchMutationOptions(options);
|
|
2458
|
+
return useMutation(mutationOptions);
|
|
2459
|
+
};
|
|
2460
|
+
/**
|
|
2461
|
+
* @summary Delete Shopping List Item
|
|
2462
|
+
*/
|
|
2463
|
+
export const deleteShoppingListItemShoppingListsListIdItemsItemIdDelete = (listId, itemId, options) => {
|
|
2464
|
+
return axios.delete(`/shopping-lists/${listId}/items/${itemId}`, options);
|
|
2465
|
+
};
|
|
2466
|
+
export const getDeleteShoppingListItemShoppingListsListIdItemsItemIdDeleteMutationOptions = (options) => {
|
|
2467
|
+
const mutationKey = ['deleteShoppingListItemShoppingListsListIdItemsItemIdDelete'];
|
|
2468
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2469
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2470
|
+
options
|
|
2471
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2472
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2473
|
+
const mutationFn = (props) => {
|
|
2474
|
+
const { listId, itemId } = props ?? {};
|
|
2475
|
+
return deleteShoppingListItemShoppingListsListIdItemsItemIdDelete(listId, itemId, axiosOptions);
|
|
2476
|
+
};
|
|
2477
|
+
return { mutationFn, ...mutationOptions };
|
|
2478
|
+
};
|
|
2479
|
+
/**
|
|
2480
|
+
* @summary Delete Shopping List Item
|
|
2481
|
+
*/
|
|
2482
|
+
export const useDeleteShoppingListItemShoppingListsListIdItemsItemIdDelete = (options) => {
|
|
2483
|
+
const mutationOptions = getDeleteShoppingListItemShoppingListsListIdItemsItemIdDeleteMutationOptions(options);
|
|
2484
|
+
return useMutation(mutationOptions);
|
|
2485
|
+
};
|
|
2486
|
+
/**
|
|
2487
|
+
* Generate a recipe tailored to the user's current pantry contents.
|
|
2488
|
+
* @summary Generate Recipe
|
|
2489
|
+
*/
|
|
2490
|
+
export const generateRecipeAiGenerateRecipePost = (generateRecipeRequest, options) => {
|
|
2491
|
+
return axios.post(`/ai/generate-recipe`, generateRecipeRequest, options);
|
|
2492
|
+
};
|
|
2493
|
+
export const getGenerateRecipeAiGenerateRecipePostMutationOptions = (options) => {
|
|
2494
|
+
const mutationKey = ['generateRecipeAiGenerateRecipePost'];
|
|
2495
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2496
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2497
|
+
options
|
|
2498
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2499
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2500
|
+
const mutationFn = (props) => {
|
|
2501
|
+
const { data } = props ?? {};
|
|
2502
|
+
return generateRecipeAiGenerateRecipePost(data, axiosOptions);
|
|
2503
|
+
};
|
|
2504
|
+
return { mutationFn, ...mutationOptions };
|
|
2505
|
+
};
|
|
2506
|
+
/**
|
|
2507
|
+
* @summary Generate Recipe
|
|
2508
|
+
*/
|
|
2509
|
+
export const useGenerateRecipeAiGenerateRecipePost = (options) => {
|
|
2510
|
+
const mutationOptions = getGenerateRecipeAiGenerateRecipePostMutationOptions(options);
|
|
2511
|
+
return useMutation(mutationOptions);
|
|
2512
|
+
};
|
|
2513
|
+
/**
|
|
2514
|
+
* Stream a recipe generation response using Server-Sent Events.
|
|
2515
|
+
* @summary Generate Recipe Stream
|
|
2516
|
+
*/
|
|
2517
|
+
export const generateRecipeStreamAiGenerateRecipeStreamPost = (generateRecipeRequest, options) => {
|
|
2518
|
+
return axios.post(`/ai/generate-recipe/stream`, generateRecipeRequest, options);
|
|
2519
|
+
};
|
|
2520
|
+
export const getGenerateRecipeStreamAiGenerateRecipeStreamPostMutationOptions = (options) => {
|
|
2521
|
+
const mutationKey = ['generateRecipeStreamAiGenerateRecipeStreamPost'];
|
|
2522
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2523
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2524
|
+
options
|
|
2525
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2526
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2527
|
+
const mutationFn = (props) => {
|
|
2528
|
+
const { data } = props ?? {};
|
|
2529
|
+
return generateRecipeStreamAiGenerateRecipeStreamPost(data, axiosOptions);
|
|
2530
|
+
};
|
|
2531
|
+
return { mutationFn, ...mutationOptions };
|
|
2532
|
+
};
|
|
2533
|
+
/**
|
|
2534
|
+
* @summary Generate Recipe Stream
|
|
2535
|
+
*/
|
|
2536
|
+
export const useGenerateRecipeStreamAiGenerateRecipeStreamPost = (options) => {
|
|
2537
|
+
const mutationOptions = getGenerateRecipeStreamAiGenerateRecipeStreamPostMutationOptions(options);
|
|
2538
|
+
return useMutation(mutationOptions);
|
|
2539
|
+
};
|
|
2540
|
+
/**
|
|
2541
|
+
* Grounded recipe suggestion (blueprint ยง9.1) โ the primary path.
|
|
2542
|
+
|
|
2543
|
+
Stage 1: deterministic coverage retrieval over catalog + household
|
|
2544
|
+
recipes (no LLM). Stage 2: the LLM reranks/adapts candidates by catalog
|
|
2545
|
+
id โ choose/scale/substitute/explain only. Persist-on-save goes through
|
|
2546
|
+
POST /catalog/recipes/{id}/save. When the LLM is disabled,
|
|
2547
|
+
GET /recipes/suggestions serves the Stage-1 ranking as the degraded path.
|
|
2548
|
+
* @summary Suggest Recipes
|
|
2549
|
+
*/
|
|
2550
|
+
export const suggestRecipesAiSuggestRecipesPost = (suggestRecipesRequest, options) => {
|
|
2551
|
+
return axios.post(`/ai/suggest-recipes`, suggestRecipesRequest, options);
|
|
2552
|
+
};
|
|
2553
|
+
export const getSuggestRecipesAiSuggestRecipesPostMutationOptions = (options) => {
|
|
2554
|
+
const mutationKey = ['suggestRecipesAiSuggestRecipesPost'];
|
|
2555
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2556
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2557
|
+
options
|
|
2558
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2559
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2560
|
+
const mutationFn = (props) => {
|
|
2561
|
+
const { data } = props ?? {};
|
|
2562
|
+
return suggestRecipesAiSuggestRecipesPost(data, axiosOptions);
|
|
2563
|
+
};
|
|
2564
|
+
return { mutationFn, ...mutationOptions };
|
|
2565
|
+
};
|
|
2566
|
+
/**
|
|
2567
|
+
* @summary Suggest Recipes
|
|
2568
|
+
*/
|
|
2569
|
+
export const useSuggestRecipesAiSuggestRecipesPost = (options) => {
|
|
2570
|
+
const mutationOptions = getSuggestRecipesAiSuggestRecipesPostMutationOptions(options);
|
|
2571
|
+
return useMutation(mutationOptions);
|
|
2572
|
+
};
|
|
2573
|
+
/**
|
|
2574
|
+
* Generate a multi-day meal plan from the user's current pantry.
|
|
2575
|
+
* @summary Generate Meal Plan
|
|
2576
|
+
*/
|
|
2577
|
+
export const generateMealPlanAiMealPlanPost = (mealPlanRequest, options) => {
|
|
2578
|
+
return axios.post(`/ai/meal-plan`, mealPlanRequest, options);
|
|
2579
|
+
};
|
|
2580
|
+
export const getGenerateMealPlanAiMealPlanPostMutationOptions = (options) => {
|
|
2581
|
+
const mutationKey = ['generateMealPlanAiMealPlanPost'];
|
|
2582
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2583
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2584
|
+
options
|
|
2585
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2586
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2587
|
+
const mutationFn = (props) => {
|
|
2588
|
+
const { data } = props ?? {};
|
|
2589
|
+
return generateMealPlanAiMealPlanPost(data, axiosOptions);
|
|
2590
|
+
};
|
|
2591
|
+
return { mutationFn, ...mutationOptions };
|
|
2592
|
+
};
|
|
2593
|
+
/**
|
|
2594
|
+
* @summary Generate Meal Plan
|
|
2595
|
+
*/
|
|
2596
|
+
export const useGenerateMealPlanAiMealPlanPost = (options) => {
|
|
2597
|
+
const mutationOptions = getGenerateMealPlanAiMealPlanPostMutationOptions(options);
|
|
2598
|
+
return useMutation(mutationOptions);
|
|
2599
|
+
};
|
|
2600
|
+
/**
|
|
2601
|
+
* Score the user's saved recipes against a natural language query.
|
|
2602
|
+
* @summary Semantic Search
|
|
2603
|
+
*/
|
|
2604
|
+
export const semanticSearchAiSearchPost = (searchRequest, options) => {
|
|
2605
|
+
return axios.post(`/ai/search`, searchRequest, options);
|
|
2606
|
+
};
|
|
2607
|
+
export const getSemanticSearchAiSearchPostMutationOptions = (options) => {
|
|
2608
|
+
const mutationKey = ['semanticSearchAiSearchPost'];
|
|
2609
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2610
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2611
|
+
options
|
|
2612
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2613
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2614
|
+
const mutationFn = (props) => {
|
|
2615
|
+
const { data } = props ?? {};
|
|
2616
|
+
return semanticSearchAiSearchPost(data, axiosOptions);
|
|
2617
|
+
};
|
|
2618
|
+
return { mutationFn, ...mutationOptions };
|
|
2619
|
+
};
|
|
2620
|
+
/**
|
|
2621
|
+
* @summary Semantic Search
|
|
2622
|
+
*/
|
|
2623
|
+
export const useSemanticSearchAiSearchPost = (options) => {
|
|
2624
|
+
const mutationOptions = getSemanticSearchAiSearchPostMutationOptions(options);
|
|
2625
|
+
return useMutation(mutationOptions);
|
|
2626
|
+
};
|
|
2627
|
+
/**
|
|
2628
|
+
* Recognize pantry items from a photo via the configured vision backend.
|
|
2629
|
+
|
|
2630
|
+
The image is validated (MIME whitelist + size cap, same rules as pantry
|
|
2631
|
+
uploads) and sent to the vision provider in memory โ it is not persisted;
|
|
2632
|
+
the client can attach it again when saving items via POST /pantry-items/.
|
|
2633
|
+
Recognized items are normalized to the app's enums before returning.
|
|
2634
|
+
* @summary Recognize Items
|
|
2635
|
+
*/
|
|
2636
|
+
export const recognizeItemsAiRecognizeItemsPost = (bodyRecognizeItemsAiRecognizeItemsPost, options) => {
|
|
2637
|
+
const formData = new FormData();
|
|
2638
|
+
formData.append(`image`, bodyRecognizeItemsAiRecognizeItemsPost.image);
|
|
2639
|
+
return axios.post(`/ai/recognize-items`, formData, options);
|
|
2640
|
+
};
|
|
2641
|
+
export const getRecognizeItemsAiRecognizeItemsPostMutationOptions = (options) => {
|
|
2642
|
+
const mutationKey = ['recognizeItemsAiRecognizeItemsPost'];
|
|
2643
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2644
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2645
|
+
options
|
|
2646
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2647
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2648
|
+
const mutationFn = (props) => {
|
|
2649
|
+
const { data } = props ?? {};
|
|
2650
|
+
return recognizeItemsAiRecognizeItemsPost(data, axiosOptions);
|
|
2651
|
+
};
|
|
2652
|
+
return { mutationFn, ...mutationOptions };
|
|
2653
|
+
};
|
|
2654
|
+
/**
|
|
2655
|
+
* @summary Recognize Items
|
|
2656
|
+
*/
|
|
2657
|
+
export const useRecognizeItemsAiRecognizeItemsPost = (options) => {
|
|
2658
|
+
const mutationOptions = getRecognizeItemsAiRecognizeItemsPostMutationOptions(options);
|
|
2659
|
+
return useMutation(mutationOptions);
|
|
2660
|
+
};
|
|
2661
|
+
/**
|
|
2662
|
+
* Read a grocery receipt photo into confirm-ready pantry drafts (ยง11).
|
|
2663
|
+
|
|
2664
|
+
The vision backend extracts one ReceiptLine per purchased item (taxes,
|
|
2665
|
+
totals and non-food skipped by the prompt); the server then normalizes
|
|
2666
|
+
units (same coercion as photo/barcode recognition), links each line to
|
|
2667
|
+
the catalog via the ingredient linker (misses stay null with raw_name
|
|
2668
|
+
preserved), and attaches restock prefill hints: suggested_location_id
|
|
2669
|
+
from purchase history and suggested_expiration_date from catalog shelf
|
|
2670
|
+
life โ the latter always flagged low-confidence. The confirm screen posts
|
|
2671
|
+
edited lines to POST /pantry-items/bulk with source=receipt.
|
|
2672
|
+
* @summary Recognize Receipt
|
|
2673
|
+
*/
|
|
2674
|
+
export const recognizeReceiptAiRecognizeReceiptPost = (bodyRecognizeReceiptAiRecognizeReceiptPost, options) => {
|
|
2675
|
+
const formData = new FormData();
|
|
2676
|
+
formData.append(`image`, bodyRecognizeReceiptAiRecognizeReceiptPost.image);
|
|
2677
|
+
return axios.post(`/ai/recognize-receipt`, formData, options);
|
|
2678
|
+
};
|
|
2679
|
+
export const getRecognizeReceiptAiRecognizeReceiptPostMutationOptions = (options) => {
|
|
2680
|
+
const mutationKey = ['recognizeReceiptAiRecognizeReceiptPost'];
|
|
2681
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2682
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2683
|
+
options
|
|
2684
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2685
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2686
|
+
const mutationFn = (props) => {
|
|
2687
|
+
const { data } = props ?? {};
|
|
2688
|
+
return recognizeReceiptAiRecognizeReceiptPost(data, axiosOptions);
|
|
2689
|
+
};
|
|
2690
|
+
return { mutationFn, ...mutationOptions };
|
|
2691
|
+
};
|
|
2692
|
+
/**
|
|
2693
|
+
* @summary Recognize Receipt
|
|
2694
|
+
*/
|
|
2695
|
+
export const useRecognizeReceiptAiRecognizeReceiptPost = (options) => {
|
|
2696
|
+
const mutationOptions = getRecognizeReceiptAiRecognizeReceiptPostMutationOptions(options);
|
|
2697
|
+
return useMutation(mutationOptions);
|
|
2698
|
+
};
|
|
2699
|
+
/**
|
|
2700
|
+
* Look up a UPC/EAN barcode on Open Food Facts and return a normalized item draft.
|
|
2701
|
+
|
|
2702
|
+
Deterministic and free; no LLM involved. item_type is inferred from OFF's
|
|
2703
|
+
crowd-sourced categories and is always flagged low-confidence for the user
|
|
2704
|
+
to confirm.
|
|
2705
|
+
* @summary Lookup Barcode
|
|
2706
|
+
*/
|
|
2707
|
+
export const lookupBarcodeAiLookupBarcodePost = (barcodeRequest, options) => {
|
|
2708
|
+
return axios.post(`/ai/lookup-barcode`, barcodeRequest, options);
|
|
2709
|
+
};
|
|
2710
|
+
export const getLookupBarcodeAiLookupBarcodePostMutationOptions = (options) => {
|
|
2711
|
+
const mutationKey = ['lookupBarcodeAiLookupBarcodePost'];
|
|
2712
|
+
const { mutation: mutationOptions, axios: axiosOptions } = options ?
|
|
2713
|
+
options.mutation && 'mutationKey' in options.mutation && options.mutation.mutationKey ?
|
|
2714
|
+
options
|
|
2715
|
+
: { ...options, mutation: { ...options.mutation, mutationKey } }
|
|
2716
|
+
: { mutation: { mutationKey, }, axios: undefined };
|
|
2717
|
+
const mutationFn = (props) => {
|
|
2718
|
+
const { data } = props ?? {};
|
|
2719
|
+
return lookupBarcodeAiLookupBarcodePost(data, axiosOptions);
|
|
2720
|
+
};
|
|
2721
|
+
return { mutationFn, ...mutationOptions };
|
|
2722
|
+
};
|
|
2723
|
+
/**
|
|
2724
|
+
* @summary Lookup Barcode
|
|
2725
|
+
*/
|
|
2726
|
+
export const useLookupBarcodeAiLookupBarcodePost = (options) => {
|
|
2727
|
+
const mutationOptions = getLookupBarcodeAiLookupBarcodePostMutationOptions(options);
|
|
631
2728
|
return useMutation(mutationOptions);
|
|
632
2729
|
};
|
|
633
2730
|
/**
|