@skilder-ai/smoobu 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -3
- package/dist/index.d.ts +976 -5
- package/dist/index.js +472 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -109,15 +109,291 @@ declare const smoobuNewMessageDataSchema: z.ZodObject<{
|
|
|
109
109
|
id: z.ZodNumber;
|
|
110
110
|
}, z.core.$loose>;
|
|
111
111
|
}, z.core.$loose>;
|
|
112
|
+
declare const smoobuApartmentListSchema: z.ZodObject<{
|
|
113
|
+
apartments: z.ZodArray<z.ZodObject<{
|
|
114
|
+
id: z.ZodNumber;
|
|
115
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
116
|
+
}, z.core.$loose>>;
|
|
117
|
+
}, z.core.$loose>;
|
|
118
|
+
type SmoobuApartmentList = z.infer<typeof smoobuApartmentListSchema>;
|
|
119
|
+
declare const smoobuApartmentSchema: z.ZodObject<{
|
|
120
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
121
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
122
|
+
location: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
123
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
124
|
+
zip: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
125
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
126
|
+
state: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
127
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
128
|
+
latitude: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
129
|
+
longitude: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
130
|
+
}, z.core.$loose>>>;
|
|
131
|
+
timeZone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
rooms: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodNumber>>>>;
|
|
133
|
+
amenities: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
134
|
+
equipments: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
135
|
+
currency: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
137
|
+
minimal: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
138
|
+
maximal: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
139
|
+
}, z.core.$loose>>>;
|
|
140
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
141
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
142
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
143
|
+
}, z.core.$loose>>>;
|
|
144
|
+
}, z.core.$loose>;
|
|
145
|
+
type SmoobuApartment = z.infer<typeof smoobuApartmentSchema>;
|
|
146
|
+
/**
|
|
147
|
+
* A booking, as returned by GET /api/reservations(/{id}) and reservation webhooks. Hyphenated keys
|
|
148
|
+
* are Smoobu's. Without the key's "Guest Data (PII)" permission, guest fields are empty strings.
|
|
149
|
+
*/
|
|
150
|
+
declare const smoobuBookingSchema: z.ZodObject<{
|
|
151
|
+
id: z.ZodNumber;
|
|
152
|
+
'reference-id': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
153
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
154
|
+
arrival: z.ZodString;
|
|
155
|
+
departure: z.ZodString;
|
|
156
|
+
'created-at': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
157
|
+
modifiedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
158
|
+
apartment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
159
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
160
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
161
|
+
}, z.core.$loose>>>;
|
|
162
|
+
channel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
163
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
164
|
+
channel_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
165
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
166
|
+
}, z.core.$loose>>>;
|
|
167
|
+
'guest-name': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
|
+
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
169
|
+
lastname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
170
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
171
|
+
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
adults: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
173
|
+
children: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
174
|
+
'check-in': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
175
|
+
'check-out': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
176
|
+
notice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
177
|
+
'assistant-notice': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
178
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
179
|
+
'price-details': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
180
|
+
'city-tax': z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
181
|
+
'price-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
182
|
+
'commission-included': z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
183
|
+
prepayment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
184
|
+
'prepayment-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
185
|
+
deposit: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
186
|
+
'deposit-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
187
|
+
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
+
'guest-app-url': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
189
|
+
'is-blocked-booking': z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
190
|
+
guestId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
191
|
+
related: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
192
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
193
|
+
}, z.core.$loose>>>>;
|
|
194
|
+
}, z.core.$loose>;
|
|
195
|
+
type SmoobuBooking = z.infer<typeof smoobuBookingSchema>;
|
|
196
|
+
declare const smoobuBookingsPageSchema: z.ZodObject<{
|
|
197
|
+
page_count: z.ZodNumber;
|
|
198
|
+
page_size: z.ZodNumber;
|
|
199
|
+
total_items: z.ZodNumber;
|
|
200
|
+
page: z.ZodNumber;
|
|
201
|
+
bookings: z.ZodArray<z.ZodObject<{
|
|
202
|
+
id: z.ZodNumber;
|
|
203
|
+
'reference-id': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
204
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
arrival: z.ZodString;
|
|
206
|
+
departure: z.ZodString;
|
|
207
|
+
'created-at': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
208
|
+
modifiedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
209
|
+
apartment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
210
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
211
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
212
|
+
}, z.core.$loose>>>;
|
|
213
|
+
channel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
214
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
215
|
+
channel_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
216
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
217
|
+
}, z.core.$loose>>>;
|
|
218
|
+
'guest-name': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
219
|
+
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
|
+
lastname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
221
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
222
|
+
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
223
|
+
adults: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
224
|
+
children: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
225
|
+
'check-in': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
226
|
+
'check-out': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
227
|
+
notice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
|
+
'assistant-notice': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
230
|
+
'price-details': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
231
|
+
'city-tax': z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
232
|
+
'price-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
233
|
+
'commission-included': z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
234
|
+
prepayment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
235
|
+
'prepayment-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
236
|
+
deposit: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
237
|
+
'deposit-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
238
|
+
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
|
+
'guest-app-url': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
240
|
+
'is-blocked-booking': z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
241
|
+
guestId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
242
|
+
related: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
243
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
244
|
+
}, z.core.$loose>>>>;
|
|
245
|
+
}, z.core.$loose>>;
|
|
246
|
+
}, z.core.$loose>;
|
|
247
|
+
type SmoobuBookingsPage = z.infer<typeof smoobuBookingsPageSchema>;
|
|
248
|
+
declare const smoobuGuestSchema: z.ZodObject<{
|
|
249
|
+
id: z.ZodNumber;
|
|
250
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
251
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
252
|
+
companyName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
253
|
+
emails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>;
|
|
254
|
+
telephoneNumbers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>;
|
|
255
|
+
address: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
256
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
257
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
258
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
259
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
260
|
+
}, z.core.$loose>>>;
|
|
261
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
262
|
+
bookings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
263
|
+
id: z.ZodNumber;
|
|
264
|
+
'reference-id': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
265
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
266
|
+
arrival: z.ZodString;
|
|
267
|
+
departure: z.ZodString;
|
|
268
|
+
'created-at': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
269
|
+
modifiedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
270
|
+
apartment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
271
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
272
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
273
|
+
}, z.core.$loose>>>;
|
|
274
|
+
channel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
275
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
276
|
+
channel_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
277
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
278
|
+
}, z.core.$loose>>>;
|
|
279
|
+
'guest-name': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
280
|
+
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
281
|
+
lastname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
282
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
283
|
+
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
284
|
+
adults: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
285
|
+
children: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
286
|
+
'check-in': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
287
|
+
'check-out': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
288
|
+
notice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
289
|
+
'assistant-notice': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
290
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
291
|
+
'price-details': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
292
|
+
'city-tax': z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
293
|
+
'price-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
294
|
+
'commission-included': z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
295
|
+
prepayment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
296
|
+
'prepayment-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
297
|
+
deposit: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
298
|
+
'deposit-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
299
|
+
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
300
|
+
'guest-app-url': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
301
|
+
'is-blocked-booking': z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
302
|
+
guestId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
303
|
+
related: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
304
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
305
|
+
}, z.core.$loose>>>>;
|
|
306
|
+
}, z.core.$loose>>>>;
|
|
307
|
+
}, z.core.$loose>;
|
|
308
|
+
type SmoobuGuest = z.infer<typeof smoobuGuestSchema>;
|
|
309
|
+
declare const smoobuGuestsPageSchema: z.ZodObject<{
|
|
310
|
+
pageCount: z.ZodNumber;
|
|
311
|
+
pageSize: z.ZodNumber;
|
|
312
|
+
totalItems: z.ZodNumber;
|
|
313
|
+
page: z.ZodNumber;
|
|
314
|
+
guests: z.ZodArray<z.ZodObject<{
|
|
315
|
+
id: z.ZodNumber;
|
|
316
|
+
firstName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
317
|
+
lastName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
318
|
+
companyName: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
319
|
+
emails: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>;
|
|
320
|
+
telephoneNumbers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodUnknown>>>;
|
|
321
|
+
address: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
322
|
+
street: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
|
+
postalCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
324
|
+
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
325
|
+
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
326
|
+
}, z.core.$loose>>>;
|
|
327
|
+
notes: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
328
|
+
bookings: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
329
|
+
id: z.ZodNumber;
|
|
330
|
+
'reference-id': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
331
|
+
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
332
|
+
arrival: z.ZodString;
|
|
333
|
+
departure: z.ZodString;
|
|
334
|
+
'created-at': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
335
|
+
modifiedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
336
|
+
apartment: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
337
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
338
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
339
|
+
}, z.core.$loose>>>;
|
|
340
|
+
channel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
341
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
342
|
+
channel_id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
343
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
344
|
+
}, z.core.$loose>>>;
|
|
345
|
+
'guest-name': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
346
|
+
firstname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
347
|
+
lastname: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
348
|
+
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
349
|
+
phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
350
|
+
adults: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
351
|
+
children: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
352
|
+
'check-in': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
353
|
+
'check-out': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
354
|
+
notice: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
355
|
+
'assistant-notice': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
356
|
+
price: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
357
|
+
'price-details': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
358
|
+
'city-tax': z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
359
|
+
'price-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
360
|
+
'commission-included': z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
361
|
+
prepayment: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
362
|
+
'prepayment-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
363
|
+
deposit: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodNumber, z.ZodString]>>>;
|
|
364
|
+
'deposit-paid': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
365
|
+
language: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
366
|
+
'guest-app-url': z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
367
|
+
'is-blocked-booking': z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
368
|
+
guestId: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
369
|
+
related: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
370
|
+
id: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
371
|
+
}, z.core.$loose>>>>;
|
|
372
|
+
}, z.core.$loose>>>>;
|
|
373
|
+
}, z.core.$loose>>;
|
|
374
|
+
}, z.core.$loose>;
|
|
375
|
+
type SmoobuGuestsPage = z.infer<typeof smoobuGuestsPageSchema>;
|
|
112
376
|
|
|
377
|
+
type wire_SmoobuApartment = SmoobuApartment;
|
|
378
|
+
type wire_SmoobuApartmentList = SmoobuApartmentList;
|
|
379
|
+
type wire_SmoobuBooking = SmoobuBooking;
|
|
380
|
+
type wire_SmoobuBookingsPage = SmoobuBookingsPage;
|
|
113
381
|
type wire_SmoobuErrorBody = SmoobuErrorBody;
|
|
382
|
+
type wire_SmoobuGuest = SmoobuGuest;
|
|
383
|
+
type wire_SmoobuGuestsPage = SmoobuGuestsPage;
|
|
114
384
|
type wire_SmoobuMessage = SmoobuMessage;
|
|
115
385
|
type wire_SmoobuMessagesPage = SmoobuMessagesPage;
|
|
116
386
|
type wire_SmoobuSendMessageBody = SmoobuSendMessageBody;
|
|
117
387
|
type wire_SmoobuThread = SmoobuThread;
|
|
118
388
|
type wire_SmoobuThreadsPage = SmoobuThreadsPage;
|
|
119
389
|
type wire_SmoobuUser = SmoobuUser;
|
|
390
|
+
declare const wire_smoobuApartmentListSchema: typeof smoobuApartmentListSchema;
|
|
391
|
+
declare const wire_smoobuApartmentSchema: typeof smoobuApartmentSchema;
|
|
392
|
+
declare const wire_smoobuBookingSchema: typeof smoobuBookingSchema;
|
|
393
|
+
declare const wire_smoobuBookingsPageSchema: typeof smoobuBookingsPageSchema;
|
|
120
394
|
declare const wire_smoobuErrorSchema: typeof smoobuErrorSchema;
|
|
395
|
+
declare const wire_smoobuGuestSchema: typeof smoobuGuestSchema;
|
|
396
|
+
declare const wire_smoobuGuestsPageSchema: typeof smoobuGuestsPageSchema;
|
|
121
397
|
declare const wire_smoobuMessageSchema: typeof smoobuMessageSchema;
|
|
122
398
|
declare const wire_smoobuMessagesPageSchema: typeof smoobuMessagesPageSchema;
|
|
123
399
|
declare const wire_smoobuNewMessageDataSchema: typeof smoobuNewMessageDataSchema;
|
|
@@ -126,10 +402,30 @@ declare const wire_smoobuThreadsPageSchema: typeof smoobuThreadsPageSchema;
|
|
|
126
402
|
declare const wire_smoobuUserSchema: typeof smoobuUserSchema;
|
|
127
403
|
declare const wire_smoobuWebhookSchema: typeof smoobuWebhookSchema;
|
|
128
404
|
declare namespace wire {
|
|
129
|
-
export { wire_smoobuErrorSchema as smoobuErrorSchema, wire_smoobuMessageSchema as smoobuMessageSchema, wire_smoobuMessagesPageSchema as smoobuMessagesPageSchema, wire_smoobuNewMessageDataSchema as smoobuNewMessageDataSchema, wire_smoobuThreadSchema as smoobuThreadSchema, wire_smoobuThreadsPageSchema as smoobuThreadsPageSchema, wire_smoobuUserSchema as smoobuUserSchema, wire_smoobuWebhookSchema as smoobuWebhookSchema };
|
|
130
|
-
export type { wire_SmoobuErrorBody as SmoobuErrorBody, wire_SmoobuMessage as SmoobuMessage, wire_SmoobuMessagesPage as SmoobuMessagesPage, wire_SmoobuSendMessageBody as SmoobuSendMessageBody, wire_SmoobuThread as SmoobuThread, wire_SmoobuThreadsPage as SmoobuThreadsPage, wire_SmoobuUser as SmoobuUser };
|
|
405
|
+
export { wire_smoobuApartmentListSchema as smoobuApartmentListSchema, wire_smoobuApartmentSchema as smoobuApartmentSchema, wire_smoobuBookingSchema as smoobuBookingSchema, wire_smoobuBookingsPageSchema as smoobuBookingsPageSchema, wire_smoobuErrorSchema as smoobuErrorSchema, wire_smoobuGuestSchema as smoobuGuestSchema, wire_smoobuGuestsPageSchema as smoobuGuestsPageSchema, wire_smoobuMessageSchema as smoobuMessageSchema, wire_smoobuMessagesPageSchema as smoobuMessagesPageSchema, wire_smoobuNewMessageDataSchema as smoobuNewMessageDataSchema, wire_smoobuThreadSchema as smoobuThreadSchema, wire_smoobuThreadsPageSchema as smoobuThreadsPageSchema, wire_smoobuUserSchema as smoobuUserSchema, wire_smoobuWebhookSchema as smoobuWebhookSchema };
|
|
406
|
+
export type { wire_SmoobuApartment as SmoobuApartment, wire_SmoobuApartmentList as SmoobuApartmentList, wire_SmoobuBooking as SmoobuBooking, wire_SmoobuBookingsPage as SmoobuBookingsPage, wire_SmoobuErrorBody as SmoobuErrorBody, wire_SmoobuGuest as SmoobuGuest, wire_SmoobuGuestsPage as SmoobuGuestsPage, wire_SmoobuMessage as SmoobuMessage, wire_SmoobuMessagesPage as SmoobuMessagesPage, wire_SmoobuSendMessageBody as SmoobuSendMessageBody, wire_SmoobuThread as SmoobuThread, wire_SmoobuThreadsPage as SmoobuThreadsPage, wire_SmoobuUser as SmoobuUser };
|
|
131
407
|
}
|
|
132
408
|
|
|
409
|
+
/** Query parameters of GET /api/reservations, named as Smoobu expects them (camelCase works). */
|
|
410
|
+
interface SmoobuReservationQuery {
|
|
411
|
+
page?: number;
|
|
412
|
+
pageSize?: number;
|
|
413
|
+
apartmentId?: number;
|
|
414
|
+
/** Stays overlapping [from, to]. */
|
|
415
|
+
from?: string;
|
|
416
|
+
to?: string;
|
|
417
|
+
arrivalFrom?: string;
|
|
418
|
+
arrivalTo?: string;
|
|
419
|
+
departureFrom?: string;
|
|
420
|
+
departureTo?: string;
|
|
421
|
+
created_from?: string;
|
|
422
|
+
created_to?: string;
|
|
423
|
+
modifiedFrom?: string;
|
|
424
|
+
modifiedTo?: string;
|
|
425
|
+
showCancellation?: boolean;
|
|
426
|
+
excludeBlocked?: boolean;
|
|
427
|
+
includeRelated?: boolean;
|
|
428
|
+
}
|
|
133
429
|
interface SmoobuClientOptions {
|
|
134
430
|
apiKey: string;
|
|
135
431
|
apiSecret: string;
|
|
@@ -241,6 +537,301 @@ declare class SmoobuClient {
|
|
|
241
537
|
createdAt?: string | null | undefined;
|
|
242
538
|
}[];
|
|
243
539
|
}>;
|
|
540
|
+
/** GET /api/apartments: ids and names only (no pagination). */
|
|
541
|
+
listApartments(): Promise<{
|
|
542
|
+
[x: string]: unknown;
|
|
543
|
+
apartments: {
|
|
544
|
+
[x: string]: unknown;
|
|
545
|
+
id: number;
|
|
546
|
+
name?: string | null | undefined;
|
|
547
|
+
}[];
|
|
548
|
+
}>;
|
|
549
|
+
/** GET /api/apartments/{id}: location, rooms, amenities, currency, price range. */
|
|
550
|
+
getApartment(apartmentId: number): Promise<{
|
|
551
|
+
[x: string]: unknown;
|
|
552
|
+
id?: number | null | undefined;
|
|
553
|
+
name?: string | null | undefined;
|
|
554
|
+
location?: {
|
|
555
|
+
[x: string]: unknown;
|
|
556
|
+
street?: string | null | undefined;
|
|
557
|
+
zip?: string | null | undefined;
|
|
558
|
+
city?: string | null | undefined;
|
|
559
|
+
state?: string | null | undefined;
|
|
560
|
+
country?: string | null | undefined;
|
|
561
|
+
latitude?: string | number | null | undefined;
|
|
562
|
+
longitude?: string | number | null | undefined;
|
|
563
|
+
} | null | undefined;
|
|
564
|
+
timeZone?: string | null | undefined;
|
|
565
|
+
rooms?: Record<string, number | null> | null | undefined;
|
|
566
|
+
amenities?: string[] | null | undefined;
|
|
567
|
+
equipments?: string[] | null | undefined;
|
|
568
|
+
currency?: string | null | undefined;
|
|
569
|
+
price?: {
|
|
570
|
+
[x: string]: unknown;
|
|
571
|
+
minimal?: string | number | null | undefined;
|
|
572
|
+
maximal?: string | number | null | undefined;
|
|
573
|
+
} | null | undefined;
|
|
574
|
+
type?: {
|
|
575
|
+
[x: string]: unknown;
|
|
576
|
+
id?: number | null | undefined;
|
|
577
|
+
name?: string | null | undefined;
|
|
578
|
+
} | null | undefined;
|
|
579
|
+
}>;
|
|
580
|
+
/**
|
|
581
|
+
* GET /api/reservations. Dates are `YYYY-MM-DD`; `from`/`to` select stays overlapping the range.
|
|
582
|
+
* Smoobu silently falls back to 25 for a `pageSize` above 100, so that is rejected here.
|
|
583
|
+
*/
|
|
584
|
+
listReservations(params?: SmoobuReservationQuery): Promise<{
|
|
585
|
+
[x: string]: unknown;
|
|
586
|
+
page_count: number;
|
|
587
|
+
page_size: number;
|
|
588
|
+
total_items: number;
|
|
589
|
+
page: number;
|
|
590
|
+
bookings: {
|
|
591
|
+
[x: string]: unknown;
|
|
592
|
+
id: number;
|
|
593
|
+
arrival: string;
|
|
594
|
+
departure: string;
|
|
595
|
+
'reference-id'?: string | null | undefined;
|
|
596
|
+
type?: string | null | undefined;
|
|
597
|
+
'created-at'?: string | null | undefined;
|
|
598
|
+
modifiedAt?: string | null | undefined;
|
|
599
|
+
apartment?: {
|
|
600
|
+
[x: string]: unknown;
|
|
601
|
+
id?: number | null | undefined;
|
|
602
|
+
name?: string | null | undefined;
|
|
603
|
+
} | null | undefined;
|
|
604
|
+
channel?: {
|
|
605
|
+
[x: string]: unknown;
|
|
606
|
+
id?: number | null | undefined;
|
|
607
|
+
channel_id?: number | null | undefined;
|
|
608
|
+
name?: string | null | undefined;
|
|
609
|
+
} | null | undefined;
|
|
610
|
+
'guest-name'?: string | null | undefined;
|
|
611
|
+
firstname?: string | null | undefined;
|
|
612
|
+
lastname?: string | null | undefined;
|
|
613
|
+
email?: string | null | undefined;
|
|
614
|
+
phone?: string | null | undefined;
|
|
615
|
+
adults?: number | null | undefined;
|
|
616
|
+
children?: number | null | undefined;
|
|
617
|
+
'check-in'?: string | null | undefined;
|
|
618
|
+
'check-out'?: string | null | undefined;
|
|
619
|
+
notice?: string | null | undefined;
|
|
620
|
+
'assistant-notice'?: string | null | undefined;
|
|
621
|
+
price?: string | number | null | undefined;
|
|
622
|
+
'price-details'?: string | null | undefined;
|
|
623
|
+
'city-tax'?: string | number | null | undefined;
|
|
624
|
+
'price-paid'?: string | null | undefined;
|
|
625
|
+
'commission-included'?: string | number | null | undefined;
|
|
626
|
+
prepayment?: string | number | null | undefined;
|
|
627
|
+
'prepayment-paid'?: string | null | undefined;
|
|
628
|
+
deposit?: string | number | null | undefined;
|
|
629
|
+
'deposit-paid'?: string | null | undefined;
|
|
630
|
+
language?: string | null | undefined;
|
|
631
|
+
'guest-app-url'?: string | null | undefined;
|
|
632
|
+
'is-blocked-booking'?: boolean | null | undefined;
|
|
633
|
+
guestId?: number | null | undefined;
|
|
634
|
+
related?: {
|
|
635
|
+
[x: string]: unknown;
|
|
636
|
+
id?: number | null | undefined;
|
|
637
|
+
}[] | null | undefined;
|
|
638
|
+
}[];
|
|
639
|
+
}>;
|
|
640
|
+
/** GET /api/reservations/{id} (adds firstname, lastname, assistant-notice, price-details…). */
|
|
641
|
+
getReservation(reservationId: number): Promise<{
|
|
642
|
+
[x: string]: unknown;
|
|
643
|
+
id: number;
|
|
644
|
+
arrival: string;
|
|
645
|
+
departure: string;
|
|
646
|
+
'reference-id'?: string | null | undefined;
|
|
647
|
+
type?: string | null | undefined;
|
|
648
|
+
'created-at'?: string | null | undefined;
|
|
649
|
+
modifiedAt?: string | null | undefined;
|
|
650
|
+
apartment?: {
|
|
651
|
+
[x: string]: unknown;
|
|
652
|
+
id?: number | null | undefined;
|
|
653
|
+
name?: string | null | undefined;
|
|
654
|
+
} | null | undefined;
|
|
655
|
+
channel?: {
|
|
656
|
+
[x: string]: unknown;
|
|
657
|
+
id?: number | null | undefined;
|
|
658
|
+
channel_id?: number | null | undefined;
|
|
659
|
+
name?: string | null | undefined;
|
|
660
|
+
} | null | undefined;
|
|
661
|
+
'guest-name'?: string | null | undefined;
|
|
662
|
+
firstname?: string | null | undefined;
|
|
663
|
+
lastname?: string | null | undefined;
|
|
664
|
+
email?: string | null | undefined;
|
|
665
|
+
phone?: string | null | undefined;
|
|
666
|
+
adults?: number | null | undefined;
|
|
667
|
+
children?: number | null | undefined;
|
|
668
|
+
'check-in'?: string | null | undefined;
|
|
669
|
+
'check-out'?: string | null | undefined;
|
|
670
|
+
notice?: string | null | undefined;
|
|
671
|
+
'assistant-notice'?: string | null | undefined;
|
|
672
|
+
price?: string | number | null | undefined;
|
|
673
|
+
'price-details'?: string | null | undefined;
|
|
674
|
+
'city-tax'?: string | number | null | undefined;
|
|
675
|
+
'price-paid'?: string | null | undefined;
|
|
676
|
+
'commission-included'?: string | number | null | undefined;
|
|
677
|
+
prepayment?: string | number | null | undefined;
|
|
678
|
+
'prepayment-paid'?: string | null | undefined;
|
|
679
|
+
deposit?: string | number | null | undefined;
|
|
680
|
+
'deposit-paid'?: string | null | undefined;
|
|
681
|
+
language?: string | null | undefined;
|
|
682
|
+
'guest-app-url'?: string | null | undefined;
|
|
683
|
+
'is-blocked-booking'?: boolean | null | undefined;
|
|
684
|
+
guestId?: number | null | undefined;
|
|
685
|
+
related?: {
|
|
686
|
+
[x: string]: unknown;
|
|
687
|
+
id?: number | null | undefined;
|
|
688
|
+
}[] | null | undefined;
|
|
689
|
+
}>;
|
|
690
|
+
/** GET /api/guests. Needs the "Guest Data (PII)" key permission (403 otherwise). */
|
|
691
|
+
listGuests(params?: {
|
|
692
|
+
page?: number;
|
|
693
|
+
pageSize?: number;
|
|
694
|
+
query?: string;
|
|
695
|
+
}): Promise<{
|
|
696
|
+
[x: string]: unknown;
|
|
697
|
+
pageCount: number;
|
|
698
|
+
pageSize: number;
|
|
699
|
+
totalItems: number;
|
|
700
|
+
page: number;
|
|
701
|
+
guests: {
|
|
702
|
+
[x: string]: unknown;
|
|
703
|
+
id: number;
|
|
704
|
+
firstName?: string | null | undefined;
|
|
705
|
+
lastName?: string | null | undefined;
|
|
706
|
+
companyName?: string | null | undefined;
|
|
707
|
+
emails?: unknown[] | null | undefined;
|
|
708
|
+
telephoneNumbers?: unknown[] | null | undefined;
|
|
709
|
+
address?: {
|
|
710
|
+
[x: string]: unknown;
|
|
711
|
+
street?: string | null | undefined;
|
|
712
|
+
postalCode?: string | null | undefined;
|
|
713
|
+
city?: string | null | undefined;
|
|
714
|
+
country?: string | null | undefined;
|
|
715
|
+
} | null | undefined;
|
|
716
|
+
notes?: string | null | undefined;
|
|
717
|
+
bookings?: {
|
|
718
|
+
[x: string]: unknown;
|
|
719
|
+
id: number;
|
|
720
|
+
arrival: string;
|
|
721
|
+
departure: string;
|
|
722
|
+
'reference-id'?: string | null | undefined;
|
|
723
|
+
type?: string | null | undefined;
|
|
724
|
+
'created-at'?: string | null | undefined;
|
|
725
|
+
modifiedAt?: string | null | undefined;
|
|
726
|
+
apartment?: {
|
|
727
|
+
[x: string]: unknown;
|
|
728
|
+
id?: number | null | undefined;
|
|
729
|
+
name?: string | null | undefined;
|
|
730
|
+
} | null | undefined;
|
|
731
|
+
channel?: {
|
|
732
|
+
[x: string]: unknown;
|
|
733
|
+
id?: number | null | undefined;
|
|
734
|
+
channel_id?: number | null | undefined;
|
|
735
|
+
name?: string | null | undefined;
|
|
736
|
+
} | null | undefined;
|
|
737
|
+
'guest-name'?: string | null | undefined;
|
|
738
|
+
firstname?: string | null | undefined;
|
|
739
|
+
lastname?: string | null | undefined;
|
|
740
|
+
email?: string | null | undefined;
|
|
741
|
+
phone?: string | null | undefined;
|
|
742
|
+
adults?: number | null | undefined;
|
|
743
|
+
children?: number | null | undefined;
|
|
744
|
+
'check-in'?: string | null | undefined;
|
|
745
|
+
'check-out'?: string | null | undefined;
|
|
746
|
+
notice?: string | null | undefined;
|
|
747
|
+
'assistant-notice'?: string | null | undefined;
|
|
748
|
+
price?: string | number | null | undefined;
|
|
749
|
+
'price-details'?: string | null | undefined;
|
|
750
|
+
'city-tax'?: string | number | null | undefined;
|
|
751
|
+
'price-paid'?: string | null | undefined;
|
|
752
|
+
'commission-included'?: string | number | null | undefined;
|
|
753
|
+
prepayment?: string | number | null | undefined;
|
|
754
|
+
'prepayment-paid'?: string | null | undefined;
|
|
755
|
+
deposit?: string | number | null | undefined;
|
|
756
|
+
'deposit-paid'?: string | null | undefined;
|
|
757
|
+
language?: string | null | undefined;
|
|
758
|
+
'guest-app-url'?: string | null | undefined;
|
|
759
|
+
'is-blocked-booking'?: boolean | null | undefined;
|
|
760
|
+
guestId?: number | null | undefined;
|
|
761
|
+
related?: {
|
|
762
|
+
[x: string]: unknown;
|
|
763
|
+
id?: number | null | undefined;
|
|
764
|
+
}[] | null | undefined;
|
|
765
|
+
}[] | null | undefined;
|
|
766
|
+
}[];
|
|
767
|
+
}>;
|
|
768
|
+
/** GET /api/guests/{id}. Needs the "Guest Data (PII)" key permission (403 otherwise). */
|
|
769
|
+
getGuest(guestId: number): Promise<{
|
|
770
|
+
[x: string]: unknown;
|
|
771
|
+
id: number;
|
|
772
|
+
firstName?: string | null | undefined;
|
|
773
|
+
lastName?: string | null | undefined;
|
|
774
|
+
companyName?: string | null | undefined;
|
|
775
|
+
emails?: unknown[] | null | undefined;
|
|
776
|
+
telephoneNumbers?: unknown[] | null | undefined;
|
|
777
|
+
address?: {
|
|
778
|
+
[x: string]: unknown;
|
|
779
|
+
street?: string | null | undefined;
|
|
780
|
+
postalCode?: string | null | undefined;
|
|
781
|
+
city?: string | null | undefined;
|
|
782
|
+
country?: string | null | undefined;
|
|
783
|
+
} | null | undefined;
|
|
784
|
+
notes?: string | null | undefined;
|
|
785
|
+
bookings?: {
|
|
786
|
+
[x: string]: unknown;
|
|
787
|
+
id: number;
|
|
788
|
+
arrival: string;
|
|
789
|
+
departure: string;
|
|
790
|
+
'reference-id'?: string | null | undefined;
|
|
791
|
+
type?: string | null | undefined;
|
|
792
|
+
'created-at'?: string | null | undefined;
|
|
793
|
+
modifiedAt?: string | null | undefined;
|
|
794
|
+
apartment?: {
|
|
795
|
+
[x: string]: unknown;
|
|
796
|
+
id?: number | null | undefined;
|
|
797
|
+
name?: string | null | undefined;
|
|
798
|
+
} | null | undefined;
|
|
799
|
+
channel?: {
|
|
800
|
+
[x: string]: unknown;
|
|
801
|
+
id?: number | null | undefined;
|
|
802
|
+
channel_id?: number | null | undefined;
|
|
803
|
+
name?: string | null | undefined;
|
|
804
|
+
} | null | undefined;
|
|
805
|
+
'guest-name'?: string | null | undefined;
|
|
806
|
+
firstname?: string | null | undefined;
|
|
807
|
+
lastname?: string | null | undefined;
|
|
808
|
+
email?: string | null | undefined;
|
|
809
|
+
phone?: string | null | undefined;
|
|
810
|
+
adults?: number | null | undefined;
|
|
811
|
+
children?: number | null | undefined;
|
|
812
|
+
'check-in'?: string | null | undefined;
|
|
813
|
+
'check-out'?: string | null | undefined;
|
|
814
|
+
notice?: string | null | undefined;
|
|
815
|
+
'assistant-notice'?: string | null | undefined;
|
|
816
|
+
price?: string | number | null | undefined;
|
|
817
|
+
'price-details'?: string | null | undefined;
|
|
818
|
+
'city-tax'?: string | number | null | undefined;
|
|
819
|
+
'price-paid'?: string | null | undefined;
|
|
820
|
+
'commission-included'?: string | number | null | undefined;
|
|
821
|
+
prepayment?: string | number | null | undefined;
|
|
822
|
+
'prepayment-paid'?: string | null | undefined;
|
|
823
|
+
deposit?: string | number | null | undefined;
|
|
824
|
+
'deposit-paid'?: string | null | undefined;
|
|
825
|
+
language?: string | null | undefined;
|
|
826
|
+
'guest-app-url'?: string | null | undefined;
|
|
827
|
+
'is-blocked-booking'?: boolean | null | undefined;
|
|
828
|
+
guestId?: number | null | undefined;
|
|
829
|
+
related?: {
|
|
830
|
+
[x: string]: unknown;
|
|
831
|
+
id?: number | null | undefined;
|
|
832
|
+
}[] | null | undefined;
|
|
833
|
+
}[] | null | undefined;
|
|
834
|
+
}>;
|
|
244
835
|
/** POST /api/reservations/{id}/messages/send-message-to-guest (no message id is returned). */
|
|
245
836
|
sendMessageToGuest(reservationId: number, body: Omit<SmoobuSendMessageBody, 'internal'>): Promise<{
|
|
246
837
|
[x: string]: unknown;
|
|
@@ -379,7 +970,359 @@ interface Account {
|
|
|
379
970
|
lastName: string | null;
|
|
380
971
|
email: string | null;
|
|
381
972
|
}
|
|
973
|
+
/** A rental unit. Smoobu calls these "apartments". */
|
|
974
|
+
declare const propertySummarySchema: z.ZodObject<{
|
|
975
|
+
id: z.ZodNumber;
|
|
976
|
+
name: z.ZodNullable<z.ZodString>;
|
|
977
|
+
}, z.core.$strip>;
|
|
978
|
+
type PropertySummary = z.infer<typeof propertySummarySchema>;
|
|
979
|
+
declare const propertySchema: z.ZodObject<{
|
|
980
|
+
id: z.ZodNumber;
|
|
981
|
+
name: z.ZodNullable<z.ZodString>;
|
|
982
|
+
type: z.ZodNullable<z.ZodString>;
|
|
983
|
+
location: z.ZodObject<{
|
|
984
|
+
street: z.ZodNullable<z.ZodString>;
|
|
985
|
+
zip: z.ZodNullable<z.ZodString>;
|
|
986
|
+
city: z.ZodNullable<z.ZodString>;
|
|
987
|
+
state: z.ZodNullable<z.ZodString>;
|
|
988
|
+
country: z.ZodNullable<z.ZodString>;
|
|
989
|
+
latitude: z.ZodNullable<z.ZodNumber>;
|
|
990
|
+
longitude: z.ZodNullable<z.ZodNumber>;
|
|
991
|
+
}, z.core.$strip>;
|
|
992
|
+
timeZone: z.ZodNullable<z.ZodString>;
|
|
993
|
+
capacity: z.ZodObject<{
|
|
994
|
+
maxGuests: z.ZodNullable<z.ZodNumber>;
|
|
995
|
+
bedrooms: z.ZodNullable<z.ZodNumber>;
|
|
996
|
+
bathrooms: z.ZodNullable<z.ZodNumber>;
|
|
997
|
+
beds: z.ZodObject<{
|
|
998
|
+
double: z.ZodNullable<z.ZodNumber>;
|
|
999
|
+
single: z.ZodNullable<z.ZodNumber>;
|
|
1000
|
+
queen: z.ZodNullable<z.ZodNumber>;
|
|
1001
|
+
king: z.ZodNullable<z.ZodNumber>;
|
|
1002
|
+
sofa: z.ZodNullable<z.ZodNumber>;
|
|
1003
|
+
couch: z.ZodNullable<z.ZodNumber>;
|
|
1004
|
+
child: z.ZodNullable<z.ZodNumber>;
|
|
1005
|
+
}, z.core.$strip>;
|
|
1006
|
+
}, z.core.$strip>;
|
|
1007
|
+
amenities: z.ZodArray<z.ZodString>;
|
|
1008
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
1009
|
+
priceRange: z.ZodObject<{
|
|
1010
|
+
min: z.ZodNullable<z.ZodNumber>;
|
|
1011
|
+
max: z.ZodNullable<z.ZodNumber>;
|
|
1012
|
+
}, z.core.$strip>;
|
|
1013
|
+
}, z.core.$strip>;
|
|
1014
|
+
type Property = z.infer<typeof propertySchema>;
|
|
1015
|
+
/**
|
|
1016
|
+
* confirmed = a live booking; modified = changed after creation; cancelled; blocked = dates
|
|
1017
|
+
* blocked by the host (no guest).
|
|
1018
|
+
*/
|
|
1019
|
+
declare const reservationStatusSchema: z.ZodEnum<{
|
|
1020
|
+
confirmed: "confirmed";
|
|
1021
|
+
modified: "modified";
|
|
1022
|
+
cancelled: "cancelled";
|
|
1023
|
+
blocked: "blocked";
|
|
1024
|
+
}>;
|
|
1025
|
+
type ReservationStatus = z.infer<typeof reservationStatusSchema>;
|
|
1026
|
+
declare const reservationSchema: z.ZodObject<{
|
|
1027
|
+
id: z.ZodNumber;
|
|
1028
|
+
reference: z.ZodNullable<z.ZodString>;
|
|
1029
|
+
status: z.ZodEnum<{
|
|
1030
|
+
confirmed: "confirmed";
|
|
1031
|
+
modified: "modified";
|
|
1032
|
+
cancelled: "cancelled";
|
|
1033
|
+
blocked: "blocked";
|
|
1034
|
+
}>;
|
|
1035
|
+
property: z.ZodNullable<z.ZodObject<{
|
|
1036
|
+
id: z.ZodNumber;
|
|
1037
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1038
|
+
}, z.core.$strip>>;
|
|
1039
|
+
channel: z.ZodNullable<z.ZodObject<{
|
|
1040
|
+
typeId: z.ZodNullable<z.ZodNumber>;
|
|
1041
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1042
|
+
}, z.core.$strip>>;
|
|
1043
|
+
stay: z.ZodObject<{
|
|
1044
|
+
arrival: z.ZodISODate;
|
|
1045
|
+
departure: z.ZodISODate;
|
|
1046
|
+
nights: z.ZodNullable<z.ZodNumber>;
|
|
1047
|
+
checkInTime: z.ZodNullable<z.ZodString>;
|
|
1048
|
+
checkOutTime: z.ZodNullable<z.ZodString>;
|
|
1049
|
+
adults: z.ZodNullable<z.ZodNumber>;
|
|
1050
|
+
children: z.ZodNullable<z.ZodNumber>;
|
|
1051
|
+
}, z.core.$strip>;
|
|
1052
|
+
guest: z.ZodObject<{
|
|
1053
|
+
id: z.ZodNullable<z.ZodNumber>;
|
|
1054
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1055
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
1056
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
1057
|
+
email: z.ZodNullable<z.ZodString>;
|
|
1058
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
1059
|
+
language: z.ZodNullable<z.ZodString>;
|
|
1060
|
+
}, z.core.$strip>;
|
|
1061
|
+
notes: z.ZodObject<{
|
|
1062
|
+
guest: z.ZodNullable<z.ZodString>;
|
|
1063
|
+
assistant: z.ZodNullable<z.ZodString>;
|
|
1064
|
+
}, z.core.$strip>;
|
|
1065
|
+
payment: z.ZodObject<{
|
|
1066
|
+
total: z.ZodNullable<z.ZodNumber>;
|
|
1067
|
+
paid: z.ZodNullable<z.ZodBoolean>;
|
|
1068
|
+
prepayment: z.ZodNullable<z.ZodNumber>;
|
|
1069
|
+
prepaymentPaid: z.ZodNullable<z.ZodBoolean>;
|
|
1070
|
+
deposit: z.ZodNullable<z.ZodNumber>;
|
|
1071
|
+
depositPaid: z.ZodNullable<z.ZodBoolean>;
|
|
1072
|
+
cityTax: z.ZodNullable<z.ZodNumber>;
|
|
1073
|
+
channelCommission: z.ZodNullable<z.ZodNumber>;
|
|
1074
|
+
details: z.ZodNullable<z.ZodString>;
|
|
1075
|
+
}, z.core.$strip>;
|
|
1076
|
+
guestAppUrl: z.ZodNullable<z.ZodString>;
|
|
1077
|
+
relatedPropertyIds: z.ZodArray<z.ZodNumber>;
|
|
1078
|
+
createdAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1079
|
+
modifiedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1080
|
+
}, z.core.$strip>;
|
|
1081
|
+
type Reservation = z.infer<typeof reservationSchema>;
|
|
1082
|
+
declare const reservationPageSchema: z.ZodObject<{
|
|
1083
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1084
|
+
id: z.ZodNumber;
|
|
1085
|
+
reference: z.ZodNullable<z.ZodString>;
|
|
1086
|
+
status: z.ZodEnum<{
|
|
1087
|
+
confirmed: "confirmed";
|
|
1088
|
+
modified: "modified";
|
|
1089
|
+
cancelled: "cancelled";
|
|
1090
|
+
blocked: "blocked";
|
|
1091
|
+
}>;
|
|
1092
|
+
property: z.ZodNullable<z.ZodObject<{
|
|
1093
|
+
id: z.ZodNumber;
|
|
1094
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1095
|
+
}, z.core.$strip>>;
|
|
1096
|
+
channel: z.ZodNullable<z.ZodObject<{
|
|
1097
|
+
typeId: z.ZodNullable<z.ZodNumber>;
|
|
1098
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1099
|
+
}, z.core.$strip>>;
|
|
1100
|
+
stay: z.ZodObject<{
|
|
1101
|
+
arrival: z.ZodISODate;
|
|
1102
|
+
departure: z.ZodISODate;
|
|
1103
|
+
nights: z.ZodNullable<z.ZodNumber>;
|
|
1104
|
+
checkInTime: z.ZodNullable<z.ZodString>;
|
|
1105
|
+
checkOutTime: z.ZodNullable<z.ZodString>;
|
|
1106
|
+
adults: z.ZodNullable<z.ZodNumber>;
|
|
1107
|
+
children: z.ZodNullable<z.ZodNumber>;
|
|
1108
|
+
}, z.core.$strip>;
|
|
1109
|
+
guest: z.ZodObject<{
|
|
1110
|
+
id: z.ZodNullable<z.ZodNumber>;
|
|
1111
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1112
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
1113
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
1114
|
+
email: z.ZodNullable<z.ZodString>;
|
|
1115
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
1116
|
+
language: z.ZodNullable<z.ZodString>;
|
|
1117
|
+
}, z.core.$strip>;
|
|
1118
|
+
notes: z.ZodObject<{
|
|
1119
|
+
guest: z.ZodNullable<z.ZodString>;
|
|
1120
|
+
assistant: z.ZodNullable<z.ZodString>;
|
|
1121
|
+
}, z.core.$strip>;
|
|
1122
|
+
payment: z.ZodObject<{
|
|
1123
|
+
total: z.ZodNullable<z.ZodNumber>;
|
|
1124
|
+
paid: z.ZodNullable<z.ZodBoolean>;
|
|
1125
|
+
prepayment: z.ZodNullable<z.ZodNumber>;
|
|
1126
|
+
prepaymentPaid: z.ZodNullable<z.ZodBoolean>;
|
|
1127
|
+
deposit: z.ZodNullable<z.ZodNumber>;
|
|
1128
|
+
depositPaid: z.ZodNullable<z.ZodBoolean>;
|
|
1129
|
+
cityTax: z.ZodNullable<z.ZodNumber>;
|
|
1130
|
+
channelCommission: z.ZodNullable<z.ZodNumber>;
|
|
1131
|
+
details: z.ZodNullable<z.ZodString>;
|
|
1132
|
+
}, z.core.$strip>;
|
|
1133
|
+
guestAppUrl: z.ZodNullable<z.ZodString>;
|
|
1134
|
+
relatedPropertyIds: z.ZodArray<z.ZodNumber>;
|
|
1135
|
+
createdAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1136
|
+
modifiedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1137
|
+
}, z.core.$strip>>;
|
|
1138
|
+
page: z.ZodNumber;
|
|
1139
|
+
pageSize: z.ZodNumber;
|
|
1140
|
+
pageCount: z.ZodNumber;
|
|
1141
|
+
total: z.ZodNumber;
|
|
1142
|
+
}, z.core.$strip>;
|
|
1143
|
+
type ReservationPage = z.infer<typeof reservationPageSchema>;
|
|
1144
|
+
/** Filters for `reservations.list`. Dates are `YYYY-MM-DD`; every range bound is inclusive. */
|
|
1145
|
+
interface ReservationFilter {
|
|
1146
|
+
page?: number;
|
|
1147
|
+
/** 1–100. Smoobu's default is 25. */
|
|
1148
|
+
pageSize?: number;
|
|
1149
|
+
propertyId?: number;
|
|
1150
|
+
/** Also return bookings of grouped properties (needs propertyId). */
|
|
1151
|
+
includeRelated?: boolean;
|
|
1152
|
+
/** Stays overlapping [stayFrom, stayTo]. Use the same date for "staying on that day". */
|
|
1153
|
+
stayFrom?: string;
|
|
1154
|
+
stayTo?: string;
|
|
1155
|
+
arrivalFrom?: string;
|
|
1156
|
+
arrivalTo?: string;
|
|
1157
|
+
departureFrom?: string;
|
|
1158
|
+
departureTo?: string;
|
|
1159
|
+
createdFrom?: string;
|
|
1160
|
+
createdTo?: string;
|
|
1161
|
+
modifiedFrom?: string;
|
|
1162
|
+
modifiedTo?: string;
|
|
1163
|
+
/** Default false: Smoobu leaves cancelled bookings out. */
|
|
1164
|
+
includeCancelled?: boolean;
|
|
1165
|
+
/** Default true (Smoobu's default): host-blocked dates are returned as status "blocked". */
|
|
1166
|
+
includeBlocked?: boolean;
|
|
1167
|
+
}
|
|
1168
|
+
/** Smoobu's guest CRM record. Only available with the "Guest Data (PII)" key permission. */
|
|
1169
|
+
declare const guestSchema: z.ZodObject<{
|
|
1170
|
+
id: z.ZodNumber;
|
|
1171
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
1172
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
1173
|
+
companyName: z.ZodNullable<z.ZodString>;
|
|
1174
|
+
emails: z.ZodArray<z.ZodString>;
|
|
1175
|
+
phones: z.ZodArray<z.ZodString>;
|
|
1176
|
+
address: z.ZodNullable<z.ZodObject<{
|
|
1177
|
+
street: z.ZodNullable<z.ZodString>;
|
|
1178
|
+
postalCode: z.ZodNullable<z.ZodString>;
|
|
1179
|
+
city: z.ZodNullable<z.ZodString>;
|
|
1180
|
+
country: z.ZodNullable<z.ZodString>;
|
|
1181
|
+
}, z.core.$strip>>;
|
|
1182
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
1183
|
+
reservations: z.ZodArray<z.ZodObject<{
|
|
1184
|
+
id: z.ZodNumber;
|
|
1185
|
+
reference: z.ZodNullable<z.ZodString>;
|
|
1186
|
+
status: z.ZodEnum<{
|
|
1187
|
+
confirmed: "confirmed";
|
|
1188
|
+
modified: "modified";
|
|
1189
|
+
cancelled: "cancelled";
|
|
1190
|
+
blocked: "blocked";
|
|
1191
|
+
}>;
|
|
1192
|
+
property: z.ZodNullable<z.ZodObject<{
|
|
1193
|
+
id: z.ZodNumber;
|
|
1194
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1195
|
+
}, z.core.$strip>>;
|
|
1196
|
+
channel: z.ZodNullable<z.ZodObject<{
|
|
1197
|
+
typeId: z.ZodNullable<z.ZodNumber>;
|
|
1198
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1199
|
+
}, z.core.$strip>>;
|
|
1200
|
+
stay: z.ZodObject<{
|
|
1201
|
+
arrival: z.ZodISODate;
|
|
1202
|
+
departure: z.ZodISODate;
|
|
1203
|
+
nights: z.ZodNullable<z.ZodNumber>;
|
|
1204
|
+
checkInTime: z.ZodNullable<z.ZodString>;
|
|
1205
|
+
checkOutTime: z.ZodNullable<z.ZodString>;
|
|
1206
|
+
adults: z.ZodNullable<z.ZodNumber>;
|
|
1207
|
+
children: z.ZodNullable<z.ZodNumber>;
|
|
1208
|
+
}, z.core.$strip>;
|
|
1209
|
+
guest: z.ZodObject<{
|
|
1210
|
+
id: z.ZodNullable<z.ZodNumber>;
|
|
1211
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1212
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
1213
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
1214
|
+
email: z.ZodNullable<z.ZodString>;
|
|
1215
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
1216
|
+
language: z.ZodNullable<z.ZodString>;
|
|
1217
|
+
}, z.core.$strip>;
|
|
1218
|
+
notes: z.ZodObject<{
|
|
1219
|
+
guest: z.ZodNullable<z.ZodString>;
|
|
1220
|
+
assistant: z.ZodNullable<z.ZodString>;
|
|
1221
|
+
}, z.core.$strip>;
|
|
1222
|
+
payment: z.ZodObject<{
|
|
1223
|
+
total: z.ZodNullable<z.ZodNumber>;
|
|
1224
|
+
paid: z.ZodNullable<z.ZodBoolean>;
|
|
1225
|
+
prepayment: z.ZodNullable<z.ZodNumber>;
|
|
1226
|
+
prepaymentPaid: z.ZodNullable<z.ZodBoolean>;
|
|
1227
|
+
deposit: z.ZodNullable<z.ZodNumber>;
|
|
1228
|
+
depositPaid: z.ZodNullable<z.ZodBoolean>;
|
|
1229
|
+
cityTax: z.ZodNullable<z.ZodNumber>;
|
|
1230
|
+
channelCommission: z.ZodNullable<z.ZodNumber>;
|
|
1231
|
+
details: z.ZodNullable<z.ZodString>;
|
|
1232
|
+
}, z.core.$strip>;
|
|
1233
|
+
guestAppUrl: z.ZodNullable<z.ZodString>;
|
|
1234
|
+
relatedPropertyIds: z.ZodArray<z.ZodNumber>;
|
|
1235
|
+
createdAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1236
|
+
modifiedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1237
|
+
}, z.core.$strip>>;
|
|
1238
|
+
}, z.core.$strip>;
|
|
1239
|
+
type Guest = z.infer<typeof guestSchema>;
|
|
1240
|
+
declare const guestPageSchema: z.ZodObject<{
|
|
1241
|
+
items: z.ZodArray<z.ZodObject<{
|
|
1242
|
+
id: z.ZodNumber;
|
|
1243
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
1244
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
1245
|
+
companyName: z.ZodNullable<z.ZodString>;
|
|
1246
|
+
emails: z.ZodArray<z.ZodString>;
|
|
1247
|
+
phones: z.ZodArray<z.ZodString>;
|
|
1248
|
+
address: z.ZodNullable<z.ZodObject<{
|
|
1249
|
+
street: z.ZodNullable<z.ZodString>;
|
|
1250
|
+
postalCode: z.ZodNullable<z.ZodString>;
|
|
1251
|
+
city: z.ZodNullable<z.ZodString>;
|
|
1252
|
+
country: z.ZodNullable<z.ZodString>;
|
|
1253
|
+
}, z.core.$strip>>;
|
|
1254
|
+
notes: z.ZodNullable<z.ZodString>;
|
|
1255
|
+
reservations: z.ZodArray<z.ZodObject<{
|
|
1256
|
+
id: z.ZodNumber;
|
|
1257
|
+
reference: z.ZodNullable<z.ZodString>;
|
|
1258
|
+
status: z.ZodEnum<{
|
|
1259
|
+
confirmed: "confirmed";
|
|
1260
|
+
modified: "modified";
|
|
1261
|
+
cancelled: "cancelled";
|
|
1262
|
+
blocked: "blocked";
|
|
1263
|
+
}>;
|
|
1264
|
+
property: z.ZodNullable<z.ZodObject<{
|
|
1265
|
+
id: z.ZodNumber;
|
|
1266
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1267
|
+
}, z.core.$strip>>;
|
|
1268
|
+
channel: z.ZodNullable<z.ZodObject<{
|
|
1269
|
+
typeId: z.ZodNullable<z.ZodNumber>;
|
|
1270
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1271
|
+
}, z.core.$strip>>;
|
|
1272
|
+
stay: z.ZodObject<{
|
|
1273
|
+
arrival: z.ZodISODate;
|
|
1274
|
+
departure: z.ZodISODate;
|
|
1275
|
+
nights: z.ZodNullable<z.ZodNumber>;
|
|
1276
|
+
checkInTime: z.ZodNullable<z.ZodString>;
|
|
1277
|
+
checkOutTime: z.ZodNullable<z.ZodString>;
|
|
1278
|
+
adults: z.ZodNullable<z.ZodNumber>;
|
|
1279
|
+
children: z.ZodNullable<z.ZodNumber>;
|
|
1280
|
+
}, z.core.$strip>;
|
|
1281
|
+
guest: z.ZodObject<{
|
|
1282
|
+
id: z.ZodNullable<z.ZodNumber>;
|
|
1283
|
+
name: z.ZodNullable<z.ZodString>;
|
|
1284
|
+
firstName: z.ZodNullable<z.ZodString>;
|
|
1285
|
+
lastName: z.ZodNullable<z.ZodString>;
|
|
1286
|
+
email: z.ZodNullable<z.ZodString>;
|
|
1287
|
+
phone: z.ZodNullable<z.ZodString>;
|
|
1288
|
+
language: z.ZodNullable<z.ZodString>;
|
|
1289
|
+
}, z.core.$strip>;
|
|
1290
|
+
notes: z.ZodObject<{
|
|
1291
|
+
guest: z.ZodNullable<z.ZodString>;
|
|
1292
|
+
assistant: z.ZodNullable<z.ZodString>;
|
|
1293
|
+
}, z.core.$strip>;
|
|
1294
|
+
payment: z.ZodObject<{
|
|
1295
|
+
total: z.ZodNullable<z.ZodNumber>;
|
|
1296
|
+
paid: z.ZodNullable<z.ZodBoolean>;
|
|
1297
|
+
prepayment: z.ZodNullable<z.ZodNumber>;
|
|
1298
|
+
prepaymentPaid: z.ZodNullable<z.ZodBoolean>;
|
|
1299
|
+
deposit: z.ZodNullable<z.ZodNumber>;
|
|
1300
|
+
depositPaid: z.ZodNullable<z.ZodBoolean>;
|
|
1301
|
+
cityTax: z.ZodNullable<z.ZodNumber>;
|
|
1302
|
+
channelCommission: z.ZodNullable<z.ZodNumber>;
|
|
1303
|
+
details: z.ZodNullable<z.ZodString>;
|
|
1304
|
+
}, z.core.$strip>;
|
|
1305
|
+
guestAppUrl: z.ZodNullable<z.ZodString>;
|
|
1306
|
+
relatedPropertyIds: z.ZodArray<z.ZodNumber>;
|
|
1307
|
+
createdAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1308
|
+
modifiedAt: z.ZodNullable<z.ZodISODateTime>;
|
|
1309
|
+
}, z.core.$strip>>;
|
|
1310
|
+
}, z.core.$strip>>;
|
|
1311
|
+
page: z.ZodNumber;
|
|
1312
|
+
pageSize: z.ZodNumber;
|
|
1313
|
+
pageCount: z.ZodNumber;
|
|
1314
|
+
total: z.ZodNumber;
|
|
1315
|
+
}, z.core.$strip>;
|
|
1316
|
+
type GuestPage = z.infer<typeof guestPageSchema>;
|
|
382
1317
|
|
|
1318
|
+
/**
|
|
1319
|
+
* Iterates over every item of a paged endpoint, fetching pages lazily.
|
|
1320
|
+
*
|
|
1321
|
+
* ```ts
|
|
1322
|
+
* for await (const r of paginate((page) => smoobu.reservations.list({ page, pageSize: 100 }))) …
|
|
1323
|
+
* ```
|
|
1324
|
+
*/
|
|
1325
|
+
declare function paginate<T>(fetchPage: (page: number) => Promise<Page<T>>): AsyncGenerator<T>;
|
|
383
1326
|
/**
|
|
384
1327
|
* High-level Smoobu API: speaks the clean domain model (types.ts). Use `.client` for raw,
|
|
385
1328
|
* endpoint-level access to anything not covered here yet.
|
|
@@ -389,6 +1332,28 @@ declare class Smoobu {
|
|
|
389
1332
|
constructor(options: SmoobuClientOptions | SmoobuClient);
|
|
390
1333
|
/** The account the API key belongs to (GET /api/me). The cheapest credentials check. */
|
|
391
1334
|
getAccount(): Promise<Account>;
|
|
1335
|
+
readonly properties: {
|
|
1336
|
+
/** All properties (ids and names). Smoobu calls them apartments. */
|
|
1337
|
+
list: () => Promise<PropertySummary[]>;
|
|
1338
|
+
/** One property's details: location, time zone, capacity, amenities, currency. */
|
|
1339
|
+
get: (propertyId: number) => Promise<Property>;
|
|
1340
|
+
};
|
|
1341
|
+
readonly reservations: {
|
|
1342
|
+
/** Reservations matching the filter, in Smoobu's order. Dates are `YYYY-MM-DD`. */
|
|
1343
|
+
list: (filter?: ReservationFilter) => Promise<ReservationPage>;
|
|
1344
|
+
/** One reservation, with the fields only the single-booking endpoint returns. */
|
|
1345
|
+
get: (reservationId: number) => Promise<Reservation>;
|
|
1346
|
+
};
|
|
1347
|
+
/** Smoobu's guest CRM. Requires the API key's "Guest Data (PII)" permission (403 otherwise). */
|
|
1348
|
+
readonly guests: {
|
|
1349
|
+
get: (guestId: number) => Promise<Guest>;
|
|
1350
|
+
/** Searches guests by a free-text query (name, email…). */
|
|
1351
|
+
search: (params?: {
|
|
1352
|
+
query?: string;
|
|
1353
|
+
page?: number;
|
|
1354
|
+
pageSize?: number;
|
|
1355
|
+
}) => Promise<GuestPage>;
|
|
1356
|
+
};
|
|
392
1357
|
readonly messages: {
|
|
393
1358
|
/** Conversations, most recent first, with the latest message of each (GET /api/threads). */
|
|
394
1359
|
listConversations: (params?: {
|
|
@@ -441,10 +1406,16 @@ declare function signRequest(input: SignInput): Record<string, string>;
|
|
|
441
1406
|
|
|
442
1407
|
declare function htmlToText(html: string): string;
|
|
443
1408
|
|
|
444
|
-
/** "YYYY-MM-DD HH:MM:SS" → "YYYY-MM-DDTHH:MM:SS"; anything unexpected → null. */
|
|
1409
|
+
/** "YYYY-MM-DD HH:MM[:SS]" → "YYYY-MM-DDTHH:MM:SS"; anything unexpected → null. */
|
|
445
1410
|
declare function toLocalDateTime(value: string | null | undefined): string | null;
|
|
446
1411
|
declare function toMessage(reservationId: number, m: SmoobuMessage): Message;
|
|
447
1412
|
declare function toConversationSummary(t: SmoobuThread): ConversationSummary;
|
|
1413
|
+
declare function toProperty(a: SmoobuApartment, fallback: {
|
|
1414
|
+
id: number;
|
|
1415
|
+
name?: string | null;
|
|
1416
|
+
}): Property;
|
|
1417
|
+
declare function toReservation(b: SmoobuBooking): Reservation;
|
|
1418
|
+
declare function toGuest(g: SmoobuGuest): Guest;
|
|
448
1419
|
|
|
449
|
-
export { Smoobu, SmoobuApiError, SmoobuClient, SmoobuResponseShapeError, canonicalQuery, conversationPageSchema, conversationSummarySchema, htmlToText, messageAudienceSchema, messageDirectionSchema, messagePageSchema, messageSchema, pageSchema, signRequest, toConversationSummary, toLocalDateTime, toMessage, wire };
|
|
450
|
-
export type { Account, ConversationPage, ConversationSummary, Message, MessageAudience, MessageDirection, MessagePage, Page, Query, QueryValue, SendMessageInput, SignInput, SmoobuClientOptions, SmoobuErrorCode };
|
|
1420
|
+
export { Smoobu, SmoobuApiError, SmoobuClient, SmoobuResponseShapeError, canonicalQuery, conversationPageSchema, conversationSummarySchema, guestPageSchema, guestSchema, htmlToText, messageAudienceSchema, messageDirectionSchema, messagePageSchema, messageSchema, pageSchema, paginate, propertySchema, propertySummarySchema, reservationPageSchema, reservationSchema, reservationStatusSchema, signRequest, toConversationSummary, toGuest, toLocalDateTime, toMessage, toProperty, toReservation, wire };
|
|
1421
|
+
export type { Account, ConversationPage, ConversationSummary, Guest, GuestPage, Message, MessageAudience, MessageDirection, MessagePage, Page, Property, PropertySummary, Query, QueryValue, Reservation, ReservationFilter, ReservationPage, ReservationStatus, SendMessageInput, SignInput, SmoobuClientOptions, SmoobuErrorCode, SmoobuReservationQuery };
|