@sportsbroker/firebase-structure 3.24.0-28 → 3.24.0-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.
@@ -0,0 +1,13 @@
1
+ types:
2
+ - build
3
+ - chore
4
+ - ci
5
+ - docs
6
+ - feat
7
+ - fix
8
+ - improvement
9
+ - perf
10
+ - refactor
11
+ - revert
12
+ - style
13
+ - test
package/CHANGELOG.md CHANGED
@@ -2,206 +2,6 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
- ## [3.24.0-28](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-26...v3.24.0-28) (2021-05-27)
6
-
7
-
8
- ### Features
9
-
10
- * added penalty shootout events ([c62dba9](https://github.com/SportsBroker-HQ/firebase-structure/commit/c62dba96d138bd3215ab3b437b2d93ccdf272990))
11
- * identify player by quasi unique id ([71f9554](https://github.com/SportsBroker-HQ/firebase-structure/commit/71f955447310c75d6ffa9f00dff3ba9a722aee6a))
12
-
13
- ## [3.24.0-27](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-26...v3.24.0-27) (2021-05-20)
14
-
15
-
16
- ### Features
17
-
18
- * identify player by quasi unique id ([71f9554](https://github.com/SportsBroker-HQ/firebase-structure/commit/71f955447310c75d6ffa9f00dff3ba9a722aee6a))
19
-
20
- ## [3.24.0-26](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-16...v3.24.0-26) (2021-05-20)
21
-
22
-
23
- ### Features
24
-
25
- * add missed penalty event, add period to events ([42293fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/42293feefc383900fa456d8dfef80ade0581c3b6))
26
- * add short name to league table ([db3a43f](https://github.com/SportsBroker-HQ/firebase-structure/commit/db3a43f11484f3c6c42bc87261b7dbeebcca3a87))
27
- * add temporaryTeams ([3e0c94b](https://github.com/SportsBroker-HQ/firebase-structure/commit/3e0c94b16db3f364555adf2bf53a7227db7efbab))
28
- * add tournament type to match ([07a9531](https://github.com/SportsBroker-HQ/firebase-structure/commit/07a9531a80f4756a6264e87bb0c4c1c59f76943a))
29
- * add tournament type to match ([f6bb925](https://github.com/SportsBroker-HQ/firebase-structure/commit/f6bb9257d6c2848a09cf06153c42a8209e0086ff))
30
- * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
31
- * added tournament stage ([2b189d7](https://github.com/SportsBroker-HQ/firebase-structure/commit/2b189d7bec15763309200736e8554fcbf98c656d))
32
- * make sub player in optional ([2f66535](https://github.com/SportsBroker-HQ/firebase-structure/commit/2f66535bb82037854865ebd0d37bca5b7cb443b8))
33
- * mark teams as optional ([98a7b6b](https://github.com/SportsBroker-HQ/firebase-structure/commit/98a7b6b9daabceb41f6450f6ff6e51054248b37f))
34
- * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
35
- * new match statistics [ch14445] ([e1b598e](https://github.com/SportsBroker-HQ/firebase-structure/commit/e1b598eaf702948e33c27d9e6fccf95e53c6cafa))
36
-
37
-
38
- ### Bug Fixes
39
-
40
- * converted commentary type from enum to strings union ([#144](https://github.com/SportsBroker-HQ/firebase-structure/issues/144)) ([97e0fbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/97e0fbedea00b2e9a70b1ee41db7c6fd286f2b15))
41
-
42
- ## [3.24.0-25](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-24...v3.24.0-25) (2021-05-19)
43
-
44
-
45
- ### Features
46
-
47
- * add tournament type to match ([f6bb925](https://github.com/SportsBroker-HQ/firebase-structure/commit/f6bb9257d6c2848a09cf06153c42a8209e0086ff))
48
-
49
- ## [3.24.0-24](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-23...v3.24.0-24) (2021-05-17)
50
-
51
-
52
- ### Features
53
-
54
- * add tournament type to match ([07a9531](https://github.com/SportsBroker-HQ/firebase-structure/commit/07a9531a80f4756a6264e87bb0c4c1c59f76943a))
55
-
56
- ## [3.24.0-23](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-22...v3.24.0-23) (2021-05-17)
57
-
58
-
59
- ### Features
60
-
61
- * add temporaryTeams ([3e0c94b](https://github.com/SportsBroker-HQ/firebase-structure/commit/3e0c94b16db3f364555adf2bf53a7227db7efbab))
62
-
63
- ## [3.24.0-22](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-21...v3.24.0-22) (2021-05-14)
64
-
65
-
66
- ### Features
67
-
68
- * add missed penalty event, add period to events ([42293fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/42293feefc383900fa456d8dfef80ade0581c3b6))
69
-
70
- ## [3.24.0-21](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-20...v3.24.0-21) (2021-05-12)
71
-
72
-
73
- ### Features
74
-
75
- * add short name to league table ([db3a43f](https://github.com/SportsBroker-HQ/firebase-structure/commit/db3a43f11484f3c6c42bc87261b7dbeebcca3a87))
76
-
77
- ## [3.24.0-20](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-19...v3.24.0-20) (2021-05-11)
78
-
79
-
80
- ### Features
81
-
82
- * mark teams as optional ([98a7b6b](https://github.com/SportsBroker-HQ/firebase-structure/commit/98a7b6b9daabceb41f6450f6ff6e51054248b37f))
83
-
84
- ## [3.24.0-19](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-17...v3.24.0-19) (2021-05-10)
85
-
86
-
87
- ### Features
88
-
89
- * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
90
- * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
91
-
92
-
93
- ### Bug Fixes
94
-
95
- * converted commentary type from enum to strings union ([#144](https://github.com/SportsBroker-HQ/firebase-structure/issues/144)) ([97e0fbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/97e0fbedea00b2e9a70b1ee41db7c6fd286f2b15))
96
-
97
- ## [3.24.0-18](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-17...v3.24.0-18) (2021-05-10)
98
-
99
-
100
- ### Features
101
-
102
- * added match commentary types ([21c5791](https://github.com/SportsBroker-HQ/firebase-structure/commit/21c5791d7f86debd3a003ce2c930944104fbcd7b))
103
- * new match statistics [ch14445] ([619f873](https://github.com/SportsBroker-HQ/firebase-structure/commit/619f873a61de094d9c9dd8db11c2b16580b52051))
104
-
105
-
106
- ### Bug Fixes
107
-
108
- * converted commentary type from enum to strings union ([#144](https://github.com/SportsBroker-HQ/firebase-structure/issues/144)) ([97e0fbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/97e0fbedea00b2e9a70b1ee41db7c6fd286f2b15))
109
-
110
- ## [3.24.0-17](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-16...v3.24.0-17) (2021-05-06)
111
-
112
-
113
- ### Features
114
-
115
- * make sub player in optional ([2f66535](https://github.com/SportsBroker-HQ/firebase-structure/commit/2f66535bb82037854865ebd0d37bca5b7cb443b8))
116
- * new match statistics [ch14445] ([e1b598e](https://github.com/SportsBroker-HQ/firebase-structure/commit/e1b598eaf702948e33c27d9e6fccf95e53c6cafa))
117
-
118
- ## [3.24.0-16](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-15...v3.24.0-16) (2021-04-23)
119
-
120
-
121
- ### Features
122
-
123
- * adjust head to head structure ([a9e03d0](https://github.com/SportsBroker-HQ/firebase-structure/commit/a9e03d09e5632b0a52ab0fd13559320a6ba62fda))
124
-
125
- ## [3.24.0-15](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-14...v3.24.0-15) (2021-04-21)
126
-
127
- ## [3.24.0-14](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-13...v3.24.0-14) (2021-04-21)
128
-
129
-
130
- ### Bug Fixes
131
-
132
- * prevent remove of stages/groups ([cf92497](https://github.com/SportsBroker-HQ/firebase-structure/commit/cf9249774fa323eb2317e70488593e9b2c162686))
133
-
134
- ## [3.24.0-13](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-12...v3.24.0-13) (2021-04-21)
135
-
136
-
137
- ### Features
138
-
139
- * set prev/next match as optional ([fa64283](https://github.com/SportsBroker-HQ/firebase-structure/commit/fa64283cd8059db43baeefa4c75c04b97652125e))
140
-
141
- ## [3.24.0-12](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-11...v3.24.0-12) (2021-04-21)
142
-
143
-
144
- ### Features
145
-
146
- * add stages, groups ([7e0bf8f](https://github.com/SportsBroker-HQ/firebase-structure/commit/7e0bf8f96d65e84abb4e463ef0dd0f2ca643467a))
147
-
148
- ## [3.24.0-11](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-10...v3.24.0-11) (2021-04-19)
149
-
150
-
151
- ### Features
152
-
153
- * add match team predicate ([1b01393](https://github.com/SportsBroker-HQ/firebase-structure/commit/1b013931dd54e080569fd01b5a2f1a60cc982432))
154
-
155
- ## [3.24.0-10](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-9...v3.24.0-10) (2021-04-19)
156
-
157
-
158
- ### Bug Fixes
159
-
160
- * revert snapshots structures ([4dffdbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/4dffdbeadde47e7cd977be4d639c1b2a013015fc))
161
-
162
- ## [3.24.0-9](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-7...v3.24.0-9) (2021-04-16)
163
-
164
-
165
- ### Features
166
-
167
- * added type and countryCode to SeasonOverview ([dc420fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/dc420fe7566bb8bd0721668c449847b84a576588))
168
- * adjust events teamId ([afc6b72](https://github.com/SportsBroker-HQ/firebase-structure/commit/afc6b727dfa5e0ba2cb558c54d7e15453a6a5efd))
169
-
170
- ## [3.24.0-8](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-7...v3.24.0-8) (2021-04-16)
171
-
172
-
173
- ### Features
174
-
175
- * added type and countryCode to SeasonOverview ([dc420fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/dc420fe7566bb8bd0721668c449847b84a576588))
176
-
177
- ## [3.24.0-7](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-6...v3.24.0-7) (2021-04-15)
178
-
179
-
180
- ### Features
181
-
182
- * adjust match scores schema ([e34e1d3](https://github.com/SportsBroker-HQ/firebase-structure/commit/e34e1d313256cd330105f436e90caeaebb5293c9))
183
-
184
- ## [3.24.0-6](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-5...v3.24.0-6) (2021-04-15)
185
-
186
-
187
- ### Features
188
-
189
- * adjust match scores schema ([c18bbe3](https://github.com/SportsBroker-HQ/firebase-structure/commit/c18bbe3ea23151a7567d226da57ca3914a35be9a))
190
-
191
- ## [3.24.0-5](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-3...v3.24.0-5) (2021-04-14)
192
-
193
-
194
- ### Features
195
-
196
- * adjust head2head structure ([39ee387](https://github.com/SportsBroker-HQ/firebase-structure/commit/39ee38764e4ff0aee5224207bfb83933ebae11b8))
197
-
198
- ## [3.24.0-4](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-3...v3.24.0-4) (2021-04-14)
199
-
200
-
201
- ### Features
202
-
203
- * adjust head2head structure ([39ee387](https://github.com/SportsBroker-HQ/firebase-structure/commit/39ee38764e4ff0aee5224207bfb83933ebae11b8))
204
-
205
5
  ## [3.24.0-3](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-2...v3.24.0-3) (2021-04-14)
206
6
 
207
7
 
@@ -5,11 +5,10 @@ import { Shares } from "./shares";
5
5
  import { Stats } from "./stats";
6
6
  import { Teams } from "./teams";
7
7
  import { Lineups } from "./lineups";
8
+ import { Referees } from "./referees";
8
9
  import { Stories } from "./stories";
9
10
  import { Commentaries } from "./commentaries";
10
11
  import { HeadToHeadStats } from "./h2h";
11
- import { MatchTeamPredicates } from "./matchTeamPredicate";
12
- import { MatchOfficials } from "./officials";
13
12
 
14
13
  export interface Matches {
15
14
  events: Events;
@@ -20,8 +19,7 @@ export interface Matches {
20
19
  teams: Teams;
21
20
  h2h?: HeadToHeadStats;
22
21
  lineups?: Lineups;
23
- officials?: MatchOfficials;
22
+ referees?: Referees;
24
23
  stories?: Stories;
25
24
  commentaries?: Commentaries;
26
- predicates?: MatchTeamPredicates;
27
25
  }
@@ -1,7 +1,6 @@
1
1
  export interface CommentaryItem {
2
2
  period: number;
3
3
  content: string;
4
- type: CommentaryType;
5
4
  time: {
6
5
  minutes: number;
7
6
  seconds: number;
@@ -9,24 +8,10 @@ export interface CommentaryItem {
9
8
  };
10
9
  }
11
10
 
12
- export type CommentaryType =
13
- | 'assist'
14
- | 'comment'
15
- | 'full time'
16
- | 'goal'
17
- | 'half time'
18
- | 'comment_important'
19
- | 'kick off'
20
- | 'penalty'
21
- | 'red card'
22
- | 'second_yellow red card'
23
- | 'secondyellow card'
24
- | 'substitution'
25
- | 'var'
26
- | 'yellow card';
27
-
28
11
  export interface Commentaries {
29
12
  [sportID: string]: {
30
- [matchID: string]: CommentaryItem[];
13
+ [matchID: string]: {
14
+ [commentaryID: string]: CommentaryItem;
15
+ };
31
16
  };
32
17
  }
@@ -1,13 +1,6 @@
1
- import { TeamSide, PlayerID, TeamID, MatchPeriod } from "../../global";
1
+ import { NumericID, TeamSide } from "../../global";
2
2
 
3
- type EventType =
4
- | "YELLOW_CARD"
5
- | "RED_CARD"
6
- | "GOAL"
7
- | "SUBSTITUTION"
8
- | "MISSED_PENALTY"
9
- | "PENALTY_SHOOTOUT_GOAL"
10
- | "PENALTY_SHOOTOUT_MISS";
3
+ type EventType = "YELLOW_CARD" | "RED_CARD" | "GOAL" | "SUBSTITUTION";
11
4
 
12
5
  interface EventTime {
13
6
  minutes: number;
@@ -19,14 +12,13 @@ interface BaseEvent {
19
12
  type: EventType;
20
13
  time: EventTime;
21
14
  teamType: TeamSide;
22
- teamId: TeamID;
23
- period: MatchPeriod;
15
+ teamId: NumericID;
24
16
  }
25
17
 
26
18
  interface RedCardEvent extends BaseEvent {
27
19
  type: "RED_CARD";
28
20
  isSecondYellow?: boolean;
29
- playerId: PlayerID;
21
+ playerId: NumericID;
30
22
  playerName: string;
31
23
  playerShirtName: string;
32
24
  playerUniform: string;
@@ -34,7 +26,7 @@ interface RedCardEvent extends BaseEvent {
34
26
 
35
27
  interface YellowCardEvent extends BaseEvent {
36
28
  type: "YELLOW_CARD";
37
- playerId: PlayerID;
29
+ playerId: NumericID;
38
30
  playerName: string;
39
31
  playerShirtName: string;
40
32
  playerUniform: string;
@@ -42,31 +34,14 @@ interface YellowCardEvent extends BaseEvent {
42
34
 
43
35
  interface GoalEvent extends BaseEvent {
44
36
  type: "GOAL";
45
- assistingPlayerId?: PlayerID;
37
+ assistingPlayerId?: NumericID;
46
38
  assistingPlayerName?: string;
47
39
  assistingPlayerShirtName?: string;
48
40
  assistingPlayerUniform?: string;
49
41
  goalNumber: number;
50
42
  penalty?: boolean;
51
43
  ownGoal?: boolean;
52
- playerId: PlayerID;
53
- playerName: string;
54
- playerShirtName: string;
55
- playerUniform: string;
56
- }
57
-
58
- interface PenaltyShootoutShotEvent extends BaseEvent {
59
- type: "PENALTY_SHOOTOUT_GOAL" | "PENALTY_SHOOTOUT_MISS";
60
- playerId: PlayerID;
61
- playerName: string;
62
- playerShirtName: string;
63
- playerUniform: string;
64
- teamPenaltyNumber: number;
65
- }
66
-
67
- interface MissedPenaltyEvent extends BaseEvent {
68
- type: "MISSED_PENALTY";
69
- playerId: PlayerID;
44
+ playerId: NumericID;
70
45
  playerName: string;
71
46
  playerShirtName: string;
72
47
  playerUniform: string;
@@ -74,11 +49,11 @@ interface MissedPenaltyEvent extends BaseEvent {
74
49
 
75
50
  interface SubstitutionEvent extends BaseEvent {
76
51
  type: "SUBSTITUTION";
77
- playerInId?: PlayerID;
78
- playerInName?: string;
79
- playerInShirtName?: string;
80
- playerInUniform?: string;
81
- playerOutId: PlayerID;
52
+ playerInId: NumericID;
53
+ playerInName: string;
54
+ playerInShirtName: string;
55
+ playerInUniform: string;
56
+ playerOutId: NumericID;
82
57
  playerOutName: string;
83
58
  playerOutShirtName: string;
84
59
  playerOutUniform: string;
@@ -91,9 +66,7 @@ export interface Events {
91
66
  | YellowCardEvent
92
67
  | RedCardEvent
93
68
  | GoalEvent
94
- | MissedPenaltyEvent
95
- | SubstitutionEvent
96
- | PenaltyShootoutShotEvent;
69
+ | SubstitutionEvent;
97
70
  };
98
71
  };
99
72
  }
@@ -1,21 +1,9 @@
1
- export interface TeamHeadToHeadStats {
2
- wins: number;
1
+ export interface HeadToHeadTeamStats {
3
2
  goals: number;
4
- }
5
-
6
- export interface TeamsHeadToHeadStats {
7
- [teamId: string]: TeamHeadToHeadStats;
3
+ wins: number;
8
4
  }
9
5
 
10
6
  export interface HeadToHeadStats {
11
- teamsData: TeamsHeadToHeadStats;
12
- draws: number;
13
- }
14
-
15
- // h2hId - "<teamAId>_<teamBId>" or "<teamBId>_<teamAId>"
16
-
17
- export interface HeadToHead {
18
- [sportId: string]: {
19
- [h2hId: string]: HeadToHeadStats,
20
- }
7
+ home: HeadToHeadTeamStats;
8
+ away: HeadToHeadTeamStats;
21
9
  }
@@ -1,7 +1,5 @@
1
- import { PlayerID } from '../../global';
2
-
3
1
  export interface Player {
4
- playerId: PlayerID;
2
+ playerId: number;
5
3
  displayName: string;
6
4
  shirtName: string;
7
5
  uniform: string;
@@ -1,4 +1,4 @@
1
- import {Group, ISODate, MatchID, MatchPeriod, MatchStatus, SeasonID, Stage} from "../../global";
1
+ import {ISODate, MatchID, MatchPeriod, MatchStatus, SeasonID} from "../../global";
2
2
 
3
3
  export interface MatchTime {
4
4
  minutes: number;
@@ -18,11 +18,8 @@ export interface MatchOverview {
18
18
  roundNb: number;
19
19
  originalRoundNb: number;
20
20
  isTba: boolean;
21
- stage?: Stage;
22
- group?: Group;
23
21
  eventStatus: EventStatus;
24
22
  season: SeasonID;
25
- tournamentType: 'DOMESTIC' | 'INTERNATIONAL';
26
23
  }
27
24
 
28
25
  export interface Overviews {
@@ -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
+ }
@@ -1,10 +1,9 @@
1
1
  export interface Score {
2
- home: number | null;
3
- away: number | null;
2
+ home: number;
3
+ away: number;
4
4
  }
5
5
 
6
- // @TODO: change to firstHalf, fullTime, overtime
7
- export interface MatchPeriods {
6
+ export interface MatchPeriods{
8
7
  firstHalf: Score;
9
8
  secondHalf?: Score;
10
9
  firstOvertime?: Score;
@@ -12,8 +11,8 @@ export interface MatchPeriods {
12
11
  }
13
12
 
14
13
  export interface MatchScore {
15
- home: number | null;
16
- away: number | null;
14
+ home: number;
15
+ away: number;
17
16
  periods: MatchPeriods;
18
17
  shootoutPenalties?: Score;
19
18
  }
@@ -3,78 +3,36 @@ export interface TeamsStats {
3
3
  away: number;
4
4
  }
5
5
 
6
- /**
7
- * @see: https://sportsbroker.slite.com/app/channels/VOZ0prjzHu/notes/tOQ3uR_FUT
8
- */
9
- export interface MatchStats {
10
- // possession
11
- possessionPercentageLast15: TeamsStats,
12
- possessionPercentageLast30: TeamsStats,
6
+ export interface MatchStats {
13
7
  possession: TeamsStats,
14
- possessionLosses: TeamsStats,
15
- possessionWonAttThird: TeamsStats,
16
- possessionWonDefThird: TeamsStats,
17
- possessionWonMidThird: TeamsStats,
18
-
19
- // shots
20
- bigChanceCreated: TeamsStats,
21
- bigChanceMissed: TeamsStats,
22
- bigChanceScored: TeamsStats,
23
- crossbarHits: TeamsStats,
24
- postHitsLeft: TeamsStats,
25
- postHitsRight: TeamsStats,
26
- shots: TeamsStats,
27
- shotsOffTarget: TeamsStats,
8
+ attackingThirdPossession: TeamsStats,
9
+ ownThirdPossession: TeamsStats,
28
10
  shotsOnTarget: TeamsStats,
29
- woodwork: TeamsStats,
30
-
31
- // attacking
32
- goalAssists: TeamsStats,
33
- freeKickAwarded: TeamsStats,
34
- fastbreak: TeamsStats,
11
+ shotsOffTarget: TeamsStats,
12
+ clearances: TeamsStats,
35
13
  corners: TeamsStats,
36
- throws: TeamsStats,
37
14
  offsides: TeamsStats,
38
-
39
- // defensive
40
- fouls: TeamsStats,
41
- saves: TeamsStats,
42
- penaltySave: TeamsStats,
43
- ownGoals: TeamsStats,
44
- interceptionsInBox: TeamsStats,
45
- clearance: TeamsStats,
15
+ passes: TeamsStats,
46
16
  interceptions: TeamsStats,
17
+ penalties: TeamsStats,
18
+ shots: TeamsStats,
19
+ ownGoals: TeamsStats,
20
+ saves: TeamsStats,
21
+ freeKickAwarded: TeamsStats,
22
+ freeKickConceded: TeamsStats,
47
23
  crossBlocked: TeamsStats,
48
- shotBlocked: TeamsStats,
49
24
  tackles: TeamsStats,
50
-
51
- //passing
52
- passes: TeamsStats,
53
- backwardPass: TeamsStats,
54
- forwardPass: TeamsStats,
55
- successfulCrosses: TeamsStats,
56
- unsuccessfulCrosses: TeamsStats,
57
- successfulPasses: TeamsStats,
58
- unsuccessfulPasses: TeamsStats,
59
- successfulLongBalls: TeamsStats,
60
- unsuccessfulLongBalls: TeamsStats,
61
- penaltyAreaEntries: TeamsStats,
62
-
63
- // 1vs1
64
- duelsWon: TeamsStats,
65
- duelsLost: TeamsStats,
66
- groundDuelsWon: TeamsStats,
67
- groundDuelsLost: TeamsStats,
68
- aerialDuelsWon: TeamsStats,
69
- aerialDuelsLost: TeamsStats,
70
- oneOnOneShotAttempt: TeamsStats,
71
-
72
- // discipline
25
+ touches: TeamsStats,
73
26
  yellowCards: TeamsStats,
74
27
  redCards: TeamsStats,
75
- penaltyGoal: TeamsStats,
76
- penaltyConceded: TeamsStats,
77
- penaltyTaken: TeamsStats,
28
+ foulsConceded: TeamsStats,
29
+ groundDuelsWon: TeamsStats,
30
+ aerialDuelsWon: TeamsStats,
31
+ punches: TeamsStats,
32
+ cornerKicks: TeamsStats,
33
+ successfulPasses: TeamsStats,
34
+ successfulCrosses: TeamsStats,
35
+ unsuccessfulPasses: TeamsStats,
78
36
  }
79
37
 
80
38
  export interface Stats {
@@ -10,8 +10,8 @@ export interface MatchTeam {
10
10
  export interface Teams {
11
11
  [sportID: string]: {
12
12
  [matchID: string]: {
13
- home?: MatchTeam;
14
- away?: MatchTeam;
13
+ home: MatchTeam;
14
+ away: MatchTeam;
15
15
  };
16
16
  };
17
17
  }
@@ -1,6 +1,5 @@
1
1
  import { Overviews } from "./overviews";
2
2
  import { TeamsInSeasons } from "./teams";
3
- import { Stages } from "./stages";
4
3
 
5
4
  export interface Seasons {
6
5
  overviews: Overviews;
@@ -1,10 +1,6 @@
1
1
  import { ISODate, Image, SeasonID } from "../../global";
2
- import {Stages} from "./stages";
3
2
 
4
3
  export type SeasonState = 'UPCOMING' | 'ACTIVE' | 'FINISHED';
5
- export type SeasonType = 'DOMESTIC' | 'INTERNATIONAL';
6
- export type TournamentStage = 'group' | 'knockout';
7
-
8
4
 
9
5
  export interface SeasonOverview {
10
6
  endDate: ISODate;
@@ -15,10 +11,6 @@ export interface SeasonOverview {
15
11
  nextSeasonId?: string;
16
12
  state: SeasonState;
17
13
  logo?: Image;
18
- type: SeasonType;
19
- countryCode?: string;
20
- stages?: Stages;
21
- stage?: TournamentStage;
22
14
  }
23
15
 
24
16
  /**
@@ -8,12 +8,9 @@ export type NumericID = number;
8
8
  */
9
9
  export type MongoID = string;
10
10
 
11
-
12
- export type UUID = string;
13
-
14
11
  export type UserID = MongoID;
15
12
 
16
- export type TeamID = UUID;
13
+ export type TeamID = MongoID;
17
14
 
18
15
  /**
19
16
  * @type ISO ISODate
@@ -27,19 +24,12 @@ export type SportID = "soccer" | string;
27
24
 
28
25
  export type Language = "en" | "de" | string;
29
26
 
30
- export type MatchID = UUID;
27
+ export type MatchID = MongoID;
31
28
 
32
29
  export type SeasonID = string;
33
30
 
34
31
  export type GroupID = string;
35
32
 
36
- /**
37
- * Until we will support external player ids and there is need
38
- * to have match unique player ids it will be constructed as
39
- * concatenation of Team ID and Player uniform number
40
- *
41
- * ie. 5f4160de-72d3-4821-ae19-6bfb4f05a0c9_11
42
- */
43
33
  export type PlayerID = string;
44
34
 
45
35
  export type Percentage = number // 0.0-1.0
@@ -76,11 +66,3 @@ export interface WithSeasons {
76
66
  }
77
67
 
78
68
  export type Platforms = 'IOS' | 'WEB' | 'ANDROID';
79
-
80
- export interface Stage {
81
- id: string;
82
- }
83
-
84
- export interface Group {
85
- id: string;
86
- }
@@ -1,4 +1,4 @@
1
- import {Group, ISODate, MatchID, MatchStatus, Stage} from "../global";
1
+ import {ISODate, MatchID, MatchStatus} from "../global";
2
2
 
3
3
  export interface MatchQueryData {
4
4
  id: MatchID;
@@ -6,8 +6,6 @@ export interface MatchQueryData {
6
6
  realStartDate: ISODate; // Real start time, f.e match was delayed
7
7
  roundNb: number;
8
8
  matchStatus: MatchStatus;
9
- stage?: Stage;
10
- group?: Group;
11
9
  }
12
10
 
13
11
  interface Matches {
@@ -1,15 +1,4 @@
1
- import {
2
- Group,
3
- Image,
4
- ISODate,
5
- MatchPeriod,
6
- MatchResult,
7
- MatchSide,
8
- MatchStatus,
9
- Stage,
10
- TeamID,
11
- TeamSide
12
- } from "../global";
1
+ import {Image, ISODate, MatchPeriod, MatchResult, MatchSide, MatchStatus, TeamID, TeamSide} from "../global";
13
2
 
14
3
  export interface Team {
15
4
  id: TeamID;
@@ -20,10 +9,7 @@ export interface Team {
20
9
 
21
10
  export interface Opponent {
22
11
  score: number;
23
- name: string;
24
12
  teamId: string;
25
- abbreviation: string;
26
- logo?: Image;
27
13
  }
28
14
 
29
15
  export interface PreviousMatch {
@@ -56,11 +42,11 @@ export interface EventStatus {
56
42
 
57
43
  export interface MatchOverviewSnapshot {
58
44
  id: string;
59
- teams?: {
60
- home?: Team;
61
- away?: Team;
45
+ teams: {
46
+ home: Team;
47
+ away: Team;
62
48
  };
63
- score?: {
49
+ score: {
64
50
  home: number;
65
51
  away: number;
66
52
  };
@@ -68,13 +54,6 @@ export interface MatchOverviewSnapshot {
68
54
  home: Share;
69
55
  away: Share;
70
56
  };
71
- temporaryTeams?: {
72
- home?: string;
73
- away?: string;
74
- };
75
- tournamentType: 'DOMESTIC' | 'INTERNATIONAL';
76
- stage?: Stage;
77
- group?: Group;
78
57
  startDate: ISODate;
79
58
  roundNb: number;
80
59
  eventStatus: EventStatus;
@@ -1,30 +1,24 @@
1
1
  import { TeamRanking } from "../details/tables/ranking";
2
- import {Image, MatchResult} from "../global";
3
- import {Team} from "./matchOverviews";
4
-
5
- export interface MatchOveriew {
6
- vsTeam?: Team;
7
- result?: MatchResult;
8
- matchId?: string;
9
- startDate?: string;
10
- }
11
2
 
12
3
  export interface TeamTable {
13
- name: string;
14
- abbreviation: string;
15
- shortName: string;
16
- logo: Image;
17
4
  ranking: TeamRanking;
18
- groupId?: string;
19
5
  previousMatchId?: string;
20
6
  nextMatchId?: string;
21
- nextMatch?: MatchOveriew;
22
- previousMatch?: MatchOveriew;
23
7
  }
24
8
 
25
9
  export interface GroupTable {
26
10
  name: string;
27
- matchesIds: {[matchId: string]: true};
11
+ matchesIds: string[];
12
+ ranking: {
13
+ [teamID: string]: TeamRanking;
14
+ }
15
+ }
16
+
17
+ export interface SeasonTable {
18
+ groupIds?: string[];
19
+ table: {
20
+ [teamID: string]: TeamTable;
21
+ }
28
22
  }
29
23
 
30
24
  export interface TableSummary {
@@ -37,9 +31,7 @@ export interface TableSummary {
37
31
  };
38
32
  leagues: {
39
33
  [sportID: string]: {
40
- [seasonID: string]: {
41
- [teamID: string]: TeamTable;
42
- };
34
+ [seasonID: string]: SeasonTable;
43
35
  };
44
36
  };
45
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.24.0-28",
3
+ "version": "3.24.0-3",
4
4
  "description": "Firebase structure typings",
5
5
  "main": "index.d.ts",
6
6
  "repository": {
@@ -1,10 +0,0 @@
1
- export interface MatchTeamPredicate {
2
- // Winner of the current match will go to nextMatchWinnerId match
3
- nextMatchWinnerId: string;
4
- }
5
-
6
- export interface MatchTeamPredicates {
7
- [sportID: string]: {
8
- [matchID: string]: MatchTeamPredicate;
9
- }
10
- }
@@ -1,18 +0,0 @@
1
- export enum MatchOfficialType {
2
- FourthOfficial = 'Fourth official',
3
- Lineman1 = 'Lineman 1',
4
- Lineman2 = 'Lineman 2',
5
- Main = 'Main',
6
- }
7
-
8
- export interface MatchOfficial {
9
- firstName: string;
10
- lastName: string;
11
- officialType: MatchOfficialType;
12
- }
13
-
14
- export interface MatchOfficials {
15
- [sportID: string]: {
16
- [matchID: string]: MatchOfficial[];
17
- };
18
- }
@@ -1,12 +0,0 @@
1
- export interface Stage {
2
- name: string;
3
- matchesIds: { [matchId: string]: true };
4
- }
5
-
6
- export interface Stages {
7
- [sportId: string]: {
8
- [seasonId: string]: {
9
- [stageId: string]: Stage;
10
- }
11
- }
12
- }