order3000 1.11.0 → 1.13.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/client.cjs CHANGED
@@ -631,6 +631,29 @@ class BeveragesResource extends BaseResource {
631
631
  constructor(tokenManager, baseUrl) {
632
632
  super(tokenManager, baseUrl, "/beverages");
633
633
  }
634
+ /**
635
+ * Fetch a beverage by its `accessor` slug (localized name/description,
636
+ * price, assets with public URLs). Pair with `patch` for a safe
637
+ * read-modify-write rename that preserves untouched locales.
638
+ */
639
+ async get(accessor) {
640
+ return this.request(
641
+ "GET",
642
+ `/${encodeURIComponent(accessor)}`
643
+ );
644
+ }
645
+ /**
646
+ * Edit a beverage by id. `editBeverage` replaces the fields it receives,
647
+ * so callers wanting a partial change should read the beverage with `get`
648
+ * first and merge. Returns the updated beverage row.
649
+ */
650
+ async patch(beverageId, body) {
651
+ return this.request(
652
+ "PATCH",
653
+ `/${encodeURIComponent(beverageId)}`,
654
+ body
655
+ );
656
+ }
634
657
  /**
635
658
  * Upload an asset image for a beverage. The SDK builds the multipart body
636
659
  * internally — pass a Buffer/Uint8Array, the original filename, the MIME type,
@@ -838,16 +861,20 @@ class EventsResource extends BaseResource {
838
861
  return event.assets ?? [];
839
862
  }
840
863
  /**
841
- * Per-start-slot occupancy availability for an event on a date. Each slot's
842
- * `offered` honours the venue's reservation mode (`passive`: every slot;
843
- * `auto_steer`: only acceptable slots), so a public widget can pre-exclude
844
- * fully-booked start times.
864
+ * Per-start-slot availability for an event on a date, per booking channel.
865
+ * Reservation channel: each slot's `offered` honours the venue's
866
+ * reservation mode (`passive`: every slot; `auto_steer`: only acceptable
867
+ * slots), so a public widget can pre-exclude fully-booked start times.
868
+ * Order channel: the event's order-pickup grid gated by per-slot caps and
869
+ * the order booking window (no table occupancy); events without a
870
+ * dedicated order grid inherit the reservation grid.
845
871
  */
846
872
  async getSlotAvailability(idOrAccessor, options) {
847
873
  const params = new URLSearchParams();
848
874
  params.set("reservationDate", options.reservationDate);
849
875
  params.set("partySize", String(options.partySize));
850
876
  if (options.areaId) params.set("areaId", options.areaId);
877
+ if (options.channel) params.set("channel", options.channel);
851
878
  return this.request(
852
879
  "GET",
853
880
  `/${encodeURIComponent(idOrAccessor)}/slot-availability?${params.toString()}`
@@ -999,6 +1026,64 @@ class PaymentIntentsResource extends BaseResource {
999
1026
  }
1000
1027
  }
1001
1028
 
1029
+ class PublicationsResource extends BaseResource {
1030
+ constructor(tokenManager, baseUrl) {
1031
+ super(tokenManager, baseUrl, "/publications");
1032
+ }
1033
+ /**
1034
+ * Create a publication bound to a menu (by `menuAccessor`) with column
1035
+ * defaults (A4, primary palette, all facts shown). `name` is optional —
1036
+ * set the design afterwards with `setBlocks`. Returns the new publication
1037
+ * row (its `accessor` keys every later verb).
1038
+ */
1039
+ async create(body) {
1040
+ return this.request("POST", "", body);
1041
+ }
1042
+ /**
1043
+ * Partially update a publication's design, block by block: only the
1044
+ * provided fields fold into the stored designDoc (grouped blocks — frame,
1045
+ * QR, rule, item facts — merge; `showFrame: false` / `showQr: false`
1046
+ * remove their block). Localized texts merge per locale; colour tokens
1047
+ * accept `null` to clear back to the brand default. The name + accessor
1048
+ * follow the primary-locale title — the response returns the (possibly
1049
+ * regenerated) accessor.
1050
+ */
1051
+ async setBlocks(accessor, body) {
1052
+ return this.request(
1053
+ "PATCH",
1054
+ `/${encodeURIComponent(accessor)}`,
1055
+ body
1056
+ );
1057
+ }
1058
+ /**
1059
+ * Render the publication's saved design to its print PDF (the same
1060
+ * Gotenberg path as the public download route). Returns the PDF
1061
+ * base64-encoded (`pdfBase64`) with its page count — decode with
1062
+ * `Buffer.from(result.pdfBase64, 'base64')`.
1063
+ */
1064
+ async render(accessor, body = {}) {
1065
+ return this.request(
1066
+ "POST",
1067
+ `/${encodeURIComponent(accessor)}/render`,
1068
+ body
1069
+ );
1070
+ }
1071
+ /**
1072
+ * Compose a booklet PDF from ordered sections: inline `sections`
1073
+ * (`publicationAccessor` + optional 1-based inclusive page range) for
1074
+ * ad-hoc composition, or `bookletAccessor` to compose a persisted booklet
1075
+ * publication from its stored sections. Returns the merged PDF
1076
+ * base64-encoded with its page count.
1077
+ */
1078
+ async composeBooklet(body) {
1079
+ return this.request(
1080
+ "POST",
1081
+ "/compose-booklet",
1082
+ body
1083
+ );
1084
+ }
1085
+ }
1086
+
1002
1087
  class ReservationsResource extends BaseResource {
1003
1088
  constructor(tokenManager, baseUrl) {
1004
1089
  super(tokenManager, baseUrl, "/reservations");
@@ -1708,6 +1793,7 @@ class O3KClient {
1708
1793
  __publicField(this, "menus");
1709
1794
  __publicField(this, "orders");
1710
1795
  __publicField(this, "paymentIntents");
1796
+ __publicField(this, "publications");
1711
1797
  __publicField(this, "reservations");
1712
1798
  __publicField(this, "rituals");
1713
1799
  __publicField(this, "subscriptions");
@@ -1740,6 +1826,10 @@ class O3KClient {
1740
1826
  this.tokenManager,
1741
1827
  this.baseUrl
1742
1828
  );
1829
+ this.publications = new PublicationsResource(
1830
+ this.tokenManager,
1831
+ this.baseUrl
1832
+ );
1743
1833
  this.reservations = new ReservationsResource(
1744
1834
  this.tokenManager,
1745
1835
  this.baseUrl
package/dist/client.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { ab as ListAdsOptions, ac as ListAdsResponse, A as Ad, v as CreateAdRequest, w as CreateAdResponse, ax as PatchAdRequest, ay as PatchAdResponse, aO as SaveAdKeywordsRequest, aP as SaveAdKeywordsResponse, aM as SaveAdCalloutsRequest, aN as SaveAdCalloutsResponse, aQ as SaveAdNegativeKeywordsRequest, aR as SaveAdNegativeKeywordsResponse, aS as SaveAdWebsitePagesRequest, aT as SaveAdWebsitePagesResponse, aY as SetAdBudgetRequest, aZ as SetAdBudgetResponse, U as EditMetaAdRequest, V as EditMetaAdResponse, O as DeleteAdResponse, a2 as GetAreaOptions, c as Area, a1 as GetAreaAvailabilityOptions, e as AreaAvailabilityResponse, a_ as SubmitAreaBookingRequestPayload, h as AreaBookingRequestResponse, ad as ListArticlesOptions, ae as ListArticlesResponse, m as Article, az as PatchArticleRequest, $ as FeatureImage, bf as UploadFeatureImageArgs, aD as PatchFeatureImageRequest, af as ListAssetsOptions, ag as ListAssetsResponse, n as Asset, B as Basket, a as AddToBasketRequest, b as AddToBasketResponse, aK as RemoveFromBasketResponse, N as DeclaredReturn, t as BasketTotals, bb as UploadAssetArgs, bc as UploadAssetResponse, a4 as GetCalloutsResponse, x as CreateCalloutRequest, y as CreateCalloutResponse, b7 as UpdateCalloutRequest, b8 as UpdateCalloutResponse, P as DeleteCalloutResponse, a0 as FetchDishResponse, S as EditDishRequest, T as EditDishResponse, ah as ListEventsOptions, ai as ListEventsResponse, E as CreateEventRequest, F as CreateEventResponse, a5 as GetEventOptions, Y as EventByAccessor, aB as PatchEventRequest, aC as PatchEventResponse, Q as DeleteEventResponse, a6 as GetEventSlotAvailabilityOptions, _ as EventSlotAvailabilityResponse, bd as UploadEventAssetArgs, be as UploadEventAssetResponse, a7 as GetMenuOptions, al as Menu, ao as MenuBundle, at as MenuSubscription, aa as LatestOrder, aF as PlaceOrderRequest, aG as PlaceOrderResponse, C as ConfirmOrderRequest, u as ConfirmOrderResponse, G as CreatePaymentIntentRequest, H as CreatePaymentIntentResponse, z as CreateDeltaPaymentIntentRequest, D as CreateDeltaPaymentIntentResponse, aI as ReduceDeltaPaymentIntentRequest, aJ as ReduceDeltaPaymentIntentResponse, aj as MakeReservationRequest, ak as MakeReservationResponse, aL as RitualByAccessor, a$ as SubscribeRequest, b0 as SubscribeResponse, b3 as SubscriptionCreditStatus, b2 as SubscriptionCredit, r as BasketItemMetadata, bg as Venue, a9 as GetWebsitePagesResponse, I as CreateWebsitePageRequest, J as CreateWebsitePageResponse, b9 as UpdateWebsitePageRequest, ba as UpdateWebsitePageResponse, R as DeleteWebsitePageResponse, L as Currency, aW as ScheduleTimeSlot, M as DayOfWeek } from './index-CQHgJH4m.cjs';
2
- export { d as O3KAreaAsset, f as O3KAreaAvailabilityWindow, g as O3KAreaBookingMode, i as O3KAreaBookingRequestSource, j as O3KAreaBookingRequestStatus, k as O3KAreaBookingStatus, l as O3KAreaFeature, o as O3KBasketItem, p as O3KBasketItemDeposit, q as O3KBasketItemMenuItemRef, s as O3KBasketStatus, K as O3KCropArea, W as O3KEvent, X as O3KEventAsset, Z as O3KEventMenu, a3 as O3KGetArticleResponse, a8 as O3KGetVenueResponse, am as O3KMenuAsset, an as O3KMenuBeverage, ap as O3KMenuBundleDeposit, aq as O3KMenuDish, ar as O3KMenuItem, as as O3KMenuItemType, au as O3KMenuSubscriptionPoster, av as O3KOrderFulfillmentType, aw as O3KOrderStatus, aA as O3KPatchArticleResponse, aE as O3KPaymentStatus, aH as O3KPromotion, aU as O3KSchedule, aV as O3KScheduleOverride, aX as O3KScheduleWithTimeSlots, b1 as O3KSubscriberStatus, b4 as O3KSubscriptionPeriod, b5 as O3KTimeSlot, b6 as O3KUnit } from './index-CQHgJH4m.cjs';
1
+ import { ai as ListAdsOptions, aj as ListAdsResponse, A as Ad, x as CreateAdRequest, y as CreateAdResponse, aE as PatchAdRequest, aF as PatchAdResponse, aX as SaveAdKeywordsRequest, aY as SaveAdKeywordsResponse, aV as SaveAdCalloutsRequest, aW as SaveAdCalloutsResponse, aZ as SaveAdNegativeKeywordsRequest, a_ as SaveAdNegativeKeywordsResponse, a$ as SaveAdWebsitePagesRequest, b0 as SaveAdWebsitePagesResponse, b5 as SetAdBudgetRequest, b6 as SetAdBudgetResponse, _ as EditMetaAdRequest, $ as EditMetaAdResponse, S as DeleteAdResponse, a9 as GetAreaOptions, c as Area, a8 as GetAreaAvailabilityOptions, e as AreaAvailabilityResponse, b9 as SubmitAreaBookingRequestPayload, h as AreaBookingRequestResponse, ak as ListArticlesOptions, al as ListArticlesResponse, m as Article, aG as PatchArticleRequest, a5 as FeatureImage, bq as UploadFeatureImageArgs, aK as PatchFeatureImageRequest, am as ListAssetsOptions, an as ListAssetsResponse, n as Asset, B as Basket, a as AddToBasketRequest, b as AddToBasketResponse, aR as RemoveFromBasketResponse, R as DeclaredReturn, t as BasketTotals, a6 as FetchBeverageResponse, W as EditBeverageRequest, X as EditBeverageResponse, bm as UploadAssetArgs, bn as UploadAssetResponse, ab as GetCalloutsResponse, z as CreateCalloutRequest, D as CreateCalloutResponse, bi as UpdateCalloutRequest, bj as UpdateCalloutResponse, T as DeleteCalloutResponse, a7 as FetchDishResponse, Y as EditDishRequest, Z as EditDishResponse, ao as ListEventsOptions, ap as ListEventsResponse, G as CreateEventRequest, H as CreateEventResponse, ac as GetEventOptions, a2 as EventByAccessor, aI as PatchEventRequest, aJ as PatchEventResponse, U as DeleteEventResponse, ad as GetEventSlotAvailabilityOptions, a4 as EventSlotAvailabilityResponse, bo as UploadEventAssetArgs, bp as UploadEventAssetResponse, ae as GetMenuOptions, as as Menu, av as MenuBundle, aA as MenuSubscription, ah as LatestOrder, aM as PlaceOrderRequest, aN as PlaceOrderResponse, v as ConfirmOrderRequest, w as ConfirmOrderResponse, K as CreatePaymentIntentRequest, L as CreatePaymentIntentResponse, E as CreateDeltaPaymentIntentRequest, F as CreateDeltaPaymentIntentResponse, aP as ReduceDeltaPaymentIntentRequest, aQ as ReduceDeltaPaymentIntentResponse, I as CreateMenuPublicationRequest, J as CreateMenuPublicationResponse, b7 as SetMenuPublicationBlocksRequest, b8 as SetMenuPublicationBlocksResponse, aS as RenderMenuPublicationPdfRequest, aT as RenderMenuPublicationPdfResponse, C as ComposeMenuPublicationBookletRequest, u as ComposeMenuPublicationBookletResponse, aq as MakeReservationRequest, ar as MakeReservationResponse, aU as RitualByAccessor, ba as SubscribeRequest, bb as SubscribeResponse, be as SubscriptionCreditStatus, bd as SubscriptionCredit, r as BasketItemMetadata, br as Venue, ag as GetWebsitePagesResponse, M as CreateWebsitePageRequest, N as CreateWebsitePageResponse, bk as UpdateWebsitePageRequest, bl as UpdateWebsitePageResponse, V as DeleteWebsitePageResponse, P as Currency, b3 as ScheduleTimeSlot, Q as DayOfWeek } from './index-CJebGltI.cjs';
2
+ export { d as O3KAreaAsset, f as O3KAreaAvailabilityWindow, g as O3KAreaBookingMode, i as O3KAreaBookingRequestSource, j as O3KAreaBookingRequestStatus, k as O3KAreaBookingStatus, l as O3KAreaFeature, o as O3KBasketItem, p as O3KBasketItemDeposit, q as O3KBasketItemMenuItemRef, s as O3KBasketStatus, O as O3KCropArea, a0 as O3KEvent, a1 as O3KEventAsset, a3 as O3KEventMenu, aa as O3KGetArticleResponse, af as O3KGetVenueResponse, at as O3KMenuAsset, au as O3KMenuBeverage, aw as O3KMenuBundleDeposit, ax as O3KMenuDish, ay as O3KMenuItem, az as O3KMenuItemType, aB as O3KMenuSubscriptionPoster, aC as O3KOrderFulfillmentType, aD as O3KOrderStatus, aH as O3KPatchArticleResponse, aL as O3KPaymentStatus, aO as O3KPromotion, b1 as O3KSchedule, b2 as O3KScheduleOverride, b4 as O3KScheduleWithTimeSlots, bc as O3KSubscriberStatus, bf as O3KSubscriptionPeriod, bg as O3KTimeSlot, bh as O3KUnit } from './index-CJebGltI.cjs';
3
3
  import { z as z$1 } from 'zod';
4
4
  import { z } from 'zod/v4';
5
5
  import { RealtimePostgresChangesPayload, RealtimeChannel, SupabaseClient } from '@supabase/supabase-js';
@@ -369,6 +369,18 @@ declare class BasketsResource extends BaseResource {
369
369
 
370
370
  declare class BeveragesResource extends BaseResource {
371
371
  constructor(tokenManager: TokenManager, baseUrl: string);
372
+ /**
373
+ * Fetch a beverage by its `accessor` slug (localized name/description,
374
+ * price, assets with public URLs). Pair with `patch` for a safe
375
+ * read-modify-write rename that preserves untouched locales.
376
+ */
377
+ get(accessor: string): Promise<FetchBeverageResponse>;
378
+ /**
379
+ * Edit a beverage by id. `editBeverage` replaces the fields it receives,
380
+ * so callers wanting a partial change should read the beverage with `get`
381
+ * first and merge. Returns the updated beverage row.
382
+ */
383
+ patch(beverageId: string, body: EditBeverageRequest): Promise<EditBeverageResponse>;
372
384
  /**
373
385
  * Upload an asset image for a beverage. The SDK builds the multipart body
374
386
  * internally — pass a Buffer/Uint8Array, the original filename, the MIME type,
@@ -479,10 +491,13 @@ declare class EventsResource extends BaseResource {
479
491
  */
480
492
  listAssets(idOrAccessor: string): Promise<EventAssetEntry[]>;
481
493
  /**
482
- * Per-start-slot occupancy availability for an event on a date. Each slot's
483
- * `offered` honours the venue's reservation mode (`passive`: every slot;
484
- * `auto_steer`: only acceptable slots), so a public widget can pre-exclude
485
- * fully-booked start times.
494
+ * Per-start-slot availability for an event on a date, per booking channel.
495
+ * Reservation channel: each slot's `offered` honours the venue's
496
+ * reservation mode (`passive`: every slot; `auto_steer`: only acceptable
497
+ * slots), so a public widget can pre-exclude fully-booked start times.
498
+ * Order channel: the event's order-pickup grid gated by per-slot caps and
499
+ * the order booking window (no table occupancy); events without a
500
+ * dedicated order grid inherit the reservation grid.
486
501
  */
487
502
  getSlotAvailability(idOrAccessor: string, options: GetEventSlotAvailabilityOptions): Promise<EventSlotAvailabilityResponse>;
488
503
  /**
@@ -580,6 +595,42 @@ declare class PaymentIntentsResource extends BaseResource {
580
595
  reduceDelta(request: ReduceDeltaPaymentIntentRequest): Promise<ReduceDeltaPaymentIntentResponse>;
581
596
  }
582
597
 
598
+ declare class PublicationsResource extends BaseResource {
599
+ constructor(tokenManager: TokenManager, baseUrl: string);
600
+ /**
601
+ * Create a publication bound to a menu (by `menuAccessor`) with column
602
+ * defaults (A4, primary palette, all facts shown). `name` is optional —
603
+ * set the design afterwards with `setBlocks`. Returns the new publication
604
+ * row (its `accessor` keys every later verb).
605
+ */
606
+ create(body: Omit<CreateMenuPublicationRequest, 'venueAccessor'>): Promise<CreateMenuPublicationResponse>;
607
+ /**
608
+ * Partially update a publication's design, block by block: only the
609
+ * provided fields fold into the stored designDoc (grouped blocks — frame,
610
+ * QR, rule, item facts — merge; `showFrame: false` / `showQr: false`
611
+ * remove their block). Localized texts merge per locale; colour tokens
612
+ * accept `null` to clear back to the brand default. The name + accessor
613
+ * follow the primary-locale title — the response returns the (possibly
614
+ * regenerated) accessor.
615
+ */
616
+ setBlocks(accessor: string, body: Omit<SetMenuPublicationBlocksRequest, 'venueAccessor' | 'publicationAccessor'>): Promise<SetMenuPublicationBlocksResponse>;
617
+ /**
618
+ * Render the publication's saved design to its print PDF (the same
619
+ * Gotenberg path as the public download route). Returns the PDF
620
+ * base64-encoded (`pdfBase64`) with its page count — decode with
621
+ * `Buffer.from(result.pdfBase64, 'base64')`.
622
+ */
623
+ render(accessor: string, body?: Omit<RenderMenuPublicationPdfRequest, 'venueAccessor' | 'publicationAccessor'>): Promise<RenderMenuPublicationPdfResponse>;
624
+ /**
625
+ * Compose a booklet PDF from ordered sections: inline `sections`
626
+ * (`publicationAccessor` + optional 1-based inclusive page range) for
627
+ * ad-hoc composition, or `bookletAccessor` to compose a persisted booklet
628
+ * publication from its stored sections. Returns the merged PDF
629
+ * base64-encoded with its page count.
630
+ */
631
+ composeBooklet(body: Omit<ComposeMenuPublicationBookletRequest, 'venueAccessor'>): Promise<ComposeMenuPublicationBookletResponse>;
632
+ }
633
+
583
634
  declare class ReservationsResource extends BaseResource {
584
635
  constructor(tokenManager: TokenManager, baseUrl: string);
585
636
  /**
@@ -1406,6 +1457,7 @@ declare class O3KClient {
1406
1457
  menus: MenusResource;
1407
1458
  orders: OrdersResource;
1408
1459
  paymentIntents: PaymentIntentsResource;
1460
+ publications: PublicationsResource;
1409
1461
  reservations: ReservationsResource;
1410
1462
  rituals: RitualsResource;
1411
1463
  subscriptions: SubscriptionsResource;
package/dist/client.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { ab as ListAdsOptions, ac as ListAdsResponse, A as Ad, v as CreateAdRequest, w as CreateAdResponse, ax as PatchAdRequest, ay as PatchAdResponse, aO as SaveAdKeywordsRequest, aP as SaveAdKeywordsResponse, aM as SaveAdCalloutsRequest, aN as SaveAdCalloutsResponse, aQ as SaveAdNegativeKeywordsRequest, aR as SaveAdNegativeKeywordsResponse, aS as SaveAdWebsitePagesRequest, aT as SaveAdWebsitePagesResponse, aY as SetAdBudgetRequest, aZ as SetAdBudgetResponse, U as EditMetaAdRequest, V as EditMetaAdResponse, O as DeleteAdResponse, a2 as GetAreaOptions, c as Area, a1 as GetAreaAvailabilityOptions, e as AreaAvailabilityResponse, a_ as SubmitAreaBookingRequestPayload, h as AreaBookingRequestResponse, ad as ListArticlesOptions, ae as ListArticlesResponse, m as Article, az as PatchArticleRequest, $ as FeatureImage, bf as UploadFeatureImageArgs, aD as PatchFeatureImageRequest, af as ListAssetsOptions, ag as ListAssetsResponse, n as Asset, B as Basket, a as AddToBasketRequest, b as AddToBasketResponse, aK as RemoveFromBasketResponse, N as DeclaredReturn, t as BasketTotals, bb as UploadAssetArgs, bc as UploadAssetResponse, a4 as GetCalloutsResponse, x as CreateCalloutRequest, y as CreateCalloutResponse, b7 as UpdateCalloutRequest, b8 as UpdateCalloutResponse, P as DeleteCalloutResponse, a0 as FetchDishResponse, S as EditDishRequest, T as EditDishResponse, ah as ListEventsOptions, ai as ListEventsResponse, E as CreateEventRequest, F as CreateEventResponse, a5 as GetEventOptions, Y as EventByAccessor, aB as PatchEventRequest, aC as PatchEventResponse, Q as DeleteEventResponse, a6 as GetEventSlotAvailabilityOptions, _ as EventSlotAvailabilityResponse, bd as UploadEventAssetArgs, be as UploadEventAssetResponse, a7 as GetMenuOptions, al as Menu, ao as MenuBundle, at as MenuSubscription, aa as LatestOrder, aF as PlaceOrderRequest, aG as PlaceOrderResponse, C as ConfirmOrderRequest, u as ConfirmOrderResponse, G as CreatePaymentIntentRequest, H as CreatePaymentIntentResponse, z as CreateDeltaPaymentIntentRequest, D as CreateDeltaPaymentIntentResponse, aI as ReduceDeltaPaymentIntentRequest, aJ as ReduceDeltaPaymentIntentResponse, aj as MakeReservationRequest, ak as MakeReservationResponse, aL as RitualByAccessor, a$ as SubscribeRequest, b0 as SubscribeResponse, b3 as SubscriptionCreditStatus, b2 as SubscriptionCredit, r as BasketItemMetadata, bg as Venue, a9 as GetWebsitePagesResponse, I as CreateWebsitePageRequest, J as CreateWebsitePageResponse, b9 as UpdateWebsitePageRequest, ba as UpdateWebsitePageResponse, R as DeleteWebsitePageResponse, L as Currency, aW as ScheduleTimeSlot, M as DayOfWeek } from './index-CQHgJH4m.mjs';
2
- export { d as O3KAreaAsset, f as O3KAreaAvailabilityWindow, g as O3KAreaBookingMode, i as O3KAreaBookingRequestSource, j as O3KAreaBookingRequestStatus, k as O3KAreaBookingStatus, l as O3KAreaFeature, o as O3KBasketItem, p as O3KBasketItemDeposit, q as O3KBasketItemMenuItemRef, s as O3KBasketStatus, K as O3KCropArea, W as O3KEvent, X as O3KEventAsset, Z as O3KEventMenu, a3 as O3KGetArticleResponse, a8 as O3KGetVenueResponse, am as O3KMenuAsset, an as O3KMenuBeverage, ap as O3KMenuBundleDeposit, aq as O3KMenuDish, ar as O3KMenuItem, as as O3KMenuItemType, au as O3KMenuSubscriptionPoster, av as O3KOrderFulfillmentType, aw as O3KOrderStatus, aA as O3KPatchArticleResponse, aE as O3KPaymentStatus, aH as O3KPromotion, aU as O3KSchedule, aV as O3KScheduleOverride, aX as O3KScheduleWithTimeSlots, b1 as O3KSubscriberStatus, b4 as O3KSubscriptionPeriod, b5 as O3KTimeSlot, b6 as O3KUnit } from './index-CQHgJH4m.mjs';
1
+ import { ai as ListAdsOptions, aj as ListAdsResponse, A as Ad, x as CreateAdRequest, y as CreateAdResponse, aE as PatchAdRequest, aF as PatchAdResponse, aX as SaveAdKeywordsRequest, aY as SaveAdKeywordsResponse, aV as SaveAdCalloutsRequest, aW as SaveAdCalloutsResponse, aZ as SaveAdNegativeKeywordsRequest, a_ as SaveAdNegativeKeywordsResponse, a$ as SaveAdWebsitePagesRequest, b0 as SaveAdWebsitePagesResponse, b5 as SetAdBudgetRequest, b6 as SetAdBudgetResponse, _ as EditMetaAdRequest, $ as EditMetaAdResponse, S as DeleteAdResponse, a9 as GetAreaOptions, c as Area, a8 as GetAreaAvailabilityOptions, e as AreaAvailabilityResponse, b9 as SubmitAreaBookingRequestPayload, h as AreaBookingRequestResponse, ak as ListArticlesOptions, al as ListArticlesResponse, m as Article, aG as PatchArticleRequest, a5 as FeatureImage, bq as UploadFeatureImageArgs, aK as PatchFeatureImageRequest, am as ListAssetsOptions, an as ListAssetsResponse, n as Asset, B as Basket, a as AddToBasketRequest, b as AddToBasketResponse, aR as RemoveFromBasketResponse, R as DeclaredReturn, t as BasketTotals, a6 as FetchBeverageResponse, W as EditBeverageRequest, X as EditBeverageResponse, bm as UploadAssetArgs, bn as UploadAssetResponse, ab as GetCalloutsResponse, z as CreateCalloutRequest, D as CreateCalloutResponse, bi as UpdateCalloutRequest, bj as UpdateCalloutResponse, T as DeleteCalloutResponse, a7 as FetchDishResponse, Y as EditDishRequest, Z as EditDishResponse, ao as ListEventsOptions, ap as ListEventsResponse, G as CreateEventRequest, H as CreateEventResponse, ac as GetEventOptions, a2 as EventByAccessor, aI as PatchEventRequest, aJ as PatchEventResponse, U as DeleteEventResponse, ad as GetEventSlotAvailabilityOptions, a4 as EventSlotAvailabilityResponse, bo as UploadEventAssetArgs, bp as UploadEventAssetResponse, ae as GetMenuOptions, as as Menu, av as MenuBundle, aA as MenuSubscription, ah as LatestOrder, aM as PlaceOrderRequest, aN as PlaceOrderResponse, v as ConfirmOrderRequest, w as ConfirmOrderResponse, K as CreatePaymentIntentRequest, L as CreatePaymentIntentResponse, E as CreateDeltaPaymentIntentRequest, F as CreateDeltaPaymentIntentResponse, aP as ReduceDeltaPaymentIntentRequest, aQ as ReduceDeltaPaymentIntentResponse, I as CreateMenuPublicationRequest, J as CreateMenuPublicationResponse, b7 as SetMenuPublicationBlocksRequest, b8 as SetMenuPublicationBlocksResponse, aS as RenderMenuPublicationPdfRequest, aT as RenderMenuPublicationPdfResponse, C as ComposeMenuPublicationBookletRequest, u as ComposeMenuPublicationBookletResponse, aq as MakeReservationRequest, ar as MakeReservationResponse, aU as RitualByAccessor, ba as SubscribeRequest, bb as SubscribeResponse, be as SubscriptionCreditStatus, bd as SubscriptionCredit, r as BasketItemMetadata, br as Venue, ag as GetWebsitePagesResponse, M as CreateWebsitePageRequest, N as CreateWebsitePageResponse, bk as UpdateWebsitePageRequest, bl as UpdateWebsitePageResponse, V as DeleteWebsitePageResponse, P as Currency, b3 as ScheduleTimeSlot, Q as DayOfWeek } from './index-CJebGltI.mjs';
2
+ export { d as O3KAreaAsset, f as O3KAreaAvailabilityWindow, g as O3KAreaBookingMode, i as O3KAreaBookingRequestSource, j as O3KAreaBookingRequestStatus, k as O3KAreaBookingStatus, l as O3KAreaFeature, o as O3KBasketItem, p as O3KBasketItemDeposit, q as O3KBasketItemMenuItemRef, s as O3KBasketStatus, O as O3KCropArea, a0 as O3KEvent, a1 as O3KEventAsset, a3 as O3KEventMenu, aa as O3KGetArticleResponse, af as O3KGetVenueResponse, at as O3KMenuAsset, au as O3KMenuBeverage, aw as O3KMenuBundleDeposit, ax as O3KMenuDish, ay as O3KMenuItem, az as O3KMenuItemType, aB as O3KMenuSubscriptionPoster, aC as O3KOrderFulfillmentType, aD as O3KOrderStatus, aH as O3KPatchArticleResponse, aL as O3KPaymentStatus, aO as O3KPromotion, b1 as O3KSchedule, b2 as O3KScheduleOverride, b4 as O3KScheduleWithTimeSlots, bc as O3KSubscriberStatus, bf as O3KSubscriptionPeriod, bg as O3KTimeSlot, bh as O3KUnit } from './index-CJebGltI.mjs';
3
3
  import { z as z$1 } from 'zod';
4
4
  import { z } from 'zod/v4';
5
5
  import { RealtimePostgresChangesPayload, RealtimeChannel, SupabaseClient } from '@supabase/supabase-js';
@@ -369,6 +369,18 @@ declare class BasketsResource extends BaseResource {
369
369
 
370
370
  declare class BeveragesResource extends BaseResource {
371
371
  constructor(tokenManager: TokenManager, baseUrl: string);
372
+ /**
373
+ * Fetch a beverage by its `accessor` slug (localized name/description,
374
+ * price, assets with public URLs). Pair with `patch` for a safe
375
+ * read-modify-write rename that preserves untouched locales.
376
+ */
377
+ get(accessor: string): Promise<FetchBeverageResponse>;
378
+ /**
379
+ * Edit a beverage by id. `editBeverage` replaces the fields it receives,
380
+ * so callers wanting a partial change should read the beverage with `get`
381
+ * first and merge. Returns the updated beverage row.
382
+ */
383
+ patch(beverageId: string, body: EditBeverageRequest): Promise<EditBeverageResponse>;
372
384
  /**
373
385
  * Upload an asset image for a beverage. The SDK builds the multipart body
374
386
  * internally — pass a Buffer/Uint8Array, the original filename, the MIME type,
@@ -479,10 +491,13 @@ declare class EventsResource extends BaseResource {
479
491
  */
480
492
  listAssets(idOrAccessor: string): Promise<EventAssetEntry[]>;
481
493
  /**
482
- * Per-start-slot occupancy availability for an event on a date. Each slot's
483
- * `offered` honours the venue's reservation mode (`passive`: every slot;
484
- * `auto_steer`: only acceptable slots), so a public widget can pre-exclude
485
- * fully-booked start times.
494
+ * Per-start-slot availability for an event on a date, per booking channel.
495
+ * Reservation channel: each slot's `offered` honours the venue's
496
+ * reservation mode (`passive`: every slot; `auto_steer`: only acceptable
497
+ * slots), so a public widget can pre-exclude fully-booked start times.
498
+ * Order channel: the event's order-pickup grid gated by per-slot caps and
499
+ * the order booking window (no table occupancy); events without a
500
+ * dedicated order grid inherit the reservation grid.
486
501
  */
487
502
  getSlotAvailability(idOrAccessor: string, options: GetEventSlotAvailabilityOptions): Promise<EventSlotAvailabilityResponse>;
488
503
  /**
@@ -580,6 +595,42 @@ declare class PaymentIntentsResource extends BaseResource {
580
595
  reduceDelta(request: ReduceDeltaPaymentIntentRequest): Promise<ReduceDeltaPaymentIntentResponse>;
581
596
  }
582
597
 
598
+ declare class PublicationsResource extends BaseResource {
599
+ constructor(tokenManager: TokenManager, baseUrl: string);
600
+ /**
601
+ * Create a publication bound to a menu (by `menuAccessor`) with column
602
+ * defaults (A4, primary palette, all facts shown). `name` is optional —
603
+ * set the design afterwards with `setBlocks`. Returns the new publication
604
+ * row (its `accessor` keys every later verb).
605
+ */
606
+ create(body: Omit<CreateMenuPublicationRequest, 'venueAccessor'>): Promise<CreateMenuPublicationResponse>;
607
+ /**
608
+ * Partially update a publication's design, block by block: only the
609
+ * provided fields fold into the stored designDoc (grouped blocks — frame,
610
+ * QR, rule, item facts — merge; `showFrame: false` / `showQr: false`
611
+ * remove their block). Localized texts merge per locale; colour tokens
612
+ * accept `null` to clear back to the brand default. The name + accessor
613
+ * follow the primary-locale title — the response returns the (possibly
614
+ * regenerated) accessor.
615
+ */
616
+ setBlocks(accessor: string, body: Omit<SetMenuPublicationBlocksRequest, 'venueAccessor' | 'publicationAccessor'>): Promise<SetMenuPublicationBlocksResponse>;
617
+ /**
618
+ * Render the publication's saved design to its print PDF (the same
619
+ * Gotenberg path as the public download route). Returns the PDF
620
+ * base64-encoded (`pdfBase64`) with its page count — decode with
621
+ * `Buffer.from(result.pdfBase64, 'base64')`.
622
+ */
623
+ render(accessor: string, body?: Omit<RenderMenuPublicationPdfRequest, 'venueAccessor' | 'publicationAccessor'>): Promise<RenderMenuPublicationPdfResponse>;
624
+ /**
625
+ * Compose a booklet PDF from ordered sections: inline `sections`
626
+ * (`publicationAccessor` + optional 1-based inclusive page range) for
627
+ * ad-hoc composition, or `bookletAccessor` to compose a persisted booklet
628
+ * publication from its stored sections. Returns the merged PDF
629
+ * base64-encoded with its page count.
630
+ */
631
+ composeBooklet(body: Omit<ComposeMenuPublicationBookletRequest, 'venueAccessor'>): Promise<ComposeMenuPublicationBookletResponse>;
632
+ }
633
+
583
634
  declare class ReservationsResource extends BaseResource {
584
635
  constructor(tokenManager: TokenManager, baseUrl: string);
585
636
  /**
@@ -1406,6 +1457,7 @@ declare class O3KClient {
1406
1457
  menus: MenusResource;
1407
1458
  orders: OrdersResource;
1408
1459
  paymentIntents: PaymentIntentsResource;
1460
+ publications: PublicationsResource;
1409
1461
  reservations: ReservationsResource;
1410
1462
  rituals: RitualsResource;
1411
1463
  subscriptions: SubscriptionsResource;
package/dist/client.mjs CHANGED
@@ -630,6 +630,29 @@ class BeveragesResource extends BaseResource {
630
630
  constructor(tokenManager, baseUrl) {
631
631
  super(tokenManager, baseUrl, "/beverages");
632
632
  }
633
+ /**
634
+ * Fetch a beverage by its `accessor` slug (localized name/description,
635
+ * price, assets with public URLs). Pair with `patch` for a safe
636
+ * read-modify-write rename that preserves untouched locales.
637
+ */
638
+ async get(accessor) {
639
+ return this.request(
640
+ "GET",
641
+ `/${encodeURIComponent(accessor)}`
642
+ );
643
+ }
644
+ /**
645
+ * Edit a beverage by id. `editBeverage` replaces the fields it receives,
646
+ * so callers wanting a partial change should read the beverage with `get`
647
+ * first and merge. Returns the updated beverage row.
648
+ */
649
+ async patch(beverageId, body) {
650
+ return this.request(
651
+ "PATCH",
652
+ `/${encodeURIComponent(beverageId)}`,
653
+ body
654
+ );
655
+ }
633
656
  /**
634
657
  * Upload an asset image for a beverage. The SDK builds the multipart body
635
658
  * internally — pass a Buffer/Uint8Array, the original filename, the MIME type,
@@ -837,16 +860,20 @@ class EventsResource extends BaseResource {
837
860
  return event.assets ?? [];
838
861
  }
839
862
  /**
840
- * Per-start-slot occupancy availability for an event on a date. Each slot's
841
- * `offered` honours the venue's reservation mode (`passive`: every slot;
842
- * `auto_steer`: only acceptable slots), so a public widget can pre-exclude
843
- * fully-booked start times.
863
+ * Per-start-slot availability for an event on a date, per booking channel.
864
+ * Reservation channel: each slot's `offered` honours the venue's
865
+ * reservation mode (`passive`: every slot; `auto_steer`: only acceptable
866
+ * slots), so a public widget can pre-exclude fully-booked start times.
867
+ * Order channel: the event's order-pickup grid gated by per-slot caps and
868
+ * the order booking window (no table occupancy); events without a
869
+ * dedicated order grid inherit the reservation grid.
844
870
  */
845
871
  async getSlotAvailability(idOrAccessor, options) {
846
872
  const params = new URLSearchParams();
847
873
  params.set("reservationDate", options.reservationDate);
848
874
  params.set("partySize", String(options.partySize));
849
875
  if (options.areaId) params.set("areaId", options.areaId);
876
+ if (options.channel) params.set("channel", options.channel);
850
877
  return this.request(
851
878
  "GET",
852
879
  `/${encodeURIComponent(idOrAccessor)}/slot-availability?${params.toString()}`
@@ -998,6 +1025,64 @@ class PaymentIntentsResource extends BaseResource {
998
1025
  }
999
1026
  }
1000
1027
 
1028
+ class PublicationsResource extends BaseResource {
1029
+ constructor(tokenManager, baseUrl) {
1030
+ super(tokenManager, baseUrl, "/publications");
1031
+ }
1032
+ /**
1033
+ * Create a publication bound to a menu (by `menuAccessor`) with column
1034
+ * defaults (A4, primary palette, all facts shown). `name` is optional —
1035
+ * set the design afterwards with `setBlocks`. Returns the new publication
1036
+ * row (its `accessor` keys every later verb).
1037
+ */
1038
+ async create(body) {
1039
+ return this.request("POST", "", body);
1040
+ }
1041
+ /**
1042
+ * Partially update a publication's design, block by block: only the
1043
+ * provided fields fold into the stored designDoc (grouped blocks — frame,
1044
+ * QR, rule, item facts — merge; `showFrame: false` / `showQr: false`
1045
+ * remove their block). Localized texts merge per locale; colour tokens
1046
+ * accept `null` to clear back to the brand default. The name + accessor
1047
+ * follow the primary-locale title — the response returns the (possibly
1048
+ * regenerated) accessor.
1049
+ */
1050
+ async setBlocks(accessor, body) {
1051
+ return this.request(
1052
+ "PATCH",
1053
+ `/${encodeURIComponent(accessor)}`,
1054
+ body
1055
+ );
1056
+ }
1057
+ /**
1058
+ * Render the publication's saved design to its print PDF (the same
1059
+ * Gotenberg path as the public download route). Returns the PDF
1060
+ * base64-encoded (`pdfBase64`) with its page count — decode with
1061
+ * `Buffer.from(result.pdfBase64, 'base64')`.
1062
+ */
1063
+ async render(accessor, body = {}) {
1064
+ return this.request(
1065
+ "POST",
1066
+ `/${encodeURIComponent(accessor)}/render`,
1067
+ body
1068
+ );
1069
+ }
1070
+ /**
1071
+ * Compose a booklet PDF from ordered sections: inline `sections`
1072
+ * (`publicationAccessor` + optional 1-based inclusive page range) for
1073
+ * ad-hoc composition, or `bookletAccessor` to compose a persisted booklet
1074
+ * publication from its stored sections. Returns the merged PDF
1075
+ * base64-encoded with its page count.
1076
+ */
1077
+ async composeBooklet(body) {
1078
+ return this.request(
1079
+ "POST",
1080
+ "/compose-booklet",
1081
+ body
1082
+ );
1083
+ }
1084
+ }
1085
+
1001
1086
  class ReservationsResource extends BaseResource {
1002
1087
  constructor(tokenManager, baseUrl) {
1003
1088
  super(tokenManager, baseUrl, "/reservations");
@@ -1707,6 +1792,7 @@ class O3KClient {
1707
1792
  __publicField(this, "menus");
1708
1793
  __publicField(this, "orders");
1709
1794
  __publicField(this, "paymentIntents");
1795
+ __publicField(this, "publications");
1710
1796
  __publicField(this, "reservations");
1711
1797
  __publicField(this, "rituals");
1712
1798
  __publicField(this, "subscriptions");
@@ -1739,6 +1825,10 @@ class O3KClient {
1739
1825
  this.tokenManager,
1740
1826
  this.baseUrl
1741
1827
  );
1828
+ this.publications = new PublicationsResource(
1829
+ this.tokenManager,
1830
+ this.baseUrl
1831
+ );
1742
1832
  this.reservations = new ReservationsResource(
1743
1833
  this.tokenManager,
1744
1834
  this.baseUrl