@seatlayer/js 0.101.0 → 0.103.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/dist/{chunk-URLBBOTJ.js → chunk-WFAVFYCD.js} +1 -1
- package/dist/{hostedCheckout-4BFFNCCU.js → hostedCheckout-XSQ7ISQC.js} +56 -17
- package/dist/index.cjs +196 -74
- package/dist/index.d.cts +66 -2
- package/dist/index.d.ts +66 -2
- package/dist/index.js +141 -58
- package/dist/manager.js +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -224,8 +224,13 @@ declare class BuyerAccessContext {
|
|
|
224
224
|
/**
|
|
225
225
|
* Handle a 401/403 from a scoped call. Returns true when the caller should
|
|
226
226
|
* retry the same request once with the refreshed bearer.
|
|
227
|
+
*
|
|
228
|
+
* `sentAuthorization` is the `Authorization` header the failed request
|
|
229
|
+
* carried. When the caller has it, the "did the refresh change anything"
|
|
230
|
+
* check below compares against exactly that bearer; without it, the bearer
|
|
231
|
+
* this context last issued stands in.
|
|
227
232
|
*/
|
|
228
|
-
handleFailure(status: number, code: string | undefined): Promise<boolean>;
|
|
233
|
+
handleFailure(status: number, code: string | undefined, sentAuthorization?: string | null): Promise<boolean>;
|
|
229
234
|
/** Host-driven re-acquisition (after the buyer signs in again, say). */
|
|
230
235
|
refresh(reason?: BuyerAccessRefreshReason): Promise<boolean>;
|
|
231
236
|
/** Drop the bearer. Called on destroy so nothing outlives the widget. */
|
|
@@ -633,9 +638,22 @@ declare class ApiError extends Error {
|
|
|
633
638
|
* contention. Absent when the server said nothing; never inferred here.
|
|
634
639
|
*/
|
|
635
640
|
retryable?: boolean;
|
|
641
|
+
/**
|
|
642
|
+
* Why a 404 happened when the key itself shows it (`api_key_as_event_key`,
|
|
643
|
+
* `secret_key_as_event_key`, `example_event_key`): an API key or the docs'
|
|
644
|
+
* example pasted where the event key goes. Absent otherwise.
|
|
645
|
+
*/
|
|
646
|
+
hint?: string;
|
|
647
|
+
/**
|
|
648
|
+
* The API's plain-language explanation for the developer, when it sent one.
|
|
649
|
+
* Not buyer copy: `message` stays the machine code callers already compare.
|
|
650
|
+
*/
|
|
651
|
+
serverMessage?: string;
|
|
636
652
|
constructor(status: number, message: string, code?: string, conflicts?: HoldConflict[], reason?: string, retryAfterS?: number, notice?: string, details?: {
|
|
637
653
|
fields?: BookingFormFieldError[];
|
|
638
654
|
retryable?: boolean;
|
|
655
|
+
hint?: string;
|
|
656
|
+
serverMessage?: string;
|
|
639
657
|
});
|
|
640
658
|
}
|
|
641
659
|
interface HoldResult {
|
|
@@ -822,6 +840,13 @@ interface GaPromptTier {
|
|
|
822
840
|
*/
|
|
823
841
|
interface GAPromptRequest {
|
|
824
842
|
area: PickerGAArea;
|
|
843
|
+
/**
|
|
844
|
+
* How the area sells: absent = per person; 'whole' = one party takes the
|
|
845
|
+
* whole area (min = max = its guests); 'variable' = one party picks a size in
|
|
846
|
+
* min–max. A box is ONE booking at ONE ticket type: confirm with a number, or
|
|
847
|
+
* a record naming a single tier.
|
|
848
|
+
*/
|
|
849
|
+
bookingMode?: 'whole' | 'variable';
|
|
825
850
|
/** Quantities already chosen here, per tier id (`''` for an untiered area). */
|
|
826
851
|
selected: Record<string, number>;
|
|
827
852
|
min: number;
|
|
@@ -857,6 +882,10 @@ interface GaPromptPicker {
|
|
|
857
882
|
/** Tickets in the order right now, held + selected seats + every GA quantity. */
|
|
858
883
|
totalTicketCount(): number;
|
|
859
884
|
onGAPromptHook?: ((prompt: GAPromptRequest) => boolean | void) | undefined;
|
|
885
|
+
/** The buyer's access filter: with wheelchair on, an area offers only its wheelchair places. */
|
|
886
|
+
controller?: {
|
|
887
|
+
getAccessibilityFilter?(): readonly string[] | null;
|
|
888
|
+
};
|
|
860
889
|
}
|
|
861
890
|
|
|
862
891
|
type SeatingChartBuyerView = 'map' | 'venue3d';
|
|
@@ -5232,7 +5261,9 @@ interface PerformanceGroupCheckoutHandoff {
|
|
|
5232
5261
|
}
|
|
5233
5262
|
/** What the wrapper is showing the buyer right now, for host telemetry. */
|
|
5234
5263
|
interface PerformanceGroupStatusEvent {
|
|
5235
|
-
|
|
5264
|
+
/** `checkout`: the hosted checkout could not start; the seats stay held. */
|
|
5265
|
+
/** `session_ended`: the buyer's session ended; the map stopped updating. */
|
|
5266
|
+
kind: 'idle' | 'pending' | 'recovery_failed' | 'sales_closed' | 'revision_changed' | 'checkout' | 'session_ended';
|
|
5236
5267
|
message: string;
|
|
5237
5268
|
/** The short operation reference from §12, when one applies. */
|
|
5238
5269
|
reference?: string;
|
|
@@ -5257,6 +5288,20 @@ interface PerformanceGroupPickerOptions {
|
|
|
5257
5288
|
*/
|
|
5258
5289
|
allowSelectionModeSwitch?: boolean;
|
|
5259
5290
|
apiBase?: string;
|
|
5291
|
+
/**
|
|
5292
|
+
* `'hosted'`: SeatLayer takes the money through the organizer's gateway (a
|
|
5293
|
+
* same-seat run only) and {@link onCheckout} still fires. Default
|
|
5294
|
+
* `'handoff'`. A run whose checkout the organizer's backend owns stays on
|
|
5295
|
+
* the handoff. With no buyer token, the picker mints an anonymous
|
|
5296
|
+
* public-sale session itself.
|
|
5297
|
+
*/
|
|
5298
|
+
checkout?: 'handoff' | 'hosted';
|
|
5299
|
+
/** Where a redirecting gateway returns to. Only a declared origin is kept. */
|
|
5300
|
+
returnUrl?: string;
|
|
5301
|
+
/** Default true. False hides the run's name, summary and dates, for a host page that shows them. */
|
|
5302
|
+
header?: boolean;
|
|
5303
|
+
/** `checkout: 'hosted'` only: the order is paid and the tickets are issued. */
|
|
5304
|
+
onOrderConfirmed?: (order: CheckoutOrderStatus) => void;
|
|
5260
5305
|
buyerAccessTokenProvider?: BuyerAccessTokenProvider;
|
|
5261
5306
|
buyerAccessToken?: string | BuyerAccessToken;
|
|
5262
5307
|
maxSelection?: number;
|
|
@@ -5351,7 +5396,12 @@ declare class PerformanceGroupPicker {
|
|
|
5351
5396
|
private switchingMode;
|
|
5352
5397
|
/** Latched at the first `booked`, so the callback and the copy fire once. */
|
|
5353
5398
|
private booked;
|
|
5399
|
+
private readonly hosted;
|
|
5400
|
+
/** The anonymous session's real refusal, carried past `provider_failed`. */
|
|
5401
|
+
private refusal;
|
|
5354
5402
|
constructor(options: PerformanceGroupPickerOptions);
|
|
5403
|
+
/** Who takes the money: `'hosted'` only once render() confirmed SeatLayer does. */
|
|
5404
|
+
get checkoutMode(): 'handoff' | 'hosted';
|
|
5355
5405
|
/**
|
|
5356
5406
|
* The mode the buyer is ACTUALLY in.
|
|
5357
5407
|
*
|
|
@@ -5491,6 +5541,12 @@ declare class PerformanceGroupPicker {
|
|
|
5491
5541
|
private setInteractionLocked;
|
|
5492
5542
|
private announce;
|
|
5493
5543
|
private showStatus;
|
|
5544
|
+
/**
|
|
5545
|
+
* The availability poll stopped because the buyer's session ended. The map
|
|
5546
|
+
* on screen is now stale, so the picker says that plainly, and the host is
|
|
5547
|
+
* told through `onError` so it can offer a fresh session.
|
|
5548
|
+
*/
|
|
5549
|
+
private sessionEnded;
|
|
5494
5550
|
private clearStatus;
|
|
5495
5551
|
private operationChanged;
|
|
5496
5552
|
/**
|
|
@@ -5742,6 +5798,14 @@ interface SeasonPickerOptions {
|
|
|
5742
5798
|
realtimePollMs?: number;
|
|
5743
5799
|
fetch?: typeof fetch;
|
|
5744
5800
|
offer?: SeasonOfferPresentation;
|
|
5801
|
+
/**
|
|
5802
|
+
* Show the picker's own season header: name, venue chips, package prices
|
|
5803
|
+
* and dates. Defaults to true. Set it to false when the host page already
|
|
5804
|
+
* shows those facts, so the buyer does not read them twice; the picker then
|
|
5805
|
+
* starts at its step bar. The offer and benefits live in that header, so
|
|
5806
|
+
* `offer` has no visible effect while it is hidden.
|
|
5807
|
+
*/
|
|
5808
|
+
header?: boolean;
|
|
5745
5809
|
maxSelection?: number;
|
|
5746
5810
|
selectedObjects?: string[];
|
|
5747
5811
|
selectableObjects?: string[] | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -224,8 +224,13 @@ declare class BuyerAccessContext {
|
|
|
224
224
|
/**
|
|
225
225
|
* Handle a 401/403 from a scoped call. Returns true when the caller should
|
|
226
226
|
* retry the same request once with the refreshed bearer.
|
|
227
|
+
*
|
|
228
|
+
* `sentAuthorization` is the `Authorization` header the failed request
|
|
229
|
+
* carried. When the caller has it, the "did the refresh change anything"
|
|
230
|
+
* check below compares against exactly that bearer; without it, the bearer
|
|
231
|
+
* this context last issued stands in.
|
|
227
232
|
*/
|
|
228
|
-
handleFailure(status: number, code: string | undefined): Promise<boolean>;
|
|
233
|
+
handleFailure(status: number, code: string | undefined, sentAuthorization?: string | null): Promise<boolean>;
|
|
229
234
|
/** Host-driven re-acquisition (after the buyer signs in again, say). */
|
|
230
235
|
refresh(reason?: BuyerAccessRefreshReason): Promise<boolean>;
|
|
231
236
|
/** Drop the bearer. Called on destroy so nothing outlives the widget. */
|
|
@@ -633,9 +638,22 @@ declare class ApiError extends Error {
|
|
|
633
638
|
* contention. Absent when the server said nothing; never inferred here.
|
|
634
639
|
*/
|
|
635
640
|
retryable?: boolean;
|
|
641
|
+
/**
|
|
642
|
+
* Why a 404 happened when the key itself shows it (`api_key_as_event_key`,
|
|
643
|
+
* `secret_key_as_event_key`, `example_event_key`): an API key or the docs'
|
|
644
|
+
* example pasted where the event key goes. Absent otherwise.
|
|
645
|
+
*/
|
|
646
|
+
hint?: string;
|
|
647
|
+
/**
|
|
648
|
+
* The API's plain-language explanation for the developer, when it sent one.
|
|
649
|
+
* Not buyer copy: `message` stays the machine code callers already compare.
|
|
650
|
+
*/
|
|
651
|
+
serverMessage?: string;
|
|
636
652
|
constructor(status: number, message: string, code?: string, conflicts?: HoldConflict[], reason?: string, retryAfterS?: number, notice?: string, details?: {
|
|
637
653
|
fields?: BookingFormFieldError[];
|
|
638
654
|
retryable?: boolean;
|
|
655
|
+
hint?: string;
|
|
656
|
+
serverMessage?: string;
|
|
639
657
|
});
|
|
640
658
|
}
|
|
641
659
|
interface HoldResult {
|
|
@@ -822,6 +840,13 @@ interface GaPromptTier {
|
|
|
822
840
|
*/
|
|
823
841
|
interface GAPromptRequest {
|
|
824
842
|
area: PickerGAArea;
|
|
843
|
+
/**
|
|
844
|
+
* How the area sells: absent = per person; 'whole' = one party takes the
|
|
845
|
+
* whole area (min = max = its guests); 'variable' = one party picks a size in
|
|
846
|
+
* min–max. A box is ONE booking at ONE ticket type: confirm with a number, or
|
|
847
|
+
* a record naming a single tier.
|
|
848
|
+
*/
|
|
849
|
+
bookingMode?: 'whole' | 'variable';
|
|
825
850
|
/** Quantities already chosen here, per tier id (`''` for an untiered area). */
|
|
826
851
|
selected: Record<string, number>;
|
|
827
852
|
min: number;
|
|
@@ -857,6 +882,10 @@ interface GaPromptPicker {
|
|
|
857
882
|
/** Tickets in the order right now, held + selected seats + every GA quantity. */
|
|
858
883
|
totalTicketCount(): number;
|
|
859
884
|
onGAPromptHook?: ((prompt: GAPromptRequest) => boolean | void) | undefined;
|
|
885
|
+
/** The buyer's access filter: with wheelchair on, an area offers only its wheelchair places. */
|
|
886
|
+
controller?: {
|
|
887
|
+
getAccessibilityFilter?(): readonly string[] | null;
|
|
888
|
+
};
|
|
860
889
|
}
|
|
861
890
|
|
|
862
891
|
type SeatingChartBuyerView = 'map' | 'venue3d';
|
|
@@ -5232,7 +5261,9 @@ interface PerformanceGroupCheckoutHandoff {
|
|
|
5232
5261
|
}
|
|
5233
5262
|
/** What the wrapper is showing the buyer right now, for host telemetry. */
|
|
5234
5263
|
interface PerformanceGroupStatusEvent {
|
|
5235
|
-
|
|
5264
|
+
/** `checkout`: the hosted checkout could not start; the seats stay held. */
|
|
5265
|
+
/** `session_ended`: the buyer's session ended; the map stopped updating. */
|
|
5266
|
+
kind: 'idle' | 'pending' | 'recovery_failed' | 'sales_closed' | 'revision_changed' | 'checkout' | 'session_ended';
|
|
5236
5267
|
message: string;
|
|
5237
5268
|
/** The short operation reference from §12, when one applies. */
|
|
5238
5269
|
reference?: string;
|
|
@@ -5257,6 +5288,20 @@ interface PerformanceGroupPickerOptions {
|
|
|
5257
5288
|
*/
|
|
5258
5289
|
allowSelectionModeSwitch?: boolean;
|
|
5259
5290
|
apiBase?: string;
|
|
5291
|
+
/**
|
|
5292
|
+
* `'hosted'`: SeatLayer takes the money through the organizer's gateway (a
|
|
5293
|
+
* same-seat run only) and {@link onCheckout} still fires. Default
|
|
5294
|
+
* `'handoff'`. A run whose checkout the organizer's backend owns stays on
|
|
5295
|
+
* the handoff. With no buyer token, the picker mints an anonymous
|
|
5296
|
+
* public-sale session itself.
|
|
5297
|
+
*/
|
|
5298
|
+
checkout?: 'handoff' | 'hosted';
|
|
5299
|
+
/** Where a redirecting gateway returns to. Only a declared origin is kept. */
|
|
5300
|
+
returnUrl?: string;
|
|
5301
|
+
/** Default true. False hides the run's name, summary and dates, for a host page that shows them. */
|
|
5302
|
+
header?: boolean;
|
|
5303
|
+
/** `checkout: 'hosted'` only: the order is paid and the tickets are issued. */
|
|
5304
|
+
onOrderConfirmed?: (order: CheckoutOrderStatus) => void;
|
|
5260
5305
|
buyerAccessTokenProvider?: BuyerAccessTokenProvider;
|
|
5261
5306
|
buyerAccessToken?: string | BuyerAccessToken;
|
|
5262
5307
|
maxSelection?: number;
|
|
@@ -5351,7 +5396,12 @@ declare class PerformanceGroupPicker {
|
|
|
5351
5396
|
private switchingMode;
|
|
5352
5397
|
/** Latched at the first `booked`, so the callback and the copy fire once. */
|
|
5353
5398
|
private booked;
|
|
5399
|
+
private readonly hosted;
|
|
5400
|
+
/** The anonymous session's real refusal, carried past `provider_failed`. */
|
|
5401
|
+
private refusal;
|
|
5354
5402
|
constructor(options: PerformanceGroupPickerOptions);
|
|
5403
|
+
/** Who takes the money: `'hosted'` only once render() confirmed SeatLayer does. */
|
|
5404
|
+
get checkoutMode(): 'handoff' | 'hosted';
|
|
5355
5405
|
/**
|
|
5356
5406
|
* The mode the buyer is ACTUALLY in.
|
|
5357
5407
|
*
|
|
@@ -5491,6 +5541,12 @@ declare class PerformanceGroupPicker {
|
|
|
5491
5541
|
private setInteractionLocked;
|
|
5492
5542
|
private announce;
|
|
5493
5543
|
private showStatus;
|
|
5544
|
+
/**
|
|
5545
|
+
* The availability poll stopped because the buyer's session ended. The map
|
|
5546
|
+
* on screen is now stale, so the picker says that plainly, and the host is
|
|
5547
|
+
* told through `onError` so it can offer a fresh session.
|
|
5548
|
+
*/
|
|
5549
|
+
private sessionEnded;
|
|
5494
5550
|
private clearStatus;
|
|
5495
5551
|
private operationChanged;
|
|
5496
5552
|
/**
|
|
@@ -5742,6 +5798,14 @@ interface SeasonPickerOptions {
|
|
|
5742
5798
|
realtimePollMs?: number;
|
|
5743
5799
|
fetch?: typeof fetch;
|
|
5744
5800
|
offer?: SeasonOfferPresentation;
|
|
5801
|
+
/**
|
|
5802
|
+
* Show the picker's own season header: name, venue chips, package prices
|
|
5803
|
+
* and dates. Defaults to true. Set it to false when the host page already
|
|
5804
|
+
* shows those facts, so the buyer does not read them twice; the picker then
|
|
5805
|
+
* starts at its step bar. The offer and benefits live in that header, so
|
|
5806
|
+
* `offer` has no visible effect while it is hidden.
|
|
5807
|
+
*/
|
|
5808
|
+
header?: boolean;
|
|
5745
5809
|
maxSelection?: number;
|
|
5746
5810
|
selectedObjects?: string[];
|
|
5747
5811
|
selectableObjects?: string[] | null;
|