@maestro_io/maestro-web-sdk 2.2.0 → 2.2.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/components/core/PanelManager/PanelManager.d.ts +3 -0
- package/dist/helpers/url.d.ts +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/interfaces/IMaestroEvent.d.ts +13 -0
- package/dist/interfaces/IMaestroManager.d.ts +8 -1
- package/dist/interfaces/IUserSettings.d.ts +36 -0
- package/dist/maestro-web-sdk.umd.js +3 -3
- package/dist/maestro-web-sdk.umd.js.map +1 -1
- package/dist/modules/bets/view/BetsView.d.ts +4 -0
- package/dist/modules/bets/view/UserBets/BetsCard/BetsCard.d.ts +1 -0
- package/dist/modules/bets/view/UserBets/BetsCard/BetsCardEvent.d.ts +1 -0
- package/dist/modules/bets/view/UserBets/BetsCard/BetsCardFooter.d.ts +2 -1
- package/dist/modules/bets/view/UserBets/Boost/Boost.d.ts +2 -1
- package/dist/modules/bets/view/UserBets/Parlay/Parlay.d.ts +2 -1
- package/dist/modules/bets/view/UserBets/Straight/Straight.d.ts +2 -1
- package/dist/modules/bets/view/UserBets/Teaser/Teaser.d.ts +2 -1
- package/dist/modules/bets/view/components/Bet/Bet.d.ts +7 -0
- package/dist/modules/bets/view-model/BetsViewModel.d.ts +15 -0
- package/dist/modules/key-plays/interfaces/IKeyPlays.d.ts +1 -0
- package/dist/modules/key-plays/interfaces/IKeyPlaysResponse.d.ts +6 -6
- package/dist/modules/key-plays/view/KeyPlayCardView.d.ts +4 -1
- package/dist/modules/key-plays/view/KeyPlayErrorStateView.d.ts +2 -0
- package/dist/modules/key-plays/view-model/KeyPlaysViewModel.d.ts +5 -1
- package/dist/services/BetsService.d.ts +2 -2
- package/dist/services/NetworkManager/NetworkManager.d.ts +1 -3
- package/dist/services/NetworkManager/NetworkManagerFactory.d.ts +42 -0
- package/dist/services/NetworkManager/types.d.ts +77 -0
- package/dist/services/StatsService.d.ts +2 -2
- package/dist/services/UserSettingsManager.d.ts +63 -0
- package/dist/view-models/MaestroEventViewModel.d.ts +5 -0
- package/dist/view-models/PanelManagerViewModel.d.ts +24 -0
- package/dist/view-models/index.d.ts +4 -0
- package/package.json +1 -1
|
@@ -3,9 +3,12 @@ import './PanelManager.styles.css';
|
|
|
3
3
|
import { MaestroPanelType } from '@/models/IPanel';
|
|
4
4
|
interface PanelManagerState {
|
|
5
5
|
activePanel: MaestroPanelType;
|
|
6
|
+
visiblePanels: MaestroPanelType[];
|
|
6
7
|
}
|
|
7
8
|
declare class PanelManager extends React.Component<{}, PanelManagerState> {
|
|
8
9
|
private unsubscribe;
|
|
10
|
+
private panelsUnsubscribe;
|
|
11
|
+
private viewModel;
|
|
9
12
|
constructor(props: {});
|
|
10
13
|
componentDidMount(): void;
|
|
11
14
|
componentWillUnmount(): void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const setImageDimensions: (url: string, width: number, height: number) => string;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ import IMaestroManager, { SDKConfigParams } from './interfaces/IMaestroManager';
|
|
|
3
3
|
import IMaestroEvent from './interfaces/IMaestroEvent';
|
|
4
4
|
import { MaestroEventViewModel } from './view-models/MaestroEventViewModel';
|
|
5
5
|
import IMaestroKeyPlaysResponse from './modules/key-plays/interfaces/IKeyPlaysResponse';
|
|
6
|
+
import { IUserSettings } from './interfaces/IUserSettings';
|
|
6
7
|
export { default as Overlay } from './components/molecules/Overlay/Overlay';
|
|
7
8
|
export { OverlayType, IMaestroOverlayEvent, IOverlaySize, IOverlayPosition, IFantasyPayload, IOverlayAnalyticsEvent, } from './types/OverlayTypes';
|
|
8
9
|
export { IWinningBet } from './models/IWinningBet';
|
|
9
10
|
export { IMaestroEventDelegate, IMaestroEvent, IMaestroKeyPlaysResponse };
|
|
11
|
+
export { IUserSettings, DEFAULT_USER_SETTINGS, } from './interfaces/IUserSettings';
|
|
10
12
|
export type Environment = 'development' | 'staging' | 'production';
|
|
11
13
|
/**
|
|
12
14
|
* Main SDK class that serves as the entry point for the Maestro TV SDK
|
|
@@ -27,7 +29,7 @@ declare class MaestroWebSDK implements IMaestroManager {
|
|
|
27
29
|
* @returns {MaestroWebSDK} - The MaestroWebSDK instance
|
|
28
30
|
*/
|
|
29
31
|
static getInstance(): MaestroWebSDK;
|
|
30
|
-
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate): Promise<IMaestroEvent>;
|
|
32
|
+
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate, userSettings?: IUserSettings): Promise<IMaestroEvent>;
|
|
31
33
|
userDidStopWatchingEvent(_: string): void;
|
|
32
34
|
configure(configParams: SDKConfigParams): void;
|
|
33
35
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MaestroPanelType } from '@/models/IPanel';
|
|
2
2
|
import IMaestroKeyPlaysResponse from '../modules/key-plays/interfaces/IKeyPlaysResponse';
|
|
3
|
+
import { IUserSettings } from './IUserSettings';
|
|
3
4
|
/**
|
|
4
5
|
* This is the public API that the app can use to make calls to the SDK related to the currently-loaded event.
|
|
5
6
|
*/
|
|
@@ -74,6 +75,18 @@ export default interface IMaestroEvent {
|
|
|
74
75
|
* https://developers.maestro.io/sdk/web/maestro-event-interface/state/updateKeyPlaysData
|
|
75
76
|
*/
|
|
76
77
|
updateKeyPlaysData(data: IMaestroKeyPlaysResponse | null): Promise<void>;
|
|
78
|
+
updateUserSettings(settings: IUserSettings): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* @description Updates the SDK with the current time code of the player.
|
|
81
|
+
* This is used to synchronize the SDK with the player's current time code.
|
|
82
|
+
* https://developers.maestro.io/sdk/web/maestro-event-interface/state/updatePlayerTimeCode
|
|
83
|
+
*/
|
|
84
|
+
updatePlayerTimeCode(timestamp: number): void;
|
|
85
|
+
/**
|
|
86
|
+
* @description Retrieves the current player time code stored in the SDK.
|
|
87
|
+
* https://developers.maestro.io/sdk/web/maestro-event-interface/state/getPlayerTimeCode
|
|
88
|
+
*/
|
|
89
|
+
getPlayerTimeCode(): number | null;
|
|
77
90
|
simulateUseCase<T = any>(useCase: TestUseCase, panelType: MaestroPanelType, testData?: T): void;
|
|
78
91
|
}
|
|
79
92
|
declare const TEST_USE_CASES: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import IMaestroEventDelegate from './IMaestroEventDelegate';
|
|
2
2
|
import IMaestroEvent from './IMaestroEvent';
|
|
3
|
+
import { IUserSettings } from './IUserSettings';
|
|
3
4
|
export type SDKConfigParams = {
|
|
4
5
|
/**
|
|
5
6
|
* The type of environment to use. Defaults to `development`. The available options are `development`, `staging`, and `production`.
|
|
@@ -33,6 +34,10 @@ export type SDKConfigParams = {
|
|
|
33
34
|
* The client app SWID for authentication.
|
|
34
35
|
*/
|
|
35
36
|
clientAppSwid?: string;
|
|
37
|
+
/**
|
|
38
|
+
* User settings for customizing SDK behavior (panel visibility, feature toggles, etc.)
|
|
39
|
+
*/
|
|
40
|
+
userSettings?: IUserSettings;
|
|
36
41
|
};
|
|
37
42
|
/**
|
|
38
43
|
This is the MaestroKit top-level API for initializing and configuring the framework. It encompasses all functionality that is not specific to an event.
|
|
@@ -47,6 +52,7 @@ export default interface IMaestroManager {
|
|
|
47
52
|
* @param {SDKConfigParams['siteID']} configParams.siteID - The site ID to use for the SDK.
|
|
48
53
|
* @param {SDKConfigParams['jwt']} configParams.jwt - The JWT token to use for authentication.
|
|
49
54
|
* @param {SDKConfigParams['userID']} configParams.userID - The user ID of the logged account.
|
|
55
|
+
* @param {SDKConfigParams['userSettings']} configParams.userSettings - User settings for customizing SDK behavior.
|
|
50
56
|
*/
|
|
51
57
|
configure(configParams: SDKConfigParams): void;
|
|
52
58
|
/**
|
|
@@ -54,9 +60,10 @@ export default interface IMaestroManager {
|
|
|
54
60
|
Arguments:
|
|
55
61
|
- eventID: The Event ID for the event opened in the player.
|
|
56
62
|
- delegate: an instance of the app's implementation of IMaestroEventDelegate
|
|
63
|
+
- userSettings: Optional user settings to override the configured settings for this event
|
|
57
64
|
The function returns an instance of MaestroEventViewModel, which includes an implementation of IMaestroEvent. IMaestroEvent represents the app-facing portion of the MaestroKit API related to the currently-loaded event. So after `userDidStartWatchingEvent` is called, the SDK has access to the API detailed in `MaestroEventDelegate` for making calls to the app, and the app has access to the API detailed in `IMaestroEvent` for making calls to the SDK.
|
|
58
65
|
*/
|
|
59
|
-
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate): Promise<IMaestroEvent>;
|
|
66
|
+
userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate, userSettings?: IUserSettings): Promise<IMaestroEvent>;
|
|
60
67
|
/**
|
|
61
68
|
* @description Tells the SDK the user has closed an event that was open in the app's player.
|
|
62
69
|
* @param eventID
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User settings interface for customizing Maestro Web SDK behavior
|
|
3
|
+
* Supports panel-level and feature-level customizations
|
|
4
|
+
*/
|
|
5
|
+
export interface IUserSettings {
|
|
6
|
+
panels?: {
|
|
7
|
+
bets?: {
|
|
8
|
+
/** Hide the entire bets panel from panel selection */
|
|
9
|
+
hidePanel?: boolean;
|
|
10
|
+
/** Hide wager values (dollar amounts) in betting cards */
|
|
11
|
+
hideWagers?: boolean;
|
|
12
|
+
};
|
|
13
|
+
stats?: {
|
|
14
|
+
/** Hide the entire stats panel from panel selection */
|
|
15
|
+
hidePanel?: boolean;
|
|
16
|
+
};
|
|
17
|
+
keyPlays?: {
|
|
18
|
+
/** Hide the entire key plays panel from panel selection */
|
|
19
|
+
hidePanel?: boolean;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Default user settings - all features enabled by default
|
|
25
|
+
*/
|
|
26
|
+
export declare const DEFAULT_USER_SETTINGS: IUserSettings;
|
|
27
|
+
/**
|
|
28
|
+
* Panel-specific settings type helpers
|
|
29
|
+
*/
|
|
30
|
+
export type BetsSettings = NonNullable<IUserSettings['panels']>['bets'];
|
|
31
|
+
export type StatsSettings = NonNullable<IUserSettings['panels']>['stats'];
|
|
32
|
+
export type KeyPlaysSettings = NonNullable<IUserSettings['panels']>['keyPlays'];
|
|
33
|
+
/**
|
|
34
|
+
* Utility type for getting panel settings by panel type
|
|
35
|
+
*/
|
|
36
|
+
export type PanelSettings<T extends keyof NonNullable<IUserSettings['panels']>> = NonNullable<IUserSettings['panels']>[T];
|