order3000 1.7.0 → 1.8.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
@@ -623,6 +623,22 @@ class EventsResource extends BaseResource {
623
623
  });
624
624
  return event.assets ?? [];
625
625
  }
626
+ /**
627
+ * Per-start-slot occupancy availability for an event on a date. Each slot's
628
+ * `offered` honours the venue's reservation mode (`passive`: every slot;
629
+ * `auto_steer`: only acceptable slots), so a public widget can pre-exclude
630
+ * fully-booked start times.
631
+ */
632
+ async getSlotAvailability(idOrAccessor, options) {
633
+ const params = new URLSearchParams();
634
+ params.set("reservationDate", options.reservationDate);
635
+ params.set("partySize", String(options.partySize));
636
+ if (options.areaId) params.set("areaId", options.areaId);
637
+ return this.request(
638
+ "GET",
639
+ `/${encodeURIComponent(idOrAccessor)}/slot-availability?${params.toString()}`
640
+ );
641
+ }
626
642
  /**
627
643
  * Upload a asset image for an event. The SDK builds the multipart
628
644
  * body internally — pass a Buffer/Uint8Array, the original filename,
package/dist/client.d.cts CHANGED
@@ -442,6 +442,11 @@ interface components {
442
442
  isBookable?: boolean;
443
443
  isPublic?: boolean;
444
444
  isActive?: boolean;
445
+ areaType?: components["schemas"]["AreaType"];
446
+ turnTimes?: {
447
+ [key: string]: number;
448
+ } | null;
449
+ cleanup?: number | null;
445
450
  assets?: {
446
451
  id: string;
447
452
  type: components["schemas"]["AssetType"];
@@ -462,6 +467,14 @@ interface components {
462
467
  /** Format: uri */
463
468
  publicUrl: string;
464
469
  }[];
470
+ closures?: {
471
+ id: string;
472
+ date: string;
473
+ reason: {
474
+ [key: string]: string;
475
+ } | null;
476
+ isActive: boolean;
477
+ }[];
465
478
  };
466
479
  /** FetchAreasResponse */
467
480
  FetchAreasResponse: components["schemas"]["Area"][];
@@ -500,6 +513,11 @@ interface components {
500
513
  isBookable?: boolean;
501
514
  isPublic?: boolean;
502
515
  isActive?: boolean;
516
+ areaType?: components["schemas"]["AreaType"];
517
+ turnTimes?: {
518
+ [key: string]: number;
519
+ } | null;
520
+ cleanup?: number | null;
503
521
  assets?: {
504
522
  id: string;
505
523
  type: components["schemas"]["AssetType"];
@@ -520,6 +538,14 @@ interface components {
520
538
  /** Format: uri */
521
539
  publicUrl: string;
522
540
  }[];
541
+ closures?: {
542
+ id: string;
543
+ date: string;
544
+ reason: {
545
+ [key: string]: string;
546
+ } | null;
547
+ isActive: boolean;
548
+ }[];
523
549
  };
524
550
  /** GetAreaAvailabilityResponse */
525
551
  GetAreaAvailabilityResponse: {
@@ -1229,6 +1255,16 @@ interface components {
1229
1255
  publicUrl: string;
1230
1256
  }[];
1231
1257
  };
1258
+ /** FetchSlotAvailabilityResponse */
1259
+ FetchSlotAvailabilityResponse: {
1260
+ /** @description Slot start time in HH:MM:SS format */
1261
+ startTime: string;
1262
+ /** @description Whether a party of this size can be booked at this slot */
1263
+ acceptable: boolean;
1264
+ /** @description Whether the public widget should offer this slot — passive: always; auto_steer: only when acceptable */
1265
+ offered: boolean;
1266
+ reason: components["schemas"]["OccupancyReason"];
1267
+ }[];
1232
1268
  /**
1233
1269
  * CreateEventRequest
1234
1270
  * @description Request payload for creating a new event
@@ -1247,6 +1283,9 @@ interface components {
1247
1283
  maxGuests?: number | null;
1248
1284
  minPartySize?: number | null;
1249
1285
  maxPartySize?: number | null;
1286
+ staffByRole?: ((string | number | boolean | (null)) | {
1287
+ [key: string]: unknown;
1288
+ } | unknown[]) | null;
1250
1289
  isPublic?: boolean;
1251
1290
  reservationsEnabled?: boolean;
1252
1291
  bookingOpensAtDays?: number | null;
@@ -1295,6 +1334,9 @@ interface components {
1295
1334
  maxGuests: number | null;
1296
1335
  minPartySize: number | null;
1297
1336
  maxPartySize: number | null;
1337
+ staffByRole: ((string | number | boolean | (null)) | {
1338
+ [key: string]: unknown;
1339
+ } | unknown[]) | null;
1298
1340
  isPublic: boolean;
1299
1341
  reservationsEnabled: boolean;
1300
1342
  bookingOpensAtDays: number | null;
@@ -1328,6 +1370,9 @@ interface components {
1328
1370
  maxGuests?: number | null;
1329
1371
  minPartySize?: number | null;
1330
1372
  maxPartySize?: number | null;
1373
+ staffByRole?: ((string | number | boolean | (null)) | {
1374
+ [key: string]: unknown;
1375
+ } | unknown[]) | null;
1331
1376
  isPublic?: boolean;
1332
1377
  reservationsEnabled?: boolean;
1333
1378
  bookingOpensAtDays?: number | null;
@@ -1354,6 +1399,86 @@ interface components {
1354
1399
  } | null;
1355
1400
  ritualAccessor?: string | null;
1356
1401
  };
1402
+ /** Schedule */
1403
+ Schedule: {
1404
+ id: string;
1405
+ name: (string | number | boolean | (null)) | {
1406
+ [key: string]: unknown;
1407
+ } | unknown[];
1408
+ description: ((string | number | boolean | (null)) | {
1409
+ [key: string]: unknown;
1410
+ } | unknown[]) | null;
1411
+ timezone: string;
1412
+ rrule: string | null;
1413
+ exdates: string[] | null;
1414
+ validFrom: string | null;
1415
+ validTo: string | null;
1416
+ slotMode: components["schemas"]["SlotMode"];
1417
+ intervalDuration: number | null;
1418
+ duration: number | null;
1419
+ isActive: boolean;
1420
+ sortIndex: string | null;
1421
+ updatedAt: unknown;
1422
+ updatedBy: string | null;
1423
+ createdAt: unknown;
1424
+ createdBy: string | null;
1425
+ scheduleTimeSlots?: {
1426
+ scheduleId: string | null;
1427
+ timeSlotId: string | null;
1428
+ dayOfWeek: components["schemas"]["DayOfWeek"];
1429
+ sortIndex: string | null;
1430
+ timeSlot: {
1431
+ id: string;
1432
+ startTime: string;
1433
+ endTime: string | null;
1434
+ isActive: boolean | null;
1435
+ isSchedulable: boolean | null;
1436
+ maxBookings: number | null;
1437
+ maxGuests: number | null;
1438
+ overflowBookings: number | null;
1439
+ overflowGuests: number | null;
1440
+ sortIndex: string | null;
1441
+ updatedAt: unknown;
1442
+ updatedBy: string | null;
1443
+ createdAt: unknown;
1444
+ createdBy: string | null;
1445
+ } | null;
1446
+ }[];
1447
+ scheduleOverrides?: {
1448
+ id: string;
1449
+ scheduleId: string;
1450
+ date: string;
1451
+ reason: ((string | number | boolean | (null)) | {
1452
+ [key: string]: unknown;
1453
+ } | unknown[]) | null;
1454
+ isActive: boolean;
1455
+ updatedAt: unknown;
1456
+ updatedBy: string | null;
1457
+ createdAt: unknown;
1458
+ createdBy: string | null;
1459
+ scheduleOverrideTimeSlots: {
1460
+ overrideId: string;
1461
+ timeSlotId: string;
1462
+ sortIndex: string | null;
1463
+ timeSlot: {
1464
+ id: string;
1465
+ startTime: string;
1466
+ endTime: string | null;
1467
+ isActive: boolean | null;
1468
+ isSchedulable: boolean | null;
1469
+ maxBookings: number | null;
1470
+ maxGuests: number | null;
1471
+ overflowBookings: number | null;
1472
+ overflowGuests: number | null;
1473
+ sortIndex: string | null;
1474
+ updatedAt: unknown;
1475
+ updatedBy: string | null;
1476
+ createdAt: unknown;
1477
+ createdBy: string | null;
1478
+ };
1479
+ }[];
1480
+ }[];
1481
+ };
1357
1482
  /**
1358
1483
  * EditEventResponse
1359
1484
  * @description Successfully updated event with schedule
@@ -1375,6 +1500,9 @@ interface components {
1375
1500
  maxGuests: number | null;
1376
1501
  minPartySize: number | null;
1377
1502
  maxPartySize: number | null;
1503
+ staffByRole: ((string | number | boolean | (null)) | {
1504
+ [key: string]: unknown;
1505
+ } | unknown[]) | null;
1378
1506
  isPublic: boolean;
1379
1507
  reservationsEnabled: boolean;
1380
1508
  bookingOpensAtDays: number | null;
@@ -1389,47 +1517,7 @@ interface components {
1389
1517
  updatedBy: string | null;
1390
1518
  createdAt: unknown;
1391
1519
  updatedAt: unknown;
1392
- schedule: {
1393
- id: string;
1394
- name: (string | number | boolean | (null)) | {
1395
- [key: string]: unknown;
1396
- } | unknown[];
1397
- description: ((string | number | boolean | (null)) | {
1398
- [key: string]: unknown;
1399
- } | unknown[]) | null;
1400
- timezone: string;
1401
- rrule: string | null;
1402
- exdates: string[] | null;
1403
- validFrom: string | null;
1404
- validTo: string | null;
1405
- slotMode: components["schemas"]["SlotMode"];
1406
- intervalDuration: number | null;
1407
- duration: number | null;
1408
- isActive: boolean;
1409
- sortIndex: string | null;
1410
- updatedAt: unknown;
1411
- updatedBy: string | null;
1412
- createdAt: unknown;
1413
- createdBy: string | null;
1414
- scheduleTimeSlots?: {
1415
- scheduleId: string | null;
1416
- timeSlotId: string | null;
1417
- dayOfWeek: components["schemas"]["DayOfWeek"];
1418
- sortIndex: string | null;
1419
- timeSlot: {
1420
- id: string;
1421
- startTime: string;
1422
- endTime: string | null;
1423
- isActive: boolean | null;
1424
- isSchedulable: boolean | null;
1425
- sortIndex: string | null;
1426
- updatedAt: unknown;
1427
- updatedBy: string | null;
1428
- createdAt: unknown;
1429
- createdBy: string | null;
1430
- } | null;
1431
- }[];
1432
- } | null;
1520
+ schedule: components["schemas"]["Schedule"] | null;
1433
1521
  };
1434
1522
  /** DeleteEventResponse */
1435
1523
  DeleteEventResponse: {
@@ -1449,6 +1537,9 @@ interface components {
1449
1537
  maxGuests: number | null;
1450
1538
  minPartySize: number | null;
1451
1539
  maxPartySize: number | null;
1540
+ staffByRole: ((string | number | boolean | (null)) | {
1541
+ [key: string]: unknown;
1542
+ } | unknown[]) | null;
1452
1543
  isPublic: boolean;
1453
1544
  reservationsEnabled: boolean;
1454
1545
  bookingOpensAtDays: number | null;
@@ -1915,6 +2006,11 @@ interface components {
1915
2006
  * @description UUID of the event this reservation is for
1916
2007
  */
1917
2008
  eventId: string;
2009
+ /**
2010
+ * Format: uuid
2011
+ * @description UUID of the area to seat this party in. Defaults to the event's primary area (the one with the most tables) when omitted; the occupancy gate evaluates capacity against this area.
2012
+ */
2013
+ areaId?: string | null;
1918
2014
  /** @description Date of the reservation in YYYY-MM-DD format */
1919
2015
  reservationDate: string;
1920
2016
  /** @description Time of the reservation in HH:MM:SS format */
@@ -1974,6 +2070,7 @@ interface components {
1974
2070
  * @description Event identifier for this reservation
1975
2071
  */
1976
2072
  eventId: string;
2073
+ areaId: string | null;
1977
2074
  quickReferenceNumber: number | null;
1978
2075
  /** @description Date of the reservation in YYYY-MM-DD format */
1979
2076
  reservationDate: string;
@@ -2111,6 +2208,9 @@ interface components {
2111
2208
  maxGuests: number | null;
2112
2209
  minPartySize: number | null;
2113
2210
  maxPartySize: number | null;
2211
+ staffByRole: ((string | number | boolean | (null)) | {
2212
+ [key: string]: unknown;
2213
+ } | unknown[]) | null;
2114
2214
  isPublic: boolean;
2115
2215
  reservationsEnabled: boolean;
2116
2216
  bookingOpensAtDays: number | null;
@@ -2127,77 +2227,7 @@ interface components {
2127
2227
  updatedAt: unknown;
2128
2228
  covers: number;
2129
2229
  }[];
2130
- schedule: {
2131
- id: string;
2132
- name: (string | number | boolean | (null)) | {
2133
- [key: string]: unknown;
2134
- } | unknown[];
2135
- description: ((string | number | boolean | (null)) | {
2136
- [key: string]: unknown;
2137
- } | unknown[]) | null;
2138
- timezone: string;
2139
- rrule: string | null;
2140
- exdates: string[] | null;
2141
- validFrom: string | null;
2142
- validTo: string | null;
2143
- slotMode: components["schemas"]["SlotMode"];
2144
- intervalDuration: number | null;
2145
- duration: number | null;
2146
- isActive: boolean;
2147
- sortIndex: string | null;
2148
- updatedAt: unknown;
2149
- updatedBy: string | null;
2150
- createdAt: unknown;
2151
- createdBy: string | null;
2152
- scheduleTimeSlots: {
2153
- scheduleId: string | null;
2154
- timeSlotId: string | null;
2155
- dayOfWeek: components["schemas"]["DayOfWeek"];
2156
- sortIndex: string | null;
2157
- timeSlot: {
2158
- id: string;
2159
- startTime: string;
2160
- endTime: string | null;
2161
- isActive: boolean | null;
2162
- isSchedulable: boolean | null;
2163
- sortIndex: string | null;
2164
- updatedAt: unknown;
2165
- updatedBy: string | null;
2166
- createdAt: unknown;
2167
- createdBy: string | null;
2168
- } | null;
2169
- }[];
2170
- scheduleOverrides: {
2171
- id: string;
2172
- scheduleId: string;
2173
- date: string;
2174
- reason: ((string | number | boolean | (null)) | {
2175
- [key: string]: unknown;
2176
- } | unknown[]) | null;
2177
- isActive: boolean;
2178
- updatedAt: unknown;
2179
- updatedBy: string | null;
2180
- createdAt: unknown;
2181
- createdBy: string | null;
2182
- scheduleOverrideTimeSlots: {
2183
- overrideId: string;
2184
- timeSlotId: string;
2185
- sortIndex: string | null;
2186
- timeSlot: {
2187
- id: string;
2188
- startTime: string;
2189
- endTime: string | null;
2190
- isActive: boolean | null;
2191
- isSchedulable: boolean | null;
2192
- sortIndex: string | null;
2193
- updatedAt: unknown;
2194
- updatedBy: string | null;
2195
- createdAt: unknown;
2196
- createdBy: string | null;
2197
- };
2198
- }[];
2199
- }[];
2200
- } | null;
2230
+ schedule: components["schemas"]["Schedule"] | null;
2201
2231
  };
2202
2232
  /** GetSubscriptionResponse */
2203
2233
  GetSubscriptionResponse: {
@@ -2604,6 +2634,8 @@ interface components {
2604
2634
  /** @enum {string} */
2605
2635
  AreaBookingStatus: "confirmed" | "arrived" | "completed" | "cancelled" | "no_show";
2606
2636
  /** @enum {string} */
2637
+ AreaType: "indoor" | "outdoor";
2638
+ /** @enum {string} */
2607
2639
  ArticleEditorSaveState: "idle" | "saving" | "saved" | "error";
2608
2640
  /** @enum {string} */
2609
2641
  ArticleStatus: "draft" | "published";
@@ -2640,14 +2672,24 @@ interface components {
2640
2672
  /** @enum {string} */
2641
2673
  MenuItemType: "dish" | "beverage";
2642
2674
  /** @enum {string} */
2675
+ OccupancyReason: "ok" | "tables" | "personnel";
2676
+ /** @enum {string} */
2643
2677
  FulfillmentType: "pickup" | "delivery";
2644
2678
  /** @enum {string} */
2645
2679
  OrderStatus: "pending" | "in_progress" | "ready" | "completed" | "cancelled";
2646
2680
  /** @enum {string} */
2681
+ PaxBand: "1-2" | "3-4" | "5-6" | "7+";
2682
+ /** @enum {string} */
2647
2683
  PaymentMethod: "card" | "cash" | "voucher";
2648
2684
  /** @enum {string} */
2649
2685
  PaymentStatus: "unpaid" | "paid" | "refunded" | "authorized" | "cash_pending";
2650
2686
  /** @enum {string} */
2687
+ PlatformRole: "platform_maintainer";
2688
+ /** @enum {string} */
2689
+ ReservationMode: "passive" | "auto_steer";
2690
+ /** @enum {string} */
2691
+ Role: "superadmin" | "admin" | "manager" | "chef" | "cook" | "waiter" | "rider";
2692
+ /** @enum {string} */
2651
2693
  ScanTokenEntityType: "order" | "depositware";
2652
2694
  /** @enum {string} */
2653
2695
  SortOrder: "asc" | "desc";
@@ -2670,13 +2712,13 @@ interface components {
2670
2712
  /** @enum {string} */
2671
2713
  MentionEntityType: "dish" | "beverage" | "ingredient" | "menu" | "ritual";
2672
2714
  /** @enum {string} */
2673
- MentionKind: "link" | "value";
2715
+ MentionType: "link" | "value";
2674
2716
  /** @enum {string} */
2675
2717
  PendingSuperadminTransferStatus: "pending_invite" | "accepted_awaiting_payment" | "completed" | "cancelled" | "expired";
2676
2718
  /** @enum {string} */
2677
2719
  BillingMode: "single_anchor" | "split";
2678
2720
  /** @enum {string} */
2679
- VenueChargeKind: "base" | "addon";
2721
+ VenueChargeType: "base" | "addon";
2680
2722
  /** @enum {string} */
2681
2723
  AssetType: "image" | "video" | "document";
2682
2724
  /** @enum {string} */
@@ -2684,7 +2726,7 @@ interface components {
2684
2726
  /** @enum {string} */
2685
2727
  GbpSyncStatus: "processing" | "live" | "rejected" | "failed" | "removed";
2686
2728
  /** @enum {string} */
2687
- GeoAreaKind: "postcode" | "city" | "region";
2729
+ GeoAreaType: "postcode" | "city" | "region";
2688
2730
  /** @enum {string} */
2689
2731
  Jurisdiction: "DE" | "CH" | "FR" | "IT";
2690
2732
  /** @enum {string} */
@@ -3025,6 +3067,12 @@ interface GetAreaOptions {
3025
3067
  }
3026
3068
  type AreaAvailabilityWindow = schemas['GetAreaAvailabilityResponse']['occupied'][number];
3027
3069
  type AreaAvailabilityResponse = schemas['GetAreaAvailabilityResponse'];
3070
+ type EventSlotAvailabilityResponse = schemas['FetchSlotAvailabilityResponse'];
3071
+ interface GetEventSlotAvailabilityOptions {
3072
+ reservationDate: string;
3073
+ partySize: number;
3074
+ areaId?: string;
3075
+ }
3028
3076
  interface GetAreaAvailabilityOptions {
3029
3077
  /** YYYY-MM-DD — defaults to today */
3030
3078
  from?: string;
@@ -3414,6 +3462,13 @@ declare class EventsResource extends BaseResource {
3414
3462
  * `assets[]` array (empty when the event has none).
3415
3463
  */
3416
3464
  listAssets(idOrAccessor: string): Promise<EventAssetEntry[]>;
3465
+ /**
3466
+ * Per-start-slot occupancy availability for an event on a date. Each slot's
3467
+ * `offered` honours the venue's reservation mode (`passive`: every slot;
3468
+ * `auto_steer`: only acceptable slots), so a public widget can pre-exclude
3469
+ * fully-booked start times.
3470
+ */
3471
+ getSlotAvailability(idOrAccessor: string, options: GetEventSlotAvailabilityOptions): Promise<EventSlotAvailabilityResponse>;
3417
3472
  /**
3418
3473
  * Upload a asset image for an event. The SDK builds the multipart
3419
3474
  * body internally — pass a Buffer/Uint8Array, the original filename,