@peektravel/app-utilities 0.2.5 → 0.2.7
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/dist/index.cjs +58 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +219 -25
- package/dist/index.d.ts +219 -25
- package/dist/index.js +58 -31
- package/dist/index.js.map +1 -1
- package/dist/ui/index.cjs +39 -8
- package/dist/ui/index.cjs.map +1 -1
- package/dist/ui/index.d.cts +9 -3
- package/dist/ui/index.d.ts +9 -3
- package/dist/ui/index.js +39 -8
- package/dist/ui/index.js.map +1 -1
- package/docs/webhooks.md +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -156,113 +156,248 @@ declare class ProductService {
|
|
|
156
156
|
}
|
|
157
157
|
|
|
158
158
|
/**
|
|
159
|
-
* The clean data model for Peek Pro bookings.
|
|
159
|
+
* The clean, transport-agnostic data model for Peek Pro bookings.
|
|
160
|
+
*
|
|
161
|
+
* This is the shape consumers of the package work with. It is intentionally
|
|
162
|
+
* decoupled from the underlying Peek GraphQL schema — the raw GraphQL types and
|
|
163
|
+
* the conversion logic live inside the package and are never exposed here. A
|
|
164
|
+
* booking is the central resource: it carries the customer, the activity and
|
|
165
|
+
* slot, the ticket lines, lifecycle flags, money totals, and (optionally) the
|
|
166
|
+
* guest list and full price breakdown.
|
|
160
167
|
*/
|
|
161
|
-
/** A ticket line within a booking. */
|
|
168
|
+
/** A ticket line within a booking (one resource option and its quantity). */
|
|
162
169
|
interface Ticket {
|
|
170
|
+
/** Ticket (resource option) name, e.g. `"Adult"`. Falls back to `"Unknown"`. */
|
|
163
171
|
name: string;
|
|
172
|
+
/** How many of this ticket are on the booking. */
|
|
164
173
|
quantity: number;
|
|
174
|
+
/** The resource option id backing this ticket. Falls back to `"unknown"`. */
|
|
165
175
|
ticketId: string;
|
|
176
|
+
/**
|
|
177
|
+
* Per-unit list price of the ticket — only populated when
|
|
178
|
+
* `includePriceBreakdown` is requested.
|
|
179
|
+
*/
|
|
180
|
+
listPrice?: Price;
|
|
181
|
+
/**
|
|
182
|
+
* Total value for this ticket line — only populated when
|
|
183
|
+
* `includePriceBreakdown` is requested.
|
|
184
|
+
*/
|
|
185
|
+
totalValue?: Price;
|
|
166
186
|
}
|
|
167
|
-
/** A formatted monetary value. */
|
|
187
|
+
/** A formatted monetary value: a human display string plus its raw amount. */
|
|
168
188
|
interface Price {
|
|
189
|
+
/** Human-formatted amount (e.g. `"$25.00"`). */
|
|
169
190
|
display: string;
|
|
191
|
+
/** Numeric amount as a string (e.g. `"25.00"`). */
|
|
170
192
|
amount: string;
|
|
171
193
|
}
|
|
172
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* A resource pool used by a booking (e.g. a kayak or guide pool), with the
|
|
196
|
+
* quantity drawn from it.
|
|
197
|
+
*/
|
|
173
198
|
interface Resource {
|
|
199
|
+
/** How many units of the resource the booking uses. */
|
|
174
200
|
quantity: number;
|
|
201
|
+
/** Resource pool name. */
|
|
175
202
|
name: string;
|
|
203
|
+
/** Resource pool short name. */
|
|
176
204
|
shortName: string;
|
|
177
205
|
}
|
|
178
|
-
/**
|
|
206
|
+
/**
|
|
207
|
+
* A concrete resource assigned to a booking (a specific resource within a
|
|
208
|
+
* pool, as opposed to the pool-level {@link Resource} count).
|
|
209
|
+
*/
|
|
179
210
|
interface ResourcePoolAssignment {
|
|
211
|
+
/** Assigned resource id. */
|
|
180
212
|
id: string;
|
|
213
|
+
/** Assigned resource name. */
|
|
181
214
|
name: string;
|
|
182
215
|
}
|
|
183
|
-
/**
|
|
216
|
+
/**
|
|
217
|
+
* A custom question/answer captured on a booking or a guest. Location questions
|
|
218
|
+
* additionally carry a captured lat/long.
|
|
219
|
+
*/
|
|
184
220
|
interface CustomQuestionAnswer {
|
|
221
|
+
/** The question text as shown to the customer. */
|
|
185
222
|
question: string;
|
|
223
|
+
/** The customer's answer. */
|
|
186
224
|
answer: string;
|
|
225
|
+
/** Captured latitude, present only for location questions. */
|
|
187
226
|
latitude?: string;
|
|
227
|
+
/** Captured longitude, present only for location questions. */
|
|
188
228
|
longitude?: string;
|
|
189
229
|
}
|
|
190
|
-
/** A
|
|
230
|
+
/** A custom field response captured against a {@link Guest}. */
|
|
191
231
|
interface GuestMetadata {
|
|
232
|
+
/** Field response id. */
|
|
192
233
|
id: string;
|
|
234
|
+
/** The field's name. */
|
|
193
235
|
name: string;
|
|
236
|
+
/** The captured value (empty string when none). */
|
|
194
237
|
value: string;
|
|
195
238
|
}
|
|
196
|
-
/**
|
|
239
|
+
/**
|
|
240
|
+
* A guest on a booking. Populated only when guests are requested
|
|
241
|
+
* (`includeGuests`); the primary guest is included and flagged via
|
|
242
|
+
* {@link Guest.isPrimary}.
|
|
243
|
+
*/
|
|
197
244
|
interface Guest {
|
|
245
|
+
/** Unique guest id. */
|
|
198
246
|
id: string;
|
|
247
|
+
/** Guest name, or null. */
|
|
199
248
|
name: string | null;
|
|
249
|
+
/** Guest country, or null. */
|
|
200
250
|
country: string | null;
|
|
251
|
+
/** Date of birth, or null. */
|
|
201
252
|
dateOfBirth: Date | null;
|
|
253
|
+
/** Phone number, or null. */
|
|
202
254
|
phone: string | null;
|
|
255
|
+
/** Email address, or null. */
|
|
203
256
|
email: string | null;
|
|
257
|
+
/** Whether the guest is subject to GDPR handling. */
|
|
204
258
|
isGdpr: boolean;
|
|
259
|
+
/** Whether the guest is an actual participant (vs. a booker only). */
|
|
205
260
|
isParticipant: boolean;
|
|
261
|
+
/** Whether this is the booking's primary guest. */
|
|
206
262
|
isPrimary: boolean;
|
|
263
|
+
/** Whether the guest opted in to SMS. */
|
|
207
264
|
optinSms: boolean;
|
|
265
|
+
/** Whether the guest opted in to marketing. */
|
|
208
266
|
optinMarketing: boolean;
|
|
267
|
+
/** Postal code, or null. */
|
|
209
268
|
postalCode: string | null;
|
|
269
|
+
/** Custom field responses captured for this guest. */
|
|
210
270
|
metadata: GuestMetadata[];
|
|
211
271
|
}
|
|
212
272
|
/** A booking in Peek Pro. */
|
|
213
273
|
interface Booking {
|
|
274
|
+
/** Stable unique booking id. */
|
|
214
275
|
bookingId: string;
|
|
276
|
+
/** Human-facing display id shown in the Peek UI (e.g. `"B-123456"`). */
|
|
215
277
|
displayId: string;
|
|
278
|
+
/**
|
|
279
|
+
* Normalized booking source, e.g. `"website"`, `"app"`, `"expedia"`.
|
|
280
|
+
* `"unknown"` when the origin can't be mapped.
|
|
281
|
+
*/
|
|
216
282
|
source: string;
|
|
283
|
+
/** Raw source app reported by Peek (e.g. `"WIDGET"`). `"unknown"` if absent. */
|
|
217
284
|
sourceApp: string;
|
|
285
|
+
/**
|
|
286
|
+
* Human-readable source description (e.g. `"Website Booking Flow"`).
|
|
287
|
+
* `"unknown"` when the origin can't be mapped.
|
|
288
|
+
*/
|
|
218
289
|
sourceDescription: string;
|
|
290
|
+
/**
|
|
291
|
+
* Raw source actor name reported by Peek, when present. `null` when the
|
|
292
|
+
* origin actor carries no name.
|
|
293
|
+
*/
|
|
294
|
+
sourceDetails: string | null;
|
|
295
|
+
/** Primary guest's name, or `""` when unknown. */
|
|
219
296
|
customerName: string | null;
|
|
297
|
+
/** Primary guest's email, or null. */
|
|
220
298
|
customerEmail: string | null;
|
|
299
|
+
/** Primary guest's phone, or null. */
|
|
221
300
|
customerPhone: string | null;
|
|
301
|
+
/** The activity (product) id this booking is for. `"unknown"` if absent. */
|
|
222
302
|
productId: string;
|
|
303
|
+
/** The activity (product) name. `"unknown"` if absent. */
|
|
223
304
|
productName: string;
|
|
305
|
+
/** Whether the booked product is a rental (vs. a standard activity). */
|
|
224
306
|
isRentalProduct: boolean;
|
|
307
|
+
/** The timeslot's legacy id, or null when the booking has no timeslot. */
|
|
225
308
|
timeslotId: string | null;
|
|
309
|
+
/** Total number of tickets across all ticket lines. */
|
|
226
310
|
totalTickets: number;
|
|
311
|
+
/** Human-readable ticket summary (e.g. `"2x Adult, 1x Child"`). */
|
|
227
312
|
ticketDescription: string;
|
|
313
|
+
/** The individual ticket lines on the booking. */
|
|
228
314
|
tickets: Ticket[];
|
|
315
|
+
/** Whether the booking has been canceled. */
|
|
229
316
|
isCanceled: boolean;
|
|
317
|
+
/** Whether the booking was marked a no-show. */
|
|
230
318
|
isNoShow: boolean;
|
|
319
|
+
/** Whether any guest on the booking has been checked in. */
|
|
231
320
|
isCheckedIn: boolean;
|
|
321
|
+
/** Whether the booking's rental has been returned. */
|
|
232
322
|
isReturned: boolean;
|
|
323
|
+
/** Purchase time in the account's local zone (ISO datetime), or null. */
|
|
233
324
|
purchasedAt: string | null;
|
|
325
|
+
/** Purchase time in UTC (ISO datetime), or null. */
|
|
234
326
|
purchasedAtUtc: string | null;
|
|
327
|
+
/** Activity start in the account's local zone (ISO datetime), or null. */
|
|
235
328
|
startsAt: string | null;
|
|
329
|
+
/** Activity start in UTC (ISO datetime), or null. */
|
|
236
330
|
startsAtUtc: string | null;
|
|
331
|
+
/** Activity end in the account's local zone (ISO datetime), or null. */
|
|
237
332
|
endsAt: string | null;
|
|
333
|
+
/** Activity end in UTC (ISO datetime), or null. */
|
|
238
334
|
endsAtUtc: string | null;
|
|
335
|
+
/** Activity duration in minutes (0 when start/end are unknown). */
|
|
239
336
|
durationMin: number;
|
|
337
|
+
/** The availability time id for the booked slot, or null. */
|
|
240
338
|
availabilityTimeId: string | null;
|
|
339
|
+
/** Customer booking-portal URL, or null. */
|
|
241
340
|
portalUrl: string | null;
|
|
341
|
+
/** Operator notes on the booking (`""` when none). */
|
|
242
342
|
notes: string;
|
|
343
|
+
/** Total booking value, human-formatted (e.g. `"$75.00"`). `""` if absent. */
|
|
243
344
|
valueDisplay: string;
|
|
345
|
+
/** Total booking value as a numeric string. `""` if absent. */
|
|
244
346
|
valueAmount: string;
|
|
347
|
+
/** Outstanding balance as a numeric string. `""` if absent. */
|
|
245
348
|
outstandingBalanceAmount: string;
|
|
349
|
+
/** Outstanding balance, human-formatted. `""` if absent. */
|
|
246
350
|
outstandingBalanceDisplay: string;
|
|
351
|
+
/** Redemption codes of promo codes applied to the order. */
|
|
247
352
|
promoCodes: string[];
|
|
353
|
+
/** Tips left on the booking. */
|
|
248
354
|
tips: Price[];
|
|
249
|
-
/**
|
|
355
|
+
/**
|
|
356
|
+
* Convenience fee — only populated when `includePriceBreakdown` is requested.
|
|
357
|
+
*/
|
|
250
358
|
convenienceFee?: Price;
|
|
359
|
+
/** Deposit — only populated when `includePriceBreakdown` is requested. */
|
|
251
360
|
deposit?: Price;
|
|
361
|
+
/** Discount — only populated when `includePriceBreakdown` is requested. */
|
|
252
362
|
discount?: Price;
|
|
363
|
+
/**
|
|
364
|
+
* Price after discount — only populated when `includePriceBreakdown` is
|
|
365
|
+
* requested.
|
|
366
|
+
*/
|
|
253
367
|
discountedPrice?: Price;
|
|
368
|
+
/** Fees — only populated when `includePriceBreakdown` is requested. */
|
|
254
369
|
fees?: Price;
|
|
370
|
+
/**
|
|
371
|
+
* Flat partner fee — only populated when `includePriceBreakdown` is requested.
|
|
372
|
+
*/
|
|
255
373
|
flatPartnerFee?: Price;
|
|
374
|
+
/** Base price — only populated when `includePriceBreakdown` is requested. */
|
|
256
375
|
price?: Price;
|
|
376
|
+
/** Retail price — only populated when `includePriceBreakdown` is requested. */
|
|
257
377
|
retailPrice?: Price;
|
|
378
|
+
/** Taxes — only populated when `includePriceBreakdown` is requested. */
|
|
258
379
|
taxes?: Price;
|
|
380
|
+
/**
|
|
381
|
+
* Tips total in the breakdown — only populated when `includePriceBreakdown`
|
|
382
|
+
* is requested.
|
|
383
|
+
*/
|
|
259
384
|
tipsBreakdown?: Price;
|
|
385
|
+
/** Pool-level resource usage (quantity per resource pool). */
|
|
260
386
|
resources: Resource[];
|
|
387
|
+
/** Concrete resources assigned to the booking. */
|
|
261
388
|
resourcePoolAssignments: ResourcePoolAssignment[];
|
|
389
|
+
/** Reseller channel id, or null for a direct booking. */
|
|
262
390
|
resellerId: string | null;
|
|
391
|
+
/**
|
|
392
|
+
* Reseller display name (channel name, plus `" - <agent>"` when an agent is
|
|
393
|
+
* set), or null for a direct booking.
|
|
394
|
+
*/
|
|
263
395
|
resellerName: string | null;
|
|
396
|
+
/** The order id this booking belongs to. `""` if absent. */
|
|
264
397
|
orderId: string;
|
|
398
|
+
/** Custom question answers captured at the booking level. */
|
|
265
399
|
customQuestionAnswers: CustomQuestionAnswer[];
|
|
400
|
+
/** Custom question answers captured per guest/ticket. */
|
|
266
401
|
customGuestQuestionAnswers: CustomQuestionAnswer[];
|
|
267
402
|
/** Guests — only populated when `includeGuests` is requested. */
|
|
268
403
|
guests?: Guest[];
|
|
@@ -336,13 +471,19 @@ interface CreateBookingInput {
|
|
|
336
471
|
}
|
|
337
472
|
/** The result of creating a booking. */
|
|
338
473
|
interface CreatedBooking {
|
|
474
|
+
/** The order id the new booking belongs to. */
|
|
339
475
|
orderId: string;
|
|
476
|
+
/** The new booking's id. */
|
|
340
477
|
bookingId: string;
|
|
478
|
+
/** The new booking's human-facing display id. */
|
|
341
479
|
displayId: string;
|
|
480
|
+
/** Remaining balance as a numeric string. */
|
|
342
481
|
balanceAmount: string;
|
|
482
|
+
/** 3-letter uppercase ISO currency code of the balance. */
|
|
343
483
|
balanceCurrency: string;
|
|
484
|
+
/** Balance, human-formatted (e.g. `"$75.00"`). */
|
|
344
485
|
balanceFormatted: string;
|
|
345
|
-
/**
|
|
486
|
+
/** The charge transaction id — set only when the booking was marked paid. */
|
|
346
487
|
transactionId?: string;
|
|
347
488
|
}
|
|
348
489
|
|
|
@@ -351,13 +492,16 @@ interface CreatedBooking {
|
|
|
351
492
|
*/
|
|
352
493
|
/** A single payment applied to a booking's order. */
|
|
353
494
|
interface Payment {
|
|
495
|
+
/** Payment id (`pmt_…`). */
|
|
354
496
|
id: string;
|
|
355
497
|
/** Date the payment was applied (YYYY-MM-DD). */
|
|
356
498
|
paidAt: string;
|
|
499
|
+
/** The payment's current (net of refunds) amount. */
|
|
357
500
|
currentAmount: {
|
|
358
501
|
amount: string;
|
|
359
502
|
currency: string;
|
|
360
503
|
};
|
|
504
|
+
/** How much of the payment can still be refunded. */
|
|
361
505
|
refundableAmount: {
|
|
362
506
|
amount: string;
|
|
363
507
|
currency: string;
|
|
@@ -365,16 +509,22 @@ interface Payment {
|
|
|
365
509
|
}
|
|
366
510
|
/** A payment source on the order, with any payments made against it. */
|
|
367
511
|
interface PaymentSource {
|
|
512
|
+
/** Human-readable description of the source (e.g. a card summary). */
|
|
368
513
|
description: string;
|
|
514
|
+
/** Payment source id (`ps_…`, or a synthetic id like `cash/cash`). */
|
|
369
515
|
id: string;
|
|
516
|
+
/** Source type reported by Peek (e.g. card/cash/custom). */
|
|
370
517
|
type: string;
|
|
371
518
|
/** Payments made against this source, when any exist. */
|
|
372
519
|
payments?: Payment[];
|
|
373
520
|
}
|
|
374
521
|
/** The payments-on-file result for a booking. */
|
|
375
522
|
interface BookingPaymentsOnFile {
|
|
523
|
+
/** The booking these payments belong to. */
|
|
376
524
|
bookingId: string;
|
|
525
|
+
/** The order id the payments live on. */
|
|
377
526
|
orderId: string;
|
|
527
|
+
/** The order's payment sources, each with its payments grouped under it. */
|
|
378
528
|
paymentsOnFile: PaymentSource[];
|
|
379
529
|
}
|
|
380
530
|
/** Input for charging a booking. */
|
|
@@ -394,11 +544,17 @@ interface MakePaymentInput {
|
|
|
394
544
|
}
|
|
395
545
|
/** Result of charging a booking. */
|
|
396
546
|
interface MakePaymentResult {
|
|
547
|
+
/** The gateway transaction id for the charge. */
|
|
397
548
|
transactionId: string;
|
|
549
|
+
/** The booking that was charged. */
|
|
398
550
|
bookingId: string;
|
|
551
|
+
/** The order the charge was applied to. */
|
|
399
552
|
orderId: string;
|
|
553
|
+
/** Amount charged, as a numeric string. */
|
|
400
554
|
amount: string;
|
|
555
|
+
/** 3-letter uppercase ISO currency code of the charge. */
|
|
401
556
|
currency: string;
|
|
557
|
+
/** The payment source that was charged. */
|
|
402
558
|
paymentSourceId: string;
|
|
403
559
|
}
|
|
404
560
|
/** Input for refunding a booking payment. */
|
|
@@ -416,17 +572,26 @@ interface RefundInput {
|
|
|
416
572
|
}
|
|
417
573
|
/** Result of refunding a booking payment. */
|
|
418
574
|
interface RefundResult {
|
|
575
|
+
/** The gateway transaction id for the refund. */
|
|
419
576
|
transactionId: string;
|
|
577
|
+
/** The booking that was refunded. */
|
|
420
578
|
bookingId: string;
|
|
579
|
+
/** The order the refund was applied to. */
|
|
421
580
|
orderId: string;
|
|
581
|
+
/** Amount refunded, as a numeric string. */
|
|
422
582
|
amount: string;
|
|
583
|
+
/** 3-letter uppercase ISO currency code of the refund. */
|
|
423
584
|
currency: string;
|
|
585
|
+
/** The payment that was refunded (`pmt_…`). */
|
|
424
586
|
paymentId: string;
|
|
425
587
|
}
|
|
426
588
|
/** Result of creating an invoice link. */
|
|
427
589
|
interface InvoiceLinkResult {
|
|
590
|
+
/** The booking the invoice is for. */
|
|
428
591
|
bookingId: string;
|
|
592
|
+
/** The order the invoice is for. */
|
|
429
593
|
orderId: string;
|
|
594
|
+
/** The customer-facing URL where the invoice can be paid. */
|
|
430
595
|
invoiceLink: string;
|
|
431
596
|
}
|
|
432
597
|
|
|
@@ -439,8 +604,11 @@ interface InvoiceLinkResult {
|
|
|
439
604
|
*/
|
|
440
605
|
/** Money amount for an add-on line, as returned by the gateway. */
|
|
441
606
|
interface BookingAddonMoney {
|
|
607
|
+
/** Numeric amount as a string (e.g. `"10.00"`). */
|
|
442
608
|
amount: string;
|
|
609
|
+
/** ISO currency code (e.g. `"USD"`). */
|
|
443
610
|
currency: string;
|
|
611
|
+
/** Human-formatted amount (e.g. `"$10.00"`). */
|
|
444
612
|
formatted: string;
|
|
445
613
|
}
|
|
446
614
|
/** A single add-on option with the quantity attached to the booking. */
|
|
@@ -465,8 +633,11 @@ interface BookingAddon {
|
|
|
465
633
|
}
|
|
466
634
|
/** A booking's add-ons. */
|
|
467
635
|
interface BookingAddons {
|
|
636
|
+
/** The booking id these add-ons belong to. */
|
|
468
637
|
bookingId: string;
|
|
638
|
+
/** The booking's human-facing display id. */
|
|
469
639
|
displayId: string;
|
|
640
|
+
/** The order id the add-ons live on. */
|
|
470
641
|
orderId: string;
|
|
471
642
|
/** Add-ons with at least one live option; fully-canceled add-ons are omitted. */
|
|
472
643
|
addons: BookingAddon[];
|
|
@@ -568,8 +739,9 @@ declare class BookingService {
|
|
|
568
739
|
* @throws {Error} when `paymentSourceId` is missing or not a `ps_…` id / one
|
|
569
740
|
* of `cash/cash`, `custom/other`, `custom/voucher`; when `amount` is not a
|
|
570
741
|
* valid number; when `currency` is not a 3-letter uppercase code; when
|
|
571
|
-
* `idempotencyKey` is empty; when `bookingId`
|
|
572
|
-
* when the booking or payment source is not found; or when the
|
|
742
|
+
* `idempotencyKey` is empty; when `bookingId` is not a valid booking id
|
|
743
|
+
* (`b_…`/`B-…`); when the booking or payment source is not found; or when the
|
|
744
|
+
* charge fails.
|
|
573
745
|
*/
|
|
574
746
|
makePayment(input: MakePaymentInput): Promise<MakePaymentResult>;
|
|
575
747
|
/**
|
|
@@ -717,49 +889,71 @@ interface PurchasedMembership {
|
|
|
717
889
|
}
|
|
718
890
|
|
|
719
891
|
/**
|
|
720
|
-
* The clean data
|
|
892
|
+
* The clean, transport-agnostic data models for Peek Pro activity availability
|
|
893
|
+
* times.
|
|
894
|
+
*
|
|
895
|
+
* `PeekAccessService.getAvailabilityTimes()` returns the bookable time slots for
|
|
896
|
+
* a given activity and date, each carrying its per-resource-option availability
|
|
897
|
+
* so callers can decide whether a requested party fits.
|
|
898
|
+
*/
|
|
899
|
+
/**
|
|
900
|
+
* A single bookable availability time slot for an activity.
|
|
901
|
+
*
|
|
902
|
+
* Each slot describes a start/end window on the queried date and reports how
|
|
903
|
+
* much capacity remains per resource option (see {@link Availability}).
|
|
721
904
|
*/
|
|
722
|
-
/** A single bookable availability time slot for an activity. */
|
|
723
905
|
interface AvailabilityTime {
|
|
724
|
-
/**
|
|
906
|
+
/** Stable unique identifier of the slot. */
|
|
725
907
|
id: string;
|
|
726
|
-
/**
|
|
908
|
+
/** Human-readable time label for the slot (e.g. `"10:00 AM"`). */
|
|
727
909
|
time: string;
|
|
728
|
-
/** Slot start. */
|
|
910
|
+
/** Slot start as reported by Peek (ISO datetime). */
|
|
729
911
|
from: string;
|
|
730
|
-
/** Slot end. */
|
|
912
|
+
/** Slot end as reported by Peek (ISO datetime). */
|
|
731
913
|
end: string;
|
|
732
|
-
/**
|
|
914
|
+
/** How long the slot runs (see {@link Duration}). */
|
|
733
915
|
duration: Duration;
|
|
734
|
-
/** Availability status. */
|
|
916
|
+
/** Availability status reported by Peek (e.g. open/closed/sold-out). */
|
|
735
917
|
status: string;
|
|
736
|
-
/**
|
|
918
|
+
/**
|
|
919
|
+
* Remaining availability broken down per resource option. One entry per
|
|
920
|
+
* resource option offered for the slot.
|
|
921
|
+
*/
|
|
737
922
|
availability: Availability[];
|
|
738
923
|
}
|
|
739
|
-
/**
|
|
924
|
+
/** The length of an {@link AvailabilityTime} slot. */
|
|
740
925
|
interface Duration {
|
|
926
|
+
/** Human-readable duration name (e.g. `"1 hour"`). */
|
|
741
927
|
name: string;
|
|
928
|
+
/** The numeric length paired with its unit. */
|
|
742
929
|
length: {
|
|
930
|
+
/** Quantity of `unit` (e.g. `60`). */
|
|
743
931
|
amount: number;
|
|
932
|
+
/** Unit of `amount` (e.g. `"minutes"`). */
|
|
744
933
|
unit: string;
|
|
745
934
|
};
|
|
746
935
|
}
|
|
747
936
|
/** Availability for a specific resource option within a slot. */
|
|
748
937
|
interface Availability {
|
|
938
|
+
/** Total capacity of this resource option for the slot. */
|
|
749
939
|
qty: number;
|
|
940
|
+
/** How much of `qty` is already taken. */
|
|
750
941
|
taken: number;
|
|
942
|
+
/** The resource option this availability is for. */
|
|
751
943
|
resourceOptionId: string;
|
|
752
944
|
}
|
|
753
945
|
/** A requested resource-option quantity used when querying availability. */
|
|
754
946
|
interface ResourceOptionQuantity {
|
|
947
|
+
/** The resource option to check. */
|
|
755
948
|
resourceOptionId: string;
|
|
949
|
+
/** How many units of that option to check availability for. */
|
|
756
950
|
quantity: number;
|
|
757
951
|
}
|
|
758
952
|
/** Query parameters for fetching availability times. */
|
|
759
953
|
interface AvailabilityTimesQuery {
|
|
760
954
|
/** Activity (product) id. */
|
|
761
955
|
activityId: string;
|
|
762
|
-
/** Date (YYYY-MM-DD). */
|
|
956
|
+
/** Date to check (YYYY-MM-DD). */
|
|
763
957
|
date: string;
|
|
764
958
|
/** The resource options and quantities to check availability for. */
|
|
765
959
|
resourceOptionQuantities: ResourceOptionQuantity[];
|
|
@@ -847,8 +1041,6 @@ interface Timeslot {
|
|
|
847
1041
|
}
|
|
848
1042
|
/** A resource allocated to a {@link Timeslot}. */
|
|
849
1043
|
interface AssignedResource {
|
|
850
|
-
/** Resource pool id. */
|
|
851
|
-
id: string;
|
|
852
1044
|
/** Resource pool name. */
|
|
853
1045
|
name: string;
|
|
854
1046
|
/** Resource pool capacity. */
|
|
@@ -857,6 +1049,8 @@ interface AssignedResource {
|
|
|
857
1049
|
category: string;
|
|
858
1050
|
/** Allocated quantity. */
|
|
859
1051
|
quantity: number;
|
|
1052
|
+
/** Allocation status (e.g. `"ACTIVE"`). */
|
|
1053
|
+
status: string;
|
|
860
1054
|
/** Backing account user id, or null. */
|
|
861
1055
|
accountUserId: string | null;
|
|
862
1056
|
}
|