@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.
Files changed (39) hide show
  1. package/dist/MaestroEventDelegate.d.ts +3 -0
  2. package/dist/components/core/App/App.d.ts +2 -0
  3. package/dist/components/core/PanelManager/PanelManager.d.ts +5 -2
  4. package/dist/components/organisms/SegmentController/SegmentController.d.ts +1 -0
  5. package/dist/external/AxiosNetworkClient.d.ts +1 -1
  6. package/dist/external/ports/networkClient.d.ts +1 -1
  7. package/dist/index.d.ts +12 -1
  8. package/dist/interfaces/IMaestroEvent.d.ts +6 -0
  9. package/dist/interfaces/IMaestroEventDelegate.d.ts +11 -0
  10. package/dist/interfaces/IMaestroManager.d.ts +2 -1
  11. package/dist/maestro-web-sdk.umd.js +3 -3
  12. package/dist/maestro-web-sdk.umd.js.map +1 -1
  13. package/dist/modules/bets/types/BetsAnalyticsTypes.d.ts +8 -0
  14. package/dist/modules/bets/view/SixPack/SixPackView.d.ts +1 -0
  15. package/dist/modules/bets/view/UserBets/UserBetsView.d.ts +0 -1
  16. package/dist/modules/bets/view/components/PromoCodeBanner/PromoCodeBanner.d.ts +1 -0
  17. package/dist/modules/bets/view-model/BetsViewModel.d.ts +15 -1
  18. package/dist/modules/key-plays/view-model/KeyPlaysViewModel.d.ts +4 -0
  19. package/dist/modules/stats/interfaces/IStats.d.ts +1 -1
  20. package/dist/modules/stats/view/ActiveAthletes/ActiveAthletes.d.ts +1 -0
  21. package/dist/modules/stats/view/ActiveAthletes/CollapsedAthletes/CollapsedAthletes.d.ts +1 -1
  22. package/dist/modules/stats/view/ActiveAthletes/ExpandedAthletes/ExpandedAthletes.d.ts +1 -1
  23. package/dist/modules/stats/view/DriveSummary/DriveSummary.d.ts +1 -0
  24. package/dist/modules/stats/view/GameLeaders/GameLeaders.d.ts +1 -0
  25. package/dist/modules/stats/view/StatsItemView.d.ts +2 -0
  26. package/dist/modules/stats/view/StatsView.d.ts +1 -0
  27. package/dist/modules/stats/view-model/StatsViewModel.d.ts +11 -2
  28. package/dist/services/AnalyticsService/AnalyticsService.d.ts +49 -0
  29. package/dist/services/AnalyticsService/types.d.ts +65 -0
  30. package/dist/services/InsightsService/InsightsPayloadBuilder.d.ts +280 -0
  31. package/dist/services/InsightsService/InsightsService.d.ts +10 -0
  32. package/dist/services/NetworkManager/NetworkManager.d.ts +2 -17
  33. package/dist/services/NetworkManager/types.d.ts +0 -4
  34. package/dist/services/PageService/PageService.d.ts +8 -0
  35. package/dist/services/PageService/index.d.ts +2 -0
  36. package/dist/services/PageService/mocks.d.ts +2 -0
  37. package/dist/services/PageService/types.d.ts +53 -0
  38. package/dist/view-models/PanelManagerViewModel.d.ts +13 -7
  39. package/package.json +1 -1
@@ -1,12 +1,7 @@
1
+ import { Environment } from '@/index';
1
2
  import { ICacheManager } from '../../external/ports/cacheManager';
2
3
  import { INetworkClient } from '../../external/ports/networkClient';
3
- export declare const WorkingEnvironment: {
4
- readonly DEVELOPMENT: "development";
5
- readonly STAGING: "staging";
6
- readonly PRODUCTION: "production";
7
- };
8
- export type WorkingEnvironment = typeof WorkingEnvironment[keyof typeof WorkingEnvironment];
9
- export declare const MAESTRO_BASE_URLS: Record<WorkingEnvironment, string>;
4
+ export declare const MAESTRO_BASE_URLS: Record<Environment, string>;
10
5
  export declare const SDK_FLAVOR = "MaestroKit_Web";
11
6
  export declare const ENDPOINTS: {
12
7
  CAN_I_PLAY: string;
@@ -22,7 +17,6 @@ export declare const HttpMethod: {
22
17
  };
23
18
  export type HttpMethod = typeof HttpMethod[keyof typeof HttpMethod];
24
19
  export interface NetworkManagerOptions {
25
- environment?: WorkingEnvironment;
26
20
  networkClient?: INetworkClient;
27
21
  externalNetworkClient?: INetworkClient;
28
22
  externalBaseURL?: string;
@@ -33,18 +27,9 @@ declare class NetworkManager {
33
27
  private cacheManager;
34
28
  private maestroClient;
35
29
  private externalClient;
36
- private environment;
37
30
  private pollingTasks;
38
31
  private localStorage;
39
32
  constructor(options?: NetworkManagerOptions, localStorageOverride?: Storage);
40
- /**
41
- * Sets the working environment (development, staging, production)
42
- */
43
- setEnvironment(environment: WorkingEnvironment): void;
44
- /**
45
- * Get current environment
46
- */
47
- getEnvironment(): WorkingEnvironment;
48
33
  /**
49
34
  * Set authentication for Maestro APIs
50
35
  */
@@ -1,4 +1,3 @@
1
- import { WorkingEnvironment } from './NetworkManager';
2
1
  /**
3
2
  * Service types for different NetworkManager contexts
4
3
  */
@@ -14,7 +13,6 @@ export type ServiceType = typeof ServiceType[keyof typeof ServiceType];
14
13
  export interface ServiceNetworkManagerConfig {
15
14
  serviceType: ServiceType;
16
15
  externalBaseURL: string;
17
- environment?: WorkingEnvironment;
18
16
  defaultCacheDuration?: number;
19
17
  }
20
18
  /**
@@ -23,7 +21,6 @@ export interface ServiceNetworkManagerConfig {
23
21
  export interface IServiceNetworkManager {
24
22
  readonly serviceType: ServiceType;
25
23
  readonly externalBaseURL: string;
26
- getEnvironment(): WorkingEnvironment;
27
24
  externalApiRequest<T = any>(options: {
28
25
  endpoint: string;
29
26
  method?: string;
@@ -72,6 +69,5 @@ export type ServiceNetworkManager = IStatsNetworkManager | IBetsNetworkManager |
72
69
  * Factory configuration for different service types
73
70
  */
74
71
  export interface NetworkManagerFactoryConfig {
75
- environment?: WorkingEnvironment;
76
72
  defaultCacheDuration?: number;
77
73
  }
@@ -0,0 +1,8 @@
1
+ import { Observable } from '../../helpers/Observable';
2
+ import { PageConfig } from './types';
3
+ export default class PageService {
4
+ configObservable: Observable<PageConfig | null>;
5
+ private client;
6
+ constructor();
7
+ fetchPageConfig(siteId: string, eventId: string): Promise<PageConfig | null>;
8
+ }
@@ -0,0 +1,2 @@
1
+ import PageService from './PageService';
2
+ export default PageService;
@@ -0,0 +1,2 @@
1
+ import { PageConfig } from './types';
2
+ export declare const MOCK_PAGE_CONFIG: PageConfig;
@@ -0,0 +1,53 @@
1
+ import ITheme from '@/models/ITheme';
2
+ interface PageConfigPanel {
3
+ _id: string;
4
+ slug: string;
5
+ panel_name?: string;
6
+ panel_type?: string;
7
+ icon_name?: string;
8
+ }
9
+ export type PageMetadata = {
10
+ /**
11
+ * Event ID or Airing ID
12
+ */
13
+ external_field_1?: string;
14
+ /**
15
+ * Sport guid
16
+ */
17
+ external_field_2?: string;
18
+ /**
19
+ * League guid
20
+ */
21
+ external_field_3?: string;
22
+ /**
23
+ * External field 1 identifier. Can be either 'airing' or 'event'.
24
+ */
25
+ external_field_4?: 'airing' | 'event';
26
+ /**
27
+ * A stringified JSON object containing additional metadata.
28
+ */
29
+ external_field_5?: string;
30
+ };
31
+ export interface PageConfig {
32
+ panels: PageConfigPanel[];
33
+ page: {
34
+ _id: string;
35
+ slug: string;
36
+ type: string;
37
+ name?: string;
38
+ metadata?: PageMetadata;
39
+ };
40
+ insights: {
41
+ _id: string | null;
42
+ };
43
+ site: {
44
+ _id: string;
45
+ domainUrl: string;
46
+ package: {
47
+ version: string;
48
+ id: string;
49
+ };
50
+ };
51
+ theme?: ITheme | null;
52
+ }
53
+ export {};
@@ -1,5 +1,9 @@
1
1
  import { Observable } from '../helpers/Observable';
2
2
  import { MaestroPanelType } from '../models/IPanel';
3
+ export type PanelInfo = {
4
+ type: MaestroPanelType;
5
+ title: string;
6
+ };
3
7
  export declare class PanelManagerViewModel {
4
8
  private _panels;
5
9
  private _currentPanel;
@@ -7,6 +11,7 @@ export declare class PanelManagerViewModel {
7
11
  private settingsManager;
8
12
  private settingsUnsubscribe;
9
13
  private readonly ALL_PANELS;
14
+ private getAvailablePanelsFromConfig;
10
15
  constructor();
11
16
  /**
12
17
  * Initialize panels based on current settings
@@ -17,9 +22,10 @@ export declare class PanelManagerViewModel {
17
22
  */
18
23
  private subscribeToSettingsChanges;
19
24
  /**
20
- * Filter panels based on user settings
25
+ * Filter panels based on user settings and page config
21
26
  */
22
- private filterPanelsBasedOnSettings;
27
+ private filterPanels;
28
+ private updateActivePanel;
23
29
  /**
24
30
  * Update panels when settings change
25
31
  */
@@ -28,11 +34,11 @@ export declare class PanelManagerViewModel {
28
34
  * Cleanup subscriptions
29
35
  */
30
36
  cleanup(): void;
31
- get panels(): MaestroPanelType[];
32
- get panelsObservable(): Observable<MaestroPanelType[]>;
33
- get currentPanel(): MaestroPanelType;
34
- set currentPanel(value: MaestroPanelType);
35
- get currentPanelObservable(): Observable<MaestroPanelType>;
37
+ get panels(): PanelInfo[];
38
+ get panelsObservable(): Observable<PanelInfo[]>;
39
+ get currentPanel(): MaestroPanelType | null;
40
+ set currentPanel(value: MaestroPanelType | null);
41
+ get currentPanelObservable(): Observable<MaestroPanelType | null>;
36
42
  get newlyFocusedPanel(): MaestroPanelType | null;
37
43
  set newlyFocusedPanel(value: MaestroPanelType | null);
38
44
  getIndex(forPanelType: MaestroPanelType): number | null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maestro_io/maestro-web-sdk",
3
3
  "private": false,
4
- "version": "2.2.1",
4
+ "version": "2.2.3",
5
5
  "type": "commonjs",
6
6
  "license": "MIT",
7
7
  "main": "dist/maestro-web-sdk.umd.js",