@maestro_io/maestro-web-sdk 2.2.1 → 2.2.3
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/MaestroEventDelegate.d.ts +3 -0
- package/dist/components/core/App/App.d.ts +2 -0
- package/dist/components/core/PanelManager/PanelManager.d.ts +5 -2
- package/dist/components/organisms/SegmentController/SegmentController.d.ts +1 -0
- package/dist/external/AxiosNetworkClient.d.ts +1 -1
- package/dist/external/ports/networkClient.d.ts +1 -1
- package/dist/index.d.ts +12 -1
- package/dist/interfaces/IMaestroEvent.d.ts +6 -0
- package/dist/interfaces/IMaestroEventDelegate.d.ts +11 -0
- package/dist/interfaces/IMaestroManager.d.ts +2 -1
- package/dist/maestro-web-sdk.umd.js +3 -3
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/modules/bets/types/BetsAnalyticsTypes.d.ts +8 -0
- package/dist/modules/bets/view/SixPack/SixPackView.d.ts +1 -0
- package/dist/modules/bets/view/UserBets/UserBetsView.d.ts +0 -1
- package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +1 -0
- package/dist/modules/bets/view-model/BetsViewModel.d.ts +15 -1
- package/dist/modules/key-plays/view-model/KeyPlaysViewModel.d.ts +4 -0
- package/dist/modules/stats/interfaces/IStats.d.ts +1 -1
- package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +1 -0
- package/dist/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.d.ts +1 -1
- package/dist/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.d.ts +1 -1
- package/dist/modules/stats/view/DriveSummary/DriveSummary.d.ts +1 -0
- package/dist/modules/stats/view/GameLeaders/GameLeaders.d.ts +1 -0
- package/dist/modules/stats/view/StatsItemView.d.ts +2 -0
- package/dist/modules/stats/view/StatsView.d.ts +1 -0
- package/dist/modules/stats/view-model/StatsViewModel.d.ts +11 -2
- package/dist/services/AnalyticsService/AnalyticsService.d.ts +49 -0
- package/dist/services/AnalyticsService/types.d.ts +65 -0
- package/dist/services/InsightsService/InsightsPayloadBuilder.d.ts +280 -0
- package/dist/services/InsightsService/InsightsService.d.ts +10 -0
- package/dist/services/NetworkManager/NetworkManager.d.ts +2 -17
- package/dist/services/NetworkManager/types.d.ts +0 -4
- package/dist/services/PageService/PageService.d.ts +8 -0
- package/dist/services/PageService/index.d.ts +2 -0
- package/dist/services/PageService/mocks.d.ts +2 -0
- package/dist/services/PageService/types.d.ts +53 -0
- package/dist/view-models/PanelManagerViewModel.d.ts +13 -7
- package/package.json +1 -1
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import IMaestroEventDelegate from './interfaces/IMaestroEventDelegate';
|
|
2
|
+
import { ActionTrackEvent, ImpressionTrackEvent } from './services/AnalyticsService/types';
|
|
2
3
|
/**
|
|
3
4
|
* Our own implementation of the IMaestroEventDelegate interface. Useful for Development and Testing
|
|
4
5
|
*/
|
|
5
6
|
export default class MaestroEventDelegate implements IMaestroEventDelegate {
|
|
7
|
+
trackImpression(impression: ImpressionTrackEvent): void;
|
|
8
|
+
trackAction(action: ActionTrackEvent): void;
|
|
6
9
|
getStatsAPIBaseURL(): string;
|
|
7
10
|
getBettingAPIBaseURL(): string;
|
|
8
11
|
userRequestedNewKeyPlaysData(): Promise<void>;
|
|
@@ -3,6 +3,8 @@ import './App.styles.css';
|
|
|
3
3
|
declare class App extends React.Component<{
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
}> {
|
|
6
|
+
get colors(): import("../../../models/ITheme").IThemeColors;
|
|
7
|
+
get typography(): import("../../../models/ITheme").IThemeTypography;
|
|
6
8
|
componentDidMount(): void;
|
|
7
9
|
componentWillUnmount(): void;
|
|
8
10
|
render(): React.JSX.Element;
|
|
@@ -2,8 +2,11 @@ import React from 'react';
|
|
|
2
2
|
import './PanelManager.styles.css';
|
|
3
3
|
import { MaestroPanelType } from '@/models/IPanel';
|
|
4
4
|
interface PanelManagerState {
|
|
5
|
-
activePanel: MaestroPanelType;
|
|
6
|
-
visiblePanels:
|
|
5
|
+
activePanel: MaestroPanelType | null;
|
|
6
|
+
visiblePanels: {
|
|
7
|
+
type: MaestroPanelType;
|
|
8
|
+
title: string;
|
|
9
|
+
}[];
|
|
7
10
|
}
|
|
8
11
|
declare class PanelManager extends React.Component<{}, PanelManagerState> {
|
|
9
12
|
private unsubscribe;
|
|
@@ -22,6 +22,7 @@ declare class SegmentController extends React.Component<SegmentControllerProps>
|
|
|
22
22
|
lastActiveIndex: number;
|
|
23
23
|
};
|
|
24
24
|
onBecameFocused: (item: SegmentItem, i: number) => (layout: Layout) => void;
|
|
25
|
+
onEnterPress: (item: SegmentItem) => () => void;
|
|
25
26
|
handleArrowPress: (index: number) => (direction: Direction, _props: WithFocusableProps) => void;
|
|
26
27
|
render(): React.JSX.Element;
|
|
27
28
|
}
|
|
@@ -14,7 +14,7 @@ declare class AxiosNetworkClient implements INetworkClient {
|
|
|
14
14
|
});
|
|
15
15
|
private retry;
|
|
16
16
|
get<TResponseData = any>(endpoint: string, params?: Record<string, any>, headers?: Record<string, string>): Promise<TResponseData>;
|
|
17
|
-
post<TRequestData = any, TResponseData = any>(endpoint: string, data: TRequestData): Promise<TResponseData>;
|
|
17
|
+
post<TRequestData = any, TResponseData = any>(endpoint: string, data: TRequestData, params?: Record<string, any>, headers?: Record<string, string>): Promise<TResponseData>;
|
|
18
18
|
setAuthentication(token: string | null, apiKey: string | null): void;
|
|
19
19
|
}
|
|
20
20
|
export default AxiosNetworkClient;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export interface INetworkClient {
|
|
2
2
|
get<TResponseData = any>(endpoint: string, params?: Record<string, any>, headers?: Record<string, string>): Promise<TResponseData>;
|
|
3
|
-
post<TRequestData = any, TResponseData = any>(endpoint: string, data: TRequestData): Promise<TResponseData>;
|
|
3
|
+
post<TRequestData = any, TResponseData = any>(endpoint: string, data: TRequestData, params?: Record<string, any>, headers?: Record<string, string>): Promise<TResponseData>;
|
|
4
4
|
setAuthentication(token: string | null, apiKey: string | null): void;
|
|
5
5
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,12 +4,14 @@ import IMaestroEvent from './interfaces/IMaestroEvent';
|
|
|
4
4
|
import { MaestroEventViewModel } from './view-models/MaestroEventViewModel';
|
|
5
5
|
import IMaestroKeyPlaysResponse from './modules/key-plays/interfaces/IKeyPlaysResponse';
|
|
6
6
|
import { IUserSettings } from './interfaces/IUserSettings';
|
|
7
|
+
import { PageConfig } from './services/PageService/types';
|
|
7
8
|
export { default as Overlay } from './components/molecules/Overlay/Overlay';
|
|
8
9
|
export { OverlayType, IMaestroOverlayEvent, IOverlaySize, IOverlayPosition, IFantasyPayload, IOverlayAnalyticsEvent, } from './types/OverlayTypes';
|
|
9
10
|
export { IWinningBet } from './models/IWinningBet';
|
|
11
|
+
export { ActionTrackEvent, ImpressionTrackEvent, Metadata, PanelClickAction, PanelViewAction, } from './services/AnalyticsService/types';
|
|
10
12
|
export { IMaestroEventDelegate, IMaestroEvent, IMaestroKeyPlaysResponse };
|
|
11
13
|
export { IUserSettings, DEFAULT_USER_SETTINGS, } from './interfaces/IUserSettings';
|
|
12
|
-
export type Environment = 'development' | '
|
|
14
|
+
export type Environment = 'development' | 'production';
|
|
13
15
|
/**
|
|
14
16
|
* Main SDK class that serves as the entry point for the Maestro TV SDK
|
|
15
17
|
* Follows a singleton pattern similar to the Swift implementation
|
|
@@ -23,6 +25,8 @@ declare class MaestroWebSDK implements IMaestroManager {
|
|
|
23
25
|
private clientAppToken?;
|
|
24
26
|
private clientAppSwid?;
|
|
25
27
|
private maestroEventViewModel;
|
|
28
|
+
private environment;
|
|
29
|
+
private pageConfig;
|
|
26
30
|
private constructor();
|
|
27
31
|
/**
|
|
28
32
|
* @description Returns the MaestroWebSDK instance
|
|
@@ -32,6 +36,12 @@ declare class MaestroWebSDK implements IMaestroManager {
|
|
|
32
36
|
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate, userSettings?: IUserSettings): Promise<IMaestroEvent>;
|
|
33
37
|
userDidStopWatchingEvent(_: string): void;
|
|
34
38
|
configure(configParams: SDKConfigParams): void;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the environment for the SDK
|
|
41
|
+
* @param environment The environment to set
|
|
42
|
+
*/
|
|
43
|
+
setEnvironment(environment: Environment): void;
|
|
44
|
+
getEnvironment(): Environment;
|
|
35
45
|
/**
|
|
36
46
|
* Checks if this is an authorized client based on siteID
|
|
37
47
|
*/
|
|
@@ -68,6 +78,7 @@ declare class MaestroWebSDK implements IMaestroManager {
|
|
|
68
78
|
getClientAppToken(): string | undefined;
|
|
69
79
|
getCurrentUserID(): string | undefined;
|
|
70
80
|
getClientAppSwid(): string | undefined;
|
|
81
|
+
getPageConfig(): PageConfig | null;
|
|
71
82
|
}
|
|
72
83
|
declare const SDK: MaestroWebSDK;
|
|
73
84
|
export default SDK;
|
|
@@ -93,6 +93,12 @@ declare const TEST_USE_CASES: {
|
|
|
93
93
|
readonly betsTabLoadFailure: "betsTabLoadFailure";
|
|
94
94
|
readonly betsMockData: "betsMockData";
|
|
95
95
|
readonly betsLiveData: "betsLiveData";
|
|
96
|
+
readonly showBasketballPreGameStatsMockData: "showBasketballPreGameStatsMockData";
|
|
97
|
+
readonly showBasketballInGameStatsMockData: "showBasketballInGameStatsMockData";
|
|
98
|
+
readonly showFootballPreGameStatsMockData: "showFootballPreGameStatsMockData";
|
|
99
|
+
readonly showFootballInGameStatsMockData: "showFootballInGameStatsMockData";
|
|
100
|
+
readonly showHockeyPreGameStatsMockData: "showHockeyPreGameStatsMockData";
|
|
101
|
+
readonly showHockeyInGameStatsMockData: "showHockeyInGameStatsMockData";
|
|
96
102
|
};
|
|
97
103
|
export type TestUseCase = typeof TEST_USE_CASES[keyof typeof TEST_USE_CASES];
|
|
98
104
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ActionTrackEvent, ImpressionTrackEvent } from '@/services/AnalyticsService/types';
|
|
1
2
|
/**
|
|
2
3
|
* @description Interface for the client app to implement in order to handle Maestro TV SDK events.
|
|
3
4
|
*/
|
|
@@ -45,4 +46,14 @@ export default interface IMaestroEventDelegate {
|
|
|
45
46
|
*
|
|
46
47
|
*/
|
|
47
48
|
getStatsAPIBaseURL(): string;
|
|
49
|
+
/**
|
|
50
|
+
* @description Track an user's action event for analytics. (i.e. key play clicked)
|
|
51
|
+
* https://developers.maestro.io/sdk/web/event-delegate/trackAction
|
|
52
|
+
*/
|
|
53
|
+
trackAction(action: ActionTrackEvent): void;
|
|
54
|
+
/**
|
|
55
|
+
* @description Track an impression event for analytics. (i.e. panel view)
|
|
56
|
+
* https://developers.maestro.io/sdk/web/event-delegate/trackImpression
|
|
57
|
+
*/
|
|
58
|
+
trackImpression(impression: ImpressionTrackEvent): void;
|
|
48
59
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import IMaestroEventDelegate from './IMaestroEventDelegate';
|
|
2
2
|
import IMaestroEvent from './IMaestroEvent';
|
|
3
|
+
import { Environment } from '..';
|
|
3
4
|
import { IUserSettings } from './IUserSettings';
|
|
4
5
|
export type SDKConfigParams = {
|
|
5
6
|
/**
|
|
6
7
|
* The type of environment to use. Defaults to `development`. The available options are `development`, `staging`, and `production`.
|
|
7
8
|
*/
|
|
8
|
-
environment?:
|
|
9
|
+
environment?: Environment;
|
|
9
10
|
/**
|
|
10
11
|
* The frequency in seconds to poll for updates. Defaults to 5.0.
|
|
11
12
|
*/
|