@wix/bookings 1.0.297 → 1.0.299

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 (49) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +2 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +2 -1
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +2 -1
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/cjs/src/bookings-availability-v2-time-slot.http.d.ts +238 -0
  11. package/build/cjs/src/bookings-availability-v2-time-slot.http.js +556 -0
  12. package/build/cjs/src/bookings-availability-v2-time-slot.http.js.map +1 -0
  13. package/build/cjs/src/bookings-availability-v2-time-slot.meta.d.ts +16 -0
  14. package/build/cjs/src/bookings-availability-v2-time-slot.meta.js +100 -0
  15. package/build/cjs/src/bookings-availability-v2-time-slot.meta.js.map +1 -0
  16. package/build/cjs/src/bookings-availability-v2-time-slot.public.d.ts +11 -0
  17. package/build/cjs/src/bookings-availability-v2-time-slot.public.js +32 -0
  18. package/build/cjs/src/bookings-availability-v2-time-slot.public.js.map +1 -0
  19. package/build/cjs/src/bookings-availability-v2-time-slot.types.d.ts +812 -0
  20. package/build/cjs/src/bookings-availability-v2-time-slot.types.js +14 -0
  21. package/build/cjs/src/bookings-availability-v2-time-slot.types.js.map +1 -0
  22. package/build/cjs/src/bookings-availability-v2-time-slot.universal.d.ts +1415 -0
  23. package/build/cjs/src/bookings-availability-v2-time-slot.universal.js +577 -0
  24. package/build/cjs/src/bookings-availability-v2-time-slot.universal.js.map +1 -0
  25. package/build/es/index.d.ts +1 -0
  26. package/build/es/index.js +1 -0
  27. package/build/es/index.js.map +1 -1
  28. package/build/es/index.typings.d.ts +1 -0
  29. package/build/es/index.typings.js +1 -0
  30. package/build/es/index.typings.js.map +1 -1
  31. package/build/es/meta.d.ts +1 -0
  32. package/build/es/meta.js +1 -0
  33. package/build/es/meta.js.map +1 -1
  34. package/build/es/src/bookings-availability-v2-time-slot.http.d.ts +238 -0
  35. package/build/es/src/bookings-availability-v2-time-slot.http.js +549 -0
  36. package/build/es/src/bookings-availability-v2-time-slot.http.js.map +1 -0
  37. package/build/es/src/bookings-availability-v2-time-slot.meta.d.ts +16 -0
  38. package/build/es/src/bookings-availability-v2-time-slot.meta.js +74 -0
  39. package/build/es/src/bookings-availability-v2-time-slot.meta.js.map +1 -0
  40. package/build/es/src/bookings-availability-v2-time-slot.public.d.ts +11 -0
  41. package/build/es/src/bookings-availability-v2-time-slot.public.js +24 -0
  42. package/build/es/src/bookings-availability-v2-time-slot.public.js.map +1 -0
  43. package/build/es/src/bookings-availability-v2-time-slot.types.d.ts +812 -0
  44. package/build/es/src/bookings-availability-v2-time-slot.types.js +11 -0
  45. package/build/es/src/bookings-availability-v2-time-slot.types.js.map +1 -0
  46. package/build/es/src/bookings-availability-v2-time-slot.universal.d.ts +1415 -0
  47. package/build/es/src/bookings-availability-v2-time-slot.universal.js +551 -0
  48. package/build/es/src/bookings-availability-v2-time-slot.universal.js.map +1 -0
  49. package/package.json +2 -2
@@ -0,0 +1,1415 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ /**
8
+ * The `TimeSlot` object represents the availability information
9
+ * for an `Appointment` service's specific slot, including:
10
+ *
11
+ * 1. Whether the slot is bookable for the given service?
12
+ *
13
+ * 2. In what location the service is available for this slot?
14
+ *
15
+ * 3. Which available resources can provide the service for this slot?
16
+ *
17
+ * 4. Does booking the slot for the service violates any of the service booking policies?
18
+ *
19
+ * 5. What is the total capacity and remaining capacity of the service at the time of the calculation of the `TimeSlot`?
20
+ *
21
+ * > __Note:__
22
+ * When the `TimeSlot` has a non empty `NestedTimeSlots`, it represents the availability information
23
+ * > for a given list of `Appointment` services within a specific time slot.
24
+ */
25
+ export interface TimeSlot {
26
+ /**
27
+ * Service ID.
28
+ *
29
+ * > Not returned from `MultiServiceAvailabilityTimeSlots` API calls.
30
+ * > Instead, each nested time slot has its own serviceId.
31
+ */
32
+ serviceId?: string | null;
33
+ /**
34
+ * Local start date of the time slot in ISO-8601 format.
35
+ * For example, "2024-01-30T13:30:00".
36
+ *
37
+ * > When returned from `MultiServiceAvailabilityTimeSlots` API calls,
38
+ * > represents the earliest `localStartDate` of the `TimeSlot`'s nested time slots.
39
+ */
40
+ localStartDate?: string | null;
41
+ /**
42
+ * Local end date of the time slot in ISO-8601 format.
43
+ * For example, "2024-01-30T14:30:00".
44
+ *
45
+ * > When returned from `MultiServiceAvailabilityTimeSlots` API calls,
46
+ * > represents the latest `localEndDate` of the `TimeSlot`'s nested time slots.
47
+ */
48
+ localEndDate?: string | null;
49
+ /**
50
+ * Whether the slot is bookable according to the service's booking policies.
51
+ *
52
+ * If booking this time slot does not violates any of the service's booking policies,
53
+ * the returned value is `true`. Otherwise, returns `false`.
54
+ *
55
+ * > When returned from `MultiServiceAvailabilityTimeSlots` API calls,
56
+ * > + `bookable` is `false` if at least one of the provided services is not bookable within the time slot.
57
+ * > + `bookable` is `true` if all provided services are bookable within the time slot.
58
+ */
59
+ bookable?: boolean | null;
60
+ /**
61
+ * The geographic location of the slot.
62
+ *
63
+ * > When returned from `MultiServiceAvailabilityTimeSlots` API calls,
64
+ * > the geographic location of all nested time slots of the `TimeSlot`.
65
+ */
66
+ location?: Location;
67
+ /**
68
+ * Total number of spots for the slot.
69
+ *
70
+ * > When returned from `MultiServiceAvailabilityTimeSlots` API calls,
71
+ * > `totalCapacity` is always 1, regardless the number of requested services.
72
+ */
73
+ totalCapacity?: number | null;
74
+ /**
75
+ * Remaining number of spots for the slot.
76
+ * For example, for an appointment service with total capacity of 1 spot and one booked spot, the remaining capacity will be 0.
77
+ *
78
+ * > When returned from `MultiServiceAvailabilityTimeSlots` API calls,
79
+ * > `remainingCapacity` is 1 if all requested services has `remainingCapacity` >= 1.
80
+ * > `remainingCapacity` is 0, if there is at least one requested service with `remainingCapacity` < 1.
81
+ */
82
+ remainingCapacity?: number | null;
83
+ /**
84
+ * > When returned from `ListMultiServiceAvailabilityTimeSlots`,
85
+ * > indicates that at least one of the nested time slots does not meet with at least one of the service's booking policies.
86
+ * > There is no indication which of the requested services violates a booking policy.
87
+ */
88
+ bookingPolicyViolations?: BookingPolicyViolations;
89
+ /**
90
+ * List of `AvailableResources` for the time slot.
91
+ * Each `AvailableResources` contains information about available resources of the same type.
92
+ *
93
+ * > Not returned from `MultiServiceAvailabilityTimeSlots` API calls.
94
+ * > Instead, each nested time slot has its own available resources.
95
+ */
96
+ availableResources?: AvailableResources[];
97
+ /**
98
+ * > Nested time slots.
99
+ * > Returned only from `MultiServiceAvailabilityTimeSlots` API calls.
100
+ */
101
+ nestedTimeSlots?: NestedTimeSlot[];
102
+ }
103
+ export interface Location {
104
+ /** Business Location ID. Present only if the location is a business location. */
105
+ _id?: string | null;
106
+ /** The location name. */
107
+ name?: string | null;
108
+ /** A string representation for the full address of the location. */
109
+ formattedAddress?: string | null;
110
+ /**
111
+ * The type of location:
112
+ * - `CUSTOM`: The location is specific to this service, and is not derived from the business location.
113
+ * - `BUSINESS`: A business location, either the default business address, or locations defined for the business by the Business Info.
114
+ * - `CUSTOMER`: The location is determined by the customer and is not set up beforehand.
115
+ */
116
+ locationType?: LocationType;
117
+ }
118
+ export declare enum LocationType {
119
+ UNKNOWN_LOCATION_TYPE = "UNKNOWN_LOCATION_TYPE",
120
+ /** A business location, either the default business address, or locations defined for the business by the Business Info. */
121
+ BUSINESS = "BUSINESS",
122
+ /** The location is unique to this service and isn't defined as one of the business locations. */
123
+ CUSTOM = "CUSTOM",
124
+ /** The location can be determined by the customer and is not set up beforehand. */
125
+ CUSTOMER = "CUSTOMER"
126
+ }
127
+ /** relevant for event based slots, and not for availability based slots */
128
+ export interface EventInfo {
129
+ }
130
+ export interface WaitingList {
131
+ /** Total number of spots in this wait list. */
132
+ totalCapacity?: number | null;
133
+ /**
134
+ * Number of remaining spots for this wait list.
135
+ * For example, a Yoga event with 10 waitList spots and 3 registered
136
+ * on the waitList has 10 `total_capacity` and 7 `remaining_capacity`.
137
+ */
138
+ remainingCapacity?: number | null;
139
+ }
140
+ export interface BookingPolicyViolations {
141
+ /** Bookings policy violation. Too early to book this slot. */
142
+ tooEarlyToBook?: boolean | null;
143
+ /** Bookings policy violation. Too late to book this slot. */
144
+ tooLateToBook?: boolean | null;
145
+ /** Bookings policy violation. Online booking is disabled for the `TimeSlot` service. */
146
+ bookOnlineDisabled?: boolean | null;
147
+ }
148
+ export interface AvailableResources {
149
+ /** Resource type ID. */
150
+ resourceTypeId?: string | null;
151
+ /**
152
+ * Available resources for the time slot.
153
+ *
154
+ * + When returned from `ListAvailabilityTimeSlots`, empty by default.
155
+ * + + If you provided `includeResourceTypeIds` or `resourceIds` in request,
156
+ * contains __up__ to 10 available resources out of those provided.
157
+ *
158
+ * + When returned from `GetAvailabilityTimeSlots`, contains all available resources by default.
159
+ * + + If you provided `includeResourceTypeIds` or `resourceIds` in request,
160
+ * contains all of the available resources out of those provided.
161
+ *
162
+ *
163
+ * > + When returned from `ListMultiServiceAvailabilityTimeSlots`, empty by default.
164
+ * > + + If you provided `includeResourceTypeIds` or `resourceIds` in request,
165
+ * > contains __up__ to 10 available resources out of those provided.
166
+ *
167
+ * > + When returned from `GetMultiServiceAvailabilityTimeSlots`, contains all available resources by default.
168
+ * > + + If you provided `includeResourceTypeIds` or `resourceIds` in request,
169
+ * > contains all of the available resources out of those provided.
170
+ */
171
+ resources?: Resource[];
172
+ /**
173
+ * Whether there are more available resources for the slot that are not listed in `resources` due to size limitations.
174
+ * @readonly
175
+ */
176
+ hasMoreAvailableResources?: boolean | null;
177
+ }
178
+ export interface Resource {
179
+ /** Resource ID. */
180
+ _id?: string;
181
+ /** Resource name. */
182
+ name?: string | null;
183
+ }
184
+ export interface NestedTimeSlot {
185
+ /** Service ID of the nested time slot. */
186
+ serviceId?: string;
187
+ /**
188
+ * Local start date of the nested time slot in ISO-8601 format.
189
+ * For example, "2024-01-30T13:30:00".
190
+ */
191
+ localStartDate?: string;
192
+ /**
193
+ * Local end date of the nested time slot in ISO-8601 format.
194
+ * For example, "2024-01-30T14:30:00".
195
+ */
196
+ localEndDate?: string;
197
+ /**
198
+ * List of `AvailableResources` for the nested time slot.
199
+ * Each `AvailableResources` contains information about available resources of the same type.
200
+ */
201
+ availableResources?: AvailableResources[];
202
+ }
203
+ export interface CalculateEventBasedAvailabilityRequest {
204
+ serviceIds?: string[];
205
+ from?: string;
206
+ to?: string;
207
+ timeZone?: string;
208
+ /**
209
+ * TODO good definition of what bookable means https://github.com/wix-private/scheduler/pull/18267/files?file-filters%5B%5D=.proto&show-viewed-files=true#r1199809006
210
+ * TODO: Locks are not taken into account. // Class is not supported yet. (relevant only for classes with waiting list)
211
+ * Aliza's suggestion to consider locks in bookable
212
+ */
213
+ bookable?: boolean | null;
214
+ /** support filtering by location type, or by locationId. Other fields like `name` are ignored */
215
+ location?: Location[];
216
+ resourceIds?: string[];
217
+ /** if not empty, return slots with openSpots >= X */
218
+ openSpots?: number | null;
219
+ /**
220
+ * each nested field is checked on its own. i.e. if `too_early_to_book` is defined and `too_late_to_book` is not defined
221
+ * we will return slots for which `too_early_to_book` is same as on the request, regardless of `too_late_to_book`.
222
+ */
223
+ bookingPolicyViolations?: BookingPolicyViolations;
224
+ /**
225
+ * Maximum number of slots to load for each date. For example, if `slots_per_day` is set to `3`,
226
+ * at most 3 available slots are returned for each day in the date range specified in the query's
227
+ * `filter`.
228
+ *
229
+ * When a day has both bookable and non-bookable slots, bookable slots are returned first.
230
+ * Non-bookable slots are returned according to the specified filters, after all
231
+ * bookable slots are already included.
232
+ */
233
+ slotsPerDay?: number | null;
234
+ cursorPaging?: CursorPaging;
235
+ }
236
+ export interface CursorPaging {
237
+ /** Number of items to load. */
238
+ limit?: number | null;
239
+ /**
240
+ * Pointer to the next or previous page in the list of results.
241
+ *
242
+ * You can get the relevant cursor token
243
+ * from the `pagingMetadata` object in the previous call's response.
244
+ * Not relevant for the first request.
245
+ */
246
+ cursor?: string | null;
247
+ }
248
+ export interface CalculateEventBasedAvailabilityResponse {
249
+ slots?: TimeSlot[];
250
+ cursorPagingMetadata?: CursorPagingMetadata;
251
+ }
252
+ export interface CursorPagingMetadata {
253
+ /** Number of items returned in the response. */
254
+ count?: number | null;
255
+ /** Offset that was requested. */
256
+ cursors?: Cursors;
257
+ /**
258
+ * Indicates if there are more results after the current page.
259
+ * If `true`, another page of results can be retrieved.
260
+ * If `false`, this is the last page.
261
+ */
262
+ hasNext?: boolean | null;
263
+ }
264
+ export interface Cursors {
265
+ /** Cursor pointing to next page in the list of results. */
266
+ next?: string | null;
267
+ /** Cursor pointing to previous page in the list of results. */
268
+ prev?: string | null;
269
+ }
270
+ export interface ListEventTimeSlotsRequest {
271
+ /** The services for which the time slots are being returned. */
272
+ serviceIds?: string[] | null;
273
+ /**
274
+ * Local start date for which event time slots are returned, in ISO-8601 format.
275
+ * E.g, "2024-01-30T13:30:00".
276
+ * Required, unless `cursorPaging` is provided.
277
+ */
278
+ fromLocalDate?: string | null;
279
+ /**
280
+ * Local end date for which event time slots are returned, in ISO-8601 format.
281
+ * E.g, "2024-01-30T13:30:00".
282
+ * Required, unless `cursorPaging` is provided.
283
+ */
284
+ toLocalDate?: string | null;
285
+ /**
286
+ * The time zone, in IANA time zone format.
287
+ * Default is the Wix Business time zone.
288
+ */
289
+ timeZone?: string | null;
290
+ /** TODO good definition of what bookable means https://github.com/wix-private/scheduler/pull/18267/files?file-filters%5B%5D=.proto&show-viewed-files=true#r1199809006 */
291
+ bookable?: boolean | null;
292
+ /** support filtering by location type, or by locationId. Other fields like `name` are ignored */
293
+ location?: Location[];
294
+ /** TODO: maxsize && do we need include_resource_type_id here? also is the behavior is the same as availabilityTimeSlots, we won't return resources by default? */
295
+ resourceIds?: string[] | null;
296
+ /** if not empty, return slots with remainingCapacity >= X */
297
+ remainingCapacity?: number | null;
298
+ /**
299
+ * each nested field is checked on its own. i.e. if `too_early_to_book` is defined and `too_late_to_book` is not defined
300
+ * we will return slots for which `too_early_to_book` is same as on the request, regardless of `too_late_to_book`.
301
+ */
302
+ bookingPolicyViolations?: BookingPolicyViolations;
303
+ /**
304
+ * Maximum number of slots to load for each date. For example, if `slots_per_day` is set to `3`,
305
+ * at most 3 available slots are returned for each day in the date range specified in the query's
306
+ * `filter`.
307
+ *
308
+ * When a day has both bookable and non-bookable slots, bookable slots are returned first.
309
+ * Non-bookable slots are returned according to the specified filters, after all
310
+ * bookable slots are already included.
311
+ */
312
+ timeSlotsPerDay?: number | null;
313
+ cursorPaging?: CursorPaging;
314
+ }
315
+ export interface ListEventTimeSlotsResponse {
316
+ /** TODO: maxsize */
317
+ timeSlots?: TimeSlot[];
318
+ /** The time zone, in IANA time zone format. */
319
+ timeZone?: string | null;
320
+ cursorPagingMetadata?: CursorPagingMetadata;
321
+ }
322
+ export interface ListMultiServiceAvailabilityTimeSlotsRequest {
323
+ /**
324
+ * Services for which the multiService time slots are being returned for.
325
+ * Each service contains its own resources filters within.
326
+ *
327
+ * MinSize: 2.
328
+ * MaxSize: 8.
329
+ */
330
+ services?: Service[];
331
+ /**
332
+ * Lower boundary for `localStartDate` to include in response, in ISO-8601 format.
333
+ * For example, "2024-01-30T13:30:00".
334
+ * Required, unless `cursorPaging`.`cursor` is provided.
335
+ * > __Note:__: Each returned `TimeSlot` in response has a `localStartDate`
336
+ * > within the provided `fromLocalDate` and `toLocalDate` exclusive.
337
+ */
338
+ fromLocalDate?: string | null;
339
+ /**
340
+ * Upper boundary for `localStartDate` to include in response, in ISO-8601 format.
341
+ * For example, "2024-01-30T14:30:00".
342
+ * Required, unless `cursorPaging`.`cursor` is provided.
343
+ * > __Note:__: Each returned `TimeSlot` in response has a `localStartDate`
344
+ * > within the provided `fromLocalDate` and `toLocalDate` exclusive.
345
+ */
346
+ toLocalDate?: string | null;
347
+ /**
348
+ * Time zone, in IANA time zone format.
349
+ * Required, unless `cursorPaging`.`cursor` is provided.
350
+ */
351
+ timeZone?: string | null;
352
+ /**
353
+ * Location for which the multiService time slots are being returned for.
354
+ *
355
+ * You can specify location or location type for which the time slots will be returned for.
356
+ * > __Note:__ Supports filtering by location type, or by locationId. Other fields like `name` are ignored.
357
+ * > If locationType is `BUSINESS`, you __must__ provide a locationId.
358
+ */
359
+ location?: Location;
360
+ /**
361
+ * Whether the `TimeSlot` is bookable according all of the services booking policies.
362
+ *
363
+ * If booking any of the `TimeSlot`.`NestedTimeSlot`'s violates any of its services bookings policies,
364
+ * returns as `false`. Otherwise, returns as `true`.
365
+ *
366
+ * > __Note:__
367
+ * > A `TimeSlot` with a `NestedTimeSlot` that doesn't meet its service's bookings policies will be returned with `bookable` = false,
368
+ * > while a `TimeSlot` with no available resources will not be returned at all.
369
+ */
370
+ bookable?: boolean | null;
371
+ /**
372
+ * Indicators for service's booking policy violations for booking the `TimeSlot`.
373
+ *
374
+ * A bookable time slot must not violate any policy,
375
+ * therefor, this filter is only relevant when `bookable` filter is false.
376
+ *
377
+ * Each nested field is checked on all `NestedTimeSlot`'s. For example, if only one of the `NestedTimeSlot`'s
378
+ * has a service with `tooEarlyToBook` same as in the request, we return the `TimeSlot` regardless of whether
379
+ * the other `NestedTimeSlots` has the same `tooEarlyToBook` as in request.
380
+ *
381
+ * Each nested field is checked on its own. For example, if `tooEarlyToBook` is defined and `bookOnlineDisabled` is not defined
382
+ * we return slots for which `tooEarlyToBook` is same as on the request, regardless of `bookOnlineDisabled`.
383
+ */
384
+ bookingPolicyViolations?: BookingPolicyViolations;
385
+ /**
386
+ * Maximum number of slots to load for each day. For example, if `timeSlotsPerDay` is set to `3`,
387
+ * we return at most 3 available `TimeSlot`'s for each day within the date range specified in request.
388
+ *
389
+ * By default,
390
+ * if `bookable` filter was not specified,
391
+ * and a day has both `bookable` and `un-bookable` slots, `bookable` slots are returned first.
392
+ *
393
+ * If the number of `bookable` slots is less than the requested `timeSlotsPerDay`,
394
+ * `un-bookable` slots will be returned according to the specified filters.
395
+ */
396
+ timeSlotsPerDay?: number | null;
397
+ /**
398
+ * CursorPaging.
399
+ *
400
+ * Enables you to fetch `TimeSlot`'s in smaller, more manageable chunks
401
+ * by setting a limit on the number of `TimeSlots` returned in response.
402
+ * This is useful in order to enhance efficiency of data retrieval and reduce load on both the client and server.
403
+ *
404
+ * If there are more results than the specified limit, the response will contain a `cursorPagingMetaData`
405
+ * with a cursor pointing to next page of results. In order to fetch the next page of results, you should pass the
406
+ * returned cursor to the next call as `cursorPaging`.`cursor`.
407
+ *
408
+ * For the first call, you should only specify the `limit` for the results page.
409
+ * For each following call, you should only pass the previous returned cursor as `cursorPaging`.`cursor`
410
+ * the `cursorPaging`.`limit`. You may pass a different `limit`.
411
+ * No need to specify any additional parameters.
412
+ *
413
+ * __TODO: This is only describes the current behavior, should be fixed__
414
+ * <blockquote class="important">
415
+ * <p><strong>Important:</strong><br/>
416
+ * If you only provide a `cursorPaging`.`cursor`,
417
+ * the response will contain the default size of results = 1000.
418
+ * </p>
419
+ * </blockquote>
420
+ *
421
+ * cursorPaging.limit:
422
+ * Default: 1000
423
+ * Max: 1000
424
+ */
425
+ cursorPaging?: CommonCursorPaging;
426
+ }
427
+ export interface Service {
428
+ /** Service ID. */
429
+ serviceId?: string;
430
+ /** Resources to include in response. */
431
+ resourceIds?: string[];
432
+ }
433
+ export interface CommonCursorPaging {
434
+ /**
435
+ * Number of items to load.
436
+ *
437
+ * Default: `1000`
438
+ * Max: `1000`
439
+ */
440
+ limit?: number | null;
441
+ /**
442
+ * Pointer to the next or previous page in the list of results.
443
+ *
444
+ * You can get the relevant cursor token
445
+ * from the `pagingMetadata` object in the previous call's response.
446
+ * Not relevant for the first request.
447
+ */
448
+ cursor?: string | null;
449
+ }
450
+ export interface ListMultiServiceAvailabilityTimeSlotsResponse {
451
+ /** Time slots. */
452
+ timeSlots?: TimeSlot[];
453
+ /**
454
+ * Time zone, in IANA time zone format.
455
+ * Shared for all `TimeSlot`'s in response.
456
+ */
457
+ timeZone?: string | null;
458
+ /**
459
+ * CursorPagingMetaData.
460
+ * Contains information about the next page of results.
461
+ *
462
+ * By default,
463
+ * if there are more than 1000 results,
464
+ * the response will contain a `cursorPagingMetaData` with a cursor to the next page of results.
465
+ *
466
+ * <blockquote class="important">
467
+ * <p><strong>Important:</strong><br/>
468
+ * `count` is not supported.
469
+ * </p>
470
+ * </blockquote>
471
+ */
472
+ cursorPagingMetadata?: CommonCursorPagingMetadata;
473
+ }
474
+ export interface CommonCursorPagingMetadata {
475
+ /** Offset that was requested. */
476
+ cursors?: CommonCursors;
477
+ /**
478
+ * Indicates if there are more results after the current page.
479
+ * If `true`, another page of results can be retrieved.
480
+ * If `false`, this is the last page.
481
+ */
482
+ hasNext?: boolean | null;
483
+ }
484
+ export interface CommonCursors {
485
+ /** Cursor pointing to next page in the list of results. */
486
+ next?: string | null;
487
+ /** Cursor pointing to previous page in the list of results. */
488
+ prev?: string | null;
489
+ }
490
+ export interface GetMultiServiceAvailabilityTimeSlotRequest {
491
+ /**
492
+ * Services for which the multiService time slots are being returned for.
493
+ * Each service contains its own resources filters within.
494
+ *
495
+ * MinSize: 2.
496
+ * MaxSize: 8.
497
+ */
498
+ services: Service[];
499
+ /**
500
+ * Local start date of the time slot, in ISO-8601 format.
501
+ * For example, "2024-01-30T13:30:00".
502
+ */
503
+ localStartDate: string;
504
+ /**
505
+ * Local end date of the time slot, in ISO-8601 format.
506
+ * For example, "2024-01-30T14:30:00".
507
+ */
508
+ localEndDate: string;
509
+ /** Time zone, in IANA time zone format. */
510
+ timeZone: string | null;
511
+ /**
512
+ * The location of the time slot.
513
+ *
514
+ * You must provide a specific `locationType`.
515
+ * If locationType is `BUSINESS`, you __must__ also provide a locationId.
516
+ *
517
+ * <blockquote class="important">
518
+ * <p><strong>Important:</strong><br/>
519
+ * `name` and `formattedAddress` are ignored.
520
+ * </p>
521
+ * </blockquote>
522
+ */
523
+ location: Location;
524
+ }
525
+ export interface GetMultiServiceAvailabilityTimeSlotResponse {
526
+ /** Time slot. */
527
+ timeSlot?: TimeSlot;
528
+ /** The time zone, in IANA time zone format. */
529
+ timeZone?: string | null;
530
+ }
531
+ export interface ListAvailabilityTimeSlotsRequest {
532
+ /**
533
+ * Service ID for which the time slots are being returned for.
534
+ * Currently supports only services of type `Appointment`.
535
+ * Required, unless `cursorPaging`.`cursor` is provided.
536
+ */
537
+ serviceId?: string | null;
538
+ /**
539
+ * Lower boundary for `localStartDate` to include in response, in ISO-8601 format.
540
+ * For example, "2024-01-30T13:30:00".
541
+ * Required, unless `cursorPaging`.`cursor` is provided.
542
+ * > __Note:__: Each returned `TimeSlot` in response has a `localStartDate`
543
+ * > within the provided `fromLocalDate` and `toLocalDate` exclusive.
544
+ */
545
+ fromLocalDate?: string | null;
546
+ /**
547
+ * Upper boundary for `localStartDate` to include in response, in ISO-8601 format.
548
+ * For example, "2024-01-30T14:30:00".
549
+ * Required, unless `cursorPaging`.`cursor` is provided.
550
+ * > __Note:__: Each returned `TimeSlot` in response has a `localStartDate`
551
+ * > within the provided `fromLocalDate` and `toLocalDate` exclusive.
552
+ * > The `localEndDate` of the returned `TimeSlot` is the `TimeSlot`'s `localStartDate` + the service duration
553
+ */
554
+ toLocalDate?: string | null;
555
+ /**
556
+ * Time zone, in IANA time zone format.
557
+ * Required, unless `cursorPaging`.`cursor` is provided.
558
+ */
559
+ timeZone?: string | null;
560
+ /**
561
+ * Locations to include in response.
562
+ *
563
+ * By default,
564
+ * if no locations are provided,
565
+ * the response contains `TimeSlot`'s for all locations where the service is available.
566
+ *
567
+ * You can specify locations or location types for which the time slots will be returned for.
568
+ * > __Note:__ Supports filtering by location type, or by locationId. Other fields like `name` are ignored.
569
+ * > If locationType is `BUSINESS`, you __must__ provide a locationId.
570
+ */
571
+ locations?: Location[];
572
+ /**
573
+ * Resources to include in response.
574
+ *
575
+ * If specified,
576
+ * the returned time slots will contain __up__ to 10 available resources out of the provided list.
577
+ * Otherwise, the returned time slots returns with an empty `AvailableResources`.
578
+ * > __Note:__ Not specifying `resourceIds` can be handy in case you want to avoid large response in flows that only
579
+ * > interested whether the time slots are available or not. [An example for such flow](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/service-availability-time-slots/sample-flows#all-apis_wix-service-availability_service-availability-time-slots_sample-flows_let-your-customers-to-dynamically-select-an-available-time-slot-for-any-of-your-business-services).
580
+ */
581
+ resourceIds?: string[];
582
+ /**
583
+ * Resource type ID's to include in response, this is in addition to the requested resourceIds.
584
+ *
585
+ * If specified in request, the returned time slots will contain __up__ to 10 `AvailableResources` with `ResourceTypeId`
586
+ * out of those specified, each contains __up__ to 10 available resources of this type.
587
+ */
588
+ includeResourceTypeIds?: string[];
589
+ /**
590
+ * Whether the `TimeSlot` is bookable according to the service's booking policies.
591
+ *
592
+ * If booking this time slot does not violates any of the service's booking policies,
593
+ * returns as `true`. Otherwise, returns as `false`.
594
+ *
595
+ * > __Note:__
596
+ * > A time slot that doesn't meet the service's bookings policies will be returned with `bookable` = false,
597
+ * > while a time slot with no available resources will not be returned at all.
598
+ */
599
+ bookable?: boolean | null;
600
+ /**
601
+ * Indicators for service's booking policy violations for booking the `TimeSlot`.
602
+ *
603
+ * A bookable time slot must not violate any policy,
604
+ * therefor, this filter is only relevant when `bookable` filter is false.
605
+ *
606
+ * Each nested field is checked on its own. i.e. if `tooEarlyToBook` is defined and `bookOnlineDisabled` is not defined
607
+ * we return slots for which `tooEarlyToBook` is same as on the request, regardless of `bookOnlineDisabled`.
608
+ */
609
+ bookingPolicyViolations?: BookingPolicyViolations;
610
+ /**
611
+ * Maximum number of slots to load for each day. For example, if `timeSlotsPerDay` is set to `3`,
612
+ * we return at most 3 available `TimeSlot`'s for each day within the date range specified in request.
613
+ *
614
+ * By default,
615
+ * if `bookable` filter was not specified,
616
+ * and a day has both `bookable` and `un-bookable` slots, `bookable` slots are returned first.
617
+ *
618
+ * If the number of `bookable` slots is less than the requested `timeSlotsPerDay`,
619
+ * `un-bookable` slots will be returned according to the specified filters.
620
+ */
621
+ timeSlotsPerDay?: number | null;
622
+ /**
623
+ * CursorPaging.
624
+ *
625
+ * Enables you to fetch `TimeSlot`'s in smaller, more manageable chunks
626
+ * by setting a limit on the number of `TimeSlots` returned in response.
627
+ * This is useful in order to enhance efficiency of data retrieval and reduce load on both the client and server.
628
+ *
629
+ * If there are more results than the specified limit, the response will contain a `cursorPagingMetaData`
630
+ * with a cursor pointing to next page of results. In order to fetch the next page of results, you should pass the
631
+ * returned cursor to the next call as `cursorPaging`.`cursor`.
632
+ *
633
+ * For the first call, you should only specify the `limit` for the results page.
634
+ * For each following call, you should only pass the previous returned cursor as `cursorPaging`.`cursor`
635
+ * the `cursorPaging`.`limit`. You may pass a different `limit`.
636
+ * No need to specify any additional parameters.
637
+ *
638
+ * __TODO: This is only describes the current behavior, should be fixed__
639
+ * <blockquote class="important">
640
+ * <p><strong>Important:</strong><br/>
641
+ * If you only provide a `cursorPaging`.`cursor`,
642
+ * the response will contain the default size of results = 1000.
643
+ * </p>
644
+ * </blockquote>
645
+ *
646
+ * cursorPaging.limit:
647
+ * Default: 1000
648
+ * Max: 1000
649
+ */
650
+ cursorPaging?: CommonCursorPaging;
651
+ }
652
+ export interface ListAvailabilityTimeSlotsResponse {
653
+ /** Time slots. */
654
+ timeSlots?: TimeSlot[];
655
+ /**
656
+ * Time zone, in IANA time zone format.
657
+ * Shared for all `TimeSlot`'s in response.
658
+ */
659
+ timeZone?: string | null;
660
+ /**
661
+ * CursorPagingMetaData.
662
+ * Contains information about the next page of results.
663
+ *
664
+ * By default,
665
+ * if there are more than 1000 results,
666
+ * the response will contain a `cursorPagingMetaData` with a cursor to the next page of results.
667
+ *
668
+ * <blockquote class="important">
669
+ * <p><strong>Important:</strong><br/>
670
+ * `count` is not supported.
671
+ * </p>
672
+ * </blockquote>
673
+ */
674
+ cursorPagingMetadata?: CommonCursorPagingMetadata;
675
+ }
676
+ export interface GetAvailabilityTimeSlotRequest {
677
+ /**
678
+ * Service ID of the time slot.
679
+ * Currently supports only services of type `Appointment`.
680
+ */
681
+ serviceId: string;
682
+ /**
683
+ * Local start date of the time slot, in ISO-8601 format.
684
+ * For example, "2024-01-30T13:30:00".
685
+ */
686
+ localStartDate: string;
687
+ /**
688
+ * Local end date of the time slot, in ISO-8601 format.
689
+ * For example, "2024-01-30T14:30:00".
690
+ */
691
+ localEndDate: string;
692
+ /** Time zone, in IANA time zone format. */
693
+ timeZone: string | null;
694
+ /**
695
+ * The location of the time slot.
696
+ *
697
+ * You must provide a specific `locationType`.
698
+ * If locationType is `BUSINESS`, you __must__ also provide a locationId.
699
+ *
700
+ * <blockquote class="important">
701
+ * <p><strong>Important:</strong><br/>
702
+ * `name` and `formattedAddress` are ignored.
703
+ * </p>
704
+ * </blockquote>
705
+ */
706
+ location: Location;
707
+ /**
708
+ * Resources to include in response.
709
+ *
710
+ * If specified,
711
+ * the returned time slot contain only the available resources out of provided list.
712
+ * Otherwise, the returned time slot returned with all possible `AvailableResources`.
713
+ * > __Note:__ This can be handy in case you want to avoid large response in flows that only
714
+ * > interested to check the availability of the time slot for specific resources.
715
+ */
716
+ resourceIds?: string[];
717
+ /**
718
+ * Resource type ID's to include in response, this is in addition to the requested resourceIds.
719
+ *
720
+ * If specified in request, the returned time slot contain only the `AvailableResources` with `ResourceTypeId`
721
+ * out of those specified, each contains all the available resources of this type.
722
+ */
723
+ includeResourceTypeIds?: string[];
724
+ }
725
+ export interface GetAvailabilityTimeSlotResponse {
726
+ /** Time slot. */
727
+ timeSlot?: TimeSlot;
728
+ /** Time zone, in IANA time zone format. */
729
+ timeZone?: string | null;
730
+ }
731
+ export interface ListMultiServiceAvailabilityTimeSlotsResponseNonNullableFields {
732
+ timeSlots: {
733
+ location?: {
734
+ locationType: LocationType;
735
+ };
736
+ availableResources: {
737
+ resources: {
738
+ _id: string;
739
+ }[];
740
+ }[];
741
+ nestedTimeSlots: {
742
+ serviceId: string;
743
+ localStartDate: string;
744
+ localEndDate: string;
745
+ availableResources: {
746
+ resources: {
747
+ _id: string;
748
+ }[];
749
+ }[];
750
+ }[];
751
+ }[];
752
+ }
753
+ export interface GetMultiServiceAvailabilityTimeSlotResponseNonNullableFields {
754
+ timeSlot?: {
755
+ location?: {
756
+ locationType: LocationType;
757
+ };
758
+ availableResources: {
759
+ resources: {
760
+ _id: string;
761
+ }[];
762
+ }[];
763
+ nestedTimeSlots: {
764
+ serviceId: string;
765
+ localStartDate: string;
766
+ localEndDate: string;
767
+ availableResources: {
768
+ resources: {
769
+ _id: string;
770
+ }[];
771
+ }[];
772
+ }[];
773
+ };
774
+ }
775
+ export interface ListAvailabilityTimeSlotsResponseNonNullableFields {
776
+ timeSlots: {
777
+ location?: {
778
+ locationType: LocationType;
779
+ };
780
+ availableResources: {
781
+ resources: {
782
+ _id: string;
783
+ }[];
784
+ }[];
785
+ nestedTimeSlots: {
786
+ serviceId: string;
787
+ localStartDate: string;
788
+ localEndDate: string;
789
+ availableResources: {
790
+ resources: {
791
+ _id: string;
792
+ }[];
793
+ }[];
794
+ }[];
795
+ }[];
796
+ }
797
+ export interface GetAvailabilityTimeSlotResponseNonNullableFields {
798
+ timeSlot?: {
799
+ location?: {
800
+ locationType: LocationType;
801
+ };
802
+ availableResources: {
803
+ resources: {
804
+ _id: string;
805
+ }[];
806
+ }[];
807
+ nestedTimeSlots: {
808
+ serviceId: string;
809
+ localStartDate: string;
810
+ localEndDate: string;
811
+ availableResources: {
812
+ resources: {
813
+ _id: string;
814
+ }[];
815
+ }[];
816
+ }[];
817
+ };
818
+ }
819
+ /**
820
+ * Retrieves a list of multiService `TimeSlot`'s that match the provided filters.
821
+ * <blockquote class="important">
822
+ * <p><strong>Important:</strong><br/>
823
+ * Currently supported only for services of type `APPOINTMENT`.
824
+ * </p>
825
+ * </blockquote>
826
+ *
827
+ * The request body __must__ include one of:
828
+ *
829
+ * + All of the following filters: `serviceId`, `fromLocalDate`, `toLocalDate`, `location`, and `timeZone`. You may add additional filters as you wish.
830
+ * + A `cursorPaging` with a valid `cursor` from previous response.
831
+ *
832
+ *
833
+ * Each [TimeSlot](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/availability-time-slots/time-slot-object) in response
834
+ * represents the availability of the given list of services in a specific location, within a given range of time.
835
+ *
836
+ * Each `TimeSlot`.`NestedTimeSlot` represents a single service from the given list. The order of the `NestedTimeSlots` is the same as the order
837
+ * of the given services in request.
838
+ *
839
+ * The first `NestedTimeSlot` has `localStartDate` within the given `fromLocalDate` and `toLocalDate` - exclusive,
840
+ * and each following `NestedTimeSlot` has a `localStartDate` that equals to the previous `NestedTimeSlot`'s `localEndDate`.
841
+ *
842
+ * > __Notes:__
843
+ * > + All nested time slots share the same location.
844
+ * > + You can pass up to 8 services in request.
845
+ *
846
+ * ### AvailableResources in response:
847
+ * <blockquote class="important">
848
+ * <p><strong>Important:</strong><br/>
849
+ * By default,
850
+ * if you don't specify `service`.`includeResourceTypeIds` or `service`.`resourceIds` filters in request,
851
+ * we return `TimeSlot`.`NestedTimeSlot`'s with an empty `AvailableResources`.
852
+ * </p>
853
+ * </blockquote>
854
+ *
855
+ * If you wish to get a list of available resources for a `TimeSlot`.`NestedTimeSlot` you should either:
856
+ * + provide `service`.`resourceIds` in request.
857
+ * + provide `service`.`includeResourceTypeIds` in request.
858
+ *
859
+ * > __Notes:__
860
+ * >
861
+ * > + In both cases the returned `TimeSlot`.`NestedTimeSlot`'s contains __up__ to 10 `AvailableResources` that match the provided filters.
862
+ * > Each `AvailableResources` contains __up__ to 10 available `resources` of the same type that match the provided filters.
863
+ * >
864
+ * > + If an `AvailableResources` has more available resources which are not listed within it,
865
+ * > we return `AvailableResources`.`hasMoreAvailableResources` as true.
866
+ * > + If you wish to get the full available resources list for all `NestedTimeSlot` of a specific `TimeSlot`,
867
+ * > you can call [GetMultiServiceAvailabilityTimeSlot](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/multi-service-availability-time-slots/get-multi-service-availability-time-slot).
868
+ *
869
+ *
870
+ * ### Availability VS Bookability:
871
+ * An available time slot is not necessarily bookable.
872
+ *
873
+ * The `bookable` field of a `TimeSlot` indicates whether the customer can book all of the of the services within the given time slot,
874
+ * at a specific period of time.
875
+ * Read more about [Availability VS Bookability](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/multi-service-availability-time-slots/introduction#all-apis_wix-service-availability_multi-service-availability-time-slots_introduction_availability-vs-bookability).
876
+ *
877
+ * By default,
878
+ * + The response does not contains unavailable `TimeSlot`'s.
879
+ * For example,
880
+ * if there are no available resources to provide the service from `2024-01-30T14:30:00` to `2024-01-30T15:30:00`,
881
+ * we don't return `TimeSlot`'s with `localStartDate` within this range.
882
+ * + The response contains both `bookable` and `un-bookable` `TimeSlot`'s.
883
+ * For example,
884
+ * if one of the services has a booking policy which enforces booking the service up to 10 minutes before the session starts,
885
+ * we return `TimeSlot`'s with the violating `localStartDate` with `bookable` as false.
886
+ * If you want to list only __bookable__ `TimeSlots` you should pass `bookable` as true.
887
+ * + If booking one of the `NestedTimeSlot`'s violates one of the corresponding service's booking policies,
888
+ * the `TimeSlot` returns with `bookable` as false. There is no indication which service's policy was violated.
889
+ *
890
+ * <blockquote class="important">
891
+ * <p><strong>Important:</strong><br/>
892
+ * Because of DST, there are edge cases where certain times either do not exist or exist twice for a local time zone.
893
+ * Read about [DST Handling](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/multi-service-availability-time-slots/introduction#all-apis_wix-service-availability_multi-service-availability-time-slots_introduction_daylight-saving-time-dst-handling)
894
+ * </p>
895
+ * </blockquote>
896
+ *
897
+ *
898
+ * ### Pagination:
899
+ * You can specify how many `TimeSlot`'s will return in response by providing a `limit`
900
+ * for the `cursorPaging` in request.
901
+ *
902
+ * If there are more `TimeSlot`s that match the provided filters, we return a `cursorPagingMetaData`
903
+ * with `hasNext` = true and a `cursors`.`next` that points to the next page of results.
904
+ * In order to retrieve the next page of results, you should only provide `cursorPaging` with a limit and the cursor
905
+ * you got in previous call to `cursorPaging`.`cursor` in the request of the following call.
906
+ *
907
+ * By default,
908
+ * the response contains at most 1000 results.
909
+ * If there are more than 1000 results, we return a `cursorPagingMetadata` with
910
+ * a cursor for the next page of results, regardless of whether a `cursorPaging`
911
+ * was provided in request.
912
+ *
913
+ * #### ListAvailabilityTimeSlots runs with the following defaults:
914
+ * + `cursorPaging`.`limit` is 1000.
915
+ * + `localStartDate` is sorted in `ASC` order.
916
+ * @public
917
+ * @documentationMaturity preview
918
+ * @permissionScope Read Bookings - Public Data
919
+ * @permissionScope Manage Bookings Services and Settings
920
+ * @permissionScope Read Bookings - Including Participants
921
+ * @permissionScope Read Bookings - all read permissions
922
+ * @permissionScope Read Bookings Calendar Availability
923
+ * @permissionScope Manage Bookings - all permissions
924
+ * @applicableIdentity APP
925
+ * @applicableIdentity MEMBER
926
+ * @applicableIdentity VISITOR
927
+ */
928
+ export declare function listMultiServiceAvailabilityTimeSlots(options?: ListMultiServiceAvailabilityTimeSlotsOptions): Promise<ListMultiServiceAvailabilityTimeSlotsResponse & ListMultiServiceAvailabilityTimeSlotsResponseNonNullableFields>;
929
+ export interface ListMultiServiceAvailabilityTimeSlotsOptions {
930
+ /**
931
+ * Services for which the multiService time slots are being returned for.
932
+ * Each service contains its own resources filters within.
933
+ *
934
+ * MinSize: 2.
935
+ * MaxSize: 8.
936
+ */
937
+ services?: Service[];
938
+ /**
939
+ * Lower boundary for `localStartDate` to include in response, in ISO-8601 format.
940
+ * For example, "2024-01-30T13:30:00".
941
+ * Required, unless `cursorPaging`.`cursor` is provided.
942
+ * > __Note:__: Each returned `TimeSlot` in response has a `localStartDate`
943
+ * > within the provided `fromLocalDate` and `toLocalDate` exclusive.
944
+ */
945
+ fromLocalDate?: string | null;
946
+ /**
947
+ * Upper boundary for `localStartDate` to include in response, in ISO-8601 format.
948
+ * For example, "2024-01-30T14:30:00".
949
+ * Required, unless `cursorPaging`.`cursor` is provided.
950
+ * > __Note:__: Each returned `TimeSlot` in response has a `localStartDate`
951
+ * > within the provided `fromLocalDate` and `toLocalDate` exclusive.
952
+ */
953
+ toLocalDate?: string | null;
954
+ /**
955
+ * Time zone, in IANA time zone format.
956
+ * Required, unless `cursorPaging`.`cursor` is provided.
957
+ */
958
+ timeZone?: string | null;
959
+ /**
960
+ * Location for which the multiService time slots are being returned for.
961
+ *
962
+ * You can specify location or location type for which the time slots will be returned for.
963
+ * > __Note:__ Supports filtering by location type, or by locationId. Other fields like `name` are ignored.
964
+ * > If locationType is `BUSINESS`, you __must__ provide a locationId.
965
+ */
966
+ location?: Location;
967
+ /**
968
+ * Whether the `TimeSlot` is bookable according all of the services booking policies.
969
+ *
970
+ * If booking any of the `TimeSlot`.`NestedTimeSlot`'s violates any of its services bookings policies,
971
+ * returns as `false`. Otherwise, returns as `true`.
972
+ *
973
+ * > __Note:__
974
+ * > A `TimeSlot` with a `NestedTimeSlot` that doesn't meet its service's bookings policies will be returned with `bookable` = false,
975
+ * > while a `TimeSlot` with no available resources will not be returned at all.
976
+ */
977
+ bookable?: boolean | null;
978
+ /**
979
+ * Indicators for service's booking policy violations for booking the `TimeSlot`.
980
+ *
981
+ * A bookable time slot must not violate any policy,
982
+ * therefor, this filter is only relevant when `bookable` filter is false.
983
+ *
984
+ * Each nested field is checked on all `NestedTimeSlot`'s. For example, if only one of the `NestedTimeSlot`'s
985
+ * has a service with `tooEarlyToBook` same as in the request, we return the `TimeSlot` regardless of whether
986
+ * the other `NestedTimeSlots` has the same `tooEarlyToBook` as in request.
987
+ *
988
+ * Each nested field is checked on its own. For example, if `tooEarlyToBook` is defined and `bookOnlineDisabled` is not defined
989
+ * we return slots for which `tooEarlyToBook` is same as on the request, regardless of `bookOnlineDisabled`.
990
+ */
991
+ bookingPolicyViolations?: BookingPolicyViolations;
992
+ /**
993
+ * Maximum number of slots to load for each day. For example, if `timeSlotsPerDay` is set to `3`,
994
+ * we return at most 3 available `TimeSlot`'s for each day within the date range specified in request.
995
+ *
996
+ * By default,
997
+ * if `bookable` filter was not specified,
998
+ * and a day has both `bookable` and `un-bookable` slots, `bookable` slots are returned first.
999
+ *
1000
+ * If the number of `bookable` slots is less than the requested `timeSlotsPerDay`,
1001
+ * `un-bookable` slots will be returned according to the specified filters.
1002
+ */
1003
+ timeSlotsPerDay?: number | null;
1004
+ /**
1005
+ * CursorPaging.
1006
+ *
1007
+ * Enables you to fetch `TimeSlot`'s in smaller, more manageable chunks
1008
+ * by setting a limit on the number of `TimeSlots` returned in response.
1009
+ * This is useful in order to enhance efficiency of data retrieval and reduce load on both the client and server.
1010
+ *
1011
+ * If there are more results than the specified limit, the response will contain a `cursorPagingMetaData`
1012
+ * with a cursor pointing to next page of results. In order to fetch the next page of results, you should pass the
1013
+ * returned cursor to the next call as `cursorPaging`.`cursor`.
1014
+ *
1015
+ * For the first call, you should only specify the `limit` for the results page.
1016
+ * For each following call, you should only pass the previous returned cursor as `cursorPaging`.`cursor`
1017
+ * the `cursorPaging`.`limit`. You may pass a different `limit`.
1018
+ * No need to specify any additional parameters.
1019
+ *
1020
+ * __TODO: This is only describes the current behavior, should be fixed__
1021
+ * <blockquote class="important">
1022
+ * <p><strong>Important:</strong><br/>
1023
+ * If you only provide a `cursorPaging`.`cursor`,
1024
+ * the response will contain the default size of results = 1000.
1025
+ * </p>
1026
+ * </blockquote>
1027
+ *
1028
+ * cursorPaging.limit:
1029
+ * Default: 1000
1030
+ * Max: 1000
1031
+ */
1032
+ cursorPaging?: CommonCursorPaging;
1033
+ }
1034
+ /**
1035
+ * Retrieves an available multiService `TimeSlot` that match the provided filters.
1036
+ *
1037
+ * Throws `SlotNotFound` if there is no such available time slot.
1038
+ *
1039
+ * <blockquote class="important">
1040
+ * <p><strong>Important:</strong><br/>
1041
+ * Currently supported only for services of type `APPOINTMENT`.
1042
+ * </p>
1043
+ * </blockquote>
1044
+ *
1045
+ * By default,
1046
+ * if you don't provide a `service`.`includeResourceTypeIds` or `service`.`resourceIds` in request,
1047
+ * we return for each `TimeSlot`.`NestedTimeSlot` all `AvailableResources` with all `AvailableResources`.`resources` which are available to provide
1048
+ * the corresponding service within the time slot.
1049
+ *
1050
+ * If you specify `service`.`includeResourceTypeIds` or `service`.`resourceIds` in request,
1051
+ * the returned `TimeSlot`.`NestedTimeSlot` for this service will contain only `AvailableResources` with at least one available resource
1052
+ * which match the given resources filters,
1053
+ * each contains all available resources out of those requested.
1054
+ *
1055
+ * + Notes:
1056
+ * + All nested time slots share the same location.
1057
+ * + You can pass up to 8 services.
1058
+ * @param services - Services for which the multiService time slots are being returned for.
1059
+ * Each service contains its own resources filters within.
1060
+ *
1061
+ * MinSize: 2.
1062
+ * MaxSize: 8.
1063
+ * @public
1064
+ * @documentationMaturity preview
1065
+ * @requiredField options
1066
+ * @requiredField options.localEndDate
1067
+ * @requiredField options.localStartDate
1068
+ * @requiredField options.location
1069
+ * @requiredField options.location.locationType
1070
+ * @requiredField options.timeZone
1071
+ * @requiredField services
1072
+ * @requiredField services.serviceId
1073
+ * @permissionScope Read Bookings - Public Data
1074
+ * @permissionScope Manage Bookings Services and Settings
1075
+ * @permissionScope Read Bookings - Including Participants
1076
+ * @permissionScope Read Bookings - all read permissions
1077
+ * @permissionScope Read Bookings Calendar Availability
1078
+ * @permissionScope Manage Bookings - all permissions
1079
+ * @applicableIdentity APP
1080
+ * @applicableIdentity MEMBER
1081
+ * @applicableIdentity VISITOR
1082
+ */
1083
+ export declare function getMultiServiceAvailabilityTimeSlot(services: Service[], options: GetMultiServiceAvailabilityTimeSlotOptions): Promise<GetMultiServiceAvailabilityTimeSlotResponse & GetMultiServiceAvailabilityTimeSlotResponseNonNullableFields>;
1084
+ export interface GetMultiServiceAvailabilityTimeSlotOptions {
1085
+ /**
1086
+ * Local start date of the time slot, in ISO-8601 format.
1087
+ * For example, "2024-01-30T13:30:00".
1088
+ */
1089
+ localStartDate: string;
1090
+ /**
1091
+ * Local end date of the time slot, in ISO-8601 format.
1092
+ * For example, "2024-01-30T14:30:00".
1093
+ */
1094
+ localEndDate: string;
1095
+ /** Time zone, in IANA time zone format. */
1096
+ timeZone: string | null;
1097
+ /**
1098
+ * The location of the time slot.
1099
+ *
1100
+ * You must provide a specific `locationType`.
1101
+ * If locationType is `BUSINESS`, you __must__ also provide a locationId.
1102
+ *
1103
+ * <blockquote class="important">
1104
+ * <p><strong>Important:</strong><br/>
1105
+ * `name` and `formattedAddress` are ignored.
1106
+ * </p>
1107
+ * </blockquote>
1108
+ */
1109
+ location: Location;
1110
+ }
1111
+ /**
1112
+ * Retrieves a list of `TimeSlot`'s that match the provided filters.
1113
+ *
1114
+ * <blockquote class="important">
1115
+ * <p><strong>Important:</strong><br/>
1116
+ * Currently supported only for services of type `APPOINTMENT`.
1117
+ * </p>
1118
+ * </blockquote>
1119
+ *
1120
+ * The request body __must__ include one of:
1121
+ *
1122
+ * + All of the following filters: `serviceId`, `fromLocalDate`, `toLocalDate`, and `timeZone`. You may add additional filters as you wish.
1123
+ * + A `cursorPaging` with a valid `cursor` from previous response.
1124
+ *
1125
+ * Each [TimeSlot](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/availability-time-slots/time-slot-object) in response
1126
+ * represents the availability of the service in a specific location,
1127
+ * and has a `localStartDate` within the range of the provided `fromLocalDate` and `toLocalDate` exclusive.
1128
+ *
1129
+ *
1130
+ * ### AvailableResources in response:
1131
+ * <blockquote class="important">
1132
+ * <p><strong>Important:</strong><br/>
1133
+ * By default,
1134
+ * if you don't specify `includeResourceTypeIds` or `resourceIds` filters in request,
1135
+ * we return `TimeSlot`'s with an empty `AvailableResources`.
1136
+ * </p>
1137
+ * </blockquote>
1138
+ *
1139
+ * If you wish to get a list of available resources for each `TimeSlot` you should either:
1140
+ * + provide `resourceIds` in request.
1141
+ * + provide `includeResourceTypeIds` in request.
1142
+ *
1143
+ * > __Notes:__
1144
+ * >
1145
+ * > + In both cases the returned `TimeSlot`'s contains __up__ to 10 `AvailableResources` that match the provided filters.
1146
+ * > Each `AvailableResources` contains __up__ to 10 available `resources` of the same type that match the provided filters.
1147
+ * >
1148
+ * > + If an `AvailableResources` has more available resources which are not listed within it,
1149
+ * > we return `AvailableResources`.`hasMoreAvailableResources` as true.
1150
+ * > + If you wish to get the full available resources list for a specific `TimeSlot`,
1151
+ * > you can call [GetAvailabilityTimeSlot](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/service-availability-time-slots/get-availability-time-slot).
1152
+ *
1153
+ *
1154
+ * ### Availability VS Bookability:
1155
+ * An available time slot is not necessarily bookable.
1156
+ *
1157
+ * The `bookable` field of a `TimeSlot` indicates whether a customer can book the service within the given time slot,
1158
+ * at a specific period of time.
1159
+ * Read more about [Availability VS Bookability](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/service-availability-time-slots/introduction#all-apis_wix-service-availability_service-availability-time-slots_introduction_availability-vs-bookability).
1160
+ *
1161
+ * By default,
1162
+ * + The response does not contains unavailable `TimeSlot`'s.
1163
+ * For example,
1164
+ * if there are no available resources to provide the service from `2024-01-30T14:30:00` to `2024-01-30T15:30:00`,
1165
+ * we don't return `TimeSlot`'s with `localStartDate` within this range.
1166
+ * + The response contains both `bookable` and `un-bookable` `TimeSlot`'s.
1167
+ * For example,
1168
+ * if the service has a booking policy which enforces booking the service up to 10 minutes before the session starts,
1169
+ * we return `TimeSlot`'s with the violating `localStartDate` with `bookable` as false.
1170
+ * If you want to list only __bookable__ `TimeSlots` you should pass `bookable` as true.
1171
+ *
1172
+ * <blockquote class="important">
1173
+ * <p><strong>Important:</strong><br/>
1174
+ * Because of DST, there are edge cases where certain times either do not exist or exist twice for a local time zone.
1175
+ * Read about [DST Handling](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/service-availability-time-slots/introduction#all-apis_wix-service-availability_service-availability-time-slots_introduction_daylight-saving-time-dst-handling)
1176
+ * </p>
1177
+ * </blockquote>
1178
+ *
1179
+ *
1180
+ * ### Pagination:
1181
+ * You can specify how many `TimeSlot`'s will return in response by providing a `limit`
1182
+ * for the `cursorPaging` in request.
1183
+ *
1184
+ * If there are more `TimeSlot`s that match the provided filters, we return a `cursorPagingMetaData`
1185
+ * with `hasNext` = true and a `cursors`.`next` that points to the next page of results.
1186
+ * In order to retrieve the next page of results, you should only provide `cursorPaging` with a limit and the cursor
1187
+ * you got in previous call to `cursorPaging`.`cursor` in the request of the following call.
1188
+ *
1189
+ * By default,
1190
+ * the response contains at most 1000 results.
1191
+ * If there are more than 1000 results, we return a `cursorPagingMetadata` with
1192
+ * a cursor for the next page of results, regardless of whether a `cursorPaging`
1193
+ * was provided in request.
1194
+ *
1195
+ * #### ListAvailabilityTimeSlots runs with the following defaults:
1196
+ * + `cursorPaging`.`limit` is 1000.
1197
+ * + `localStartDate` is sorted in `ASC` order.
1198
+ * @public
1199
+ * @documentationMaturity preview
1200
+ * @permissionScope Read Bookings - Public Data
1201
+ * @permissionScope Manage Bookings Services and Settings
1202
+ * @permissionScope Read Bookings - Including Participants
1203
+ * @permissionScope Read Bookings - all read permissions
1204
+ * @permissionScope Read Bookings Calendar Availability
1205
+ * @permissionScope Manage Bookings - all permissions
1206
+ * @applicableIdentity APP
1207
+ * @applicableIdentity MEMBER
1208
+ * @applicableIdentity VISITOR
1209
+ */
1210
+ export declare function listAvailabilityTimeSlots(options?: ListAvailabilityTimeSlotsOptions): Promise<ListAvailabilityTimeSlotsResponse & ListAvailabilityTimeSlotsResponseNonNullableFields>;
1211
+ export interface ListAvailabilityTimeSlotsOptions {
1212
+ /**
1213
+ * Service ID for which the time slots are being returned for.
1214
+ * Currently supports only services of type `Appointment`.
1215
+ * Required, unless `cursorPaging`.`cursor` is provided.
1216
+ */
1217
+ serviceId?: string | null;
1218
+ /**
1219
+ * Lower boundary for `localStartDate` to include in response, in ISO-8601 format.
1220
+ * For example, "2024-01-30T13:30:00".
1221
+ * Required, unless `cursorPaging`.`cursor` is provided.
1222
+ * > __Note:__: Each returned `TimeSlot` in response has a `localStartDate`
1223
+ * > within the provided `fromLocalDate` and `toLocalDate` exclusive.
1224
+ */
1225
+ fromLocalDate?: string | null;
1226
+ /**
1227
+ * Upper boundary for `localStartDate` to include in response, in ISO-8601 format.
1228
+ * For example, "2024-01-30T14:30:00".
1229
+ * Required, unless `cursorPaging`.`cursor` is provided.
1230
+ * > __Note:__: Each returned `TimeSlot` in response has a `localStartDate`
1231
+ * > within the provided `fromLocalDate` and `toLocalDate` exclusive.
1232
+ * > The `localEndDate` of the returned `TimeSlot` is the `TimeSlot`'s `localStartDate` + the service duration
1233
+ */
1234
+ toLocalDate?: string | null;
1235
+ /**
1236
+ * Time zone, in IANA time zone format.
1237
+ * Required, unless `cursorPaging`.`cursor` is provided.
1238
+ */
1239
+ timeZone?: string | null;
1240
+ /**
1241
+ * Locations to include in response.
1242
+ *
1243
+ * By default,
1244
+ * if no locations are provided,
1245
+ * the response contains `TimeSlot`'s for all locations where the service is available.
1246
+ *
1247
+ * You can specify locations or location types for which the time slots will be returned for.
1248
+ * > __Note:__ Supports filtering by location type, or by locationId. Other fields like `name` are ignored.
1249
+ * > If locationType is `BUSINESS`, you __must__ provide a locationId.
1250
+ */
1251
+ locations?: Location[];
1252
+ /**
1253
+ * Resources to include in response.
1254
+ *
1255
+ * If specified,
1256
+ * the returned time slots will contain __up__ to 10 available resources out of the provided list.
1257
+ * Otherwise, the returned time slots returns with an empty `AvailableResources`.
1258
+ * > __Note:__ Not specifying `resourceIds` can be handy in case you want to avoid large response in flows that only
1259
+ * > interested whether the time slots are available or not. [An example for such flow](https://bo.wix.com/wix-docs/rest/all-apis/wix-service-availability/service-availability-time-slots/sample-flows#all-apis_wix-service-availability_service-availability-time-slots_sample-flows_let-your-customers-to-dynamically-select-an-available-time-slot-for-any-of-your-business-services).
1260
+ */
1261
+ resourceIds?: string[];
1262
+ /**
1263
+ * Resource type ID's to include in response, this is in addition to the requested resourceIds.
1264
+ *
1265
+ * If specified in request, the returned time slots will contain __up__ to 10 `AvailableResources` with `ResourceTypeId`
1266
+ * out of those specified, each contains __up__ to 10 available resources of this type.
1267
+ */
1268
+ includeResourceTypeIds?: string[];
1269
+ /**
1270
+ * Whether the `TimeSlot` is bookable according to the service's booking policies.
1271
+ *
1272
+ * If booking this time slot does not violates any of the service's booking policies,
1273
+ * returns as `true`. Otherwise, returns as `false`.
1274
+ *
1275
+ * > __Note:__
1276
+ * > A time slot that doesn't meet the service's bookings policies will be returned with `bookable` = false,
1277
+ * > while a time slot with no available resources will not be returned at all.
1278
+ */
1279
+ bookable?: boolean | null;
1280
+ /**
1281
+ * Indicators for service's booking policy violations for booking the `TimeSlot`.
1282
+ *
1283
+ * A bookable time slot must not violate any policy,
1284
+ * therefor, this filter is only relevant when `bookable` filter is false.
1285
+ *
1286
+ * Each nested field is checked on its own. i.e. if `tooEarlyToBook` is defined and `bookOnlineDisabled` is not defined
1287
+ * we return slots for which `tooEarlyToBook` is same as on the request, regardless of `bookOnlineDisabled`.
1288
+ */
1289
+ bookingPolicyViolations?: BookingPolicyViolations;
1290
+ /**
1291
+ * Maximum number of slots to load for each day. For example, if `timeSlotsPerDay` is set to `3`,
1292
+ * we return at most 3 available `TimeSlot`'s for each day within the date range specified in request.
1293
+ *
1294
+ * By default,
1295
+ * if `bookable` filter was not specified,
1296
+ * and a day has both `bookable` and `un-bookable` slots, `bookable` slots are returned first.
1297
+ *
1298
+ * If the number of `bookable` slots is less than the requested `timeSlotsPerDay`,
1299
+ * `un-bookable` slots will be returned according to the specified filters.
1300
+ */
1301
+ timeSlotsPerDay?: number | null;
1302
+ /**
1303
+ * CursorPaging.
1304
+ *
1305
+ * Enables you to fetch `TimeSlot`'s in smaller, more manageable chunks
1306
+ * by setting a limit on the number of `TimeSlots` returned in response.
1307
+ * This is useful in order to enhance efficiency of data retrieval and reduce load on both the client and server.
1308
+ *
1309
+ * If there are more results than the specified limit, the response will contain a `cursorPagingMetaData`
1310
+ * with a cursor pointing to next page of results. In order to fetch the next page of results, you should pass the
1311
+ * returned cursor to the next call as `cursorPaging`.`cursor`.
1312
+ *
1313
+ * For the first call, you should only specify the `limit` for the results page.
1314
+ * For each following call, you should only pass the previous returned cursor as `cursorPaging`.`cursor`
1315
+ * the `cursorPaging`.`limit`. You may pass a different `limit`.
1316
+ * No need to specify any additional parameters.
1317
+ *
1318
+ * __TODO: This is only describes the current behavior, should be fixed__
1319
+ * <blockquote class="important">
1320
+ * <p><strong>Important:</strong><br/>
1321
+ * If you only provide a `cursorPaging`.`cursor`,
1322
+ * the response will contain the default size of results = 1000.
1323
+ * </p>
1324
+ * </blockquote>
1325
+ *
1326
+ * cursorPaging.limit:
1327
+ * Default: 1000
1328
+ * Max: 1000
1329
+ */
1330
+ cursorPaging?: CommonCursorPaging;
1331
+ }
1332
+ /**
1333
+ * Retrieves an available `TimeSlot` that match the provided filters.
1334
+ *
1335
+ * Throws `SlotNotFound` if there is no such available time slot.
1336
+ *
1337
+ * <blockquote class="important">
1338
+ * <p><strong>Important:</strong><br/>
1339
+ * Currently supported only for services of type `APPOINTMENT`.
1340
+ * </p>
1341
+ * </blockquote>
1342
+ *
1343
+ * By default,
1344
+ * if you don't provide `includeResourceTypeIds` or `resourceIds` in request,
1345
+ * we return all `AvailableResources` with all `AvailableResources`.`resources` which are available to provide
1346
+ * the service within the time slot.
1347
+ *
1348
+ * If you specify `includeResourceTypeIds` or `resourceIds` in request,
1349
+ * the returned `TimeSlot` will contain only `AvailableResources` with at least one available resource
1350
+ * which match the given resources filters,
1351
+ * each contains all available resources out of those requested.
1352
+ * @param serviceId - Service ID of the time slot.
1353
+ * Currently supports only services of type `Appointment`.
1354
+ * @public
1355
+ * @documentationMaturity preview
1356
+ * @requiredField options.localEndDate
1357
+ * @requiredField options.localStartDate
1358
+ * @requiredField options.location
1359
+ * @requiredField options.timeZone
1360
+ * @requiredField serviceId
1361
+ * @permissionScope Read Bookings - Public Data
1362
+ * @permissionScope Manage Bookings Services and Settings
1363
+ * @permissionScope Read Bookings - Including Participants
1364
+ * @permissionScope Read Bookings - all read permissions
1365
+ * @permissionScope Read Bookings Calendar Availability
1366
+ * @permissionScope Manage Bookings - all permissions
1367
+ * @applicableIdentity APP
1368
+ * @applicableIdentity MEMBER
1369
+ * @applicableIdentity VISITOR
1370
+ */
1371
+ export declare function getAvailabilityTimeSlot(serviceId: string, options?: GetAvailabilityTimeSlotOptions): Promise<GetAvailabilityTimeSlotResponse & GetAvailabilityTimeSlotResponseNonNullableFields>;
1372
+ export interface GetAvailabilityTimeSlotOptions {
1373
+ /**
1374
+ * Local start date of the time slot, in ISO-8601 format.
1375
+ * For example, "2024-01-30T13:30:00".
1376
+ */
1377
+ localStartDate: string;
1378
+ /**
1379
+ * Local end date of the time slot, in ISO-8601 format.
1380
+ * For example, "2024-01-30T14:30:00".
1381
+ */
1382
+ localEndDate: string;
1383
+ /** Time zone, in IANA time zone format. */
1384
+ timeZone: string | null;
1385
+ /**
1386
+ * The location of the time slot.
1387
+ *
1388
+ * You must provide a specific `locationType`.
1389
+ * If locationType is `BUSINESS`, you __must__ also provide a locationId.
1390
+ *
1391
+ * <blockquote class="important">
1392
+ * <p><strong>Important:</strong><br/>
1393
+ * `name` and `formattedAddress` are ignored.
1394
+ * </p>
1395
+ * </blockquote>
1396
+ */
1397
+ location: Location;
1398
+ /**
1399
+ * Resources to include in response.
1400
+ *
1401
+ * If specified,
1402
+ * the returned time slot contain only the available resources out of provided list.
1403
+ * Otherwise, the returned time slot returned with all possible `AvailableResources`.
1404
+ * > __Note:__ This can be handy in case you want to avoid large response in flows that only
1405
+ * > interested to check the availability of the time slot for specific resources.
1406
+ */
1407
+ resourceIds?: string[];
1408
+ /**
1409
+ * Resource type ID's to include in response, this is in addition to the requested resourceIds.
1410
+ *
1411
+ * If specified in request, the returned time slot contain only the `AvailableResources` with `ResourceTypeId`
1412
+ * out of those specified, each contains all the available resources of this type.
1413
+ */
1414
+ includeResourceTypeIds?: string[];
1415
+ }