@seatlayer/js 0.47.1 → 0.47.2

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.d.cts CHANGED
@@ -1069,6 +1069,59 @@ declare class EmbeddedDesigner {
1069
1069
  private handleMessage;
1070
1070
  }
1071
1071
 
1072
+ /**
1073
+ * Buyer-safe ticket-offer availability shared by the canonical picker and the
1074
+ * hosted event-page templates.
1075
+ *
1076
+ * This module intentionally owns the wire parser. A hosted page, iframe, popup
1077
+ * and SDK mount must refuse or accept the same payload; duplicating this reader
1078
+ * is how one surface eventually prints a price another surface will not charge.
1079
+ */
1080
+ type SaleState = 'on-sale' | 'low' | 'sold-out' | 'presale' | 'closed';
1081
+ interface TicketOfferSummary {
1082
+ /** Legacy ordering fields kept for older page templates and payloads. */
1083
+ index: number;
1084
+ count: number;
1085
+ /** Units currently available at this offer price; null means unlimited. */
1086
+ remaining: number | null;
1087
+ /** Buyer-facing fields added by the offers UX. Absent on older workers. */
1088
+ id?: string;
1089
+ name?: string;
1090
+ categoryKey?: string | null;
1091
+ startsAt?: number | null;
1092
+ endsAt?: number | null;
1093
+ }
1094
+ interface TicketOfferPrice {
1095
+ categoryKey: string;
1096
+ /** Major units. What a hold on this category is charged right now. */
1097
+ price: number;
1098
+ /** Major units, or null. Printed only when genuinely higher. */
1099
+ previousPrice: number | null;
1100
+ /** Offer provenance for the price row. Absent on older workers. */
1101
+ offerId?: string;
1102
+ offerName?: string;
1103
+ remaining?: number | null;
1104
+ startsAt?: number | null;
1105
+ endsAt?: number | null;
1106
+ }
1107
+ interface TicketOfferAvailability {
1108
+ state: SaleState;
1109
+ /** Currently advertised offer price, in minor units. */
1110
+ fromPrice: number | null;
1111
+ previousPrice: number | null;
1112
+ currency: string | null;
1113
+ /** The highest-priority active buy offer, when one exists. */
1114
+ release: TicketOfferSummary | null;
1115
+ /** The next scheduled price offer. It does not close ordinary ticket sales. */
1116
+ upcoming: TicketOfferSummary | null;
1117
+ /** Server-resolved active offer prices by category, in major units. */
1118
+ prices: TicketOfferPrice[];
1119
+ }
1120
+ /** Parse a public offer payload without repairing a half-understood price. */
1121
+ declare function parseTicketOfferAvailability(body: unknown): TicketOfferAvailability | null;
1122
+ /** Translate the server-resolved category map into SeatPicker pricing. */
1123
+ declare function ticketOfferPrices(availability: TicketOfferAvailability | null): Record<string, number>;
1124
+
1072
1125
  /**
1073
1126
  * SeatPicker — the full buyer experience as a widget.
1074
1127
  *
@@ -1298,6 +1351,12 @@ interface SeatPickerOptions {
1298
1351
  * fall back to the chart price.
1299
1352
  */
1300
1353
  pricing?: SeatPickerPricing;
1354
+ /**
1355
+ * Fires when the server-resolved active offer changes. Hosted event pages use
1356
+ * this to keep their headline, sticky bar and the canonical picker on the
1357
+ * same live fact. The picker remains fully functional when it is omitted.
1358
+ */
1359
+ onOfferAvailabilityChange?: (availability: TicketOfferAvailability | null) => void;
1301
1360
  /** Hold TTL in ms passed to hold(); server clamps to its own limits. */
1302
1361
  holdTtlMs?: number;
1303
1362
  /**
@@ -1472,6 +1531,8 @@ declare class SeatPicker {
1472
1531
  private readonly apiBase;
1473
1532
  private readonly controller;
1474
1533
  private readonly maxTickets;
1534
+ /** Original host pricing, kept separate from live server offer overrides. */
1535
+ private readonly hostPricing;
1475
1536
  private root;
1476
1537
  private mapHost;
1477
1538
  private rendered;
@@ -1482,9 +1543,16 @@ declare class SeatPicker {
1482
1543
  private ro;
1483
1544
  private holdTimer;
1484
1545
  private toastTimer;
1546
+ private offerRefreshTimer;
1547
+ /** Armed only when the offer schedule has a known future transition (or as a
1548
+ * bounded retry after a failed read) — never a fixed-cadence poll. */
1549
+ private offerBoundaryTimer;
1550
+ private offerVisibilityHandler;
1485
1551
  /** Short-lived UI motion timers; all are cancelled on destroy. */
1486
1552
  private motionTimers;
1487
1553
  private currency;
1554
+ private eventTimezone;
1555
+ private offerAvailability;
1488
1556
  private hold;
1489
1557
  /** Latest server expiry for the open hold (moves on extend). */
1490
1558
  private holdExpiresAt;
@@ -1855,6 +1923,28 @@ declare class SeatPicker {
1855
1923
  private openSeatView;
1856
1924
  private closeSeatView;
1857
1925
  private money;
1926
+ /**
1927
+ * Sleep until the offer schedule's next known transition, then re-read.
1928
+ *
1929
+ * A far-away boundary is capped: the wake re-reads, learns the (unchanged)
1930
+ * schedule, and re-arms — so a picker left open for days still tracks an
1931
+ * organizer's schedule edits at a cost of one request every few hours. No
1932
+ * future transition means no timer at all; an event with no releases does
1933
+ * zero background traffic. A wake in a hidden tab fetches nothing — the
1934
+ * visibilitychange handler owns catching that tab up.
1935
+ */
1936
+ private scheduleOfferBoundary;
1937
+ /** Debounce the no-store offer read behind a burst of seat-status frames. */
1938
+ private scheduleOfferRefresh;
1939
+ /**
1940
+ * Pull the server's resolved answer. A failed refresh keeps the last truthful
1941
+ * answer: flashing back to a chart price while checkout still charges an
1942
+ * offer is worse than a temporarily stale remaining count.
1943
+ */
1944
+ private refreshOfferAvailability;
1945
+ private offerPrice;
1946
+ /** The compact current/upcoming offer card above Ticket prices. */
1947
+ private syncOffer;
1858
1948
  /**
1859
1949
  * The price the buyer will actually pay for a category (+tier): the host's
1860
1950
  * `pricing` override when present, else the chart's stored price. Every
@@ -2799,4 +2889,4 @@ declare class ChannelsMode {
2799
2889
  handleBack(): boolean;
2800
2890
  }
2801
2891
 
2802
- export { AccessLinkReveal, AccessLinkStatusRecord, ApiError, AssignmentResult, type AttachPickerFrameOptions, type BestAvailableResult, BucketRow, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, ChannelAccessIntent, ChannelAllocationPage, ChannelListResult, ChannelPreviewProjection, ChannelRecord, ChannelSeatStatus, type ChannelsCapabilities, type ChannelsClient, ChannelsMode, type ChannelsModeHost, type ChannelsRowView, type ChannelsSeatView, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type OrderStatusResult, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type Projection, type PubApiOptions, type RealtimeSink, type ResumedHoldResult, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedObjectUnavailableEvent, type SelectedSeat, type StatusChange, type SubscribeTicket, attachPickerFrame, bucketRowsHtml, createBuyerAccessContext, createControllerSink };
2892
+ export { AccessLinkReveal, AccessLinkStatusRecord, ApiError, AssignmentResult, type AttachPickerFrameOptions, type BestAvailableResult, BucketRow, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, ChannelAccessIntent, ChannelAllocationPage, ChannelListResult, ChannelPreviewProjection, ChannelRecord, ChannelSeatStatus, type ChannelsCapabilities, type ChannelsClient, ChannelsMode, type ChannelsModeHost, type ChannelsRowView, type ChannelsSeatView, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type OrderStatusResult, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type Projection, type PubApiOptions, type RealtimeSink, type ResumedHoldResult, type SaleState, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedObjectUnavailableEvent, type SelectedSeat, type StatusChange, type SubscribeTicket, type TicketOfferAvailability, type TicketOfferPrice, type TicketOfferSummary, attachPickerFrame, bucketRowsHtml, createBuyerAccessContext, createControllerSink, parseTicketOfferAvailability, ticketOfferPrices };
package/dist/index.d.ts CHANGED
@@ -1069,6 +1069,59 @@ declare class EmbeddedDesigner {
1069
1069
  private handleMessage;
1070
1070
  }
1071
1071
 
1072
+ /**
1073
+ * Buyer-safe ticket-offer availability shared by the canonical picker and the
1074
+ * hosted event-page templates.
1075
+ *
1076
+ * This module intentionally owns the wire parser. A hosted page, iframe, popup
1077
+ * and SDK mount must refuse or accept the same payload; duplicating this reader
1078
+ * is how one surface eventually prints a price another surface will not charge.
1079
+ */
1080
+ type SaleState = 'on-sale' | 'low' | 'sold-out' | 'presale' | 'closed';
1081
+ interface TicketOfferSummary {
1082
+ /** Legacy ordering fields kept for older page templates and payloads. */
1083
+ index: number;
1084
+ count: number;
1085
+ /** Units currently available at this offer price; null means unlimited. */
1086
+ remaining: number | null;
1087
+ /** Buyer-facing fields added by the offers UX. Absent on older workers. */
1088
+ id?: string;
1089
+ name?: string;
1090
+ categoryKey?: string | null;
1091
+ startsAt?: number | null;
1092
+ endsAt?: number | null;
1093
+ }
1094
+ interface TicketOfferPrice {
1095
+ categoryKey: string;
1096
+ /** Major units. What a hold on this category is charged right now. */
1097
+ price: number;
1098
+ /** Major units, or null. Printed only when genuinely higher. */
1099
+ previousPrice: number | null;
1100
+ /** Offer provenance for the price row. Absent on older workers. */
1101
+ offerId?: string;
1102
+ offerName?: string;
1103
+ remaining?: number | null;
1104
+ startsAt?: number | null;
1105
+ endsAt?: number | null;
1106
+ }
1107
+ interface TicketOfferAvailability {
1108
+ state: SaleState;
1109
+ /** Currently advertised offer price, in minor units. */
1110
+ fromPrice: number | null;
1111
+ previousPrice: number | null;
1112
+ currency: string | null;
1113
+ /** The highest-priority active buy offer, when one exists. */
1114
+ release: TicketOfferSummary | null;
1115
+ /** The next scheduled price offer. It does not close ordinary ticket sales. */
1116
+ upcoming: TicketOfferSummary | null;
1117
+ /** Server-resolved active offer prices by category, in major units. */
1118
+ prices: TicketOfferPrice[];
1119
+ }
1120
+ /** Parse a public offer payload without repairing a half-understood price. */
1121
+ declare function parseTicketOfferAvailability(body: unknown): TicketOfferAvailability | null;
1122
+ /** Translate the server-resolved category map into SeatPicker pricing. */
1123
+ declare function ticketOfferPrices(availability: TicketOfferAvailability | null): Record<string, number>;
1124
+
1072
1125
  /**
1073
1126
  * SeatPicker — the full buyer experience as a widget.
1074
1127
  *
@@ -1298,6 +1351,12 @@ interface SeatPickerOptions {
1298
1351
  * fall back to the chart price.
1299
1352
  */
1300
1353
  pricing?: SeatPickerPricing;
1354
+ /**
1355
+ * Fires when the server-resolved active offer changes. Hosted event pages use
1356
+ * this to keep their headline, sticky bar and the canonical picker on the
1357
+ * same live fact. The picker remains fully functional when it is omitted.
1358
+ */
1359
+ onOfferAvailabilityChange?: (availability: TicketOfferAvailability | null) => void;
1301
1360
  /** Hold TTL in ms passed to hold(); server clamps to its own limits. */
1302
1361
  holdTtlMs?: number;
1303
1362
  /**
@@ -1472,6 +1531,8 @@ declare class SeatPicker {
1472
1531
  private readonly apiBase;
1473
1532
  private readonly controller;
1474
1533
  private readonly maxTickets;
1534
+ /** Original host pricing, kept separate from live server offer overrides. */
1535
+ private readonly hostPricing;
1475
1536
  private root;
1476
1537
  private mapHost;
1477
1538
  private rendered;
@@ -1482,9 +1543,16 @@ declare class SeatPicker {
1482
1543
  private ro;
1483
1544
  private holdTimer;
1484
1545
  private toastTimer;
1546
+ private offerRefreshTimer;
1547
+ /** Armed only when the offer schedule has a known future transition (or as a
1548
+ * bounded retry after a failed read) — never a fixed-cadence poll. */
1549
+ private offerBoundaryTimer;
1550
+ private offerVisibilityHandler;
1485
1551
  /** Short-lived UI motion timers; all are cancelled on destroy. */
1486
1552
  private motionTimers;
1487
1553
  private currency;
1554
+ private eventTimezone;
1555
+ private offerAvailability;
1488
1556
  private hold;
1489
1557
  /** Latest server expiry for the open hold (moves on extend). */
1490
1558
  private holdExpiresAt;
@@ -1855,6 +1923,28 @@ declare class SeatPicker {
1855
1923
  private openSeatView;
1856
1924
  private closeSeatView;
1857
1925
  private money;
1926
+ /**
1927
+ * Sleep until the offer schedule's next known transition, then re-read.
1928
+ *
1929
+ * A far-away boundary is capped: the wake re-reads, learns the (unchanged)
1930
+ * schedule, and re-arms — so a picker left open for days still tracks an
1931
+ * organizer's schedule edits at a cost of one request every few hours. No
1932
+ * future transition means no timer at all; an event with no releases does
1933
+ * zero background traffic. A wake in a hidden tab fetches nothing — the
1934
+ * visibilitychange handler owns catching that tab up.
1935
+ */
1936
+ private scheduleOfferBoundary;
1937
+ /** Debounce the no-store offer read behind a burst of seat-status frames. */
1938
+ private scheduleOfferRefresh;
1939
+ /**
1940
+ * Pull the server's resolved answer. A failed refresh keeps the last truthful
1941
+ * answer: flashing back to a chart price while checkout still charges an
1942
+ * offer is worse than a temporarily stale remaining count.
1943
+ */
1944
+ private refreshOfferAvailability;
1945
+ private offerPrice;
1946
+ /** The compact current/upcoming offer card above Ticket prices. */
1947
+ private syncOffer;
1858
1948
  /**
1859
1949
  * The price the buyer will actually pay for a category (+tier): the host's
1860
1950
  * `pricing` override when present, else the chart's stored price. Every
@@ -2799,4 +2889,4 @@ declare class ChannelsMode {
2799
2889
  handleBack(): boolean;
2800
2890
  }
2801
2891
 
2802
- export { AccessLinkReveal, AccessLinkStatusRecord, ApiError, AssignmentResult, type AttachPickerFrameOptions, type BestAvailableResult, BucketRow, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, ChannelAccessIntent, ChannelAllocationPage, ChannelListResult, ChannelPreviewProjection, ChannelRecord, ChannelSeatStatus, type ChannelsCapabilities, type ChannelsClient, ChannelsMode, type ChannelsModeHost, type ChannelsRowView, type ChannelsSeatView, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type OrderStatusResult, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type Projection, type PubApiOptions, type RealtimeSink, type ResumedHoldResult, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedObjectUnavailableEvent, type SelectedSeat, type StatusChange, type SubscribeTicket, attachPickerFrame, bucketRowsHtml, createBuyerAccessContext, createControllerSink };
2892
+ export { AccessLinkReveal, AccessLinkStatusRecord, ApiError, AssignmentResult, type AttachPickerFrameOptions, type BestAvailableResult, BucketRow, BuyerAccessContext, type BuyerAccessExpiredEvent, type BuyerAccessRefreshReason, type BuyerAccessToken, type BuyerAccessTokenProvider, BuyerAccessUnavailableError, type BuyerAccessUnavailableEvent, type BuyerAccessUnavailableReason, BuyerRealtimeClient, type BuyerRealtimeOptions, ChannelAccessIntent, ChannelAllocationPage, ChannelListResult, ChannelPreviewProjection, ChannelRecord, ChannelSeatStatus, type ChannelsCapabilities, type ChannelsClient, ChannelsMode, type ChannelsModeHost, type ChannelsRowView, type ChannelsSeatView, type CheckoutHandoff, type CheckoutLineItem, type CheckoutSessionResult, EmbeddedDesigner, type EmbeddedDesignerEventType, type EmbeddedDesignerMessage, type EmbeddedDesignerOptions, type GAAreaAvailability, type HoldConflict, type HoldLineItem, type HoldResult, type OrderStatusResult, type PaymentOptionsReason, type PaymentOptionsResult, type PaymentProviderName, type Projection, type PubApiOptions, type RealtimeSink, type ResumedHoldResult, type SaleState, SeatPicker, type SeatPickerOptions, type SeatPickerTheme, SeatingChart, type SeatingChartOptions, type SelectedObjectUnavailableEvent, type SelectedSeat, type StatusChange, type SubscribeTicket, type TicketOfferAvailability, type TicketOfferPrice, type TicketOfferSummary, attachPickerFrame, bucketRowsHtml, createBuyerAccessContext, createControllerSink, parseTicketOfferAvailability, ticketOfferPrices };