@maestro_io/maestro-web-sdk 2.2.1 → 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 (31) hide show
  1. package/dist/MaestroEventDelegate.d.ts +3 -0
  2. package/dist/components/organisms/SegmentController/SegmentController.d.ts +1 -0
  3. package/dist/external/AxiosNetworkClient.d.ts +1 -1
  4. package/dist/external/ports/networkClient.d.ts +1 -1
  5. package/dist/index.d.ts +9 -1
  6. package/dist/interfaces/IMaestroEventDelegate.d.ts +11 -0
  7. package/dist/interfaces/IMaestroManager.d.ts +2 -1
  8. package/dist/maestro-web-sdk.umd.js +3 -3
  9. package/dist/maestro-web-sdk.umd.js.map +1 -1
  10. package/dist/modules/bets/types/BetsAnalyticsTypes.d.ts +25 -0
  11. package/dist/modules/bets/view/SixPack/SixPackView.d.ts +1 -0
  12. package/dist/modules/bets/view/UserBets/UserBetsView.d.ts +0 -1
  13. package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +1 -0
  14. package/dist/modules/bets/view-model/BetsViewModel.d.ts +19 -1
  15. package/dist/modules/key-plays/view-model/KeyPlaysViewModel.d.ts +4 -0
  16. package/dist/modules/stats/interfaces/IStats.d.ts +1 -1
  17. package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +1 -0
  18. package/dist/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.d.ts +1 -1
  19. package/dist/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.d.ts +1 -1
  20. package/dist/modules/stats/view/DriveSummary/DriveSummary.d.ts +1 -0
  21. package/dist/modules/stats/view/GameLeaders/GameLeaders.d.ts +1 -0
  22. package/dist/modules/stats/view/StatsItemView.d.ts +2 -0
  23. package/dist/modules/stats/view/StatsView.d.ts +1 -0
  24. package/dist/modules/stats/view-model/StatsViewModel.d.ts +6 -2
  25. package/dist/services/AnalyticsService/AnalyticsService.d.ts +65 -0
  26. package/dist/services/AnalyticsService/types.d.ts +65 -0
  27. package/dist/services/InsightsService/InsightsPayloadBuilder.d.ts +278 -0
  28. package/dist/services/InsightsService/InsightsService.d.ts +10 -0
  29. package/dist/services/NetworkManager/NetworkManager.d.ts +2 -17
  30. package/dist/services/NetworkManager/types.d.ts +0 -4
  31. 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>;
@@ -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
@@ -7,9 +7,10 @@ import { IUserSettings } from './interfaces/IUserSettings';
7
7
  export { default as Overlay } from './components/molecules/Overlay/Overlay';
8
8
  export { OverlayType, IMaestroOverlayEvent, IOverlaySize, IOverlayPosition, IFantasyPayload, IOverlayAnalyticsEvent, } from './types/OverlayTypes';
9
9
  export { IWinningBet } from './models/IWinningBet';
10
+ export { ActionTrackEvent, ImpressionTrackEvent, Metadata, PanelClickAction, PanelViewAction, } from './services/AnalyticsService/types';
10
11
  export { IMaestroEventDelegate, IMaestroEvent, IMaestroKeyPlaysResponse };
11
12
  export { IUserSettings, DEFAULT_USER_SETTINGS, } from './interfaces/IUserSettings';
12
- export type Environment = 'development' | 'staging' | 'production';
13
+ export type Environment = 'development' | 'production';
13
14
  /**
14
15
  * Main SDK class that serves as the entry point for the Maestro TV SDK
15
16
  * Follows a singleton pattern similar to the Swift implementation
@@ -23,6 +24,7 @@ declare class MaestroWebSDK implements IMaestroManager {
23
24
  private clientAppToken?;
24
25
  private clientAppSwid?;
25
26
  private maestroEventViewModel;
27
+ private environment;
26
28
  private constructor();
27
29
  /**
28
30
  * @description Returns the MaestroWebSDK instance
@@ -32,6 +34,12 @@ declare class MaestroWebSDK implements IMaestroManager {
32
34
  userDidStartWatchingEvent(eventID: string, delegate: IMaestroEventDelegate, userSettings?: IUserSettings): Promise<IMaestroEvent>;
33
35
  userDidStopWatchingEvent(_: string): void;
34
36
  configure(configParams: SDKConfigParams): void;
37
+ /**
38
+ * Sets the environment for the SDK
39
+ * @param environment The environment to set
40
+ */
41
+ setEnvironment(environment: Environment): void;
42
+ getEnvironment(): Environment;
35
43
  /**
36
44
  * Checks if this is an authorized client based on siteID
37
45
  */
@@ -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?: 'development' | 'staging' | 'production';
9
+ environment?: Environment;
9
10
  /**
10
11
  * The frequency in seconds to poll for updates. Defaults to 5.0.
11
12
  */