@dunbackmeadow/commerce-sdk 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as AppInfo, V as VenueLocation, C as CuisineQuery, a as Cuisine, R as RestaurantSummary, D as DrinkType, b as CuisineCatalog, c as CateringRequestInput, d as CateringRequest, S as SelectOptionInput, O as Order, U as UpdateDeliveryInput, e as CancelOrderOptions, L as LateRefundRequestInput, f as LateRefundRequest, W as WebhookEvent } from './luma-
|
|
2
|
-
export { g as ATTENDING_STATUSES, h as Address, i as AllergyCoverage, j as Attendee, B as BuildCateringRequestArgs, k as
|
|
1
|
+
import { A as AppInfo, V as VenueLocation, C as CuisineQuery, a as Cuisine, R as RestaurantSummary, D as DrinkType, b as CuisineCatalog, c as CateringRequestInput, d as CateringRequest, S as SelectOptionInput, O as Order, U as UpdateDeliveryInput, e as CancelOrderOptions, L as LateRefundRequestInput, f as LateRefundRequest, W as WebhookEvent } from './luma-WIhD5QRd.js';
|
|
2
|
+
export { g as ATTENDING_STATUSES, h as Address, i as AllergyCoverage, j as Attendee, B as BuildCateringRequestArgs, k as CateringBudgetResult, l as CateringItem, m as CateringMealType, n as CateringOption, o as CateringPolicies, p as CateringRequestStatus, q as CateringServiceStyle, r as CuisineId, s as CustomCuisineId, t as DUNBACK_REGISTRATION_QUESTION, u as DeliveredLateData, v as DrinkTypeId, w as DunbackEventSettings, x as LumaEventLike, y as LumaGuestLike, z as OrderCancellation, E as OrderDelivery, F as OrderRevision, G as OrderStatus, P as PartyDiet, H as PingData, I as Price, J as PriceLine, K as RefundDecidedData, M as StandardCuisineId, N as UnavailableReason, Q as UnavailableReasonCode, T as UnfedGuests, X as UsdcPaymentInstructions, Y as WebhookEventType, Z as buildCateringRequest, _ as canOrderFood, $ as guestsWithUnsharedAllergies, a0 as toDunbackAddress, a1 as toDunbackAttendees, a2 as toVenueLocation } from './luma-WIhD5QRd.js';
|
|
3
3
|
|
|
4
4
|
/** Any non-2xx answer from the Partner API. */
|
|
5
5
|
declare class DunbackApiError extends Error {
|
package/dist/index.js
CHANGED
|
@@ -316,7 +316,9 @@ function toVenueLocation(geo) {
|
|
|
316
316
|
function buildCateringRequest(args) {
|
|
317
317
|
const { event, guests, settings, host } = args;
|
|
318
318
|
if (!settings?.enabled) throw new Error("Dunback catering is not enabled for this event.");
|
|
319
|
-
if (!settings.drinksOnly && !settings.restaurantName && !settings.cuisine
|
|
319
|
+
if (!settings.drinksOnly && !settings.restaurantName && !settings.cuisine && !settings.dishPreferences?.length && settings.mealType !== "breakfast") {
|
|
320
|
+
throw new Error("Choose a restaurant, a cuisine or the dishes you'd like for the catering.");
|
|
321
|
+
}
|
|
320
322
|
const onsite = args.onsiteContact || settings.onsiteContact || (host.phone ? { name: host.name, phone: host.phone, email: host.email } : null);
|
|
321
323
|
if (!onsite) throw new Error("An on-site contact with a phone number is required for delivery.");
|
|
322
324
|
const attendees = [...toDunbackAttendees(guests), ...args.extraAttendees || []];
|
|
@@ -325,11 +327,18 @@ function buildCateringRequest(args) {
|
|
|
325
327
|
partnerReference: `luma:${event.api_id || event.id}`,
|
|
326
328
|
event: { name: event.name, startsAt: event.start_at, timeZone: event.timezone, ...event.url ? { url: event.url } : {} },
|
|
327
329
|
...settings.deliveryDeadlineLocal ? { deliveryDeadlineLocal: settings.deliveryDeadlineLocal } : {},
|
|
328
|
-
...settings.restaurantName ? { restaurantName: settings.restaurantName } : settings.drinksOnly ? {} : { cuisine: settings.cuisine },
|
|
330
|
+
...settings.restaurantName ? { restaurantName: settings.restaurantName } : settings.drinksOnly || !settings.cuisine ? {} : { cuisine: settings.cuisine },
|
|
329
331
|
serviceStyle: settings.serviceStyle ?? "meal_boxes",
|
|
330
332
|
...settings.drinksOnly ? { drinksOnly: true } : { includeDrinks: settings.includeDrinks ?? true },
|
|
331
333
|
...settings.drinkTypes?.length ? { drinkTypes: settings.drinkTypes } : {},
|
|
332
334
|
...settings.budgetPerGuest ? { budgetPerGuest: settings.budgetPerGuest } : {},
|
|
335
|
+
...settings.maxTotal ? { maxTotal: settings.maxTotal } : {},
|
|
336
|
+
...settings.maxPerGuest ? { maxPerGuest: settings.maxPerGuest } : {},
|
|
337
|
+
// Dish rules are about food: not for a drinks-only order.
|
|
338
|
+
...!settings.drinksOnly && settings.dishPreferences?.length ? { dishPreferences: settings.dishPreferences } : {},
|
|
339
|
+
...!settings.drinksOnly && settings.mealType ? { mealType: settings.mealType } : {},
|
|
340
|
+
...!settings.drinksOnly && settings.spicyShare != null ? { spicyShare: settings.spicyShare } : {},
|
|
341
|
+
...!settings.drinksOnly && settings.partyDiet?.length ? { partyDiet: settings.partyDiet } : {},
|
|
333
342
|
deliveryAddress: args.deliveryAddress || toDunbackAddress(event.geo_address_json),
|
|
334
343
|
onsiteContact: onsite,
|
|
335
344
|
deliveryNotes: settings.deliveryNotes || "",
|
|
@@ -149,9 +149,10 @@ interface CateringRequestInput {
|
|
|
149
149
|
*/
|
|
150
150
|
restaurantName?: string;
|
|
151
151
|
/**
|
|
152
|
-
* Required
|
|
153
|
-
*
|
|
154
|
-
*
|
|
152
|
+
* Required unless you give restaurantName, dishPreferences or mealType
|
|
153
|
+
* "breakfast" (then any cuisine). Restaurants whose primary cuisine this is
|
|
154
|
+
* are matched first; restaurants listing it as their secondary cuisine only
|
|
155
|
+
* when none of those can cater.
|
|
155
156
|
*/
|
|
156
157
|
cuisine?: CuisineId;
|
|
157
158
|
/**
|
|
@@ -177,8 +178,34 @@ interface CateringRequestInput {
|
|
|
177
178
|
* types; with food, the drinks come from these types when the restaurant has them.
|
|
178
179
|
*/
|
|
179
180
|
drinkTypes?: DrinkTypeId[];
|
|
180
|
-
/**
|
|
181
|
+
/** Soft: options above this card price per guest are only flagged `withinBudget: false`. */
|
|
181
182
|
budgetPerGuest?: number;
|
|
183
|
+
/**
|
|
184
|
+
* Hard budget, USD: options priced above it are not offered. Compared with
|
|
185
|
+
* what the host would pay: the card total, or the USDC total at a restaurant
|
|
186
|
+
* that takes no card. When it leaves fewer than three options,
|
|
187
|
+
* `CateringRequest.budget.message` says how far to raise it for three.
|
|
188
|
+
*/
|
|
189
|
+
maxTotal?: number;
|
|
190
|
+
/** Hard budget per guest, USD (see `maxTotal`). */
|
|
191
|
+
maxPerGuest?: number;
|
|
192
|
+
/**
|
|
193
|
+
* Kinds of dishes the host wants, up to 8: "sushi", "seafood", "pastries",
|
|
194
|
+
* "bagels", "tacos"... The mains come from dishes that match; a guest no
|
|
195
|
+
* matching dish is safe for gets another safe main (its allergyCoverage
|
|
196
|
+
* entry says `outsidePreferences: true`). Any cuisine when none is given.
|
|
197
|
+
*/
|
|
198
|
+
dishPreferences?: string[];
|
|
199
|
+
/**
|
|
200
|
+
* The kind of food, whatever the delivery time: "breakfast" (pastries,
|
|
201
|
+
* bagels, egg dishes, fruit...), "lunch" or "dinner". Without it, a delivery
|
|
202
|
+
* before 10:30 prefers breakfast food without requiring it.
|
|
203
|
+
*/
|
|
204
|
+
mealType?: CateringMealType;
|
|
205
|
+
/** About this share (0..1) of the main servings spicy; 0 = nothing spicy. */
|
|
206
|
+
spicyShare?: number;
|
|
207
|
+
/** Diets every guest's food must fit, e.g. ["vegetarian"] for an all-vegetarian event. */
|
|
208
|
+
partyDiet?: PartyDiet[];
|
|
182
209
|
deliveryAddress: Address;
|
|
183
210
|
/** Who receives the delivery at the venue. */
|
|
184
211
|
onsiteContact: {
|
|
@@ -194,6 +221,28 @@ interface CateringRequestInput {
|
|
|
194
221
|
};
|
|
195
222
|
attendees: Attendee[];
|
|
196
223
|
}
|
|
224
|
+
type CateringMealType = "breakfast" | "lunch" | "dinner";
|
|
225
|
+
type PartyDiet = "vegetarian" | "vegan" | "halal" | "kosher" | "gluten_free" | "dairy_free" | "pescatarian";
|
|
226
|
+
/** What a hard budget (`maxTotal` / `maxPerGuest`) did to the options. */
|
|
227
|
+
interface CateringBudgetResult {
|
|
228
|
+
maxTotal: number | null;
|
|
229
|
+
maxPerGuest: number | null;
|
|
230
|
+
/** The budget for the whole order (the tighter of the two), USD. */
|
|
231
|
+
limit: number;
|
|
232
|
+
/** Options offered (all within the budget). */
|
|
233
|
+
withinBudget: number;
|
|
234
|
+
/** Options left out for being over the budget. */
|
|
235
|
+
overBudget: number;
|
|
236
|
+
/** With fewer than three options: about how far to raise the budget for three (null otherwise). */
|
|
237
|
+
suggestedMaxTotal: number | null;
|
|
238
|
+
suggestedMaxPerGuest: number | null;
|
|
239
|
+
/**
|
|
240
|
+
* Show this to the host when set, e.g. "Only 2 catering offers fit your
|
|
241
|
+
* budget of $1,000. Raising your budget to about $1,150 would give you 3
|
|
242
|
+
* offers to choose from."
|
|
243
|
+
*/
|
|
244
|
+
message: string | null;
|
|
245
|
+
}
|
|
197
246
|
/** A drink type from `listDrinkTypes()`, or any short word ("horchata"). */
|
|
198
247
|
type DrinkTypeId = "coffee" | "tea" | "milk_tea" | "boba" | "fruit_tea" | "smoothie" | "juice" | "soda" | "hot_chocolate" | "water" | (string & {});
|
|
199
248
|
interface DrinkType {
|
|
@@ -247,6 +296,10 @@ interface CateringItem {
|
|
|
247
296
|
dietaryTags: string[];
|
|
248
297
|
/** true for a shared dish added so the order reaches the restaurant's minimum. */
|
|
249
298
|
addedForMinimum?: boolean;
|
|
299
|
+
/** The request's dishPreferences this dish matches ("sushi"). */
|
|
300
|
+
matches?: string[];
|
|
301
|
+
/** true for a spicy main (see spicyShare). */
|
|
302
|
+
spicy?: boolean;
|
|
250
303
|
/**
|
|
251
304
|
* A drink's choices, from the restaurant's own options: ["Sweetness: 50%",
|
|
252
305
|
* "Toppings: Boba"]. Each option mixes them differently (favorites: the
|
|
@@ -259,6 +312,8 @@ interface AllergyCoverage {
|
|
|
259
312
|
constraint: string;
|
|
260
313
|
guests: number;
|
|
261
314
|
dishes: string[];
|
|
315
|
+
/** None of the dishes asked for (dishPreferences / mealType) is safe for these guests: they get other safe dishes. */
|
|
316
|
+
outsidePreferences?: boolean;
|
|
262
317
|
}
|
|
263
318
|
interface UnfedGuests {
|
|
264
319
|
constraint: string;
|
|
@@ -286,7 +341,11 @@ interface CateringOption {
|
|
|
286
341
|
/** Guests no dish on this menu is known to be safe for. Show this to the host. */
|
|
287
342
|
unfedGuests: UnfedGuests[];
|
|
288
343
|
price: Price;
|
|
344
|
+
/** With budgetPerGuest (soft) or maxTotal / maxPerGuest (hard; always true then). */
|
|
289
345
|
withinBudget?: boolean;
|
|
346
|
+
/** With spicyShare only: main servings that are spicy, of all main servings. */
|
|
347
|
+
spicyServings?: number;
|
|
348
|
+
mainServings?: number;
|
|
290
349
|
/**
|
|
291
350
|
* false when this restaurant hasn't set up card payments on Dunback (its
|
|
292
351
|
* Stripe account): the option can then only be paid in USDC, and selecting
|
|
@@ -326,7 +385,10 @@ interface CateringRequest {
|
|
|
326
385
|
restaurant: {
|
|
327
386
|
requested: string;
|
|
328
387
|
found: boolean | null;
|
|
388
|
+
/** The restaurant found: may differ from `requested` (part of a name, or a misspelling). */
|
|
329
389
|
name: string | null;
|
|
390
|
+
/** true: no restaurant has that name; `name` is the closest spelling found (e.g. "Ragoon Ruby" -> "Rangoon Ruby Palo Alto"). Show the host which restaurant it is. */
|
|
391
|
+
closeMatch?: boolean;
|
|
330
392
|
available: boolean | null;
|
|
331
393
|
reason: string | null;
|
|
332
394
|
} | null;
|
|
@@ -335,6 +397,14 @@ interface CateringRequest {
|
|
|
335
397
|
drinksOnly: boolean;
|
|
336
398
|
includeDrinks: boolean;
|
|
337
399
|
drinkTypes: DrinkType[];
|
|
400
|
+
dishPreferences: string[];
|
|
401
|
+
mealType: CateringMealType | null;
|
|
402
|
+
spicyShare: number | null;
|
|
403
|
+
partyDiet: PartyDiet[];
|
|
404
|
+
maxTotal: number | null;
|
|
405
|
+
maxPerGuest: number | null;
|
|
406
|
+
/** With a hard budget only. Show `budget.message` to the host when it is set. */
|
|
407
|
+
budget: CateringBudgetResult | null;
|
|
338
408
|
guestCount: number;
|
|
339
409
|
deliveryDeadlineLocal: string;
|
|
340
410
|
timeZone: string;
|
|
@@ -355,7 +425,7 @@ interface CateringRequest {
|
|
|
355
425
|
updatedAt: string;
|
|
356
426
|
}
|
|
357
427
|
/** Why a restaurant can't cater an event. Unknown codes may be added: treat them as "other". */
|
|
358
|
-
type UnavailableReasonCode = "party_too_large" | "below_minimum_order" | "notice_too_short" | "no_buffet_dishes" | "style_not_offered" | "outside_delivery_area" | "not_serving_then" | "different_cuisine" | "restaurant_declined";
|
|
428
|
+
type UnavailableReasonCode = "party_too_large" | "below_minimum_order" | "notice_too_short" | "no_buffet_dishes" | "style_not_offered" | "outside_delivery_area" | "not_serving_then" | "different_cuisine" | "no_matching_dishes" | "over_budget" | "restaurant_declined";
|
|
359
429
|
interface UnavailableReason {
|
|
360
430
|
/** Restaurant name. */
|
|
361
431
|
name: string;
|
|
@@ -680,7 +750,7 @@ interface DunbackEventSettings {
|
|
|
680
750
|
* a cuisine picker: the restaurant settles it, and all options come from it.
|
|
681
751
|
*/
|
|
682
752
|
restaurantName?: string;
|
|
683
|
-
/** Required when no restaurantName is set, unless drinksOnly. */
|
|
753
|
+
/** Required when no restaurantName is set, unless drinksOnly, dishPreferences or mealType "breakfast". */
|
|
684
754
|
cuisine?: CuisineId;
|
|
685
755
|
/**
|
|
686
756
|
* Drinks only, no food (coffee for a morning meetup, boba for a study
|
|
@@ -697,7 +767,19 @@ interface DunbackEventSettings {
|
|
|
697
767
|
serviceStyle?: CateringServiceStyle;
|
|
698
768
|
/** Food catering: also one drink per guest. Default true. */
|
|
699
769
|
includeDrinks?: boolean;
|
|
770
|
+
/** Soft: options above it are flagged withinBudget: false. */
|
|
700
771
|
budgetPerGuest?: number;
|
|
772
|
+
/** Hard budget (USD): options above it aren't offered (see CateringRequestInput.maxTotal). */
|
|
773
|
+
maxTotal?: number;
|
|
774
|
+
maxPerGuest?: number;
|
|
775
|
+
/** Dishes the host wants: "sushi", "seafood", "pastries", "bagels"... */
|
|
776
|
+
dishPreferences?: string[];
|
|
777
|
+
/** "breakfast" for breakfast food (pastries, bagels, eggs...) whatever the time. */
|
|
778
|
+
mealType?: CateringMealType;
|
|
779
|
+
/** About this share (0..1) of the main servings spicy; 0 = nothing spicy. */
|
|
780
|
+
spicyShare?: number;
|
|
781
|
+
/** Diets every guest's food must fit, e.g. ["vegetarian"]. */
|
|
782
|
+
partyDiet?: PartyDiet[];
|
|
701
783
|
/**
|
|
702
784
|
* The host's estimate of how many guests will attend (or the event's
|
|
703
785
|
* capacity). Pass it to listCuisines(venue, { guests }) so only cuisines
|
|
@@ -829,4 +911,4 @@ declare function canOrderFood(settings: DunbackEventSettings | null | undefined,
|
|
|
829
911
|
reason?: string;
|
|
830
912
|
};
|
|
831
913
|
|
|
832
|
-
export {
|
|
914
|
+
export { guestsWithUnsharedAllergies as $, type AppInfo as A, type BuildCateringRequestArgs as B, type CuisineQuery as C, type DrinkType as D, type OrderDelivery as E, type OrderRevision as F, type OrderStatus as G, type PingData as H, type Price as I, type PriceLine as J, type RefundDecidedData as K, type LateRefundRequestInput as L, type StandardCuisineId as M, type UnavailableReason as N, type Order as O, type PartyDiet as P, type UnavailableReasonCode as Q, type RestaurantSummary as R, type SelectOptionInput as S, type UnfedGuests as T, type UpdateDeliveryInput as U, type VenueLocation as V, type WebhookEvent as W, type UsdcPaymentInstructions as X, type WebhookEventType as Y, buildCateringRequest as Z, canOrderFood as _, type Cuisine as a, toDunbackAddress as a0, toDunbackAttendees as a1, toVenueLocation as a2, type CuisineCatalog as b, type CateringRequestInput as c, type CateringRequest as d, type CancelOrderOptions as e, type LateRefundRequest as f, ATTENDING_STATUSES as g, type Address as h, type AllergyCoverage as i, type Attendee as j, type CateringBudgetResult as k, type CateringItem as l, type CateringMealType as m, type CateringOption as n, type CateringPolicies as o, type CateringRequestStatus as p, type CateringServiceStyle as q, type CuisineId as r, type CustomCuisineId as s, DUNBACK_REGISTRATION_QUESTION as t, type DeliveredLateData as u, type DrinkTypeId as v, type DunbackEventSettings as w, type LumaEventLike as x, type LumaGuestLike as y, type OrderCancellation as z };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { n as CateringOption, a as Cuisine, w as DunbackEventSettings, R as RestaurantSummary, D as DrinkType, O as Order, I as Price } from '../luma-WIhD5QRd.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Optional, unstyled-by-default React building blocks for the three Luma
|
package/docs/API_REFERENCE.md
CHANGED
|
@@ -106,11 +106,17 @@ serves them. Hosts can pick them like any other: send the `id` as `cuisine`.
|
|
|
106
106
|
| `event.timeZone` | IANA, required | Venue time zone |
|
|
107
107
|
| `event.url` | URL | |
|
|
108
108
|
| `deliveryDeadlineLocal` | `YYYY-MM-DDTHH:mm` | Default: `startsAt` minus 30 min, venue-local |
|
|
109
|
-
| `restaurantName` | string | A restaurant the host prefers (`/catalog/restaurants`): all options come from it. Send it or `cuisine`, not both. If it can't cater, `restaurant.available` is false and `restaurant.reason` says why; the options are from other restaurants |
|
|
110
|
-
| `cuisine` | cuisine id
|
|
109
|
+
| `restaurantName` | string | A restaurant the host prefers (`/catalog/restaurants`): all options come from it. Part of a name matches every location; small misspellings are tolerated when no restaurant matches exactly (`restaurant.closeMatch: true`). Send it or `cuisine`, not both. If it can't cater, `restaurant.available` is false and `restaurant.reason` says why; the options are from other restaurants |
|
|
110
|
+
| `cuisine` | cuisine id | A standard id or a `custom:…` id from `/catalog/cuisines`. Required unless you send `restaurantName`, `dishPreferences` or `mealType: "breakfast"` (then any cuisine) |
|
|
111
111
|
| `serviceStyle` | `buffet` or `meal_boxes` | How food is served. `buffet`: trays and platters to share, from restaurants with catering dishes. `meal_boxes`: one packed meal per guest from restaurants' regular dishes (more dishes, usually more restaurants). Default `meal_boxes`. |
|
|
112
112
|
| `includeDrinks` | bool | Default true. Non-alcoholic only. |
|
|
113
|
-
| `
|
|
113
|
+
| `dishPreferences` | string[], up to 8 | Kinds of dishes the host wants: `"sushi"`, `"seafood"`, `"pastries"`, `"bagels"`, `"tacos"`… The mains come from dishes that match (name, description, category, tags; `"seafood"` also by a fish or shellfish allergen), and only restaurants with such dishes take part. A guest none of them is safe for gets another safe main (`allergyCoverage[].outsidePreferences: true`) |
|
|
114
|
+
| `mealType` | `breakfast`, `lunch` or `dinner` | The kind of food, whatever the delivery time. Breakfast food: dishes in the restaurant's breakfast or brunch menu, or that read like breakfast (pastries, bagels, egg dishes, oatmeal, fruit platters…). Without it, a delivery before 10:30 prefers breakfast food without requiring it |
|
|
115
|
+
| `spicyShare` | number 0–1 | About this share of the main servings spicy (`0.33` = a third; `0` = nothing spicy). Spicy: the restaurant's spice level 2 or more, or, without a level, the dish's wording ("spicy", "Sichuan", "jalapeño"…) |
|
|
116
|
+
| `partyDiet` | array of `vegetarian`, `vegan`, `halal`, `kosher`, `gluten_free`, `dairy_free`, `pescatarian` | Every guest's food must fit, as if each guest had said so (an all-vegetarian event) |
|
|
117
|
+
| `maxTotal` | number, USD | Hard budget for the order: options priced above it are not offered. Compared with what the host would pay (the card total; the USDC total at a restaurant that takes no card). See `budget` below |
|
|
118
|
+
| `maxPerGuest` | number, USD | Hard budget per guest, like `maxTotal` |
|
|
119
|
+
| `budgetPerGuest` | number | Soft: only flags options above it (`withinBudget: false`) |
|
|
114
120
|
| `deliveryAddress` | `{address1, address2?, city, state?, zip, country?}`, required | |
|
|
115
121
|
| `onsiteContact` | `{name, phone, email?}`, required | Receives the delivery |
|
|
116
122
|
| `deliveryNotes` | string | |
|
|
@@ -147,10 +153,12 @@ Composing usually takes 5–30 s. When it finishes, you receive the
|
|
|
147
153
|
| `object` | `"catering_request"` |
|
|
148
154
|
| `status` | `COMPOSING`, `OPTIONS_READY`, `NO_OPTIONS`, `SELECTED` or `FAILED` |
|
|
149
155
|
| `partnerReference`, `event`, `cuisine`, `guestCount` | As sent; `event` gains `startsAtLocal` |
|
|
156
|
+
| `dishPreferences`, `mealType`, `spicyShare`, `partyDiet`, `maxTotal`, `maxPerGuest` | As sent (`[]` / `null` when not) |
|
|
157
|
+
| `budget` | With `maxTotal` / `maxPerGuest` only: `{ maxTotal, maxPerGuest, limit, withinBudget, overBudget, suggestedMaxTotal, suggestedMaxPerGuest, message }`. When the budget leaves fewer than three options, `message` says so and how far to raise it for three ("Only 2 catering offers fit your budget of $1,000. Raising your budget to about $1,150 would give you 3 offers to choose from."). **Show `message` to the host.** |
|
|
150
158
|
| `deliveryDeadlineLocal`, `timeZone`, `daypart` | |
|
|
151
159
|
| `allergySummary` | `[{ constraint, guests: [names] }]` |
|
|
152
|
-
| `options` | Up to 3;
|
|
153
|
-
| `unavailableReasons` | `[{ name, code, reason }]` when `NO_OPTIONS`. `code`: `party_too_large`, `below_minimum_order`, `notice_too_short`, `no_buffet_dishes`, `style_not_offered`, `outside_delivery_area`, `not_serving_then`, `different_cuisine` or `restaurant_declined` (more may be added) |
|
|
160
|
+
| `options` | Up to 3, each from one restaurant; from different restaurants when several can cater. See below |
|
|
161
|
+
| `unavailableReasons` | `[{ name, code, reason }]` when `NO_OPTIONS`. `code`: `party_too_large`, `below_minimum_order`, `notice_too_short`, `no_buffet_dishes`, `style_not_offered`, `outside_delivery_area`, `not_serving_then`, `different_cuisine`, `no_matching_dishes` (none of the dishes asked for), `over_budget` or `restaurant_declined` (more may be added) |
|
|
154
162
|
| `orderId` | Set once an option is selected |
|
|
155
163
|
| `error` | `{ code, message }`, when `FAILED` |
|
|
156
164
|
| `createdAt`, `updatedAt` | |
|
|
@@ -96,6 +96,12 @@ type DunbackEventSettings = {
|
|
|
96
96
|
serviceStyle?: "buffet" | "meal_boxes"; // default "meal_boxes"
|
|
97
97
|
includeDrinks?: boolean; // default true (non-alcoholic only)
|
|
98
98
|
budgetPerGuest?: number; // USD; options above it are flagged, not hidden
|
|
99
|
+
maxTotal?: number; // USD, hard: options above it aren't offered; show request.budget.message
|
|
100
|
+
maxPerGuest?: number; // USD per guest, hard
|
|
101
|
+
dishPreferences?: string[]; // "sushi", "seafood", "pastries", "bagels"... (no cuisine needed)
|
|
102
|
+
mealType?: "breakfast" | "lunch" | "dinner"; // "breakfast": pastries, bagels, eggs... whatever the time
|
|
103
|
+
spicyShare?: number; // 0..1 of the main servings spicy; 0 = nothing spicy
|
|
104
|
+
partyDiet?: ("vegetarian" | "vegan" | "halal" | "kosher" | "gluten_free" | "dairy_free" | "pescatarian")[];
|
|
99
105
|
guestListDeadline?: string; // ISO; "Order Food" is offered from then on
|
|
100
106
|
deliveryDeadlineLocal?: string; // default: 30 min before start, venue-local "YYYY-MM-DDTHH:mm"
|
|
101
107
|
deliveryNotes?: string; // "Loading dock on Emerson St"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dunbackmeadow/commerce-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Official Node.js/TypeScript SDK for the Dunback Meadow commerce API. Order from your app or agent and pay by card (Stripe) or USDC. Event catering is available now; more product types are coming.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|