@wix/table-reservations 1.0.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.
Files changed (80) hide show
  1. package/build/cjs/index.d.ts +2 -0
  2. package/build/cjs/index.js +25 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +2 -0
  5. package/build/cjs/index.typings.js +25 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +2 -0
  8. package/build/cjs/meta.js +25 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/table-reservations-v1-reservation-location.http.d.ts +21 -0
  11. package/build/cjs/src/table-reservations-v1-reservation-location.http.js +219 -0
  12. package/build/cjs/src/table-reservations-v1-reservation-location.http.js.map +1 -0
  13. package/build/cjs/src/table-reservations-v1-reservation-location.meta.d.ts +20 -0
  14. package/build/cjs/src/table-reservations-v1-reservation-location.meta.js +102 -0
  15. package/build/cjs/src/table-reservations-v1-reservation-location.meta.js.map +1 -0
  16. package/build/cjs/src/table-reservations-v1-reservation-location.public.d.ts +11 -0
  17. package/build/cjs/src/table-reservations-v1-reservation-location.public.js +41 -0
  18. package/build/cjs/src/table-reservations-v1-reservation-location.public.js.map +1 -0
  19. package/build/cjs/src/table-reservations-v1-reservation-location.types.d.ts +1465 -0
  20. package/build/cjs/src/table-reservations-v1-reservation-location.types.js +142 -0
  21. package/build/cjs/src/table-reservations-v1-reservation-location.types.js.map +1 -0
  22. package/build/cjs/src/table-reservations-v1-reservation-location.universal.d.ts +1455 -0
  23. package/build/cjs/src/table-reservations-v1-reservation-location.universal.js +488 -0
  24. package/build/cjs/src/table-reservations-v1-reservation-location.universal.js.map +1 -0
  25. package/build/cjs/src/table-reservations-v1-reservation.http.d.ts +36 -0
  26. package/build/cjs/src/table-reservations-v1-reservation.http.js +346 -0
  27. package/build/cjs/src/table-reservations-v1-reservation.http.js.map +1 -0
  28. package/build/cjs/src/table-reservations-v1-reservation.meta.d.ts +28 -0
  29. package/build/cjs/src/table-reservations-v1-reservation.meta.js +176 -0
  30. package/build/cjs/src/table-reservations-v1-reservation.meta.js.map +1 -0
  31. package/build/cjs/src/table-reservations-v1-reservation.public.d.ts +15 -0
  32. package/build/cjs/src/table-reservations-v1-reservation.public.js +61 -0
  33. package/build/cjs/src/table-reservations-v1-reservation.public.js.map +1 -0
  34. package/build/cjs/src/table-reservations-v1-reservation.types.d.ts +477 -0
  35. package/build/cjs/src/table-reservations-v1-reservation.types.js +58 -0
  36. package/build/cjs/src/table-reservations-v1-reservation.types.js.map +1 -0
  37. package/build/cjs/src/table-reservations-v1-reservation.universal.d.ts +699 -0
  38. package/build/cjs/src/table-reservations-v1-reservation.universal.js +607 -0
  39. package/build/cjs/src/table-reservations-v1-reservation.universal.js.map +1 -0
  40. package/build/es/index.d.ts +2 -0
  41. package/build/es/index.js +3 -0
  42. package/build/es/index.js.map +1 -0
  43. package/build/es/index.typings.d.ts +2 -0
  44. package/build/es/index.typings.js +3 -0
  45. package/build/es/index.typings.js.map +1 -0
  46. package/build/es/meta.d.ts +2 -0
  47. package/build/es/meta.js +3 -0
  48. package/build/es/meta.js.map +1 -0
  49. package/build/es/src/table-reservations-v1-reservation-location.http.d.ts +21 -0
  50. package/build/es/src/table-reservations-v1-reservation-location.http.js +212 -0
  51. package/build/es/src/table-reservations-v1-reservation-location.http.js.map +1 -0
  52. package/build/es/src/table-reservations-v1-reservation-location.meta.d.ts +20 -0
  53. package/build/es/src/table-reservations-v1-reservation-location.meta.js +76 -0
  54. package/build/es/src/table-reservations-v1-reservation-location.meta.js.map +1 -0
  55. package/build/es/src/table-reservations-v1-reservation-location.public.d.ts +11 -0
  56. package/build/es/src/table-reservations-v1-reservation-location.public.js +24 -0
  57. package/build/es/src/table-reservations-v1-reservation-location.public.js.map +1 -0
  58. package/build/es/src/table-reservations-v1-reservation-location.types.d.ts +1465 -0
  59. package/build/es/src/table-reservations-v1-reservation-location.types.js +139 -0
  60. package/build/es/src/table-reservations-v1-reservation-location.types.js.map +1 -0
  61. package/build/es/src/table-reservations-v1-reservation-location.universal.d.ts +1455 -0
  62. package/build/es/src/table-reservations-v1-reservation-location.universal.js +462 -0
  63. package/build/es/src/table-reservations-v1-reservation-location.universal.js.map +1 -0
  64. package/build/es/src/table-reservations-v1-reservation.http.d.ts +36 -0
  65. package/build/es/src/table-reservations-v1-reservation.http.js +335 -0
  66. package/build/es/src/table-reservations-v1-reservation.http.js.map +1 -0
  67. package/build/es/src/table-reservations-v1-reservation.meta.d.ts +28 -0
  68. package/build/es/src/table-reservations-v1-reservation.meta.js +146 -0
  69. package/build/es/src/table-reservations-v1-reservation.meta.js.map +1 -0
  70. package/build/es/src/table-reservations-v1-reservation.public.d.ts +15 -0
  71. package/build/es/src/table-reservations-v1-reservation.public.js +44 -0
  72. package/build/es/src/table-reservations-v1-reservation.public.js.map +1 -0
  73. package/build/es/src/table-reservations-v1-reservation.types.d.ts +477 -0
  74. package/build/es/src/table-reservations-v1-reservation.types.js +55 -0
  75. package/build/es/src/table-reservations-v1-reservation.types.js.map +1 -0
  76. package/build/es/src/table-reservations-v1-reservation.universal.d.ts +699 -0
  77. package/build/es/src/table-reservations-v1-reservation.universal.js +577 -0
  78. package/build/es/src/table-reservations-v1-reservation.universal.js.map +1 -0
  79. package/meta/package.json +6 -0
  80. package/package.json +38 -0
@@ -0,0 +1,699 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ /** The reservation domain object. */
8
+ export interface Reservation {
9
+ /**
10
+ * Reservation ID. Read-Only.
11
+ * @readonly
12
+ */
13
+ _id?: string | null;
14
+ /** Status of the reservation. See the [Reservation Lifecycle article]() for more details on each of the statuses, and an explanations of the reservation lifecycle. */
15
+ status?: Status;
16
+ /**
17
+ * Reservation source.
18
+ *
19
+ * This indicates how the reservation was made.
20
+ * `ONLINE` indicates that the customer made the reservation through a website or app.
21
+ * `OFFLINE` indicates that the reservation was made by a restaurant employee, for example when a customer calls to make a reservation.
22
+ * `WALK-IN` indicates that the customer did not make a reservation beforehand, and the reservation was entered into the system by a restaurant employee when the customer arrived at the restaurant.
23
+ */
24
+ source?: Source;
25
+ /** Reservation details. */
26
+ details?: Details;
27
+ /** Information about the person the reservation is being made for. */
28
+ reservee?: Reservee;
29
+ /**
30
+ * Information about the person making the reservation.
31
+ * @readonly
32
+ */
33
+ reservedBy?: ReservedBy;
34
+ /**
35
+ * Team message.
36
+ *
37
+ * A message for the restaurant staff containing any additional information regarding the reservation, such as special requirements for the guests.
38
+ */
39
+ teamMessage?: string | null;
40
+ /**
41
+ * Date and time when the when the reservation was created.
42
+ * @readonly
43
+ */
44
+ _createdDate?: Date;
45
+ /**
46
+ * Date and time when the when the reservation was changed.
47
+ * @readonly
48
+ */
49
+ _updatedDate?: Date;
50
+ /**
51
+ * Revision number, which increments by 1 each time the reservation is updated.
52
+ * To prevent conflicting changes, the current revision must be passed when updating the reservation.
53
+ *
54
+ * Ignored when creating a reservation.
55
+ * @readonly
56
+ */
57
+ revision?: string | null;
58
+ /** The reason the reservation was declined. */
59
+ declineReason?: string | null;
60
+ }
61
+ export declare enum Status {
62
+ UNKNOWN = "UNKNOWN",
63
+ /** The reservation is held for 10 minutes, during which time the reservee should fill in their details. */
64
+ HELD = "HELD",
65
+ /** The reservation has been reserved. */
66
+ RESERVED = "RESERVED",
67
+ /** The reservation has been canceled. */
68
+ CANCELED = "CANCELED",
69
+ /** The reservation has been successfully finished. */
70
+ FINISHED = "FINISHED",
71
+ /** The reservee didn't arrive. */
72
+ NO_SHOW = "NO_SHOW",
73
+ /** The reservee occupied the table. */
74
+ SEATED = "SEATED",
75
+ /** The reservee requested a reservation and is waiting for manual approval. */
76
+ REQUESTED = "REQUESTED",
77
+ /** The owner declined a reservee's request. */
78
+ DECLINED = "DECLINED"
79
+ }
80
+ export declare enum Source {
81
+ UNKNOWN = "UNKNOWN",
82
+ /** The reservation is created by a User. */
83
+ OFFLINE = "OFFLINE",
84
+ /** The reservation is created by UoU. */
85
+ ONLINE = "ONLINE",
86
+ /** The reservation is created by a User. It can be created without reservee data. */
87
+ WALK_IN = "WALK_IN"
88
+ }
89
+ /** Reservation details. */
90
+ export interface Details {
91
+ /** ID of the reservation location at which this reservation will be made. */
92
+ reservationLocationId?: string | null;
93
+ /** Table IDs of tables used for this reservation. */
94
+ tableIds?: string[] | null;
95
+ /** Start date and time of the reservation. */
96
+ startDate?: Date;
97
+ /** End date and time of the reservation. */
98
+ endDate?: Date;
99
+ /** Party size. */
100
+ partySize?: number | null;
101
+ }
102
+ /** A person the reservation is being made for. */
103
+ export interface Reservee {
104
+ /** First name. */
105
+ firstName?: string | null;
106
+ /** Last name. */
107
+ lastName?: string | null;
108
+ /** Email address. */
109
+ email?: string | null;
110
+ /** Phone number. */
111
+ phone?: string | null;
112
+ /** Whether the reserve has given marketing consent. */
113
+ marketingConsent?: boolean | null;
114
+ /**
115
+ * Custom fields for the reservee in key-value pairs.
116
+ *
117
+ * The key is the custom field's ID, and the value is the custom field's value.
118
+ *
119
+ * Empty fields are not returned.
120
+ */
121
+ customFields?: Record<string, any> | null;
122
+ /**
123
+ * Contact ID. If a contact with this ID does not exist on the site, one will be created.
124
+ * @readonly
125
+ */
126
+ contactId?: string | null;
127
+ }
128
+ /** A person making reservation. */
129
+ export interface ReservedBy {
130
+ /**
131
+ * Contact ID for the person who made the reservation. If a contact with this ID does not exist on the site, one will be created.
132
+ * @readonly
133
+ */
134
+ contactId?: string | null;
135
+ }
136
+ export interface CreateReservationRequest {
137
+ /** Reservation details. */
138
+ reservation: Reservation;
139
+ /** Ignore table combination conflicts. This will ensure that the reservation is created even if the required tables are already reserved. */
140
+ ignoreTableCombinationConflicts?: TableCombinationConflictType[];
141
+ /** Ignore reservation location conflicts. This will ensure that the reservation is created even if the required seats or tables are unavailable according to the reservation location's business schedule or its pacing settings. */
142
+ ignoreReservationLocationConflicts?: Type[];
143
+ }
144
+ export declare enum TableCombinationConflictType {
145
+ UNKNOWN = "UNKNOWN",
146
+ RESERVED = "RESERVED",
147
+ TOO_BIG = "TOO_BIG",
148
+ TOO_SMALL = "TOO_SMALL",
149
+ OFFLINE_ONLY = "OFFLINE_ONLY"
150
+ }
151
+ export declare enum Type {
152
+ UNKNOWN = "UNKNOWN",
153
+ PARTY_PACING = "PARTY_PACING",
154
+ SEAT_PACING = "SEAT_PACING"
155
+ }
156
+ export interface CreateReservationResponse {
157
+ /** Reservation. */
158
+ reservation?: Reservation;
159
+ }
160
+ export interface ReservationDetailsConflicts {
161
+ /** Table combinations conflicts. */
162
+ tableCombinationConflicts?: TableCombinationConflict[];
163
+ /** Reservation location conflicts. */
164
+ reservationLocationConflicts?: ReservationLocationConflict[];
165
+ }
166
+ export interface TableCombinationConflict {
167
+ /** Conflict type. */
168
+ type?: TableCombinationConflictType;
169
+ }
170
+ export interface ReservationLocationConflict {
171
+ /** Reservation location conflict type. */
172
+ type?: Type;
173
+ }
174
+ export interface GetReservationRequest {
175
+ /** Reservation ID. */
176
+ reservationId: string;
177
+ /**
178
+ * Array of named, predefined sets of projected fields to be returned.
179
+ *
180
+ * Supported values: `PUBLIC`, `FULL`.
181
+ */
182
+ fieldsets?: Set[];
183
+ }
184
+ export declare enum Set {
185
+ PUBLIC = "PUBLIC",
186
+ FULL = "FULL"
187
+ }
188
+ export interface GetReservationResponse {
189
+ /** Reservation. */
190
+ reservation?: Reservation;
191
+ }
192
+ export interface UpdateReservationRequest {
193
+ /** Reservation information to update. */
194
+ reservation: Reservation;
195
+ /** Ignored table combination conflicts. This will ensure that the reservation is updated even if the required tables are already reserved. */
196
+ ignoreTableCombinationConflicts?: TableCombinationConflictType[];
197
+ /** Ignored reservation location conflicts. This will ensure that the reservation is updated even if the required seats or tables are unavailable according to the reservation location's business schedule or its pacing settings. */
198
+ ignoreReservationLocationConflicts?: Type[];
199
+ }
200
+ export interface UpdateReservationResponse {
201
+ /** Reservation. */
202
+ reservation?: Reservation;
203
+ }
204
+ export interface ReservationDataUpdated {
205
+ /** Reserved reservation. */
206
+ reservation?: Reservation;
207
+ /** Old reservation. */
208
+ oldReservation?: Reservation;
209
+ }
210
+ export interface CreateHeldReservationRequest {
211
+ /** `HELD` reservation information to update. */
212
+ reservationDetails: HeldReservationDetails;
213
+ }
214
+ /** Reservation details when create reservation in status HELD. */
215
+ export interface HeldReservationDetails {
216
+ /** ID of the reservation location where the reservation is made. */
217
+ reservationLocationId?: string | null;
218
+ /** Start date and time of the reservation. */
219
+ startDate?: Date;
220
+ /** Party size. */
221
+ partySize?: number | null;
222
+ }
223
+ export interface CreateHeldReservationResponse {
224
+ /** Reservation. */
225
+ reservation?: Reservation;
226
+ }
227
+ export interface ReserveReservationRequest {
228
+ /** Reservation ID. */
229
+ reservationId: string;
230
+ /** Reservee details. */
231
+ reservee: Reservee;
232
+ /**
233
+ * Revision number.
234
+ *
235
+ * Include the existing `revision` to prevent conflicting updates to reservations.
236
+ */
237
+ revision: string | null;
238
+ }
239
+ export interface ReserveReservationResponse {
240
+ /** Reservation. */
241
+ reservation?: Reservation;
242
+ }
243
+ export interface ReservationReserved {
244
+ /** Reserved reservation. */
245
+ reservation?: Reservation;
246
+ }
247
+ export interface CancelReservationRequest {
248
+ /** Reservation ID. */
249
+ reservationId: string;
250
+ /**
251
+ * Revision number.
252
+ *
253
+ * Include the existing `revision` to prevent conflicting updates to reservations.
254
+ */
255
+ revision: string | null;
256
+ /** Phone number that was used when the reservation was created. */
257
+ phone?: string | null;
258
+ }
259
+ export interface CancelReservationResponse {
260
+ /** Reservation. */
261
+ reservation?: Reservation;
262
+ }
263
+ export interface ReservationCanceled {
264
+ /** Reserved reservation. */
265
+ reservation?: Reservation;
266
+ }
267
+ export interface DeleteReservationRequest {
268
+ /** Reservation ID. */
269
+ reservationId?: string;
270
+ revision?: string;
271
+ }
272
+ export interface DeleteReservationResponse {
273
+ }
274
+ export interface ListReservationsRequest {
275
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
276
+ paging?: CursorPaging;
277
+ /** The way how reservations in response should be sorted. */
278
+ sort?: Sorting;
279
+ /** Start date from. */
280
+ startDateFrom?: Date;
281
+ /** Start date to. */
282
+ startDateTo?: Date;
283
+ /** Only reservations with this status should be returned. */
284
+ status?: Status;
285
+ }
286
+ export interface CursorPaging {
287
+ /** Number of items to load. */
288
+ limit?: number | null;
289
+ /**
290
+ * Pointer to the next or previous page in the list of results.
291
+ *
292
+ * You can get the relevant cursor token
293
+ * from the `pagingMetadata` object in the previous call's response.
294
+ * Not relevant for the first request.
295
+ */
296
+ cursor?: string | null;
297
+ }
298
+ export interface Sorting {
299
+ /** Name of the field to sort by. */
300
+ fieldName?: string;
301
+ /**
302
+ * Sort order.
303
+ *
304
+ * Use `ASC` for ascending order or `DESC` for descending order. Defaults to `ASC`.
305
+ */
306
+ order?: SortOrder;
307
+ }
308
+ export declare enum SortOrder {
309
+ ASC = "ASC",
310
+ DESC = "DESC"
311
+ }
312
+ export interface ListReservationsResponse {
313
+ /** List of reservations. */
314
+ reservations?: Reservation[];
315
+ /** Metadata for the paginated results. */
316
+ pagingMetadata?: CursorPagingMetadata;
317
+ }
318
+ export interface CursorPagingMetadata {
319
+ /** Number of items returned in the response. */
320
+ count?: number | null;
321
+ /** Offset that was requested. */
322
+ cursors?: Cursors;
323
+ /**
324
+ * Indicates if there are more results after the current page.
325
+ * If `true`, another page of results can be retrieved.
326
+ * If `false`, this is the last page.
327
+ */
328
+ hasNext?: boolean | null;
329
+ }
330
+ export interface Cursors {
331
+ /** Cursor pointing to next page in the list of results. */
332
+ next?: string | null;
333
+ /** Cursor pointing to previous page in the list of results. */
334
+ prev?: string | null;
335
+ }
336
+ export interface QueryReservationsRequest {
337
+ /** Query to select reservations. */
338
+ query: CursorQuery;
339
+ }
340
+ export interface CursorQuery extends CursorQueryPagingMethodOneOf {
341
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
342
+ cursorPaging?: CursorPaging;
343
+ /**
344
+ * Filter object in the following format:
345
+ * `"filter" : {
346
+ * "fieldName1": "value1",
347
+ * "fieldName2":{"$operator":"value2"}
348
+ * }`
349
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
350
+ */
351
+ filter?: Record<string, any> | null;
352
+ /**
353
+ * Sort object in the following format:
354
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
355
+ */
356
+ sort?: Sorting[];
357
+ }
358
+ /** @oneof */
359
+ export interface CursorQueryPagingMethodOneOf {
360
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
361
+ cursorPaging?: CursorPaging;
362
+ }
363
+ export interface QueryReservationsResponse {
364
+ /** List of reservations. */
365
+ reservations?: Reservation[];
366
+ /** Metadata for the paginated results. */
367
+ pagingMetadata?: CursorPagingMetadata;
368
+ }
369
+ export interface DomainEvent extends DomainEventBodyOneOf {
370
+ createdEvent?: EntityCreatedEvent;
371
+ updatedEvent?: EntityUpdatedEvent;
372
+ deletedEvent?: EntityDeletedEvent;
373
+ actionEvent?: ActionEvent;
374
+ /**
375
+ * Unique event ID.
376
+ * Allows clients to ignore duplicate webhooks.
377
+ */
378
+ _id?: string;
379
+ /**
380
+ * Assumes actions are also always typed to an entity_type
381
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
382
+ */
383
+ entityFqdn?: string;
384
+ /**
385
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
386
+ * This is although the created/updated/deleted notion is duplication of the oneof types
387
+ * Example: created/updated/deleted/started/completed/email_opened
388
+ */
389
+ slug?: string;
390
+ /** ID of the entity associated with the event. */
391
+ entityId?: string;
392
+ /** Event timestamp. */
393
+ eventTime?: Date;
394
+ /**
395
+ * Whether the event was triggered as a result of a privacy regulation application
396
+ * (for example, GDPR).
397
+ */
398
+ triggeredByAnonymizeRequest?: boolean | null;
399
+ /** If present, indicates the action that triggered the event. */
400
+ originatedFrom?: string | null;
401
+ /**
402
+ * A sequence number defining the order of updates to the underlying entity.
403
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
404
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
405
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
406
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
407
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
408
+ */
409
+ entityEventSequence?: string | null;
410
+ }
411
+ /** @oneof */
412
+ export interface DomainEventBodyOneOf {
413
+ createdEvent?: EntityCreatedEvent;
414
+ updatedEvent?: EntityUpdatedEvent;
415
+ deletedEvent?: EntityDeletedEvent;
416
+ actionEvent?: ActionEvent;
417
+ }
418
+ export interface EntityCreatedEvent {
419
+ entityAsJson?: string;
420
+ }
421
+ export interface EntityUpdatedEvent {
422
+ /**
423
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
424
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
425
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
426
+ */
427
+ currentEntityAsJson?: string;
428
+ }
429
+ export interface EntityDeletedEvent {
430
+ }
431
+ export interface ActionEvent {
432
+ bodyAsJson?: string;
433
+ }
434
+ export interface Empty {
435
+ }
436
+ export interface CreateReservationResponseNonNullableFields {
437
+ reservation?: {
438
+ status: Status;
439
+ source: Source;
440
+ };
441
+ }
442
+ export interface GetReservationResponseNonNullableFields {
443
+ reservation?: {
444
+ status: Status;
445
+ source: Source;
446
+ };
447
+ }
448
+ export interface UpdateReservationResponseNonNullableFields {
449
+ reservation?: {
450
+ status: Status;
451
+ source: Source;
452
+ };
453
+ }
454
+ export interface CreateHeldReservationResponseNonNullableFields {
455
+ reservation?: {
456
+ status: Status;
457
+ source: Source;
458
+ };
459
+ }
460
+ export interface ReserveReservationResponseNonNullableFields {
461
+ reservation?: {
462
+ status: Status;
463
+ source: Source;
464
+ };
465
+ }
466
+ export interface CancelReservationResponseNonNullableFields {
467
+ reservation?: {
468
+ status: Status;
469
+ source: Source;
470
+ };
471
+ }
472
+ export interface ListReservationsResponseNonNullableFields {
473
+ reservations: {
474
+ status: Status;
475
+ source: Source;
476
+ }[];
477
+ }
478
+ export interface QueryReservationsResponseNonNullableFields {
479
+ reservations: {
480
+ status: Status;
481
+ source: Source;
482
+ }[];
483
+ }
484
+ /**
485
+ * Creates a new reservation.
486
+ * `Create Reservation` creates a reservation with the status of your choice. Generally, a reservation should be created with either the `RESERVED` status or the `REQUESTED` status if manual approval is required for confirmation.
487
+ * `Create Reservation` gives you the option to override the restaurant’s rules regarding online availability (using `ignoreReservationLocationConflicts`) and table management (using `ignoreTableCombinationConflicts`.)
488
+ * @param reservation - Reservation details.
489
+ * @public
490
+ * @documentationMaturity preview
491
+ * @requiredField reservation
492
+ * @requiredField reservation.details
493
+ * @requiredField reservation.details.partySize
494
+ * @requiredField reservation.details.reservationLocationId
495
+ * @requiredField reservation.details.startDate
496
+ * @applicableIdentity MEMBER
497
+ * @applicableIdentity VISITOR
498
+ */
499
+ export declare function createReservation(reservation: Reservation, options?: CreateReservationOptions): Promise<CreateReservationResponse & CreateReservationResponseNonNullableFields>;
500
+ export interface CreateReservationOptions {
501
+ /** Ignore table combination conflicts. This will ensure that the reservation is created even if the required tables are already reserved. */
502
+ ignoreTableCombinationConflicts?: TableCombinationConflictType[];
503
+ /** Ignore reservation location conflicts. This will ensure that the reservation is created even if the required seats or tables are unavailable according to the reservation location's business schedule or its pacing settings. */
504
+ ignoreReservationLocationConflicts?: Type[];
505
+ }
506
+ /**
507
+ * Retrieves a reservation.
508
+ * @param reservationId - Reservation ID.
509
+ * @public
510
+ * @documentationMaturity preview
511
+ * @requiredField reservationId
512
+ * @applicableIdentity MEMBER
513
+ * @applicableIdentity VISITOR
514
+ */
515
+ export declare function getReservation(reservationId: string, options?: GetReservationOptions): Promise<GetReservationResponse & GetReservationResponseNonNullableFields>;
516
+ export interface GetReservationOptions {
517
+ /**
518
+ * Array of named, predefined sets of projected fields to be returned.
519
+ *
520
+ * Supported values: `PUBLIC`, `FULL`.
521
+ */
522
+ fieldsets?: Set[];
523
+ }
524
+ /**
525
+ * Each time the reservation is updated, revision increments by 1. The existing revision must be included when updating the reservation. This ensures you're working with the latest reservation information, and it prevents unintended overwrites.
526
+ * @param _id - Reservation ID. Read-Only.
527
+ * @public
528
+ * @documentationMaturity preview
529
+ * @requiredField _id
530
+ * @requiredField reservation
531
+ * @requiredField reservation.revision
532
+ */
533
+ export declare function updateReservation(_id: string | null, reservation: UpdateReservation, options?: UpdateReservationOptions): Promise<UpdateReservationResponse & UpdateReservationResponseNonNullableFields>;
534
+ export interface UpdateReservation {
535
+ /**
536
+ * Reservation ID. Read-Only.
537
+ * @readonly
538
+ */
539
+ _id?: string | null;
540
+ /** Status of the reservation. See the [Reservation Lifecycle article]() for more details on each of the statuses, and an explanations of the reservation lifecycle. */
541
+ status?: Status;
542
+ /**
543
+ * Reservation source.
544
+ *
545
+ * This indicates how the reservation was made.
546
+ * `ONLINE` indicates that the customer made the reservation through a website or app.
547
+ * `OFFLINE` indicates that the reservation was made by a restaurant employee, for example when a customer calls to make a reservation.
548
+ * `WALK-IN` indicates that the customer did not make a reservation beforehand, and the reservation was entered into the system by a restaurant employee when the customer arrived at the restaurant.
549
+ */
550
+ source?: Source;
551
+ /** Reservation details. */
552
+ details?: Details;
553
+ /** Information about the person the reservation is being made for. */
554
+ reservee?: Reservee;
555
+ /**
556
+ * Information about the person making the reservation.
557
+ * @readonly
558
+ */
559
+ reservedBy?: ReservedBy;
560
+ /**
561
+ * Team message.
562
+ *
563
+ * A message for the restaurant staff containing any additional information regarding the reservation, such as special requirements for the guests.
564
+ */
565
+ teamMessage?: string | null;
566
+ /**
567
+ * Date and time when the when the reservation was created.
568
+ * @readonly
569
+ */
570
+ _createdDate?: Date;
571
+ /**
572
+ * Date and time when the when the reservation was changed.
573
+ * @readonly
574
+ */
575
+ _updatedDate?: Date;
576
+ /**
577
+ * Revision number, which increments by 1 each time the reservation is updated.
578
+ * To prevent conflicting changes, the current revision must be passed when updating the reservation.
579
+ *
580
+ * Ignored when creating a reservation.
581
+ * @readonly
582
+ */
583
+ revision?: string | null;
584
+ /** The reason the reservation was declined. */
585
+ declineReason?: string | null;
586
+ }
587
+ export interface UpdateReservationOptions {
588
+ /** Ignored table combination conflicts. This will ensure that the reservation is updated even if the required tables are already reserved. */
589
+ ignoreTableCombinationConflicts?: TableCombinationConflictType[];
590
+ /** Ignored reservation location conflicts. This will ensure that the reservation is updated even if the required seats or tables are unavailable according to the reservation location's business schedule or its pacing settings. */
591
+ ignoreReservationLocationConflicts?: Type[];
592
+ }
593
+ /**
594
+ * Creates a new reservation with the `HELD` status.
595
+ *
596
+ * Reservations with the `HELD` status are only valid for 10 minutes. Trying to change a `HELD` reservation’s status after 10 minutes returns an error.
597
+ *
598
+ * You cannot call [`Update Reservation`](#update-reservation) to change a reservation’s status from `HELD`. Trying to do so will return an error.
599
+ * @param reservationDetails - `HELD` reservation information to update.
600
+ * @public
601
+ * @documentationMaturity preview
602
+ * @requiredField reservationDetails
603
+ * @requiredField reservationDetails.partySize
604
+ * @requiredField reservationDetails.reservationLocationId
605
+ * @requiredField reservationDetails.startDate
606
+ * @applicableIdentity MEMBER
607
+ * @applicableIdentity VISITOR
608
+ */
609
+ export declare function createHeldReservation(reservationDetails: HeldReservationDetails): Promise<CreateHeldReservationResponse & CreateHeldReservationResponseNonNullableFields>;
610
+ /**
611
+ * Reserves or requests a `HELD` reservation.
612
+ *
613
+ * `Reserve Reservation` changes a reservation's `HELD` status to `RESERVED`, or to `REQUESTED` if the reservation's reservation location requires manual approval.
614
+ * @param reservationId - Reservation ID.
615
+ * @param reservee - Reservee details.
616
+ * @param revision - Revision number.
617
+ *
618
+ * Include the existing `revision` to prevent conflicting updates to reservations.
619
+ * @public
620
+ * @documentationMaturity preview
621
+ * @requiredField reservationId
622
+ * @requiredField reservee
623
+ * @requiredField reservee.firstName
624
+ * @requiredField reservee.phone
625
+ * @requiredField revision
626
+ * @applicableIdentity MEMBER
627
+ * @applicableIdentity VISITOR
628
+ */
629
+ export declare function reserveReservation(reservationId: string, reservee: Reservee, revision: string | null): Promise<ReserveReservationResponse & ReserveReservationResponseNonNullableFields>;
630
+ /**
631
+ * Cancels a reservation.
632
+ *
633
+ * Sets the reservation status to `CANCELED`.
634
+ * @param reservationId - Reservation ID.
635
+ * @param revision - Revision number.
636
+ *
637
+ * Include the existing `revision` to prevent conflicting updates to reservations.
638
+ * @public
639
+ * @documentationMaturity preview
640
+ * @requiredField reservationId
641
+ * @requiredField revision
642
+ * @applicableIdentity MEMBER
643
+ * @applicableIdentity VISITOR
644
+ */
645
+ export declare function cancelReservation(reservationId: string, revision: string | null, options?: CancelReservationOptions): Promise<CancelReservationResponse & CancelReservationResponseNonNullableFields>;
646
+ export interface CancelReservationOptions {
647
+ /** Phone number that was used when the reservation was created. */
648
+ phone?: string | null;
649
+ }
650
+ /**
651
+ * Retrieves a list of up to 100 reservations.
652
+ * @public
653
+ * @documentationMaturity preview
654
+ */
655
+ export declare function listReservations(options?: ListReservationsOptions): Promise<ListReservationsResponse & ListReservationsResponseNonNullableFields>;
656
+ export interface ListReservationsOptions {
657
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
658
+ paging?: CursorPaging;
659
+ /** The way how reservations in response should be sorted. */
660
+ sort?: Sorting;
661
+ /** Start date from. */
662
+ startDateFrom?: Date;
663
+ /** Start date to. */
664
+ startDateTo?: Date;
665
+ /** Only reservations with this status should be returned. */
666
+ status?: Status;
667
+ }
668
+ /**
669
+ * Retrieves a list of up to 100 reservations, given the provided filters, sorting, and paging.
670
+ * @public
671
+ * @documentationMaturity preview
672
+ */
673
+ export declare function queryReservations(): ReservationsQueryBuilder;
674
+ interface QueryCursorResult {
675
+ cursors: Cursors;
676
+ hasNext: () => boolean;
677
+ hasPrev: () => boolean;
678
+ length: number;
679
+ pageSize: number;
680
+ }
681
+ export interface ReservationsQueryResult extends QueryCursorResult {
682
+ items: Reservation[];
683
+ query: ReservationsQueryBuilder;
684
+ next: () => Promise<ReservationsQueryResult>;
685
+ prev: () => Promise<ReservationsQueryResult>;
686
+ }
687
+ export interface ReservationsQueryBuilder {
688
+ /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
689
+ * @documentationMaturity preview
690
+ */
691
+ limit: (limit: number) => ReservationsQueryBuilder;
692
+ /** @param cursor - A pointer to specific record
693
+ * @documentationMaturity preview
694
+ */
695
+ skipTo: (cursor: string) => ReservationsQueryBuilder;
696
+ /** @documentationMaturity preview */
697
+ find: () => Promise<ReservationsQueryResult>;
698
+ }
699
+ export {};