@wix/auto_sdk_bookings_availability-calendar 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.context.d.ts +7 -0
  11. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.context.js +13 -0
  12. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.context.js.map +1 -0
  13. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.http.d.ts +93 -0
  14. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.http.js +304 -0
  15. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.http.js.map +1 -0
  16. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.meta.d.ts +17 -0
  17. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.meta.js +85 -0
  18. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.meta.js.map +1 -0
  19. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.public.d.ts +113 -0
  20. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.public.js +28 -0
  21. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.public.js.map +1 -0
  22. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.types.d.ts +615 -0
  23. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.types.js +26 -0
  24. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.types.js.map +1 -0
  25. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.universal.d.ts +809 -0
  26. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.universal.js +285 -0
  27. package/build/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.context.d.ts +7 -0
  39. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.context.js +7 -0
  40. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.context.js.map +1 -0
  41. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.http.d.ts +93 -0
  42. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.http.js +298 -0
  43. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.http.js.map +1 -0
  44. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.meta.d.ts +17 -0
  45. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.meta.js +56 -0
  46. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.meta.js.map +1 -0
  47. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.public.d.ts +113 -0
  48. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.public.js +19 -0
  49. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.public.js.map +1 -0
  50. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.types.d.ts +615 -0
  51. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.types.js +23 -0
  52. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.types.js.map +1 -0
  53. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.universal.d.ts +809 -0
  54. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.universal.js +256 -0
  55. package/build/es/src/bookings-availability-v1-slot-availability-availability-calendar.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.context.d.ts +7 -0
  66. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.context.js +13 -0
  67. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.context.js.map +1 -0
  68. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.http.d.ts +93 -0
  69. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.http.js +304 -0
  70. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.http.js.map +1 -0
  71. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.meta.d.ts +17 -0
  72. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.meta.js +85 -0
  73. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.meta.js.map +1 -0
  74. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.public.d.ts +113 -0
  75. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.public.js +28 -0
  76. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.public.js.map +1 -0
  77. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.types.d.ts +615 -0
  78. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.types.js +26 -0
  79. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.types.js.map +1 -0
  80. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.universal.d.ts +809 -0
  81. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.universal.js +285 -0
  82. package/build/internal/cjs/src/bookings-availability-v1-slot-availability-availability-calendar.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.context.d.ts +7 -0
  93. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.context.js +7 -0
  94. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.context.js.map +1 -0
  95. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.http.d.ts +93 -0
  96. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.http.js +298 -0
  97. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.http.js.map +1 -0
  98. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.meta.d.ts +17 -0
  99. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.meta.js +56 -0
  100. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.meta.js.map +1 -0
  101. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.public.d.ts +113 -0
  102. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.public.js +19 -0
  103. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.public.js.map +1 -0
  104. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.types.d.ts +615 -0
  105. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.types.js +23 -0
  106. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.types.js.map +1 -0
  107. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.universal.d.ts +809 -0
  108. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.universal.js +256 -0
  109. package/build/internal/es/src/bookings-availability-v1-slot-availability-availability-calendar.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1,615 @@
1
+ export interface SlotAvailability {
2
+ /**
3
+ * The slot for the corresponding session, when the session is either a single session
4
+ * or a specific session generated from a recurring session.
5
+ */
6
+ slot?: Slot;
7
+ /**
8
+ * Whether the slot is bookable. Bookability is determined by checking a
9
+ * session's open slots and booking policies. Locks are not taken into
10
+ * account.
11
+ */
12
+ bookable?: boolean;
13
+ /**
14
+ * Total number of spots for this slot.
15
+ * For example, if a session has a total of 10 spots and 3 spots are booked,
16
+ * `spotsTotal` is 10 and `openSpots` is 7.
17
+ */
18
+ totalSpots?: number | null;
19
+ /** Number of open spots for this slot. */
20
+ openSpots?: number | null;
21
+ /** An object describing the slot's waitlist and its occupancy. */
22
+ waitingList?: AvailabilityWaitingList;
23
+ /** Booking policy violations for the slot. */
24
+ bookingPolicyViolations?: BookingPolicyViolations;
25
+ /**
26
+ * Indicates whether the slot is locked because a waitlist exists.
27
+ * When a slot frees up, the slot is offered to the next customer on the waitlist. Read-only.
28
+ */
29
+ locked?: boolean | null;
30
+ isFromV2?: boolean;
31
+ }
32
+ export interface Slot {
33
+ /**
34
+ * ID for the slot's corresponding session, when the session is either a single session
35
+ * or a specific session generated from a recurring session.
36
+ *
37
+ * Deprecated. Please use `eventId` instead.
38
+ * @deprecated ID for the slot's corresponding session, when the session is either a single session
39
+ * or a specific session generated from a recurring session.
40
+ *
41
+ * Deprecated. Please use `eventId` instead.
42
+ * @replacedBy event_id
43
+ * @targetRemovalDate 2025-09-30
44
+ */
45
+ sessionId?: string | null;
46
+ /** Service ID. */
47
+ serviceId?: string;
48
+ /** Schedule ID. */
49
+ scheduleId?: string;
50
+ /**
51
+ * The start time of this slot in [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339)
52
+ * format.
53
+ *
54
+ * If `timezone` is specified,
55
+ * dates are based on the local date/time. This means that the timezone offset
56
+ * in the `start_date` is ignored.
57
+ */
58
+ startDate?: string | null;
59
+ /**
60
+ * The end time of this slot in
61
+ * [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339) format.
62
+ *
63
+ * If `timezone` is specified,
64
+ * dates are based on the local date/time. This means that the timezone offset
65
+ * in the `end_date` is ignored.
66
+ */
67
+ endDate?: string | null;
68
+ /**
69
+ * The timezone for which slot availability is to be calculated.
70
+ *
71
+ * Learn more about [handling Daylight Savings Time (DST) for local time zones](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_handling-daylight-savings-time-dst-for-local-time-zones)
72
+ * when calculating availability.
73
+ */
74
+ timezone?: string | null;
75
+ /**
76
+ * The resource required for this slot. Currently, the only supported resource
77
+ * is the relevant staff member for the slot.
78
+ */
79
+ resource?: SlotResource;
80
+ /** Geographic location of the slot. */
81
+ location?: Location;
82
+ /**
83
+ * ID for the slot's corresponding event, when the event is either a single event
84
+ * or a specific event generated from a recurring event.
85
+ */
86
+ eventId?: string | null;
87
+ }
88
+ export interface SlotResource {
89
+ /**
90
+ * Resource ID.
91
+ * @readonly
92
+ */
93
+ id?: string | null;
94
+ /** Resource name. Read only. */
95
+ name?: string | null;
96
+ }
97
+ export interface Location {
98
+ /**
99
+ * Business location ID. Available only for locations that are business locations,
100
+ * meaning the `location_type` is `"OWNER_BUSINESS"`.
101
+ */
102
+ id?: string | null;
103
+ /** Location name. */
104
+ name?: string | null;
105
+ /** The full address of this location. */
106
+ formattedAddress?: string | null;
107
+ /** The full translated address of this location. */
108
+ formattedAddressTranslated?: string | null;
109
+ /**
110
+ * Location type.
111
+ *
112
+ * - `"OWNER_BUSINESS"`: The business address, as set in the site’s general settings.
113
+ * - `"OWNER_CUSTOM"`: The address as set when creating the service.
114
+ * - `"CUSTOM"`: The address as set for the individual session.
115
+ */
116
+ locationType?: LocationType;
117
+ }
118
+ export declare enum LocationType {
119
+ UNDEFINED = "UNDEFINED",
120
+ OWNER_BUSINESS = "OWNER_BUSINESS",
121
+ OWNER_CUSTOM = "OWNER_CUSTOM",
122
+ CUSTOM = "CUSTOM"
123
+ }
124
+ export interface AvailabilityWaitingList {
125
+ /**
126
+ * Total number of spots and open spots for this waitlist.
127
+ * For example, a Yoga class with 10 waitlist spots and 3 registered
128
+ * on the waitlist has 10 `total_spots` and 7 `open_spots`.
129
+ */
130
+ totalSpots?: number | null;
131
+ /** Number of open spots for this waitlist. */
132
+ openSpots?: number | null;
133
+ }
134
+ export interface BookingPolicyViolations {
135
+ /** Bookings policy violation. Too early to book this slot. */
136
+ tooEarlyToBook?: boolean | null;
137
+ /** Bookings policy violation. Too late to book this slot. */
138
+ tooLateToBook?: boolean | null;
139
+ /** Bookings policy violation. Online booking is disabled for this slot. */
140
+ bookOnlineDisabled?: boolean | null;
141
+ }
142
+ export interface NestedTimeSlot {
143
+ serviceId?: string;
144
+ start?: string;
145
+ end?: string;
146
+ resource?: SlotResource;
147
+ /** Schedule ID. */
148
+ scheduleId?: string;
149
+ }
150
+ export interface QueryAvailabilityRequest {
151
+ /**
152
+ * Query options. Refer to the
153
+ * supported filters article* ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/supported-filters) | [REST](https://dev.wix.com/docs/rest/business-solutions/bookings/time-slots/availability-calendar/supported-filters))
154
+ * for a complete list of supported filters.
155
+ */
156
+ query: QueryV2;
157
+ /**
158
+ * Time zone override for the `endDate` and `startDate` filters, in
159
+ * [IANA tz database format](https://en.wikipedia.org/wiki/Tz_database), such as
160
+ * `America/New_York` or `UTC`.
161
+ *
162
+ * For example, if you specify `("startDate": "2025-11-25T17:00:00+01:00"}` (note
163
+ * the +01:00 offset) in combination with `{"timezone": "Europe/Bucharest"}`
164
+ * (+02:00 offset), *Query Availability* adjusts the effective start time to
165
+ * reflect the specified time zone. In this case, the start time in UTC would
166
+ * be `2025-11-25T15:00:00` (using the +02:00 offset).
167
+ *
168
+ * Learn more about *handling Daylight Savings Time*
169
+ * ([SDK](https://dev.wix.com/docs/sdk/backend-modules/bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_daylight-savings-time-dst) | [REST](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_daylight-savings-time-dst)).
170
+ *
171
+ * Default: No modification applied to the `endDate` and `startDate` filters.
172
+ */
173
+ timezone?: string | null;
174
+ /**
175
+ * Maximum number of appointment slots to return for each date. For example, if
176
+ * you specify `{"slotsPerDay": 3}`, a maximum of 3 appointment slots/class events is
177
+ * returned for each day that's within the query filter's date range.
178
+ */
179
+ slotsPerDay?: number | null;
180
+ }
181
+ export interface QueryV2 extends QueryV2PagingMethodOneOf {
182
+ /**
183
+ * Filter object. For a list of
184
+ * fields you can filter by, see [Calendar Availability: Supported Fields, Filters, and Sorting](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/supported-fields,-filters,-and-sorting).
185
+ * You must include `serviceId`, `startDate` and `endDate` in the filter. This avoids large results that can impact performance.
186
+ */
187
+ filter?: Record<string, any> | null;
188
+ /**
189
+ * Sort options.
190
+ * Currently, only sorting by `startDate` is supported. For details
191
+ * on sorting, see [Calendar Availability: Supported Fields, Filters and Sorting](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/supported-fields,-filters,-and-sorting).
192
+ */
193
+ sort?: Sorting[];
194
+ }
195
+ /** @oneof */
196
+ export interface QueryV2PagingMethodOneOf {
197
+ }
198
+ export interface Sorting {
199
+ /** Name of the field to sort by. */
200
+ fieldName?: string;
201
+ /** Sort order. */
202
+ order?: SortOrder;
203
+ }
204
+ export declare enum SortOrder {
205
+ ASC = "ASC",
206
+ DESC = "DESC"
207
+ }
208
+ export interface CursorPaging {
209
+ /** Maximum number of items to return in the results. */
210
+ limit?: number | null;
211
+ /**
212
+ * Pointer to the next or previous page in the list of results.
213
+ *
214
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
215
+ * Not relevant for the first request.
216
+ */
217
+ cursor?: string | null;
218
+ }
219
+ /**
220
+ * Selected customer choices.
221
+ * These choices are selected by the customer during the booking flow and can be utilized to calculate the corresponding service's configuration properties.
222
+ */
223
+ export interface CustomerChoices {
224
+ /**
225
+ * The selected customer duration in minutes.
226
+ * Min: `1 minute`
227
+ * Max: `44639 minutes` (30 days, 23 hours, and 59 minutes)
228
+ */
229
+ durationInMinutes?: number | null;
230
+ }
231
+ export interface QueryAvailabilityResponse {
232
+ /** List of appointment slots or class events matching the filter. */
233
+ availabilityEntries?: SlotAvailability[];
234
+ }
235
+ export interface PagingMetadataV2 {
236
+ /** Number of items returned in the response. */
237
+ count?: number | null;
238
+ /** Offset that was requested. */
239
+ offset?: number | null;
240
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
241
+ total?: number | null;
242
+ /** Flag that indicates the server failed to calculate the `total` field. */
243
+ tooManyToCount?: boolean | null;
244
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
245
+ cursors?: Cursors;
246
+ }
247
+ export interface Cursors {
248
+ /** Cursor string pointing to the next page in the list of results. */
249
+ next?: string | null;
250
+ /** Cursor pointing to the previous page in the list of results. */
251
+ prev?: string | null;
252
+ }
253
+ export interface GetSlotAvailabilityRequest {
254
+ /** The slot for which the availability is checked. */
255
+ slot?: Slot;
256
+ /**
257
+ * The timezone for which slot availability is to be calculated. If specified,
258
+ * dates are based on the local date/time, meaning that the timezone offset
259
+ * in the date's format is ignored.
260
+ *
261
+ * Learn more about [handling Daylight Savings Time (DST) for local time zones](https://dev.wix.com/api/rest/wix-bookings/availability-calendar/query-availability#wix-bookings_availability-calendar_query-availability_handling-daylight-savings-time-dst-for-local-time-zones)
262
+ * when calculating availability.
263
+ */
264
+ timezone?: string | null;
265
+ }
266
+ export interface GetSlotAvailabilityResponse {
267
+ availability?: SlotAvailability;
268
+ bookingPolicySettings?: BookingPolicySettings;
269
+ }
270
+ export interface BookingPolicySettings {
271
+ /**
272
+ * The policy defining the maximum number of participants that can
273
+ * be booked for a slot or a schedule.
274
+ */
275
+ maxParticipantsPerBooking?: number | null;
276
+ }
277
+ export interface GetScheduleAvailabilityRequest {
278
+ /** The schedule ID for which availability is being checked. */
279
+ scheduleId: string;
280
+ }
281
+ export interface GetScheduleAvailabilityResponse {
282
+ availability?: ScheduleAvailability;
283
+ bookingPolicySettings?: BookingPolicySettings;
284
+ }
285
+ export interface ScheduleAvailability {
286
+ /**
287
+ * The total number of spots defined for the schedule, including
288
+ * both open and non-available spots.
289
+ */
290
+ totalSpots?: number | null;
291
+ /** The number of open spots defined for the schedule. */
292
+ openSpots?: number | null;
293
+ /** Booking policy violations for the schedule. */
294
+ bookingPolicyViolations?: BookingPolicyViolations;
295
+ }
296
+ export interface CalculateMultiSlotAvailabilityRequest {
297
+ from?: string;
298
+ to?: string;
299
+ timeZone?: string;
300
+ /** 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 */
301
+ bookable?: boolean | null;
302
+ /**
303
+ * 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
304
+ * we will return slots for which `too_early_to_book` is same as on the request, regardless of `too_late_to_book`.
305
+ */
306
+ bookingPolicyViolations?: BookingPolicyViolations;
307
+ /**
308
+ * support filtering by location type, or by locationId. Other fields like `name` are ignored
309
+ * must be set, and must have locationType. If locationType is `OWNER_BUSINESS`, must have location_id
310
+ */
311
+ location?: Location;
312
+ slots?: RuleBasedConstraints[];
313
+ /**
314
+ * Maximum number of slots to load for each date. For example, if `slots_per_day` is set to `3`,
315
+ * at most 3 available slots are returned for each day in the date range specified in the query's
316
+ * `filter`.
317
+ *
318
+ * When a day has both bookable and non-bookable slots, bookable slots are returned first.
319
+ * Non-bookable slots are returned according to the specified filters, after all
320
+ * bookable slots are already included.
321
+ */
322
+ slotsPerDay?: number | null;
323
+ cursorPaging?: CursorPaging;
324
+ }
325
+ export interface RuleBasedConstraints {
326
+ serviceId?: string;
327
+ resourcesFilter?: ResourcesFilter;
328
+ /** will be passed to availability-2, and to the availability-constraints SPI */
329
+ customerChoices?: V2CustomerChoices;
330
+ }
331
+ export interface ResourcesFilter {
332
+ resourceIds?: string[];
333
+ }
334
+ /**
335
+ * Selected customer choices.
336
+ * These choices are selected by the customer during the booking flow and can be utilized to calculate the corresponding service's configuration properties.
337
+ */
338
+ export interface V2CustomerChoices {
339
+ /**
340
+ * The selected customer duration in minutes.
341
+ * Min: `1 minute`
342
+ * Max: `44639 minutes` (30 days, 23 hours, and 59 minutes)
343
+ */
344
+ durationInMinutes?: number | null;
345
+ }
346
+ export interface CalculateMultiSlotAvailabilityResponse {
347
+ slots?: SlotAvailability[];
348
+ cursorPagingMetadata?: CursorPagingMetadata;
349
+ }
350
+ export interface CursorPagingMetadata {
351
+ /** Number of items returned in current page. */
352
+ count?: number | null;
353
+ /** Cursor strings that point to the next page, previous page, or both. */
354
+ cursors?: Cursors;
355
+ /**
356
+ * Whether there are more pages to retrieve following the current page.
357
+ *
358
+ * + `true`: Another page of results can be retrieved.
359
+ * + `false`: This is the last page.
360
+ */
361
+ hasNext?: boolean | null;
362
+ }
363
+ export interface GetAvailabilityTimeSlotRequest {
364
+ /**
365
+ * Service ID of the time slot.
366
+ * Currently supported only for services of type `APPOINTMENT`.
367
+ */
368
+ serviceId?: string;
369
+ /**
370
+ * Local start date of the time slot, in ISO-8601 format.
371
+ * For example, "2024-01-30T13:30:00".
372
+ */
373
+ localStartDate?: string;
374
+ /**
375
+ * Local end date of the time slot, in ISO-8601 format.
376
+ * For example, "2024-01-30T14:30:00".
377
+ */
378
+ localEndDate?: string;
379
+ /** Time zone, in IANA time zone format. */
380
+ timeZone?: string | null;
381
+ /**
382
+ * The location of the time slot.
383
+ *
384
+ * You must provide a specific `locationType`.
385
+ * If locationType is `BUSINESS`, you __must__ also provide a `locationId`.
386
+ *
387
+ * <blockquote class="warning">
388
+ * <p>Supports filtering by location type, or by location ID.
389
+ * Other fields like <code class="grey-background">name</code> are ignored.</p>
390
+ * </blockquote>
391
+ */
392
+ location?: TimeSlotLocation;
393
+ /**
394
+ * Resources to include in response.
395
+ *
396
+ * If specified,
397
+ * the returned `TimeSlot` contains only the available resources out of provided list.
398
+ * Otherwise, the returned `TimeSlot` returned with all possible `AvailableResources`.
399
+ */
400
+ resourceIds?: string[];
401
+ /**
402
+ * Resource type IDs to include in response, this is in addition to the requested `resourceIds`.
403
+ *
404
+ * If specified in request, the returned `TimeSlot` contains only the `AvailableResources` with `ResourceTypeId`
405
+ * out of those specified, each contains all the available resources of this type.
406
+ */
407
+ includeResourceTypeIds?: string[];
408
+ fromV2?: boolean | null;
409
+ }
410
+ export interface TimeSlotLocation {
411
+ /** Business Location ID. Present only if the location is a business location. */
412
+ id?: string | null;
413
+ /** The location name. */
414
+ name?: string | null;
415
+ /** A string representation for the full address of the location. */
416
+ formattedAddress?: string | null;
417
+ /**
418
+ * The type of location:
419
+ * - `CUSTOM`: The location is specific to this service, and is not derived from the business location.
420
+ * - `BUSINESS`: A business location, either the default business address, or locations defined for the business by the Business Info.
421
+ * - `CUSTOMER`: The location is determined by the customer and is not set up beforehand.
422
+ */
423
+ locationType?: LocationLocationType;
424
+ }
425
+ export declare enum LocationLocationType {
426
+ UNKNOWN_LOCATION_TYPE = "UNKNOWN_LOCATION_TYPE",
427
+ /** A business location, either the default business address, or locations defined for the business by the Business Info. */
428
+ BUSINESS = "BUSINESS",
429
+ /** The location is unique to this service and isn't defined as one of the business locations. */
430
+ CUSTOM = "CUSTOM",
431
+ /** The location can be determined by the customer and is not set up beforehand. */
432
+ CUSTOMER = "CUSTOMER"
433
+ }
434
+ export interface GetAvailabilityTimeSlotResponse {
435
+ /** Time slot. */
436
+ timeSlot?: TimeSlot;
437
+ /** Time zone, in IANA time zone format. */
438
+ timeZone?: string | null;
439
+ }
440
+ /**
441
+ * The `TimeSlot` object represents the availability information
442
+ * for an `Appointment` service's specific slot, including:
443
+ *
444
+ * 1. Whether the slot is bookable for the given service?
445
+ *
446
+ * 2. In what location the service is available for this slot?
447
+ *
448
+ * 3. Which available resources can provide the service for this slot?
449
+ *
450
+ * 4. Does booking the slot for the service violates any of the service booking policies?
451
+ *
452
+ * 5. What is the total capacity and remaining capacity of the service at the time of the calculation of the `TimeSlot`?
453
+ *
454
+ * > __Note:__
455
+ * > When the `TimeSlot` has a non empty `NestedTimeSlots`, it represents the availability information
456
+ * > for a given list of `Appointment` services within a specific time slot.
457
+ */
458
+ export interface TimeSlot {
459
+ /**
460
+ * Service ID.
461
+ *
462
+ * > Not returned from `MultiServiceAvailabilityTimeSlots` API calls.
463
+ * > Instead, each nested time slot has its own serviceId.
464
+ */
465
+ serviceId?: string | null;
466
+ /**
467
+ * Local start date of the time slot in ISO-8601 format.
468
+ * For example, "2024-01-30T13:30:00".
469
+ */
470
+ localStartDate?: string | null;
471
+ /**
472
+ * Local end date of the time slot in ISO-8601 format.
473
+ * For example, "2024-01-30T14:30:00".
474
+ */
475
+ localEndDate?: string | null;
476
+ /**
477
+ * Whether the slot is bookable according to the service's booking policies.
478
+ *
479
+ * If booking this time slot does not violates any of the service's booking policies,
480
+ * the returned value is `true`. Otherwise, returns `false`.
481
+ */
482
+ bookable?: boolean | null;
483
+ /** The geographic location of the slot. */
484
+ location?: TimeSlotLocation;
485
+ /** Total number of spots for the slot. */
486
+ totalCapacity?: number | null;
487
+ /**
488
+ * Remaining number of spots for the slot.
489
+ * For example, for an appointment service with total capacity of 1 spot and one booked spot, the remaining capacity will be 0.
490
+ */
491
+ remainingCapacity?: number | null;
492
+ /**
493
+ * Indicators for booking policy violations for the slot.
494
+ *
495
+ * Each nested field is checked on its own. i.e. if `tooEarlyToBook` is defined and `bookOnlineDisabled` is not defined
496
+ * we will return also slots for which `tooEarlyToBook` is same as on the request, regardless of `bookOnlineDisabled`.
497
+ */
498
+ bookingPolicyViolations?: Service_availabilityBookingPolicyViolations;
499
+ /**
500
+ * List of `AvailableResources` for the time slot.
501
+ * Each `AvailableResources` contains information about available resources of the same type.
502
+ *
503
+ * > Not returned from `MultiServiceAvailabilityTimeSlots` API calls.
504
+ * > Instead, each nested time slot has its own available resources.
505
+ */
506
+ availableResources?: AvailableResources[];
507
+ /**
508
+ * > Nested time slots.
509
+ * > Returned only from `MultiServiceAvailabilityTimeSlots` API calls.
510
+ */
511
+ nestedTimeSlots?: Service_availabilityNestedTimeSlot[];
512
+ }
513
+ /** relevant for event based slots, and not for availability based slots */
514
+ export interface EventInfo {
515
+ }
516
+ export interface WaitingList {
517
+ /** Total number of spots in this wait list. */
518
+ totalCapacity?: number | null;
519
+ /**
520
+ * Number of remaining spots for this wait list.
521
+ * For example, a Yoga event with 10 waitList spots and 3 registered
522
+ * on the waitList has 10 `total_capacity` and 7 `remaining_capacity`.
523
+ */
524
+ remainingCapacity?: number | null;
525
+ }
526
+ export interface Service_availabilityBookingPolicyViolations {
527
+ /** Bookings policy violation. Too early to book this slot. */
528
+ tooEarlyToBook?: boolean | null;
529
+ /** Bookings policy violation. Too late to book this slot. */
530
+ tooLateToBook?: boolean | null;
531
+ /** Bookings policy violation. Online booking is disabled for the `TimeSlot` service. */
532
+ bookOnlineDisabled?: boolean | null;
533
+ }
534
+ export interface AvailableResources {
535
+ /** Resource type ID. */
536
+ resourceTypeId?: string | null;
537
+ /**
538
+ * Available resources for the time slot.
539
+ *
540
+ * + When returned from `ListAvailabilityTimeSlots`, empty by default.
541
+ * + + If you provided `includeResourceTypeIds` or `resourceIds` in request,
542
+ * contains __up__ to 10 available resources out of those provided.
543
+ *
544
+ * + When returned from `GetAvailabilityTimeSlots`, contains all available resources by default.
545
+ * + + If you provided `includeResourceTypeIds` or `resourceIds` in request,
546
+ * contains all of the available resources out of those provided.
547
+ *
548
+ *
549
+ * > + When returned from `ListMultiServiceAvailabilityTimeSlots`, empty by default.
550
+ * > + + If you provided `includeResourceTypeIds` or `resourceIds` in request,
551
+ * > contains __up__ to 10 available resources out of those provided.
552
+ *
553
+ * > + When returned from `GetMultiServiceAvailabilityTimeSlots`, contains all available resources by default.
554
+ * > + + If you provided `includeResourceTypeIds` or `resourceIds` in request,
555
+ * > contains all of the available resources out of those provided.
556
+ */
557
+ resources?: Resource[];
558
+ /**
559
+ * Whether there are more available resources for the slot that are not listed in `resources` due to size limitations.
560
+ * @readonly
561
+ */
562
+ hasMoreAvailableResources?: boolean | null;
563
+ }
564
+ export interface Resource {
565
+ /** Resource ID. */
566
+ id?: string;
567
+ /** Resource name. */
568
+ name?: string | null;
569
+ }
570
+ export interface Service_availabilityNestedTimeSlot {
571
+ /** Service ID of the nested time slot. */
572
+ serviceId?: string;
573
+ /**
574
+ * Local start date of the nested time slot in ISO-8601 format.
575
+ * For example, "2024-01-30T13:30:00".
576
+ */
577
+ localStartDate?: string;
578
+ /**
579
+ * Local end date of the nested time slot in ISO-8601 format.
580
+ * For example, "2024-01-30T14:30:00".
581
+ */
582
+ localEndDate?: string;
583
+ /**
584
+ * List of `AvailableResources` for the nested time slot.
585
+ * Each `AvailableResources` contains information about available resources of the same type.
586
+ */
587
+ availableResources?: AvailableResources[];
588
+ }
589
+ interface LocationNonNullableFields {
590
+ locationType: LocationType;
591
+ }
592
+ interface SlotNonNullableFields {
593
+ serviceId: string;
594
+ scheduleId: string;
595
+ location?: LocationNonNullableFields;
596
+ }
597
+ interface NestedTimeSlotNonNullableFields {
598
+ serviceId: string;
599
+ start: string;
600
+ end: string;
601
+ scheduleId: string;
602
+ }
603
+ interface SlotAvailabilityNonNullableFields {
604
+ slot?: SlotNonNullableFields;
605
+ bookable: boolean;
606
+ isFromV2: boolean;
607
+ nestedSlots: NestedTimeSlotNonNullableFields[];
608
+ }
609
+ export interface QueryAvailabilityResponseNonNullableFields {
610
+ availabilityEntries: SlotAvailabilityNonNullableFields[];
611
+ }
612
+ export interface CalculateMultiSlotAvailabilityResponseNonNullableFields {
613
+ slots: SlotAvailabilityNonNullableFields[];
614
+ }
615
+ export {};
@@ -0,0 +1,23 @@
1
+ export var LocationType;
2
+ (function (LocationType) {
3
+ LocationType["UNDEFINED"] = "UNDEFINED";
4
+ LocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
5
+ LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
6
+ LocationType["CUSTOM"] = "CUSTOM";
7
+ })(LocationType || (LocationType = {}));
8
+ export var SortOrder;
9
+ (function (SortOrder) {
10
+ SortOrder["ASC"] = "ASC";
11
+ SortOrder["DESC"] = "DESC";
12
+ })(SortOrder || (SortOrder = {}));
13
+ export var LocationLocationType;
14
+ (function (LocationLocationType) {
15
+ LocationLocationType["UNKNOWN_LOCATION_TYPE"] = "UNKNOWN_LOCATION_TYPE";
16
+ /** A business location, either the default business address, or locations defined for the business by the Business Info. */
17
+ LocationLocationType["BUSINESS"] = "BUSINESS";
18
+ /** The location is unique to this service and isn't defined as one of the business locations. */
19
+ LocationLocationType["CUSTOM"] = "CUSTOM";
20
+ /** The location can be determined by the customer and is not set up beforehand. */
21
+ LocationLocationType["CUSTOMER"] = "CUSTOMER";
22
+ })(LocationLocationType || (LocationLocationType = {}));
23
+ //# sourceMappingURL=bookings-availability-v1-slot-availability-availability-calendar.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bookings-availability-v1-slot-availability-availability-calendar.types.js","sourceRoot":"","sources":["../../../../src/bookings-availability-v1-slot-availability-availability-calendar.types.ts"],"names":[],"mappings":"AAyHA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAwFD,MAAM,CAAN,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACf,CAAC,EAHW,SAAS,KAAT,SAAS,QAGpB;AA8OD,MAAM,CAAN,IAAY,oBAQX;AARD,WAAY,oBAAoB;IAC9B,uEAA+C,CAAA;IAC/C,4HAA4H;IAC5H,6CAAqB,CAAA;IACrB,iGAAiG;IACjG,yCAAiB,CAAA;IACjB,mFAAmF;IACnF,6CAAqB,CAAA;AACvB,CAAC,EARW,oBAAoB,KAApB,oBAAoB,QAQ/B"}