@sportsbroker/firebase-structure 3.24.0-17 → 3.24.0-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.
@@ -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,109 +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-17](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-16...v3.24.0-17) (2021-05-06)
6
-
7
-
8
- ### Features
9
-
10
- * make sub player in optional ([2f66535](https://github.com/SportsBroker-HQ/firebase-structure/commit/2f66535bb82037854865ebd0d37bca5b7cb443b8))
11
- * new match statistics [ch14445] ([e1b598e](https://github.com/SportsBroker-HQ/firebase-structure/commit/e1b598eaf702948e33c27d9e6fccf95e53c6cafa))
12
-
13
- ## [3.24.0-16](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-15...v3.24.0-16) (2021-04-23)
14
-
15
-
16
- ### Features
17
-
18
- * adjust head to head structure ([a9e03d0](https://github.com/SportsBroker-HQ/firebase-structure/commit/a9e03d09e5632b0a52ab0fd13559320a6ba62fda))
19
-
20
- ## [3.24.0-15](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-14...v3.24.0-15) (2021-04-21)
21
-
22
- ## [3.24.0-14](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-13...v3.24.0-14) (2021-04-21)
23
-
24
-
25
- ### Bug Fixes
26
-
27
- * prevent remove of stages/groups ([cf92497](https://github.com/SportsBroker-HQ/firebase-structure/commit/cf9249774fa323eb2317e70488593e9b2c162686))
28
-
29
- ## [3.24.0-13](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-12...v3.24.0-13) (2021-04-21)
30
-
31
-
32
- ### Features
33
-
34
- * set prev/next match as optional ([fa64283](https://github.com/SportsBroker-HQ/firebase-structure/commit/fa64283cd8059db43baeefa4c75c04b97652125e))
35
-
36
- ## [3.24.0-12](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-11...v3.24.0-12) (2021-04-21)
37
-
38
-
39
- ### Features
40
-
41
- * add stages, groups ([7e0bf8f](https://github.com/SportsBroker-HQ/firebase-structure/commit/7e0bf8f96d65e84abb4e463ef0dd0f2ca643467a))
42
-
43
- ## [3.24.0-11](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-10...v3.24.0-11) (2021-04-19)
44
-
45
-
46
- ### Features
47
-
48
- * add match team predicate ([1b01393](https://github.com/SportsBroker-HQ/firebase-structure/commit/1b013931dd54e080569fd01b5a2f1a60cc982432))
49
-
50
- ## [3.24.0-10](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-9...v3.24.0-10) (2021-04-19)
51
-
52
-
53
- ### Bug Fixes
54
-
55
- * revert snapshots structures ([4dffdbe](https://github.com/SportsBroker-HQ/firebase-structure/commit/4dffdbeadde47e7cd977be4d639c1b2a013015fc))
56
-
57
- ## [3.24.0-9](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-7...v3.24.0-9) (2021-04-16)
58
-
59
-
60
- ### Features
61
-
62
- * added type and countryCode to SeasonOverview ([dc420fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/dc420fe7566bb8bd0721668c449847b84a576588))
63
- * adjust events teamId ([afc6b72](https://github.com/SportsBroker-HQ/firebase-structure/commit/afc6b727dfa5e0ba2cb558c54d7e15453a6a5efd))
64
-
65
- ## [3.24.0-8](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-7...v3.24.0-8) (2021-04-16)
66
-
67
-
68
- ### Features
69
-
70
- * added type and countryCode to SeasonOverview ([dc420fe](https://github.com/SportsBroker-HQ/firebase-structure/commit/dc420fe7566bb8bd0721668c449847b84a576588))
71
-
72
- ## [3.24.0-7](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-6...v3.24.0-7) (2021-04-15)
73
-
74
-
75
- ### Features
76
-
77
- * adjust match scores schema ([e34e1d3](https://github.com/SportsBroker-HQ/firebase-structure/commit/e34e1d313256cd330105f436e90caeaebb5293c9))
78
-
79
- ## [3.24.0-6](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-5...v3.24.0-6) (2021-04-15)
80
-
81
-
82
- ### Features
83
-
84
- * adjust match scores schema ([c18bbe3](https://github.com/SportsBroker-HQ/firebase-structure/commit/c18bbe3ea23151a7567d226da57ca3914a35be9a))
85
-
86
- ## [3.24.0-5](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-3...v3.24.0-5) (2021-04-14)
87
-
88
-
89
- ### Features
90
-
91
- * adjust head2head structure ([39ee387](https://github.com/SportsBroker-HQ/firebase-structure/commit/39ee38764e4ff0aee5224207bfb83933ebae11b8))
92
-
93
- ## [3.24.0-4](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-3...v3.24.0-4) (2021-04-14)
94
-
95
-
96
- ### Features
97
-
98
- * adjust head2head structure ([39ee387](https://github.com/SportsBroker-HQ/firebase-structure/commit/39ee38764e4ff0aee5224207bfb83933ebae11b8))
99
-
100
- ## [3.24.0-3](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-2...v3.24.0-3) (2021-04-14)
101
-
102
-
103
- ### Features
104
-
105
- * add euro groups ([f990eb9](https://github.com/SportsBroker-HQ/firebase-structure/commit/f990eb908a16aee582f39c7341f74647c8032112))
106
- * adjust head2head structure ([523552b](https://github.com/SportsBroker-HQ/firebase-structure/commit/523552b539b79b8f7500af6b24d4291ab48f927d))
107
-
108
5
  ## [3.24.0-2](https://github.com/SportsBroker-HQ/firebase-structure/compare/v3.24.0-1...v3.24.0-2) (2021-04-12)
109
6
 
110
7
 
@@ -8,8 +8,6 @@ import { Lineups } from "./lineups";
8
8
  import { Referees } from "./referees";
9
9
  import { Stories } from "./stories";
10
10
  import { Commentaries } from "./commentaries";
11
- import { HeadToHeadStats } from "./h2h";
12
- import { MatchTeamPredicates } from "./matchTeamPredicate";
13
11
 
14
12
  export interface Matches {
15
13
  events: Events;
@@ -18,10 +16,8 @@ export interface Matches {
18
16
  shares: Shares;
19
17
  stats: Stats;
20
18
  teams: Teams;
21
- h2h?: HeadToHeadStats;
22
19
  lineups?: Lineups;
23
20
  referees?: Referees;
24
21
  stories?: Stories;
25
22
  commentaries?: Commentaries;
26
- predicates?: MatchTeamPredicates;
27
23
  }
@@ -1,4 +1,4 @@
1
- import { NumericID, TeamSide, TeamID } from "../../global";
1
+ import { NumericID, TeamSide } from "../../global";
2
2
 
3
3
  type EventType = "YELLOW_CARD" | "RED_CARD" | "GOAL" | "SUBSTITUTION";
4
4
 
@@ -12,7 +12,7 @@ interface BaseEvent {
12
12
  type: EventType;
13
13
  time: EventTime;
14
14
  teamType: TeamSide;
15
- teamId: TeamID;
15
+ teamId: NumericID;
16
16
  }
17
17
 
18
18
  interface RedCardEvent extends BaseEvent {
@@ -49,10 +49,10 @@ interface GoalEvent extends BaseEvent {
49
49
 
50
50
  interface SubstitutionEvent extends BaseEvent {
51
51
  type: "SUBSTITUTION";
52
- playerInId?: NumericID;
53
- playerInName?: string;
54
- playerInShirtName?: string;
55
- playerInUniform?: string;
52
+ playerInId: NumericID;
53
+ playerInName: string;
54
+ playerInShirtName: string;
55
+ playerInUniform: string;
56
56
  playerOutId: NumericID;
57
57
  playerOutName: string;
58
58
  playerOutShirtName: string;
@@ -1,18 +1,11 @@
1
- export interface TeamHeadToHeadStats {
2
- wins: number;
3
- goals: number;
4
- }
5
-
6
- export interface TeamsHeadToHeadStats {
7
- [teamId: string]: TeamHeadToHeadStats;
8
- }
9
-
10
1
  export interface HeadToHeadStats {
11
- teamsData: TeamsHeadToHeadStats;
2
+ wins: number;
3
+ homeWins: number;
4
+ awayWins: number;
12
5
  draws: number;
13
6
  }
14
7
 
15
- // h2hId - "<teamAId>_<teamBId>" or "<teamBId>_<teamAId>"
8
+ // h2hId - "<teamAId>_<teamBId>"
16
9
 
17
10
  export interface HeadToHead {
18
11
  [sportId: 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,8 +18,6 @@ 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
23
  }
@@ -1,9 +1,8 @@
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
6
  export interface MatchPeriods{
8
7
  firstHalf: Score;
9
8
  secondHalf?: 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
  }
@@ -4,57 +4,35 @@ export interface TeamsStats {
4
4
  }
5
5
 
6
6
  export interface MatchStats {
7
-
8
- accurateLongBalls: TeamsStats,
9
- aerialDuelsWon: TeamsStats,
10
- backwardPass: TeamsStats,
11
- bigChanceCreated: TeamsStats,
12
- bigChanceMissed: TeamsStats,
13
- bigChanceScored: TeamsStats,
7
+ possession: TeamsStats,
8
+ attackingThirdPossession: TeamsStats,
9
+ ownThirdPossession: TeamsStats,
10
+ shotsOnTarget: TeamsStats,
11
+ shotsOffTarget: TeamsStats,
12
+ clearances: TeamsStats,
14
13
  corners: TeamsStats,
15
- crossbarHits: TeamsStats,
16
- crossBlocked: TeamsStats,
17
- crossTotal: TeamsStats,
18
- fastbreak: TeamsStats,
19
- forwardPass: TeamsStats,
20
- foulsConceded: TeamsStats,
21
- freeKickAwarded: TeamsStats,
22
- goalAssists: TeamsStats,
23
- groundDuelsWon: TeamsStats,
24
- interceptions: TeamsStats,
25
- interceptionsInBox: TeamsStats,
26
14
  offsides: TeamsStats,
27
- oneOnOneShotAttempt: TeamsStats,
28
- ownGoals: TeamsStats,
29
- passAccuracy: TeamsStats,
30
15
  passes: TeamsStats,
31
- penaltyAreaEntries: TeamsStats,
32
- penaltyConceded: TeamsStats,
33
- penaltySave: TeamsStats,
34
- penaltyTaken: TeamsStats,
35
- possession: TeamsStats,
36
- possessionLosses: TeamsStats,
37
- possessionWonAttThird: TeamsStats,
38
- possessionWonDefThird: TeamsStats,
39
- possessionWonMidThird: TeamsStats,
40
- postHitsLeft: TeamsStats,
41
- postHitsRight: TeamsStats,
42
- redCards: TeamsStats,
43
- saves: TeamsStats,
16
+ interceptions: TeamsStats,
17
+ penalties: TeamsStats,
44
18
  shots: TeamsStats,
45
- shotsOffTarget: TeamsStats,
46
- shotsOnTarget: TeamsStats,
47
- successfulCrosses: TeamsStats,
48
- successfulPasses: TeamsStats,
19
+ ownGoals: TeamsStats,
20
+ saves: TeamsStats,
21
+ freeKickAwarded: TeamsStats,
22
+ freeKickConceded: TeamsStats,
23
+ crossBlocked: TeamsStats,
49
24
  tackles: TeamsStats,
50
- throws: TeamsStats,
51
- unsuccessfulPasses: TeamsStats,
25
+ touches: TeamsStats,
52
26
  yellowCards: TeamsStats,
53
- secondYellow: TeamsStats,
54
- shotAccuracy: TeamsStats,
55
- shotBlocked: TeamsStats,
56
- clearance: TeamsStats,
57
- woodwork: TeamsStats,
27
+ redCards: 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,
58
36
  }
59
37
 
60
38
  export interface Stats {
@@ -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,8 +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
4
 
7
5
  export interface SeasonOverview {
8
6
  endDate: ISODate;
@@ -13,9 +11,6 @@ export interface SeasonOverview {
13
11
  nextSeasonId?: string;
14
12
  state: SeasonState;
15
13
  logo?: Image;
16
- type: SeasonType;
17
- countryCode?: string;
18
- stages?: Stages;
19
14
  }
20
15
 
21
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,7 +24,7 @@ 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
 
@@ -69,11 +66,3 @@ export interface WithSeasons {
69
66
  }
70
67
 
71
68
  export type Platforms = 'IOS' | 'WEB' | 'ANDROID';
72
-
73
- export interface Stage {
74
- id: string;
75
- }
76
-
77
- export interface Group {
78
- id: string;
79
- }
@@ -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 {
@@ -68,8 +54,6 @@ export interface MatchOverviewSnapshot {
68
54
  home: Share;
69
55
  away: Share;
70
56
  };
71
- stage?: Stage;
72
- group?: Group;
73
57
  startDate: ISODate;
74
58
  roundNb: number;
75
59
  eventStatus: EventStatus;
@@ -1,38 +1,20 @@
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
- logo: Image;
16
4
  ranking: TeamRanking;
17
- groupId?: string;
18
5
  previousMatchId?: string;
19
6
  nextMatchId?: string;
20
- nextMatch?: MatchOveriew;
21
- previousMatch?: MatchOveriew;
22
- }
23
-
24
- export interface GroupTable {
25
- name: string;
26
- matchesIds: {[matchId: string]: true};
27
7
  }
28
8
 
29
9
  export interface TableSummary {
30
10
  groups: {
31
11
  [sportID: string]: {
32
12
  [seasonID: string]: {
33
- [groupId: string]: GroupTable;
34
- }
35
- }
13
+ [groupID: string]: {
14
+ [teamID: string]: TeamTable;
15
+ };
16
+ };
17
+ };
36
18
  };
37
19
  leagues: {
38
20
  [sportID: string]: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sportsbroker/firebase-structure",
3
- "version": "3.24.0-17",
3
+ "version": "3.24.0-2",
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,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
- }