@sensiblestats/widget-sdk 0.75.0 → 0.77.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/index.d.cts CHANGED
@@ -165,6 +165,10 @@ interface GreetingEntityChip {
165
165
  id: string;
166
166
  label: string;
167
167
  playing: boolean;
168
+ /** True or absent, never false; competitions only: the league has no game in the window. The widget reads `nextGameAtUtc` first and the flag only when there is no usable instant, so a flag beside a parseable instant is ignored. Absent from older servers. */
169
+ noGamesToday?: true;
170
+ /** Competitions only: the kick-off of the league's next game that has not started, omitted when a game is live or the server cannot tell. The widget decides "today" in the visitor's zone. */
171
+ nextGameAtUtc?: string;
168
172
  }
169
173
  interface GreetingPersonalSection {
170
174
  tier: GreetingPersonalTier;
@@ -190,13 +194,13 @@ interface GreetingPersonalSection {
190
194
  builder?: GreetingBuilderPreset;
191
195
  teamCards: GreetingTeamCard[];
192
196
  playerCards: GreetingPlayerCard[];
193
- facts: {
194
- marketKey: string;
195
- text: string;
196
- hits: number;
197
- window: number;
198
- matchId?: string;
199
- }[];
197
+ facts: GreetingFact[];
198
+ /** NBA and NFL only: the team availability line, apart from the facts and not one of the three. `text` carries no time; the widget draws `asOfUtc` beside it. Absent from older servers. */
199
+ injury?: GreetingInjury;
200
+ /** Facts and injury line for each game in the builder's games select. Absent from an older server: the top-level facts then stay. */
201
+ gameFacts?: GreetingGameFacts[];
202
+ /** The bare id of the game the top-level `facts` and `injury` are about; always set when they are about a game, omitted otherwise and by older servers. With it the widget keeps them on the opening choice when that is All games or holds this game, and drops them under a single game or a league that does not. Without it the widget goes by each fact's own `matchId`. */
203
+ factsMatchId?: string;
200
204
  asks: {
201
205
  actionLabel: string;
202
206
  actionValue: string;
@@ -207,6 +211,42 @@ interface GreetingPersonalSection {
207
211
  followSuggestions: GreetingEntityChip[];
208
212
  /** Starred teams with no game in the window, at most 2. */
209
213
  idleTeams?: GreetingIdleTeam[];
214
+ /** True when the visitor has a starred team, player or league in a sport other than this section's. Omitted when false and by older servers. */
215
+ hasStarsElsewhere?: boolean;
216
+ }
217
+ interface GreetingFact {
218
+ marketKey: string;
219
+ text: string;
220
+ hits: number;
221
+ window: number;
222
+ matchId?: string;
223
+ reference?: GreetingFactReference;
224
+ }
225
+ /** What a fact speaks to, never a price: the widget prices it live from the builder grid. Absent means the fact is text only. */
226
+ interface GreetingFactReference {
227
+ /** The value to send as BuilderGridRequest.sport. */
228
+ sport: string;
229
+ /** Bare id, as in the grid's matchIds. */
230
+ matchId: string;
231
+ /** The value to send as BuilderGridRequest.marketKey. */
232
+ marketKey: string;
233
+ /** Omitted when the pick has no line (a spread). */
234
+ line?: number;
235
+ /** The grid leg's own `side`. */
236
+ side?: 'home' | 'away' | 'over';
237
+ /** The player, props only. */
238
+ subject?: string;
239
+ /** Football team totals only, which are Over-only today. The widget shows the leg only if its own `direction` equals this. */
240
+ direction?: 'over';
241
+ }
242
+ interface GreetingInjury {
243
+ text: string;
244
+ asOfUtc: string;
245
+ }
246
+ interface GreetingGameFacts {
247
+ matchId: string;
248
+ facts: GreetingFact[];
249
+ injury?: GreetingInjury;
210
250
  }
211
251
  interface GreetingBuilderPreset {
212
252
  marketKey: string;
@@ -222,6 +262,8 @@ interface GreetingBuilderPreset {
222
262
  gamesOptionId?: string;
223
263
  /** A short localized line about when games return ("Next games tomorrow."); shown with the pause note. Omitted when the server has nothing to say. */
224
264
  nextGames?: string | null;
265
+ /** The kick-off of the next games, the instant `nextGames` speaks about; the widget writes the sentence in the visitor's zone. Absent from older servers. */
266
+ nextGamesAtUtc?: string;
225
267
  /** True or absent, never false: the visitor's usual market had no lines in the first-choice games, so the games slot moved wider (C13). */
226
268
  widenedForMarket?: true;
227
269
  }
@@ -1150,6 +1192,8 @@ interface ComboLeg {
1150
1192
  matchOddsId: number;
1151
1193
  bookmakerId: number;
1152
1194
  quotedAtUtc: string;
1195
+ /** Over or Under, derived from the bookmaker's raw label and never from the localized `selectionLabel`. Absent for a market that is not Over/Under and from an older server. */
1196
+ direction?: 'over' | 'under';
1153
1197
  /** The server allows pinning this leg's match. Absent on an older server, which means no pin. */
1154
1198
  pinEnabled?: boolean;
1155
1199
  /** The stat behind the leg. Absent or null on an open answer when the leg has none (stage 3 contract §3);
@@ -1259,6 +1303,11 @@ interface BuilderGridRequest {
1259
1303
  legs: number;
1260
1304
  total: string;
1261
1305
  widen: boolean;
1306
+ /**
1307
+ * Ask for every allowed pick of the market in the one game in `matchIds` (with legs 1, total 'any', widen false) instead of the one best pick.
1308
+ * A fact's price uses it to find its own bet among them. A server that does not know the flag drops it and answers the one pick.
1309
+ */
1310
+ allLegs?: boolean;
1262
1311
  operatorUserId?: string;
1263
1312
  anonymousUserId?: string;
1264
1313
  }
@@ -2023,7 +2072,7 @@ declare class Conversation {
2023
2072
  getClubRecords(limit?: number): Promise<ClubRecordsPayload | null>;
2024
2073
  }
2025
2074
 
2026
- type WidgetEntityEventName = 'pin_add' | 'pin_remove' | 'slip_click' | 'slip_result' | 'insight_expand' | 'tile_tap' | 'chip_tap' | 'slip_remove' | 'bet_placed' | 'match_view' | 'match_open' | 'combo_add';
2075
+ type WidgetEntityEventName = 'pin_add' | 'pin_remove' | 'slip_click' | 'slip_result' | 'tile_tap' | 'slip_remove' | 'bet_placed' | 'match_view' | 'match_open' | 'combo_add';
2027
2076
  type WidgetPopupEventName = 'popup_shown' | 'popup_opened' | 'popup_dismissed';
2028
2077
  type WidgetPopupAskEventName = 'popup_ask_tap';
2029
2078
  type WidgetOpenEventName = 'widget_open';
@@ -2162,4 +2211,116 @@ interface NdjsonParser {
2162
2211
  }
2163
2212
  declare function createNdjsonParser(): NdjsonParser;
2164
2213
 
2165
- export { type ActionButtonEventData, type ActionsLoadingEventData, type AddToSlipHandler, type AddToSlipRejectReason, type AddToSlipResult, type AllTimeRow, type AnswerEventData, AuthError, type AvailableMarket, type BettingInsight, type BettingInsightEventData, type BettingInsightOdds, type BuilderGridPayload, type BuilderGridRequest, type BuilderGridStatus, type ChatCallbacks, type ChatEvent, type ChatGrounding, type ChatHandle, type ChatInput, type ChatPreset, type ClubFanDashboardCard, type ClubFanDashboardHeadToHead, type ClubFanDashboardPayload, type ClubFixture, type ClubFixturesPayload, type ClubMatchLogRow, type ClubNextFixture, type ClubPerformanceMetric, type ClubPlayerAvailability, type ClubPlayerAvailabilityStatus, type ClubPlayerDetailPayload, type ClubPlayerPerformance, type ClubPlayerSeasonStats, type ClubRecordEntry, type ClubRecordsPayload, type ClubSquadPayload, type ClubSquadPlayer, type ClubSquadStatsPayload, type ClubStandingRow, type ClubStandingsPayload, type ComboAddMetadata, type ComboCard, type ComboCardEventData, type ComboLeg, type ComboReplacedLeg, type CongestedWeekCard, type CongestedWeekData, type CongestedWeekEntry, Conversation, type CountdownCard, type CountdownData, ENTITY_TYPE_CODES, type EntityCard, type EntityCardEventData, type EntityCardScope, type EntityCardStat, type EventBatch, type EventLogger, type EventLoggerOptions, type FavouriteEntity, type FavouriteKind, type FavouriteStarResponse, type FavouriteStarResult, type FavouritesNoIdentity, type FavouritesPayload, type FetchLike, type FixtureCard, type FixtureCardData, ForbiddenError, type FormAndH2H, type FormMatch, type GameListPayload, type GameResultPayload, type GameStatePayload, type GameSummary, type GreetingBuilderPreset, type GreetingDashboard, type GreetingDashboardLayout, type GreetingDashboardSet, type GreetingDashboardSignalRef, type GreetingDashboardSpan, type GreetingDashboardTile, type GreetingDashboardTileEmphasis, type GreetingEntityChip, type GreetingEntityKind, type GreetingFormResult, type GreetingGamesOption, type GreetingGamesScope, type GreetingIdleTeam, type GreetingMarketOption, type GreetingPersonalSection, type GreetingPersonalTier, type GreetingPlayerCard, type GreetingPlayerHit, type GreetingPlayerStatus, type GreetingSetChip, type GreetingTeamCard, type HeadToHead, type InjuriesCard, type InjuriesCardData, type InjuryRow, type IntentChipEventData, LIMIT_CODES, type LeaderboardChampion, type LeaderboardPayload, type LeaderboardRow, type LeagueStarResult, type LimitCode, type LimitDetails, LimitError, type LinkRow, type LinksCard, type LinksData, type LiveEventLine, type LiveMonitorAmericanFootball, type LiveMonitorBasketball, type LiveMonitorEvent, type LiveMonitorFact, type LiveMonitorMarket, type LiveMonitorMatch, type LiveMonitorSnapshot, type LiveMonitorStatPrice, type LiveMonitorStatRow, type LiveScoreCard, type LiveScoreData, type LiveStatRow, type LiveStatsCard, type LiveStatsData, type LiveTimelineCard, type LiveTimelineData, type MarketOddsBlock, type MarketOddsCard, type MarketOddsCardInsight, type MarketOddsEventData, type MarketOddsLiveBlock, type MarketOddsRow, type MatchState, type MomentumPoint, type MonitorPhase, type MonitorSport, type NbaCoHitEvidence, type NbaCoHitLeg, type NbaGameValue, type NbaInjuryEvent, type NbaInsight, type NbaInsightEventData, type NbaInsightSelection, type NbaJointGame, type NbaLadderEvidence, type NbaLadderRung, type NbaLadderStat, type NbaLineLane, type NbaLineMoveEvidence, type NbaLinePoint, type NbaListedTeammate, type NbaMatchupEvidence, type NbaMatchupPosition, type NbaMatchupTeam, type NbaPropReasonEvidence, type NbaQuarterLadderEvidence, type NbaQuarterRung, type NbaQuarterStat, type NbaSettleLine, type NbaSettlePlayer, type NbaSettleRecapEvidence, type NbaSettleSummary, type NbaSplitRow, type NbaTeammateOutEvidence, type NdjsonParser, NetworkError, type NflAtsGame, type NflAtsRecordEvidence, type NflForm, type NflFormGame, type NflInjuryPlayer, type NflInjuryReportEvidence, type NflInsight, type NflInsightEventData, type NflInsightKind, type NflInsightSelection, type NflLadderEvidence, type NflLadderRung, type NflLineMoveEvidence, type NflLineMoveLane, type NflMatchupEvidence, type NflPropReasonEvidence, type NflPropReasonGame, type NflSettleRecapEvidence, type NflSettleRecapLine, type NflSettleRecapPlayer, type NflSettleRecapSummary, type NonFootballSport, type OddsMovementCard, type OddsMovementEventData, type OddsMovementPoint, type PageContext, ParseError, type PinKind, type PinRef, type PlayerPropFact, type PlayerPropGame, type PlayerPropPrice, type PlayerPropStat, type PlayerPropStatGame, type PlayerPropsBundle, type PostMatchGoalLine, type PostMatchGoalsCard, type PostMatchGoalsData, type PostMatchNextCard, type PostMatchNextData, type PostMatchResultCard, type PostMatchResultData, type PostMatchStatRow, type PostMatchStatsCard, type PostMatchStatsData, type PostMatchTopPerformerCard, type PostMatchTopPerformerData, type PresetComboCell, type PresetGrid, type PresetGridOptions, type PresetMarketCell, type PresetPick, type PresetSinglesCell, type ProgressEventData, type QualifiedType, RateLimitError, type ReasonToBetCard, type ReasonToBetData, type RestingFormCard, type RestingFormData, type RestingNextCard, type RestingNextData, type RestingSeasonCard, type RestingSeasonData, type RestingStandingsCard, type RestingStandingsData, SIGNAL_TYPE_CODES, SPORTS, type ScheduleGroup, type ScheduleMatch, type SchedulePayload, type ScheduleSport, type SignalEntityType, type SignalInput, type SignalType, type SlipSelection, type SlipSport, type SportSpec, type StatesPayload, StatsWidgetClient, type StatsWidgetClientOptions, type StreamErrorEventData, type SubmitPlayBody, type SubmitPlayResult, type TransferRow, type TransfersCard, type TransfersData, type TurnCompleteEventData, UpstreamError, type UserContext, type WhereToWatchCard, type WhereToWatchData, type WidgetEntityEventName, type WidgetEntityType, type WidgetEventInput, type WidgetEventName, type WidgetLogInput, type WidgetOpenEventInput, type WidgetOpenEventName, type WidgetPopupAskEventInput, type WidgetPopupAskEventName, type WidgetPopupEventInput, type WidgetPopupEventName, WidgetSdkError, type WidgetSportSwitchEventInput, type WidgetSportSwitchEventName, type WireEvent, type WireSport, createEventLogger, createNdjsonParser, fromWireSport, isAddToSlipResult, isLimitCode, matchKey, mayPinOrSlip, qualifiedId, slipSportOf, sportOf, toWireSport };
2214
+ type WidgetTrackingTab = 'chat' | 'today' | 'following' | 'trends' | 'games' | 'fixtures' | 'standings' | 'squad' | 'records' | 'favourites';
2215
+ type QuestionSource = 'typed' | 'starter' | 'action' | 'tile' | 'preset' | 'live_fact' | 'bubble_ask' | 'retry';
2216
+ /** Fields on every event. `at` is epoch ms, taken when the event happened, not when it was delivered. */
2217
+ interface WidgetTrackingEnvelope {
2218
+ at: number;
2219
+ operatorId: string;
2220
+ widgetVersion: string;
2221
+ language?: string;
2222
+ conversationId?: string;
2223
+ operatorUserId?: string;
2224
+ anonymousUserId?: string;
2225
+ page?: PageContext;
2226
+ }
2227
+ /** What the slip handler resolved to: 'added' also covers an accepted price change; 'timeout' is the widget giving up waiting. */
2228
+ type AddToSlipOutcome = 'added' | 'duplicate' | 'price_changed' | 'timeout' | AddToSlipRejectReason;
2229
+ interface SlipClickFields {
2230
+ matchOddsId: number;
2231
+ matchId: number;
2232
+ odds: number;
2233
+ market?: string;
2234
+ /** Absent means football. */
2235
+ sport?: SlipSport;
2236
+ }
2237
+ type WidgetTrackingEventBody = {
2238
+ name: 'bubble_shown';
2239
+ } | {
2240
+ name: 'bubble_click';
2241
+ } | {
2242
+ name: 'bubble_ask_click';
2243
+ position: number;
2244
+ } | {
2245
+ name: 'bubble_dismiss';
2246
+ } | {
2247
+ name: 'launcher_click';
2248
+ } | {
2249
+ name: 'widget_open';
2250
+ } | {
2251
+ name: 'widget_close';
2252
+ method: 'button' | 'escape';
2253
+ tab: WidgetTrackingTab;
2254
+ answering: boolean;
2255
+ } | {
2256
+ name: 'tab_change';
2257
+ from: WidgetTrackingTab;
2258
+ to: WidgetTrackingTab;
2259
+ } | {
2260
+ name: 'question_asked';
2261
+ turnId: string;
2262
+ source: QuestionSource;
2263
+ length: number;
2264
+ text?: string;
2265
+ } | {
2266
+ name: 'answer_received';
2267
+ turnId: string;
2268
+ conversationId: string;
2269
+ latencyMs: number;
2270
+ cardTypes: string[];
2271
+ } | {
2272
+ name: 'answer_failed';
2273
+ turnId: string;
2274
+ code: string;
2275
+ } | {
2276
+ name: 'answer_stopped';
2277
+ turnId: string;
2278
+ } | {
2279
+ name: 'pin_click';
2280
+ action: 'add' | 'remove';
2281
+ target: 'match' | 'market';
2282
+ matchId?: number;
2283
+ market?: string;
2284
+ sport?: string;
2285
+ } | ({
2286
+ name: 'add_to_slip_click';
2287
+ } & SlipClickFields) | ({
2288
+ name: 'add_to_slip_result';
2289
+ outcome: AddToSlipOutcome;
2290
+ } & SlipClickFields) | {
2291
+ name: 'combo_add_click';
2292
+ surface: 'builder' | 'chat';
2293
+ sport: string;
2294
+ legs: number;
2295
+ total: string;
2296
+ } | {
2297
+ name: 'all_markets_click';
2298
+ matchId: number;
2299
+ market?: string;
2300
+ surface: string;
2301
+ } | {
2302
+ name: 'dashboard_tile_click';
2303
+ entityType: WidgetEntityType;
2304
+ entityId: string;
2305
+ } | {
2306
+ name: 'sport_switch';
2307
+ sport: string;
2308
+ } | {
2309
+ name: 'new_conversation';
2310
+ } | {
2311
+ name: 'league_star';
2312
+ competitionId: number | string;
2313
+ starred: boolean;
2314
+ } | {
2315
+ name: 'favourite_change';
2316
+ kind: string;
2317
+ id: string;
2318
+ outcome: string;
2319
+ };
2320
+ type WidgetTrackingEvent = WidgetTrackingEventBody & WidgetTrackingEnvelope;
2321
+ type WidgetTrackingEventName = WidgetTrackingEvent['name'];
2322
+ /** The event without its envelope; the tracker adds the envelope. */
2323
+ type WidgetTrackingBody = WidgetTrackingEventBody;
2324
+ type WidgetTrackingHandler = (event: WidgetTrackingEvent) => void | Promise<void>;
2325
+
2326
+ export { type ActionButtonEventData, type ActionsLoadingEventData, type AddToSlipHandler, type AddToSlipOutcome, type AddToSlipRejectReason, type AddToSlipResult, type AllTimeRow, type AnswerEventData, AuthError, type AvailableMarket, type BettingInsight, type BettingInsightEventData, type BettingInsightOdds, type BuilderGridPayload, type BuilderGridRequest, type BuilderGridStatus, type ChatCallbacks, type ChatEvent, type ChatGrounding, type ChatHandle, type ChatInput, type ChatPreset, type ClubFanDashboardCard, type ClubFanDashboardHeadToHead, type ClubFanDashboardPayload, type ClubFixture, type ClubFixturesPayload, type ClubMatchLogRow, type ClubNextFixture, type ClubPerformanceMetric, type ClubPlayerAvailability, type ClubPlayerAvailabilityStatus, type ClubPlayerDetailPayload, type ClubPlayerPerformance, type ClubPlayerSeasonStats, type ClubRecordEntry, type ClubRecordsPayload, type ClubSquadPayload, type ClubSquadPlayer, type ClubSquadStatsPayload, type ClubStandingRow, type ClubStandingsPayload, type ComboAddMetadata, type ComboCard, type ComboCardEventData, type ComboLeg, type ComboReplacedLeg, type CongestedWeekCard, type CongestedWeekData, type CongestedWeekEntry, Conversation, type CountdownCard, type CountdownData, ENTITY_TYPE_CODES, type EntityCard, type EntityCardEventData, type EntityCardScope, type EntityCardStat, type EventBatch, type EventLogger, type EventLoggerOptions, type FavouriteEntity, type FavouriteKind, type FavouriteStarResponse, type FavouriteStarResult, type FavouritesNoIdentity, type FavouritesPayload, type FetchLike, type FixtureCard, type FixtureCardData, ForbiddenError, type FormAndH2H, type FormMatch, type GameListPayload, type GameResultPayload, type GameStatePayload, type GameSummary, type GreetingBuilderPreset, type GreetingDashboard, type GreetingDashboardLayout, type GreetingDashboardSet, type GreetingDashboardSignalRef, type GreetingDashboardSpan, type GreetingDashboardTile, type GreetingDashboardTileEmphasis, type GreetingEntityChip, type GreetingEntityKind, type GreetingFact, type GreetingFactReference, type GreetingFormResult, type GreetingGameFacts, type GreetingGamesOption, type GreetingGamesScope, type GreetingIdleTeam, type GreetingInjury, type GreetingMarketOption, type GreetingPersonalSection, type GreetingPersonalTier, type GreetingPlayerCard, type GreetingPlayerHit, type GreetingPlayerStatus, type GreetingSetChip, type GreetingTeamCard, type HeadToHead, type InjuriesCard, type InjuriesCardData, type InjuryRow, type IntentChipEventData, LIMIT_CODES, type LeaderboardChampion, type LeaderboardPayload, type LeaderboardRow, type LeagueStarResult, type LimitCode, type LimitDetails, LimitError, type LinkRow, type LinksCard, type LinksData, type LiveEventLine, type LiveMonitorAmericanFootball, type LiveMonitorBasketball, type LiveMonitorEvent, type LiveMonitorFact, type LiveMonitorMarket, type LiveMonitorMatch, type LiveMonitorSnapshot, type LiveMonitorStatPrice, type LiveMonitorStatRow, type LiveScoreCard, type LiveScoreData, type LiveStatRow, type LiveStatsCard, type LiveStatsData, type LiveTimelineCard, type LiveTimelineData, type MarketOddsBlock, type MarketOddsCard, type MarketOddsCardInsight, type MarketOddsEventData, type MarketOddsLiveBlock, type MarketOddsRow, type MatchState, type MomentumPoint, type MonitorPhase, type MonitorSport, type NbaCoHitEvidence, type NbaCoHitLeg, type NbaGameValue, type NbaInjuryEvent, type NbaInsight, type NbaInsightEventData, type NbaInsightSelection, type NbaJointGame, type NbaLadderEvidence, type NbaLadderRung, type NbaLadderStat, type NbaLineLane, type NbaLineMoveEvidence, type NbaLinePoint, type NbaListedTeammate, type NbaMatchupEvidence, type NbaMatchupPosition, type NbaMatchupTeam, type NbaPropReasonEvidence, type NbaQuarterLadderEvidence, type NbaQuarterRung, type NbaQuarterStat, type NbaSettleLine, type NbaSettlePlayer, type NbaSettleRecapEvidence, type NbaSettleSummary, type NbaSplitRow, type NbaTeammateOutEvidence, type NdjsonParser, NetworkError, type NflAtsGame, type NflAtsRecordEvidence, type NflForm, type NflFormGame, type NflInjuryPlayer, type NflInjuryReportEvidence, type NflInsight, type NflInsightEventData, type NflInsightKind, type NflInsightSelection, type NflLadderEvidence, type NflLadderRung, type NflLineMoveEvidence, type NflLineMoveLane, type NflMatchupEvidence, type NflPropReasonEvidence, type NflPropReasonGame, type NflSettleRecapEvidence, type NflSettleRecapLine, type NflSettleRecapPlayer, type NflSettleRecapSummary, type NonFootballSport, type OddsMovementCard, type OddsMovementEventData, type OddsMovementPoint, type PageContext, ParseError, type PinKind, type PinRef, type PlayerPropFact, type PlayerPropGame, type PlayerPropPrice, type PlayerPropStat, type PlayerPropStatGame, type PlayerPropsBundle, type PostMatchGoalLine, type PostMatchGoalsCard, type PostMatchGoalsData, type PostMatchNextCard, type PostMatchNextData, type PostMatchResultCard, type PostMatchResultData, type PostMatchStatRow, type PostMatchStatsCard, type PostMatchStatsData, type PostMatchTopPerformerCard, type PostMatchTopPerformerData, type PresetComboCell, type PresetGrid, type PresetGridOptions, type PresetMarketCell, type PresetPick, type PresetSinglesCell, type ProgressEventData, type QualifiedType, type QuestionSource, RateLimitError, type ReasonToBetCard, type ReasonToBetData, type RestingFormCard, type RestingFormData, type RestingNextCard, type RestingNextData, type RestingSeasonCard, type RestingSeasonData, type RestingStandingsCard, type RestingStandingsData, SIGNAL_TYPE_CODES, SPORTS, type ScheduleGroup, type ScheduleMatch, type SchedulePayload, type ScheduleSport, type SignalEntityType, type SignalInput, type SignalType, type SlipSelection, type SlipSport, type SportSpec, type StatesPayload, StatsWidgetClient, type StatsWidgetClientOptions, type StreamErrorEventData, type SubmitPlayBody, type SubmitPlayResult, type TransferRow, type TransfersCard, type TransfersData, type TurnCompleteEventData, UpstreamError, type UserContext, type WhereToWatchCard, type WhereToWatchData, type WidgetEntityEventName, type WidgetEntityType, type WidgetEventInput, type WidgetEventName, type WidgetLogInput, type WidgetOpenEventInput, type WidgetOpenEventName, type WidgetPopupAskEventInput, type WidgetPopupAskEventName, type WidgetPopupEventInput, type WidgetPopupEventName, WidgetSdkError, type WidgetSportSwitchEventInput, type WidgetSportSwitchEventName, type WidgetTrackingBody, type WidgetTrackingEnvelope, type WidgetTrackingEvent, type WidgetTrackingEventName, type WidgetTrackingHandler, type WidgetTrackingTab, type WireEvent, type WireSport, createEventLogger, createNdjsonParser, fromWireSport, isAddToSlipResult, isLimitCode, matchKey, mayPinOrSlip, qualifiedId, slipSportOf, sportOf, toWireSport };
package/dist/index.d.ts CHANGED
@@ -165,6 +165,10 @@ interface GreetingEntityChip {
165
165
  id: string;
166
166
  label: string;
167
167
  playing: boolean;
168
+ /** True or absent, never false; competitions only: the league has no game in the window. The widget reads `nextGameAtUtc` first and the flag only when there is no usable instant, so a flag beside a parseable instant is ignored. Absent from older servers. */
169
+ noGamesToday?: true;
170
+ /** Competitions only: the kick-off of the league's next game that has not started, omitted when a game is live or the server cannot tell. The widget decides "today" in the visitor's zone. */
171
+ nextGameAtUtc?: string;
168
172
  }
169
173
  interface GreetingPersonalSection {
170
174
  tier: GreetingPersonalTier;
@@ -190,13 +194,13 @@ interface GreetingPersonalSection {
190
194
  builder?: GreetingBuilderPreset;
191
195
  teamCards: GreetingTeamCard[];
192
196
  playerCards: GreetingPlayerCard[];
193
- facts: {
194
- marketKey: string;
195
- text: string;
196
- hits: number;
197
- window: number;
198
- matchId?: string;
199
- }[];
197
+ facts: GreetingFact[];
198
+ /** NBA and NFL only: the team availability line, apart from the facts and not one of the three. `text` carries no time; the widget draws `asOfUtc` beside it. Absent from older servers. */
199
+ injury?: GreetingInjury;
200
+ /** Facts and injury line for each game in the builder's games select. Absent from an older server: the top-level facts then stay. */
201
+ gameFacts?: GreetingGameFacts[];
202
+ /** The bare id of the game the top-level `facts` and `injury` are about; always set when they are about a game, omitted otherwise and by older servers. With it the widget keeps them on the opening choice when that is All games or holds this game, and drops them under a single game or a league that does not. Without it the widget goes by each fact's own `matchId`. */
203
+ factsMatchId?: string;
200
204
  asks: {
201
205
  actionLabel: string;
202
206
  actionValue: string;
@@ -207,6 +211,42 @@ interface GreetingPersonalSection {
207
211
  followSuggestions: GreetingEntityChip[];
208
212
  /** Starred teams with no game in the window, at most 2. */
209
213
  idleTeams?: GreetingIdleTeam[];
214
+ /** True when the visitor has a starred team, player or league in a sport other than this section's. Omitted when false and by older servers. */
215
+ hasStarsElsewhere?: boolean;
216
+ }
217
+ interface GreetingFact {
218
+ marketKey: string;
219
+ text: string;
220
+ hits: number;
221
+ window: number;
222
+ matchId?: string;
223
+ reference?: GreetingFactReference;
224
+ }
225
+ /** What a fact speaks to, never a price: the widget prices it live from the builder grid. Absent means the fact is text only. */
226
+ interface GreetingFactReference {
227
+ /** The value to send as BuilderGridRequest.sport. */
228
+ sport: string;
229
+ /** Bare id, as in the grid's matchIds. */
230
+ matchId: string;
231
+ /** The value to send as BuilderGridRequest.marketKey. */
232
+ marketKey: string;
233
+ /** Omitted when the pick has no line (a spread). */
234
+ line?: number;
235
+ /** The grid leg's own `side`. */
236
+ side?: 'home' | 'away' | 'over';
237
+ /** The player, props only. */
238
+ subject?: string;
239
+ /** Football team totals only, which are Over-only today. The widget shows the leg only if its own `direction` equals this. */
240
+ direction?: 'over';
241
+ }
242
+ interface GreetingInjury {
243
+ text: string;
244
+ asOfUtc: string;
245
+ }
246
+ interface GreetingGameFacts {
247
+ matchId: string;
248
+ facts: GreetingFact[];
249
+ injury?: GreetingInjury;
210
250
  }
211
251
  interface GreetingBuilderPreset {
212
252
  marketKey: string;
@@ -222,6 +262,8 @@ interface GreetingBuilderPreset {
222
262
  gamesOptionId?: string;
223
263
  /** A short localized line about when games return ("Next games tomorrow."); shown with the pause note. Omitted when the server has nothing to say. */
224
264
  nextGames?: string | null;
265
+ /** The kick-off of the next games, the instant `nextGames` speaks about; the widget writes the sentence in the visitor's zone. Absent from older servers. */
266
+ nextGamesAtUtc?: string;
225
267
  /** True or absent, never false: the visitor's usual market had no lines in the first-choice games, so the games slot moved wider (C13). */
226
268
  widenedForMarket?: true;
227
269
  }
@@ -1150,6 +1192,8 @@ interface ComboLeg {
1150
1192
  matchOddsId: number;
1151
1193
  bookmakerId: number;
1152
1194
  quotedAtUtc: string;
1195
+ /** Over or Under, derived from the bookmaker's raw label and never from the localized `selectionLabel`. Absent for a market that is not Over/Under and from an older server. */
1196
+ direction?: 'over' | 'under';
1153
1197
  /** The server allows pinning this leg's match. Absent on an older server, which means no pin. */
1154
1198
  pinEnabled?: boolean;
1155
1199
  /** The stat behind the leg. Absent or null on an open answer when the leg has none (stage 3 contract §3);
@@ -1259,6 +1303,11 @@ interface BuilderGridRequest {
1259
1303
  legs: number;
1260
1304
  total: string;
1261
1305
  widen: boolean;
1306
+ /**
1307
+ * Ask for every allowed pick of the market in the one game in `matchIds` (with legs 1, total 'any', widen false) instead of the one best pick.
1308
+ * A fact's price uses it to find its own bet among them. A server that does not know the flag drops it and answers the one pick.
1309
+ */
1310
+ allLegs?: boolean;
1262
1311
  operatorUserId?: string;
1263
1312
  anonymousUserId?: string;
1264
1313
  }
@@ -2023,7 +2072,7 @@ declare class Conversation {
2023
2072
  getClubRecords(limit?: number): Promise<ClubRecordsPayload | null>;
2024
2073
  }
2025
2074
 
2026
- type WidgetEntityEventName = 'pin_add' | 'pin_remove' | 'slip_click' | 'slip_result' | 'insight_expand' | 'tile_tap' | 'chip_tap' | 'slip_remove' | 'bet_placed' | 'match_view' | 'match_open' | 'combo_add';
2075
+ type WidgetEntityEventName = 'pin_add' | 'pin_remove' | 'slip_click' | 'slip_result' | 'tile_tap' | 'slip_remove' | 'bet_placed' | 'match_view' | 'match_open' | 'combo_add';
2027
2076
  type WidgetPopupEventName = 'popup_shown' | 'popup_opened' | 'popup_dismissed';
2028
2077
  type WidgetPopupAskEventName = 'popup_ask_tap';
2029
2078
  type WidgetOpenEventName = 'widget_open';
@@ -2162,4 +2211,116 @@ interface NdjsonParser {
2162
2211
  }
2163
2212
  declare function createNdjsonParser(): NdjsonParser;
2164
2213
 
2165
- export { type ActionButtonEventData, type ActionsLoadingEventData, type AddToSlipHandler, type AddToSlipRejectReason, type AddToSlipResult, type AllTimeRow, type AnswerEventData, AuthError, type AvailableMarket, type BettingInsight, type BettingInsightEventData, type BettingInsightOdds, type BuilderGridPayload, type BuilderGridRequest, type BuilderGridStatus, type ChatCallbacks, type ChatEvent, type ChatGrounding, type ChatHandle, type ChatInput, type ChatPreset, type ClubFanDashboardCard, type ClubFanDashboardHeadToHead, type ClubFanDashboardPayload, type ClubFixture, type ClubFixturesPayload, type ClubMatchLogRow, type ClubNextFixture, type ClubPerformanceMetric, type ClubPlayerAvailability, type ClubPlayerAvailabilityStatus, type ClubPlayerDetailPayload, type ClubPlayerPerformance, type ClubPlayerSeasonStats, type ClubRecordEntry, type ClubRecordsPayload, type ClubSquadPayload, type ClubSquadPlayer, type ClubSquadStatsPayload, type ClubStandingRow, type ClubStandingsPayload, type ComboAddMetadata, type ComboCard, type ComboCardEventData, type ComboLeg, type ComboReplacedLeg, type CongestedWeekCard, type CongestedWeekData, type CongestedWeekEntry, Conversation, type CountdownCard, type CountdownData, ENTITY_TYPE_CODES, type EntityCard, type EntityCardEventData, type EntityCardScope, type EntityCardStat, type EventBatch, type EventLogger, type EventLoggerOptions, type FavouriteEntity, type FavouriteKind, type FavouriteStarResponse, type FavouriteStarResult, type FavouritesNoIdentity, type FavouritesPayload, type FetchLike, type FixtureCard, type FixtureCardData, ForbiddenError, type FormAndH2H, type FormMatch, type GameListPayload, type GameResultPayload, type GameStatePayload, type GameSummary, type GreetingBuilderPreset, type GreetingDashboard, type GreetingDashboardLayout, type GreetingDashboardSet, type GreetingDashboardSignalRef, type GreetingDashboardSpan, type GreetingDashboardTile, type GreetingDashboardTileEmphasis, type GreetingEntityChip, type GreetingEntityKind, type GreetingFormResult, type GreetingGamesOption, type GreetingGamesScope, type GreetingIdleTeam, type GreetingMarketOption, type GreetingPersonalSection, type GreetingPersonalTier, type GreetingPlayerCard, type GreetingPlayerHit, type GreetingPlayerStatus, type GreetingSetChip, type GreetingTeamCard, type HeadToHead, type InjuriesCard, type InjuriesCardData, type InjuryRow, type IntentChipEventData, LIMIT_CODES, type LeaderboardChampion, type LeaderboardPayload, type LeaderboardRow, type LeagueStarResult, type LimitCode, type LimitDetails, LimitError, type LinkRow, type LinksCard, type LinksData, type LiveEventLine, type LiveMonitorAmericanFootball, type LiveMonitorBasketball, type LiveMonitorEvent, type LiveMonitorFact, type LiveMonitorMarket, type LiveMonitorMatch, type LiveMonitorSnapshot, type LiveMonitorStatPrice, type LiveMonitorStatRow, type LiveScoreCard, type LiveScoreData, type LiveStatRow, type LiveStatsCard, type LiveStatsData, type LiveTimelineCard, type LiveTimelineData, type MarketOddsBlock, type MarketOddsCard, type MarketOddsCardInsight, type MarketOddsEventData, type MarketOddsLiveBlock, type MarketOddsRow, type MatchState, type MomentumPoint, type MonitorPhase, type MonitorSport, type NbaCoHitEvidence, type NbaCoHitLeg, type NbaGameValue, type NbaInjuryEvent, type NbaInsight, type NbaInsightEventData, type NbaInsightSelection, type NbaJointGame, type NbaLadderEvidence, type NbaLadderRung, type NbaLadderStat, type NbaLineLane, type NbaLineMoveEvidence, type NbaLinePoint, type NbaListedTeammate, type NbaMatchupEvidence, type NbaMatchupPosition, type NbaMatchupTeam, type NbaPropReasonEvidence, type NbaQuarterLadderEvidence, type NbaQuarterRung, type NbaQuarterStat, type NbaSettleLine, type NbaSettlePlayer, type NbaSettleRecapEvidence, type NbaSettleSummary, type NbaSplitRow, type NbaTeammateOutEvidence, type NdjsonParser, NetworkError, type NflAtsGame, type NflAtsRecordEvidence, type NflForm, type NflFormGame, type NflInjuryPlayer, type NflInjuryReportEvidence, type NflInsight, type NflInsightEventData, type NflInsightKind, type NflInsightSelection, type NflLadderEvidence, type NflLadderRung, type NflLineMoveEvidence, type NflLineMoveLane, type NflMatchupEvidence, type NflPropReasonEvidence, type NflPropReasonGame, type NflSettleRecapEvidence, type NflSettleRecapLine, type NflSettleRecapPlayer, type NflSettleRecapSummary, type NonFootballSport, type OddsMovementCard, type OddsMovementEventData, type OddsMovementPoint, type PageContext, ParseError, type PinKind, type PinRef, type PlayerPropFact, type PlayerPropGame, type PlayerPropPrice, type PlayerPropStat, type PlayerPropStatGame, type PlayerPropsBundle, type PostMatchGoalLine, type PostMatchGoalsCard, type PostMatchGoalsData, type PostMatchNextCard, type PostMatchNextData, type PostMatchResultCard, type PostMatchResultData, type PostMatchStatRow, type PostMatchStatsCard, type PostMatchStatsData, type PostMatchTopPerformerCard, type PostMatchTopPerformerData, type PresetComboCell, type PresetGrid, type PresetGridOptions, type PresetMarketCell, type PresetPick, type PresetSinglesCell, type ProgressEventData, type QualifiedType, RateLimitError, type ReasonToBetCard, type ReasonToBetData, type RestingFormCard, type RestingFormData, type RestingNextCard, type RestingNextData, type RestingSeasonCard, type RestingSeasonData, type RestingStandingsCard, type RestingStandingsData, SIGNAL_TYPE_CODES, SPORTS, type ScheduleGroup, type ScheduleMatch, type SchedulePayload, type ScheduleSport, type SignalEntityType, type SignalInput, type SignalType, type SlipSelection, type SlipSport, type SportSpec, type StatesPayload, StatsWidgetClient, type StatsWidgetClientOptions, type StreamErrorEventData, type SubmitPlayBody, type SubmitPlayResult, type TransferRow, type TransfersCard, type TransfersData, type TurnCompleteEventData, UpstreamError, type UserContext, type WhereToWatchCard, type WhereToWatchData, type WidgetEntityEventName, type WidgetEntityType, type WidgetEventInput, type WidgetEventName, type WidgetLogInput, type WidgetOpenEventInput, type WidgetOpenEventName, type WidgetPopupAskEventInput, type WidgetPopupAskEventName, type WidgetPopupEventInput, type WidgetPopupEventName, WidgetSdkError, type WidgetSportSwitchEventInput, type WidgetSportSwitchEventName, type WireEvent, type WireSport, createEventLogger, createNdjsonParser, fromWireSport, isAddToSlipResult, isLimitCode, matchKey, mayPinOrSlip, qualifiedId, slipSportOf, sportOf, toWireSport };
2214
+ type WidgetTrackingTab = 'chat' | 'today' | 'following' | 'trends' | 'games' | 'fixtures' | 'standings' | 'squad' | 'records' | 'favourites';
2215
+ type QuestionSource = 'typed' | 'starter' | 'action' | 'tile' | 'preset' | 'live_fact' | 'bubble_ask' | 'retry';
2216
+ /** Fields on every event. `at` is epoch ms, taken when the event happened, not when it was delivered. */
2217
+ interface WidgetTrackingEnvelope {
2218
+ at: number;
2219
+ operatorId: string;
2220
+ widgetVersion: string;
2221
+ language?: string;
2222
+ conversationId?: string;
2223
+ operatorUserId?: string;
2224
+ anonymousUserId?: string;
2225
+ page?: PageContext;
2226
+ }
2227
+ /** What the slip handler resolved to: 'added' also covers an accepted price change; 'timeout' is the widget giving up waiting. */
2228
+ type AddToSlipOutcome = 'added' | 'duplicate' | 'price_changed' | 'timeout' | AddToSlipRejectReason;
2229
+ interface SlipClickFields {
2230
+ matchOddsId: number;
2231
+ matchId: number;
2232
+ odds: number;
2233
+ market?: string;
2234
+ /** Absent means football. */
2235
+ sport?: SlipSport;
2236
+ }
2237
+ type WidgetTrackingEventBody = {
2238
+ name: 'bubble_shown';
2239
+ } | {
2240
+ name: 'bubble_click';
2241
+ } | {
2242
+ name: 'bubble_ask_click';
2243
+ position: number;
2244
+ } | {
2245
+ name: 'bubble_dismiss';
2246
+ } | {
2247
+ name: 'launcher_click';
2248
+ } | {
2249
+ name: 'widget_open';
2250
+ } | {
2251
+ name: 'widget_close';
2252
+ method: 'button' | 'escape';
2253
+ tab: WidgetTrackingTab;
2254
+ answering: boolean;
2255
+ } | {
2256
+ name: 'tab_change';
2257
+ from: WidgetTrackingTab;
2258
+ to: WidgetTrackingTab;
2259
+ } | {
2260
+ name: 'question_asked';
2261
+ turnId: string;
2262
+ source: QuestionSource;
2263
+ length: number;
2264
+ text?: string;
2265
+ } | {
2266
+ name: 'answer_received';
2267
+ turnId: string;
2268
+ conversationId: string;
2269
+ latencyMs: number;
2270
+ cardTypes: string[];
2271
+ } | {
2272
+ name: 'answer_failed';
2273
+ turnId: string;
2274
+ code: string;
2275
+ } | {
2276
+ name: 'answer_stopped';
2277
+ turnId: string;
2278
+ } | {
2279
+ name: 'pin_click';
2280
+ action: 'add' | 'remove';
2281
+ target: 'match' | 'market';
2282
+ matchId?: number;
2283
+ market?: string;
2284
+ sport?: string;
2285
+ } | ({
2286
+ name: 'add_to_slip_click';
2287
+ } & SlipClickFields) | ({
2288
+ name: 'add_to_slip_result';
2289
+ outcome: AddToSlipOutcome;
2290
+ } & SlipClickFields) | {
2291
+ name: 'combo_add_click';
2292
+ surface: 'builder' | 'chat';
2293
+ sport: string;
2294
+ legs: number;
2295
+ total: string;
2296
+ } | {
2297
+ name: 'all_markets_click';
2298
+ matchId: number;
2299
+ market?: string;
2300
+ surface: string;
2301
+ } | {
2302
+ name: 'dashboard_tile_click';
2303
+ entityType: WidgetEntityType;
2304
+ entityId: string;
2305
+ } | {
2306
+ name: 'sport_switch';
2307
+ sport: string;
2308
+ } | {
2309
+ name: 'new_conversation';
2310
+ } | {
2311
+ name: 'league_star';
2312
+ competitionId: number | string;
2313
+ starred: boolean;
2314
+ } | {
2315
+ name: 'favourite_change';
2316
+ kind: string;
2317
+ id: string;
2318
+ outcome: string;
2319
+ };
2320
+ type WidgetTrackingEvent = WidgetTrackingEventBody & WidgetTrackingEnvelope;
2321
+ type WidgetTrackingEventName = WidgetTrackingEvent['name'];
2322
+ /** The event without its envelope; the tracker adds the envelope. */
2323
+ type WidgetTrackingBody = WidgetTrackingEventBody;
2324
+ type WidgetTrackingHandler = (event: WidgetTrackingEvent) => void | Promise<void>;
2325
+
2326
+ export { type ActionButtonEventData, type ActionsLoadingEventData, type AddToSlipHandler, type AddToSlipOutcome, type AddToSlipRejectReason, type AddToSlipResult, type AllTimeRow, type AnswerEventData, AuthError, type AvailableMarket, type BettingInsight, type BettingInsightEventData, type BettingInsightOdds, type BuilderGridPayload, type BuilderGridRequest, type BuilderGridStatus, type ChatCallbacks, type ChatEvent, type ChatGrounding, type ChatHandle, type ChatInput, type ChatPreset, type ClubFanDashboardCard, type ClubFanDashboardHeadToHead, type ClubFanDashboardPayload, type ClubFixture, type ClubFixturesPayload, type ClubMatchLogRow, type ClubNextFixture, type ClubPerformanceMetric, type ClubPlayerAvailability, type ClubPlayerAvailabilityStatus, type ClubPlayerDetailPayload, type ClubPlayerPerformance, type ClubPlayerSeasonStats, type ClubRecordEntry, type ClubRecordsPayload, type ClubSquadPayload, type ClubSquadPlayer, type ClubSquadStatsPayload, type ClubStandingRow, type ClubStandingsPayload, type ComboAddMetadata, type ComboCard, type ComboCardEventData, type ComboLeg, type ComboReplacedLeg, type CongestedWeekCard, type CongestedWeekData, type CongestedWeekEntry, Conversation, type CountdownCard, type CountdownData, ENTITY_TYPE_CODES, type EntityCard, type EntityCardEventData, type EntityCardScope, type EntityCardStat, type EventBatch, type EventLogger, type EventLoggerOptions, type FavouriteEntity, type FavouriteKind, type FavouriteStarResponse, type FavouriteStarResult, type FavouritesNoIdentity, type FavouritesPayload, type FetchLike, type FixtureCard, type FixtureCardData, ForbiddenError, type FormAndH2H, type FormMatch, type GameListPayload, type GameResultPayload, type GameStatePayload, type GameSummary, type GreetingBuilderPreset, type GreetingDashboard, type GreetingDashboardLayout, type GreetingDashboardSet, type GreetingDashboardSignalRef, type GreetingDashboardSpan, type GreetingDashboardTile, type GreetingDashboardTileEmphasis, type GreetingEntityChip, type GreetingEntityKind, type GreetingFact, type GreetingFactReference, type GreetingFormResult, type GreetingGameFacts, type GreetingGamesOption, type GreetingGamesScope, type GreetingIdleTeam, type GreetingInjury, type GreetingMarketOption, type GreetingPersonalSection, type GreetingPersonalTier, type GreetingPlayerCard, type GreetingPlayerHit, type GreetingPlayerStatus, type GreetingSetChip, type GreetingTeamCard, type HeadToHead, type InjuriesCard, type InjuriesCardData, type InjuryRow, type IntentChipEventData, LIMIT_CODES, type LeaderboardChampion, type LeaderboardPayload, type LeaderboardRow, type LeagueStarResult, type LimitCode, type LimitDetails, LimitError, type LinkRow, type LinksCard, type LinksData, type LiveEventLine, type LiveMonitorAmericanFootball, type LiveMonitorBasketball, type LiveMonitorEvent, type LiveMonitorFact, type LiveMonitorMarket, type LiveMonitorMatch, type LiveMonitorSnapshot, type LiveMonitorStatPrice, type LiveMonitorStatRow, type LiveScoreCard, type LiveScoreData, type LiveStatRow, type LiveStatsCard, type LiveStatsData, type LiveTimelineCard, type LiveTimelineData, type MarketOddsBlock, type MarketOddsCard, type MarketOddsCardInsight, type MarketOddsEventData, type MarketOddsLiveBlock, type MarketOddsRow, type MatchState, type MomentumPoint, type MonitorPhase, type MonitorSport, type NbaCoHitEvidence, type NbaCoHitLeg, type NbaGameValue, type NbaInjuryEvent, type NbaInsight, type NbaInsightEventData, type NbaInsightSelection, type NbaJointGame, type NbaLadderEvidence, type NbaLadderRung, type NbaLadderStat, type NbaLineLane, type NbaLineMoveEvidence, type NbaLinePoint, type NbaListedTeammate, type NbaMatchupEvidence, type NbaMatchupPosition, type NbaMatchupTeam, type NbaPropReasonEvidence, type NbaQuarterLadderEvidence, type NbaQuarterRung, type NbaQuarterStat, type NbaSettleLine, type NbaSettlePlayer, type NbaSettleRecapEvidence, type NbaSettleSummary, type NbaSplitRow, type NbaTeammateOutEvidence, type NdjsonParser, NetworkError, type NflAtsGame, type NflAtsRecordEvidence, type NflForm, type NflFormGame, type NflInjuryPlayer, type NflInjuryReportEvidence, type NflInsight, type NflInsightEventData, type NflInsightKind, type NflInsightSelection, type NflLadderEvidence, type NflLadderRung, type NflLineMoveEvidence, type NflLineMoveLane, type NflMatchupEvidence, type NflPropReasonEvidence, type NflPropReasonGame, type NflSettleRecapEvidence, type NflSettleRecapLine, type NflSettleRecapPlayer, type NflSettleRecapSummary, type NonFootballSport, type OddsMovementCard, type OddsMovementEventData, type OddsMovementPoint, type PageContext, ParseError, type PinKind, type PinRef, type PlayerPropFact, type PlayerPropGame, type PlayerPropPrice, type PlayerPropStat, type PlayerPropStatGame, type PlayerPropsBundle, type PostMatchGoalLine, type PostMatchGoalsCard, type PostMatchGoalsData, type PostMatchNextCard, type PostMatchNextData, type PostMatchResultCard, type PostMatchResultData, type PostMatchStatRow, type PostMatchStatsCard, type PostMatchStatsData, type PostMatchTopPerformerCard, type PostMatchTopPerformerData, type PresetComboCell, type PresetGrid, type PresetGridOptions, type PresetMarketCell, type PresetPick, type PresetSinglesCell, type ProgressEventData, type QualifiedType, type QuestionSource, RateLimitError, type ReasonToBetCard, type ReasonToBetData, type RestingFormCard, type RestingFormData, type RestingNextCard, type RestingNextData, type RestingSeasonCard, type RestingSeasonData, type RestingStandingsCard, type RestingStandingsData, SIGNAL_TYPE_CODES, SPORTS, type ScheduleGroup, type ScheduleMatch, type SchedulePayload, type ScheduleSport, type SignalEntityType, type SignalInput, type SignalType, type SlipSelection, type SlipSport, type SportSpec, type StatesPayload, StatsWidgetClient, type StatsWidgetClientOptions, type StreamErrorEventData, type SubmitPlayBody, type SubmitPlayResult, type TransferRow, type TransfersCard, type TransfersData, type TurnCompleteEventData, UpstreamError, type UserContext, type WhereToWatchCard, type WhereToWatchData, type WidgetEntityEventName, type WidgetEntityType, type WidgetEventInput, type WidgetEventName, type WidgetLogInput, type WidgetOpenEventInput, type WidgetOpenEventName, type WidgetPopupAskEventInput, type WidgetPopupAskEventName, type WidgetPopupEventInput, type WidgetPopupEventName, WidgetSdkError, type WidgetSportSwitchEventInput, type WidgetSportSwitchEventName, type WidgetTrackingBody, type WidgetTrackingEnvelope, type WidgetTrackingEvent, type WidgetTrackingEventName, type WidgetTrackingHandler, type WidgetTrackingTab, type WireEvent, type WireSport, createEventLogger, createNdjsonParser, fromWireSport, isAddToSlipResult, isLimitCode, matchKey, mayPinOrSlip, qualifiedId, slipSportOf, sportOf, toWireSport };
package/dist/index.js CHANGED
@@ -330,7 +330,8 @@ async function getBuilderGrid(cfg, locale, req) {
330
330
  total: req.total,
331
331
  marketKey: req.marketKey ?? void 0,
332
332
  matchIds: req.widen ? void 0 : req.matchIds.join(","),
333
- widen: req.widen ? "true" : void 0
333
+ widen: req.widen ? "true" : void 0,
334
+ allLegs: req.allLegs ? "true" : void 0
334
335
  });
335
336
  const res = await cfg.fetch(endpoint(cfg, "price-presets" + query), {
336
337
  method: "GET",
@@ -443,6 +444,9 @@ function dispatch(ev, cb) {
443
444
  break;
444
445
  }
445
446
  }
447
+ function isAbort2(error) {
448
+ return error instanceof Error && error.name === "AbortError";
449
+ }
446
450
  async function* streamEvents(cfg, input, signal) {
447
451
  const res = await postChat(cfg, input, signal);
448
452
  const reader = res.body.getReader();
@@ -450,7 +454,14 @@ async function* streamEvents(cfg, input, signal) {
450
454
  const parser = createNdjsonParser();
451
455
  try {
452
456
  for (; ; ) {
453
- const { done, value } = await reader.read();
457
+ let chunk;
458
+ try {
459
+ chunk = await reader.read();
460
+ } catch (error) {
461
+ if (isAbort2(error)) throw error;
462
+ throw new NetworkError("Network request failed", error);
463
+ }
464
+ const { done, value } = chunk;
454
465
  if (done) break;
455
466
  for (const obj of parser.push(decoder.decode(value, { stream: true }))) yield obj;
456
467
  }