fansunited-data-layer 0.0.1 → 0.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.
Files changed (110) hide show
  1. package/README.md +213 -60
  2. package/dist/api/sportal365-sports/constants.d.ts +14 -0
  3. package/dist/api/sportal365-sports/constants.d.ts.map +1 -0
  4. package/dist/api/sportal365-sports/football/http.d.ts +8 -0
  5. package/dist/api/sportal365-sports/football/http.d.ts.map +1 -0
  6. package/dist/api/sportal365-sports/football/index.d.ts +11 -0
  7. package/dist/api/sportal365-sports/football/index.d.ts.map +1 -0
  8. package/dist/api/sportal365-sports/football/matches/index.d.ts +143 -0
  9. package/dist/api/sportal365-sports/football/matches/index.d.ts.map +1 -0
  10. package/dist/api/sportal365-sports/football/matches/transformers/commentary.d.ts +12 -0
  11. package/dist/api/sportal365-sports/football/matches/transformers/commentary.d.ts.map +1 -0
  12. package/dist/api/sportal365-sports/football/matches/transformers/index.d.ts +10 -0
  13. package/dist/api/sportal365-sports/football/matches/transformers/index.d.ts.map +1 -0
  14. package/dist/api/sportal365-sports/football/matches/transformers/lineup.d.ts +11 -0
  15. package/dist/api/sportal365-sports/football/matches/transformers/lineup.d.ts.map +1 -0
  16. package/dist/api/sportal365-sports/football/matches/transformers/match-event.d.ts +12 -0
  17. package/dist/api/sportal365-sports/football/matches/transformers/match-event.d.ts.map +1 -0
  18. package/dist/api/sportal365-sports/football/matches/transformers/match.d.ts +11 -0
  19. package/dist/api/sportal365-sports/football/matches/transformers/match.d.ts.map +1 -0
  20. package/dist/api/sportal365-sports/football/matches/transformers/odds.d.ts +11 -0
  21. package/dist/api/sportal365-sports/football/matches/transformers/odds.d.ts.map +1 -0
  22. package/dist/api/sportal365-sports/football/matches/transformers/statistics.d.ts +11 -0
  23. package/dist/api/sportal365-sports/football/matches/transformers/statistics.d.ts.map +1 -0
  24. package/dist/api/sportal365-sports/football/matches/types/commentary.types.d.ts +24 -0
  25. package/dist/api/sportal365-sports/football/matches/types/commentary.types.d.ts.map +1 -0
  26. package/dist/api/sportal365-sports/football/matches/types/event.types.d.ts +19 -0
  27. package/dist/api/sportal365-sports/football/matches/types/event.types.d.ts.map +1 -0
  28. package/dist/api/sportal365-sports/football/matches/types/index.d.ts +16 -0
  29. package/dist/api/sportal365-sports/football/matches/types/index.d.ts.map +1 -0
  30. package/dist/api/sportal365-sports/football/matches/types/lineup.types.d.ts +78 -0
  31. package/dist/api/sportal365-sports/football/matches/types/lineup.types.d.ts.map +1 -0
  32. package/dist/api/sportal365-sports/football/matches/types/match.types.d.ts +47 -0
  33. package/dist/api/sportal365-sports/football/matches/types/match.types.d.ts.map +1 -0
  34. package/dist/api/sportal365-sports/football/matches/types/minute.types.d.ts +8 -0
  35. package/dist/api/sportal365-sports/football/matches/types/minute.types.d.ts.map +1 -0
  36. package/dist/api/sportal365-sports/football/matches/types/odds.types.d.ts +80 -0
  37. package/dist/api/sportal365-sports/football/matches/types/odds.types.d.ts.map +1 -0
  38. package/dist/api/sportal365-sports/football/matches/types/option.types.d.ts +116 -0
  39. package/dist/api/sportal365-sports/football/matches/types/option.types.d.ts.map +1 -0
  40. package/dist/api/sportal365-sports/football/matches/types/referee.types.d.ts +13 -0
  41. package/dist/api/sportal365-sports/football/matches/types/referee.types.d.ts.map +1 -0
  42. package/dist/api/sportal365-sports/football/matches/types/statistics.types.d.ts +45 -0
  43. package/dist/api/sportal365-sports/football/matches/types/statistics.types.d.ts.map +1 -0
  44. package/dist/api/sportal365-sports/football/matches/types/status.types.d.ts +13 -0
  45. package/dist/api/sportal365-sports/football/matches/types/status.types.d.ts.map +1 -0
  46. package/dist/api/sportal365-sports/football/matches/types/team.types.d.ts +17 -0
  47. package/dist/api/sportal365-sports/football/matches/types/team.types.d.ts.map +1 -0
  48. package/dist/api/sportal365-sports/football/matches/types/winner.types.d.ts +15 -0
  49. package/dist/api/sportal365-sports/football/matches/types/winner.types.d.ts.map +1 -0
  50. package/dist/api/sportal365-sports/football/teams/index.d.ts +25 -0
  51. package/dist/api/sportal365-sports/football/teams/index.d.ts.map +1 -0
  52. package/dist/api/sportal365-sports/football/teams/team.types.d.ts +55 -0
  53. package/dist/api/sportal365-sports/football/teams/team.types.d.ts.map +1 -0
  54. package/dist/api/sportal365-sports/football/teams/utils.d.ts +11 -0
  55. package/dist/api/sportal365-sports/football/teams/utils.d.ts.map +1 -0
  56. package/dist/api/sportal365-sports/http.d.ts +42 -0
  57. package/dist/api/sportal365-sports/http.d.ts.map +1 -0
  58. package/dist/api/sportal365-sports/index.d.ts +9 -0
  59. package/dist/api/sportal365-sports/index.d.ts.map +1 -0
  60. package/dist/api/sportal365-sports/shared/index.d.ts +5 -0
  61. package/dist/api/sportal365-sports/shared/index.d.ts.map +1 -0
  62. package/dist/api/sportal365-sports/shared/types.d.ts +189 -0
  63. package/dist/api/sportal365-sports/shared/types.d.ts.map +1 -0
  64. package/dist/config/index.d.ts +31 -0
  65. package/dist/config/index.d.ts.map +1 -0
  66. package/dist/config/types.d.ts +33 -0
  67. package/dist/config/types.d.ts.map +1 -0
  68. package/dist/fansunited-data-layer.js +1619 -363
  69. package/dist/fansunited-data-layer.umd.cjs +6 -1
  70. package/dist/index.d.ts +32 -0
  71. package/dist/index.d.ts.map +1 -0
  72. package/dist/types/canonical/base.types.d.ts +134 -0
  73. package/dist/types/canonical/base.types.d.ts.map +1 -0
  74. package/dist/types/canonical/commentary.types.d.ts +42 -0
  75. package/dist/types/canonical/commentary.types.d.ts.map +1 -0
  76. package/dist/types/canonical/event.types.d.ts +31 -0
  77. package/dist/types/canonical/event.types.d.ts.map +1 -0
  78. package/dist/types/canonical/index.d.ts +14 -0
  79. package/dist/types/canonical/index.d.ts.map +1 -0
  80. package/dist/types/canonical/lineup.types.d.ts +33 -0
  81. package/dist/types/canonical/lineup.types.d.ts.map +1 -0
  82. package/dist/types/canonical/match.types.d.ts +139 -0
  83. package/dist/types/canonical/match.types.d.ts.map +1 -0
  84. package/dist/types/canonical/odds.types.d.ts +73 -0
  85. package/dist/types/canonical/odds.types.d.ts.map +1 -0
  86. package/dist/types/canonical/standing.types.d.ts +57 -0
  87. package/dist/types/canonical/standing.types.d.ts.map +1 -0
  88. package/dist/types/canonical/statistics.types.d.ts +27 -0
  89. package/dist/types/canonical/statistics.types.d.ts.map +1 -0
  90. package/dist/types/index.d.ts +9 -0
  91. package/dist/types/index.d.ts.map +1 -0
  92. package/dist/use-cases/index.d.ts +15 -0
  93. package/dist/use-cases/index.d.ts.map +1 -0
  94. package/dist/use-cases/mappers/index.d.ts +7 -0
  95. package/dist/use-cases/mappers/index.d.ts.map +1 -0
  96. package/dist/use-cases/mappers/matchMappers.d.ts +45 -0
  97. package/dist/use-cases/mappers/matchMappers.d.ts.map +1 -0
  98. package/dist/use-cases/match/index.d.ts +10 -0
  99. package/dist/use-cases/match/index.d.ts.map +1 -0
  100. package/dist/use-cases/match/prepareMatchList.d.ts +71 -0
  101. package/dist/use-cases/match/prepareMatchList.d.ts.map +1 -0
  102. package/dist/use-cases/match/prepareMatchScore.d.ts +62 -0
  103. package/dist/use-cases/match/prepareMatchScore.d.ts.map +1 -0
  104. package/dist/use-cases/team/index.d.ts +8 -0
  105. package/dist/use-cases/team/index.d.ts.map +1 -0
  106. package/dist/use-cases/team/prepareTeamMatches.d.ts +79 -0
  107. package/dist/use-cases/team/prepareTeamMatches.d.ts.map +1 -0
  108. package/dist/use-cases/types.d.ts +8 -0
  109. package/dist/use-cases/types.d.ts.map +1 -0
  110. package/package.json +5 -1
package/README.md CHANGED
@@ -1,73 +1,226 @@
1
- # React + TypeScript + Vite
1
+ # fansunited-data-layer
2
2
 
3
- This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
3
+ A TypeScript library for fetching and transforming sports data from multiple API providers. Returns clean, canonical types that are provider-agnostic.
4
4
 
5
- Currently, two official plugins are available:
5
+ ## Installation
6
6
 
7
- - [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Babel](https://babeljs.io/) (or [oxc](https://oxc.rs) when used in [rolldown-vite](https://vite.dev/guide/rolldown)) for Fast Refresh
8
- - [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
7
+ ```bash
8
+ npm install fansunited-data-layer
9
+ ```
9
10
 
10
- ## React Compiler
11
+ ## Quick Start
11
12
 
12
- The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation).
13
+ ```typescript
14
+ import { setConfig, getFootballMatch } from "fansunited-data-layer";
13
15
 
14
- ## Expanding the ESLint configuration
16
+ // Configure the library (once at app startup)
17
+ setConfig({
18
+ sportal365Sports: {
19
+ username: "your-username",
20
+ password: "your-password",
21
+ projectId: "your-project-id",
22
+ },
23
+ });
15
24
 
16
- If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:
25
+ // Fetch a match
26
+ const match = await getFootballMatch("7576255");
27
+ console.log(match.competitorOne.name); // "Manchester United"
28
+ console.log(match.score?.competitorOne); // "2"
29
+ ```
17
30
 
18
- ```js
19
- export default defineConfig([
20
- globalIgnores(['dist']),
21
- {
22
- files: ['**/*.{ts,tsx}'],
23
- extends: [
24
- // Other configs...
31
+ ## API Reference
25
32
 
26
- // Remove tseslint.configs.recommended and replace with this
27
- tseslint.configs.recommendedTypeChecked,
28
- // Alternatively, use this for stricter rules
29
- tseslint.configs.strictTypeChecked,
30
- // Optionally, add this for stylistic rules
31
- tseslint.configs.stylisticTypeChecked,
33
+ ### Configuration
32
34
 
33
- // Other configs...
34
- ],
35
- languageOptions: {
36
- parserOptions: {
37
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
38
- tsconfigRootDir: import.meta.dirname,
39
- },
40
- // other options...
41
- },
42
- },
43
- ])
35
+ #### `setConfig(config)`
36
+
37
+ Initialize the library with your API credentials.
38
+
39
+ ```typescript
40
+ setConfig({
41
+ sportal365Sports: {
42
+ username: string; // API username
43
+ password: string; // API password
44
+ projectId: string; // Your project ID
45
+ languageCode?: string; // Default language (default: 'en')
46
+ oddClient?: string; // Odd client identifier for odds
47
+ timeout?: number; // Request timeout in ms
48
+ }
49
+ });
44
50
  ```
45
51
 
46
- You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules:
47
-
48
- ```js
49
- // eslint.config.js
50
- import reactX from 'eslint-plugin-react-x'
51
- import reactDom from 'eslint-plugin-react-dom'
52
-
53
- export default defineConfig([
54
- globalIgnores(['dist']),
55
- {
56
- files: ['**/*.{ts,tsx}'],
57
- extends: [
58
- // Other configs...
59
- // Enable lint rules for React
60
- reactX.configs['recommended-typescript'],
61
- // Enable lint rules for React DOM
62
- reactDom.configs.recommended,
63
- ],
64
- languageOptions: {
65
- parserOptions: {
66
- project: ['./tsconfig.node.json', './tsconfig.app.json'],
67
- tsconfigRootDir: import.meta.dirname,
68
- },
69
- // other options...
70
- },
71
- },
72
- ])
52
+ ### Football Endpoints
53
+
54
+ #### `getFootballMatch(matchId, options?)`
55
+
56
+ Get a single match by ID, UUID, or slug.
57
+
58
+ ```typescript
59
+ const match = await getFootballMatch("7576255");
60
+
61
+ // With optional data
62
+ const match = await getFootballMatch("7576255", {
63
+ optionalData: ["MAIN_EVENTS", "LINEUP_STATUS", "REFEREES"],
64
+ });
65
+ ```
66
+
67
+ **Options:**
68
+
69
+ - `optionalData` - Array of: `'MAIN_EVENTS'`, `'LINEUP_STATUS'`, `'REFEREES'`, `'PENALTY_SHOOTOUT_EVENTS'`
70
+ - `languageCode` - Override default language
71
+
72
+ #### `getFootballMatchEvents(matchId, options?)`
73
+
74
+ Get all events for a match (goals, cards, substitutions).
75
+
76
+ ```typescript
77
+ const events = await getFootballMatchEvents("7576255");
78
+ events.forEach((e) => console.log(`${e.minute}' - ${e.type}`));
79
+ ```
80
+
81
+ #### `getFootballMatchLineups(matchId, options?)`
82
+
83
+ Get match lineups with formations and player details.
84
+
85
+ ```typescript
86
+ const lineups = await getFootballMatchLineups("7576255");
87
+ console.log(lineups.competitorOne.formation); // "4-3-3"
88
+ console.log(lineups.competitorOne.starters); // Player[]
89
+ ```
90
+
91
+ #### `getFootballMatchStatistics(matchId, options?)`
92
+
93
+ Get match statistics (possession, shots, corners, etc.).
94
+
95
+ ```typescript
96
+ const stats = await getFootballMatchStatistics("7576255");
97
+ stats.competitorOne.statistics.forEach((s) => {
98
+ console.log(`${s.label}: ${s.value}${s.unit || ""}`);
99
+ });
100
+ ```
101
+
102
+ #### `getFootballMatchOdds(matchId, options?)`
103
+
104
+ Get betting odds from various operators.
105
+
106
+ ```typescript
107
+ const odds = await getFootballMatchOdds("7576255", {
108
+ oddType: "PREMATCH",
109
+ marketTypes: ["1X2", "OVER_UNDER"],
110
+ });
111
+ ```
112
+
113
+ #### `getFootballMatchCommentary(matchId, options?)`
114
+
115
+ Get live text commentary for a match.
116
+
117
+ ```typescript
118
+ const commentary = await getFootballMatchCommentary("7576255");
119
+ commentary.forEach((c) => {
120
+ console.log(`${c.minute}' - ${c.text}`);
121
+ });
122
+ ```
123
+
124
+ #### `getFootballTeam(teamId, options?)`
125
+
126
+ Get team details.
127
+
128
+ ```typescript
129
+ const team = await getFootballTeam("1234");
130
+ console.log(team.name);
131
+ console.log(team.assets?.logo);
73
132
  ```
133
+
134
+ ## Use-Cases
135
+
136
+ Use-cases bridge the data layer and UI components from `fansunited-sports-ui`. Each use-case provides:
137
+
138
+ - **Server function** (`prepareX`) - Pure async function for SSR/SSG
139
+ - **Client hook** (`usePrepareX`) - React Query wrapper for client-side
140
+
141
+ ### Match Use-Cases
142
+
143
+ #### `prepareMatchScore` / `usePrepareMatchScore`
144
+
145
+ Single match score display.
146
+
147
+ ```typescript
148
+ import { prepareMatchScore, usePrepareMatchScore } from "fansunited-data-layer";
149
+
150
+ // Server-side
151
+ const data = await prepareMatchScore({ matchId: "7576255" });
152
+
153
+ // Client-side
154
+ const { data, isLoading } = usePrepareMatchScore({ matchId: "7576255" });
155
+ ```
156
+
157
+ #### `prepareMatchList` / `usePrepareMatchList`
158
+
159
+ Match lists with various grouping variants.
160
+
161
+ ```typescript
162
+ import { prepareMatchList } from "fansunited-data-layer";
163
+
164
+ const data = await prepareMatchList({
165
+ variant: "daily",
166
+ date: new Date(),
167
+ tournamentIds: ["premier-league"],
168
+ limit: 20,
169
+ });
170
+ ```
171
+
172
+ **Variants:** `daily`, `round`, `competition`, `teamResults`, `teamFixtures`, `teamMatches`, `teamResultsByCompetition`, `teamFixturesByCompetition`, `teamMatchesByCompetition`
173
+
174
+ ### Team Use-Cases
175
+
176
+ Convenience wrappers for team-specific match queries.
177
+
178
+ ```typescript
179
+ import { prepareTeamResults, usePrepareTeamResults } from "fansunited-data-layer";
180
+
181
+ // Get past matches for a team
182
+ const results = await prepareTeamResults("team-123", {
183
+ groupByCompetition: true,
184
+ limit: 20,
185
+ });
186
+
187
+ // Get upcoming matches
188
+ const fixtures = await prepareTeamFixtures("team-123");
189
+
190
+ // Get all matches (results + fixtures)
191
+ const matches = await prepareTeamMatches("team-123");
192
+ ```
193
+
194
+ ## Canonical Types
195
+
196
+ All responses are transformed to provider-agnostic canonical types prefixed with `FUSports`:
197
+
198
+ - `FUSportsMatch` - Full match data
199
+ - `FUSportsMatchEvent` - Goals, cards, substitutions
200
+ - `FUSportsMatchLineups` - Team lineups and formations
201
+ - `FUSportsMatchStatistics` - Match statistics
202
+ - `FUSportsMatchOdds` - Betting odds
203
+ - `FUSportsCommentaryItem` - Commentary entries
204
+ - `FUSportsCompetitor` - Team/competitor data
205
+ - `FUSportsCompetition` - Tournament/league data
206
+ - `FUSportsPlayer` - Player data
207
+
208
+ ## TypeScript
209
+
210
+ Full TypeScript support with exported types:
211
+
212
+ ```typescript
213
+ import type { FUSportsMatch, FUSportsMatchEvent, FUSportsCompetitor } from "fansunited-data-layer";
214
+ ```
215
+
216
+ ## Peer Dependencies
217
+
218
+ For use-cases with client hooks, you'll need:
219
+
220
+ ```bash
221
+ npm install @tanstack/react-query
222
+ ```
223
+
224
+ ## License
225
+
226
+ MIT
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Sportal365 API Domain Constants
3
+ *
4
+ * Each Sportal365 API has its own domain based on the sport/functionality.
5
+ */
6
+ /** Football API domain */
7
+ export declare const SPORTAL365_FOOTBALL_DOMAIN = "https://football.api.sportal365.com";
8
+ /** Basketball API domain */
9
+ export declare const SPORTAL365_BASKETBALL_DOMAIN = "https://basketball.api.sportal365.com";
10
+ /** Tennis API domain */
11
+ export declare const SPORTAL365_TENNIS_DOMAIN = "https://tennis.api.sportal365.com";
12
+ /** Standings API domain */
13
+ export declare const SPORTAL365_STANDINGS_DOMAIN = "https://standings.api.sportal365.com";
14
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/lib/api/sportal365-sports/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,0BAA0B;AAC1B,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAEhF,4BAA4B;AAC5B,eAAO,MAAM,4BAA4B,0CAA0C,CAAC;AAEpF,wBAAwB;AACxB,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,2BAA2B;AAC3B,eAAO,MAAM,2BAA2B,yCAAyC,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Football HTTP client for Sportal365 API
3
+ */
4
+ /**
5
+ * HTTP client configured for the Sportal365 Football API
6
+ */
7
+ export declare const footballHttp: import("../http").Sportal365HttpClient;
8
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/sportal365-sports/football/http.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,eAAO,MAAM,YAAY,wCAA+C,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Sportal365 Sports API - Football
3
+ *
4
+ * Football-specific endpoints for the Sportal365 Sports API.
5
+ * All functions return canonical FUSports types.
6
+ */
7
+ export { getFootballMatch, getFootballMatchEvents, getFootballMatchLineups, getFootballMatchOdds, getFootballMatchStatistics, getFootballMatchCommentary, getFootballMatches, } from "./matches";
8
+ export type { GetFootballMatchOptions, GetFootballMatchEventsOptions, GetFootballMatchLineupsOptions, GetFootballMatchOddsOptions, GetFootballMatchStatisticsOptions, GetFootballMatchCommentaryOptions, GetFootballMatchesOptions, OddType, ScopeType, OddFormat, MarketType, OptionalMatchData, MatchStatusType, SortDirection, } from "./matches";
9
+ export { getFootballTeam } from "./teams";
10
+ export type { GetFootballTeamOptions } from "./teams";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/sportal365-sports/football/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACH,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,GACrB,MAAM,WAAW,CAAC;AAEnB,YAAY,EACR,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,yBAAyB,EACzB,OAAO,EACP,SAAS,EACT,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,aAAa,GAChB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Sportal365 Sports API - Football Matches
3
+ *
4
+ * Fetches match data and transforms to canonical FUSports types.
5
+ */
6
+ import type { FUSportsMatch, FUSportsMatchEvent, FUSportsMatchLineups, FUSportsMatchStatistics, FUSportsMatchOdds, FUSportsCommentaryItem } from "../../../../types/canonical";
7
+ import type { GetFootballMatchOptions, GetFootballMatchEventsOptions, GetFootballMatchLineupsOptions, GetFootballMatchOddsOptions, GetFootballMatchStatisticsOptions, GetFootballMatchCommentaryOptions, GetFootballMatchesOptions } from "./types";
8
+ export type { GetFootballMatchOptions, GetFootballMatchEventsOptions, GetFootballMatchLineupsOptions, GetFootballMatchOddsOptions, GetFootballMatchStatisticsOptions, GetFootballMatchCommentaryOptions, GetFootballMatchesOptions, OddType, ScopeType, OddFormat, MarketType, OptionalMatchData, MatchStatusType, SortDirection, } from "./types";
9
+ /**
10
+ * Get a football match by ID, UUID, or slug
11
+ *
12
+ * @param matchId - The match ID, UUID, or slug
13
+ * @param options - Optional parameters for odds, events, lineups
14
+ * @returns Canonical FUSportsMatch
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * // Basic usage
19
+ * const match = await getFootballMatch('7576255');
20
+ * console.log(match.competitorOne.name); // "Manchester United"
21
+ *
22
+ * // With main events and lineup status
23
+ * const match = await getFootballMatch('7576255', {
24
+ * optionalData: ['MAIN_EVENTS', 'LINEUP_STATUS']
25
+ * });
26
+ * console.log(match.mainEvents); // Goals, cards, etc.
27
+ * ```
28
+ */
29
+ export declare function getFootballMatch(matchId: string, options?: GetFootballMatchOptions): Promise<FUSportsMatch>;
30
+ /**
31
+ * Get all events for a football match
32
+ *
33
+ * @param matchId - The match ID
34
+ * @param options - Optional parameters
35
+ * @returns Array of match events (goals, cards, substitutions, etc.)
36
+ *
37
+ * @example
38
+ * ```typescript
39
+ * const events = await getFootballMatchEvents('7576255');
40
+ * events.forEach(e => console.log(`${e.minute}' - ${e.type}`));
41
+ * ```
42
+ */
43
+ export declare function getFootballMatchEvents(matchId: string, options?: GetFootballMatchEventsOptions): Promise<FUSportsMatchEvent[]>;
44
+ /**
45
+ * Get lineups for a football match
46
+ *
47
+ * @param matchId - The match ID
48
+ * @param options - Optional parameters
49
+ * @returns Canonical match lineups with formations and players
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * const lineups = await getFootballMatchLineups('7576255');
54
+ * console.log(lineups.home.formation); // "4-3-3"
55
+ * console.log(lineups.home.starters);
56
+ * ```
57
+ */
58
+ export declare function getFootballMatchLineups(matchId: string, options?: GetFootballMatchLineupsOptions): Promise<FUSportsMatchLineups>;
59
+ /**
60
+ * Get odds for a football match
61
+ *
62
+ * Odds are fetched from the match endpoint with odds parameters.
63
+ * Uses `oddClient` and `languageCode` from config if not provided in options.
64
+ *
65
+ * @param matchId - The match ID
66
+ * @param options - Optional parameters for filtering odds
67
+ * @returns Canonical match odds with bookmaker details
68
+ *
69
+ * @example
70
+ * ```typescript
71
+ * const odds = await getFootballMatchOdds('7576255', {
72
+ * marketTypes: ['1x2', 'OVER_UNDER']
73
+ * });
74
+ * console.log(`${odds.bookmakers.length} bookmakers available`);
75
+ * ```
76
+ */
77
+ export declare function getFootballMatchOdds(matchId: string, options?: GetFootballMatchOddsOptions): Promise<FUSportsMatchOdds>;
78
+ /**
79
+ * Get team statistics for a football match
80
+ *
81
+ * @param matchId - The match ID (event ID)
82
+ * @param options - Optional parameters
83
+ * @returns Canonical match statistics for both teams
84
+ *
85
+ * @example
86
+ * ```typescript
87
+ * const stats = await getFootballMatchStatistics('7576255');
88
+ * console.log(`Possession: ${stats.home.possession}% - ${stats.away.possession}%`);
89
+ * console.log(`Shots: ${stats.home.shotsTotal} - ${stats.away.shotsTotal}`);
90
+ * ```
91
+ */
92
+ export declare function getFootballMatchStatistics(matchId: string, options?: GetFootballMatchStatisticsOptions): Promise<FUSportsMatchStatistics>;
93
+ /**
94
+ * Get live commentary for a football match
95
+ *
96
+ * @param matchId - The match ID, UUID, or slug
97
+ * @param options - Optional parameters
98
+ * @returns Array of commentary entries
99
+ *
100
+ * @example
101
+ * ```typescript
102
+ * const commentary = await getFootballMatchCommentary('7576255');
103
+ * commentary.forEach(c => {
104
+ * console.log(`${c.elapsed}' - ${c.autoText}`);
105
+ * });
106
+ * ```
107
+ */
108
+ export declare function getFootballMatchCommentary(matchId: string, options?: GetFootballMatchCommentaryOptions): Promise<FUSportsCommentaryItem[]>;
109
+ /**
110
+ * Get a list of football matches
111
+ *
112
+ * @param options - Filter and pagination options (limit and offset are required)
113
+ * @returns Array of canonical FUSportsMatch objects
114
+ *
115
+ * @example
116
+ * ```typescript
117
+ * // Get 10 upcoming matches for a specific tournament
118
+ * const matches = await getFootballMatches({
119
+ * tournamentIds: ['123'],
120
+ * fromKickoffTime: new Date().toISOString(),
121
+ * sortDirection: 'asc',
122
+ * limit: 10,
123
+ * offset: 0
124
+ * });
125
+ *
126
+ * // Get matches by team
127
+ * const teamMatches = await getFootballMatches({
128
+ * teamIds: ['102', '103'],
129
+ * teamIdsOperator: 'OR',
130
+ * limit: 20,
131
+ * offset: 0
132
+ * });
133
+ *
134
+ * // Get live matches
135
+ * const liveMatches = await getFootballMatches({
136
+ * statusTypes: ['LIVE'],
137
+ * limit: 50,
138
+ * offset: 0
139
+ * });
140
+ * ```
141
+ */
142
+ export declare function getFootballMatches(options: GetFootballMatchesOptions): Promise<FUSportsMatch[]>;
143
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/matches/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACR,aAAa,EACb,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACzB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,KAAK,EAMR,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,yBAAyB,EAC5B,MAAM,SAAS,CAAC;AAWjB,YAAY,EACR,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,yBAAyB,EACzB,OAAO,EACP,SAAS,EACT,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,aAAa,GAChB,MAAM,SAAS,CAAC;AAEjB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B,GAAG,OAAO,CAAC,aAAa,CAAC,CAkBrH;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,sBAAsB,CACxC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,6BAAkC,GAC5C,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAW/B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,uBAAuB,CACzC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,8BAAmC,GAC7C,OAAO,CAAC,oBAAoB,CAAC,CAW/B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,oBAAoB,CACtC,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,2BAAgC,GAC1C,OAAO,CAAC,iBAAiB,CAAC,CAiB5B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,0BAA0B,CAC5C,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,iCAAsC,GAChD,OAAO,CAAC,uBAAuB,CAAC,CAWlC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,0BAA0B,CAC5C,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,iCAAsC,GAChD,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAWnC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAgDrG"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Commentary transformers
3
+ *
4
+ * Transforms raw API commentary data to canonical FUSportsCommentary type.
5
+ */
6
+ import type { FUSportsCommentaryItem } from "../../../../../types/canonical";
7
+ import type { RawCommentary } from "../types";
8
+ /**
9
+ * Transform raw commentary entry to canonical format
10
+ */
11
+ export declare function transformCommentary(raw: RawCommentary): FUSportsCommentaryItem;
12
+ //# sourceMappingURL=commentary.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commentary.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/api/sportal365-sports/football/matches/transformers/commentary.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAa9C;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,sBAAsB,CAe9E"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Transformers barrel file
3
+ */
4
+ export { transformEvent } from "./match-event";
5
+ export { transformMatch } from "./match";
6
+ export { transformLineups } from "./lineup";
7
+ export { transformStatistics } from "./statistics";
8
+ export { transformMatchOdds } from "./odds";
9
+ export { transformCommentary } from "./commentary";
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/api/sportal365-sports/football/matches/transformers/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Lineup transformation utilities
3
+ * Transforms raw API lineup responses to canonical FUSports types
4
+ */
5
+ import type { FUSportsMatchLineups } from "../../../../../types/canonical";
6
+ import type { RawMatchLineups } from "../types";
7
+ /**
8
+ * Transform raw match lineups to canonical format
9
+ */
10
+ export declare function transformLineups(raw: RawMatchLineups): FUSportsMatchLineups;
11
+ //# sourceMappingURL=lineup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lineup.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/api/sportal365-sports/football/matches/transformers/lineup.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,oBAAoB,EAIvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,eAAe,EAAuC,MAAM,UAAU,CAAC;AA2ErF;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,eAAe,GAAG,oBAAoB,CAO3E"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Event transformation utilities
3
+ * Transforms raw API event responses to canonical FUSports types
4
+ */
5
+ import type { FUSportsMatchEvent } from "../../../../../types/canonical";
6
+ import type { RawMatchEvent } from "../types";
7
+ /**
8
+ * Transform raw event to canonical format
9
+ * Returns null for unknown event types
10
+ */
11
+ export declare function transformEvent(raw: RawMatchEvent): FUSportsMatchEvent | null;
12
+ //# sourceMappingURL=match-event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match-event.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/api/sportal365-sports/football/matches/transformers/match-event.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAuB,MAAM,gCAAgC,CAAC;AAC9F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAoD9C;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,aAAa,GAAG,kBAAkB,GAAG,IAAI,CAkB5E"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Match transformation utilities
3
+ * Transforms raw API match responses to canonical FUSports types
4
+ */
5
+ import type { FUSportsMatch } from "../../../../../types/canonical";
6
+ import type { RawMatch } from "../types";
7
+ /**
8
+ * Transform raw match response to canonical FUSportsMatch
9
+ */
10
+ export declare function transformMatch(raw: RawMatch): FUSportsMatch;
11
+ //# sourceMappingURL=match.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"match.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/api/sportal365-sports/football/matches/transformers/match.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,aAAa,EAUhB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,QAAQ,EAAmB,MAAM,UAAU,CAAC;AAsL1D;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,aAAa,CA2C3D"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Odds transformation utilities
3
+ * Transforms raw API odds responses to canonical FUSports types
4
+ */
5
+ import type { FUSportsMatchOdds } from "../../../../../types/canonical";
6
+ import type { RawMatchOdd } from "../types";
7
+ /**
8
+ * Transform raw match odds array to canonical format
9
+ */
10
+ export declare function transformMatchOdds(matchId: string, raw: RawMatchOdd[]): FUSportsMatchOdds;
11
+ //# sourceMappingURL=odds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"odds.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/api/sportal365-sports/football/matches/transformers/odds.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAIR,iBAAiB,EACpB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,WAAW,EAAmC,MAAM,UAAU,CAAC;AA8D7E;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,iBAAiB,CAKzF"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Statistics transformation utilities
3
+ * Transforms raw API statistics responses to canonical FUSports types
4
+ */
5
+ import type { FUSportsMatchStatistics } from "../../../../../types/canonical";
6
+ import type { RawMatchStatisticsResponse } from "../types";
7
+ /**
8
+ * Transform raw match statistics response to canonical format
9
+ */
10
+ export declare function transformStatistics(raw: RawMatchStatisticsResponse): FUSportsMatchStatistics;
11
+ //# sourceMappingURL=statistics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/api/sportal365-sports/football/matches/transformers/statistics.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,uBAAuB,EAG1B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,0BAA0B,EAAqB,MAAM,UAAU,CAAC;AA2C9E;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,0BAA0B,GAAG,uBAAuB,CAY5F"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Commentary types for Sportal365 Sports API
3
+ */
4
+ export interface RawCommentaryDetail {
5
+ [key: string]: unknown;
6
+ }
7
+ export interface RawCommentary {
8
+ external_id?: string;
9
+ type?: string;
10
+ commentary_type?: string;
11
+ subtype_1?: string;
12
+ subtype_2?: string;
13
+ template_text?: string;
14
+ auto_text?: string;
15
+ elapsed?: string | number;
16
+ elapsed_plus?: string | number;
17
+ details?: RawCommentaryDetail[];
18
+ incident_timestamp?: string;
19
+ }
20
+ export interface GetFootballMatchCommentaryOptions {
21
+ /** Language code for translations. Required by the API. Defaults to 'en' */
22
+ languageCode?: string;
23
+ }
24
+ //# sourceMappingURL=commentary.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commentary.types.d.ts","sourceRoot":"","sources":["../../../../../../src/lib/api/sportal365-sports/football/matches/types/commentary.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,mBAAmB;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,iCAAiC;IAC9C,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Match event types for Sportal365 Sports API
3
+ */
4
+ import type { RawPartialPlayer, RawTeamScore } from "../../../shared/types";
5
+ export type RawMatchEventTypeCode = "YELLOW_RED_CARD" | "PENALTY_SHOOTOUT_MISSED" | "PENALTY_SHOOTOUT_SCORED" | "SUBSTITUTION" | "GOAL" | "RED_CARD" | "PENALTY_MISS" | "YELLOW_CARD" | "ASSIST" | "PENALTY_GOAL" | "OWN_GOAL" | "DISALLOWED_GOAL" | "DISALLOWED_MISSED_PENALTY" | "DISALLOWED_PENALTY" | "DISALLOWED_OWN_GOAL" | "KICKOFF" | "HALFTIME" | "START_SECOND_HALF" | "FINISHED_FIRST_HALF" | "FINISHED_AFTER_EXTRA_TIME" | "FINISHED_AFTER_PENALTIES" | "OVERTIME_FIRST_HALF" | "OVERTIME_FIRST_HALF_END" | "OVERTIME_SECOND_HALF" | "INJURY_TIME" | "FINISHED";
6
+ export interface RawMatchEvent {
7
+ id: string;
8
+ match_id: string;
9
+ type_code: RawMatchEventTypeCode;
10
+ team_position?: "HOME" | "AWAY";
11
+ minute?: number;
12
+ injury_minute?: number;
13
+ injury_time_minutes?: number;
14
+ team_id?: string;
15
+ primary_player?: RawPartialPlayer;
16
+ secondary_player?: RawPartialPlayer;
17
+ score?: RawTeamScore;
18
+ }
19
+ //# sourceMappingURL=event.types.d.ts.map