@seatlayer/js 0.88.1 → 0.89.1
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/hostedCheckout-TMNTMVMM.js +58 -0
- package/dist/index.cjs +37 -20
- package/dist/index.d.cts +169 -2
- package/dist/index.d.ts +169 -2
- package/dist/index.js +19 -19
- package/package.json +2 -2
- package/dist/hostedCheckout-TNSXFFRL.js +0 -41
package/dist/index.d.cts
CHANGED
|
@@ -478,6 +478,78 @@ interface ControllerSinkOptions {
|
|
|
478
478
|
}
|
|
479
479
|
declare function createControllerSink(controller: PickerControllerLike, options?: ControllerSinkOptions): RealtimeSink;
|
|
480
480
|
|
|
481
|
+
/**
|
|
482
|
+
* The booking form inside the hosted-checkout card: a name, email or phone for
|
|
483
|
+
* each ticket, and the organizer's own questions, rendered from the
|
|
484
|
+
* `bookingForm` that `GET /pub/events/:key/payment-options` already carries.
|
|
485
|
+
*
|
|
486
|
+
* Built into the standalone `seatlayer-checkout.mjs` asset with the card, so it
|
|
487
|
+
* follows the card's rule: NO RUNTIME IMPORTS. Everything it needs — the ticket
|
|
488
|
+
* keys, the translator, the buyer's own details — arrives as arguments.
|
|
489
|
+
*
|
|
490
|
+
* The server is the authority on every rule below (`booking_form_incomplete`).
|
|
491
|
+
* These checks only exist so a buyer hears about a missing name next to the
|
|
492
|
+
* field, before a round trip, in the same words the refusal would map to.
|
|
493
|
+
*/
|
|
494
|
+
/** Organizer setting for one attendee detail. */
|
|
495
|
+
type AttendeeFieldMode = 'off' | 'optional' | 'required';
|
|
496
|
+
type BookingQuestionType = 'text' | 'textarea' | 'number' | 'select' | 'multiselect' | 'checkbox' | 'date' | 'email' | 'phone';
|
|
497
|
+
interface BookingQuestionOption {
|
|
498
|
+
id: string;
|
|
499
|
+
label: string;
|
|
500
|
+
}
|
|
501
|
+
/** One organizer question. Public payloads carry active questions only. */
|
|
502
|
+
interface BookingQuestion {
|
|
503
|
+
id: string;
|
|
504
|
+
position: number;
|
|
505
|
+
label: string;
|
|
506
|
+
helpText: string | null;
|
|
507
|
+
type: BookingQuestionType;
|
|
508
|
+
/** Present for `select` and `multiselect`. */
|
|
509
|
+
options: BookingQuestionOption[] | null;
|
|
510
|
+
required: boolean;
|
|
511
|
+
/** `order` is asked once per booking; `ticket` inside every ticket's block. */
|
|
512
|
+
scope: 'order' | 'ticket';
|
|
513
|
+
/** Who later sees the answer. Staff-only questions are still asked. */
|
|
514
|
+
visibility: 'buyer' | 'staff';
|
|
515
|
+
archived: boolean;
|
|
516
|
+
/** Organizer reads only. */
|
|
517
|
+
hasAnswers?: boolean;
|
|
518
|
+
}
|
|
519
|
+
/** What `payment-options` says the checkout must ask. */
|
|
520
|
+
interface BookingForm {
|
|
521
|
+
attendeeName: AttendeeFieldMode;
|
|
522
|
+
attendeeEmail: AttendeeFieldMode;
|
|
523
|
+
attendeePhone: AttendeeFieldMode;
|
|
524
|
+
questions: BookingQuestion[];
|
|
525
|
+
/** Organizer reads only. */
|
|
526
|
+
revision?: number;
|
|
527
|
+
}
|
|
528
|
+
/** One ticket's attendee, keyed by the server's ticket key. */
|
|
529
|
+
interface CheckoutAttendee {
|
|
530
|
+
ticketKey: string;
|
|
531
|
+
name?: string;
|
|
532
|
+
email?: string;
|
|
533
|
+
phone?: string;
|
|
534
|
+
}
|
|
535
|
+
type CheckoutAnswerValue = string | number | boolean | string[];
|
|
536
|
+
/** One answer. `ticketKey` is set for ticket-scope questions only. */
|
|
537
|
+
interface CheckoutAnswer {
|
|
538
|
+
questionId: string;
|
|
539
|
+
ticketKey?: string;
|
|
540
|
+
value: CheckoutAnswerValue;
|
|
541
|
+
}
|
|
542
|
+
type BookingFieldErrorCode = 'required' | 'invalid' | 'too_long';
|
|
543
|
+
/**
|
|
544
|
+
* One field the server refused (`422 booking_form_incomplete`). `key` is
|
|
545
|
+
* `attendeeName` | `attendeeEmail` | `attendeePhone` | `question:<id>`.
|
|
546
|
+
*/
|
|
547
|
+
interface BookingFormFieldError {
|
|
548
|
+
key: string;
|
|
549
|
+
ticketKey?: string;
|
|
550
|
+
code: BookingFieldErrorCode;
|
|
551
|
+
}
|
|
552
|
+
|
|
481
553
|
/**
|
|
482
554
|
* Minimal client for the browser embed surface of workers/api (the `/pub/*`
|
|
483
555
|
* routes). Platform events bind this client to a buyer access context; Managed
|
|
@@ -531,7 +603,11 @@ declare class ApiError extends Error {
|
|
|
531
603
|
* localised wording built from `retryAfterS`.
|
|
532
604
|
*/
|
|
533
605
|
notice?: string;
|
|
534
|
-
|
|
606
|
+
/** `422 booking_form_incomplete`: the fields the server refused, for inline errors. */
|
|
607
|
+
fields?: BookingFormFieldError[];
|
|
608
|
+
constructor(status: number, message: string, code?: string, conflicts?: HoldConflict[], reason?: string, retryAfterS?: number, notice?: string, details?: {
|
|
609
|
+
fields?: BookingFormFieldError[];
|
|
610
|
+
});
|
|
535
611
|
}
|
|
536
612
|
interface HoldResult {
|
|
537
613
|
holdId: string;
|
|
@@ -539,6 +615,35 @@ interface HoldResult {
|
|
|
539
615
|
/** The held seats with the buyer's chosen ticket tier per seat (present on hold). */
|
|
540
616
|
seats?: PickerSeat[];
|
|
541
617
|
items?: HoldLineItem[];
|
|
618
|
+
/**
|
|
619
|
+
* One key per guest this hold admits, in issuance order: a seat, booth or
|
|
620
|
+
* individually sold chair is its label; a general-admission place (its own
|
|
621
|
+
* inventory unit) is `"<label>#1"`; a whole table admitting q places is
|
|
622
|
+
* `"<label>#1"` … `"<label>#q"`. The booking form keys attendees and ticket
|
|
623
|
+
* answers by it. Keys and GA unit labels are internal: never show them.
|
|
624
|
+
* Absent from older servers.
|
|
625
|
+
*/
|
|
626
|
+
ticketKeys?: string[];
|
|
627
|
+
/** Per key: its label, and which guest of how many it is. */
|
|
628
|
+
ticketKeyDetails?: TicketKeyDetail[];
|
|
629
|
+
/**
|
|
630
|
+
* True when the server answered a retried hold attempt with the hold that
|
|
631
|
+
* attempt already created. Same `holdId` and `expiresAt`; `items` come back
|
|
632
|
+
* sorted by label with their committed prices.
|
|
633
|
+
*/
|
|
634
|
+
replayed?: boolean;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* One guest's ticket key. `label` is the inventory label and may be internal
|
|
638
|
+
* (a GA place); `displayLabel` is what a buyer may see. `unitIndex` and
|
|
639
|
+
* `quantity` number the guests of one ticket admitting several places.
|
|
640
|
+
*/
|
|
641
|
+
interface TicketKeyDetail {
|
|
642
|
+
ticketKey: string;
|
|
643
|
+
label: string;
|
|
644
|
+
unitIndex: number;
|
|
645
|
+
quantity: number;
|
|
646
|
+
displayLabel?: string;
|
|
542
647
|
}
|
|
543
648
|
/** Browser-safe active-hold projection returned by the resume endpoint. */
|
|
544
649
|
interface ResumedHoldResult extends HoldResult {
|
|
@@ -552,6 +657,10 @@ interface BestAvailableResult {
|
|
|
552
657
|
seats?: PickerSeat[];
|
|
553
658
|
items?: HoldResult['items'];
|
|
554
659
|
zoneId?: string;
|
|
660
|
+
/** See {@link HoldResult.ticketKeys}. */
|
|
661
|
+
ticketKeys?: string[];
|
|
662
|
+
/** See {@link HoldResult.ticketKeyDetails}. */
|
|
663
|
+
ticketKeyDetails?: TicketKeyDetail[];
|
|
555
664
|
}
|
|
556
665
|
/** A gateway the organizer can be connected to. */
|
|
557
666
|
type PaymentProviderName = 'stripe' | 'razorpay';
|
|
@@ -578,6 +687,14 @@ interface PaymentOptionsResult {
|
|
|
578
687
|
providers: PaymentProviderName[];
|
|
579
688
|
currency: string | null;
|
|
580
689
|
reason?: PaymentOptionsReason | null;
|
|
690
|
+
/**
|
|
691
|
+
* Whether the event charges. `'free'` comes with an empty `providers` list
|
|
692
|
+
* and `reason: null`: nothing is missing, the booking simply has no payment
|
|
693
|
+
* step. Absent from older servers, which only ever meant `'paid'`.
|
|
694
|
+
*/
|
|
695
|
+
bookingMode?: 'paid' | 'free';
|
|
696
|
+
/** What hosted checkout must ask: attendee details and active questions. */
|
|
697
|
+
bookingForm?: BookingForm | null;
|
|
581
698
|
}
|
|
582
699
|
/** A started payment. Exactly one of the two handoffs comes back. */
|
|
583
700
|
interface CheckoutSessionResult {
|
|
@@ -589,6 +706,16 @@ interface CheckoutSessionResult {
|
|
|
589
706
|
redirectUrl?: string;
|
|
590
707
|
/** In-page modal gateway — open it without leaving the page. */
|
|
591
708
|
clientPayload?: Record<string, unknown>;
|
|
709
|
+
/**
|
|
710
|
+
* `'confirmed'` when the booking needed no payment (a free event, or a hold
|
|
711
|
+
* that sums to zero): the seats are already booked and the tickets issued,
|
|
712
|
+
* so there is no handoff to follow. Read the order's status for the receipt.
|
|
713
|
+
*/
|
|
714
|
+
status?: 'confirmed';
|
|
715
|
+
/** Buyer-facing order number, on a booking confirmed without payment. */
|
|
716
|
+
orderNumber?: string;
|
|
717
|
+
/** Hosted confirmation page path, on a booking confirmed without payment. */
|
|
718
|
+
confirmationUrl?: string;
|
|
592
719
|
}
|
|
593
720
|
/** An order's state while its gateway webhook is in flight. */
|
|
594
721
|
interface OrderStatusResult {
|
|
@@ -603,6 +730,8 @@ interface OrderStatusResult {
|
|
|
603
730
|
startsAt?: number | null;
|
|
604
731
|
tickets?: Array<{
|
|
605
732
|
label: string;
|
|
733
|
+
/** What a buyer may call the ticket; `label` can be an internal inventory label. */
|
|
734
|
+
displayLabel?: string | null;
|
|
606
735
|
token: string;
|
|
607
736
|
status: 'issued' | 'checked_in' | 'void';
|
|
608
737
|
checkedInAt: number | null;
|
|
@@ -3280,6 +3409,40 @@ interface WebMcpRegistration {
|
|
|
3280
3409
|
/** What `PickerController.render()` reports back about the loaded event. */
|
|
3281
3410
|
type PickerRenderInfo = NonNullable<Awaited<ReturnType<PickerController['render']>>>;
|
|
3282
3411
|
|
|
3412
|
+
/**
|
|
3413
|
+
* Hosted checkout — the payment step, as a module nobody downloads until a
|
|
3414
|
+
* buyer actually asks to pay.
|
|
3415
|
+
*
|
|
3416
|
+
* This is the whole of what `checkout: 'hosted'` adds to SeatPicker: a card
|
|
3417
|
+
* that collects an email, starts a payment against `POST /pub/events/:key/
|
|
3418
|
+
* checkout`, hands off to the gateway, and waits for the webhook to land. It is
|
|
3419
|
+
* a straight port of the panel our own buyer page has shipped since hosted
|
|
3420
|
+
* checkout existed (`src/pages/CheckoutPanel.tsx`), with React and the app's
|
|
3421
|
+
* shared api client taken out.
|
|
3422
|
+
*
|
|
3423
|
+
* IT IMPORTS NOTHING AT RUNTIME. Not `@seatlayer/core`, not `./api`, not even a
|
|
3424
|
+
* type from `./SeatPicker` — every input arrives through {@link CheckoutMount},
|
|
3425
|
+
* including the two API calls, which arrive as functions. That is not
|
|
3426
|
+
* fastidiousness: this file is built as a standalone CDN asset
|
|
3427
|
+
* (`seatlayer-checkout.mjs`), and a single value import from the engine would
|
|
3428
|
+
* pull a second copy of it into that asset and undo the point of splitting.
|
|
3429
|
+
* The one exception is `./hostedCheckoutForm`, the booking form, which lives
|
|
3430
|
+
* in that same asset under the same rule.
|
|
3431
|
+
*
|
|
3432
|
+
* Three states, one card, because they are the same moment in the buyer's
|
|
3433
|
+
* journey and share every pixel of chrome:
|
|
3434
|
+
*
|
|
3435
|
+
* pay a live hold — collect an email and START a payment
|
|
3436
|
+
* resume back from a hosted gateway page — the hold and its line items
|
|
3437
|
+
* are gone with the old document, so this can only WAIT on the
|
|
3438
|
+
* order id restored from tab storage. It must never offer
|
|
3439
|
+
* to start a second payment for a purchase that may have already
|
|
3440
|
+
* succeeded.
|
|
3441
|
+
* unavailable the event cannot take money here, and the buyer is holding
|
|
3442
|
+
* seats. Say which of the three reasons it is, because two of
|
|
3443
|
+
* them give opposite advice.
|
|
3444
|
+
*/
|
|
3445
|
+
|
|
3283
3446
|
/** What `GET /pub/orders/:id/status` returns while the webhook is in flight. */
|
|
3284
3447
|
interface CheckoutOrderStatus {
|
|
3285
3448
|
orderId: string;
|
|
@@ -3290,6 +3453,8 @@ interface CheckoutOrderStatus {
|
|
|
3290
3453
|
seatCount: number;
|
|
3291
3454
|
tickets?: Array<{
|
|
3292
3455
|
label: string;
|
|
3456
|
+
/** What a buyer may call the ticket; the inventory label can be internal. */
|
|
3457
|
+
displayLabel?: string | null;
|
|
3293
3458
|
token: string;
|
|
3294
3459
|
status: 'issued' | 'checked_in' | 'void';
|
|
3295
3460
|
checkedInAt: number | null;
|
|
@@ -4618,6 +4783,8 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
4618
4783
|
getCurrentHold(): HoldResult | null;
|
|
4619
4784
|
/** Explicit host-driven hold restore (automatic session restore is on by default). */
|
|
4620
4785
|
resumeHold(holdId: string): Promise<HoldResult | null>;
|
|
4786
|
+
/** Re-hold one held seat on another ticket type; the server re-prices it. */
|
|
4787
|
+
private changeHeldTier;
|
|
4621
4788
|
/** Remove one server-held ticket while keeping the rest of the hold active. */
|
|
4622
4789
|
removeHeldTicket(label: string): Promise<boolean>;
|
|
4623
4790
|
bestAvailable(qty: number, categoryKey?: string, opts?: SeatPickerBestAvailableOptions): Promise<HoldResult | null>;
|
|
@@ -5488,4 +5655,4 @@ interface AttachPickerFrameOptions {
|
|
|
5488
5655
|
*/
|
|
5489
5656
|
declare function attachPickerFrame(iframe: HTMLIFrameElement, opts?: AttachPickerFrameOptions): () => void;
|
|
5490
5657
|
|
|
5491
|
-
export { ApiError, type AttachPickerFrameOptions, type BestAvailableResult, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type GAPromptRequest, type GaPromptTier, type HoldConflict, type HoldLineItem, type HoldResult, type OrderStatusResult, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type PerformanceGroupAvailability, type PerformanceGroupCheckoutHandoff, type PerformanceGroupDescriptor, PerformanceGroupDestroyedError, type PerformanceGroupHold, type PerformanceGroupHoldAllocation, type PerformanceGroupOperationEvent, type PerformanceGroupOperationState, PerformanceGroupPicker, type PerformanceGroupPickerOptions, type PerformanceGroupRecoveryState, type PerformanceGroupSeatAllocation, type PerformanceGroupSelectionMode, type PerformanceGroupStatusEvent, type Projection, type PubApiOptions, type RealtimeSink, type ResumedHoldResult, SEATING_CHART_CALLBACK_PROPS, SEATING_CHART_HANDLE_METHODS, SEATING_CHART_IDENTITY_PROPS, SEATING_CHART_VALUE_PROPS, type SaleState, SeasonApiError, type SeasonAudience, type SeasonAvailability, type SeasonBestAvailableOptions, type SeasonCategoryPrice, type SeasonCheckoutHandoff, type SeasonCheckoutMode, type SeasonCheckoutRequest, type SeasonCheckoutSession, type SeasonDescriptor, type SeasonOfferPresentation, type SeasonOperation, type SeasonOperationState, type SeasonPackagePrices, SeasonPicker, type SeasonPickerOptions, type SeasonPrices, type SeasonPublicRefusalReason, type SeasonPublicSession, SeasonPublicSessionRefused, SeasonRecoveryTimeoutError, type SeasonRenewalIntent, type SeasonStatusEvent, SeatPicker, type SeatPickerBestAvailableOptions, type SeatPickerBuyerView, type SeatPickerBuyerViewOptions, type SeatPickerOptions, type SeatPickerPrewarmOptions, type SeatPickerPricing, type SeatPickerTheme, type SeatPickerWebMcpOptions, SeatingChart, type SeatingChartCallbackProp, type SeatingChartCallbacks, type SeatingChartHandle, type SeatingChartHandleMethod, type SeatingChartIdentityProp, type SeatingChartOptions, type SeatingChartSeatViewInfo, type SeatingChartValueProp, type SeatingChartValues, type SelectedObjectUnavailableEvent, type SelectedSeat, type StatusChange, type SubscribeTicket, ThemeMode, type TicketOfferAvailability, type TicketOfferPrice, type TicketOfferSummary, attachPickerFrame, bindSeatingChartHandle, buildSeatingChartOptions, createBuyerAccessContext, createControllerSink, parseTicketOfferAvailability, prewarmSeatPicker, shortOperationReference, ticketOfferPrices };
|
|
5658
|
+
export { ApiError, type AttachPickerFrameOptions, type AttendeeFieldMode, type BestAvailableResult, type BookingForm, type BookingFormFieldError, type BookingQuestion, type BookingQuestionType, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, type CheckoutAnswer, type CheckoutAttendee, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type GAPromptRequest, type GaPromptTier, type HoldConflict, type HoldLineItem, type HoldResult, type OrderStatusResult, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type PerformanceGroupAvailability, type PerformanceGroupCheckoutHandoff, type PerformanceGroupDescriptor, PerformanceGroupDestroyedError, type PerformanceGroupHold, type PerformanceGroupHoldAllocation, type PerformanceGroupOperationEvent, type PerformanceGroupOperationState, PerformanceGroupPicker, type PerformanceGroupPickerOptions, type PerformanceGroupRecoveryState, type PerformanceGroupSeatAllocation, type PerformanceGroupSelectionMode, type PerformanceGroupStatusEvent, type Projection, type PubApiOptions, type RealtimeSink, type ResumedHoldResult, SEATING_CHART_CALLBACK_PROPS, SEATING_CHART_HANDLE_METHODS, SEATING_CHART_IDENTITY_PROPS, SEATING_CHART_VALUE_PROPS, type SaleState, SeasonApiError, type SeasonAudience, type SeasonAvailability, type SeasonBestAvailableOptions, type SeasonCategoryPrice, type SeasonCheckoutHandoff, type SeasonCheckoutMode, type SeasonCheckoutRequest, type SeasonCheckoutSession, type SeasonDescriptor, type SeasonOfferPresentation, type SeasonOperation, type SeasonOperationState, type SeasonPackagePrices, SeasonPicker, type SeasonPickerOptions, type SeasonPrices, type SeasonPublicRefusalReason, type SeasonPublicSession, SeasonPublicSessionRefused, SeasonRecoveryTimeoutError, type SeasonRenewalIntent, type SeasonStatusEvent, SeatPicker, type SeatPickerBestAvailableOptions, type SeatPickerBuyerView, type SeatPickerBuyerViewOptions, type SeatPickerOptions, type SeatPickerPrewarmOptions, type SeatPickerPricing, type SeatPickerTheme, type SeatPickerWebMcpOptions, SeatingChart, type SeatingChartCallbackProp, type SeatingChartCallbacks, type SeatingChartHandle, type SeatingChartHandleMethod, type SeatingChartIdentityProp, type SeatingChartOptions, type SeatingChartSeatViewInfo, type SeatingChartValueProp, type SeatingChartValues, type SelectedObjectUnavailableEvent, type SelectedSeat, type StatusChange, type SubscribeTicket, ThemeMode, type TicketKeyDetail, type TicketOfferAvailability, type TicketOfferPrice, type TicketOfferSummary, attachPickerFrame, bindSeatingChartHandle, buildSeatingChartOptions, createBuyerAccessContext, createControllerSink, parseTicketOfferAvailability, prewarmSeatPicker, shortOperationReference, ticketOfferPrices };
|
package/dist/index.d.ts
CHANGED
|
@@ -478,6 +478,78 @@ interface ControllerSinkOptions {
|
|
|
478
478
|
}
|
|
479
479
|
declare function createControllerSink(controller: PickerControllerLike, options?: ControllerSinkOptions): RealtimeSink;
|
|
480
480
|
|
|
481
|
+
/**
|
|
482
|
+
* The booking form inside the hosted-checkout card: a name, email or phone for
|
|
483
|
+
* each ticket, and the organizer's own questions, rendered from the
|
|
484
|
+
* `bookingForm` that `GET /pub/events/:key/payment-options` already carries.
|
|
485
|
+
*
|
|
486
|
+
* Built into the standalone `seatlayer-checkout.mjs` asset with the card, so it
|
|
487
|
+
* follows the card's rule: NO RUNTIME IMPORTS. Everything it needs — the ticket
|
|
488
|
+
* keys, the translator, the buyer's own details — arrives as arguments.
|
|
489
|
+
*
|
|
490
|
+
* The server is the authority on every rule below (`booking_form_incomplete`).
|
|
491
|
+
* These checks only exist so a buyer hears about a missing name next to the
|
|
492
|
+
* field, before a round trip, in the same words the refusal would map to.
|
|
493
|
+
*/
|
|
494
|
+
/** Organizer setting for one attendee detail. */
|
|
495
|
+
type AttendeeFieldMode = 'off' | 'optional' | 'required';
|
|
496
|
+
type BookingQuestionType = 'text' | 'textarea' | 'number' | 'select' | 'multiselect' | 'checkbox' | 'date' | 'email' | 'phone';
|
|
497
|
+
interface BookingQuestionOption {
|
|
498
|
+
id: string;
|
|
499
|
+
label: string;
|
|
500
|
+
}
|
|
501
|
+
/** One organizer question. Public payloads carry active questions only. */
|
|
502
|
+
interface BookingQuestion {
|
|
503
|
+
id: string;
|
|
504
|
+
position: number;
|
|
505
|
+
label: string;
|
|
506
|
+
helpText: string | null;
|
|
507
|
+
type: BookingQuestionType;
|
|
508
|
+
/** Present for `select` and `multiselect`. */
|
|
509
|
+
options: BookingQuestionOption[] | null;
|
|
510
|
+
required: boolean;
|
|
511
|
+
/** `order` is asked once per booking; `ticket` inside every ticket's block. */
|
|
512
|
+
scope: 'order' | 'ticket';
|
|
513
|
+
/** Who later sees the answer. Staff-only questions are still asked. */
|
|
514
|
+
visibility: 'buyer' | 'staff';
|
|
515
|
+
archived: boolean;
|
|
516
|
+
/** Organizer reads only. */
|
|
517
|
+
hasAnswers?: boolean;
|
|
518
|
+
}
|
|
519
|
+
/** What `payment-options` says the checkout must ask. */
|
|
520
|
+
interface BookingForm {
|
|
521
|
+
attendeeName: AttendeeFieldMode;
|
|
522
|
+
attendeeEmail: AttendeeFieldMode;
|
|
523
|
+
attendeePhone: AttendeeFieldMode;
|
|
524
|
+
questions: BookingQuestion[];
|
|
525
|
+
/** Organizer reads only. */
|
|
526
|
+
revision?: number;
|
|
527
|
+
}
|
|
528
|
+
/** One ticket's attendee, keyed by the server's ticket key. */
|
|
529
|
+
interface CheckoutAttendee {
|
|
530
|
+
ticketKey: string;
|
|
531
|
+
name?: string;
|
|
532
|
+
email?: string;
|
|
533
|
+
phone?: string;
|
|
534
|
+
}
|
|
535
|
+
type CheckoutAnswerValue = string | number | boolean | string[];
|
|
536
|
+
/** One answer. `ticketKey` is set for ticket-scope questions only. */
|
|
537
|
+
interface CheckoutAnswer {
|
|
538
|
+
questionId: string;
|
|
539
|
+
ticketKey?: string;
|
|
540
|
+
value: CheckoutAnswerValue;
|
|
541
|
+
}
|
|
542
|
+
type BookingFieldErrorCode = 'required' | 'invalid' | 'too_long';
|
|
543
|
+
/**
|
|
544
|
+
* One field the server refused (`422 booking_form_incomplete`). `key` is
|
|
545
|
+
* `attendeeName` | `attendeeEmail` | `attendeePhone` | `question:<id>`.
|
|
546
|
+
*/
|
|
547
|
+
interface BookingFormFieldError {
|
|
548
|
+
key: string;
|
|
549
|
+
ticketKey?: string;
|
|
550
|
+
code: BookingFieldErrorCode;
|
|
551
|
+
}
|
|
552
|
+
|
|
481
553
|
/**
|
|
482
554
|
* Minimal client for the browser embed surface of workers/api (the `/pub/*`
|
|
483
555
|
* routes). Platform events bind this client to a buyer access context; Managed
|
|
@@ -531,7 +603,11 @@ declare class ApiError extends Error {
|
|
|
531
603
|
* localised wording built from `retryAfterS`.
|
|
532
604
|
*/
|
|
533
605
|
notice?: string;
|
|
534
|
-
|
|
606
|
+
/** `422 booking_form_incomplete`: the fields the server refused, for inline errors. */
|
|
607
|
+
fields?: BookingFormFieldError[];
|
|
608
|
+
constructor(status: number, message: string, code?: string, conflicts?: HoldConflict[], reason?: string, retryAfterS?: number, notice?: string, details?: {
|
|
609
|
+
fields?: BookingFormFieldError[];
|
|
610
|
+
});
|
|
535
611
|
}
|
|
536
612
|
interface HoldResult {
|
|
537
613
|
holdId: string;
|
|
@@ -539,6 +615,35 @@ interface HoldResult {
|
|
|
539
615
|
/** The held seats with the buyer's chosen ticket tier per seat (present on hold). */
|
|
540
616
|
seats?: PickerSeat[];
|
|
541
617
|
items?: HoldLineItem[];
|
|
618
|
+
/**
|
|
619
|
+
* One key per guest this hold admits, in issuance order: a seat, booth or
|
|
620
|
+
* individually sold chair is its label; a general-admission place (its own
|
|
621
|
+
* inventory unit) is `"<label>#1"`; a whole table admitting q places is
|
|
622
|
+
* `"<label>#1"` … `"<label>#q"`. The booking form keys attendees and ticket
|
|
623
|
+
* answers by it. Keys and GA unit labels are internal: never show them.
|
|
624
|
+
* Absent from older servers.
|
|
625
|
+
*/
|
|
626
|
+
ticketKeys?: string[];
|
|
627
|
+
/** Per key: its label, and which guest of how many it is. */
|
|
628
|
+
ticketKeyDetails?: TicketKeyDetail[];
|
|
629
|
+
/**
|
|
630
|
+
* True when the server answered a retried hold attempt with the hold that
|
|
631
|
+
* attempt already created. Same `holdId` and `expiresAt`; `items` come back
|
|
632
|
+
* sorted by label with their committed prices.
|
|
633
|
+
*/
|
|
634
|
+
replayed?: boolean;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* One guest's ticket key. `label` is the inventory label and may be internal
|
|
638
|
+
* (a GA place); `displayLabel` is what a buyer may see. `unitIndex` and
|
|
639
|
+
* `quantity` number the guests of one ticket admitting several places.
|
|
640
|
+
*/
|
|
641
|
+
interface TicketKeyDetail {
|
|
642
|
+
ticketKey: string;
|
|
643
|
+
label: string;
|
|
644
|
+
unitIndex: number;
|
|
645
|
+
quantity: number;
|
|
646
|
+
displayLabel?: string;
|
|
542
647
|
}
|
|
543
648
|
/** Browser-safe active-hold projection returned by the resume endpoint. */
|
|
544
649
|
interface ResumedHoldResult extends HoldResult {
|
|
@@ -552,6 +657,10 @@ interface BestAvailableResult {
|
|
|
552
657
|
seats?: PickerSeat[];
|
|
553
658
|
items?: HoldResult['items'];
|
|
554
659
|
zoneId?: string;
|
|
660
|
+
/** See {@link HoldResult.ticketKeys}. */
|
|
661
|
+
ticketKeys?: string[];
|
|
662
|
+
/** See {@link HoldResult.ticketKeyDetails}. */
|
|
663
|
+
ticketKeyDetails?: TicketKeyDetail[];
|
|
555
664
|
}
|
|
556
665
|
/** A gateway the organizer can be connected to. */
|
|
557
666
|
type PaymentProviderName = 'stripe' | 'razorpay';
|
|
@@ -578,6 +687,14 @@ interface PaymentOptionsResult {
|
|
|
578
687
|
providers: PaymentProviderName[];
|
|
579
688
|
currency: string | null;
|
|
580
689
|
reason?: PaymentOptionsReason | null;
|
|
690
|
+
/**
|
|
691
|
+
* Whether the event charges. `'free'` comes with an empty `providers` list
|
|
692
|
+
* and `reason: null`: nothing is missing, the booking simply has no payment
|
|
693
|
+
* step. Absent from older servers, which only ever meant `'paid'`.
|
|
694
|
+
*/
|
|
695
|
+
bookingMode?: 'paid' | 'free';
|
|
696
|
+
/** What hosted checkout must ask: attendee details and active questions. */
|
|
697
|
+
bookingForm?: BookingForm | null;
|
|
581
698
|
}
|
|
582
699
|
/** A started payment. Exactly one of the two handoffs comes back. */
|
|
583
700
|
interface CheckoutSessionResult {
|
|
@@ -589,6 +706,16 @@ interface CheckoutSessionResult {
|
|
|
589
706
|
redirectUrl?: string;
|
|
590
707
|
/** In-page modal gateway — open it without leaving the page. */
|
|
591
708
|
clientPayload?: Record<string, unknown>;
|
|
709
|
+
/**
|
|
710
|
+
* `'confirmed'` when the booking needed no payment (a free event, or a hold
|
|
711
|
+
* that sums to zero): the seats are already booked and the tickets issued,
|
|
712
|
+
* so there is no handoff to follow. Read the order's status for the receipt.
|
|
713
|
+
*/
|
|
714
|
+
status?: 'confirmed';
|
|
715
|
+
/** Buyer-facing order number, on a booking confirmed without payment. */
|
|
716
|
+
orderNumber?: string;
|
|
717
|
+
/** Hosted confirmation page path, on a booking confirmed without payment. */
|
|
718
|
+
confirmationUrl?: string;
|
|
592
719
|
}
|
|
593
720
|
/** An order's state while its gateway webhook is in flight. */
|
|
594
721
|
interface OrderStatusResult {
|
|
@@ -603,6 +730,8 @@ interface OrderStatusResult {
|
|
|
603
730
|
startsAt?: number | null;
|
|
604
731
|
tickets?: Array<{
|
|
605
732
|
label: string;
|
|
733
|
+
/** What a buyer may call the ticket; `label` can be an internal inventory label. */
|
|
734
|
+
displayLabel?: string | null;
|
|
606
735
|
token: string;
|
|
607
736
|
status: 'issued' | 'checked_in' | 'void';
|
|
608
737
|
checkedInAt: number | null;
|
|
@@ -3280,6 +3409,40 @@ interface WebMcpRegistration {
|
|
|
3280
3409
|
/** What `PickerController.render()` reports back about the loaded event. */
|
|
3281
3410
|
type PickerRenderInfo = NonNullable<Awaited<ReturnType<PickerController['render']>>>;
|
|
3282
3411
|
|
|
3412
|
+
/**
|
|
3413
|
+
* Hosted checkout — the payment step, as a module nobody downloads until a
|
|
3414
|
+
* buyer actually asks to pay.
|
|
3415
|
+
*
|
|
3416
|
+
* This is the whole of what `checkout: 'hosted'` adds to SeatPicker: a card
|
|
3417
|
+
* that collects an email, starts a payment against `POST /pub/events/:key/
|
|
3418
|
+
* checkout`, hands off to the gateway, and waits for the webhook to land. It is
|
|
3419
|
+
* a straight port of the panel our own buyer page has shipped since hosted
|
|
3420
|
+
* checkout existed (`src/pages/CheckoutPanel.tsx`), with React and the app's
|
|
3421
|
+
* shared api client taken out.
|
|
3422
|
+
*
|
|
3423
|
+
* IT IMPORTS NOTHING AT RUNTIME. Not `@seatlayer/core`, not `./api`, not even a
|
|
3424
|
+
* type from `./SeatPicker` — every input arrives through {@link CheckoutMount},
|
|
3425
|
+
* including the two API calls, which arrive as functions. That is not
|
|
3426
|
+
* fastidiousness: this file is built as a standalone CDN asset
|
|
3427
|
+
* (`seatlayer-checkout.mjs`), and a single value import from the engine would
|
|
3428
|
+
* pull a second copy of it into that asset and undo the point of splitting.
|
|
3429
|
+
* The one exception is `./hostedCheckoutForm`, the booking form, which lives
|
|
3430
|
+
* in that same asset under the same rule.
|
|
3431
|
+
*
|
|
3432
|
+
* Three states, one card, because they are the same moment in the buyer's
|
|
3433
|
+
* journey and share every pixel of chrome:
|
|
3434
|
+
*
|
|
3435
|
+
* pay a live hold — collect an email and START a payment
|
|
3436
|
+
* resume back from a hosted gateway page — the hold and its line items
|
|
3437
|
+
* are gone with the old document, so this can only WAIT on the
|
|
3438
|
+
* order id restored from tab storage. It must never offer
|
|
3439
|
+
* to start a second payment for a purchase that may have already
|
|
3440
|
+
* succeeded.
|
|
3441
|
+
* unavailable the event cannot take money here, and the buyer is holding
|
|
3442
|
+
* seats. Say which of the three reasons it is, because two of
|
|
3443
|
+
* them give opposite advice.
|
|
3444
|
+
*/
|
|
3445
|
+
|
|
3283
3446
|
/** What `GET /pub/orders/:id/status` returns while the webhook is in flight. */
|
|
3284
3447
|
interface CheckoutOrderStatus {
|
|
3285
3448
|
orderId: string;
|
|
@@ -3290,6 +3453,8 @@ interface CheckoutOrderStatus {
|
|
|
3290
3453
|
seatCount: number;
|
|
3291
3454
|
tickets?: Array<{
|
|
3292
3455
|
label: string;
|
|
3456
|
+
/** What a buyer may call the ticket; the inventory label can be internal. */
|
|
3457
|
+
displayLabel?: string | null;
|
|
3293
3458
|
token: string;
|
|
3294
3459
|
status: 'issued' | 'checked_in' | 'void';
|
|
3295
3460
|
checkedInAt: number | null;
|
|
@@ -4618,6 +4783,8 @@ declare class SeatPicker implements GaPromptPicker {
|
|
|
4618
4783
|
getCurrentHold(): HoldResult | null;
|
|
4619
4784
|
/** Explicit host-driven hold restore (automatic session restore is on by default). */
|
|
4620
4785
|
resumeHold(holdId: string): Promise<HoldResult | null>;
|
|
4786
|
+
/** Re-hold one held seat on another ticket type; the server re-prices it. */
|
|
4787
|
+
private changeHeldTier;
|
|
4621
4788
|
/** Remove one server-held ticket while keeping the rest of the hold active. */
|
|
4622
4789
|
removeHeldTicket(label: string): Promise<boolean>;
|
|
4623
4790
|
bestAvailable(qty: number, categoryKey?: string, opts?: SeatPickerBestAvailableOptions): Promise<HoldResult | null>;
|
|
@@ -5488,4 +5655,4 @@ interface AttachPickerFrameOptions {
|
|
|
5488
5655
|
*/
|
|
5489
5656
|
declare function attachPickerFrame(iframe: HTMLIFrameElement, opts?: AttachPickerFrameOptions): () => void;
|
|
5490
5657
|
|
|
5491
|
-
export { ApiError, type AttachPickerFrameOptions, type BestAvailableResult, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type GAPromptRequest, type GaPromptTier, type HoldConflict, type HoldLineItem, type HoldResult, type OrderStatusResult, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type PerformanceGroupAvailability, type PerformanceGroupCheckoutHandoff, type PerformanceGroupDescriptor, PerformanceGroupDestroyedError, type PerformanceGroupHold, type PerformanceGroupHoldAllocation, type PerformanceGroupOperationEvent, type PerformanceGroupOperationState, PerformanceGroupPicker, type PerformanceGroupPickerOptions, type PerformanceGroupRecoveryState, type PerformanceGroupSeatAllocation, type PerformanceGroupSelectionMode, type PerformanceGroupStatusEvent, type Projection, type PubApiOptions, type RealtimeSink, type ResumedHoldResult, SEATING_CHART_CALLBACK_PROPS, SEATING_CHART_HANDLE_METHODS, SEATING_CHART_IDENTITY_PROPS, SEATING_CHART_VALUE_PROPS, type SaleState, SeasonApiError, type SeasonAudience, type SeasonAvailability, type SeasonBestAvailableOptions, type SeasonCategoryPrice, type SeasonCheckoutHandoff, type SeasonCheckoutMode, type SeasonCheckoutRequest, type SeasonCheckoutSession, type SeasonDescriptor, type SeasonOfferPresentation, type SeasonOperation, type SeasonOperationState, type SeasonPackagePrices, SeasonPicker, type SeasonPickerOptions, type SeasonPrices, type SeasonPublicRefusalReason, type SeasonPublicSession, SeasonPublicSessionRefused, SeasonRecoveryTimeoutError, type SeasonRenewalIntent, type SeasonStatusEvent, SeatPicker, type SeatPickerBestAvailableOptions, type SeatPickerBuyerView, type SeatPickerBuyerViewOptions, type SeatPickerOptions, type SeatPickerPrewarmOptions, type SeatPickerPricing, type SeatPickerTheme, type SeatPickerWebMcpOptions, SeatingChart, type SeatingChartCallbackProp, type SeatingChartCallbacks, type SeatingChartHandle, type SeatingChartHandleMethod, type SeatingChartIdentityProp, type SeatingChartOptions, type SeatingChartSeatViewInfo, type SeatingChartValueProp, type SeatingChartValues, type SelectedObjectUnavailableEvent, type SelectedSeat, type StatusChange, type SubscribeTicket, ThemeMode, type TicketOfferAvailability, type TicketOfferPrice, type TicketOfferSummary, attachPickerFrame, bindSeatingChartHandle, buildSeatingChartOptions, createBuyerAccessContext, createControllerSink, parseTicketOfferAvailability, prewarmSeatPicker, shortOperationReference, ticketOfferPrices };
|
|
5658
|
+
export { ApiError, type AttachPickerFrameOptions, type AttendeeFieldMode, type BestAvailableResult, type BookingForm, type BookingFormFieldError, type BookingQuestion, type BookingQuestionType, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, type CheckoutAnswer, type CheckoutAttendee, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type GAPromptRequest, type GaPromptTier, type HoldConflict, type HoldLineItem, type HoldResult, type OrderStatusResult, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type PerformanceGroupAvailability, type PerformanceGroupCheckoutHandoff, type PerformanceGroupDescriptor, PerformanceGroupDestroyedError, type PerformanceGroupHold, type PerformanceGroupHoldAllocation, type PerformanceGroupOperationEvent, type PerformanceGroupOperationState, PerformanceGroupPicker, type PerformanceGroupPickerOptions, type PerformanceGroupRecoveryState, type PerformanceGroupSeatAllocation, type PerformanceGroupSelectionMode, type PerformanceGroupStatusEvent, type Projection, type PubApiOptions, type RealtimeSink, type ResumedHoldResult, SEATING_CHART_CALLBACK_PROPS, SEATING_CHART_HANDLE_METHODS, SEATING_CHART_IDENTITY_PROPS, SEATING_CHART_VALUE_PROPS, type SaleState, SeasonApiError, type SeasonAudience, type SeasonAvailability, type SeasonBestAvailableOptions, type SeasonCategoryPrice, type SeasonCheckoutHandoff, type SeasonCheckoutMode, type SeasonCheckoutRequest, type SeasonCheckoutSession, type SeasonDescriptor, type SeasonOfferPresentation, type SeasonOperation, type SeasonOperationState, type SeasonPackagePrices, SeasonPicker, type SeasonPickerOptions, type SeasonPrices, type SeasonPublicRefusalReason, type SeasonPublicSession, SeasonPublicSessionRefused, SeasonRecoveryTimeoutError, type SeasonRenewalIntent, type SeasonStatusEvent, SeatPicker, type SeatPickerBestAvailableOptions, type SeatPickerBuyerView, type SeatPickerBuyerViewOptions, type SeatPickerOptions, type SeatPickerPrewarmOptions, type SeatPickerPricing, type SeatPickerTheme, type SeatPickerWebMcpOptions, SeatingChart, type SeatingChartCallbackProp, type SeatingChartCallbacks, type SeatingChartHandle, type SeatingChartHandleMethod, type SeatingChartIdentityProp, type SeatingChartOptions, type SeatingChartSeatViewInfo, type SeatingChartValueProp, type SeatingChartValues, type SelectedObjectUnavailableEvent, type SelectedSeat, type StatusChange, type SubscribeTicket, ThemeMode, type TicketKeyDetail, type TicketOfferAvailability, type TicketOfferPrice, type TicketOfferSummary, attachPickerFrame, bindSeatingChartHandle, buildSeatingChartOptions, createBuyerAccessContext, createControllerSink, parseTicketOfferAvailability, prewarmSeatPicker, shortOperationReference, ticketOfferPrices };
|