@maestro_io/maestro-web-sdk 2.2.0 → 2.2.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.
Files changed (55) hide show
  1. package/dist/MaestroEventDelegate.d.ts +3 -0
  2. package/dist/components/core/PanelManager/PanelManager.d.ts +3 -0
  3. package/dist/components/organisms/SegmentController/SegmentController.d.ts +1 -0
  4. package/dist/external/AxiosNetworkClient.d.ts +1 -1
  5. package/dist/external/ports/networkClient.d.ts +1 -1
  6. package/dist/helpers/url.d.ts +1 -0
  7. package/dist/index.d.ts +12 -2
  8. package/dist/interfaces/IMaestroEvent.d.ts +13 -0
  9. package/dist/interfaces/IMaestroEventDelegate.d.ts +11 -0
  10. package/dist/interfaces/IMaestroManager.d.ts +10 -2
  11. package/dist/interfaces/IUserSettings.d.ts +36 -0
  12. package/dist/maestro-web-sdk.umd.js +3 -3
  13. package/dist/maestro-web-sdk.umd.js.map +1 -1
  14. package/dist/modules/bets/types/BetsAnalyticsTypes.d.ts +25 -0
  15. package/dist/modules/bets/view/BetsView.d.ts +4 -0
  16. package/dist/modules/bets/view/SixPack/SixPackView.d.ts +1 -0
  17. package/dist/modules/bets/view/UserBets/BetsCard/BetsCard.d.ts +1 -0
  18. package/dist/modules/bets/view/UserBets/BetsCard/BetsCardEvent.d.ts +1 -0
  19. package/dist/modules/bets/view/UserBets/BetsCard/BetsCardFooter.d.ts +2 -1
  20. package/dist/modules/bets/view/UserBets/Boost/Boost.d.ts +2 -1
  21. package/dist/modules/bets/view/UserBets/Parlay/Parlay.d.ts +2 -1
  22. package/dist/modules/bets/view/UserBets/Straight/Straight.d.ts +2 -1
  23. package/dist/modules/bets/view/UserBets/Teaser/Teaser.d.ts +2 -1
  24. package/dist/modules/bets/view/UserBets/UserBetsView.d.ts +0 -1
  25. package/dist/modules/bets/view/components/Bet/Bet.d.ts +7 -0
  26. package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +1 -0
  27. package/dist/modules/bets/view-model/BetsViewModel.d.ts +33 -0
  28. package/dist/modules/key-plays/interfaces/IKeyPlays.d.ts +1 -0
  29. package/dist/modules/key-plays/interfaces/IKeyPlaysResponse.d.ts +6 -6
  30. package/dist/modules/key-plays/view/KeyPlayCardView.d.ts +4 -1
  31. package/dist/modules/key-plays/view/KeyPlayErrorStateView.d.ts +2 -0
  32. package/dist/modules/key-plays/view-model/KeyPlaysViewModel.d.ts +9 -1
  33. package/dist/modules/stats/interfaces/IStats.d.ts +1 -1
  34. package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +1 -0
  35. package/dist/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.d.ts +1 -1
  36. package/dist/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.d.ts +1 -1
  37. package/dist/modules/stats/view/DriveSummary/DriveSummary.d.ts +1 -0
  38. package/dist/modules/stats/view/GameLeaders/GameLeaders.d.ts +1 -0
  39. package/dist/modules/stats/view/StatsItemView.d.ts +2 -0
  40. package/dist/modules/stats/view/StatsView.d.ts +1 -0
  41. package/dist/modules/stats/view-model/StatsViewModel.d.ts +6 -2
  42. package/dist/services/AnalyticsService/AnalyticsService.d.ts +65 -0
  43. package/dist/services/AnalyticsService/types.d.ts +65 -0
  44. package/dist/services/BetsService.d.ts +2 -2
  45. package/dist/services/InsightsService/InsightsPayloadBuilder.d.ts +278 -0
  46. package/dist/services/InsightsService/InsightsService.d.ts +10 -0
  47. package/dist/services/NetworkManager/NetworkManager.d.ts +3 -20
  48. package/dist/services/NetworkManager/NetworkManagerFactory.d.ts +42 -0
  49. package/dist/services/NetworkManager/types.d.ts +73 -0
  50. package/dist/services/StatsService.d.ts +2 -2
  51. package/dist/services/UserSettingsManager.d.ts +63 -0
  52. package/dist/view-models/MaestroEventViewModel.d.ts +5 -0
  53. package/dist/view-models/PanelManagerViewModel.d.ts +24 -0
  54. package/dist/view-models/index.d.ts +4 -0
  55. package/package.json +1 -1
@@ -0,0 +1,25 @@
1
+ import { BaseMetadata } from '../../../services/AnalyticsService/types';
2
+ /**
3
+ * Valid bet types as specified in the analytics spec
4
+ */
5
+ export type BetType = 'straight' | 'parlay' | 'parlay_plus' | 'teaser' | 'boost';
6
+ /**
7
+ * Valid card types for bets module
8
+ */
9
+ export type BetCardType = '6-pack' | 'my bets > live' | 'my bets > settled' | 'my bets > upcoming' | 'hot-props' | 'promo' | 'disclaimer';
10
+ /**
11
+ * Metadata for bet panel view events
12
+ */
13
+ export interface BetPanelViewMetadata extends BaseMetadata {
14
+ in_game_bets: number;
15
+ total_bets: number;
16
+ }
17
+ /**
18
+ * Metadata for bet card click events
19
+ */
20
+ export interface BetCardClickMetadata extends BaseMetadata {
21
+ card: BetCardType;
22
+ in_game_bets: number;
23
+ total_bets: number;
24
+ bet_type: BetType | null;
25
+ }
@@ -1,23 +1,27 @@
1
1
  import React, { Component } from 'react';
2
2
  import './BetsView.styles.css';
3
3
  import { BetItem, BetsErrorState } from '../view-model/BetsViewModel';
4
+ import { Direction } from '@/external/spatial-navigation/utils';
4
5
  interface BetsViewState {
5
6
  container: HTMLDivElement | null;
6
7
  betsItems: BetItem[];
7
8
  isDataLoading: boolean;
8
9
  errorState: BetsErrorState;
10
+ hideWagers: boolean;
9
11
  }
10
12
  declare class BetsView extends Component<{}, BetsViewState> {
11
13
  private container;
12
14
  private betsItemsUnsub;
13
15
  private isDataLoadingUnsub;
14
16
  private errorStateUnsub;
17
+ private hideWagersUnsub;
15
18
  private vm;
16
19
  constructor(props: {});
17
20
  componentDidMount(): void;
18
21
  componentWillUnmount(): void;
19
22
  renderBetItem: (item: BetItem) => React.JSX.Element | null;
20
23
  clearTabLoadFailure: () => void;
24
+ onArrowPress: (d: Direction) => void;
21
25
  render(): React.JSX.Element;
22
26
  }
23
27
  export default BetsView;
@@ -15,6 +15,7 @@ export default class FocusableSixPackViewWrapper extends React.Component<Props>
15
15
  context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
16
16
  onBecameFocused: (layout: Layout) => void;
17
17
  onArrowPress: (d: Direction, _props: any) => void;
18
+ onEnterPress: () => void;
18
19
  render(): React.JSX.Element;
19
20
  }
20
21
  export {};
@@ -7,6 +7,7 @@ export declare const EVENTS_COUNT_THRESHOLD = 3;
7
7
  export type BaseBetCardProps = {
8
8
  bet: IUserBet;
9
9
  renderHeaderContent?: (props: WithFocusableProps) => React.ReactNode;
10
+ hideWagers?: boolean;
10
11
  };
11
12
  declare const _default: {
12
13
  new (props?: (BaseBetCardProps & WithFocusableProps) | undefined, context?: any): {
@@ -10,6 +10,7 @@ type BetsCardEventProps = {
10
10
  betType: string;
11
11
  onBetArrowPress: (eventIndex: number, legIndex: number) => (direction: Direction, props: any, details: Details) => void;
12
12
  onBetBackPress: () => void;
13
+ hideWagers?: boolean;
13
14
  };
14
15
  declare class BetsCardEvent extends React.Component<BetsCardEventProps> {
15
16
  static contextTypes: {
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { IUserBet } from '@/modules/bets/interfaces/IBets';
3
3
  type BetsCardFooterProps = {
4
4
  bet: IUserBet;
5
+ hideWagers?: boolean;
5
6
  };
6
- declare const BetsCardFooter: (props: BetsCardFooterProps) => React.JSX.Element;
7
+ declare const BetsCardFooter: (props: BetsCardFooterProps) => React.JSX.Element | null;
7
8
  export default BetsCardFooter;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { IUserBet } from '@/modules/bets/interfaces/IBets';
3
3
  type BoostProps = {
4
4
  bet: IUserBet;
5
+ hideWagers?: boolean;
5
6
  };
6
- declare const Boost: ({ bet }: BoostProps) => React.JSX.Element;
7
+ declare const Boost: ({ bet, hideWagers }: BoostProps) => React.JSX.Element;
7
8
  export default Boost;
@@ -3,6 +3,7 @@ import './Parlay.styles.css';
3
3
  import { IUserBet } from '@/modules/bets/interfaces/IBets';
4
4
  type ParlayProps = {
5
5
  bet: IUserBet;
6
+ hideWagers?: boolean;
6
7
  };
7
- declare const Parlay: ({ bet }: ParlayProps) => React.JSX.Element;
8
+ declare const Parlay: ({ bet, hideWagers }: ParlayProps) => React.JSX.Element;
8
9
  export default Parlay;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { IUserBet } from '@/modules/bets/interfaces/IBets';
3
3
  type StraightProps = {
4
4
  bet: IUserBet;
5
+ hideWagers?: boolean;
5
6
  };
6
- declare const Straight: ({ bet }: StraightProps) => React.JSX.Element;
7
+ declare const Straight: ({ bet, hideWagers }: StraightProps) => React.JSX.Element;
7
8
  export default Straight;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { IUserBet } from '@/modules/bets/interfaces/IBets';
3
3
  type TeaserProps = {
4
4
  bet: IUserBet;
5
+ hideWagers?: boolean;
5
6
  };
6
- declare const Teaser: ({ bet }: TeaserProps) => React.JSX.Element;
7
+ declare const Teaser: ({ bet, hideWagers }: TeaserProps) => React.JSX.Element;
7
8
  export default Teaser;
@@ -17,7 +17,6 @@ declare class UserBetsView extends React.Component<UserBetsViewProps, {
17
17
  segmentItems: (SegmentItem & {
18
18
  type: Segments;
19
19
  })[];
20
- onSegmentChange: (segment: Segments) => void;
21
20
  renderBet: (bet: IUserBet) => React.JSX.Element | null;
22
21
  renderBets: () => React.JSX.Element | (React.JSX.Element | null)[];
23
22
  get bets(): IUserBet[] | null;
@@ -6,6 +6,7 @@ import { IBetLeg } from '@/modules/bets/interfaces/IBets';
6
6
  declare const _default: {
7
7
  new (props?: ({
8
8
  leg: IBetLeg;
9
+ hideWagers?: boolean | undefined;
9
10
  } & WithFocusableProps) | undefined, context?: any): {
10
11
  state: import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState;
11
12
  navigation: import("../../../../../external/spatial-navigation/spatialNavigation").default;
@@ -28,15 +29,18 @@ declare const _default: {
28
29
  componentWillUnmount(): void;
29
30
  render(): React.ReactElement<{
30
31
  leg: IBetLeg;
32
+ hideWagers?: boolean | undefined;
31
33
  } & WithFocusableProps>;
32
34
  setState<K extends keyof import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState>(state: import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState | ((prevState: Readonly<import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState>, props: {
33
35
  leg: IBetLeg;
36
+ hideWagers?: boolean | undefined;
34
37
  } & WithFocusableProps) => import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState | Pick<import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>) | Pick<import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState, K>, callback?: (() => any) | undefined): void;
35
38
  forceUpdate(callBack?: (() => any) | undefined): void;
36
39
  props: Readonly<{
37
40
  children?: React.ReactNode;
38
41
  }> & Readonly<{
39
42
  leg: IBetLeg;
43
+ hideWagers?: boolean | undefined;
40
44
  } & WithFocusableProps>;
41
45
  context: any;
42
46
  refs: {
@@ -45,12 +49,15 @@ declare const _default: {
45
49
  componentWillMount?(): void;
46
50
  componentWillReceiveProps?(nextProps: Readonly<{
47
51
  leg: IBetLeg;
52
+ hideWagers?: boolean | undefined;
48
53
  } & WithFocusableProps>, nextContext: any): void;
49
54
  shouldComponentUpdate?(nextProps: Readonly<{
50
55
  leg: IBetLeg;
56
+ hideWagers?: boolean | undefined;
51
57
  } & WithFocusableProps>, nextState: Readonly<import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): boolean;
52
58
  componentWillUpdate?(nextProps: Readonly<{
53
59
  leg: IBetLeg;
60
+ hideWagers?: boolean | undefined;
54
61
  } & WithFocusableProps>, nextState: Readonly<import("../../../../../external/spatial-navigation/withFocusable").WithFocusableState>, nextContext: any): void;
55
62
  };
56
63
  contextTypes: {
@@ -18,5 +18,6 @@ export default class FocusablePromoCodeBannerWrapper extends React.Component<Pro
18
18
  context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
19
19
  onBecameFocused: (layout: Layout) => void;
20
20
  onArrowPress: (d: Direction, _props: any) => void;
21
+ onEnterPress: () => void;
21
22
  render(): React.JSX.Element;
22
23
  }
@@ -3,6 +3,7 @@ import { ITeam, IUserBet, IBetLeg } from '../interfaces/IBets';
3
3
  import { ViewModel } from '../../../view-models/ViewModel';
4
4
  import { TestUseCase } from '@/interfaces/IMaestroEvent';
5
5
  import IMaestroEventDelegate from '@/interfaces/IMaestroEventDelegate';
6
+ import { BetCardType, BetType } from '../types/BetsAnalyticsTypes';
6
7
  declare const BET_ITEM_TYPE: {
7
8
  readonly ODDS: "odds";
8
9
  readonly USER_BETS: "userBets";
@@ -74,16 +75,19 @@ export type SixPackBetItem = {
74
75
  away: ITeam;
75
76
  };
76
77
  id: string;
78
+ hideWagers: boolean;
77
79
  };
78
80
  export type UserBetsBetItem = {
79
81
  type: 'userBets';
80
82
  data: IUserBets;
81
83
  id: string;
84
+ hideWagers: boolean;
82
85
  };
83
86
  export type HotPropsBetItem = {
84
87
  type: 'hotProps';
85
88
  data: IHotProps;
86
89
  id: string;
90
+ hideWagers: boolean;
87
91
  };
88
92
  export type BetItem = SixPackBetItem | UserBetsBetItem | PromoBetItem | HotPropsBetItem | LocationDisclaimerBetItem | GamblingMessageBetItem;
89
93
  declare const BET_ERROR_STATE: {
@@ -101,14 +105,18 @@ export declare class BetsViewModel extends ViewModel {
101
105
  isDataLoading: Observable<boolean>;
102
106
  errorState: Observable<BetsErrorState>;
103
107
  hasEverSuccessfullyLoaded: Observable<boolean>;
108
+ hideWagers: Observable<boolean>;
104
109
  private eventId;
105
110
  private delegate;
106
111
  private betsService;
112
+ private analyticsService;
107
113
  private pollingInterval;
108
114
  private pollingTask;
109
115
  private lastNonPersonalizedResponseHash;
110
116
  private lastPersonalizedResponseHash;
111
117
  private useMockData;
118
+ private userSettingsManager;
119
+ private settingsSubscription;
112
120
  initialized: boolean;
113
121
  constructor(eventId: string, delegate: IMaestroEventDelegate, options?: {
114
122
  pollingInterval?: number;
@@ -122,6 +130,22 @@ export declare class BetsViewModel extends ViewModel {
122
130
  * Clean up resources when the ViewModel is no longer needed
123
131
  */
124
132
  cleanup(): void;
133
+ /**
134
+ * Track panel view event
135
+ */
136
+ private trackPanelView;
137
+ /**
138
+ * Track card click event
139
+ */
140
+ trackCardClick(cardType: BetCardType, betType?: BetType | null): Promise<void>;
141
+ /**
142
+ * Get base metadata for analytics events
143
+ */
144
+ private getBaseMetadata;
145
+ /**
146
+ * Get user bet counts for analytics
147
+ */
148
+ private getUserBetCounts;
125
149
  /**
126
150
  * Refresh polling for bet data
127
151
  */
@@ -170,6 +194,15 @@ export declare class BetsViewModel extends ViewModel {
170
194
  private fetchMockData;
171
195
  simulateUseCase<T = any>(useCase: TestUseCase, _: T): void;
172
196
  clearTabLoadFailure(): void;
197
+ /**
198
+ * Check if wagers should be hidden based on user settings
199
+ */
200
+ shouldHideWagers(): boolean;
201
+ /**
202
+ * Update hideWagers Observable from current settings
203
+ */
204
+ private updateHideWagersFromSettings;
205
+ private refreshBetItemsWithNewSettings;
173
206
  }
174
207
  declare global {
175
208
  interface String {
@@ -9,6 +9,7 @@ export default interface IKeyPlay {
9
9
  teamImageUrl?: string;
10
10
  playerImageUrl?: string;
11
11
  thumbnailImageUrl?: string;
12
+ wallClock?: string;
12
13
  section?: string;
13
14
  }
14
15
  export declare const KEY_PLAYS_LOAD_FAILURE_STATUS: {
@@ -29,12 +29,12 @@ interface MaestroKeyPlaysSection {
29
29
  }
30
30
  interface MaestroKeyPlay {
31
31
  description: string;
32
- team: string;
33
- wallClock: string;
34
- displayClock: string;
35
- shortPeriod: string;
36
- scoringPlay: boolean;
37
- athlete: string;
32
+ team?: string;
33
+ wallClock?: string;
34
+ displayClock?: string;
35
+ shortPeriod?: string;
36
+ scoringPlay?: boolean;
37
+ athlete?: string;
38
38
  thumbnail: string;
39
39
  thumbnailType: string;
40
40
  clipID: string;
@@ -10,17 +10,20 @@ type KeyPlayCardViewProps = IKeyPlay & {
10
10
  };
11
11
  type KeyPlaysCardViewState = {
12
12
  failedClip: KeyPlayLoadFailureStatus | null;
13
+ imageLoaded: boolean;
13
14
  };
14
15
  export declare class KeyPlayCardView extends React.Component<KeyPlayCardViewProps & WithFocusableProps, KeyPlaysCardViewState> {
15
16
  private failedClipListener;
16
17
  private vm;
17
18
  state: {
18
19
  failedClip: null;
20
+ imageLoaded: boolean;
19
21
  };
20
22
  constructor(props: KeyPlayCardViewProps);
21
23
  componentDidMount(): void;
22
24
  componentWillUnmount(): void;
23
- renderImage: () => React.JSX.Element;
25
+ onLoad: () => void;
26
+ renderImage: () => React.JSX.Element | null;
24
27
  render(): React.JSX.Element;
25
28
  }
26
29
  export default class KeyPlayCard extends React.Component<Omit<KeyPlayCardViewProps, 'setRef'> & WithFocusableProps> {
@@ -1,11 +1,13 @@
1
1
  import { KeyPlaysErrorState } from '../interfaces/IKeyPlays';
2
2
  import './KeyPlayErrorStateView.styles.css';
3
3
  import React from 'react';
4
+ import { Direction } from '@/external/spatial-navigation/utils';
4
5
  type Props = {
5
6
  errorState: KeyPlaysErrorState;
6
7
  onRetry: () => void;
7
8
  };
8
9
  declare class KeyPlayErrorStateView extends React.Component<Props, {}> {
10
+ onArrowPress: (d: Direction) => void;
9
11
  render(): React.JSX.Element | null;
10
12
  }
11
13
  export default KeyPlayErrorStateView;
@@ -1,6 +1,7 @@
1
1
  import IMaestroKeyPlaysResponse from '../interfaces/IKeyPlaysResponse';
2
2
  import IKeyPlay, { KeyPlayLoadFailureStatus, KeyPlaysErrorState } from '../interfaces/IKeyPlays';
3
3
  import { Observable } from '@/helpers/Observable';
4
+ import AnalyticsService from '@/services/AnalyticsService/AnalyticsService';
4
5
  type KeyPlayItem = {
5
6
  title: string;
6
7
  items: IKeyPlay[];
@@ -14,10 +15,17 @@ declare class KeyPlaysViewModel {
14
15
  [key: string]: KeyPlayLoadFailureStatus;
15
16
  }>;
16
17
  items: Observable<KeyPlayItem[]>;
18
+ filteredItems: Observable<KeyPlayItem[]>;
19
+ analyticsService: AnalyticsService;
20
+ constructor();
21
+ onUpdatePlayerTimeCode(playerTimeCode: number | null): void;
22
+ private filterItemsByPlayerTimeCode;
23
+ private shouldShowKeyPlay;
17
24
  isCurrentlyPlaying(index: number): boolean;
18
- setKeyPlays(items: IMaestroKeyPlaysResponse | null): Promise<void>;
25
+ setKeyPlays(items: IMaestroKeyPlaysResponse | null, playerTimeCode: number | null): Promise<void>;
19
26
  private cleanErrors;
20
27
  playKeyPlay(atIndex: number): Promise<void>;
28
+ init(): Promise<void>;
21
29
  parseNetworkResponse(response: IMaestroKeyPlaysResponse): KeyPlayItem[];
22
30
  get allItems(): IKeyPlay[];
23
31
  clipID(forKeyPlayAtIndex: number): string | undefined;
@@ -15,7 +15,7 @@ export interface Team {
15
15
  shortDisplayName?: string;
16
16
  color?: string;
17
17
  alternateColor?: string;
18
- logo: string;
18
+ logo?: string;
19
19
  statistics?: TeamStatistic[];
20
20
  homeAway?: string;
21
21
  record?: string;
@@ -5,6 +5,7 @@ import { ActiveAthletesItem } from '../../view-model/StatsViewModel';
5
5
  export type ActiveAthletesProps = {
6
6
  item: ActiveAthletesItem;
7
7
  onBecameFocused: (layout: Layout) => void;
8
+ onEnterPress: () => void;
8
9
  };
9
10
  declare class ActiveAthletes extends React.Component<ActiveAthletesProps, {
10
11
  expanded: boolean;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
2
  import './CollapsedAthletes.styles.css';
3
3
  import { ActiveAthletesProps } from '../ActiveAthletes';
4
- declare const CollapsedAthletes: (props: ActiveAthletesProps) => React.JSX.Element;
4
+ declare const CollapsedAthletes: (props: Pick<ActiveAthletesProps, 'item'>) => React.JSX.Element;
5
5
  export default CollapsedAthletes;
@@ -5,6 +5,6 @@ import { Direction } from '@/external/spatial-navigation/utils';
5
5
  type Props = {
6
6
  onArrowPress: (index: number) => (direction: Direction) => void;
7
7
  onBackPress: () => void;
8
- } & ActiveAthletesProps;
8
+ } & Pick<ActiveAthletesProps, 'item' | 'onBecameFocused' | 'onEnterPress'>;
9
9
  declare const ExpandedAthletes: (props: Props) => React.JSX.Element;
10
10
  export default ExpandedAthletes;
@@ -5,6 +5,7 @@ import './DriveSummary.styles.css';
5
5
  import { DriveSummaryItem } from '../../view-model/StatsViewModel';
6
6
  type DriveSummaryProps = {
7
7
  item: DriveSummaryItem;
8
+ onItemEnterPress: () => void;
8
9
  };
9
10
  export default class DriveSummary extends React.Component<DriveSummaryProps & WithFocusableProps> {
10
11
  static contextTypes: {
@@ -4,6 +4,7 @@ import { GameLeadersStatsItem } from '../../view-model/StatsViewModel';
4
4
  import { Direction, Layout } from '@/external/spatial-navigation/utils';
5
5
  export type GameLeaderProps = {
6
6
  item: GameLeadersStatsItem;
7
+ onEnterPress: () => void;
7
8
  };
8
9
  declare class GameLeaders extends React.Component<GameLeaderProps> {
9
10
  static contextTypes: {
@@ -3,6 +3,7 @@ import { StatsItem } from '../view-model/StatsViewModel';
3
3
  import { Direction, Layout } from '@/external/spatial-navigation/utils';
4
4
  type Props = {
5
5
  item: StatsItem;
6
+ onEnterPress: (item: StatsItem) => void;
6
7
  };
7
8
  declare class StatsItemView extends React.Component<Props> {
8
9
  static contextTypes: {
@@ -13,6 +14,7 @@ declare class StatsItemView extends React.Component<Props> {
13
14
  context: import("@/components/core/ScrollableContainer/ScrollableContainer").ScrollableContainerContextType;
14
15
  onBecameFocused: (layout: Layout) => void;
15
16
  onArrowPress: (d: Direction) => void;
17
+ onEnterPress: (item: StatsItem) => () => void;
16
18
  renderItem(): React.JSX.Element | null;
17
19
  render(): React.JSX.Element;
18
20
  }
@@ -15,6 +15,7 @@ declare class StatsView extends Component<{}, StatsViewState> {
15
15
  componentDidMount(): void;
16
16
  componentWillUnmount(): void;
17
17
  renderItems: () => React.JSX.Element[] | null;
18
+ onEnterPress: (item: StatsItem) => void;
18
19
  render(): React.JSX.Element;
19
20
  }
20
21
  export default StatsView;
@@ -4,6 +4,7 @@ import { DrivePlay, Team } from '../interfaces/IStats';
4
4
  import { AthletesStatisticsItem } from '../view/components/AthletesStatistics/AthletesStatistics';
5
5
  import StatsService from '@/services/StatsService';
6
6
  import IMaestroEventDelegate from '@/interfaces/IMaestroEventDelegate';
7
+ import AnalyticsService from '@/services/AnalyticsService/AnalyticsService';
7
8
  declare const STATS_ERROR_STATE: {
8
9
  readonly NONE: "none";
9
10
  readonly TAB_LOAD_FAILURE: "tabLoadFailure";
@@ -28,11 +29,11 @@ export type HeaderTeamStatItem = {
28
29
  type RecentGamesPreviousGame = {
29
30
  score: string;
30
31
  gameResult: string;
31
- teamLogo: string;
32
+ teamLogo?: string;
32
33
  homeAway: string;
33
34
  };
34
35
  type RecentGamesTeam = {
35
- logo: string;
36
+ logo?: string;
36
37
  name?: string;
37
38
  events: RecentGamesPreviousGame[];
38
39
  };
@@ -110,7 +111,9 @@ export declare class StatsViewModel extends ViewModel {
110
111
  eventId: string;
111
112
  statsItems: Observable<StatsItem[]>;
112
113
  errorState: Observable<BetsErrorState>;
114
+ currentGameState: Observable<string>;
113
115
  statsService: StatsService;
116
+ analyticsService: AnalyticsService;
114
117
  private pollingInterval;
115
118
  private useMockData;
116
119
  private pollingTask;
@@ -123,6 +126,7 @@ export declare class StatsViewModel extends ViewModel {
123
126
  * Initialize the ViewModel and start data fetching
124
127
  */
125
128
  init(): Promise<void>;
129
+ onEngage: (type: StatsItem['type']) => void;
126
130
  /**
127
131
  * Clean up resources when the ViewModel is no longer needed
128
132
  */
@@ -0,0 +1,65 @@
1
+ import InsightsPayloadBuilder from '../InsightsService/InsightsPayloadBuilder';
2
+ import InsightsService from '../InsightsService/InsightsService';
3
+ import { Metadata } from './types';
4
+ type KeyPlaysClickedAction = {
5
+ panel_id: string;
6
+ panel_name: string;
7
+ panel_type: string;
8
+ name: 'key_play_clicked';
9
+ metadata: {
10
+ league: string;
11
+ event: string;
12
+ airing: string;
13
+ sport: string;
14
+ action: string;
15
+ clip: string;
16
+ key_play: string;
17
+ };
18
+ };
19
+ type BetsItemClickedAction = {
20
+ panel_id: string;
21
+ panel_name: string;
22
+ panel_type: string;
23
+ name: 'bets_item_clicked';
24
+ metadata: {
25
+ league: string;
26
+ event: string;
27
+ airing: string;
28
+ sport: string;
29
+ card: string;
30
+ bet_type: string | null;
31
+ in_game_bets: number;
32
+ total_bets: number;
33
+ };
34
+ };
35
+ type StatsItemClickedAction = {
36
+ panel_id: string;
37
+ panel_name: string;
38
+ panel_type: string;
39
+ name: 'stats_item_clicked';
40
+ metadata: {
41
+ league: string;
42
+ event: string;
43
+ airing: string;
44
+ sport: string;
45
+ card: string[];
46
+ game_state: string[];
47
+ };
48
+ };
49
+ type PanelClickPayload = KeyPlaysClickedAction | BetsItemClickedAction | StatsItemClickedAction;
50
+ type PanelViewPayload = {
51
+ panel_type: string;
52
+ panel_id: string;
53
+ panel_name: string;
54
+ metadata: Metadata;
55
+ };
56
+ declare class AnalyticsService {
57
+ insightsService: InsightsService;
58
+ insightsPayloadBuilder: InsightsPayloadBuilder;
59
+ constructor();
60
+ private trackAction;
61
+ private trackImpression;
62
+ panelView({ panel_type, panel_id, panel_name, metadata, }: PanelViewPayload): Promise<void>;
63
+ panelClick({ panel_type, panel_id, panel_name, metadata, name, }: PanelClickPayload): Promise<void>;
64
+ }
65
+ export default AnalyticsService;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Generic metadata type that accepts any object extending BaseMetadata
3
+ */
4
+ export type Metadata = BaseMetadata & {
5
+ [key: string]: any;
6
+ };
7
+ export type Kingdom = 'panel';
8
+ export type Phylum = 'view' | 'engage';
9
+ /**
10
+ * Base metadata analytics events should include
11
+ */
12
+ export interface BaseMetadata {
13
+ league: string;
14
+ event: string;
15
+ airing: string;
16
+ sport: string;
17
+ }
18
+ export type PanelViewAction = {
19
+ name: 'panel_selected';
20
+ e0_kingdom: Kingdom;
21
+ e1_phylum: Phylum;
22
+ /**
23
+ * Panel Type
24
+ */
25
+ e2_class: string;
26
+ /**
27
+ * Panel ID
28
+ */
29
+ e3_order: string;
30
+ /**
31
+ * Panel Name
32
+ */
33
+ e4_family: string;
34
+ e5_genus?: string;
35
+ e6_species?: string;
36
+ /**
37
+ * Additional metadata for the panel view action.
38
+ */
39
+ metadata: Metadata;
40
+ };
41
+ export type ImpressionTrackEvent = PanelViewAction;
42
+ export type PanelClickAction = {
43
+ name: string;
44
+ e0_kingdom: 'panel';
45
+ e1_phylum: 'engage';
46
+ /**
47
+ * Panel Type
48
+ */
49
+ e2_class: string;
50
+ /**
51
+ * Panel ID.
52
+ */
53
+ e3_order: string;
54
+ /**
55
+ * Panel Name
56
+ */
57
+ e4_family: string;
58
+ e5_genus?: string;
59
+ e6_species?: string;
60
+ /**
61
+ * Additional metadata for the panel click action.
62
+ */
63
+ metadata: Metadata;
64
+ };
65
+ export type ActionTrackEvent = PanelClickAction;
@@ -1,11 +1,11 @@
1
- import NetworkManager from './NetworkManager/NetworkManager';
1
+ import { IBetsNetworkManager } from './NetworkManager/types';
2
2
  import { IBetsResponse, IPersonalizedBetsResponse } from '../modules/bets/interfaces/IBets';
3
3
  import IMaestroEventDelegate from '@/interfaces/IMaestroEventDelegate';
4
4
  /**
5
5
  * Service for handling bets-related API calls
6
6
  */
7
7
  declare class BetsService {
8
- networkManager: NetworkManager;
8
+ networkManager: IBetsNetworkManager;
9
9
  constructor(delegate: IMaestroEventDelegate);
10
10
  /**
11
11
  * Get non-personalized bets for an event