@sportsbroker/firebase-structure 3.19.0 → 3.20.0-RC2

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.
@@ -4,6 +4,9 @@ import { Scores } from "./scores";
4
4
  import { Shares } from "./shares";
5
5
  import { Stats } from "./stats";
6
6
  import { Teams } from "./teams";
7
+ import { Lineups } from "./lineups";
8
+ import { Referees } from "./referees";
9
+ import { Stories } from "./stories";
7
10
 
8
11
  export interface Matches {
9
12
  events: Events;
@@ -12,4 +15,7 @@ export interface Matches {
12
15
  shares: Shares;
13
16
  stats: Stats;
14
17
  teams: Teams;
18
+ lineups: Lineups;
19
+ referees: Referees;
20
+ stories: Stories;
15
21
  }
@@ -1,9 +1,7 @@
1
- import { TeamID, TeamSide } from "../../global";
1
+ import {NumericID, TeamSide} from "../../global";
2
2
 
3
3
  type EventType = "YELLOW_CARD" | "RED_CARD" | "GOAL" | "SUBSTITUTION";
4
4
 
5
- type PlayerID = string;
6
-
7
5
  interface EventTime {
8
6
  minutes: number;
9
7
  seconds: number;
@@ -14,39 +12,45 @@ interface BaseEvent {
14
12
  type: EventType;
15
13
  time: EventTime;
16
14
  teamType: TeamSide;
17
- teamId: TeamID;
15
+ teamId: NumericID;
18
16
  }
19
17
 
20
18
  interface RedCardEvent extends BaseEvent {
21
19
  type: "RED_CARD";
22
20
  isSecondYellow?: boolean;
23
- playerId?: PlayerID;
21
+ playerId: NumericID;
24
22
  playerName: string;
23
+ playerUniform: string;
25
24
  }
26
25
 
27
26
  interface YellowCardEvent extends BaseEvent {
28
27
  type: "YELLOW_CARD";
29
- playerId?: PlayerID;
28
+ playerId: NumericID;
30
29
  playerName: string;
30
+ playerUniform: string;
31
31
  }
32
32
 
33
33
  interface GoalEvent extends BaseEvent {
34
34
  type: "GOAL";
35
- assistingPlayerId?: PlayerID;
35
+ assistingPlayerId: NumericID;
36
36
  assistingPlayerName: string;
37
+ assistingPlayerUniform: string;
37
38
  goalNumber: number;
38
39
  penalty?: boolean;
39
40
  ownGoal?: boolean;
40
- playerId?: PlayerID;
41
+ playerId?: NumericID;
41
42
  playerName: string;
43
+ playerUniform: string;
42
44
  }
43
45
 
44
46
  interface SubstitutionEvent extends BaseEvent {
45
47
  type: "SUBSTITUTION";
46
- playerInId?: PlayerID;
48
+ playerInId: NumericID;
47
49
  playerInName: string;
48
- playerOutId?: PlayerID;
50
+ playerInUniform: string;
51
+ playerOutId: NumericID;
49
52
  playerOutName: string;
53
+ playerOutUniform: string;
50
54
  }
51
55
 
52
56
  export interface Events {
@@ -0,0 +1,32 @@
1
+ import { PlayerID } from "../../global";
2
+
3
+ export interface Player {
4
+ playerId: PlayerID;
5
+ displayName: string;
6
+ shirtName: string;
7
+ uniform: string;
8
+ position?: string | null;
9
+ startingLineup: boolean;
10
+ isOnPitch: boolean;
11
+ formation?: number | null;
12
+ }
13
+
14
+ export interface TeamLineup {
15
+ name: string;
16
+ formation: string;
17
+ coach: string;
18
+ players: {
19
+ [playerID: string]: Player;
20
+ }
21
+ }
22
+
23
+ export interface MatchLineup {
24
+ home: TeamLineup;
25
+ away: TeamLineup;
26
+ }
27
+
28
+ export interface Lineups {
29
+ [sportID: string]: {
30
+ [matchID: string]: MatchLineup;
31
+ };
32
+ }
@@ -0,0 +1,13 @@
1
+ export interface MatchReferees {
2
+ referee: string;
3
+ refereeAssistants: string[];
4
+ fourthOfficial: string;
5
+ varOfficial: string;
6
+ varAssistants: string[];
7
+ }
8
+
9
+ export interface Referees {
10
+ [sportID: string]: {
11
+ [matchID: string]: MatchReferees;
12
+ };
13
+ }
@@ -0,0 +1,15 @@
1
+ export interface MatchStory {
2
+ header: string;
3
+ content: string[];
4
+ }
5
+
6
+ export interface MatchStories {
7
+ preview?: MatchStory;
8
+ recap?: MatchStory;
9
+ }
10
+
11
+ export interface Stories {
12
+ [sportID: string]: {
13
+ [matchID: string]: MatchStories;
14
+ };
15
+ }
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Numeric ID (e.g. from stats.com API)
3
+ */
4
+ export type NumericID = number;
5
+
1
6
  /**
2
7
  * 24-char ID
3
8
  */
@@ -25,6 +30,8 @@ export type SeasonID = string;
25
30
 
26
31
  export type GroupID = string;
27
32
 
33
+ export type PlayerID = string;
34
+
28
35
  export type Percentage = number // 0.0-1.0
29
36
 
30
37
  export interface Image {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.19.0",
3
+ "version": "3.20.0-RC2",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {