@maestro_io/maestro-web-sdk 4.0.0 → 4.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/maestro-web-sdk.esm.js +2 -2
- package/dist/maestro-web-sdk.esm.js.map +1 -1
- package/dist/maestro-web-sdk.umd.js +2 -2
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/package.json +92 -0
- package/dist/src/components/atoms/BaseButton/BaseButton.d.ts +7 -0
- package/dist/src/components/atoms/BaseButton/BaseButton.js +11 -0
- package/dist/src/components/atoms/BaseButton/index.d.ts +2 -0
- package/dist/src/components/atoms/BaseButton/index.js +2 -0
- package/dist/src/components/atoms/Image/index.d.ts +13 -0
- package/dist/src/components/atoms/Image/index.js +34 -0
- package/dist/src/components/atoms/Rive/index.d.ts +219 -0
- package/dist/src/components/atoms/Rive/index.js +53 -0
- package/dist/src/components/atoms/SvgIcon/BetGeneralIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/BetGeneralIcon.js +9 -0
- package/dist/src/components/atoms/SvgIcon/BetsIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/BetsIcon.js +8 -0
- package/dist/src/components/atoms/SvgIcon/BetsWarningIcon.d.ts +7 -0
- package/dist/src/components/atoms/SvgIcon/BetsWarningIcon.js +11 -0
- package/dist/src/components/atoms/SvgIcon/ChatIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/ChatIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/CheckmarkIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/CheckmarkIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/CollapseIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/CollapseIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/ExpandIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/ExpandIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/FantasyIcon.d.ts +7 -0
- package/dist/src/components/atoms/SvgIcon/FantasyIcon.js +15 -0
- package/dist/src/components/atoms/SvgIcon/FlameIcon.d.ts +7 -0
- package/dist/src/components/atoms/SvgIcon/FlameIcon.js +11 -0
- package/dist/src/components/atoms/SvgIcon/HelloWorldIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/HelloWorldIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/Icon.d.ts +39 -0
- package/dist/src/components/atoms/SvgIcon/Icon.js +44 -0
- package/dist/src/components/atoms/SvgIcon/KeyPlaysIcon.d.ts +6 -0
- package/dist/src/components/atoms/SvgIcon/KeyPlaysIcon.js +10 -0
- package/dist/src/components/atoms/SvgIcon/MobilePhoneIcon.d.ts +7 -0
- package/dist/src/components/atoms/SvgIcon/MobilePhoneIcon.js +11 -0
- package/dist/src/components/atoms/SvgIcon/PlayIcon.d.ts +6 -0
- package/dist/src/components/atoms/SvgIcon/PlayIcon.js +8 -0
- package/dist/src/components/atoms/SvgIcon/ShopIcon.d.ts +5 -0
- package/dist/src/components/atoms/SvgIcon/ShopIcon.js +7 -0
- package/dist/src/components/atoms/SvgIcon/ShopifyIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/ShopifyIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/StatsIcon.d.ts +6 -0
- package/dist/src/components/atoms/SvgIcon/StatsIcon.js +12 -0
- package/dist/src/components/atoms/SvgIcon/TimesIcon.d.ts +3 -0
- package/dist/src/components/atoms/SvgIcon/TimesIcon.js +6 -0
- package/dist/src/components/atoms/SvgIcon/WarningIcon.d.ts +6 -0
- package/dist/src/components/atoms/SvgIcon/WarningIcon.js +8 -0
- package/dist/src/components/atoms/SvgIcon/index.d.ts +2 -0
- package/dist/src/components/atoms/SvgIcon/index.js +2 -0
- package/dist/src/components/core/App/App.d.ts +11 -0
- package/dist/src/components/core/App/App.js +35 -0
- package/dist/src/components/core/App/index.d.ts +2 -0
- package/dist/src/components/core/App/index.js +2 -0
- package/dist/src/components/core/PanelManager/PanelManager.d.ts +21 -0
- package/dist/src/components/core/PanelManager/PanelManager.js +86 -0
- package/dist/src/components/core/PanelManager/index.d.ts +2 -0
- package/dist/src/components/core/PanelManager/index.js +2 -0
- package/dist/src/components/core/ScrollableContainer/FocusableItem.d.ts +6 -0
- package/dist/src/components/core/ScrollableContainer/FocusableItem.js +38 -0
- package/dist/src/components/core/ScrollableContainer/ScrollableContainer.d.ts +78 -0
- package/dist/src/components/core/ScrollableContainer/ScrollableContainer.js +169 -0
- package/dist/src/components/core/ScrollableContainer/index.d.ts +2 -0
- package/dist/src/components/core/ScrollableContainer/index.js +2 -0
- package/dist/src/components/molecules/ActionButton/ActionButton.d.ts +94 -0
- package/dist/src/components/molecules/ActionButton/ActionButton.js +10 -0
- package/dist/src/components/molecules/ActionButton/index.d.ts +2 -0
- package/dist/src/components/molecules/ActionButton/index.js +2 -0
- package/dist/src/components/molecules/HeadshotImage/HeadshotImage.d.ts +16 -0
- package/dist/src/components/molecules/HeadshotImage/HeadshotImage.js +50 -0
- package/dist/src/components/molecules/HeadshotImage/index.d.ts +2 -0
- package/dist/src/components/molecules/HeadshotImage/index.js +2 -0
- package/dist/src/components/molecules/Overlay/Overlay.d.ts +34 -0
- package/dist/src/components/molecules/Overlay/Overlay.js +139 -0
- package/dist/src/components/molecules/Overlay/index.d.ts +2 -0
- package/dist/src/components/molecules/Overlay/index.js +2 -0
- package/dist/src/components/molecules/PanelNavButton/PanelNavButton.d.ts +104 -0
- package/dist/src/components/molecules/PanelNavButton/PanelNavButton.js +27 -0
- package/dist/src/components/molecules/PanelNavButton/index.d.ts +2 -0
- package/dist/src/components/molecules/PanelNavButton/index.js +2 -0
- package/dist/src/components/molecules/SegmentButton/SegmentButton.d.ts +9 -0
- package/dist/src/components/molecules/SegmentButton/SegmentButton.js +10 -0
- package/dist/src/components/molecules/SegmentButton/index.d.ts +2 -0
- package/dist/src/components/molecules/SegmentButton/index.js +2 -0
- package/dist/src/components/molecules/TabLoadError/TabLoadError.d.ts +94 -0
- package/dist/src/components/molecules/TabLoadError/TabLoadError.js +14 -0
- package/dist/src/components/molecules/TabLoadError/index.d.ts +2 -0
- package/dist/src/components/molecules/TabLoadError/index.js +2 -0
- package/dist/src/components/molecules/WatchButton/WatchButton.d.ts +10 -0
- package/dist/src/components/molecules/WatchButton/WatchButton.js +15 -0
- package/dist/src/components/molecules/WatchButton/index.d.ts +2 -0
- package/dist/src/components/molecules/WatchButton/index.js +2 -0
- package/dist/src/components/organisms/PanelNavigation/PanelNavigation.d.ts +16 -0
- package/dist/src/components/organisms/PanelNavigation/PanelNavigation.js +60 -0
- package/dist/src/components/organisms/PanelNavigation/index.d.ts +2 -0
- package/dist/src/components/organisms/PanelNavigation/index.js +2 -0
- package/dist/src/components/organisms/SegmentController/SegmentController.d.ts +30 -0
- package/dist/src/components/organisms/SegmentController/SegmentController.js +76 -0
- package/dist/src/components/organisms/SegmentController/index.d.ts +3 -0
- package/dist/src/components/organisms/SegmentController/index.js +2 -0
- package/dist/src/development/MaestroEventDelegate.d.ts +27 -0
- package/dist/src/development/MaestroEventDelegate.js +109 -0
- package/dist/src/development/TimeSeek.d.ts +22 -0
- package/dist/src/development/TimeSeek.js +218 -0
- package/dist/src/development/development.d.ts +1 -0
- package/dist/src/development/development.js +36 -0
- package/dist/src/external/AxiosNetworkClient.d.ts +28 -0
- package/dist/src/external/AxiosNetworkClient.js +110 -0
- package/dist/src/external/LocalStorageCacheManager.d.ts +65 -0
- package/dist/src/external/LocalStorageCacheManager.js +213 -0
- package/dist/src/external/ReactRenderer.d.ts +17 -0
- package/dist/src/external/ReactRenderer.js +65 -0
- package/dist/src/external/mocks/MockExternalNetworkClient.d.ts +104 -0
- package/dist/src/external/mocks/MockExternalNetworkClient.js +187 -0
- package/dist/src/external/ports/cacheManager.d.ts +17 -0
- package/dist/src/external/ports/cacheManager.js +1 -0
- package/dist/src/external/ports/networkClient.d.ts +19 -0
- package/dist/src/external/ports/networkClient.js +1 -0
- package/dist/src/external/ports/renderer.d.ts +4 -0
- package/dist/src/external/ports/renderer.js +1 -0
- package/dist/src/external/spatial-navigation/__mocks__/withFocusable.d.ts +8 -0
- package/dist/src/external/spatial-navigation/__mocks__/withFocusable.js +7 -0
- package/dist/src/external/spatial-navigation/index.d.ts +4 -0
- package/dist/src/external/spatial-navigation/index.js +3 -0
- package/dist/src/external/spatial-navigation/measureLayout.d.ts +2 -0
- package/dist/src/external/spatial-navigation/measureLayout.js +30 -0
- package/dist/src/external/spatial-navigation/spatialNavigation.d.ts +155 -0
- package/dist/src/external/spatial-navigation/spatialNavigation.js +876 -0
- package/dist/src/external/spatial-navigation/utils.d.ts +20 -0
- package/dist/src/external/spatial-navigation/utils.js +6 -0
- package/dist/src/external/spatial-navigation/visualDebugger.d.ts +17 -0
- package/dist/src/external/spatial-navigation/visualDebugger.js +76 -0
- package/dist/src/external/spatial-navigation/withFocusable.d.ts +123 -0
- package/dist/src/external/spatial-navigation/withFocusable.js +245 -0
- package/dist/src/helpers/Observable.d.ts +12 -0
- package/dist/src/helpers/Observable.js +37 -0
- package/dist/src/helpers/strings.d.ts +2 -0
- package/dist/src/helpers/strings.js +14 -0
- package/dist/src/helpers/url.d.ts +1 -0
- package/dist/src/helpers/url.js +12 -0
- package/dist/src/index.d.ts +54 -0
- package/dist/src/index.js +165 -0
- package/dist/src/interfaces/IMaestroEvent.d.ts +126 -0
- package/dist/src/interfaces/IMaestroEvent.js +18 -0
- package/dist/src/interfaces/IMaestroEventDelegate.d.ts +74 -0
- package/dist/src/interfaces/IMaestroEventDelegate.js +1 -0
- package/dist/src/interfaces/IMaestroManager.d.ts +45 -0
- package/dist/src/interfaces/IMaestroManager.js +1 -0
- package/dist/src/interfaces/IUserSettings.d.ts +44 -0
- package/dist/src/interfaces/IUserSettings.js +20 -0
- package/dist/src/models/IModel.d.ts +7 -0
- package/dist/src/models/IModel.js +1 -0
- package/dist/src/models/IPanel.d.ts +15 -0
- package/dist/src/models/IPanel.js +40 -0
- package/dist/src/models/ITheme.d.ts +77 -0
- package/dist/src/models/ITheme.js +20 -0
- package/dist/src/models/IWinningBet.d.ts +7 -0
- package/dist/src/models/IWinningBet.js +1 -0
- package/dist/src/modules/bets/interfaces/IBets.d.ts +192 -0
- package/dist/src/modules/bets/interfaces/IBets.js +1 -0
- package/dist/src/modules/bets/mocks.d.ts +2 -0
- package/dist/src/modules/bets/mocks.js +573 -0
- package/dist/src/modules/bets/types/BetsAnalyticsTypes.d.ts +8 -0
- package/dist/src/modules/bets/types/BetsAnalyticsTypes.js +1 -0
- package/dist/src/modules/bets/view/BetsView.d.ts +28 -0
- package/dist/src/modules/bets/view/BetsView.js +143 -0
- package/dist/src/modules/bets/view/HotProps/HotPropsView.d.ts +100 -0
- package/dist/src/modules/bets/view/HotProps/HotPropsView.js +150 -0
- package/dist/src/modules/bets/view/SixPack/SixPackView.d.ts +23 -0
- package/dist/src/modules/bets/view/SixPack/SixPackView.js +110 -0
- package/dist/src/modules/bets/view/UserBets/BetResult/BetResult.d.ts +6 -0
- package/dist/src/modules/bets/view/UserBets/BetResult/BetResult.js +6 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCard.d.ts +101 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCard.js +149 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardEvent.d.ts +26 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardEvent.js +34 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardFooter.d.ts +7 -0
- package/dist/src/modules/bets/view/UserBets/BetsCard/BetsCardFooter.js +18 -0
- package/dist/src/modules/bets/view/UserBets/Boost/Boost.d.ts +7 -0
- package/dist/src/modules/bets/view/UserBets/Boost/Boost.js +6 -0
- package/dist/src/modules/bets/view/UserBets/OutcomeBadge/OutcomeBadge.d.ts +6 -0
- package/dist/src/modules/bets/view/UserBets/OutcomeBadge/OutcomeBadge.js +9 -0
- package/dist/src/modules/bets/view/UserBets/Parlay/Parlay.d.ts +8 -0
- package/dist/src/modules/bets/view/UserBets/Parlay/Parlay.js +13 -0
- package/dist/src/modules/bets/view/UserBets/Straight/Straight.d.ts +7 -0
- package/dist/src/modules/bets/view/UserBets/Straight/Straight.js +6 -0
- package/dist/src/modules/bets/view/UserBets/Teaser/Teaser.d.ts +7 -0
- package/dist/src/modules/bets/view/UserBets/Teaser/Teaser.js +13 -0
- package/dist/src/modules/bets/view/UserBets/UserBetsView.d.ts +25 -0
- package/dist/src/modules/bets/view/UserBets/UserBetsView.js +107 -0
- package/dist/src/modules/bets/view/components/Bet/Bet.d.ts +158 -0
- package/dist/src/modules/bets/view/components/Bet/Bet.js +32 -0
- package/dist/src/modules/bets/view/components/BetPill/BetPill.d.ts +6 -0
- package/dist/src/modules/bets/view/components/BetPill/BetPill.js +6 -0
- package/dist/src/modules/bets/view/components/BetsCard/BetsCard.d.ts +10 -0
- package/dist/src/modules/bets/view/components/BetsCard/BetsCard.js +15 -0
- package/dist/src/modules/bets/view/components/BetsCard/BetsCardHeader.d.ts +16 -0
- package/dist/src/modules/bets/view/components/BetsCard/BetsCardHeader.js +20 -0
- package/dist/src/modules/bets/view/components/GamblingDisclaimer/GamblingDisclaimer.d.ts +8 -0
- package/dist/src/modules/bets/view/components/GamblingDisclaimer/GamblingDisclaimer.js +14 -0
- package/dist/src/modules/bets/view/components/LocationWarning/LocationWarning.d.ts +10 -0
- package/dist/src/modules/bets/view/components/LocationWarning/LocationWarning.js +16 -0
- package/dist/src/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +18 -0
- package/dist/src/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.js +78 -0
- package/dist/src/modules/bets/view/components/PromoCodeBanner/index.d.ts +1 -0
- package/dist/src/modules/bets/view/components/PromoCodeBanner/index.js +1 -0
- package/dist/src/modules/bets/view-model/BetsViewModel.d.ts +219 -0
- package/dist/src/modules/bets/view-model/BetsViewModel.js +974 -0
- package/dist/src/modules/fantasy/components/ExpandedAthleteList/ExpandedAthletesList.d.ts +28 -0
- package/dist/src/modules/fantasy/components/ExpandedAthleteList/ExpandedAthletesList.js +107 -0
- package/dist/src/modules/fantasy/components/ExpandedAthleteList/index.d.ts +1 -0
- package/dist/src/modules/fantasy/components/ExpandedAthleteList/index.js +1 -0
- package/dist/src/modules/fantasy/components/LeagueCard/LeagueCard.d.ts +102 -0
- package/dist/src/modules/fantasy/components/LeagueCard/LeagueCard.js +20 -0
- package/dist/src/modules/fantasy/components/LeagueCard/index.d.ts +2 -0
- package/dist/src/modules/fantasy/components/LeagueCard/index.js +2 -0
- package/dist/src/modules/fantasy/components/TopPlayerCard/TopPlayerCard.d.ts +99 -0
- package/dist/src/modules/fantasy/components/TopPlayerCard/TopPlayerCard.js +29 -0
- package/dist/src/modules/fantasy/components/TopPlayerCard/index.d.ts +2 -0
- package/dist/src/modules/fantasy/components/TopPlayerCard/index.js +2 -0
- package/dist/src/modules/fantasy/mocks.d.ts +7620 -0
- package/dist/src/modules/fantasy/mocks.js +3682 -0
- package/dist/src/modules/fantasy/types.d.ts +176 -0
- package/dist/src/modules/fantasy/types.js +6 -0
- package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/ActiveAthletesMarquee.d.ts +21 -0
- package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/ActiveAthletesMarquee.js +74 -0
- package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/ActiveAthletesMarquee/index.js +2 -0
- package/dist/src/modules/fantasy/view/FantasyItemView.d.ts +22 -0
- package/dist/src/modules/fantasy/view/FantasyItemView.js +74 -0
- package/dist/src/modules/fantasy/view/FantasyView.d.ts +27 -0
- package/dist/src/modules/fantasy/view/FantasyView.js +133 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/DraftDateCountdown.d.ts +23 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/DraftDateCountdown.js +95 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/InactiveLeague.d.ts +98 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/InactiveLeague.js +13 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/InactiveLeague/index.js +2 -0
- package/dist/src/modules/fantasy/view/LoginView/LoginView.d.ts +94 -0
- package/dist/src/modules/fantasy/view/LoginView/LoginView.js +27 -0
- package/dist/src/modules/fantasy/view/LoginView/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/LoginView/index.js +2 -0
- package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/DoubleAthleteCard.d.ts +95 -0
- package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/DoubleAthleteCard.js +25 -0
- package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/MatchupPair/DoubleAthleteCard/index.js +2 -0
- package/dist/src/modules/fantasy/view/MatchupPair/ExpandedDoubleAthleteCards.d.ts +14 -0
- package/dist/src/modules/fantasy/view/MatchupPair/ExpandedDoubleAthleteCards.js +9 -0
- package/dist/src/modules/fantasy/view/MatchupPair/MatchupPair.d.ts +100 -0
- package/dist/src/modules/fantasy/view/MatchupPair/MatchupPair.js +118 -0
- package/dist/src/modules/fantasy/view/MatchupPair/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/MatchupPair/index.js +2 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/ExpandedSingleAthleteCards.d.ts +14 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/ExpandedSingleAthleteCards.js +9 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/MatchupSingle.d.ts +100 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/MatchupSingle.js +108 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/SingleAthleteCard.d.ts +95 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/SingleAthleteCard.js +18 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/SingleAthleteCard/index.js +2 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/MatchupSingle/index.js +2 -0
- package/dist/src/modules/fantasy/view/PromoView/PromoView.d.ts +98 -0
- package/dist/src/modules/fantasy/view/PromoView/PromoView.js +12 -0
- package/dist/src/modules/fantasy/view/PromoView/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/PromoView/index.js +2 -0
- package/dist/src/modules/fantasy/view/index.d.ts +2 -0
- package/dist/src/modules/fantasy/view/index.js +2 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.FantasyPolling.d.ts +32 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.FantasyPolling.js +132 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.LeagueManagerPolling.d.ts +32 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.LeagueManagerPolling.js +141 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.d.ts +148 -0
- package/dist/src/modules/fantasy/view-model/FantasyViewModel.js +534 -0
- package/dist/src/modules/hello-world/HelloWorldImage.d.ts +2 -0
- package/dist/src/modules/hello-world/HelloWorldImage.js +32 -0
- package/dist/src/modules/hello-world/HelloWorldView.d.ts +11 -0
- package/dist/src/modules/hello-world/HelloWorldView.js +34 -0
- package/dist/src/modules/hello-world/index.d.ts +2 -0
- package/dist/src/modules/hello-world/index.js +2 -0
- package/dist/src/modules/key-plays/constants.d.ts +3 -0
- package/dist/src/modules/key-plays/constants.js +292 -0
- package/dist/src/modules/key-plays/interfaces/IKeyPlays.d.ts +32 -0
- package/dist/src/modules/key-plays/interfaces/IKeyPlays.js +14 -0
- package/dist/src/modules/key-plays/interfaces/IKeyPlaysResponse.d.ts +44 -0
- package/dist/src/modules/key-plays/interfaces/IKeyPlaysResponse.js +1 -0
- package/dist/src/modules/key-plays/view/KeyPlayCardScoreTagView.d.ts +9 -0
- package/dist/src/modules/key-plays/view/KeyPlayCardScoreTagView.js +16 -0
- package/dist/src/modules/key-plays/view/KeyPlayCardView.d.ts +39 -0
- package/dist/src/modules/key-plays/view/KeyPlayCardView.js +139 -0
- package/dist/src/modules/key-plays/view/KeyPlayErrorStateView.d.ts +13 -0
- package/dist/src/modules/key-plays/view/KeyPlayErrorStateView.js +65 -0
- package/dist/src/modules/key-plays/view/KeyPlaysView.d.ts +37 -0
- package/dist/src/modules/key-plays/view/KeyPlaysView.js +151 -0
- package/dist/src/modules/key-plays/view-model/KeyPlaysViewModel.d.ts +37 -0
- package/dist/src/modules/key-plays/view-model/KeyPlaysViewModel.js +246 -0
- package/dist/src/modules/shop/mocks.d.ts +22 -0
- package/dist/src/modules/shop/mocks.js +391 -0
- package/dist/src/modules/shop/types.d.ts +161 -0
- package/dist/src/modules/shop/types.js +7 -0
- package/dist/src/modules/shop/view/ProductDetailView/ProductDetailView.d.ts +9 -0
- package/dist/src/modules/shop/view/ProductDetailView/ProductDetailView.js +60 -0
- package/dist/src/modules/shop/view/ProductDetailView/index.d.ts +2 -0
- package/dist/src/modules/shop/view/ProductDetailView/index.js +2 -0
- package/dist/src/modules/shop/view/ShopView.d.ts +35 -0
- package/dist/src/modules/shop/view/ShopView.js +182 -0
- package/dist/src/modules/shop/view/components/BrowseCard/BrowseCard.d.ts +101 -0
- package/dist/src/modules/shop/view/components/BrowseCard/BrowseCard.js +23 -0
- package/dist/src/modules/shop/view/components/BrowseCard/index.d.ts +2 -0
- package/dist/src/modules/shop/view/components/BrowseCard/index.js +2 -0
- package/dist/src/modules/shop/view/components/ProductSummaryCard/ProductSummaryCard.d.ts +102 -0
- package/dist/src/modules/shop/view/components/ProductSummaryCard/ProductSummaryCard.js +26 -0
- package/dist/src/modules/shop/view/components/ProductSummaryCard/index.d.ts +2 -0
- package/dist/src/modules/shop/view/components/ProductSummaryCard/index.js +1 -0
- package/dist/src/modules/shop/view/components/ShopPromoView/ShopPromoView.d.ts +8 -0
- package/dist/src/modules/shop/view/components/ShopPromoView/ShopPromoView.js +19 -0
- package/dist/src/modules/shop/view/components/ShopPromoView/index.d.ts +1 -0
- package/dist/src/modules/shop/view/components/ShopPromoView/index.js +1 -0
- package/dist/src/modules/shop/view/components/ShopSection/ShopSection.d.ts +23 -0
- package/dist/src/modules/shop/view/components/ShopSection/ShopSection.js +61 -0
- package/dist/src/modules/shop/view/components/ShopSection/index.d.ts +1 -0
- package/dist/src/modules/shop/view/components/ShopSection/index.js +1 -0
- package/dist/src/modules/shop/view/index.d.ts +2 -0
- package/dist/src/modules/shop/view/index.js +2 -0
- package/dist/src/modules/shop/view-model/ShopViewModel.ShopPolling.d.ts +31 -0
- package/dist/src/modules/shop/view-model/ShopViewModel.ShopPolling.js +111 -0
- package/dist/src/modules/shop/view-model/ShopViewModel.d.ts +77 -0
- package/dist/src/modules/shop/view-model/ShopViewModel.js +357 -0
- package/dist/src/modules/stats/interfaces/IStats.d.ts +226 -0
- package/dist/src/modules/stats/interfaces/IStats.js +1 -0
- package/dist/src/modules/stats/mocks.d.ts +2 -0
- package/dist/src/modules/stats/mocks.js +746 -0
- package/dist/src/modules/stats/utils/driveSummaryUtils.d.ts +18 -0
- package/dist/src/modules/stats/utils/driveSummaryUtils.js +48 -0
- package/dist/src/modules/stats/utils/renderTeamStatistic.d.ts +20 -0
- package/dist/src/modules/stats/utils/renderTeamStatistic.js +16 -0
- package/dist/src/modules/stats/utils.d.ts +39 -0
- package/dist/src/modules/stats/utils.js +62 -0
- package/dist/src/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +22 -0
- package/dist/src/modules/stats/view/ActiveAthletes/ActiveAthletes.js +98 -0
- package/dist/src/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.d.ts +4 -0
- package/dist/src/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.js +27 -0
- package/dist/src/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.d.ts +22 -0
- package/dist/src/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.js +89 -0
- package/dist/src/modules/stats/view/ActiveAthletes/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ActiveAthletes/index.js +2 -0
- package/dist/src/modules/stats/view/DriveSummary/DrivePlayCard.d.ts +106 -0
- package/dist/src/modules/stats/view/DriveSummary/DrivePlayCard.js +70 -0
- package/dist/src/modules/stats/view/DriveSummary/DriveSummary.d.ts +17 -0
- package/dist/src/modules/stats/view/DriveSummary/DriveSummary.js +87 -0
- package/dist/src/modules/stats/view/DriveSummary/ExpandedItems/DriveSummaryExpanded.d.ts +27 -0
- package/dist/src/modules/stats/view/DriveSummary/ExpandedItems/DriveSummaryExpanded.js +129 -0
- package/dist/src/modules/stats/view/DriveSummary/Header/DriveSummaryHeader.d.ts +12 -0
- package/dist/src/modules/stats/view/DriveSummary/Header/DriveSummaryHeader.js +26 -0
- package/dist/src/modules/stats/view/DriveSummary/MainStat/MainStat.d.ts +10 -0
- package/dist/src/modules/stats/view/DriveSummary/MainStat/MainStat.js +24 -0
- package/dist/src/modules/stats/view/DriveSummary/index.d.ts +2 -0
- package/dist/src/modules/stats/view/DriveSummary/index.js +2 -0
- package/dist/src/modules/stats/view/GameLeaders/GameLeaders.d.ts +21 -0
- package/dist/src/modules/stats/view/GameLeaders/GameLeaders.js +48 -0
- package/dist/src/modules/stats/view/GameLeaders/index.d.ts +2 -0
- package/dist/src/modules/stats/view/GameLeaders/index.js +2 -0
- package/dist/src/modules/stats/view/MatchPredictor/DonutChart/DonutChart.d.ts +17 -0
- package/dist/src/modules/stats/view/MatchPredictor/DonutChart/DonutChart.js +55 -0
- package/dist/src/modules/stats/view/MatchPredictor/DonutChart/index.d.ts +2 -0
- package/dist/src/modules/stats/view/MatchPredictor/DonutChart/index.js +1 -0
- package/dist/src/modules/stats/view/MatchPredictor/MatchPredictorView.d.ts +98 -0
- package/dist/src/modules/stats/view/MatchPredictor/MatchPredictorView.js +60 -0
- package/dist/src/modules/stats/view/MatchPredictor/index.d.ts +3 -0
- package/dist/src/modules/stats/view/MatchPredictor/index.js +2 -0
- package/dist/src/modules/stats/view/Penalties/Penalties.d.ts +9 -0
- package/dist/src/modules/stats/view/Penalties/Penalties.js +6 -0
- package/dist/src/modules/stats/view/Penalties/index.d.ts +2 -0
- package/dist/src/modules/stats/view/Penalties/index.js +2 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/ExpandedPlayerStats.d.ts +16 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/ExpandedPlayerStats.js +66 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsCard.d.ts +97 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsCard.js +23 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsMinified.d.ts +6 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsMinified.js +13 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsView.d.ts +8 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/PlayerSeasonStatsView.js +148 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/index.d.ts +1 -0
- package/dist/src/modules/stats/view/PlayerSeasonStats/index.js +1 -0
- package/dist/src/modules/stats/view/RecentGames/RecentGames.d.ts +98 -0
- package/dist/src/modules/stats/view/RecentGames/RecentGames.js +23 -0
- package/dist/src/modules/stats/view/RecentGames/index.d.ts +2 -0
- package/dist/src/modules/stats/view/RecentGames/index.js +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/ExpandedScores.d.ts +30 -0
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/ExpandedScores.js +123 -0
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ExpandedScores/index.js +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/ScoreItem.d.ts +98 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/ScoreItem.js +62 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoreItem/index.js +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/ScoresSection.d.ts +6 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/ScoresSection.js +23 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoresSection/index.js +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoringSummary.d.ts +29 -0
- package/dist/src/modules/stats/view/ScoringSummary/ScoringSummary.js +125 -0
- package/dist/src/modules/stats/view/ScoringSummary/index.d.ts +2 -0
- package/dist/src/modules/stats/view/ScoringSummary/index.js +2 -0
- package/dist/src/modules/stats/view/StatsItemView.d.ts +22 -0
- package/dist/src/modules/stats/view/StatsItemView.js +92 -0
- package/dist/src/modules/stats/view/StatsQRCode/StatsQRCodeView.d.ts +98 -0
- package/dist/src/modules/stats/view/StatsQRCode/StatsQRCodeView.js +36 -0
- package/dist/src/modules/stats/view/StatsQRCode/index.d.ts +2 -0
- package/dist/src/modules/stats/view/StatsQRCode/index.js +1 -0
- package/dist/src/modules/stats/view/StatsView.d.ts +27 -0
- package/dist/src/modules/stats/view/StatsView.js +137 -0
- package/dist/src/modules/stats/view/TeamStats/TeamStatsView.d.ts +98 -0
- package/dist/src/modules/stats/view/TeamStats/TeamStatsView.js +43 -0
- package/dist/src/modules/stats/view/TeamStats/index.d.ts +2 -0
- package/dist/src/modules/stats/view/TeamStats/index.js +1 -0
- package/dist/src/modules/stats/view/Teams/StatsCarousel.d.ts +25 -0
- package/dist/src/modules/stats/view/Teams/StatsCarousel.js +83 -0
- package/dist/src/modules/stats/view/Teams/StatsProgressBar.d.ts +6 -0
- package/dist/src/modules/stats/view/Teams/StatsProgressBar.js +19 -0
- package/dist/src/modules/stats/view/Teams/Teams.d.ts +98 -0
- package/dist/src/modules/stats/view/Teams/Teams.js +43 -0
- package/dist/src/modules/stats/view/Teams/index.d.ts +2 -0
- package/dist/src/modules/stats/view/Teams/index.js +2 -0
- package/dist/src/modules/stats/view/WinProbability/WinProbability.d.ts +98 -0
- package/dist/src/modules/stats/view/WinProbability/WinProbability.js +28 -0
- package/dist/src/modules/stats/view/WinProbability/index.d.ts +2 -0
- package/dist/src/modules/stats/view/WinProbability/index.js +2 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/AthletesStatistics.d.ts +113 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/AthletesStatistics.js +89 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/StatisticTable.d.ts +3 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/StatisticTable.js +12 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/index.d.ts +2 -0
- package/dist/src/modules/stats/view/components/AthletesStatistics/index.js +2 -0
- package/dist/src/modules/stats/view/index.d.ts +2 -0
- package/dist/src/modules/stats/view/index.js +2 -0
- package/dist/src/modules/stats/view-model/StatsViewModel.d.ts +241 -0
- package/dist/src/modules/stats/view-model/StatsViewModel.js +989 -0
- package/dist/src/sentry.d.ts +3 -0
- package/dist/src/sentry.js +31 -0
- package/dist/src/services/AnalyticsService/AnalyticsService.d.ts +84 -0
- package/dist/src/services/AnalyticsService/AnalyticsService.js +404 -0
- package/dist/src/services/AnalyticsService/types.d.ts +65 -0
- package/dist/src/services/AnalyticsService/types.js +1 -0
- package/dist/src/services/BetsService.d.ts +81 -0
- package/dist/src/services/BetsService.js +122 -0
- package/dist/src/services/FantasyService.d.ts +53 -0
- package/dist/src/services/FantasyService.js +92 -0
- package/dist/src/services/InsightsService/InsightsPayloadBuilder.d.ts +279 -0
- package/dist/src/services/InsightsService/InsightsPayloadBuilder.js +386 -0
- package/dist/src/services/InsightsService/InsightsService.d.ts +11 -0
- package/dist/src/services/InsightsService/InsightsService.js +74 -0
- package/dist/src/services/NetworkManager/NetworkManager.d.ts +147 -0
- package/dist/src/services/NetworkManager/NetworkManager.js +457 -0
- package/dist/src/services/NetworkManager/NetworkManagerFactory.d.ts +42 -0
- package/dist/src/services/NetworkManager/NetworkManagerFactory.js +101 -0
- package/dist/src/services/NetworkManager/errors.d.ts +17 -0
- package/dist/src/services/NetworkManager/errors.js +45 -0
- package/dist/src/services/NetworkManager/types.d.ts +103 -0
- package/dist/src/services/NetworkManager/types.js +10 -0
- package/dist/src/services/ShopService.d.ts +23 -0
- package/dist/src/services/ShopService.js +46 -0
- package/dist/src/services/StaticService/StaticService.d.ts +12 -0
- package/dist/src/services/StaticService/StaticService.js +59 -0
- package/dist/src/services/StaticService/index.d.ts +2 -0
- package/dist/src/services/StaticService/index.js +2 -0
- package/dist/src/services/StaticService/mocks.d.ts +2 -0
- package/dist/src/services/StaticService/mocks.js +104 -0
- package/dist/src/services/StaticService/types.d.ts +76 -0
- package/dist/src/services/StaticService/types.js +1 -0
- package/dist/src/services/StatsService.d.ts +46 -0
- package/dist/src/services/StatsService.js +147 -0
- package/dist/src/services/ThemeManager/constants.d.ts +2 -0
- package/dist/src/services/ThemeManager/constants.js +47 -0
- package/dist/src/services/UserSettingsManager.d.ts +63 -0
- package/dist/src/services/UserSettingsManager.js +155 -0
- package/dist/src/test-polyfills.d.ts +1 -0
- package/dist/src/test-polyfills.js +15 -0
- package/dist/src/types/OverlayTypes.d.ts +43 -0
- package/dist/src/types/OverlayTypes.js +4 -0
- package/dist/src/view-models/MaestroEventViewModel.d.ts +63 -0
- package/dist/src/view-models/MaestroEventViewModel.js +304 -0
- package/dist/src/view-models/OverlayViewModel.d.ts +33 -0
- package/dist/src/view-models/OverlayViewModel.js +222 -0
- package/dist/src/view-models/PanelManagerViewModel.d.ts +46 -0
- package/dist/src/view-models/PanelManagerViewModel.js +212 -0
- package/dist/src/view-models/ViewModel.d.ts +12 -0
- package/dist/src/view-models/ViewModel.js +32 -0
- package/package.json +1 -1
|
@@ -0,0 +1,386 @@
|
|
|
1
|
+
import InsightsService from './InsightsService';
|
|
2
|
+
import LocalStorageCacheManager from '@/external/LocalStorageCacheManager';
|
|
3
|
+
import SDK from '@/index';
|
|
4
|
+
export default class InsightsPayloadBuilder {
|
|
5
|
+
constructor() {
|
|
6
|
+
Object.defineProperty(this, "currentTime", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: 0
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(this, "serverOffsetTime", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: 0
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "insightsService", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(this, "cacheManager", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
configurable: true,
|
|
27
|
+
writable: true,
|
|
28
|
+
value: void 0
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(this, "pageConfig", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
configurable: true,
|
|
33
|
+
writable: true,
|
|
34
|
+
value: null
|
|
35
|
+
});
|
|
36
|
+
this.insightsService = new InsightsService();
|
|
37
|
+
this.cacheManager = new LocalStorageCacheManager();
|
|
38
|
+
}
|
|
39
|
+
async getPayload(event) {
|
|
40
|
+
this.currentTime = Date.now();
|
|
41
|
+
this.serverOffsetTime = await this.getDeviceOffset();
|
|
42
|
+
this.pageConfig = SDK.getPageConfig();
|
|
43
|
+
return {
|
|
44
|
+
...this.getPageInsights(),
|
|
45
|
+
...this.getDeviceInsights(),
|
|
46
|
+
...this.getInsightsInsights(),
|
|
47
|
+
...this.getMetadataInsights(),
|
|
48
|
+
...this.getReferrerInsights(),
|
|
49
|
+
...this.getSessionInsights(),
|
|
50
|
+
...this.getSiteInsights(),
|
|
51
|
+
...this.getUserInsights(),
|
|
52
|
+
...this.getEventInsights(event),
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
getEventInsights(eventData) {
|
|
56
|
+
const ontology = eventData.ontology;
|
|
57
|
+
return {
|
|
58
|
+
/**
|
|
59
|
+
* @description Event Domain. NAMESPACE env var.
|
|
60
|
+
* @example maestro
|
|
61
|
+
*/
|
|
62
|
+
e_d: 'maestro',
|
|
63
|
+
/**
|
|
64
|
+
* @description Event stringified metadata. defaults to null.
|
|
65
|
+
* @example "{\"key\":\"value\"}"
|
|
66
|
+
*/
|
|
67
|
+
e_m: Object.values(eventData.metadata || {}).length > 0
|
|
68
|
+
? JSON.stringify(eventData.metadata)
|
|
69
|
+
: null,
|
|
70
|
+
/**
|
|
71
|
+
* @description Event time accounting for offset.
|
|
72
|
+
*/
|
|
73
|
+
e_t: this.currentTime + this.serverOffsetTime,
|
|
74
|
+
/**
|
|
75
|
+
* @description Event URL. defaults to undefined.
|
|
76
|
+
*/
|
|
77
|
+
e_u: window.location.href,
|
|
78
|
+
/**
|
|
79
|
+
* @description Event ontology kingdom. This is the highest level of the ontology and can be used to identify the event type.
|
|
80
|
+
* @example 'panel', 'engage', 'espn_key_plays'
|
|
81
|
+
*/
|
|
82
|
+
e0: ontology.kingdom,
|
|
83
|
+
/**
|
|
84
|
+
* @description Event phylum.
|
|
85
|
+
* @example 'view', 'click', 'play clip'
|
|
86
|
+
*/
|
|
87
|
+
e1: ontology.phylum,
|
|
88
|
+
/**
|
|
89
|
+
* @description Event class.
|
|
90
|
+
* @example 'panel_type'
|
|
91
|
+
*/
|
|
92
|
+
e2: ontology.class,
|
|
93
|
+
/**
|
|
94
|
+
* @description Event order.
|
|
95
|
+
* @example 'panel_id'
|
|
96
|
+
*/
|
|
97
|
+
e3: ontology.order,
|
|
98
|
+
/**
|
|
99
|
+
* @description Event family.
|
|
100
|
+
* @example 'panel_name'
|
|
101
|
+
*/
|
|
102
|
+
e4: ontology.family,
|
|
103
|
+
/**
|
|
104
|
+
* @description Event genus. This is a more specific level of the ontology and can be used to identify the event type.
|
|
105
|
+
*/
|
|
106
|
+
e5: ontology.genus,
|
|
107
|
+
/**
|
|
108
|
+
* @description Event species. This is the most specific level of the ontology and can be used to identify the event type.
|
|
109
|
+
*/
|
|
110
|
+
e6: ontology.species,
|
|
111
|
+
/**
|
|
112
|
+
* @description Current timestamp.
|
|
113
|
+
*/
|
|
114
|
+
t: this.currentTime,
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
getPageInsights() {
|
|
118
|
+
const config = SDK.getPageConfig();
|
|
119
|
+
return {
|
|
120
|
+
/**
|
|
121
|
+
* @description MongoDB page collection name (e.g. 'pages')
|
|
122
|
+
* @example object.collection
|
|
123
|
+
*/
|
|
124
|
+
p_c: 'pages',
|
|
125
|
+
/**
|
|
126
|
+
* @description MongoDB page document ID (e.g. 'pageId')
|
|
127
|
+
* @example object._id
|
|
128
|
+
*/
|
|
129
|
+
p_id: config?.page._id,
|
|
130
|
+
/**
|
|
131
|
+
* @description MongoDB page name (e.g. 'Home', 'Product Page')
|
|
132
|
+
* @example object.data.name || object.seo.title
|
|
133
|
+
*/
|
|
134
|
+
p_n: config?.page.name,
|
|
135
|
+
/**
|
|
136
|
+
* @description MongoDB page slug (e.g. 'home', 'product-page')
|
|
137
|
+
* @example object.slug
|
|
138
|
+
*/
|
|
139
|
+
p_s: config?.page.slug,
|
|
140
|
+
/**
|
|
141
|
+
* @description MongoDB page type (e.g. 'landing', 'channel')
|
|
142
|
+
* @example object.type
|
|
143
|
+
*/
|
|
144
|
+
p_t: config?.page.type,
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
getDevicePermanentID() {
|
|
148
|
+
const devicePermanentId = localStorage.getItem('mio:device:permanentId');
|
|
149
|
+
if (devicePermanentId) {
|
|
150
|
+
return devicePermanentId;
|
|
151
|
+
}
|
|
152
|
+
const newDevicePermanentId = this.randomId();
|
|
153
|
+
localStorage.setItem('mio:device:permanentId', newDevicePermanentId);
|
|
154
|
+
return newDevicePermanentId;
|
|
155
|
+
}
|
|
156
|
+
getDeviceCreated() {
|
|
157
|
+
const deviceCreated = this.cacheManager.getCache('mio:device:created');
|
|
158
|
+
if (deviceCreated) {
|
|
159
|
+
return Number(deviceCreated);
|
|
160
|
+
}
|
|
161
|
+
const now = new Date().getTime();
|
|
162
|
+
this.cacheManager.setCache('mio:device:created', now.toString());
|
|
163
|
+
return now;
|
|
164
|
+
}
|
|
165
|
+
getTabID() {
|
|
166
|
+
const tabId = sessionStorage.getItem('mio:device:tabId');
|
|
167
|
+
if (tabId) {
|
|
168
|
+
return tabId;
|
|
169
|
+
}
|
|
170
|
+
const newTabId = this.randomId();
|
|
171
|
+
sessionStorage.setItem('mio:device:tabId', newTabId);
|
|
172
|
+
return newTabId;
|
|
173
|
+
}
|
|
174
|
+
getDeviceInsights() {
|
|
175
|
+
return {
|
|
176
|
+
/**
|
|
177
|
+
* @description Device created timestamp. You might wanna keep this fixed for the device you're in using a local storage or something related
|
|
178
|
+
* @example new Date().getTime()
|
|
179
|
+
*/
|
|
180
|
+
d_ct: this.getDeviceCreated(),
|
|
181
|
+
/**
|
|
182
|
+
* @description New device or not. If you want to keep track of new devices, you can use a local storage or something related
|
|
183
|
+
* @example localStorage.getItem('isNewDevice') === 'true'
|
|
184
|
+
*/
|
|
185
|
+
d_nd: false,
|
|
186
|
+
/**
|
|
187
|
+
* @description Navigator Platform (more Web API specific).
|
|
188
|
+
* @example 'MacIntel', 'Win32', 'Linux x86_64'
|
|
189
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform
|
|
190
|
+
*/
|
|
191
|
+
d_np: window.navigator.platform,
|
|
192
|
+
/**
|
|
193
|
+
* @description A unique identifier for the device, which can be used to track the device across sessions. You might wanna save this into a local storage or something related.
|
|
194
|
+
* @example localStorage.getItem('devicePermanentId') || generateUniqueId()
|
|
195
|
+
*/
|
|
196
|
+
d_pid: this.getDevicePermanentID(),
|
|
197
|
+
/**
|
|
198
|
+
* @description Device screen height in pixels.
|
|
199
|
+
* @example window.screen.height
|
|
200
|
+
*/
|
|
201
|
+
d_sh: window.screen.height,
|
|
202
|
+
/**
|
|
203
|
+
* @description Device screen width in pixels.
|
|
204
|
+
* @example window.screen.width
|
|
205
|
+
*/
|
|
206
|
+
d_sw: window.screen.width,
|
|
207
|
+
/**
|
|
208
|
+
* @description Device tab ID, which can be used to track the device across tabs.
|
|
209
|
+
*/
|
|
210
|
+
d_tid: this.getTabID(),
|
|
211
|
+
/**
|
|
212
|
+
* @description Device time in milliseconds since epoch.
|
|
213
|
+
*/
|
|
214
|
+
d_tim: this.currentTime,
|
|
215
|
+
/**
|
|
216
|
+
* @description Device time offset in milliseconds. You might wanna keep this fixed for the device you're in using a local storage or something related.
|
|
217
|
+
*/
|
|
218
|
+
d_tof: this.serverOffsetTime,
|
|
219
|
+
/**
|
|
220
|
+
* @description Device user agent string.
|
|
221
|
+
* @example navigator.userAgent ('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3')
|
|
222
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent
|
|
223
|
+
*/
|
|
224
|
+
d_ua: window.navigator.userAgent,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
randomId() {
|
|
228
|
+
return (Math.random().toString(36).substring(2, 15) +
|
|
229
|
+
Math.random().toString(36).substring(2, 15));
|
|
230
|
+
}
|
|
231
|
+
async getDeviceOffset() {
|
|
232
|
+
const responseStart = Date.now();
|
|
233
|
+
const { diff: serverOffset, time: serverTime, } = await this.insightsService.getServerTime();
|
|
234
|
+
const responseEnd = Date.now();
|
|
235
|
+
const queryTime = responseEnd - responseStart;
|
|
236
|
+
const clientOffset = responseEnd - serverTime;
|
|
237
|
+
// from NTP algo: https://en.wikipedia.org/wiki/Network_Time_Protocol
|
|
238
|
+
// JS example: https://stackoverflow.com/questions/1638337
|
|
239
|
+
// /the-best-way-to-synchronize-client-side-javascript-clock-with-server-date
|
|
240
|
+
// will account for latent response times back to client
|
|
241
|
+
return (serverOffset - queryTime - clientOffset) / 2;
|
|
242
|
+
}
|
|
243
|
+
getInsightsInsights() {
|
|
244
|
+
return {
|
|
245
|
+
/**
|
|
246
|
+
* @description Unique identifier for the insights ID. Stored in site's document.
|
|
247
|
+
* @example site.settings.services.insights_id
|
|
248
|
+
*/
|
|
249
|
+
i_id: this.pageConfig?.insights._id,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
getMetadataInsights() {
|
|
253
|
+
return {
|
|
254
|
+
/**
|
|
255
|
+
* @description Metadata version, used to track changes in the metadata structure.
|
|
256
|
+
* @example '1.00.0'
|
|
257
|
+
*/
|
|
258
|
+
m_iv: '1.00.0',
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
getReferrerInsights() {
|
|
262
|
+
return {
|
|
263
|
+
/**
|
|
264
|
+
* @description Referrer domain, which can be used to track the domain from which the user came. Defaults to "$direct"
|
|
265
|
+
* @example 'example.com'.
|
|
266
|
+
*/
|
|
267
|
+
r_d: '$direct',
|
|
268
|
+
/**
|
|
269
|
+
* @description Referrer source, which can be used to track the source from which the user came (queryParam.r). Defaults to null
|
|
270
|
+
* @example const urlParams = new URLSearchParams(window.location.search);
|
|
271
|
+
* urlParams.get('r') || null
|
|
272
|
+
*/
|
|
273
|
+
r_s: null,
|
|
274
|
+
/**
|
|
275
|
+
* @description Referrer URL, which can be used to track the full URL from which the user came. Defaults to "$direct"
|
|
276
|
+
* @example document.referrer
|
|
277
|
+
*/
|
|
278
|
+
r_u: '$direct',
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
getSessionID() {
|
|
282
|
+
const sessionId = sessionStorage.getItem('mio:session:id');
|
|
283
|
+
if (sessionId) {
|
|
284
|
+
return sessionId;
|
|
285
|
+
}
|
|
286
|
+
const newSessionId = this.randomId();
|
|
287
|
+
sessionStorage.setItem('mio:session:id', newSessionId);
|
|
288
|
+
return newSessionId;
|
|
289
|
+
}
|
|
290
|
+
getSessionInsights() {
|
|
291
|
+
return {
|
|
292
|
+
/**
|
|
293
|
+
* @description Session ID, which can be used to track the session across requests. You might wanna keep this fixed for the session you're in using a local storage or something related.
|
|
294
|
+
*/
|
|
295
|
+
se_id: this.getSessionID(),
|
|
296
|
+
/**
|
|
297
|
+
* @description Session created timestamp. Usually set when the first event is fired
|
|
298
|
+
* @example new Date().getTime()
|
|
299
|
+
*/
|
|
300
|
+
se_s: this.currentTime,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
getSiteInsights() {
|
|
304
|
+
return {
|
|
305
|
+
/**
|
|
306
|
+
* @description Site domain.
|
|
307
|
+
* @example site.settings.domain.url. 'maestro.tv/site_slug'
|
|
308
|
+
*/
|
|
309
|
+
si_d: this.pageConfig?.site.domainUrl,
|
|
310
|
+
/**
|
|
311
|
+
* @description Site ID.
|
|
312
|
+
* @example site._id
|
|
313
|
+
*/
|
|
314
|
+
si_id: this.pageConfig?.site._id,
|
|
315
|
+
/**
|
|
316
|
+
* @description Site package ID.
|
|
317
|
+
* @example `${site.package.id}-sapphire`
|
|
318
|
+
*/
|
|
319
|
+
si_pid: `${this.pageConfig?.site.package.id}-sapphire`,
|
|
320
|
+
/**
|
|
321
|
+
* @description Site package version.
|
|
322
|
+
* @example `${site.package.version}-sapphire`
|
|
323
|
+
*/
|
|
324
|
+
si_pv: `${this.pageConfig?.site.package.version}-sapphire`,
|
|
325
|
+
/**
|
|
326
|
+
* @description Site slug.
|
|
327
|
+
* @example site.slug
|
|
328
|
+
*/
|
|
329
|
+
// TODO: grab from page config when available
|
|
330
|
+
si_s: 'espn',
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
getUserInsights() {
|
|
334
|
+
return {
|
|
335
|
+
/**
|
|
336
|
+
* @description User avatar URL. Stored in user profile. defaults to null
|
|
337
|
+
* @example GET 'https://api.maestro.io/userprofile/v1'
|
|
338
|
+
*/
|
|
339
|
+
u_a: null,
|
|
340
|
+
/**
|
|
341
|
+
* @description User account created date in milliseconds since epoch. defaults to null
|
|
342
|
+
* @example account.created
|
|
343
|
+
*/
|
|
344
|
+
u_c: null,
|
|
345
|
+
/**
|
|
346
|
+
* @description Logged User email. defaults to null
|
|
347
|
+
* @example account.email
|
|
348
|
+
*/
|
|
349
|
+
u_e: null,
|
|
350
|
+
/**
|
|
351
|
+
* @description Logged User ID. defaults to null
|
|
352
|
+
* @example account._id
|
|
353
|
+
*/
|
|
354
|
+
u_id: null,
|
|
355
|
+
/**
|
|
356
|
+
* @description Logged User is logged in or not. defaults to false
|
|
357
|
+
*/
|
|
358
|
+
u_li: false,
|
|
359
|
+
/**
|
|
360
|
+
* @description Logged User name. defaults to null
|
|
361
|
+
* @example account.name
|
|
362
|
+
*/
|
|
363
|
+
u_n: null,
|
|
364
|
+
/**
|
|
365
|
+
* @description Logged User new user or not. Usually we compare server time and account.created. If it was created less than 1 day ago it's a new user. defaults to false
|
|
366
|
+
* @example Math.abs((serverTime || Date.now()) - account.created) < msIn.day
|
|
367
|
+
*/
|
|
368
|
+
u_nu: false,
|
|
369
|
+
/**
|
|
370
|
+
* @description Logged User service. defaults to null
|
|
371
|
+
* @example account.service
|
|
372
|
+
*/
|
|
373
|
+
u_s: null,
|
|
374
|
+
/**
|
|
375
|
+
* @description Logged User UID. defaults to null
|
|
376
|
+
* @example account.uid
|
|
377
|
+
*/
|
|
378
|
+
u_u: null,
|
|
379
|
+
/**
|
|
380
|
+
* @description Logged User name. defaults to null
|
|
381
|
+
* @example account.name
|
|
382
|
+
*/
|
|
383
|
+
u_un: null,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import AxiosNetworkClient from '@/external/AxiosNetworkClient';
|
|
2
|
+
import SDK from '@/index';
|
|
3
|
+
import { captureException } from '@/sentry';
|
|
4
|
+
const INSIGHTS_BASE_URL = 'https://insights.maestro.io';
|
|
5
|
+
export default class InsightsService {
|
|
6
|
+
constructor() {
|
|
7
|
+
Object.defineProperty(this, "client", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
configurable: true,
|
|
10
|
+
writable: true,
|
|
11
|
+
value: void 0
|
|
12
|
+
});
|
|
13
|
+
this.client = new AxiosNetworkClient({
|
|
14
|
+
baseURL: INSIGHTS_BASE_URL,
|
|
15
|
+
backoff: 2,
|
|
16
|
+
delay: 1000,
|
|
17
|
+
retries: 1,
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
isEnabled() {
|
|
21
|
+
const globalConfig = SDK.getGlobalConfig();
|
|
22
|
+
const analyticsEnabled = globalConfig?.bbd?.analytics?.enabled ?? true;
|
|
23
|
+
return analyticsEnabled;
|
|
24
|
+
}
|
|
25
|
+
async action(payload) {
|
|
26
|
+
if (!this.isEnabled()) {
|
|
27
|
+
console.warn('InsightsService: Analytics is disabled in global config');
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
try {
|
|
31
|
+
// do like qs.stringify with my payload and send as formData
|
|
32
|
+
const parsedData = new URLSearchParams();
|
|
33
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
34
|
+
if (value !== undefined && value !== null) {
|
|
35
|
+
parsedData.append(key, value.toString());
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
await this.client.post('/action', parsedData, undefined, {
|
|
39
|
+
'Content-Type': 'application/x-www-form-urlencoded',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
catch (err) {
|
|
43
|
+
captureException(err, { payload });
|
|
44
|
+
console.error('Failed to send insights action:', err);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async getServerTime() {
|
|
48
|
+
if (!this.isEnabled()) {
|
|
49
|
+
return {
|
|
50
|
+
time: Date.now(),
|
|
51
|
+
diff: 0,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const responseStart = Date.now();
|
|
55
|
+
try {
|
|
56
|
+
return await this.client.get('/time', {
|
|
57
|
+
_: `${Date.now()}-${this.randomId()}`,
|
|
58
|
+
client_time: responseStart,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
captureException(err);
|
|
63
|
+
console.error('Failed to get server time:', err);
|
|
64
|
+
return {
|
|
65
|
+
time: Date.now(),
|
|
66
|
+
diff: 0,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
randomId() {
|
|
71
|
+
return (Math.random().toString(36).substring(2, 15) +
|
|
72
|
+
Math.random().toString(36).substring(2, 15));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { ICacheManager } from '../../external/ports/cacheManager';
|
|
2
|
+
import { INetworkClient } from '../../external/ports/networkClient';
|
|
3
|
+
export declare const MAESTRO_BASE_URL = "https://api.maestro.io";
|
|
4
|
+
export declare const SDK_FLAVOR = "MaestroKit_Web";
|
|
5
|
+
export declare const ENDPOINTS: {
|
|
6
|
+
CAN_I_PLAY: string;
|
|
7
|
+
STREAM: string;
|
|
8
|
+
USER_PROFILE: string;
|
|
9
|
+
ACTIVE_USER: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const HttpMethod: {
|
|
12
|
+
readonly GET: "GET";
|
|
13
|
+
readonly POST: "POST";
|
|
14
|
+
readonly PUT: "PUT";
|
|
15
|
+
readonly DELETE: "DELETE";
|
|
16
|
+
};
|
|
17
|
+
export type HttpMethod = typeof HttpMethod[keyof typeof HttpMethod];
|
|
18
|
+
export interface NetworkManagerOptions {
|
|
19
|
+
networkClient?: INetworkClient;
|
|
20
|
+
externalNetworkClient?: INetworkClient;
|
|
21
|
+
externalBaseURL?: string;
|
|
22
|
+
cacheManager?: ICacheManager;
|
|
23
|
+
defaultCacheDuration?: number;
|
|
24
|
+
}
|
|
25
|
+
declare class NetworkManager {
|
|
26
|
+
private cacheManager;
|
|
27
|
+
private maestroClient;
|
|
28
|
+
private externalClient;
|
|
29
|
+
private pollingTasks;
|
|
30
|
+
private localStorage;
|
|
31
|
+
constructor(options?: NetworkManagerOptions, localStorageOverride?: Storage);
|
|
32
|
+
/**
|
|
33
|
+
* Set authentication for Maestro APIs
|
|
34
|
+
*/
|
|
35
|
+
setAuthentication(token: string | null, apiKey: string | null): void;
|
|
36
|
+
/**
|
|
37
|
+
* Handle errors from network requests
|
|
38
|
+
*/
|
|
39
|
+
private handleError;
|
|
40
|
+
/**
|
|
41
|
+
* Make a request to the Maestro API
|
|
42
|
+
*/
|
|
43
|
+
maestroApiRequest<T = any>({ endpoint, method, params, data, headers, useCache, maestroDefaultHeaders, skipResponseBodyDeserialization, }: {
|
|
44
|
+
endpoint: string;
|
|
45
|
+
method?: HttpMethod;
|
|
46
|
+
params?: Record<string, any>;
|
|
47
|
+
data?: any;
|
|
48
|
+
headers?: Record<string, string>;
|
|
49
|
+
useCache?: boolean;
|
|
50
|
+
maestroDefaultHeaders?: {
|
|
51
|
+
siteId: string;
|
|
52
|
+
jwt: string;
|
|
53
|
+
} | null;
|
|
54
|
+
skipResponseBodyDeserialization?: boolean;
|
|
55
|
+
}): Promise<T>;
|
|
56
|
+
/**
|
|
57
|
+
* Make a request to an external API
|
|
58
|
+
*/
|
|
59
|
+
externalApiRequest<T = any>({ endpoint, method, params, data, headers, useCache, skipResponseBodyDeserialization, }: {
|
|
60
|
+
endpoint: string;
|
|
61
|
+
method?: HttpMethod;
|
|
62
|
+
params?: Record<string, any>;
|
|
63
|
+
data?: any;
|
|
64
|
+
headers?: Record<string, string>;
|
|
65
|
+
useCache?: boolean;
|
|
66
|
+
skipResponseBodyDeserialization?: boolean;
|
|
67
|
+
}): Promise<T>;
|
|
68
|
+
/**
|
|
69
|
+
* Make a request to an external API and return both data and headers
|
|
70
|
+
*/
|
|
71
|
+
externalApiRequestWithHeaders<T = any>({ endpoint, method, params, data, headers, useCache, skipResponseBodyDeserialization, }: {
|
|
72
|
+
endpoint: string;
|
|
73
|
+
method?: HttpMethod;
|
|
74
|
+
params?: Record<string, any>;
|
|
75
|
+
data?: any;
|
|
76
|
+
headers?: Record<string, string>;
|
|
77
|
+
useCache?: boolean;
|
|
78
|
+
skipResponseBodyDeserialization?: boolean;
|
|
79
|
+
}): Promise<{
|
|
80
|
+
data: T;
|
|
81
|
+
headers: Record<string, string>;
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* Start polling a Maestro API endpoint at specified interval
|
|
85
|
+
*/
|
|
86
|
+
pollMaestroApiRequest<T = any>({ endpoint, interval, method, params, data, headers, maestroDefaultHeaders, skipResponseBodyDeserialization, onData, onError, }: {
|
|
87
|
+
endpoint: string;
|
|
88
|
+
interval: number;
|
|
89
|
+
method?: HttpMethod;
|
|
90
|
+
params?: Record<string, any>;
|
|
91
|
+
data?: any;
|
|
92
|
+
headers?: Record<string, string>;
|
|
93
|
+
maestroDefaultHeaders?: {
|
|
94
|
+
siteId: string;
|
|
95
|
+
jwt: string;
|
|
96
|
+
} | null;
|
|
97
|
+
skipResponseBodyDeserialization?: boolean;
|
|
98
|
+
onData: (data: T) => void;
|
|
99
|
+
onError?: (error: Error) => void;
|
|
100
|
+
}): {
|
|
101
|
+
stop: () => void;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Start polling an external API endpoint at specified interval
|
|
105
|
+
*/
|
|
106
|
+
pollExternalApiRequest<T = any>({ endpoint, interval, method, params, data, headers, skipResponseBodyDeserialization, onData, onError, }: {
|
|
107
|
+
endpoint: string;
|
|
108
|
+
interval: number;
|
|
109
|
+
method?: HttpMethod;
|
|
110
|
+
params?: Record<string, any>;
|
|
111
|
+
data?: any;
|
|
112
|
+
headers?: Record<string, string>;
|
|
113
|
+
skipResponseBodyDeserialization?: boolean;
|
|
114
|
+
onData: (data: T) => void;
|
|
115
|
+
onError?: (error: Error) => void;
|
|
116
|
+
}): {
|
|
117
|
+
stop: () => void;
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Start polling an external API endpoint at specified interval and return both data and headers
|
|
121
|
+
*/
|
|
122
|
+
pollExternalApiRequestWithHeaders<T = any>({ endpoint, interval, method, params, data, headers, skipResponseBodyDeserialization, onData, onError, }: {
|
|
123
|
+
endpoint: string;
|
|
124
|
+
interval: number;
|
|
125
|
+
method?: HttpMethod;
|
|
126
|
+
params?: Record<string, any>;
|
|
127
|
+
data?: any;
|
|
128
|
+
headers?: Record<string, string>;
|
|
129
|
+
skipResponseBodyDeserialization?: boolean;
|
|
130
|
+
onData: (data: {
|
|
131
|
+
data: T;
|
|
132
|
+
headers: Record<string, string>;
|
|
133
|
+
}) => void;
|
|
134
|
+
onError?: (error: Error) => void;
|
|
135
|
+
}): {
|
|
136
|
+
stop: () => void;
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Stop all polling tasks
|
|
140
|
+
*/
|
|
141
|
+
stopAllPolling(): void;
|
|
142
|
+
/**
|
|
143
|
+
* Clear all cached data
|
|
144
|
+
*/
|
|
145
|
+
clearAllCache(): void;
|
|
146
|
+
}
|
|
147
|
+
export default NetworkManager;
|