khansama-api 1.68.0 → 1.69.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -912,6 +912,7 @@ export declare const DiscoverySortEnum: {
912
912
  export type EntitlementsResponseListsMax = number | null;
913
913
  export type EntitlementsResponseAiActionsMonth = number | null;
914
914
  export type EntitlementsResponseMembersMax = number | null;
915
+ export type EntitlementsResponseTemplatesMax = number | null;
915
916
  export type EntitlementsResponseSubscriptionStatus = string | null;
916
917
  export type EntitlementsResponseCurrentPeriodEnd = string | null;
917
918
  /**
@@ -931,6 +932,7 @@ export interface EntitlementsResponse {
931
932
  ai_actions_used: number;
932
933
  ai_actions_reset_at: string;
933
934
  members_max: EntitlementsResponseMembersMax;
935
+ templates_max: EntitlementsResponseTemplatesMax;
934
936
  subscription_status: EntitlementsResponseSubscriptionStatus;
935
937
  current_period_end: EntitlementsResponseCurrentPeriodEnd;
936
938
  cancel_at_period_end: boolean;
@@ -2401,6 +2403,54 @@ export interface PinnedNoteUpsert {
2401
2403
  */
2402
2404
  text: string;
2403
2405
  }
2406
+ export type PlanCopyDayResultAction = typeof PlanCopyDayResultAction[keyof typeof PlanCopyDayResultAction];
2407
+ export declare const PlanCopyDayResultAction: {
2408
+ readonly copied: "copied";
2409
+ readonly skipped: "skipped";
2410
+ readonly overwritten: "overwritten";
2411
+ };
2412
+ /**
2413
+ * What happened to one source day during a week copy.
2414
+ */
2415
+ export interface PlanCopyDayResult {
2416
+ /**
2417
+ * @minimum 0
2418
+ * @maximum 6
2419
+ */
2420
+ day_index: number;
2421
+ action: PlanCopyDayResultAction;
2422
+ meals_copied: number;
2423
+ }
2424
+ export type PlanCopyRequestDayIndex = number | null;
2425
+ export type PlanCopyRequestTargetName = string | null;
2426
+ /**
2427
+ * Copy a planned week (or one of its days) into another week (PAN-545).
2428
+
2429
+ The copy lands on the plan already at ``target_week_start`` (active
2430
+ preferred, then draft), or creates a draft plan for that week when there
2431
+ is none. ``day_index=None`` copies the whole week; a day number copies
2432
+ just that day. ``overwrite`` is the caller's explicit confirmation to
2433
+ replace target days that already hold meals — without it filled target
2434
+ days are left untouched and reported as skipped.
2435
+ */
2436
+ export interface PlanCopyRequest {
2437
+ target_week_start: string;
2438
+ day_index?: PlanCopyRequestDayIndex;
2439
+ overwrite?: boolean;
2440
+ with_grocery_list?: boolean;
2441
+ target_name?: PlanCopyRequestTargetName;
2442
+ }
2443
+ export type PlanCopyResponseGroceryList = PlanGroceryListResponse | null;
2444
+ /**
2445
+ * The target plan after the copy, plus the per-day outcome and the
2446
+ (optional) refreshed grocery list.
2447
+ */
2448
+ export interface PlanCopyResponse {
2449
+ plan: MealPlanDetailResponse;
2450
+ created: boolean;
2451
+ days: PlanCopyDayResult[];
2452
+ grocery_list?: PlanCopyResponseGroceryList;
2453
+ }
2404
2454
  export interface PlanGenerateMetadata {
2405
2455
  provider: string;
2406
2456
  model: string;
@@ -2516,6 +2566,16 @@ export interface PlanSlotBulkRequest {
2516
2566
  */
2517
2567
  items: PlanSlotBulkItem[];
2518
2568
  }
2569
+ /**
2570
+ * Save a household plan as a reusable template (PAN-545).
2571
+ */
2572
+ export interface PlanTemplateCreate {
2573
+ /**
2574
+ * @minLength 1
2575
+ * @maxLength 200
2576
+ */
2577
+ name: string;
2578
+ }
2519
2579
  export type PlanWeekViewResponseShoppingList = PlanGroceryListResponse | null;
2520
2580
  /**
2521
2581
  * Read-back after a swap / lock / undo (``GET /plans/{id}/week-view``).
@@ -7092,6 +7152,73 @@ export declare const useAdoptPresetPlansPresetsPresetIdAdoptPost: <TError = Axio
7092
7152
  presetId: number;
7093
7153
  params?: AdoptPresetPlansPresetsPresetIdAdoptPostParams;
7094
7154
  }, TContext>;
7155
+ /**
7156
+ * Copy this plan's week (or one day) into another week (PAN-545): the
7157
+ copy lands on the plan already at the target week, or creates a draft
7158
+ plan for it. Filled target days are never replaced without
7159
+ ``overwrite=true`` — the app asks before sending it.
7160
+ * @summary Copy Plan Week
7161
+ */
7162
+ export declare const copyPlanWeekPlansPlanIdCopyPost: (planId: number, planCopyRequest: PlanCopyRequest, options?: AxiosRequestConfig) => Promise<AxiosResponse<PlanCopyResponse>>;
7163
+ export declare const getCopyPlanWeekPlansPlanIdCopyPostMutationOptions: <TError = AxiosError<HTTPValidationError>, TContext = unknown>(options?: {
7164
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof copyPlanWeekPlansPlanIdCopyPost>>, TError, {
7165
+ planId: number;
7166
+ data: PlanCopyRequest;
7167
+ }, TContext>;
7168
+ axios?: AxiosRequestConfig;
7169
+ }) => UseMutationOptions<Awaited<ReturnType<typeof copyPlanWeekPlansPlanIdCopyPost>>, TError, {
7170
+ planId: number;
7171
+ data: PlanCopyRequest;
7172
+ }, TContext>;
7173
+ export type CopyPlanWeekPlansPlanIdCopyPostMutationResult = NonNullable<Awaited<ReturnType<typeof copyPlanWeekPlansPlanIdCopyPost>>>;
7174
+ export type CopyPlanWeekPlansPlanIdCopyPostMutationBody = PlanCopyRequest;
7175
+ export type CopyPlanWeekPlansPlanIdCopyPostMutationError = AxiosError<HTTPValidationError>;
7176
+ /**
7177
+ * @summary Copy Plan Week
7178
+ */
7179
+ export declare const useCopyPlanWeekPlansPlanIdCopyPost: <TError = AxiosError<HTTPValidationError>, TContext = unknown>(options?: {
7180
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof copyPlanWeekPlansPlanIdCopyPost>>, TError, {
7181
+ planId: number;
7182
+ data: PlanCopyRequest;
7183
+ }, TContext>;
7184
+ axios?: AxiosRequestConfig;
7185
+ }) => UseMutationResult<Awaited<ReturnType<typeof copyPlanWeekPlansPlanIdCopyPost>>, TError, {
7186
+ planId: number;
7187
+ data: PlanCopyRequest;
7188
+ }, TContext>;
7189
+ /**
7190
+ * Save this plan as a named template (PAN-545) any future week can be
7191
+ created from. Plus-only where the plan limits apply — a capped Free
7192
+ household gets the 402 the app renders as the upgrade card.
7193
+ * @summary Save Plan As Template
7194
+ */
7195
+ export declare const savePlanAsTemplatePlansPlanIdSaveAsTemplatePost: (planId: number, planTemplateCreate: PlanTemplateCreate, options?: AxiosRequestConfig) => Promise<AxiosResponse<MealPlanDetailResponse>>;
7196
+ export declare const getSavePlanAsTemplatePlansPlanIdSaveAsTemplatePostMutationOptions: <TError = AxiosError<HTTPValidationError>, TContext = unknown>(options?: {
7197
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof savePlanAsTemplatePlansPlanIdSaveAsTemplatePost>>, TError, {
7198
+ planId: number;
7199
+ data: PlanTemplateCreate;
7200
+ }, TContext>;
7201
+ axios?: AxiosRequestConfig;
7202
+ }) => UseMutationOptions<Awaited<ReturnType<typeof savePlanAsTemplatePlansPlanIdSaveAsTemplatePost>>, TError, {
7203
+ planId: number;
7204
+ data: PlanTemplateCreate;
7205
+ }, TContext>;
7206
+ export type SavePlanAsTemplatePlansPlanIdSaveAsTemplatePostMutationResult = NonNullable<Awaited<ReturnType<typeof savePlanAsTemplatePlansPlanIdSaveAsTemplatePost>>>;
7207
+ export type SavePlanAsTemplatePlansPlanIdSaveAsTemplatePostMutationBody = PlanTemplateCreate;
7208
+ export type SavePlanAsTemplatePlansPlanIdSaveAsTemplatePostMutationError = AxiosError<HTTPValidationError>;
7209
+ /**
7210
+ * @summary Save Plan As Template
7211
+ */
7212
+ export declare const useSavePlanAsTemplatePlansPlanIdSaveAsTemplatePost: <TError = AxiosError<HTTPValidationError>, TContext = unknown>(options?: {
7213
+ mutation?: UseMutationOptions<Awaited<ReturnType<typeof savePlanAsTemplatePlansPlanIdSaveAsTemplatePost>>, TError, {
7214
+ planId: number;
7215
+ data: PlanTemplateCreate;
7216
+ }, TContext>;
7217
+ axios?: AxiosRequestConfig;
7218
+ }) => UseMutationResult<Awaited<ReturnType<typeof savePlanAsTemplatePlansPlanIdSaveAsTemplatePost>>, TError, {
7219
+ planId: number;
7220
+ data: PlanTemplateCreate;
7221
+ }, TContext>;
7095
7222
  /**
7096
7223
  * One plan with its slots (eager-loaded).
7097
7224
  * @summary Get Plan