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-D7ZH0AzE.cjs'; 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-D7ZH0AzE.cjs'; import { z as z$1 } from 'zod'; import { z } from 'zod/v4'; import { RealtimePostgresChangesPayload, RealtimeChannel, SupabaseClient } from '@supabase/supabase-js'; declare class TokenManager { private readonly clientId; private readonly clientSecret; private readonly tokenEndpoint; private readonly userVenueId?; private accessToken; private tokenExpiresAt; private refreshPromise; private defaultVenueId?; constructor(clientId: string, clientSecret: string, tokenEndpoint: string, userVenueId?: string | undefined); initialize(): Promise; getToken(): Promise; getVenueId(): string; /** * Async counterpart to {@link getVenueId}. Fetches the token if it * hasn't been loaded yet (which is what populates `defaultVenueId` via * `setDefaultVenueId`), then returns the venue id. * * Prefer this over `getVenueId()` from request paths — a cold SDK * instance will otherwise synchronously throw "No venue ID available" * before the token has had a chance to load. */ getVenueIdAsync(): Promise; private refreshToken; private setDefaultVenueId; } /** * Per-call cache override. SDK reads are uniformly `cache: 'no-store'` * — correct for live-read endpoints (basket, team-order, payment * intents) where any caching causes stale responses against realtime * mutations. No SDK method bakes in ISR: apps that consume near-static * data during static generation own caching at the call site by * wrapping the SDK call in Next.js `unstable_cache(fn, key, { revalidate })` * (e.g. thamarai's `getTiffinBoxEvent` / `getALaCarteMenu`), which is * what lets Next.js pre-render the page during the build instead of * bailing out to dynamic rendering with `DYNAMIC_SERVER_USAGE`. The * `cache` field below remains only as a per-call escape hatch for the * rare reader that needs a non-default `RequestCache` value. */ interface RequestCacheOptions { cache?: RequestCache; } declare abstract class BaseResource { protected readonly tokenManager: TokenManager; protected readonly baseUrl: string; protected readonly resourcePath: string; constructor(tokenManager: TokenManager, baseUrl: string, resourcePath: string); protected request(method: 'GET' | 'POST' | 'PATCH' | 'DELETE', path: string, data?: unknown, cacheOptions?: RequestCacheOptions): Promise; /** * Multipart counterpart to `request`. Skips the JSON Content-Type * default — `fetch` sets `multipart/form-data; boundary=…` * automatically when the body is a `FormData`. Use for binary uploads * (e.g. article feature image). */ protected requestMultipart(method: 'POST' | 'PATCH' | 'PUT', path: string, formData: FormData): Promise; } declare class AdsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * List the venue's ads, ordered by `createdAt`. Optionally filter by * `ownerEntityType` (e.g. `event`), `ownerEntityId`, or `channel` (e.g. * `google`). Each ad carries its paste-ready Google Search Ad `content` * document and lifecycle `status`. */ list(options?: ListAdsOptions): Promise; /** * Fetch a single ad by id within the active venue. Ads have no accessor * — the lookup is always by uuid. Returns the full row including the * `content` document and `status`. */ get(adId: string): Promise; /** * Create a new ad for a polymorphic owner entity (an event today). Copy * + status take the DB defaults (empty content, `draft`) and are * populated later via {@link patch}. Returns the created ad. */ create(body: CreateAdRequest): Promise; /** * Partial-update an ad by id. Pass `content` to write paste-ready Google * Responsive Search Ad copy (the char-limit + count validation is the * self-heal contract) and/or `status` to move the ad through its * lifecycle. Returns the resulting ad. */ patch(adId: string, body: PatchAdRequest): Promise; /** * Replace the ad's three owner-managed keyword sets in one shot: the * active positive `keywords` the campaign bids on (alongside the venue * keywords), the reversible `dismissedKeywords`, and the * `disabledVenueKeywords` (venue keywords toggled off for this event). * Every set is replaced wholesale — call {@link get} first and resend * the full set to preserve existing entries. Texts are lowercased + * de-duplicated server-side; an empty array clears that set. Returns the * cleaned, persisted sets. */ saveKeywords(adId: string, body: SaveAdKeywordsRequest): Promise; /** * Replace the ad's owner-chosen callout set in one shot — the highlights * pushed to Google as CALLOUT assets. The set references the venue's callout * pool by id; it is de-duplicated while preserving order, and an empty array * clears callouts. Only ids belonging to the venue's pool survive. Call * {@link get} first and resend the full set to preserve existing entries. * Returns the cleaned, persisted ids. */ saveCallouts(adId: string, body: SaveAdCalloutsRequest): Promise; /** * Replace the ad's owner-curated NEGATIVE keyword set (and the venue * negatives toggled off for this ad) in one shot. An empty `negativeKeywords` * array clears the set. Texts are trimmed + de-duplicated server-side; the * set is pushed to a linked live campaign immediately. Call {@link get} first * and resend the full set to preserve existing entries. */ saveNegativeKeywords(adId: string, body: SaveAdNegativeKeywordsRequest): Promise; /** * Replace the ad's owner-chosen website-page set in one shot — the pages * pushed to Google as SITELINK assets. The set references the venue's * website-page pool by id; it is de-duplicated while preserving order, and * an empty array clears sitelinks. Only ids belonging to the venue's pool * survive. Call {@link get} first and resend the full set to preserve * existing entries. Returns the cleaned, persisted ids. */ saveWebsitePages(adId: string, body: SaveAdWebsitePagesRequest): Promise; /** * Persist the ad's order3000-side daily budget, in CENTS (the app-wide money * unit). This writes `ads.dailyBudget` and pushes NOTHING to Google — it lets * the owner set + refine a budget on a DRAFT ad before any campaign exists; * `createCampaign` reads it as the default at launch (converting cents→micros * at the Google boundary). Returns the updated ad row. */ setBudget(adId: string, body: SetAdBudgetRequest): Promise; /** * Write paste-ready Meta (Facebook/Instagram) ad copy + creative onto the * ad's `metaContent` document — the Meta analog of {@link patch} (which writes * Google `content`). Pass `metaContent` (primary text / headline / description * keyed by locale, `finalUrl`, `callToAction`, the per-placement `creatives` * map) and/or `status`; Google `content` is left untouched. Returns the * resulting ad. */ editMeta(adId: string, body: EditMetaAdRequest): Promise; /** * Permanently delete an ad by id. Returns the deleted ad row. */ delete(adId: string): Promise; } declare class AreasResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * List bookable + public areas for the venue. */ list(options?: GetAreaOptions): Promise; /** * Fetch a single area by id or accessor. The server resolves either * form transparently. */ get(idOrAccessor: string, options?: GetAreaOptions): Promise; /** * List occupied date/time windows for an area between `from` and `to`. */ getAvailability(accessor: string, options?: GetAreaAvailabilityOptions): Promise; /** * Submit a public booking request for an area. */ submitBookingRequest(accessor: string, payload: SubmitAreaBookingRequestPayload): Promise; private buildExpandQuery; } declare class ArticlesResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * List articles for the venue. Default behaviour returns published + * active articles, ordered by `priority` (desc) then `publishedAt` * (desc). Override defaults via `includeDrafts` / `includeInactive`, * or filter by a single tag. * * `content` on each article is a TipTap JSON document — opaque on the * wire. Use the order3000-cli's `articles outline` command (forthcoming) * for human-friendly node addressing. */ list(options?: ListArticlesOptions): Promise; /** * Fetch a single article by id or accessor within the active venue. * The server resolves either form transparently. Returns the full row * including the TipTap `content` document. */ get(idOrAccessor: string): Promise
; /** * Partial-update an article. Locale-keyed fields (slug, title, excerpt) * merge at the locale level — `{ slug: { en: 'foo' } }` updates `en` * without touching `de`. Plain scalar / array fields fully replace. * Returns the resulting article. */ patch(idOrAccessor: string, body: PatchArticleRequest): Promise
; /** * Read the article's resolved feature image — asset id, public URL, * matched locale, plus the FULL per-locale caption + alt records. * Returns null when the article has no feature image yet (the wire * 404 is mapped here for ergonomic null-checking on the caller side). */ getFeatureImage(idOrAccessor: string, options?: { locale?: string; }): Promise; /** * Upload a new feature image. Replaces any existing feature image * for the venue's primary locale (the previous one is demoted to * `role='inline'`). The SDK builds the multipart body internally — * pass a Buffer/Uint8Array, the original filename, and the MIME * type. */ uploadFeatureImage(idOrAccessor: string, file: UploadFeatureImageArgs): Promise; /** * Update per-locale caption / alt on the article's feature image. * Locale-keyed merge — `{ caption: { en: '…' } }` does not touch * `de`. Plain-string locale values are server-side wrapped into * minimal TipTap docs (the storage shape). */ patchFeatureImage(idOrAccessor: string, body: PatchFeatureImageRequest): Promise; } /** Result of a venue-scoped asset delete (mirrors the action's response). */ interface DeleteAssetResponse { success: boolean; /** Whether the file + row were removed (vs. just unlinked at one entity). */ deleted: boolean; } /** * Editable fields on a venue asset (mirrors the `editAsset` action's input, * minus the path-supplied id + tenant accessor). All optional — only the * supplied fields are written. `caption` / `alt` are per-locale records (a flat * string or a TipTap doc per locale); the action normalises strings to TipTap. */ interface UpdateAssetInput { tags?: string[]; caption?: Record>; alt?: Record>; isActive?: boolean; cropArea?: { x: number; y: number; width: number; height: number; }; } /** The updated asset row (`editAsset`'s response — the central `assets` row). */ type UpdateAssetResponse = Asset; declare class AssetsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * List a venue's ACTIVE assets carrying `tag`, ordered by `sortIndex`. * * A binding-agnostic query on the central `assets` table — an asset is * returned regardless of whether it is bound to a ritual, dish, beverage, * event, or is standalone. Each asset carries its resolved Supabase * `publicUrl`. * * @param options - `tag` (required) + optional `type` filter * @returns Array of assets with public URLs */ list(options: ListAssetsOptions): Promise; /** * Permanently remove a venue asset by id — the storage object, the `assets` * row, and every junction link (an `everywhere` delete). The venue-wide * counterpart to deleting an asset from a single entity. * * Proxies the dual-mode `deleteAsset` server action via * `DELETE /venues/{venueId}/assets/{assetId}`. The action also publishes * `order3000.assets.updated`, so every open asset library for the venue * updates live. * * @param assetId - The globally-unique asset id * @returns `{ success, deleted }` */ delete(assetId: string): Promise; /** * Edit a venue asset's metadata (tags / caption / alt / active flag / crop) * by id. Only the supplied fields are written; per-locale `caption` / `alt` * merge into the existing record rather than overwriting it. * * Proxies the dual-mode `editAsset` server action via * `PATCH /venues/{venueId}/assets/{assetId}`. The action also publishes * `order3000.assets.updated`, so every open asset library for the venue * updates live — the grid refetches and any open EditAssetModal showing this * asset re-seeds to reflect the edit. * * @param assetId - The globally-unique asset id * @param input - The fields to change * @returns The updated asset row */ update(assetId: string, input: UpdateAssetInput): Promise; } declare class BasketsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Get the current basket for a session * @param sessionId - The session identifier (from cookie) * @returns The basket with all items, or null if no basket exists */ get(sessionId: string): Promise; /** * Add an item to the basket * Creates basket and guest customer if they don't exist * @param request - The add to basket request * @returns The response with basket item ID and item count */ add(request: AddToBasketRequest): Promise; /** * Remove an item from the basket. * * Since each basket item represents a single physical product, * removing it removes the entire item. There is no partial removal. * * @param sessionId - The session identifier * @param basketItemId - The basket item ID to remove * @returns The response with item count */ remove(sessionId: string, basketItemId: string): Promise; /** * Canonical totals for a basket. Clients read every displayed monetary * figure (effective total, deposit credit, cash refund) from this * endpoint — they never multiply deposit counts by amounts locally. * * Pass `declaredReturns` as references to depositware templates plus a * count. order3000 refuses deposit money amounts on input. */ getTotals(basketId: string, body?: { declaredReturns?: DeclaredReturn[]; }): Promise; /** * Mark every active basket for the session as `abandoned`. * * Used by thamarai's "Neu starten" flow: after a non-team order * has been placed (its basket converted), the user might want to * start a fresh order. A subsequent `add()` call would otherwise * reuse any leftover active basket on the same session — which * can happen if a prior compose flow left an active row behind. * Calling `abandon()` first guarantees the next `add()` inserts a * brand-new active basket with exactly one item. */ abandon(sessionId: string): Promise<{ abandonedCount: number; }>; /** * Persist per-template declared-return counts onto the basket. * * Used by team-order participants so the Lead's breakdown popover * sees every member's intent in real time (the standard * `useTeamOrderRealtime` postgres-changes subscription on * `baskets` then propagates the change to the team). * * Server validates `sessionId === basket.session_id` — only the * basket's owner can write to its declared returns. */ setDeclaredReturns(basketId: string, body: { sessionId: string; declaredReturns: DeclaredReturn[]; }): Promise<{ basketId: string; declaredReturns: DeclaredReturn[]; }>; } declare class BeveragesResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Fetch a beverage by its `accessor` slug (localized name/description, * price, assets with public URLs). Pair with `patch` for a safe * read-modify-write rename that preserves untouched locales. */ get(accessor: string): Promise; /** * Edit a beverage by id. `editBeverage` replaces the fields it receives, * so callers wanting a partial change should read the beverage with `get` * first and merge. Returns the updated beverage row. */ patch(beverageId: string, body: EditBeverageRequest): Promise; /** * Upload an asset image for a beverage. The SDK builds the multipart body * internally — pass a Buffer/Uint8Array, the original filename, the MIME type, * and optional discovery `tags` (e.g. `['lunch-menu']`). The asset is stored, * tagged, and linked to the beverage via `beverage_assets`; returns the new * asset and its public URL. The beverage is addressed by its accessor. */ uploadAsset(idOrAccessor: string, file: UploadAssetArgs): Promise; } /** * The venue's callout pool — the localized "highlight" phrases (≤25 chars per * locale, Google's CalloutAsset limit) an ad references by id and that publish * to Google as CALLOUT assets on campaign create. This resource manages the * POOL itself; an ad's pick from it is `client.ads.saveCallouts(...)`. */ declare class CalloutsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * List the venue's whole callout pool, ordered by `createdAt`. */ list(): Promise; /** * Add a callout to the venue pool. `label` is the localized text (`{ de, * en }`); each locale value ≤25 chars and at least one must be non-empty. * Returns the created callout row. */ create(body: CreateCalloutRequest): Promise; /** * Replace a pool callout's localized `label` (each locale value ≤25 chars; * at least one non-empty). Returns the updated callout row. */ update(calloutId: string, body: UpdateCalloutRequest): Promise; /** * Permanently remove a callout from the venue pool. Returns the deleted row. * (Ads still referencing the id simply drop it on their next save.) */ delete(calloutId: string): Promise; } declare class DishesResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Fetch a dish by its `accessor` slug (localized name/description, dietary * flags, price, assets with public URLs). Pair with `patch` for a safe * read-modify-write rename that preserves untouched locales + flags. */ get(accessor: string): Promise; /** * Edit a dish by id. `editDish` replaces the fields it receives (localized * `name` is required), so callers wanting a partial change should read the * dish with `get` first and merge. Returns the updated dish row. */ patch(dishId: string, body: EditDishRequest): Promise; /** * Upload an asset image for a dish. The SDK builds the multipart body * internally — pass a Buffer/Uint8Array, the original filename, the MIME type, * and optional discovery `tags` (e.g. `['lunch-menu']`). The asset is stored, * tagged, and linked to the dish via `dish_assets`; returns the new asset and * its public URL. The dish is addressed by its accessor. */ uploadAsset(idOrAccessor: string, file: UploadAssetArgs): Promise; } /** Element type of an expanded event's `assets[]` array. */ type EventAssetEntry = NonNullable[number]; declare class EventsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * List all events for the venue * @param options - Optional filters for the list request * @returns Array of events with schedule, assets, and promotions */ list(options?: ListEventsOptions): Promise; /** * Create a new event * @param event - The event details * @returns The created event */ place(event: CreateEventRequest): Promise; /** * Get a single event by id or accessor (slug), with optional `expand` * parts. The server resolves either form transparently. * @param idOrAccessor - The event UUID or accessor (e.g., 'lunch-menu') * @param options - Optional expand options * @returns The event with optional schedule, timeSlots, menus, and assets */ get(idOrAccessor: string, options?: GetEventOptions): Promise; private buildQueryString; /** * Partial-update an event by id or accessor. Every body field is * optional; locale-keyed fields (`name`, `description`) merge at the * locale level — `{ name: { en: 'Brunch' } }` updates `en` without * touching `de`. Pass a `schedule` object to update timing, or * `ritualAccessor` to (re)link a ritual (`null` detaches). Returns the * resulting event with its schedule. */ patch(idOrAccessor: string, body: PatchEventRequest): Promise; /** * Permanently delete an event by id or accessor. Returns the deleted * event row. */ delete(idOrAccessor: string): Promise; /** * List the assets attached to an event. Convenience over * `get(idOrAccessor, { expand: ['assets'] })` — returns the * `assets[]` array (empty when the event has none). */ listAssets(idOrAccessor: string): Promise; /** * Per-start-slot availability for an event on a date, per booking channel. * Reservation channel: each slot's `offered` honours the venue's * reservation mode (`passive`: every slot; `auto_steer`: only acceptable * slots), so a public widget can pre-exclude fully-booked start times. * Order channel: the event's order-pickup grid gated by per-slot caps and * the order booking window (no table occupancy); events without a * dedicated order grid inherit the reservation grid. */ getSlotAvailability(idOrAccessor: string, options: GetEventSlotAvailabilityOptions): Promise; /** * Upload a asset image for an event. The SDK builds the multipart * body internally — pass a Buffer/Uint8Array, the original filename, * and the MIME type. The asset is stored and linked to the event via * `event_assets`; returns the new asset and its public URL. */ uploadAsset(idOrAccessor: string, file: UploadEventAssetArgs): Promise; /** * Remove a asset from an event. Deletes the asset (storage object + * DB row + `event_assets` link). Returns `{ success: true }`. */ removeAsset(idOrAccessor: string, assetId: string): Promise<{ success: boolean; }>; } declare class MenusResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Get a menu by id or accessor (slug), with optional `expand` parts. * The server resolves either form transparently. * @param idOrAccessor - The menu UUID or accessor (slug) * @param options - Optional expand options * @returns The menu with optional items and assets */ get(idOrAccessor: string, options?: GetMenuOptions): Promise; /** * Get all bundles for a menu * @param menuIdOrAccessor - The menu UUID or accessor (slug) * @returns Array of menu bundles */ getBundles(menuIdOrAccessor: string): Promise; /** * Get all active subscriptions for a menu * @param menuIdOrAccessor - The menu UUID or accessor (slug) * @returns Array of menu subscriptions with posters */ getSubscriptions(menuIdOrAccessor: string): Promise; private buildQueryString; } declare class OrdersResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Most recent non-team order for the guest session, with captured * basket items + totals + declared returns inlined. `null` when the * session has no qualifying order yet (fresh session, or only team * orders which go through `teamOrders` instead). */ getLatest(sessionId: string): Promise; /** * Place a new order. * * The order3000 backend calculates taxAmount and totalAmount from the basket items: * - totalAmount: derived from basket items' prices (bundleId -> price) * - taxAmount: derived from basket items' tax rates (bundleId -> taxRateId -> rate) * * SDK callers cannot provide these values - they're implicit from the basket contents. */ place(order: PlaceOrderRequest): Promise; get(orderId: string): Promise; /** * Confirm an order after client-side Stripe payment has succeeded. * * Verifies the PaymentIntent status with Stripe and transitions * the order to 'paid' status. */ confirm(orderId: string, request: ConfirmOrderRequest): Promise; } declare class PaymentIntentsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Create a Stripe PaymentIntent via order3000's Stripe Connect integration. * * Returns a clientSecret for client-side payment confirmation and an orderId * for the draft order that was created. */ create(request: CreatePaymentIntentRequest): Promise; /** * Create a delta PaymentIntent for a team-order participant who added * items after paying. Reuses the saved card from the initial auth so the * client only needs one tap (unless Stripe triggers 3DS). */ createDelta(request: CreateDeltaPaymentIntentRequest): Promise; /** * Release part of a team-order participant's existing Stripe authorisation * when they remove items from their basket. Walks payments newest-first, * cancelling fully-consumed PIs and `update({ amount })`-ing the last * partially-trimmed one. No client-side confirmation — lowering a * `requires_capture` PI's amount is a single server round-trip. */ reduceDelta(request: ReduceDeltaPaymentIntentRequest): Promise; } declare class PublicationsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Create a publication bound to a menu (by `menuAccessor`) with column * defaults (A4, primary palette, all facts shown). `name` is optional — * set the design afterwards with `setBlocks`. Returns the new publication * row (its `accessor` keys every later verb). */ create(body: Omit): Promise; /** * Partially update a publication's design, block by block: only the * provided fields fold into the stored designDoc (grouped blocks — frame, * QR, rule, item facts — merge; `showFrame: false` / `showQr: false` * remove their block). Localized texts merge per locale; colour tokens * accept `null` to clear back to the brand default. The name + accessor * follow the primary-locale title — the response returns the (possibly * regenerated) accessor. */ setBlocks(accessor: string, body: Omit): Promise; /** * Render the publication's saved design to its print PDF (the same * Gotenberg path as the public download route). Returns the PDF * base64-encoded (`pdfBase64`) with its page count — decode with * `Buffer.from(result.pdfBase64, 'base64')`. */ render(accessor: string, body?: Omit): Promise; /** * Compose a booklet PDF from ordered sections: inline `sections` * (`publicationAccessor` + optional 1-based inclusive page range) for * ad-hoc composition, or `bookletAccessor` to compose a persisted booklet * publication from its stored sections. Returns the merged PDF * base64-encoded with its page count. */ composeBooklet(body: Omit): Promise; } declare class ReservationsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Make a new reservation * @param reservation - The reservation details * @returns The created reservation with confirmation code */ make(reservation: MakeReservationRequest): Promise; /** * Get a reservation by ID * @param reservationId - The reservation ID * @returns The reservation details */ get(reservationId: string): Promise; } /** * Read access to a venue's rituals (recurring concepts — `service` rituals are * the venue's operating hours; `special` rituals are recurring happenings such * as an à la carte weekend or a jazz night). The ad-copy agent calls * `rituals.get(accessor)` to study a ritual before writing its ads, mirroring * how it studies an event via `events.get`. */ declare class RitualsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Get a single ritual by accessor (slug). Returns the ritual with its * template schedule (time slots + date overrides), media, and the events * materialised from it (with per-day covers). * @param accessor - The ritual accessor (e.g. 'a-la-carte-weekend') * @returns The ritual document */ get(accessor: string): Promise; } declare class SubscriptionsResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * Get a subscription by id or accessor (slug). The server resolves * either form transparently. * @param idOrAccessor - The subscription UUID or accessor (slug) * @returns The subscription with posters */ get(idOrAccessor: string): Promise; /** * Subscribe a customer to a subscription plan via Stripe Checkout * @param subscriptionIdOrAccessor - The subscription UUID or accessor * @param request - Subscribe request with email and redirect URLs * @returns Stripe Checkout URL and session ID */ subscribe(subscriptionIdOrAccessor: string, request: SubscribeRequest): Promise; /** * Cancel a customer's subscription * @param subscriptionIdOrAccessor - The subscription UUID or accessor * @param subscriberId - The subscriber record ID */ cancel(subscriptionIdOrAccessor: string, subscriberId: string): Promise; /** * Get credits for a subscriber * @param subscriptionIdOrAccessor - The subscription UUID or accessor * @param subscriberId - The subscriber record ID * @param status - Optional filter by credit status * @returns Array of subscription credits */ getCredits(subscriptionIdOrAccessor: string, subscriberId: string, status?: SubscriptionCreditStatus): Promise; } /** * Generated by Kubb (https://kubb.dev/). * Do not edit manually. */ declare const fulfillmentTypeSchema: z.ZodEnum<{ pickup: "pickup"; delivery: "delivery"; }>; /** * Generated by Kubb (https://kubb.dev/). * Do not edit manually. */ declare const participantStatusSchema: z.ZodEnum<{ placed: "placed"; completed: "completed"; cancelled: "cancelled"; browsing: "browsing"; authorized: "authorized"; cash_pending: "cash_pending"; }>; /** * Generated by Kubb (https://kubb.dev/). * Do not edit manually. */ declare const paymentMethodSchema: z.ZodEnum<{ card: "card"; cash: "cash"; voucher: "voucher"; }>; /** * Generated by Kubb (https://kubb.dev/). * Do not edit manually. */ declare const teamOrderStatusSchema: z.ZodEnum<{ draft: "draft"; collecting: "collecting"; locked: "locked"; placed: "placed"; ready: "ready"; completed: "completed"; cancelled: "cancelled"; }>; /** * Runtime enum objects with an `enumValues` tuple — kept as a thin shim * over the kubb-generated `z.enum(...)` schemas so that downstream SDK * consumers can write `z.enum(paymentMethodEnum.enumValues)`, the same * idiom order3000's server uses against the real Drizzle pgEnum. * * The values themselves are now sourced from `apps/order3000/public/openapi.json` * via kubb — no manual mirror to maintain. */ declare const paymentMethodEnum: { enumValues: ("card" | "cash" | "voucher")[]; }; declare const fulfillmentTypeEnum: { enumValues: ("pickup" | "delivery")[]; }; declare const teamOrderStatusEnum: { enumValues: ("draft" | "collecting" | "locked" | "placed" | "ready" | "completed" | "cancelled")[]; }; declare const participantStatusEnum: { enumValues: ("placed" | "completed" | "cancelled" | "browsing" | "authorized" | "cash_pending")[]; }; type PaymentMethod = z$1.infer; type FulfillmentType = z$1.infer; type TeamOrderStatus = z$1.infer; type ParticipantStatus = z$1.infer; interface TeamDeliveryAddress { street: string; city: string; /** * `region` and `postcode`, NOT `state` and `postalCode`. * * This type is the wire contract of order3000's team-order endpoints, and * that contract is `DeliveryAddressSchema` — derived from the `addresses` * table, which names these columns `region` and `postcode`. The old spelling * never matched the API this SDK wraps: a caller who believed the type and * sent `postalCode` would have had it dropped server-side, and the required * `postcode` rejected as missing. * * It stayed invisible because the one caller spreads a correctly-named * object, so the runtime payload was always right and only the declaration * lied. `postcode` is the house term everywhere (label, key, field, column); * external APIs get mapped at the adapter line, never mirrored inward. */ region?: string | null; postcode: string; country: string; } interface CreateTeamOrderRequest { sessionId: string; menuId: string; leadDisplayName: string; teamName?: string; logoUrl?: string; /** * Optional ISO 8601 datetime. The Lead's "close the window" decision — * unset on FAST-share creation. When null, the team never auto-locks; * the Lead explicitly submits when ready. */ deadlineAt?: string | null; fulfillmentType: FulfillmentType; /** * Optional ISO 8601 datetime. The Lead's pickup-time decision — unset * at team creation, set later on the Lead's Fulfilment step. Backfilled * onto each child `orders.fulfillmentAt` when `submitTeamOrder` fires. */ fulfillmentAt?: string | null; deliveryAddress?: TeamDeliveryAddress; allowedPaymentMethods: PaymentMethod[]; eventId?: string; } interface CreateTeamOrderResponse { publicId: string; teamOrderId: string; } interface TeamOrderBasketItemMenuItemRef { menuItemId: string; role: string | null; quantity: number; unit: 'grams' | 'kilograms' | 'liters' | 'milliliters' | 'pieces'; } interface TeamOrderBasketItem { id: string; metadata: BasketItemMetadata | null; menuItems: TeamOrderBasketItemMenuItemRef[]; /** * `true` when the item's cumulative price (folded across the * participant's basket items in `basket_items.created_at` order) * is fully covered by the participant's `paidTotal`. `false` * when the item is part of an outstanding delta — typically an * item the participant added after their last authorisation but * hasn't run a delta payment for yet. Drives the per-item * "Confirmed" vs "Pending" badge in the team-mode BasketReview; * the Lead therefore can't be tricked into submitting while a * teammate has unpaid items in their cart. */ isPaid: boolean; } /** * Active payment row surfaced for a participant. "Active" excludes voided * and failed rows — those never reach the client. */ type TeamOrderParticipantPaymentStatus = 'authorized' | 'captured' | 'cash_pending' | 'cash_received'; interface TeamOrderParticipantPayment { amount: number; method: PaymentMethod; status: TeamOrderParticipantPaymentStatus; createdAt: string; /** * Last 4 digits of the card used for this card payment. Populated * lazily by `fetchTeamOrder` for the *current viewer's* card rows * only (one Stripe round-trip per render, then cached on the * `team_order_payments` row), so the delta-payment UI can render * `Card **** 4242` and tell the user which card will be charged * or refunded. `null` for cash rows or while the lookup hasn't * landed yet. */ cardLast4: string | null; } interface TeamOrderParticipant { guestId: string; basketId: string | null; orderId: string | null; /** * Consecutive, never-reused join-order number. 1 for the lead; 2, 3, ... * for joiners in arrival order. Clients fall back to `Person {n}` when * `displayName` is null. Stays stable even if an earlier participant is * later dropped — numbers are not recycled. */ participantNumber: number | null; displayName: string | null; status: ParticipantStatus; bundleCount: number; /** * What this participant currently owes the lead — *Ihr Anteil*. For * cash payers, kept live by every basket-mutation action; for card * payers, refreshed on delta-pay and at submit-time partial-capture. * Drives every Anteil / cash-handover UI (TiffinExchange, the lead's * settle-up cash total, the step-2 confirmation, the step-3 row). */ amount: number; paymentMethod: PaymentMethod | null; isLead: boolean; /** True when this participant is the current caller (session match). */ isMe: boolean; joinedAt: string; /** * Participant's current basket contents in SDK format (identical to what * `baskets.get` returns). The thamarai client feeds these straight into * its existing `hydrateBasket` → `transformBasketItem` transform. */ items: TeamOrderBasketItem[]; /** * Per-participant payment trail — one row per auth (initial + each delta * round). Empty until the participant has checked out. */ payments: TeamOrderParticipantPayment[]; /** Sum of `payments[].amount` (authorised/collected total). */ paidTotal: number; /** `amount` − `paidTotal`, floored at 0. Positive = delta owed. */ amountDue: number; /** * Server-persisted declared-return counts per depositware template, * captured the last time the participant authorised payment (or * resubmitted via a delta). Empty until they've checked out — and * always reflects what the server actually has on file (i.e. * `orderDeposits.declaredReturningCount`). * * Clients use this to hydrate the local "I'm returning N empties" * UI on refresh: without it, the local Zustand store starts empty, * so `useBasketTotals` recomputes `effectiveTotal` *without* the * deposit credit that was actually applied at auth time, causing * the delta-payment view to incorrectly demand or refund money. */ declaredReturns: Array<{ depositwareTemplateId: string; count: number; }>; /** * ISO timestamp the team Lead checked off this participant on * their post-placement settle-up checklist — a private "this * person has handed over what they owe me" tick. `null` while * unchecked. Lead-private; consumer-side rendering decides * whether to surface it. */ leadSettledAt: string | null; } interface ThresholdCheck { meets: boolean; failedConstraints: Array<'quantity' | 'amount'>; requiredQuantity: number | null; currentQuantity: number; requiredAmount: number | null; currentAmount: number; } interface FetchTeamOrderResponse { teamOrder: { id: string; publicId: string; venueId: string; menuId: string; eventId: string | null; teamName: string | null; logoUrl: string | null; leadDisplayName: string; status: TeamOrderStatus; allowedPaymentMethods: PaymentMethod[]; fulfillmentType: FulfillmentType; fulfillmentAt: string | null; deadlineAt: string | null; lockedAt: string | null; placedAt: string | null; cancelledAt: string | null; /** * Free-text reason the Lead provided when dissolving the team order. * Surfaced to non-Lead participants via the `cancelledByLeadToast` * broadcast so they see context alongside the cancellation event. */ cancelReason: string | null; deliveryAddressId: string | null; /** * Free-form text the Lead types on the Fulfilment step describing * where the team will sit down to eat (e.g. "Kitchen K3, Building X"). * `null` until the Lead enters a value. */ diningLocation: string | null; /** * HH:MM time (venue timezone) at which the team starts eating. * Derived server-side from `fulfillmentAt + effectiveOffset` where * `effectiveOffset = dining_offset_minutes ?? 15`. `null` only when * `fulfillmentAt` hasn't been set yet. */ diningTime: string | null; /** * Whether the team's menu is configured for delivery fulfillment. * Snapshotted from `menus.metadata.isDeliveryEnabled` at fetch time. * Clients use this to gate the Lead's "Switch to delivery" control. */ isDeliveryEnabled: boolean; /** * Cycling 100→999 short reference, repurposed from the Lead's own * `orders.quickReferenceNumber` so the team has exactly one number * — the same number printed on the consolidated kitchen receipt * and surfaced in the customer's Abwicklung view. `null` until the * Lead has authorised payment (the Lead's order row is created at * PaymentIntent time, which is when the quickRef is assigned). */ quickReferenceNumber: number | null; }; deliveryThreshold: { amount: number | null; quantity: number | null; }; participants: TeamOrderParticipant[]; aggregatedTotals: { confirmedBundleCount: number; confirmedAmount: number; totalBundleCount: number; }; thresholdCheck: ThresholdCheck; isLead: boolean; } interface JoinTeamOrderRequest { sessionId: string; displayName?: string; } interface JoinTeamOrderResponse { teamOrderId: string; basketId: string; guestId: string; status: TeamOrderStatus; isLead: boolean; alreadyJoined: boolean; } interface SubmitTeamOrderResponse { teamOrderId: string; status: TeamOrderStatus; capturedOrderIds: string[]; cashPendingOrderIds: string[]; droppedBasketIds: string[]; placedAt: string; } interface CancelTeamOrderResponse { teamOrderId: string; status: TeamOrderStatus; voidedPaymentIntentIds: string[]; cancelledAt: string; } interface ExtendDeadlineResponse { teamOrderId: string; status: TeamOrderStatus; deadlineAt: string | null; } interface SwitchFulfillmentResponse { teamOrderId: string; status: TeamOrderStatus; fulfillmentType: FulfillmentType; deliveryAddressId: string | null; } interface UpdateDeliveryAddressResponse { teamOrderId: string; deliveryAddressId: string; } /** * Team Orders SDK resource. * * Mixes venue-scoped and publicId-scoped endpoints, so it doesn't inherit * from BaseResource (which hard-codes /venues/{venueId}). Create goes to * `/venues/{venueId}/team-orders`; everything else targets * `/team-orders/{publicId}/...` because publicId is globally unique and the * venue is resolved server-side via a helper. */ declare class TeamOrdersResource { private readonly tokenManager; private readonly baseUrl; constructor(tokenManager: TokenManager, baseUrl: string); private request; /** * Lead creates a team order from their active basket. * Returns the unguessable `publicId` the lead shares with coworkers. */ create(request: CreateTeamOrderRequest): Promise; /** * Public read by publicId. Pass the caller's sessionId so the response * can set `isLead` correctly for UI gating. */ get(publicId: string, sessionId?: string): Promise; /** * Participant joins a team order. Idempotent: safe to call on every page * mount of the shared URL. */ join(publicId: string, request: JoinTeamOrderRequest): Promise; /** * Lead submits the team order. Drops basket-only participants, captures * every authorised Stripe PaymentIntent atomically, flips child orders to * `pending`. The "Submit anyways" UX is a client-side confirmation dialog * that calls the same endpoint — no server variant exists. */ submit(publicId: string, request: { sessionId: string; }): Promise; /** * Lead cancels pre-placement. Voids every authorised Stripe * PaymentIntent (no refunds needed — nothing was captured). */ cancel(publicId: string, request: { sessionId: string; reason?: string; }): Promise; /** * Lead pushes the deadline. A `locked` team flips back to `collecting` * when the new deadline is in the future. */ extendDeadline(publicId: string, request: { sessionId: string; newDeadlineAt: string; }): Promise; /** * Lead commits (or changes) the shared pickup/delivery time. Required * before `submit` — which backfills each child order's `fulfillmentAt` * from this value at capture time. */ setFulfillmentAt(publicId: string, request: { sessionId: string; fulfillmentAt: string; }): Promise<{ teamOrderId: string; status: TeamOrderStatus; fulfillmentAt: string; /** * Returned so callers can re-sync the deadline wheel — the server * clamps `deadlineAt` down to the new `fulfillmentAt` whenever the * old deadline would have sat past it. */ deadlineAt: string | null; }>; /** * Lead sets the free-form "where we'll eat" text on the team order. * Broadcast to participants via the standard realtime refetch path. */ setDiningLocation(publicId: string, request: { sessionId: string; diningLocation: string; }): Promise<{ teamOrderId: string; status: TeamOrderStatus; diningLocation: string | null; }>; /** * Lead sets when the team will start eating. Client sends HH:MM; server * computes the delta against `fulfillmentAt` and stores it as * `dining_offset` (ms) so the intent survives any later pickup change. */ setDiningTime(publicId: string, request: { sessionId: string; diningTime: string; }): Promise<{ teamOrderId: string; status: TeamOrderStatus; diningTime: string; diningOffset: number; }>; /** * Toggle a participant's "settled" tick on the team Lead's * post-placement settle-up checklist. Writes to * `orders.leadSettledAt` — sets it to `NOW()` when `settled` is * `true`, clears it back to `null` when `false`. * * Authorized only for the team Lead's session — server rejects * non-Lead callers and `orderId`s that don't belong to this team. */ setOrderLeadSettled(publicId: string, request: { sessionId: string; orderId: string; settled: boolean; }): Promise<{ orderId: string; leadSettledAt: string | null; }>; /** * Any participant proposes an auto-extend when their local clock sees * that `fulfillmentAt` has passed while the team order is still * collecting. Idempotent on the server side: concurrent callers race * but only one write lands. */ autoExtendFulfillmentIfExpired(publicId: string, request: { sessionId: string; proposedFulfillmentAt: string; }): Promise<{ extended: boolean; teamOrderId: string; status: TeamOrderStatus; fulfillmentAt: string; deadlineAt: string | null; previousFulfillmentAt: string; waitingCount: number; }>; /** * Lead flips pickup ↔ delivery. Pass `deliveryAddress` when switching * TO delivery if no address is already set on the team order. */ switchFulfillment(publicId: string, request: { sessionId: string; fulfillmentType: FulfillmentType; deliveryAddress?: TeamDeliveryAddress; }): Promise; /** * Lead replaces the delivery address (inserts a new row in the shared * addresses table with type='PHYSICAL' and links it to the team order). */ updateDeliveryAddress(publicId: string, request: { sessionId: string; deliveryAddress: TeamDeliveryAddress; }): Promise; } /** * Reads at the venue level. Doesn't extend `BaseResource` because that * class hard-codes a `/venues/{venueId}/` URL template, * which assumes a venue-scoped sub-resource. Venues themselves are AT * `/venues/:venueIdOrAccessor` directly. */ declare class VenuesResource { private readonly tokenManager; private readonly baseUrl; constructor(tokenManager: TokenManager, baseUrl: string); /** * Fetch a venue by its UUID or its accessor (slug). The path accepts * either form; the server resolves transparently. * * Powers the order3000-cli's `venues use ` validation step * — the CLI hits this to prove the accessor exists and to cache the * resolved UUID + display fields locally. */ get(idOrAccessor: string): Promise; } /** * The venue's website-page pool — link targets (a localized `label` plus an * internal `path` or `externalUrl`) an ad references by id and that publish to * Google as SITELINK assets on campaign create. This resource manages the POOL * itself; an ad's pick from it is `client.ads.saveWebsitePages(...)`. */ declare class WebsitePagesResource extends BaseResource { constructor(tokenManager: TokenManager, baseUrl: string); /** * List the venue's whole website-page pool, ordered by `createdAt`. */ list(): Promise; /** * Add a website page to the venue pool. `target` is the raw reference the * owner typed — an internal path (`/speisekarte`) or a full URL — classified * server-side against the venue website. `label` is the localized link text. * Returns the created page row. */ create(body: CreateWebsitePageRequest): Promise; /** * Replace a pool page's `target` (re-classified into a path or external URL) * and/or localized `label`. Returns the updated page row. */ update(pageId: string, body: UpdateWebsitePageRequest): Promise; /** * Permanently remove a website page from the venue pool. Returns the deleted * row. (Ads still referencing the id simply drop it on their next save.) */ delete(pageId: string): Promise; } type RealtimeEvent = 'INSERT' | 'UPDATE' | 'DELETE' | '*'; type RealtimeRow = { [key: string]: any; }; interface SubscriptionOptions { event?: RealtimeEvent; filter?: string; onInsert?: (record: T) => void; onUpdate?: (newRecord: T, oldRecord: T) => void; onDelete?: (oldRecord: T) => void; onChange?: (payload: RealtimePostgresChangesPayload) => void; onError?: (error: Error) => void; onStatusChange?: (status: 'SUBSCRIBED' | 'CLOSED' | 'CHANNEL_ERROR' | 'TIMED_OUT') => void; } interface RealtimeSubscription { unsubscribe: () => Promise; channelName: string; } interface MenuItemRow { id: string; menu_id: string; type: 'dish' | 'beverage'; dish_id: string | null; beverage_id: string | null; price_adjustment: number; currency: Currency; is_active: boolean; is_featured: boolean; tags: string[] | null; sort_index: string | null; } interface EventRow { id: string; venue_id: string; accessor: string; name: Record; is_public: boolean; is_active: boolean; schedule_id: string | null; } interface ScheduleRow { id: string; name: Record; is_active: boolean; valid_from: string | null; valid_to: string | null; } interface ScheduleOverrideRow { id: string; schedule_id: string; date: string; reason: Record | null; is_active: boolean; } declare abstract class BaseRealtimeChannel { protected readonly manager: RealtimeManager; protected readonly tableName: string; protected channels: Map; private supabaseClient; constructor(manager: RealtimeManager, tableName: string); subscribe(options?: SubscriptionOptions): Promise; protected buildFilter(venueId: string, additionalFilter?: string): string; private handlePayload; unsubscribeAll(): Promise; } declare class MenuItemsChannel extends BaseRealtimeChannel { constructor(manager: RealtimeManager); protected buildFilter(_venueId: string, additionalFilter?: string): string; /** * Subscribe to changes for a specific menu's items */ subscribeToMenu(menuId: string, options?: Omit, 'filter'>): Promise; } declare class EventsChannel extends BaseRealtimeChannel { constructor(manager: RealtimeManager); /** * Subscribe to changes for a specific event */ subscribeToEvent(eventId: string, options?: Omit, 'filter'>): Promise; } declare class ScheduleOverridesChannel extends BaseRealtimeChannel { constructor(manager: RealtimeManager); protected buildFilter(_venueId: string, additionalFilter?: string): string; /** * Subscribe to changes for a specific schedule's overrides */ subscribeToSchedule(scheduleId: string, options?: Omit, 'filter'>): Promise; } interface RealtimeConfig { url: string; anonKey: string; } declare class RealtimeManager { private readonly tokenManager; private readonly baseUrl; private supabaseClient; private configPromise; menuItems: MenuItemsChannel; events: EventsChannel; scheduleOverrides: ScheduleOverridesChannel; constructor(tokenManager: TokenManager, baseUrl: string); /** * Fetch realtime config from the order3000 backend. * This keeps Supabase as an internal implementation detail. */ private fetchRealtimeConfig; getSupabaseClient(): Promise; getVenueId(): string; /** * Get the realtime configuration (Supabase URL and anon key). * Use this to pass the config to client-side code for establishing * realtime connections from the browser. */ getConfig(): Promise; disconnectAll(): Promise; } interface ScheduleInfo { /** Time range string, e.g. "11:30-15:00" */ timeRange: string | null; /** Active days in week order */ activeDays: DayOfWeek[]; } interface ScheduleInput { rrule?: string | null; /** Slot interval in milliseconds (codebase convention). */ intervalDuration?: number | null; scheduleTimeSlots?: ScheduleTimeSlot[]; } /** * Extract schedule information from a schedule object. * Returns time range and active days for display purposes. * * @param schedule - Schedule object with rrule, intervalDuration (ms), and scheduleTimeSlots * @returns ScheduleInfo with timeRange and activeDays */ declare function getScheduleInfo(schedule: ScheduleInput | null | undefined): ScheduleInfo; /** * Generated by Kubb (https://kubb.dev/). * Do not edit manually. */ declare const deliveryAddressSchema: z.ZodObject<{ street: z.ZodString; city: z.ZodString; region: z.ZodOptional>; postcode: z.ZodString; country: z.ZodEnum<{ AD: "AD"; AE: "AE"; AF: "AF"; AG: "AG"; AI: "AI"; AL: "AL"; AM: "AM"; AO: "AO"; AQ: "AQ"; AR: "AR"; AS: "AS"; AT: "AT"; AU: "AU"; AW: "AW"; AX: "AX"; AZ: "AZ"; BA: "BA"; BB: "BB"; BD: "BD"; BE: "BE"; BF: "BF"; BG: "BG"; BH: "BH"; BI: "BI"; BJ: "BJ"; BL: "BL"; BM: "BM"; BN: "BN"; BO: "BO"; BQ: "BQ"; BR: "BR"; BS: "BS"; BT: "BT"; BV: "BV"; BW: "BW"; BY: "BY"; BZ: "BZ"; CA: "CA"; CC: "CC"; CD: "CD"; CF: "CF"; CG: "CG"; CH: "CH"; CI: "CI"; CK: "CK"; CL: "CL"; CM: "CM"; CN: "CN"; CO: "CO"; CR: "CR"; CU: "CU"; CV: "CV"; CW: "CW"; CX: "CX"; CY: "CY"; CZ: "CZ"; DE: "DE"; DJ: "DJ"; DK: "DK"; DM: "DM"; DO: "DO"; DZ: "DZ"; EC: "EC"; EE: "EE"; EG: "EG"; EH: "EH"; ER: "ER"; ES: "ES"; ET: "ET"; FI: "FI"; FJ: "FJ"; FK: "FK"; FM: "FM"; FO: "FO"; FR: "FR"; GA: "GA"; GB: "GB"; GD: "GD"; GE: "GE"; GF: "GF"; GG: "GG"; GH: "GH"; GI: "GI"; GL: "GL"; GM: "GM"; GN: "GN"; GP: "GP"; GQ: "GQ"; GR: "GR"; GS: "GS"; GT: "GT"; GU: "GU"; GW: "GW"; GY: "GY"; HK: "HK"; HM: "HM"; HN: "HN"; HR: "HR"; HT: "HT"; HU: "HU"; ID: "ID"; IE: "IE"; IL: "IL"; IM: "IM"; IN: "IN"; IO: "IO"; IQ: "IQ"; IR: "IR"; IS: "IS"; IT: "IT"; JE: "JE"; JM: "JM"; JO: "JO"; JP: "JP"; KE: "KE"; KG: "KG"; KH: "KH"; KI: "KI"; KM: "KM"; KN: "KN"; KP: "KP"; KR: "KR"; KW: "KW"; KY: "KY"; KZ: "KZ"; LA: "LA"; LB: "LB"; LC: "LC"; LI: "LI"; LK: "LK"; LR: "LR"; LS: "LS"; LT: "LT"; LU: "LU"; LV: "LV"; LY: "LY"; MA: "MA"; MC: "MC"; MD: "MD"; ME: "ME"; MF: "MF"; MG: "MG"; MH: "MH"; MK: "MK"; ML: "ML"; MM: "MM"; MN: "MN"; MO: "MO"; MP: "MP"; MQ: "MQ"; MR: "MR"; MS: "MS"; MT: "MT"; MU: "MU"; MV: "MV"; MW: "MW"; MX: "MX"; MY: "MY"; MZ: "MZ"; NA: "NA"; NC: "NC"; NE: "NE"; NF: "NF"; NG: "NG"; NI: "NI"; NL: "NL"; NO: "NO"; NP: "NP"; NR: "NR"; NU: "NU"; NZ: "NZ"; OM: "OM"; PA: "PA"; PE: "PE"; PF: "PF"; PG: "PG"; PH: "PH"; PK: "PK"; PL: "PL"; PM: "PM"; PN: "PN"; PR: "PR"; PS: "PS"; PT: "PT"; PW: "PW"; PY: "PY"; QA: "QA"; RE: "RE"; RO: "RO"; RS: "RS"; RU: "RU"; RW: "RW"; SA: "SA"; SB: "SB"; SC: "SC"; SD: "SD"; SE: "SE"; SG: "SG"; SH: "SH"; SI: "SI"; SJ: "SJ"; SK: "SK"; SL: "SL"; SM: "SM"; SN: "SN"; SO: "SO"; SR: "SR"; SS: "SS"; ST: "ST"; SV: "SV"; SX: "SX"; SY: "SY"; SZ: "SZ"; TC: "TC"; TD: "TD"; TF: "TF"; TG: "TG"; TH: "TH"; TJ: "TJ"; TK: "TK"; TL: "TL"; TM: "TM"; TN: "TN"; TO: "TO"; TR: "TR"; TT: "TT"; TV: "TV"; TW: "TW"; TZ: "TZ"; UA: "UA"; UG: "UG"; UM: "UM"; US: "US"; UY: "UY"; UZ: "UZ"; VA: "VA"; VC: "VC"; VE: "VE"; VG: "VG"; VI: "VI"; VN: "VN"; VU: "VU"; WF: "WF"; WS: "WS"; YE: "YE"; YT: "YT"; ZA: "ZA"; ZM: "ZM"; ZW: "ZW"; }>; }, z.core.$strip>; /** * Generated by Kubb (https://kubb.dev/). * Do not edit manually. */ declare const countryEnum: { readonly AD: "AD"; readonly AE: "AE"; readonly AF: "AF"; readonly AG: "AG"; readonly AI: "AI"; readonly AL: "AL"; readonly AM: "AM"; readonly AO: "AO"; readonly AQ: "AQ"; readonly AR: "AR"; readonly AS: "AS"; readonly AT: "AT"; readonly AU: "AU"; readonly AW: "AW"; readonly AX: "AX"; readonly AZ: "AZ"; readonly BA: "BA"; readonly BB: "BB"; readonly BD: "BD"; readonly BE: "BE"; readonly BF: "BF"; readonly BG: "BG"; readonly BH: "BH"; readonly BI: "BI"; readonly BJ: "BJ"; readonly BL: "BL"; readonly BM: "BM"; readonly BN: "BN"; readonly BO: "BO"; readonly BQ: "BQ"; readonly BR: "BR"; readonly BS: "BS"; readonly BT: "BT"; readonly BV: "BV"; readonly BW: "BW"; readonly BY: "BY"; readonly BZ: "BZ"; readonly CA: "CA"; readonly CC: "CC"; readonly CD: "CD"; readonly CF: "CF"; readonly CG: "CG"; readonly CH: "CH"; readonly CI: "CI"; readonly CK: "CK"; readonly CL: "CL"; readonly CM: "CM"; readonly CN: "CN"; readonly CO: "CO"; readonly CR: "CR"; readonly CU: "CU"; readonly CV: "CV"; readonly CW: "CW"; readonly CX: "CX"; readonly CY: "CY"; readonly CZ: "CZ"; readonly DE: "DE"; readonly DJ: "DJ"; readonly DK: "DK"; readonly DM: "DM"; readonly DO: "DO"; readonly DZ: "DZ"; readonly EC: "EC"; readonly EE: "EE"; readonly EG: "EG"; readonly EH: "EH"; readonly ER: "ER"; readonly ES: "ES"; readonly ET: "ET"; readonly FI: "FI"; readonly FJ: "FJ"; readonly FK: "FK"; readonly FM: "FM"; readonly FO: "FO"; readonly FR: "FR"; readonly GA: "GA"; readonly GB: "GB"; readonly GD: "GD"; readonly GE: "GE"; readonly GF: "GF"; readonly GG: "GG"; readonly GH: "GH"; readonly GI: "GI"; readonly GL: "GL"; readonly GM: "GM"; readonly GN: "GN"; readonly GP: "GP"; readonly GQ: "GQ"; readonly GR: "GR"; readonly GS: "GS"; readonly GT: "GT"; readonly GU: "GU"; readonly GW: "GW"; readonly GY: "GY"; readonly HK: "HK"; readonly HM: "HM"; readonly HN: "HN"; readonly HR: "HR"; readonly HT: "HT"; readonly HU: "HU"; readonly ID: "ID"; readonly IE: "IE"; readonly IL: "IL"; readonly IM: "IM"; readonly IN: "IN"; readonly IO: "IO"; readonly IQ: "IQ"; readonly IR: "IR"; readonly IS: "IS"; readonly IT: "IT"; readonly JE: "JE"; readonly JM: "JM"; readonly JO: "JO"; readonly JP: "JP"; readonly KE: "KE"; readonly KG: "KG"; readonly KH: "KH"; readonly KI: "KI"; readonly KM: "KM"; readonly KN: "KN"; readonly KP: "KP"; readonly KR: "KR"; readonly KW: "KW"; readonly KY: "KY"; readonly KZ: "KZ"; readonly LA: "LA"; readonly LB: "LB"; readonly LC: "LC"; readonly LI: "LI"; readonly LK: "LK"; readonly LR: "LR"; readonly LS: "LS"; readonly LT: "LT"; readonly LU: "LU"; readonly LV: "LV"; readonly LY: "LY"; readonly MA: "MA"; readonly MC: "MC"; readonly MD: "MD"; readonly ME: "ME"; readonly MF: "MF"; readonly MG: "MG"; readonly MH: "MH"; readonly MK: "MK"; readonly ML: "ML"; readonly MM: "MM"; readonly MN: "MN"; readonly MO: "MO"; readonly MP: "MP"; readonly MQ: "MQ"; readonly MR: "MR"; readonly MS: "MS"; readonly MT: "MT"; readonly MU: "MU"; readonly MV: "MV"; readonly MW: "MW"; readonly MX: "MX"; readonly MY: "MY"; readonly MZ: "MZ"; readonly NA: "NA"; readonly NC: "NC"; readonly NE: "NE"; readonly NF: "NF"; readonly NG: "NG"; readonly NI: "NI"; readonly NL: "NL"; readonly NO: "NO"; readonly NP: "NP"; readonly NR: "NR"; readonly NU: "NU"; readonly NZ: "NZ"; readonly OM: "OM"; readonly PA: "PA"; readonly PE: "PE"; readonly PF: "PF"; readonly PG: "PG"; readonly PH: "PH"; readonly PK: "PK"; readonly PL: "PL"; readonly PM: "PM"; readonly PN: "PN"; readonly PR: "PR"; readonly PS: "PS"; readonly PT: "PT"; readonly PW: "PW"; readonly PY: "PY"; readonly QA: "QA"; readonly RE: "RE"; readonly RO: "RO"; readonly RS: "RS"; readonly RU: "RU"; readonly RW: "RW"; readonly SA: "SA"; readonly SB: "SB"; readonly SC: "SC"; readonly SD: "SD"; readonly SE: "SE"; readonly SG: "SG"; readonly SH: "SH"; readonly SI: "SI"; readonly SJ: "SJ"; readonly SK: "SK"; readonly SL: "SL"; readonly SM: "SM"; readonly SN: "SN"; readonly SO: "SO"; readonly SR: "SR"; readonly SS: "SS"; readonly ST: "ST"; readonly SV: "SV"; readonly SX: "SX"; readonly SY: "SY"; readonly SZ: "SZ"; readonly TC: "TC"; readonly TD: "TD"; readonly TF: "TF"; readonly TG: "TG"; readonly TH: "TH"; readonly TJ: "TJ"; readonly TK: "TK"; readonly TL: "TL"; readonly TM: "TM"; readonly TN: "TN"; readonly TO: "TO"; readonly TR: "TR"; readonly TT: "TT"; readonly TV: "TV"; readonly TW: "TW"; readonly TZ: "TZ"; readonly UA: "UA"; readonly UG: "UG"; readonly UM: "UM"; readonly US: "US"; readonly UY: "UY"; readonly UZ: "UZ"; readonly VA: "VA"; readonly VC: "VC"; readonly VE: "VE"; readonly VG: "VG"; readonly VI: "VI"; readonly VN: "VN"; readonly VU: "VU"; readonly WF: "WF"; readonly WS: "WS"; readonly YE: "YE"; readonly YT: "YT"; readonly ZA: "ZA"; readonly ZM: "ZM"; readonly ZW: "ZW"; }; type CountryEnumKey = (typeof countryEnum)[keyof typeof countryEnum]; type Country = CountryEnumKey; /** * Generated by Kubb (https://kubb.dev/). * Do not edit manually. */ /** * DeliveryAddress */ type DeliveryAddress = { /** * @type string */ street: string; /** * @type string */ city: string; /** * @type string */ region?: string | null; /** * @type string */ postcode: string; /** * @type string */ country: Country; }; interface O3KClientConfig { clientId: string; clientSecret: string; venueId?: string; /** * Base URL for API requests * @default "https://order3000.com/api" */ baseUrl?: string; /** * Machine-to-machine token endpoint. The order3000 server hosts user * session routes under `/auth/*` and robot-account M2M token exchange * under `/m2m/token`; the SDK is exclusively an M2M consumer, so the * default points at the latter. * @default "${baseUrl}/m2m/token" */ tokenUrl?: string; } declare class O3KClient { ads: AdsResource; areas: AreasResource; articles: ArticlesResource; assets: AssetsResource; baskets: BasketsResource; beverages: BeveragesResource; callouts: CalloutsResource; dishes: DishesResource; events: EventsResource; menus: MenusResource; orders: OrdersResource; paymentIntents: PaymentIntentsResource; publications: PublicationsResource; reservations: ReservationsResource; rituals: RitualsResource; subscriptions: SubscriptionsResource; teamOrders: TeamOrdersResource; venues: VenuesResource; websitePages: WebsitePagesResource; realtime: RealtimeManager; private readonly baseUrl; private readonly tokenManager; constructor(config: O3KClientConfig); } export { Ad as O3KAd, AddToBasketRequest as O3KAddToBasketRequest, AddToBasketResponse as O3KAddToBasketResponse, Area as O3KArea, AreaAvailabilityResponse as O3KAreaAvailabilityResponse, AreaBookingRequestResponse as O3KAreaBookingRequestResponse, Article as O3KArticle, Asset as O3KAsset, Basket as O3KBasket, BasketItemMetadata as O3KBasketItemMetadata, BasketTotals as O3KBasketTotals, O3KClient, ConfirmOrderRequest as O3KConfirmOrderRequest, ConfirmOrderResponse as O3KConfirmOrderResponse, CreateAdRequest as O3KCreateAdRequest, CreateAdResponse as O3KCreateAdResponse, CreateDeltaPaymentIntentRequest as O3KCreateDeltaPaymentIntentRequest, CreateDeltaPaymentIntentResponse as O3KCreateDeltaPaymentIntentResponse, CreateEventRequest as O3KCreateEventRequest, CreateEventResponse as O3KCreateEventResponse, CreatePaymentIntentRequest as O3KCreatePaymentIntentRequest, CreatePaymentIntentResponse as O3KCreatePaymentIntentResponse, Currency as O3KCurrency, DayOfWeek as O3KDayOfWeek, DeclaredReturn as O3KDeclaredReturn, DeleteAdResponse as O3KDeleteAdResponse, DeleteEventResponse as O3KDeleteEventResponse, deliveryAddressSchema as O3KDeliveryAddressSchema, EventByAccessor as O3KEventByAccessor, FeatureImage as O3KFeatureImage, fulfillmentTypeEnum as O3KFulfillmentTypeEnum, GetAreaAvailabilityOptions as O3KGetAreaAvailabilityOptions, GetAreaOptions as O3KGetAreaOptions, GetEventOptions as O3KGetEventOptions, GetMenuOptions as O3KGetMenuOptions, getScheduleInfo as O3KGetScheduleInfo, LatestOrder as O3KLatestOrder, ListAdsOptions as O3KListAdsOptions, ListAdsResponse as O3KListAdsResponse, ListArticlesOptions as O3KListArticlesOptions, ListArticlesResponse as O3KListArticlesResponse, ListAssetsOptions as O3KListAssetsOptions, ListAssetsResponse as O3KListAssetsResponse, ListEventsOptions as O3KListEventsOptions, ListEventsResponse as O3KListEventsResponse, Menu as O3KMenu, MenuBundle as O3KMenuBundle, MenuSubscription as O3KMenuSubscription, participantStatusEnum as O3KParticipantStatusEnum, PatchAdRequest as O3KPatchAdRequest, PatchAdResponse as O3KPatchAdResponse, PatchArticleRequest as O3KPatchArticleRequest, PatchEventRequest as O3KPatchEventRequest, PatchEventResponse as O3KPatchEventResponse, PatchFeatureImageRequest as O3KPatchFeatureImageRequest, paymentMethodEnum as O3KPaymentMethodEnum, PlaceOrderRequest as O3KPlaceOrderRequest, RemoveFromBasketResponse as O3KRemoveFromBasketResponse, RitualByAccessor as O3KRitual, ScheduleTimeSlot as O3KScheduleTimeSlot, SubmitAreaBookingRequestPayload as O3KSubmitAreaBookingRequestPayload, SubscribeRequest as O3KSubscribeRequest, SubscribeResponse as O3KSubscribeResponse, SubscriptionCredit as O3KSubscriptionCredit, SubscriptionCreditStatus as O3KSubscriptionCreditStatus, teamOrderStatusEnum as O3KTeamOrderStatusEnum, UploadAssetArgs as O3KUploadAssetArgs, UploadAssetResponse as O3KUploadAssetResponse, UploadEventAssetArgs as O3KUploadEventAssetArgs, UploadEventAssetResponse as O3KUploadEventAssetResponse, UploadFeatureImageArgs as O3KUploadFeatureImageArgs, Venue as O3KVenue }; export type { CancelTeamOrderResponse as O3KCancelTeamOrderResponse, O3KClientConfig, CreateTeamOrderRequest as O3KCreateTeamOrderRequest, CreateTeamOrderResponse as O3KCreateTeamOrderResponse, DeliveryAddress as O3KDeliveryAddress, EventRow as O3KEventRow, ExtendDeadlineResponse as O3KExtendTeamOrderDeadlineResponse, FetchTeamOrderResponse as O3KFetchTeamOrderResponse, JoinTeamOrderRequest as O3KJoinTeamOrderRequest, JoinTeamOrderResponse as O3KJoinTeamOrderResponse, MenuItemRow as O3KMenuItemRow, RealtimeConfig as O3KRealtimeConfig, RealtimeEvent as O3KRealtimeEvent, RealtimeSubscription as O3KRealtimeSubscription, ScheduleInfo as O3KScheduleInfo, ScheduleOverrideRow as O3KScheduleOverrideRow, ScheduleRow as O3KScheduleRow, SubmitTeamOrderResponse as O3KSubmitTeamOrderResponse, SubscriptionOptions as O3KSubscriptionOptions, SwitchFulfillmentResponse as O3KSwitchTeamOrderFulfillmentResponse, TeamDeliveryAddress as O3KTeamDeliveryAddress, TeamOrderBasketItem as O3KTeamOrderBasketItem, TeamOrderBasketItemMenuItemRef as O3KTeamOrderBasketItemMenuItemRef, FulfillmentType as O3KTeamOrderFulfillmentType, TeamOrderParticipant as O3KTeamOrderParticipant, ParticipantStatus as O3KTeamOrderParticipantStatus, PaymentMethod as O3KTeamOrderPaymentMethod, TeamOrderStatus as O3KTeamOrderStatus, ThresholdCheck as O3KTeamOrderThresholdCheck, UpdateDeliveryAddressResponse as O3KUpdateTeamOrderDeliveryAddressResponse };