@wix/table-reservations 1.0.77 → 1.0.79

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 (133) hide show
  1. package/build/cjs/context.d.ts +3 -3
  2. package/build/cjs/context.js +3 -3
  3. package/build/cjs/context.js.map +1 -1
  4. package/build/cjs/index.d.ts +3 -3
  5. package/build/cjs/index.js +3 -3
  6. package/build/cjs/index.js.map +1 -1
  7. package/build/cjs/meta.d.ts +3 -3
  8. package/build/cjs/meta.js +3 -3
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/context.d.ts +3 -3
  11. package/build/es/context.js +3 -3
  12. package/build/es/context.js.map +1 -1
  13. package/build/es/index.d.ts +3 -3
  14. package/build/es/index.js +3 -3
  15. package/build/es/index.js.map +1 -1
  16. package/build/es/meta.d.ts +3 -3
  17. package/build/es/meta.js +3 -3
  18. package/build/es/meta.js.map +1 -1
  19. package/package.json +13 -9
  20. package/build/cjs/index.typings.d.ts +0 -3
  21. package/build/cjs/index.typings.js +0 -30
  22. package/build/cjs/index.typings.js.map +0 -1
  23. package/build/cjs/src/table-reservations-v1-reservation-location.context.d.ts +0 -6
  24. package/build/cjs/src/table-reservations-v1-reservation-location.context.js +0 -73
  25. package/build/cjs/src/table-reservations-v1-reservation-location.context.js.map +0 -1
  26. package/build/cjs/src/table-reservations-v1-reservation-location.http.d.ts +0 -40
  27. package/build/cjs/src/table-reservations-v1-reservation-location.http.js +0 -266
  28. package/build/cjs/src/table-reservations-v1-reservation-location.http.js.map +0 -1
  29. package/build/cjs/src/table-reservations-v1-reservation-location.meta.d.ts +0 -20
  30. package/build/cjs/src/table-reservations-v1-reservation-location.meta.js +0 -106
  31. package/build/cjs/src/table-reservations-v1-reservation-location.meta.js.map +0 -1
  32. package/build/cjs/src/table-reservations-v1-reservation-location.public.d.ts +0 -178
  33. package/build/cjs/src/table-reservations-v1-reservation-location.public.js +0 -48
  34. package/build/cjs/src/table-reservations-v1-reservation-location.public.js.map +0 -1
  35. package/build/cjs/src/table-reservations-v1-reservation-location.types.d.ts +0 -2260
  36. package/build/cjs/src/table-reservations-v1-reservation-location.types.js +0 -187
  37. package/build/cjs/src/table-reservations-v1-reservation-location.types.js.map +0 -1
  38. package/build/cjs/src/table-reservations-v1-reservation-location.universal.d.ts +0 -2333
  39. package/build/cjs/src/table-reservations-v1-reservation-location.universal.js +0 -613
  40. package/build/cjs/src/table-reservations-v1-reservation-location.universal.js.map +0 -1
  41. package/build/cjs/src/table-reservations-v1-reservation.context.d.ts +0 -11
  42. package/build/cjs/src/table-reservations-v1-reservation.context.js +0 -158
  43. package/build/cjs/src/table-reservations-v1-reservation.context.js.map +0 -1
  44. package/build/cjs/src/table-reservations-v1-reservation.http.d.ts +0 -89
  45. package/build/cjs/src/table-reservations-v1-reservation.http.js +0 -508
  46. package/build/cjs/src/table-reservations-v1-reservation.http.js.map +0 -1
  47. package/build/cjs/src/table-reservations-v1-reservation.meta.d.ts +0 -29
  48. package/build/cjs/src/table-reservations-v1-reservation.meta.js +0 -199
  49. package/build/cjs/src/table-reservations-v1-reservation.meta.js.map +0 -1
  50. package/build/cjs/src/table-reservations-v1-reservation.public.d.ts +0 -26
  51. package/build/cjs/src/table-reservations-v1-reservation.public.js +0 -78
  52. package/build/cjs/src/table-reservations-v1-reservation.public.js.map +0 -1
  53. package/build/cjs/src/table-reservations-v1-reservation.types.d.ts +0 -976
  54. package/build/cjs/src/table-reservations-v1-reservation.types.js +0 -119
  55. package/build/cjs/src/table-reservations-v1-reservation.types.js.map +0 -1
  56. package/build/cjs/src/table-reservations-v1-reservation.universal.d.ts +0 -1382
  57. package/build/cjs/src/table-reservations-v1-reservation.universal.js +0 -872
  58. package/build/cjs/src/table-reservations-v1-reservation.universal.js.map +0 -1
  59. package/build/cjs/src/table-reservations-v1-time-slot.context.d.ts +0 -3
  60. package/build/cjs/src/table-reservations-v1-time-slot.context.js +0 -22
  61. package/build/cjs/src/table-reservations-v1-time-slot.context.js.map +0 -1
  62. package/build/cjs/src/table-reservations-v1-time-slot.http.d.ts +0 -13
  63. package/build/cjs/src/table-reservations-v1-time-slot.http.js +0 -126
  64. package/build/cjs/src/table-reservations-v1-time-slot.http.js.map +0 -1
  65. package/build/cjs/src/table-reservations-v1-time-slot.meta.d.ts +0 -13
  66. package/build/cjs/src/table-reservations-v1-time-slot.meta.js +0 -47
  67. package/build/cjs/src/table-reservations-v1-time-slot.meta.js.map +0 -1
  68. package/build/cjs/src/table-reservations-v1-time-slot.public.d.ts +0 -8
  69. package/build/cjs/src/table-reservations-v1-time-slot.public.js +0 -17
  70. package/build/cjs/src/table-reservations-v1-time-slot.public.js.map +0 -1
  71. package/build/cjs/src/table-reservations-v1-time-slot.types.d.ts +0 -137
  72. package/build/cjs/src/table-reservations-v1-time-slot.types.js +0 -32
  73. package/build/cjs/src/table-reservations-v1-time-slot.types.js.map +0 -1
  74. package/build/cjs/src/table-reservations-v1-time-slot.universal.d.ts +0 -178
  75. package/build/cjs/src/table-reservations-v1-time-slot.universal.js +0 -166
  76. package/build/cjs/src/table-reservations-v1-time-slot.universal.js.map +0 -1
  77. package/build/es/index.typings.d.ts +0 -3
  78. package/build/es/index.typings.js +0 -4
  79. package/build/es/index.typings.js.map +0 -1
  80. package/build/es/src/table-reservations-v1-reservation-location.context.d.ts +0 -6
  81. package/build/es/src/table-reservations-v1-reservation-location.context.js +0 -66
  82. package/build/es/src/table-reservations-v1-reservation-location.context.js.map +0 -1
  83. package/build/es/src/table-reservations-v1-reservation-location.http.d.ts +0 -40
  84. package/build/es/src/table-reservations-v1-reservation-location.http.js +0 -259
  85. package/build/es/src/table-reservations-v1-reservation-location.http.js.map +0 -1
  86. package/build/es/src/table-reservations-v1-reservation-location.meta.d.ts +0 -20
  87. package/build/es/src/table-reservations-v1-reservation-location.meta.js +0 -76
  88. package/build/es/src/table-reservations-v1-reservation-location.meta.js.map +0 -1
  89. package/build/es/src/table-reservations-v1-reservation-location.public.d.ts +0 -178
  90. package/build/es/src/table-reservations-v1-reservation-location.public.js +0 -25
  91. package/build/es/src/table-reservations-v1-reservation-location.public.js.map +0 -1
  92. package/build/es/src/table-reservations-v1-reservation-location.types.d.ts +0 -2260
  93. package/build/es/src/table-reservations-v1-reservation-location.types.js +0 -184
  94. package/build/es/src/table-reservations-v1-reservation-location.types.js.map +0 -1
  95. package/build/es/src/table-reservations-v1-reservation-location.universal.d.ts +0 -2333
  96. package/build/es/src/table-reservations-v1-reservation-location.universal.js +0 -583
  97. package/build/es/src/table-reservations-v1-reservation-location.universal.js.map +0 -1
  98. package/build/es/src/table-reservations-v1-reservation.context.d.ts +0 -11
  99. package/build/es/src/table-reservations-v1-reservation.context.js +0 -146
  100. package/build/es/src/table-reservations-v1-reservation.context.js.map +0 -1
  101. package/build/es/src/table-reservations-v1-reservation.http.d.ts +0 -89
  102. package/build/es/src/table-reservations-v1-reservation.http.js +0 -496
  103. package/build/es/src/table-reservations-v1-reservation.http.js.map +0 -1
  104. package/build/es/src/table-reservations-v1-reservation.meta.d.ts +0 -29
  105. package/build/es/src/table-reservations-v1-reservation.meta.js +0 -164
  106. package/build/es/src/table-reservations-v1-reservation.meta.js.map +0 -1
  107. package/build/es/src/table-reservations-v1-reservation.public.d.ts +0 -26
  108. package/build/es/src/table-reservations-v1-reservation.public.js +0 -50
  109. package/build/es/src/table-reservations-v1-reservation.public.js.map +0 -1
  110. package/build/es/src/table-reservations-v1-reservation.types.d.ts +0 -976
  111. package/build/es/src/table-reservations-v1-reservation.types.js +0 -116
  112. package/build/es/src/table-reservations-v1-reservation.types.js.map +0 -1
  113. package/build/es/src/table-reservations-v1-reservation.universal.d.ts +0 -1382
  114. package/build/es/src/table-reservations-v1-reservation.universal.js +0 -837
  115. package/build/es/src/table-reservations-v1-reservation.universal.js.map +0 -1
  116. package/build/es/src/table-reservations-v1-time-slot.context.d.ts +0 -3
  117. package/build/es/src/table-reservations-v1-time-slot.context.js +0 -18
  118. package/build/es/src/table-reservations-v1-time-slot.context.js.map +0 -1
  119. package/build/es/src/table-reservations-v1-time-slot.http.d.ts +0 -13
  120. package/build/es/src/table-reservations-v1-time-slot.http.js +0 -122
  121. package/build/es/src/table-reservations-v1-time-slot.http.js.map +0 -1
  122. package/build/es/src/table-reservations-v1-time-slot.meta.d.ts +0 -13
  123. package/build/es/src/table-reservations-v1-time-slot.meta.js +0 -20
  124. package/build/es/src/table-reservations-v1-time-slot.meta.js.map +0 -1
  125. package/build/es/src/table-reservations-v1-time-slot.public.d.ts +0 -8
  126. package/build/es/src/table-reservations-v1-time-slot.public.js +0 -9
  127. package/build/es/src/table-reservations-v1-time-slot.public.js.map +0 -1
  128. package/build/es/src/table-reservations-v1-time-slot.types.d.ts +0 -137
  129. package/build/es/src/table-reservations-v1-time-slot.types.js +0 -29
  130. package/build/es/src/table-reservations-v1-time-slot.types.js.map +0 -1
  131. package/build/es/src/table-reservations-v1-time-slot.universal.d.ts +0 -178
  132. package/build/es/src/table-reservations-v1-time-slot.universal.js +0 -139
  133. package/build/es/src/table-reservations-v1-time-slot.universal.js.map +0 -1
@@ -1,1382 +0,0 @@
1
- import { EventDefinition } from '@wix/sdk-types';
2
- /** The reservation domain object. */
3
- export interface Reservation {
4
- /**
5
- * Reservation ID.
6
- * @readonly
7
- */
8
- _id?: string | null;
9
- /**
10
- * Status of the reservation.
11
- *
12
- * Supported values:
13
- *
14
- * * `HELD`: The reservation is temporary and will expire in 10 minutes if its status isn’t changed. This phase temporarily reserves the required number of seats and tables for a given party size at a chosen time while a customer enters details and/or confirms their reservation request.
15
- * * `REQUESTED`: A customer finished requesting this reservation, meaning they have added all necessary details and confirmed the request. Restaurant staff can now either approve or decline the reservation request.
16
- * * `DECLINED`: The restaurant’s owner or staff declined the customer’s request to make the reservation.
17
- * * `RESERVED`: The reservation is confirmed.
18
- * * `SEATED`: The customer is currently occupying the table.
19
- * * `CANCELED`: The reservation is canceled.
20
- * * `NO_SHOW`: The customer didn't show up for their reservation.
21
- * * `FINISHED`: The reservation completed successfully.
22
- *
23
- *
24
- * See the article for this API titled "The Reservation Lifecycle" in the menu on the left for more details on each of the statuses, and an explanation of the reservation lifecycle.
25
- */
26
- status?: Status;
27
- /**
28
- * Reservation source.
29
- *
30
- * This indicates how the reservation was made.
31
- * * `ONLINE` indicates that the customer made the reservation through a website or app.
32
- * * `OFFLINE` indicates that the reservation was made by a restaurant employee, for example when a customer calls to make a reservation.
33
- * * `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.
34
- */
35
- source?: Source;
36
- /** Reservation details. */
37
- details?: Details;
38
- /**
39
- * Information about the person the reservation is being made for.
40
- *
41
- * A reservation created with any `source` other than `WALK_IN` requires the `reservation.reservee.phone` and `reservation.reservee.firstName` fields.
42
- * Attempting to create a reservation without these fields results in an error.
43
- */
44
- reservee?: Reservee;
45
- /**
46
- * Information about the person making the reservation.
47
- *
48
- * This field is required if the reservation's `status` is anything other than `WALK_IN`.
49
- * @readonly
50
- */
51
- reservedBy?: ReservedBy;
52
- /**
53
- * Team message.
54
- *
55
- * A message for the restaurant staff containing any additional information regarding the reservation, such as special requirements for the guests.
56
- */
57
- teamMessage?: string | null;
58
- /**
59
- * Date and time the reservation was created.
60
- * @readonly
61
- */
62
- _createdDate?: Date;
63
- /**
64
- * Date and time the reservation was changed.
65
- * @readonly
66
- */
67
- _updatedDate?: Date;
68
- /**
69
- * Revision number, which increments by 1 each time the reservation is updated.
70
- * To prevent conflicting changes, the current revision must be passed when updating the reservation.
71
- *
72
- * Ignored when creating a reservation.
73
- * @readonly
74
- */
75
- revision?: string | null;
76
- /** The reason the reservation was declined. */
77
- declineReason?: string | null;
78
- }
79
- export declare enum Status {
80
- UNKNOWN = "UNKNOWN",
81
- /** The reservation is held for 10 minutes, during which time the reservee should fill in their details. */
82
- HELD = "HELD",
83
- /** The reservation has been reserved. */
84
- RESERVED = "RESERVED",
85
- /** The reservation has been canceled. */
86
- CANCELED = "CANCELED",
87
- /** The reservation has finished successfully. */
88
- FINISHED = "FINISHED",
89
- /** The reservee didn't arrive. */
90
- NO_SHOW = "NO_SHOW",
91
- /** The reservee occupied the table. */
92
- SEATED = "SEATED",
93
- /** The reservee requested a reservation and is waiting for manual approval. */
94
- REQUESTED = "REQUESTED",
95
- /** The owner declined a reservee's request. */
96
- DECLINED = "DECLINED",
97
- /** The reservation is held for 10 minutes from the created time, during which time the reservee should pay. After payment is completed status will be changed automatically to RESERVED. */
98
- PAYMENT_PENDING = "PAYMENT_PENDING"
99
- }
100
- export declare enum Source {
101
- UNKNOWN = "UNKNOWN",
102
- /** The reservation is created by a User. */
103
- OFFLINE = "OFFLINE",
104
- /** The reservation is created by UoU. */
105
- ONLINE = "ONLINE",
106
- /** The reservation is created by a User. It can be created without reservee data. */
107
- WALK_IN = "WALK_IN"
108
- }
109
- /** Reservation details. */
110
- export interface Details {
111
- /** ID of the reservation location at which this reservation will be made. */
112
- reservationLocationId?: string | null;
113
- /** IDs of tables used for this reservation. */
114
- tableIds?: string[] | null;
115
- /** Start date and time of the reservation. */
116
- startDate?: Date;
117
- /** End date and time of the reservation. */
118
- endDate?: Date;
119
- /** Party size. */
120
- partySize?: number | null;
121
- }
122
- /** The person the reservation is being made for. */
123
- export interface Reservee {
124
- /**
125
- * First name.
126
- *
127
- * This field is required if the reservation's `status` is anything other than `WALK_IN`.
128
- */
129
- firstName?: string | null;
130
- /** Last name. */
131
- lastName?: string | null;
132
- /** Email address. */
133
- email?: string | null;
134
- /**
135
- * Phone number.
136
- *
137
- * This property should begin with a +, followed by the country code, and then the rest of the phone number. For example, `"+972555555555"`.
138
- *
139
- * This field is required if the reservation's `status` is anything other than `WALK_IN`.
140
- */
141
- phone?: string | null;
142
- /** Whether the reservee has given marketing consent. */
143
- marketingConsent?: boolean | null;
144
- /**
145
- * Custom fields for the reservee in key-value pairs.
146
- *
147
- * The key is the custom field's ID, and the value is the custom field's value. For example, a custom field for allergies might have the key-value pair `f4283b2d-6340-4cf9-bae7-8769e6b62127 : "Nuts, Seafood"`.
148
- *
149
- * Empty fields are not returned.
150
- */
151
- customFields?: Record<string, any> | null;
152
- /**
153
- * Contact ID. If a contact with this ID does not exist on the site, one will be created.
154
- * @readonly
155
- */
156
- contactId?: string | null;
157
- }
158
- /** A person making reservation. */
159
- export interface ReservedBy {
160
- /**
161
- * 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.
162
- * @readonly
163
- */
164
- contactId?: string | null;
165
- }
166
- /** Migration note. */
167
- export interface MigrationNote {
168
- }
169
- /** Table with reservation conflicts. */
170
- export interface TableWithReservationConflicts {
171
- /** Table id. */
172
- tableId?: string;
173
- /** List of reservation ids. */
174
- reservationIds?: string[];
175
- }
176
- export interface CreateReservationRequest {
177
- /** Reservation details. */
178
- reservation: Reservation;
179
- /**
180
- * Ignore table combination conflicts of the types included in the array. This ensures that the reservation is created even if the given conflicts would normally prevent it.
181
- *
182
- * Possible values:
183
- * * `"RESERVED"`: One or more of the chosen tables are already reserved.
184
- * * `"TOO_BIG"`: The party is too big for the selected table.
185
- * * `"TOO_SMALL"`: The party is too small for the selected table.
186
- * * `"OFFLINE_ONLY"`: The restaurant does not allow online reservations.
187
- */
188
- ignoreTableCombinationConflicts?: TableCombinationConflictType[];
189
- /**
190
- * Ignored reservation location conflicts of the types included in the array. This ensures that the reservation is created even if the given conflicts would normally prevent it.
191
- *
192
- * Possible values:
193
- * * `"PARTY_PACING"`: The restaurant cannot accommodate a party of the given size according to party pacing settings.
194
- * * `"SEAT_PACING"`: The required number of seats are unavailable according to seat pacing settings.
195
- */
196
- ignoreReservationLocationConflicts?: Type[];
197
- }
198
- export declare enum TableCombinationConflictType {
199
- UNKNOWN = "UNKNOWN",
200
- RESERVED = "RESERVED",
201
- TOO_BIG = "TOO_BIG",
202
- TOO_SMALL = "TOO_SMALL",
203
- OFFLINE_ONLY = "OFFLINE_ONLY"
204
- }
205
- export declare enum Type {
206
- UNKNOWN = "UNKNOWN",
207
- PARTY_PACING = "PARTY_PACING",
208
- SEAT_PACING = "SEAT_PACING"
209
- }
210
- export interface CreateReservationResponse {
211
- /** Reservation. */
212
- reservation?: Reservation;
213
- }
214
- export interface ReservationDetailsConflicts {
215
- /** Table combinations conflicts. */
216
- tableCombinationConflicts?: TableCombinationConflict[];
217
- /** Reservation location conflicts. */
218
- reservationLocationConflicts?: ReservationLocationConflict[];
219
- }
220
- export interface TableCombinationConflict {
221
- /** Conflict type. */
222
- type?: TableCombinationConflictType;
223
- }
224
- export interface ReservationLocationConflict {
225
- /** Reservation location conflict type. */
226
- type?: Type;
227
- }
228
- export interface GetReservationRequest {
229
- /** Reservation ID. */
230
- reservationId: string;
231
- /**
232
- * Array of named, predefined sets of projected fields to be returned.
233
- *
234
- * Supported values: `PUBLIC`, `FULL`.
235
- *
236
- * Calling this method with `fieldsets` set to `FULL` requires additional permissions. See this API's Introduction article for more information.
237
- */
238
- fieldsets?: Set[];
239
- }
240
- export declare enum Set {
241
- PUBLIC = "PUBLIC",
242
- FULL = "FULL"
243
- }
244
- export interface GetReservationResponse {
245
- /** Reservation. */
246
- reservation?: Reservation;
247
- }
248
- export interface UpdateReservationRequest {
249
- /** Reservation information to update. */
250
- reservation: Reservation;
251
- /**
252
- * Ignore table combination conflicts of the types included in the array. This ensures that the reservation is updated even if the given conflicts would normally prevent it.
253
- *
254
- * Possible values:
255
- * * `"RESERVED"`: One or more of the chosen tables are already reserved.
256
- * * `"TOO_BIG"`: The party is too big for the selected table.
257
- * * `"TOO_SMALL"`: The party is too small for the selected table.
258
- * * `"OFFLINE_ONLY"`: The restaurant does not allow online reservations.
259
- */
260
- ignoreTableCombinationConflicts?: TableCombinationConflictType[];
261
- /**
262
- * Ignored reservation location conflicts of the types included in the array. This ensures that the reservation is updated even if the given conflicts would normally prevent it.
263
- *
264
- * Possible values:
265
- * * `"PARTY_PACING"`: The restaurant cannot accommodate a party of the given size according to party pacing settings.
266
- * * `"SEAT_PACING"`: The required number of seats are unavailable according to seat pacing settings.
267
- */
268
- ignoreReservationLocationConflicts?: Type[];
269
- }
270
- export interface UpdateReservationResponse {
271
- /** Reservation. */
272
- reservation?: Reservation;
273
- }
274
- export interface ReservationDataUpdated {
275
- /** Reserved reservation. */
276
- reservation?: Reservation;
277
- /** Old reservation. */
278
- oldReservation?: Reservation;
279
- }
280
- export interface CreateHeldReservationRequest {
281
- /** Held reservation information to update. */
282
- reservationDetails: HeldReservationDetails;
283
- }
284
- /** Reservation details when create reservation in status HELD. */
285
- export interface HeldReservationDetails {
286
- /** ID of the reservation location where the reservation is made. */
287
- reservationLocationId?: string | null;
288
- /** Start date and time of the reservation. */
289
- startDate?: Date;
290
- /** Party size. */
291
- partySize?: number | null;
292
- }
293
- export interface CreateHeldReservationResponse {
294
- /** Reservation. */
295
- reservation?: Reservation;
296
- }
297
- export interface ReserveReservationRequest {
298
- /** Reservation ID. */
299
- reservationId: string;
300
- /** Reservee details. */
301
- reservee: Reservee;
302
- /**
303
- * Revision number.
304
- *
305
- * Include the existing `revision` to prevent conflicting updates to reservations.
306
- */
307
- revision: string | null;
308
- }
309
- export interface ReserveReservationResponse {
310
- /** Reservation. */
311
- reservation?: Reservation;
312
- }
313
- export interface ReservationReserved {
314
- /** Reserved reservation. */
315
- reservation?: Reservation;
316
- }
317
- export interface CancelReservationRequest {
318
- /** Reservation ID. */
319
- reservationId: string;
320
- /**
321
- * Revision number.
322
- *
323
- * Include the existing `revision` to prevent conflicting updates to reservations.
324
- */
325
- revision: string | null;
326
- /**
327
- * The phone number that was provided when the reservation was created.
328
- *
329
- * This is required for reservations with any `source` other than `WALK_IN`.
330
- *
331
- * This requirement provides additional security by ensuring that the canceling party knows both the reservation's `reservationId` and the reservee's `phone`.
332
- */
333
- phone?: string | null;
334
- }
335
- export interface CancelReservationResponse {
336
- /** Reservation. */
337
- reservation?: Reservation;
338
- }
339
- export interface ReservationCanceled {
340
- /** Reserved reservation. */
341
- reservation?: Reservation;
342
- }
343
- export interface DeleteReservationRequest {
344
- /** Reservation ID. */
345
- reservationId?: string;
346
- revision?: string;
347
- }
348
- export interface DeleteReservationResponse {
349
- }
350
- export interface ListReservationsRequest {
351
- /** 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`. */
352
- paging?: CursorPaging;
353
- /** Defines how reservations in the response are sorted. */
354
- sort?: Sorting;
355
- /** Only reservations starting after this date are returned. */
356
- startDateFrom?: Date;
357
- /** Only reservations starting before this date are returned. */
358
- startDateTo?: Date;
359
- /**
360
- * Only reservations with this status are returned.
361
- *
362
- * * `HELD`: The reservation is temporary and will expire in 10 minutes if its status isn’t changed. This phase temporarily reserves the required number of seats and tables for a given party size at a chosen time while a customer enters details and/or confirms their reservation request.
363
- * * `REQUESTED`: A customer finished requesting this reservation, meaning they have added all necessary details and confirmed the request. Restaurant staff can now either approve or decline the reservation request.
364
- * * `DECLINED`: The restaurant’s owner or staff declined the customer’s request to make the reservation.
365
- * * `RESERVED`: The reservation is confirmed.
366
- * * `SEATED`: The customer is currently occupying the table.
367
- * * `CANCELED`: The reservation is canceled.
368
- * * `NO_SHOW`: The customer didn't show up for their reservation.
369
- * * `FINISHED`: The reservation completed successfully.
370
- */
371
- status?: Status;
372
- }
373
- export interface CursorPaging {
374
- /** Number of items to load. */
375
- limit?: number | null;
376
- /**
377
- * Pointer to the next or previous page in the list of results.
378
- *
379
- * You can get the relevant cursor token
380
- * from the `pagingMetadata` object in the previous call's response.
381
- * Not relevant for the first request.
382
- */
383
- cursor?: string | null;
384
- }
385
- export interface Sorting {
386
- /** Name of the field to sort by. */
387
- fieldName?: string;
388
- /**
389
- * Sort order.
390
- *
391
- * Use `ASC` for ascending order or `DESC` for descending order. Defaults to `ASC`.
392
- */
393
- order?: SortOrder;
394
- }
395
- export declare enum SortOrder {
396
- ASC = "ASC",
397
- DESC = "DESC"
398
- }
399
- export interface ListReservationsResponse {
400
- /** List of reservations. */
401
- reservations?: Reservation[];
402
- /** Metadata for the paginated results. */
403
- pagingMetadata?: CursorPagingMetadata;
404
- }
405
- export interface CursorPagingMetadata {
406
- /** Number of items returned in the response. */
407
- count?: number | null;
408
- /** Offset that was requested. */
409
- cursors?: Cursors;
410
- /**
411
- * Indicates if there are more results after the current page.
412
- * If `true`, another page of results can be retrieved.
413
- * If `false`, this is the last page.
414
- */
415
- hasNext?: boolean | null;
416
- }
417
- export interface Cursors {
418
- /** Cursor pointing to next page in the list of results. */
419
- next?: string | null;
420
- /** Cursor pointing to previous page in the list of results. */
421
- prev?: string | null;
422
- }
423
- export interface QueryReservationsRequest {
424
- /** Query to select reservations. */
425
- query: CursorQuery;
426
- }
427
- export interface CursorQuery extends CursorQueryPagingMethodOneOf {
428
- /** 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`. */
429
- cursorPaging?: CursorPaging;
430
- /**
431
- * Filter object in the following format:
432
- * `"filter" : {
433
- * "fieldName1": "value1",
434
- * "fieldName2":{"$operator":"value2"}
435
- * }`
436
- *
437
- * For a detailed list of supported operations, see the [Supported Filters and Sorting](https://dev.wix.com/docs/rest/api-reference/wix-restaurants/reservations/reservations/sorting-and-filtering) article.
438
- * To learn how to query reservations, see [API Query Language](https://dev.wix.com/api/rest/getting-started/api-query-language).
439
- */
440
- filter?: Record<string, any> | null;
441
- /**
442
- * Sort object in the following format:
443
- * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
444
- */
445
- sort?: Sorting[];
446
- }
447
- /** @oneof */
448
- export interface CursorQueryPagingMethodOneOf {
449
- /** 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`. */
450
- cursorPaging?: CursorPaging;
451
- }
452
- export interface QueryReservationsResponse {
453
- /** List of reservations. */
454
- reservations?: Reservation[];
455
- /** Metadata for the paginated results. */
456
- pagingMetadata?: CursorPagingMetadata;
457
- }
458
- export interface SearchReservationsRequest {
459
- /** Search query. */
460
- search: CursorSearch;
461
- }
462
- export interface CursorSearch extends CursorSearchPagingMethodOneOf {
463
- /** Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can not be used together with 'filter' or 'sort' */
464
- cursorPaging?: CursorPaging;
465
- /** A filter object. See the filter section [here](https://dev.wix.com/docs/rnd-general/articles/p13n-guidelines-aips/guidance-aips/wix-api-basics/1011-wql-wix-query-language) */
466
- filter?: Record<string, any> | null;
467
- /** Sort object in the form [{"fieldName":"sortField1"},{"fieldName":"sortField2","direction":"DESC"}] */
468
- sort?: Sorting[];
469
- /** Aggregations | Faceted search: refers to a way to explore large amounts of data by displaying summaries about various partitions of the data and later allowing to narrow the navigation to a specific partition. */
470
- aggregations?: Aggregation[];
471
- /** free text to match in searchable fields */
472
- search?: SearchDetails;
473
- /** Time zone to adjust date-time-based filters and aggregations. ISO 8601 or IANA time zone database format. */
474
- timeZone?: string | null;
475
- }
476
- /** @oneof */
477
- export interface CursorSearchPagingMethodOneOf {
478
- /** Cursor pointing to page of results. Can't be used together with 'paging'. 'cursor_paging.cursor' can not be used together with 'filter' or 'sort' */
479
- cursorPaging?: CursorPaging;
480
- }
481
- export interface Aggregation extends AggregationKindOneOf {
482
- value?: ValueAggregation;
483
- range?: RangeAggregation;
484
- scalar?: ScalarAggregation;
485
- dateHistogram?: DateHistogramAggregation;
486
- nested?: NestedAggregation;
487
- name?: string | null;
488
- type?: AggregationType;
489
- fieldPath?: string;
490
- groupBy?: GroupByAggregation;
491
- }
492
- /** @oneof */
493
- export interface AggregationKindOneOf {
494
- value?: ValueAggregation;
495
- range?: RangeAggregation;
496
- scalar?: ScalarAggregation;
497
- dateHistogram?: DateHistogramAggregation;
498
- nested?: NestedAggregation;
499
- }
500
- export interface RangeBucket {
501
- /** Inclusive lower bound of the range. Required if to is not given. */
502
- from?: number | null;
503
- /** Exclusive upper bound of the range. Required if from is not given. */
504
- to?: number | null;
505
- }
506
- export declare enum SortType {
507
- COUNT = "COUNT",
508
- VALUE = "VALUE"
509
- }
510
- export declare enum SortDirection {
511
- DESC = "DESC",
512
- ASC = "ASC"
513
- }
514
- export declare enum MissingValues {
515
- EXCLUDE = "EXCLUDE",
516
- INCLUDE = "INCLUDE"
517
- }
518
- export interface IncludeMissingValuesOptions {
519
- /** can specify custom bucket name. Defaults are [string -> "N/A"], [int -> "0"], [bool -> "false"] ... */
520
- addToBucket?: string;
521
- }
522
- export declare enum ScalarType {
523
- UNKNOWN_SCALAR_TYPE = "UNKNOWN_SCALAR_TYPE",
524
- COUNT_DISTINCT = "COUNT_DISTINCT",
525
- MIN = "MIN",
526
- MAX = "MAX",
527
- SUM = "SUM",
528
- AVG = "AVG"
529
- }
530
- export interface ValueAggregation extends ValueAggregationOptionsOneOf {
531
- /** options for including missing values */
532
- includeOptions?: IncludeMissingValuesOptions;
533
- sortType?: SortType;
534
- sortDirection?: SortDirection;
535
- /** How many aggregations would you like to return? Can be between 1 and 250. 10 is the default. */
536
- limit?: number | null;
537
- /** should missing values be included or excluded from the aggregation results. Default is EXCLUDE */
538
- missingValues?: MissingValues;
539
- }
540
- /** @oneof */
541
- export interface ValueAggregationOptionsOneOf {
542
- /** options for including missing values */
543
- includeOptions?: IncludeMissingValuesOptions;
544
- }
545
- export declare enum NestedAggregationType {
546
- UNKNOWN_AGGREGATION_TYPE = "UNKNOWN_AGGREGATION_TYPE",
547
- VALUE = "VALUE",
548
- RANGE = "RANGE",
549
- SCALAR = "SCALAR",
550
- DATE_HISTOGRAM = "DATE_HISTOGRAM"
551
- }
552
- export interface RangeAggregation {
553
- buckets?: RangeBucket[];
554
- }
555
- export interface ScalarAggregation {
556
- type?: ScalarType;
557
- }
558
- export interface DateHistogramAggregation {
559
- interval?: Interval;
560
- }
561
- export declare enum Interval {
562
- UNKNOWN_INTERVAL = "UNKNOWN_INTERVAL",
563
- YEAR = "YEAR",
564
- MONTH = "MONTH",
565
- WEEK = "WEEK",
566
- DAY = "DAY",
567
- HOUR = "HOUR",
568
- MINUTE = "MINUTE",
569
- SECOND = "SECOND"
570
- }
571
- export interface NestedAggregationItem extends NestedAggregationItemKindOneOf {
572
- value?: ValueAggregation;
573
- range?: RangeAggregation;
574
- scalar?: ScalarAggregation;
575
- dateHistogram?: DateHistogramAggregation;
576
- name?: string | null;
577
- type?: NestedAggregationType;
578
- fieldPath?: string;
579
- }
580
- /** @oneof */
581
- export interface NestedAggregationItemKindOneOf {
582
- value?: ValueAggregation;
583
- range?: RangeAggregation;
584
- scalar?: ScalarAggregation;
585
- dateHistogram?: DateHistogramAggregation;
586
- }
587
- export declare enum AggregationType {
588
- UNKNOWN_AGGREGATION_TYPE = "UNKNOWN_AGGREGATION_TYPE",
589
- VALUE = "VALUE",
590
- RANGE = "RANGE",
591
- SCALAR = "SCALAR",
592
- DATE_HISTOGRAM = "DATE_HISTOGRAM",
593
- NESTED = "NESTED"
594
- }
595
- export interface NestedAggregation {
596
- nestedAggregations?: NestedAggregationItem[];
597
- }
598
- export interface GroupByAggregation extends GroupByAggregationKindOneOf {
599
- value?: ValueAggregation;
600
- name?: string | null;
601
- fieldPath?: string;
602
- }
603
- /** @oneof */
604
- export interface GroupByAggregationKindOneOf {
605
- value?: ValueAggregation;
606
- }
607
- export interface SearchDetails {
608
- /** boolean search mode */
609
- mode?: Mode;
610
- /** search term or expression */
611
- expression?: string | null;
612
- /** fields to search in. if empty - server will search in own default fields */
613
- fields?: string[];
614
- /** flag if should use auto fuzzy search (allowing typos by a managed proximity algorithm) */
615
- fuzzy?: boolean;
616
- }
617
- export declare enum Mode {
618
- /** any */
619
- OR = "OR",
620
- /** all */
621
- AND = "AND"
622
- }
623
- export interface SearchReservationsResponse {
624
- /** List of Reservations. */
625
- reservations?: Reservation[];
626
- /** Cursor paging metadata. */
627
- pagingMetadata?: CursorPagingMetadata;
628
- /** Aggregation data. */
629
- aggregationData?: AggregationData;
630
- }
631
- export interface AggregationData {
632
- /** key = aggregation name (as derived from search request) */
633
- results?: AggregationResults[];
634
- }
635
- export interface ValueAggregationResult {
636
- value?: string;
637
- count?: number;
638
- }
639
- export interface RangeAggregationResult {
640
- from?: number | null;
641
- to?: number | null;
642
- count?: number;
643
- }
644
- export interface NestedAggregationResults extends NestedAggregationResultsResultOneOf {
645
- values?: ValueResults;
646
- ranges?: RangeResults;
647
- scalar?: ScalarResult;
648
- name?: string;
649
- type?: AggregationType;
650
- fieldPath?: string;
651
- }
652
- /** @oneof */
653
- export interface NestedAggregationResultsResultOneOf {
654
- values?: ValueResults;
655
- ranges?: RangeResults;
656
- scalar?: ScalarResult;
657
- }
658
- export interface ValueResults {
659
- results?: ValueAggregationResult[];
660
- }
661
- export interface RangeResults {
662
- results?: RangeAggregationResult[];
663
- }
664
- export interface ScalarResult {
665
- type?: ScalarType;
666
- value?: number;
667
- }
668
- export interface NestedValueAggregationResult {
669
- value?: string;
670
- nestedResults?: NestedAggregationResults;
671
- }
672
- export interface ValueResult {
673
- value?: string;
674
- count?: number | null;
675
- }
676
- export interface RangeResult {
677
- from?: number | null;
678
- to?: number | null;
679
- count?: number | null;
680
- }
681
- export interface NestedResultsScalarResult {
682
- value?: number;
683
- }
684
- export interface NestedResultValue extends NestedResultValueResultOneOf {
685
- value?: ValueResult;
686
- range?: RangeResult;
687
- scalar?: NestedResultsScalarResult;
688
- dateHistogram?: ValueResult;
689
- }
690
- /** @oneof */
691
- export interface NestedResultValueResultOneOf {
692
- value?: ValueResult;
693
- range?: RangeResult;
694
- scalar?: NestedResultsScalarResult;
695
- dateHistogram?: ValueResult;
696
- }
697
- export interface Results {
698
- results?: Record<string, NestedResultValue>;
699
- }
700
- export interface DateHistogramResult {
701
- value?: string;
702
- count?: number;
703
- }
704
- export interface GroupByValueResults {
705
- results?: NestedValueAggregationResult[];
706
- }
707
- export interface DateHistogramResults {
708
- results?: DateHistogramResult[];
709
- }
710
- export interface NestedResults {
711
- results?: Results[];
712
- }
713
- export interface AggregationResults extends AggregationResultsResultOneOf {
714
- values?: ValueResults;
715
- ranges?: RangeResults;
716
- scalar?: ScalarResult;
717
- groupedByValue?: GroupByValueResults;
718
- dateHistogram?: DateHistogramResults;
719
- nested?: NestedResults;
720
- name?: string;
721
- type?: AggregationType;
722
- fieldPath?: string;
723
- }
724
- /** @oneof */
725
- export interface AggregationResultsResultOneOf {
726
- values?: ValueResults;
727
- ranges?: RangeResults;
728
- scalar?: ScalarResult;
729
- groupedByValue?: GroupByValueResults;
730
- dateHistogram?: DateHistogramResults;
731
- nested?: NestedResults;
732
- }
733
- export interface DomainEvent<T = string> extends DomainEventBodyOneOf<T> {
734
- /** Information about the reservation that was created and event metadata. */
735
- createdEvent?: EntityCreatedEvent<T>;
736
- /** Information about the reservation that was updated and event metadata. */
737
- updatedEvent?: EntityUpdatedEvent<T>;
738
- deletedEvent?: EntityDeletedEvent<T>;
739
- actionEvent?: ActionEvent<T>;
740
- /**
741
- * Unique event ID.
742
- * Allows clients to ignore duplicate webhooks.
743
- */
744
- _id?: string;
745
- /**
746
- * Assumes actions are also always typed to an entity_type
747
- * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
748
- */
749
- entityFqdn?: string;
750
- /**
751
- * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
752
- * This is although the created/updated/deleted notion is duplication of the oneof types
753
- * Example: created/updated/deleted/started/completed/email_opened
754
- */
755
- slug?: string;
756
- /** ID of the entity associated with the event. */
757
- entityId?: string;
758
- /** Event timestamp. */
759
- eventTime?: Date;
760
- /**
761
- * Whether the event was triggered as a result of a privacy regulation application
762
- * (for example, GDPR).
763
- */
764
- triggeredByAnonymizeRequest?: boolean | null;
765
- /** If present, indicates the action that triggered the event. */
766
- originatedFrom?: string | null;
767
- /**
768
- * A sequence number defining the order of updates to the underlying entity.
769
- * For example, given that some entity was updated at 16:00 and than again at 16:01,
770
- * it is guaranteed that the sequence number of the second update is strictly higher than the first.
771
- * As the consumer, you can use this value to ensure that you handle messages in the correct order.
772
- * To do so, you will need to persist this number on your end, and compare the sequence number from the
773
- * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
774
- */
775
- entityEventSequence?: string | null;
776
- }
777
- export interface DomainCreatedEvent<T> extends Omit<DomainEvent<T>, 'deletedEvent' | 'updatedEvent' | 'actionEvent'> {
778
- }
779
- export interface DomainDeletedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'updatedEvent' | 'actionEvent'> {
780
- }
781
- export interface DomainUpdatedEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'actionEvent'> {
782
- }
783
- export interface DomainActionEvent<T> extends Omit<DomainEvent<T>, 'createdEvent' | 'deletedEvent' | 'updatedEvent'> {
784
- }
785
- /** @oneof */
786
- export interface DomainEventBodyOneOf<T> {
787
- createdEvent?: EntityCreatedEvent<T>;
788
- updatedEvent?: EntityUpdatedEvent<T>;
789
- deletedEvent?: EntityDeletedEvent<T>;
790
- actionEvent?: ActionEvent<T>;
791
- }
792
- export interface EntityCreatedEvent<T> {
793
- entity?: T;
794
- }
795
- export interface EntityUpdatedEvent<T> {
796
- /**
797
- * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
798
- * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
799
- * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
800
- */
801
- currentEntity?: T;
802
- }
803
- export interface EntityDeletedEvent<T> {
804
- /** Entity that was deleted */
805
- deletedEntity?: T | null;
806
- }
807
- export interface ActionEvent<T> {
808
- body?: T;
809
- }
810
- export interface Empty {
811
- }
812
- export interface RemoveReservationMigrationNotesRequest {
813
- /** Reservation ID. */
814
- reservationId?: string;
815
- /** Revision. */
816
- revision?: string;
817
- }
818
- export interface RemoveReservationMigrationNotesResponse {
819
- reservation?: Reservation;
820
- }
821
- export interface CreateReservationResponseNonNullableFields {
822
- reservation?: {
823
- status: Status;
824
- source: Source;
825
- };
826
- }
827
- export interface GetReservationResponseNonNullableFields {
828
- reservation?: {
829
- status: Status;
830
- source: Source;
831
- };
832
- }
833
- export interface UpdateReservationResponseNonNullableFields {
834
- reservation?: {
835
- status: Status;
836
- source: Source;
837
- };
838
- }
839
- export interface CreateHeldReservationResponseNonNullableFields {
840
- reservation?: {
841
- status: Status;
842
- source: Source;
843
- };
844
- }
845
- export interface ReserveReservationResponseNonNullableFields {
846
- reservation?: {
847
- status: Status;
848
- source: Source;
849
- };
850
- }
851
- export interface CancelReservationResponseNonNullableFields {
852
- reservation?: {
853
- status: Status;
854
- source: Source;
855
- };
856
- }
857
- export interface ListReservationsResponseNonNullableFields {
858
- reservations: {
859
- status: Status;
860
- source: Source;
861
- }[];
862
- }
863
- export interface QueryReservationsResponseNonNullableFields {
864
- reservations: {
865
- status: Status;
866
- source: Source;
867
- }[];
868
- }
869
- export interface SearchReservationsResponseNonNullableFields {
870
- reservations: {
871
- status: Status;
872
- source: Source;
873
- }[];
874
- aggregationData?: {
875
- results: {
876
- values?: {
877
- results: {
878
- value: string;
879
- count: number;
880
- }[];
881
- };
882
- ranges?: {
883
- results: {
884
- count: number;
885
- }[];
886
- };
887
- scalar?: {
888
- type: ScalarType;
889
- value: number;
890
- };
891
- groupedByValue?: {
892
- results: {
893
- value: string;
894
- nestedResults?: {
895
- values?: {
896
- results: {
897
- value: string;
898
- count: number;
899
- }[];
900
- };
901
- ranges?: {
902
- results: {
903
- count: number;
904
- }[];
905
- };
906
- scalar?: {
907
- type: ScalarType;
908
- value: number;
909
- };
910
- name: string;
911
- type: AggregationType;
912
- fieldPath: string;
913
- };
914
- }[];
915
- };
916
- dateHistogram?: {
917
- results: {
918
- value: string;
919
- count: number;
920
- }[];
921
- };
922
- nested?: {
923
- results: {
924
- results?: {
925
- value?: {
926
- value: string;
927
- };
928
- scalar?: {
929
- value: number;
930
- };
931
- dateHistogram?: {
932
- value: string;
933
- };
934
- };
935
- }[];
936
- };
937
- name: string;
938
- type: AggregationType;
939
- fieldPath: string;
940
- }[];
941
- };
942
- }
943
- export declare const onReservationCreated: EventDefinition<DomainCreatedEvent<Reservation>, "wix.table_reservations.v1.reservation_created">;
944
- export declare const onReservationUpdated: EventDefinition<DomainUpdatedEvent<Reservation>, "wix.table_reservations.v1.reservation_updated">;
945
- /**
946
- * Creates a new reservation.
947
- *
948
- * `createReservation()` accepts and requires different fields depending on the `status` provided and your permissions.
949
- *
950
- * **Status and source**
951
- *
952
- * If a `status` is not provided, it will be set to:
953
- * * `RESERVED` if manual approval is not required for confirmation
954
- * * `REQUESTED` if manual approval is required for confirmation.
955
- *
956
- * A reservation created with any `source` other than `WALK_IN` requires the `reservation.reservee.phone` and `reservation.reservee.firstName` fields.
957
- * Attempting to create a reservation without these fields will result in an error.
958
- *
959
- * **Permissions**
960
- *
961
- * Including the fields `status`, `source`, `reservation.details.tableIds`, `reservation.details.endDate`, `ignoreReservationLocationConflicts`, or `ignoreTableCombinationConflicts` in the request requires additional permissions. See this API's Introduction article for more information.
962
- *
963
- * If `source` is not provided, its value is set depending on the permissions of the user making the call. See this API's Introduction article for more information.
964
- *
965
- *
966
- * > **Note:** `createReservation()` requires all details of the reservation upfront. The process of creating a reservation can be broken up using `createHeldReservation`. `createHeldReservation` creates a temporary reservation that expires automatically unless it is completed with the addition of more details using `reserveReservation()`.
967
- * @param reservation - Reservation details.
968
- * @public
969
- * @documentationMaturity preview
970
- * @requiredField reservation
971
- * @requiredField reservation.details
972
- * @requiredField reservation.details.partySize
973
- * @requiredField reservation.details.reservationLocationId
974
- * @requiredField reservation.details.startDate
975
- * @param options - Options for creating the reservation.
976
- * @permissionScope Manage Reservations (Medium)
977
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
978
- * @permissionScope Manage Reservations (Full)
979
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
980
- * @permissionScope Manage Reservations (Basic)
981
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
982
- * @permissionScope Manage Reservations (Full)
983
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
984
- * @applicableIdentity APP
985
- * @applicableIdentity MEMBER
986
- * @applicableIdentity VISITOR
987
- * @returns Reservation.
988
- */
989
- export declare function createReservation(reservation: Reservation, options?: CreateReservationOptions): Promise<Reservation & NonNullable<CreateReservationResponseNonNullableFields>['reservation']>;
990
- export interface CreateReservationOptions {
991
- /**
992
- * Ignore table combination conflicts of the types included in the array. This ensures that the reservation is created even if the given conflicts would normally prevent it.
993
- *
994
- * Possible values:
995
- * * `"RESERVED"`: One or more of the chosen tables are already reserved.
996
- * * `"TOO_BIG"`: The party is too big for the selected table.
997
- * * `"TOO_SMALL"`: The party is too small for the selected table.
998
- * * `"OFFLINE_ONLY"`: The restaurant does not allow online reservations.
999
- */
1000
- ignoreTableCombinationConflicts?: TableCombinationConflictType[];
1001
- /**
1002
- * Ignored reservation location conflicts of the types included in the array. This ensures that the reservation is created even if the given conflicts would normally prevent it.
1003
- *
1004
- * Possible values:
1005
- * * `"PARTY_PACING"`: The restaurant cannot accommodate a party of the given size according to party pacing settings.
1006
- * * `"SEAT_PACING"`: The required number of seats are unavailable according to seat pacing settings.
1007
- */
1008
- ignoreReservationLocationConflicts?: Type[];
1009
- }
1010
- /**
1011
- * Retrieves a reservation.
1012
- *
1013
- * Calling this method with `fieldsets` set to `FULL` requires additional permissions. See this API's Introduction article for more information.
1014
- * @param reservationId - Reservation ID.
1015
- * @public
1016
- * @documentationMaturity preview
1017
- * @requiredField reservationId
1018
- * @permissionScope Manage Reservations (Medium)
1019
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1020
- * @permissionScope Manage Reservations (Full)
1021
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1022
- * @permissionScope Manage Reservations (Basic)
1023
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
1024
- * @permissionScope Manage Reservations (Medium)
1025
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1026
- * @permissionScope Manage Reservations (Full)
1027
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1028
- * @applicableIdentity APP
1029
- * @applicableIdentity MEMBER
1030
- * @applicableIdentity VISITOR
1031
- * @returns Reservation.
1032
- */
1033
- export declare function getReservation(reservationId: string, options?: GetReservationOptions): Promise<Reservation & NonNullable<GetReservationResponseNonNullableFields>['reservation']>;
1034
- export interface GetReservationOptions {
1035
- /**
1036
- * Array of named, predefined sets of projected fields to be returned.
1037
- *
1038
- * Supported values: `PUBLIC`, `FULL`.
1039
- *
1040
- * Calling this method with `fieldsets` set to `FULL` requires additional permissions. See this API's Introduction article for more information.
1041
- */
1042
- fieldsets?: Set[];
1043
- }
1044
- /**
1045
- * Updates a reservation.
1046
- *
1047
- * Including the fields `status`, `source`, `reservation.details.tableIds`, `reservation.details.endDate`, `ignoreReservationLocationConflicts`, and `ignoreTableCombinationConflicts` in the request requires additional permissions. See this API's Introduction article for more information.
1048
- *
1049
- * 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.
1050
- * @param _id - Reservation ID.
1051
- * @public
1052
- * @documentationMaturity preview
1053
- * @requiredField _id
1054
- * @requiredField reservation
1055
- * @requiredField reservation.revision
1056
- * @param options - Options for updating the reservation.
1057
- * @param reservation - Reservation information to update.
1058
- * @permissionScope Manage Reservations (Medium)
1059
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1060
- * @permissionScope Manage Reservations (Full)
1061
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1062
- * @permissionScope Manage Reservations (Full)
1063
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1064
- * @applicableIdentity APP
1065
- * @returns Reservation.
1066
- */
1067
- export declare function updateReservation(_id: string | null, reservation: UpdateReservation, options?: UpdateReservationOptions): Promise<Reservation & NonNullable<UpdateReservationResponseNonNullableFields>['reservation']>;
1068
- export interface UpdateReservation {
1069
- /**
1070
- * Reservation ID.
1071
- * @readonly
1072
- */
1073
- _id?: string | null;
1074
- /**
1075
- * Status of the reservation.
1076
- *
1077
- * See the article for this API titled "The Reservation Lifecycle" in the menu on the left for more details on each of the statuses, and an explanation of the reservation lifecycle.
1078
- */
1079
- status?: Status;
1080
- /**
1081
- * Reservation source.
1082
- *
1083
- * This indicates how the reservation was made.
1084
- * * `ONLINE` indicates that the customer made the reservation through a website or app.
1085
- * * `OFFLINE` indicates that the reservation was made by a restaurant employee, for example when a customer calls to make a reservation.
1086
- * * `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.
1087
- */
1088
- source?: Source;
1089
- /** Reservation details. */
1090
- details?: Details;
1091
- /**
1092
- * Information about the person the reservation is being made for.
1093
- *
1094
- * A reservation created with any `source` other than `WALK_IN` requires the `reservation.reservee.phone` and `reservation.reservee.firstName` fields.
1095
- * Attempting to create a reservation without these fields results in an error.
1096
- */
1097
- reservee?: Reservee;
1098
- /**
1099
- * Information about the person making the reservation.
1100
- *
1101
- * This field is required if the reservation's `status` is anything other than `WALK_IN`.
1102
- * @readonly
1103
- */
1104
- reservedBy?: ReservedBy;
1105
- /**
1106
- * Team message.
1107
- *
1108
- * A message for the restaurant staff containing any additional information regarding the reservation, such as special requirements for the guests.
1109
- */
1110
- teamMessage?: string | null;
1111
- /**
1112
- * Date and time the reservation was created.
1113
- * @readonly
1114
- */
1115
- _createdDate?: Date;
1116
- /**
1117
- * Date and time the reservation was changed.
1118
- * @readonly
1119
- */
1120
- _updatedDate?: Date;
1121
- /**
1122
- * Revision number, which increments by 1 each time the reservation is updated.
1123
- * To prevent conflicting changes, the current revision must be passed when updating the reservation.
1124
- *
1125
- * Ignored when creating a reservation.
1126
- * @readonly
1127
- */
1128
- revision?: string | null;
1129
- /** The reason the reservation was declined. */
1130
- declineReason?: string | null;
1131
- }
1132
- export interface UpdateReservationOptions {
1133
- /**
1134
- * Ignore table combination conflicts of the types included in the array. This ensures that the reservation is updated even if the given conflicts would normally prevent it.
1135
- *
1136
- * Possible values:
1137
- * * `"RESERVED"`: One or more of the chosen tables are already reserved.
1138
- * * `"TOO_BIG"`: The party is too big for the selected table.
1139
- * * `"TOO_SMALL"`: The party is too small for the selected table.
1140
- * * `"OFFLINE_ONLY"`: The restaurant does not allow online reservations.
1141
- */
1142
- ignoreTableCombinationConflicts?: TableCombinationConflictType[];
1143
- /**
1144
- * Ignored reservation location conflicts of the types included in the array. This ensures that the reservation is updated even if the given conflicts would normally prevent it.
1145
- *
1146
- * Possible values:
1147
- * * `"PARTY_PACING"`: The restaurant cannot accommodate a party of the given size according to party pacing settings.
1148
- * * `"SEAT_PACING"`: The required number of seats are unavailable according to seat pacing settings.
1149
- */
1150
- ignoreReservationLocationConflicts?: Type[];
1151
- }
1152
- /**
1153
- * Creates a new temporary reservation and holds it for the customer for 10 minutes.
1154
- *
1155
- * Creates a new reservation with the `HELD` status. `HELD` reservations are intended to reserve seats and tables for a party in a selected time slot while they enter further reservation details, such as names and contact information. 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.
1156
- *
1157
- * You cannot call `updateReservation()` to change a reservation’s status from `HELD`. Trying to do so returns an error. Instead, you should use `reserveReservation()`.
1158
- *
1159
- * If you do not wish to have `HELD` reservations in your flow, you can create a reservation with all required details using `createReservation()`.
1160
- *
1161
- * @param reservationDetails - Held reservation information to update.
1162
- * @public
1163
- * @documentationMaturity preview
1164
- * @requiredField reservationDetails
1165
- * @requiredField reservationDetails.partySize
1166
- * @requiredField reservationDetails.reservationLocationId
1167
- * @requiredField reservationDetails.startDate
1168
- * @permissionScope Manage Reservations (Medium)
1169
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1170
- * @permissionScope Manage Reservations (Full)
1171
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1172
- * @permissionScope Manage Reservations (Basic)
1173
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
1174
- * @applicableIdentity APP
1175
- * @applicableIdentity MEMBER
1176
- * @applicableIdentity VISITOR
1177
- */
1178
- export declare function createHeldReservation(reservationDetails: HeldReservationDetails): Promise<CreateHeldReservationResponse & CreateHeldReservationResponseNonNullableFields>;
1179
- /**
1180
- * Reserves or requests a held reservation.
1181
- *
1182
- * Held reservations are temporary reservations with the `HELD` status created by `createHeldReservation()`.
1183
- *
1184
- * They are intended to reserve seats and tables for a party in a selected time slot while they enter further reservation details, such as names and contact information. Reservations with the `HELD` status are only valid for 10 minutes. Trying to call `Reserve Reservation` with a held reservation older than 10 minutes returns an error.
1185
- *
1186
- * `Reserve Reservation` changes a reservation's `HELD` status to:
1187
- * * `RESERVED` if the reservation's reservation location does not require manual approval.
1188
- * * `REQUESTED` if the reservation's reservation location requires manual approval.
1189
- * @param reservationId - Reservation ID.
1190
- * @param reservee - Reservee details.
1191
- * @param revision - Revision number.
1192
- *
1193
- * Include the existing `revision` to prevent conflicting updates to reservations.
1194
- * @public
1195
- * @documentationMaturity preview
1196
- * @requiredField reservationId
1197
- * @requiredField reservee
1198
- * @requiredField reservee.firstName
1199
- * @requiredField reservee.phone
1200
- * @requiredField revision
1201
- * @permissionScope Manage Reservations (Medium)
1202
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1203
- * @permissionScope Manage Reservations (Full)
1204
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1205
- * @permissionScope Manage Reservations (Basic)
1206
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
1207
- * @applicableIdentity APP
1208
- * @applicableIdentity MEMBER
1209
- * @applicableIdentity VISITOR
1210
- */
1211
- export declare function reserveReservation(reservationId: string, reservee: Reservee, revision: string | null): Promise<ReserveReservationResponse & ReserveReservationResponseNonNullableFields>;
1212
- /**
1213
- * Cancels a reservation.
1214
- *
1215
- * Sets the reservation status to `CANCELED`.
1216
- * @param reservationId - Reservation ID.
1217
- * @param revision - Revision number.
1218
- *
1219
- * Include the existing `revision` to prevent conflicting updates to reservations.
1220
- * @public
1221
- * @documentationMaturity preview
1222
- * @requiredField reservationId
1223
- * @requiredField revision
1224
- * @param options - Options for canceling the reservation.
1225
- * @permissionScope Manage Reservations (Medium)
1226
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1227
- * @permissionScope Manage Reservations (Full)
1228
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1229
- * @permissionScope Manage Reservations (Basic)
1230
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-BASIC
1231
- * @applicableIdentity APP
1232
- * @applicableIdentity MEMBER
1233
- * @applicableIdentity VISITOR
1234
- */
1235
- export declare function cancelReservation(reservationId: string, revision: string | null, options?: CancelReservationOptions): Promise<CancelReservationResponse & CancelReservationResponseNonNullableFields>;
1236
- export interface CancelReservationOptions {
1237
- /**
1238
- * The phone number that was provided when the reservation was created.
1239
- *
1240
- * This is required for reservations with any `source` other than `WALK_IN`.
1241
- *
1242
- * This requirement provides additional security by ensuring that the canceling party knows both the reservation's `reservationId` and the reservee's `phone`.
1243
- */
1244
- phone?: string | null;
1245
- }
1246
- /**
1247
- * Retrieves a list of up to 100 reservations.
1248
- * @public
1249
- * @documentationMaturity preview
1250
- * @param options - Options for listing the reservations.
1251
- * @permissionScope Manage Reservations (Medium)
1252
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1253
- * @permissionScope Manage Reservations (Full)
1254
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1255
- * @applicableIdentity APP
1256
- */
1257
- export declare function listReservations(options?: ListReservationsOptions): Promise<ListReservationsResponse & ListReservationsResponseNonNullableFields>;
1258
- export interface ListReservationsOptions {
1259
- /** 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`. */
1260
- paging?: CursorPaging;
1261
- /** Defines how reservations in the response are sorted. */
1262
- sort?: Sorting;
1263
- /** Only reservations starting after this date are returned. */
1264
- startDateFrom?: Date;
1265
- /** Only reservations starting before this date are returned. */
1266
- startDateTo?: Date;
1267
- /**
1268
- * Only reservations with this status are returned.
1269
- *
1270
- * * `HELD`: The reservation is temporary and will expire in 10 minutes if its status isn’t changed. This phase temporarily reserves the required number of seats and tables for a given party size at a chosen time while a customer enters details and/or confirms their reservation request.
1271
- * * `REQUESTED`: A customer finished requesting this reservation, meaning they have added all necessary details and confirmed the request. Restaurant staff can now either approve or decline the reservation request.
1272
- * * `DECLINED`: The restaurant’s owner or staff declined the customer’s request to make the reservation.
1273
- * * `RESERVED`: The reservation is confirmed.
1274
- * * `SEATED`: The customer is currently occupying the table.
1275
- * * `CANCELED`: The reservation is canceled.
1276
- * * `NO_SHOW`: The customer didn't show up for their reservation.
1277
- * * `FINISHED`: The reservation completed successfully.
1278
- */
1279
- status?: Status;
1280
- }
1281
- /**
1282
- * Creates a query to retrieve a list of reservations.
1283
- *
1284
- * The `queryReservations()` function builds a query to retrieve a list of reservations and returns a [`ReservationsQueryBuilder`](#ReservationsQueryBuilder) object.
1285
- *
1286
- * The returned object contains the query definition, which is used to run the query using the [find()](#ReservationsQueryBuilder/find) function.
1287
- *
1288
- * You can refine the query by chaining `ReservationsQueryBuilder` functions onto the query. `ReservationsQueryBuilder` functions enable you to filter, sort, and control the results that `queryReservations()` returns.
1289
- *
1290
- * `queryReservations()` runs with the following `ReservationsQueryBuilder` defaults, which you can override:
1291
- *
1292
- * * [`skip(0)`](#ReservationsQueryBuilder/skip)
1293
- * * [`limit(50)`](#ReservationsQueryBuilder/limit)
1294
- * * [`descending('_createdDate')`](#ReservationsQueryBuilder/descending)
1295
- *
1296
- * The following `ReservationsQueryBuilder` functions are supported for `queryReservations()`. For a full description of the reservation object, see the object returned for the [`items`](#ReservationsQueryResult/items) property in [`ReservationsQueryResult`](#ReservationsQueryResult).
1297
- * @public
1298
- * @documentationMaturity preview
1299
- * @permissionScope Manage Reservations (Medium)
1300
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1301
- * @permissionScope Manage Reservations (Full)
1302
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1303
- * @applicableIdentity APP
1304
- */
1305
- export declare function queryReservations(): ReservationsQueryBuilder;
1306
- interface QueryCursorResult {
1307
- cursors: Cursors;
1308
- hasNext: () => boolean;
1309
- hasPrev: () => boolean;
1310
- length: number;
1311
- pageSize: number;
1312
- }
1313
- export interface ReservationsQueryResult extends QueryCursorResult {
1314
- items: Reservation[];
1315
- query: ReservationsQueryBuilder;
1316
- next: () => Promise<ReservationsQueryResult>;
1317
- prev: () => Promise<ReservationsQueryResult>;
1318
- }
1319
- export interface ReservationsQueryBuilder {
1320
- /** @param propertyName - Property whose value is compared with `value`.
1321
- * @param value - Value to compare against.
1322
- * @documentationMaturity preview
1323
- */
1324
- eq: (propertyName: '_id' | 'status' | 'details.startDate', value: any) => ReservationsQueryBuilder;
1325
- /** @param propertyName - Property whose value is compared with `value`.
1326
- * @param value - Value to compare against.
1327
- * @documentationMaturity preview
1328
- */
1329
- ne: (propertyName: '_id' | 'status' | 'details.startDate', value: any) => ReservationsQueryBuilder;
1330
- /** @param propertyName - Property whose value is compared with `value`.
1331
- * @param value - Value to compare against.
1332
- * @documentationMaturity preview
1333
- */
1334
- ge: (propertyName: 'details.startDate', value: any) => ReservationsQueryBuilder;
1335
- /** @param propertyName - Property whose value is compared with `value`.
1336
- * @param value - Value to compare against.
1337
- * @documentationMaturity preview
1338
- */
1339
- gt: (propertyName: 'details.startDate', value: any) => ReservationsQueryBuilder;
1340
- /** @param propertyName - Property whose value is compared with `value`.
1341
- * @param value - Value to compare against.
1342
- * @documentationMaturity preview
1343
- */
1344
- le: (propertyName: 'details.startDate', value: any) => ReservationsQueryBuilder;
1345
- /** @param propertyName - Property whose value is compared with `value`.
1346
- * @param value - Value to compare against.
1347
- * @documentationMaturity preview
1348
- */
1349
- lt: (propertyName: 'details.startDate', value: any) => ReservationsQueryBuilder;
1350
- /** @documentationMaturity preview */
1351
- in: (propertyName: '_id' | 'status' | 'details.startDate', value: any) => ReservationsQueryBuilder;
1352
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1353
- * @documentationMaturity preview
1354
- */
1355
- ascending: (...propertyNames: Array<'details.startDate'>) => ReservationsQueryBuilder;
1356
- /** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
1357
- * @documentationMaturity preview
1358
- */
1359
- descending: (...propertyNames: Array<'details.startDate'>) => ReservationsQueryBuilder;
1360
- /** @param limit - Number of items to return, which is also the `pageSize` of the results object.
1361
- * @documentationMaturity preview
1362
- */
1363
- limit: (limit: number) => ReservationsQueryBuilder;
1364
- /** @param cursor - A pointer to specific record
1365
- * @documentationMaturity preview
1366
- */
1367
- skipTo: (cursor: string) => ReservationsQueryBuilder;
1368
- /** @documentationMaturity preview */
1369
- find: () => Promise<ReservationsQueryResult>;
1370
- }
1371
- /** @param search - Search query.
1372
- * @public
1373
- * @documentationMaturity preview
1374
- * @requiredField search
1375
- * @permissionScope Manage Reservations (Medium)
1376
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-MEDIUM
1377
- * @permissionScope Manage Reservations (Full)
1378
- * @permissionScopeId SCOPE.DC-RESERVATIONS.MANAGE-RESERVATIONS-FULL
1379
- * @applicableIdentity APP
1380
- */
1381
- export declare function searchReservations(search: CursorSearch): Promise<SearchReservationsResponse & SearchReservationsResponseNonNullableFields>;
1382
- export {};