fansunited-data-layer 0.2.0 → 0.2.1
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.
- package/api/fansunited/constants.d.ts +5 -0
- package/api/fansunited/constants.d.ts.map +1 -0
- package/api/fansunited/football/competition/index.d.ts +30 -0
- package/api/fansunited/football/competition/index.d.ts.map +1 -0
- package/api/fansunited/football/competition/transformer.d.ts +11 -0
- package/api/fansunited/football/competition/transformer.d.ts.map +1 -0
- package/api/fansunited/football/competition/types.d.ts +70 -0
- package/api/fansunited/football/competition/types.d.ts.map +1 -0
- package/api/fansunited/football/competitions/index.d.ts +27 -0
- package/api/fansunited/football/competitions/index.d.ts.map +1 -0
- package/api/fansunited/football/competitions/transformer.d.ts +14 -0
- package/api/fansunited/football/competitions/transformer.d.ts.map +1 -0
- package/api/fansunited/football/competitions/types.d.ts +67 -0
- package/api/fansunited/football/competitions/types.d.ts.map +1 -0
- package/api/fansunited/football/http.d.ts +8 -0
- package/api/fansunited/football/http.d.ts.map +1 -0
- package/api/fansunited/football/index.d.ts +19 -0
- package/api/fansunited/football/index.d.ts.map +1 -0
- package/api/fansunited/football/matches/index.d.ts +61 -0
- package/api/fansunited/football/matches/index.d.ts.map +1 -0
- package/api/fansunited/football/matches/transformer.d.ts +28 -0
- package/api/fansunited/football/matches/transformer.d.ts.map +1 -0
- package/api/fansunited/football/matches/types.d.ts +328 -0
- package/api/fansunited/football/matches/types.d.ts.map +1 -0
- package/api/fansunited/football/players/index.d.ts +30 -0
- package/api/fansunited/football/players/index.d.ts.map +1 -0
- package/api/fansunited/football/players/transformer.d.ts +10 -0
- package/api/fansunited/football/players/transformer.d.ts.map +1 -0
- package/api/fansunited/football/players/types.d.ts +70 -0
- package/api/fansunited/football/players/types.d.ts.map +1 -0
- package/api/fansunited/football/search/index.d.ts +49 -0
- package/api/fansunited/football/search/index.d.ts.map +1 -0
- package/api/fansunited/football/search/transformer.d.ts +10 -0
- package/api/fansunited/football/search/transformer.d.ts.map +1 -0
- package/api/fansunited/football/search/types.d.ts +151 -0
- package/api/fansunited/football/search/types.d.ts.map +1 -0
- package/api/fansunited/football/teams/index.d.ts +30 -0
- package/api/fansunited/football/teams/index.d.ts.map +1 -0
- package/api/fansunited/football/teams/transformer.d.ts +10 -0
- package/api/fansunited/football/teams/transformer.d.ts.map +1 -0
- package/api/fansunited/football/teams/types.d.ts +87 -0
- package/api/fansunited/football/teams/types.d.ts.map +1 -0
- package/api/fansunited/http.d.ts +54 -0
- package/api/fansunited/http.d.ts.map +1 -0
- package/api/fansunited/index.d.ts +10 -0
- package/api/fansunited/index.d.ts.map +1 -0
- package/api/sportal365-sports/constants.d.ts +16 -0
- package/api/sportal365-sports/constants.d.ts.map +1 -0
- package/api/sportal365-sports/football/competitions/competition.types.d.ts +148 -0
- package/api/sportal365-sports/football/competitions/competition.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/competitions/index.d.ts +54 -0
- package/api/sportal365-sports/football/competitions/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/competitions/utils.d.ts +14 -0
- package/api/sportal365-sports/football/competitions/utils.d.ts.map +1 -0
- package/api/sportal365-sports/football/http.d.ts +8 -0
- package/api/sportal365-sports/football/http.d.ts.map +1 -0
- package/api/sportal365-sports/football/index.d.ts +19 -0
- package/api/sportal365-sports/football/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/index.d.ts +151 -0
- package/api/sportal365-sports/football/matches/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/commentary.d.ts +12 -0
- package/api/sportal365-sports/football/matches/transformers/commentary.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/index.d.ts +10 -0
- package/api/sportal365-sports/football/matches/transformers/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/lineup.d.ts +11 -0
- package/api/sportal365-sports/football/matches/transformers/lineup.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/match-event.d.ts +12 -0
- package/api/sportal365-sports/football/matches/transformers/match-event.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/match.d.ts +11 -0
- package/api/sportal365-sports/football/matches/transformers/match.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/odds.d.ts +11 -0
- package/api/sportal365-sports/football/matches/transformers/odds.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/transformers/statistics.d.ts +11 -0
- package/api/sportal365-sports/football/matches/transformers/statistics.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/commentary.types.d.ts +27 -0
- package/api/sportal365-sports/football/matches/types/commentary.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/event.types.d.ts +19 -0
- package/api/sportal365-sports/football/matches/types/event.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/index.d.ts +16 -0
- package/api/sportal365-sports/football/matches/types/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/lineup.types.d.ts +80 -0
- package/api/sportal365-sports/football/matches/types/lineup.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/match.types.d.ts +47 -0
- package/api/sportal365-sports/football/matches/types/match.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/minute.types.d.ts +8 -0
- package/api/sportal365-sports/football/matches/types/minute.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/odds.types.d.ts +80 -0
- package/api/sportal365-sports/football/matches/types/odds.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/option.types.d.ts +129 -0
- package/api/sportal365-sports/football/matches/types/option.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/referee.types.d.ts +13 -0
- package/api/sportal365-sports/football/matches/types/referee.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/statistics.types.d.ts +45 -0
- package/api/sportal365-sports/football/matches/types/statistics.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/status.types.d.ts +13 -0
- package/api/sportal365-sports/football/matches/types/status.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/team.types.d.ts +17 -0
- package/api/sportal365-sports/football/matches/types/team.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/matches/types/winner.types.d.ts +15 -0
- package/api/sportal365-sports/football/matches/types/winner.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/search/index.d.ts +45 -0
- package/api/sportal365-sports/football/search/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/search/search.transformer.d.ts +10 -0
- package/api/sportal365-sports/football/search/search.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/football/search/search.types.d.ts +147 -0
- package/api/sportal365-sports/football/search/search.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/standings/index.d.ts +43 -0
- package/api/sportal365-sports/football/standings/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/standings/standing.transformer.d.ts +15 -0
- package/api/sportal365-sports/football/standings/standing.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/football/standings/standing.types.d.ts +73 -0
- package/api/sportal365-sports/football/standings/standing.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/statistics/index.d.ts +42 -0
- package/api/sportal365-sports/football/statistics/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/statistics/player-season.transformer.d.ts +11 -0
- package/api/sportal365-sports/football/statistics/player-season.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/football/statistics/player-season.types.d.ts +84 -0
- package/api/sportal365-sports/football/statistics/player-season.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/teams/index.d.ts +53 -0
- package/api/sportal365-sports/football/teams/index.d.ts.map +1 -0
- package/api/sportal365-sports/football/teams/squad.types.d.ts +63 -0
- package/api/sportal365-sports/football/teams/squad.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/teams/team.types.d.ts +58 -0
- package/api/sportal365-sports/football/teams/team.types.d.ts.map +1 -0
- package/api/sportal365-sports/football/teams/utils.d.ts +24 -0
- package/api/sportal365-sports/football/teams/utils.d.ts.map +1 -0
- package/api/sportal365-sports/http.d.ts +59 -0
- package/api/sportal365-sports/http.d.ts.map +1 -0
- package/api/sportal365-sports/index.d.ts +14 -0
- package/api/sportal365-sports/index.d.ts.map +1 -0
- package/api/sportal365-sports/search/http.d.ts +8 -0
- package/api/sportal365-sports/search/http.d.ts.map +1 -0
- package/api/sportal365-sports/search/index.d.ts +43 -0
- package/api/sportal365-sports/search/index.d.ts.map +1 -0
- package/api/sportal365-sports/search/search.transformer.d.ts +10 -0
- package/api/sportal365-sports/search/search.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/search/search.types.d.ts +209 -0
- package/api/sportal365-sports/search/search.types.d.ts.map +1 -0
- package/api/sportal365-sports/shared/index.d.ts +6 -0
- package/api/sportal365-sports/shared/index.d.ts.map +1 -0
- package/api/sportal365-sports/shared/providerRef.helper.d.ts +79 -0
- package/api/sportal365-sports/shared/providerRef.helper.d.ts.map +1 -0
- package/api/sportal365-sports/shared/types.d.ts +189 -0
- package/api/sportal365-sports/shared/types.d.ts.map +1 -0
- package/api/sportal365-sports/statistics/http.d.ts +8 -0
- package/api/sportal365-sports/statistics/http.d.ts.map +1 -0
- package/api/sportal365-sports/statistics/index.d.ts +55 -0
- package/api/sportal365-sports/statistics/index.d.ts.map +1 -0
- package/api/sportal365-sports/statistics/team-stats.transformer.d.ts +14 -0
- package/api/sportal365-sports/statistics/team-stats.transformer.d.ts.map +1 -0
- package/api/sportal365-sports/statistics/team-stats.types.d.ts +45 -0
- package/api/sportal365-sports/statistics/team-stats.types.d.ts.map +1 -0
- package/client.cjs +8 -0
- package/client.d.ts +20 -0
- package/client.d.ts.map +1 -0
- package/client.js +12065 -0
- package/config/index.d.ts +31 -0
- package/config/index.d.ts.map +1 -0
- package/config/types.d.ts +36 -0
- package/config/types.d.ts.map +1 -0
- package/fansunited-data-layer.cjs +1 -0
- package/fansunited-data-layer.js +1739 -0
- package/helpers/competition.helpers.d.ts +22 -0
- package/helpers/competition.helpers.d.ts.map +1 -0
- package/helpers/index.d.ts +7 -0
- package/helpers/index.d.ts.map +1 -0
- package/helpers/team.helpers.d.ts +289 -0
- package/helpers/team.helpers.d.ts.map +1 -0
- package/index-Cogo-Kkd.cjs +1 -0
- package/index-D7T2Yy11.js +1170 -0
- package/index.d.ts +39 -0
- package/index.d.ts.map +1 -0
- package/package.json +12 -15
- package/providers/competition/hooks/index.d.ts +6 -0
- package/providers/competition/hooks/index.d.ts.map +1 -0
- package/providers/competition/hooks/useCompetitionStats.d.ts +8 -0
- package/providers/competition/hooks/useCompetitionStats.d.ts.map +1 -0
- package/providers/competition/hooks/useGoalDistribution.d.ts +11 -0
- package/providers/competition/hooks/useGoalDistribution.d.ts.map +1 -0
- package/providers/competition/hooks/useMatchHelpers.d.ts +16 -0
- package/providers/competition/hooks/useMatchHelpers.d.ts.map +1 -0
- package/providers/competition/hooks/useStandingsCalculations.d.ts +18 -0
- package/providers/competition/hooks/useStandingsCalculations.d.ts.map +1 -0
- package/providers/competition/hooks/useStandingsHelpers.d.ts +23 -0
- package/providers/competition/hooks/useStandingsHelpers.d.ts.map +1 -0
- package/providers/competition/hooks/useTeamPosition.d.ts +8 -0
- package/providers/competition/hooks/useTeamPosition.d.ts.map +1 -0
- package/providers/competition/hooks/useTeamResultsTable.d.ts +9 -0
- package/providers/competition/hooks/useTeamResultsTable.d.ts.map +1 -0
- package/providers/competition/utils/competitionStats.d.ts +42 -0
- package/providers/competition/utils/competitionStats.d.ts.map +1 -0
- package/providers/competition/utils/goalDistribution.d.ts +41 -0
- package/providers/competition/utils/goalDistribution.d.ts.map +1 -0
- package/providers/competition/utils/index.d.ts +6 -0
- package/providers/competition/utils/index.d.ts.map +1 -0
- package/providers/competition/utils/standingsCalculations.d.ts +24 -0
- package/providers/competition/utils/standingsCalculations.d.ts.map +1 -0
- package/providers/competition.context.d.ts +8 -0
- package/providers/competition.context.d.ts.map +1 -0
- package/providers/competition.provider.d.ts +3 -0
- package/providers/competition.provider.d.ts.map +1 -0
- package/providers/competition.types.d.ts +118 -0
- package/providers/competition.types.d.ts.map +1 -0
- package/providers/fansunited-config.context.d.ts +6 -0
- package/providers/fansunited-config.context.d.ts.map +1 -0
- package/providers/fansunited-config.hooks.d.ts +19 -0
- package/providers/fansunited-config.hooks.d.ts.map +1 -0
- package/providers/fansunited-config.provider.d.ts +44 -0
- package/providers/fansunited-config.provider.d.ts.map +1 -0
- package/providers/fansunited-config.types.d.ts +48 -0
- package/providers/fansunited-config.types.d.ts.map +1 -0
- package/providers/fansunited-sdk.hook.d.ts +40 -0
- package/providers/fansunited-sdk.hook.d.ts.map +1 -0
- package/providers/index.d.ts +20 -0
- package/providers/index.d.ts.map +1 -0
- package/providers/match/hooks/useEventHelpers.d.ts +12 -0
- package/providers/match/hooks/useEventHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useHeadToHeadHelpers.d.ts +13 -0
- package/providers/match/hooks/useHeadToHeadHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useLineupHelpers.d.ts +13 -0
- package/providers/match/hooks/useLineupHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useMatchStandingsCalculations.d.ts +20 -0
- package/providers/match/hooks/useMatchStandingsCalculations.d.ts.map +1 -0
- package/providers/match/hooks/useMatchStatus.d.ts +12 -0
- package/providers/match/hooks/useMatchStatus.d.ts.map +1 -0
- package/providers/match/hooks/useOddsHelpers.d.ts +10 -0
- package/providers/match/hooks/useOddsHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useScoreHelpers.d.ts +16 -0
- package/providers/match/hooks/useScoreHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useStandingsHelpers.d.ts +22 -0
- package/providers/match/hooks/useStandingsHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useStatisticsHelpers.d.ts +13 -0
- package/providers/match/hooks/useStatisticsHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useTeamHelpers.d.ts +11 -0
- package/providers/match/hooks/useTeamHelpers.d.ts.map +1 -0
- package/providers/match/hooks/useTeamStatsHelpers.d.ts +12 -0
- package/providers/match/hooks/useTeamStatsHelpers.d.ts.map +1 -0
- package/providers/match.context.d.ts +8 -0
- package/providers/match.context.d.ts.map +1 -0
- package/providers/match.provider.d.ts +3 -0
- package/providers/match.provider.d.ts.map +1 -0
- package/providers/match.types.d.ts +151 -0
- package/providers/match.types.d.ts.map +1 -0
- package/providers/team/hooks/useFormStats.d.ts +49 -0
- package/providers/team/hooks/useFormStats.d.ts.map +1 -0
- package/providers/team/hooks/useMatchHelpers.d.ts +12 -0
- package/providers/team/hooks/useMatchHelpers.d.ts.map +1 -0
- package/providers/team/hooks/useSquadHelpers.d.ts +17 -0
- package/providers/team/hooks/useSquadHelpers.d.ts.map +1 -0
- package/providers/team.context.d.ts +8 -0
- package/providers/team.context.d.ts.map +1 -0
- package/providers/team.provider.d.ts +3 -0
- package/providers/team.provider.d.ts.map +1 -0
- package/providers/team.types.d.ts +68 -0
- package/providers/team.types.d.ts.map +1 -0
- package/types/canonical/base.types.d.ts +366 -0
- package/types/canonical/base.types.d.ts.map +1 -0
- package/types/canonical/commentary.types.d.ts +42 -0
- package/types/canonical/commentary.types.d.ts.map +1 -0
- package/types/canonical/event.types.d.ts +31 -0
- package/types/canonical/event.types.d.ts.map +1 -0
- package/types/canonical/index.d.ts +17 -0
- package/types/canonical/index.d.ts.map +1 -0
- package/types/canonical/lineup.types.d.ts +33 -0
- package/types/canonical/lineup.types.d.ts.map +1 -0
- package/types/canonical/match.types.d.ts +153 -0
- package/types/canonical/match.types.d.ts.map +1 -0
- package/types/canonical/odds.types.d.ts +73 -0
- package/types/canonical/odds.types.d.ts.map +1 -0
- package/types/canonical/search.types.d.ts +101 -0
- package/types/canonical/search.types.d.ts.map +1 -0
- package/types/canonical/sports-search.types.d.ts +151 -0
- package/types/canonical/sports-search.types.d.ts.map +1 -0
- package/types/canonical/squad.types.d.ts +30 -0
- package/types/canonical/squad.types.d.ts.map +1 -0
- package/types/canonical/standing.types.d.ts +85 -0
- package/types/canonical/standing.types.d.ts.map +1 -0
- package/types/canonical/statistics.types.d.ts +81 -0
- package/types/canonical/statistics.types.d.ts.map +1 -0
- package/types/index.d.ts +10 -0
- package/types/index.d.ts.map +1 -0
- package/utilities/stats/core/helpers.d.ts +65 -0
- package/utilities/stats/core/helpers.d.ts.map +1 -0
- package/utilities/stats/core/index.d.ts +7 -0
- package/utilities/stats/core/index.d.ts.map +1 -0
- package/utilities/stats/core/types.d.ts +39 -0
- package/utilities/stats/core/types.d.ts.map +1 -0
- package/utilities/stats/index.d.ts +27 -0
- package/utilities/stats/index.d.ts.map +1 -0
- package/utilities/stats/match/headToHead.d.ts +73 -0
- package/utilities/stats/match/headToHead.d.ts.map +1 -0
- package/utilities/stats/match/homeVsAway.d.ts +30 -0
- package/utilities/stats/match/homeVsAway.d.ts.map +1 -0
- package/utilities/stats/match/index.d.ts +8 -0
- package/utilities/stats/match/index.d.ts.map +1 -0
- package/utilities/stats/match/overUnder.d.ts +59 -0
- package/utilities/stats/match/overUnder.d.ts.map +1 -0
- package/utilities/stats/match/result.d.ts +13 -0
- package/utilities/stats/match/result.d.ts.map +1 -0
- package/utilities/stats/team/commonOpponents.d.ts +28 -0
- package/utilities/stats/team/commonOpponents.d.ts.map +1 -0
- package/utilities/stats/team/goalStats.d.ts +42 -0
- package/utilities/stats/team/goalStats.d.ts.map +1 -0
- package/utilities/stats/team/index.d.ts +7 -0
- package/utilities/stats/team/index.d.ts.map +1 -0
- package/utilities/stats/team/streaks.d.ts +48 -0
- package/utilities/stats/team/streaks.d.ts.map +1 -0
- package/vite.svg +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sportal365 Sports API - Football Statistics
|
|
3
|
+
*
|
|
4
|
+
* Fetches player statistics and transforms to canonical FUSports types.
|
|
5
|
+
*/
|
|
6
|
+
import type { FUSportsPlayerSeasonStatistics } from "../../../../types/canonical";
|
|
7
|
+
import { type DataLayerConfig } from "../../../../config";
|
|
8
|
+
import type { GetFootballPlayerSeasonStatisticsOptions } from "./player-season.types";
|
|
9
|
+
export type { GetFootballPlayerSeasonStatisticsOptions } from "./player-season.types";
|
|
10
|
+
/**
|
|
11
|
+
* Get player season statistics for a team
|
|
12
|
+
*
|
|
13
|
+
* Fetches statistics for all players in a team for the specified season(s).
|
|
14
|
+
*
|
|
15
|
+
* By default, results are cached for 10 minutes (600 seconds).
|
|
16
|
+
* You can override this by passing a custom `next` option.
|
|
17
|
+
*
|
|
18
|
+
* @param options - Required parameters (seasonIds, teamId)
|
|
19
|
+
* @param config - Optional data layer config (uses singleton if not provided)
|
|
20
|
+
* @returns Map of player ID to canonical FUSportsPlayerSeasonStatistics
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const stats = await getFootballPlayerSeasonStatistics({
|
|
25
|
+
* seasonIds: ['8009707'],
|
|
26
|
+
* teamId: '102'
|
|
27
|
+
* });
|
|
28
|
+
* console.log(stats['179118']?.goals); // Player goals
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* // Custom cache duration (5 minutes)
|
|
34
|
+
* const stats = await getFootballPlayerSeasonStatistics({
|
|
35
|
+
* seasonIds: ['8009707'],
|
|
36
|
+
* teamId: '102',
|
|
37
|
+
* next: { revalidate: 300 }
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function getFootballPlayerSeasonStatistics(options: GetFootballPlayerSeasonStatisticsOptions, config?: DataLayerConfig): Promise<Record<string, FUSportsPlayerSeasonStatistics>>;
|
|
42
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/statistics/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,KAAK,EAER,wCAAwC,EAC3C,MAAM,uBAAuB,CAAC;AAI/B,YAAY,EAAE,wCAAwC,EAAE,MAAM,uBAAuB,CAAC;AAEtF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,iCAAiC,CACnD,OAAO,EAAE,wCAAwC,EACjD,MAAM,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,8BAA8B,CAAC,CAAC,CAkCzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Player season statistics transformation utilities
|
|
3
|
+
* Transforms raw API responses to canonical FUSports types
|
|
4
|
+
*/
|
|
5
|
+
import type { FUSportsPlayerSeasonStatistics } from "../../../../types/canonical";
|
|
6
|
+
import type { RawPlayerSeasonStatisticsEntry } from "./player-season.types";
|
|
7
|
+
/**
|
|
8
|
+
* Transform raw player season statistics to canonical FUSportsPlayerSeasonStatistics
|
|
9
|
+
*/
|
|
10
|
+
export declare function transformPlayerSeasonStatistics(raw: RawPlayerSeasonStatisticsEntry, teamId: string): FUSportsPlayerSeasonStatistics;
|
|
11
|
+
//# sourceMappingURL=player-season.transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player-season.transformer.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/statistics/player-season.transformer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,KAAK,EAAE,8BAA8B,EAAsB,MAAM,uBAAuB,CAAC;AAkBhG;;GAEG;AACH,wBAAgB,+BAA+B,CAC3C,GAAG,EAAE,8BAA8B,EACnC,MAAM,EAAE,MAAM,GACf,8BAA8B,CAsDhC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Player season statistics types for Sportal365 Sports API
|
|
3
|
+
*/
|
|
4
|
+
import type { RawAssets, RawCountry, RawVenue, RawTournament, RawSeason } from "../../shared/types";
|
|
5
|
+
import type { NextCacheOptions } from "../../http";
|
|
6
|
+
export interface GetFootballPlayerSeasonStatisticsOptions {
|
|
7
|
+
/** Season IDs to fetch statistics for */
|
|
8
|
+
seasonIds: string[];
|
|
9
|
+
/** Team ID to fetch statistics for */
|
|
10
|
+
teamId: string;
|
|
11
|
+
/** Language code for translations (e.g., 'en', 'bg'). Defaults to 'en' */
|
|
12
|
+
languageCode?: string;
|
|
13
|
+
/** Next.js cache options for ISR/on-demand revalidation */
|
|
14
|
+
next?: NextCacheOptions;
|
|
15
|
+
}
|
|
16
|
+
export interface RawPlayerStatistic {
|
|
17
|
+
name: string;
|
|
18
|
+
value: string;
|
|
19
|
+
}
|
|
20
|
+
export interface RawPlayerProfile {
|
|
21
|
+
height: string;
|
|
22
|
+
weight: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RawPlayerSocial {
|
|
25
|
+
type?: string;
|
|
26
|
+
url?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RawPlayerInfo {
|
|
29
|
+
country: RawCountry;
|
|
30
|
+
active: boolean;
|
|
31
|
+
birthdate: string;
|
|
32
|
+
birth_city: null | {
|
|
33
|
+
id: string;
|
|
34
|
+
name: string;
|
|
35
|
+
country: RawCountry;
|
|
36
|
+
uuid: string | null;
|
|
37
|
+
slug: string;
|
|
38
|
+
};
|
|
39
|
+
profile: RawPlayerProfile;
|
|
40
|
+
social: RawPlayerSocial[];
|
|
41
|
+
uuid: string;
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
slug: string;
|
|
45
|
+
position: string;
|
|
46
|
+
gender: "MALE" | "FEMALE";
|
|
47
|
+
assets: RawAssets;
|
|
48
|
+
}
|
|
49
|
+
export interface RawTeamInfo {
|
|
50
|
+
id: string;
|
|
51
|
+
name: string;
|
|
52
|
+
slug: string;
|
|
53
|
+
three_letter_code: string;
|
|
54
|
+
short_name: string;
|
|
55
|
+
type: "club" | "national";
|
|
56
|
+
country: RawCountry;
|
|
57
|
+
venue: RawVenue;
|
|
58
|
+
social: {
|
|
59
|
+
web?: string;
|
|
60
|
+
twitter_id?: string;
|
|
61
|
+
facebook_id?: string;
|
|
62
|
+
instagram_id?: string;
|
|
63
|
+
wikipedia_id?: string;
|
|
64
|
+
};
|
|
65
|
+
founded: number;
|
|
66
|
+
gender: "MALE" | "FEMALE";
|
|
67
|
+
assets: RawAssets;
|
|
68
|
+
uuid: string;
|
|
69
|
+
}
|
|
70
|
+
export interface RawPlayerSeasonStatisticsEntry {
|
|
71
|
+
player: RawPlayerInfo;
|
|
72
|
+
teams: RawTeamInfo[];
|
|
73
|
+
season: RawSeason & {
|
|
74
|
+
tournament: RawTournament;
|
|
75
|
+
};
|
|
76
|
+
statistics: RawPlayerStatistic[];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Player season statistics response from /v2/statistics/players/season
|
|
80
|
+
*/
|
|
81
|
+
export interface RawPlayerSeasonStatisticsResponse {
|
|
82
|
+
statistics: RawPlayerSeasonStatisticsEntry[];
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=player-season.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"player-season.types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/statistics/player-season.types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMnD,MAAM,WAAW,wCAAwC;IACrD,yCAAyC;IACzC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sCAAsC;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IA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U,CAAC;IACpB,KAAK,EAAE,QAAQ,CAAC;IAChB,MAAM,EAAE;QACJ,GAAG,CAAC,EAAE,MAAM,CAAC;QACb,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,YAAY,CAAC,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,MAAM,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,8BAA8B;IAC3C,MAAM,EAAE,aAAa,CAAC;IACtB,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,MAAM,EAAE,SAAS,GAAG;QAChB,UAAU,EAAE,aAAa,CAAC;KAC7B,CAAC;IACF,UAAU,EAAE,kBAAkB,EAAE,CAAC;CACpC;AAED;;GAEG;AACH,MAAM,WAAW,iCAAiC;IAC9C,UAAU,EAAE,8BAA8B,EAAE,CAAC;CAChD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sportal365 Sports API - Football Teams
|
|
3
|
+
*
|
|
4
|
+
* Fetches team data and transforms to canonical FUSports types.
|
|
5
|
+
*/
|
|
6
|
+
import type { FUSportsCompetitor, FUSportsSquad } from "../../../../types/canonical";
|
|
7
|
+
import { type DataLayerConfig } from "../../../../config";
|
|
8
|
+
import type { GetFootballTeamOptions } from "./team.types";
|
|
9
|
+
import type { GetFootballTeamSquadOptions } from "./squad.types";
|
|
10
|
+
export type { GetFootballTeamOptions } from "./team.types";
|
|
11
|
+
export type { GetFootballTeamSquadOptions } from "./squad.types";
|
|
12
|
+
/**
|
|
13
|
+
* Get a football team by ID, UUID, or slug
|
|
14
|
+
*
|
|
15
|
+
* Always fetches with `optional_data=form` to include recent match form.
|
|
16
|
+
*
|
|
17
|
+
* @param teamId - The team ID, UUID, or slug
|
|
18
|
+
* @param options - Optional parameters
|
|
19
|
+
* @param config - Optional data layer config (uses singleton if not provided)
|
|
20
|
+
* @returns Canonical FUSportsCompetitor
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* const team = await getFootballTeam('102');
|
|
25
|
+
* console.log(team.name); // "Manchester United"
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function getFootballTeam(teamId: string, options?: GetFootballTeamOptions, config?: DataLayerConfig): Promise<FUSportsCompetitor>;
|
|
29
|
+
/**
|
|
30
|
+
* Get a football team's squad by team ID, UUID, or slug
|
|
31
|
+
*
|
|
32
|
+
* Optionally fetches player season statistics if seasonIds are provided.
|
|
33
|
+
*
|
|
34
|
+
* @param teamId - The team ID, UUID, or slug
|
|
35
|
+
* @param options - Optional parameters
|
|
36
|
+
* @param config - Optional data layer config (uses singleton if not provided)
|
|
37
|
+
* @returns Canonical FUSportsSquad
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const squad = await getFootballTeamSquad('102');
|
|
42
|
+
* console.log(squad.players.length); // Number of players in squad
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```typescript
|
|
47
|
+
* // Fetch squad with season statistics
|
|
48
|
+
* const squad = await getFootballTeamSquad('102', { seasonIds: ['8009707'] });
|
|
49
|
+
* console.log(squad.players[0].seasonStatistics?.goals); // Player goals
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare function getFootballTeamSquad(teamId: string, options?: GetFootballTeamSquadOptions, config?: DataLayerConfig): Promise<FUSportsSquad>;
|
|
53
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/teams/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AACrF,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErE,OAAO,KAAK,EAAkB,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3E,OAAO,KAAK,EAAoB,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAKnF,YAAY,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AAC3D,YAAY,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEjE;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CACjC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,sBAAsB,EAChC,MAAM,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAkB7B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,oBAAoB,CACtC,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,2BAA2B,EACrC,MAAM,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,aAAa,CAAC,CA8CxB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Squad-specific types for Sportal365 Sports API
|
|
3
|
+
*/
|
|
4
|
+
import type { RawAssets, RawCountry } from "../../shared/types";
|
|
5
|
+
import type { NextCacheOptions } from "../../http";
|
|
6
|
+
export interface GetFootballTeamSquadOptions {
|
|
7
|
+
/** Language code for translations (e.g., 'en', 'bg'). Defaults to 'en' */
|
|
8
|
+
languageCode?: string;
|
|
9
|
+
/** Member status filter. Defaults to 'ACTIVE' */
|
|
10
|
+
memberStatus?: "ACTIVE" | "INACTIVE" | "ALL";
|
|
11
|
+
/** Season IDs to fetch player statistics for. If provided, each squad member will include seasonStatistics */
|
|
12
|
+
seasonIds?: string[];
|
|
13
|
+
/** Next.js cache options for ISR/on-demand revalidation */
|
|
14
|
+
next?: NextCacheOptions;
|
|
15
|
+
}
|
|
16
|
+
export interface RawSquadPlayerData {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
slug: string;
|
|
20
|
+
position: string;
|
|
21
|
+
country: RawCountry | null;
|
|
22
|
+
birthdate: string;
|
|
23
|
+
birth_city: string | null;
|
|
24
|
+
gender: "MALE" | "FEMALE";
|
|
25
|
+
profile: {
|
|
26
|
+
height: string | null;
|
|
27
|
+
weight: string | null;
|
|
28
|
+
} | null;
|
|
29
|
+
active: boolean;
|
|
30
|
+
assets: RawAssets | null;
|
|
31
|
+
}
|
|
32
|
+
export interface RawSquadPlayer {
|
|
33
|
+
player: RawSquadPlayerData;
|
|
34
|
+
shirt_number: number;
|
|
35
|
+
contract_type: "PERMANENT" | "LOAN" | "UNKNOWN";
|
|
36
|
+
contract_until: string | null;
|
|
37
|
+
status: "ACTIVE" | "INACTIVE";
|
|
38
|
+
start_date: string | null;
|
|
39
|
+
end_date: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface RawSquadCoach {
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
slug: string;
|
|
45
|
+
country: RawCountry | null;
|
|
46
|
+
birthdate: string;
|
|
47
|
+
gender: "MALE" | "FEMALE";
|
|
48
|
+
assets: RawAssets | null;
|
|
49
|
+
uuid: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Squad response from /v2/teams/{id}/squad
|
|
53
|
+
*/
|
|
54
|
+
export interface RawSquadResponse {
|
|
55
|
+
team: {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
slug: string;
|
|
59
|
+
};
|
|
60
|
+
coach: RawSquadCoach | null;
|
|
61
|
+
players: RawSquadPlayer[];
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=squad.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"squad.types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/teams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Q,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,aAAa;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,UAAU,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC1B,MAAM,EAAE,SAAS,GAAG,IAAI,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B,IAAI,EAAE;QACF,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,cAAc,EAAE,CAAC;CAC7B"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team-specific types for Sportal365 Sports API
|
|
3
|
+
* Types specific to team entities and team profile responses
|
|
4
|
+
*/
|
|
5
|
+
import type { RawAssets, RawCountry, RawVenue, RawSeason, RawFormMatch } from "../../shared/types";
|
|
6
|
+
import type { NextCacheOptions } from "../../http";
|
|
7
|
+
export interface RawTeamSocial {
|
|
8
|
+
web?: string;
|
|
9
|
+
twitter_id?: string;
|
|
10
|
+
facebook_id?: string;
|
|
11
|
+
instagram_id?: string;
|
|
12
|
+
wikipedia_id?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface RawCoach {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
slug: string;
|
|
18
|
+
country: RawCountry;
|
|
19
|
+
birthdate: string;
|
|
20
|
+
gender: "MALE" | "FEMALE";
|
|
21
|
+
assets: RawAssets | null;
|
|
22
|
+
uuid: string;
|
|
23
|
+
}
|
|
24
|
+
export interface RawShirtColor {
|
|
25
|
+
type: "home" | "away";
|
|
26
|
+
color_code: string;
|
|
27
|
+
}
|
|
28
|
+
export interface GetFootballTeamOptions {
|
|
29
|
+
/** Language code for translations (e.g., 'en', 'bg'). Defaults to 'en' */
|
|
30
|
+
languageCode?: string;
|
|
31
|
+
/** Next.js cache options for ISR/on-demand revalidation */
|
|
32
|
+
next?: NextCacheOptions;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Full team profile response from /v2/teams/{id}?optional_data=form
|
|
36
|
+
*/
|
|
37
|
+
export interface RawTeamProfile {
|
|
38
|
+
id: string;
|
|
39
|
+
name: string;
|
|
40
|
+
slug: string;
|
|
41
|
+
three_letter_code: string;
|
|
42
|
+
short_name: string | null;
|
|
43
|
+
type: "club" | "national" | "placeholder";
|
|
44
|
+
founded: number;
|
|
45
|
+
country: RawCountry;
|
|
46
|
+
venue: RawVenue;
|
|
47
|
+
social: RawTeamSocial;
|
|
48
|
+
coach: RawCoach | null;
|
|
49
|
+
president: unknown | null;
|
|
50
|
+
gender: "MALE" | "FEMALE";
|
|
51
|
+
active_seasons: RawSeason[];
|
|
52
|
+
assets: RawAssets;
|
|
53
|
+
shirt_colors: RawShirtColor[];
|
|
54
|
+
uuid: string;
|
|
55
|
+
current_season: RawSeason;
|
|
56
|
+
form: RawFormMatch[];
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=team.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/teams/team.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMnD,MAAM,WAAW,aAAa;IAC1B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,U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AAM,EAAE,SAAS,CAAC;IAClB,YAAY,EAAE,aAAa,EAAE,CAAC;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,SAAS,CAAC;IAC1B,IAAI,EAAE,YAAY,EAAE,CAAC;CACxB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Team transformation utilities
|
|
3
|
+
* Transforms raw API responses to canonical FUSports types
|
|
4
|
+
*/
|
|
5
|
+
import type { FUSportsTeamCompetitor, FUSportsSquad, FUSportsSquadMember, FUSportsCoach } from "../../../../types/canonical";
|
|
6
|
+
import type { RawTeamProfile } from "./team.types";
|
|
7
|
+
import type { RawSquadResponse, RawSquadPlayer, RawSquadCoach } from "./squad.types";
|
|
8
|
+
/**
|
|
9
|
+
* Transform raw team profile to canonical FUSportsTeamCompetitor
|
|
10
|
+
*/
|
|
11
|
+
export declare function transformTeam(raw: RawTeamProfile): FUSportsTeamCompetitor;
|
|
12
|
+
/**
|
|
13
|
+
* Transform raw squad player to canonical FUSportsSquadMember
|
|
14
|
+
*/
|
|
15
|
+
export declare function transformSquadPlayer(raw: RawSquadPlayer): FUSportsSquadMember;
|
|
16
|
+
/**
|
|
17
|
+
* Transform raw squad coach to canonical FUSportsCoach
|
|
18
|
+
*/
|
|
19
|
+
export declare function transformSquadCoach(raw: RawSquadCoach): FUSportsCoach;
|
|
20
|
+
/**
|
|
21
|
+
* Transform raw squad response to canonical FUSportsSquad
|
|
22
|
+
*/
|
|
23
|
+
export declare function transformSquad(raw: RawSquadResponse): FUSportsSquad;
|
|
24
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/teams/utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACR,sBAAsB,EACtB,aAAa,EACb,mBAAmB,EACnB,aAAa,EAChB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGrF;;GAEG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,cAAc,GAAG,sBAAsB,CA2KzE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,cAAc,GAAG,mBAAmB,CAmC7E;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,aAAa,CAiBrE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,gBAAgB,GAAG,aAAa,CAOnE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sportal365 Sports API - HTTP client factory
|
|
3
|
+
* Creates sport-specific HTTP clients for Sportal365 APIs
|
|
4
|
+
*/
|
|
5
|
+
import { type DataLayerConfig } from "../../config";
|
|
6
|
+
/**
|
|
7
|
+
* Next.js cache options for fetch requests
|
|
8
|
+
* @see https://nextjs.org/docs/app/api-reference/functions/fetch#optionsnext
|
|
9
|
+
*/
|
|
10
|
+
export interface NextCacheOptions {
|
|
11
|
+
/** Time in seconds to cache the response. Set to 0 to disable caching. */
|
|
12
|
+
revalidate?: number | false;
|
|
13
|
+
/** Cache tags for on-demand revalidation with revalidateTag() */
|
|
14
|
+
tags?: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface RequestOptions {
|
|
17
|
+
/** API path (e.g., '/v2/matches/123') */
|
|
18
|
+
path: string;
|
|
19
|
+
/** Query parameters */
|
|
20
|
+
params?: Record<string, string | string[] | undefined>;
|
|
21
|
+
/** Custom headers to include in the request */
|
|
22
|
+
headers?: Record<string, string>;
|
|
23
|
+
/** Next.js cache options for ISR/on-demand revalidation */
|
|
24
|
+
next?: NextCacheOptions;
|
|
25
|
+
/** Optional data layer config (uses singleton if not provided) */
|
|
26
|
+
config?: DataLayerConfig;
|
|
27
|
+
}
|
|
28
|
+
export interface Sportal365HttpClient {
|
|
29
|
+
/**
|
|
30
|
+
* Make a GET request to the Sportal365 Sports API
|
|
31
|
+
*
|
|
32
|
+
* Handles:
|
|
33
|
+
* - Authentication (Basic Auth)
|
|
34
|
+
* - Project ID header
|
|
35
|
+
* - Timeout
|
|
36
|
+
* - Error handling
|
|
37
|
+
*
|
|
38
|
+
* @param options - Request options
|
|
39
|
+
* @returns Parsed JSON response
|
|
40
|
+
*/
|
|
41
|
+
get<T>(options: RequestOptions): Promise<T>;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create an HTTP client for a specific Sportal365 API domain
|
|
45
|
+
*
|
|
46
|
+
* @param domain - The base URL for the API (e.g., 'https://football.api.sportal365.com')
|
|
47
|
+
* @returns HTTP client configured for the specified domain
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { createHttpClient } from '../http';
|
|
52
|
+
* import { SPORTAL365_FOOTBALL_DOMAIN } from '../constants';
|
|
53
|
+
*
|
|
54
|
+
* const footballHttp = createHttpClient(SPORTAL365_FOOTBALL_DOMAIN);
|
|
55
|
+
* const data = await footballHttp.get({ path: '/v2/matches/123' });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare function createHttpClient(domain: string): Sportal365HttpClient;
|
|
59
|
+
//# sourceMappingURL=http.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/lib/api/sportal365-sports/http.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/D;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC3B,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,uBAAuB;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC,CAAC;IACvD,+CAA+C;IAC/C,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,kEAAkE;IAClE,MAAM,CAAC,EAAE,eAAe,CAAC;CAC5B;AAED,MAAM,WAAW,oBAAoB;IACjC;;;;;;;;;;;OAWG;IACH,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;CAC/C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CA+DrE"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sportal365 Sports API
|
|
3
|
+
*
|
|
4
|
+
* API layer for communicating with Sportal365 Sports API.
|
|
5
|
+
* All public functions return canonical FUSports types.
|
|
6
|
+
*/
|
|
7
|
+
export { getFootballMatch, getFootballMatchEvents, getFootballMatchLineups, getFootballMatchOdds, getFootballMatchStatistics, getFootballMatchCommentary, getFootballMatches, getFootballTeam, getFootballTeamSquad, getFootballCompetition, getFootballSeasonDetails, getFootballStandings, getFootballPlayerSeasonStatistics, searchFootball, } from "./football";
|
|
8
|
+
export { search } from "./search";
|
|
9
|
+
export type { GetFootballMatchOptions, GetFootballMatchEventsOptions, GetFootballMatchLineupsOptions, GetFootballMatchOddsOptions, GetFootballMatchStatisticsOptions, GetFootballMatchCommentaryOptions, GetFootballMatchesOptions, GetFootballTeamOptions, GetFootballTeamSquadOptions, GetFootballCompetitionOptions, GetFootballSeasonDetailsOptions, GetFootballStandingsOptions, GetFootballPlayerSeasonStatisticsOptions, GetFootballSearchOptions, SearchEntityType, FootballStandingsExpandOption, OddType, ScopeType, OddFormat, MarketType, OptionalMatchData, MatchStatusType, SortDirection, } from "./football";
|
|
10
|
+
export type { GetSportsSearchOptions, SportType, SportsSearchEntityType } from "./search";
|
|
11
|
+
export { getTeamSeasonStatistics } from "./statistics";
|
|
12
|
+
export type { GetTeamSeasonStatisticsOptions } from "./statistics";
|
|
13
|
+
export type { NextCacheOptions } from "./http";
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/api/sportal365-sports/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACH,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,oBAAoB,EACpB,0BAA0B,EAC1B,0BAA0B,EAC1B,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,EACpB,iCAAiC,EACjC,cAAc,GACjB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,YAAY,EACR,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,yBAAyB,EACzB,sBAAsB,EACtB,2BAA2B,EAC3B,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,wCAAwC,EACxC,wBAAwB,EACxB,gBAAgB,EAChB,6BAA6B,EAC7B,OAAO,EACP,SAAS,EACT,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,aAAa,GAChB,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,sBAAsB,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAG1F,OAAO,EAAE,uBAAuB,EAAE,MAAM,cAAc,CAAC;AACvD,YAAY,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAGnE,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/sportal365-sports/search/http.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH;;GAEG;AACH,eAAO,MAAM,gBAAgB,wCAAoD,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sports Search API endpoints for Sportal365
|
|
3
|
+
* Cross-sport search across all entities
|
|
4
|
+
*/
|
|
5
|
+
import type { FUSportsSportsSearchResults } from "../../../types/canonical/sports-search.types";
|
|
6
|
+
import { type DataLayerConfig } from "../../../config";
|
|
7
|
+
import type { GetSportsSearchOptions } from "./search.types";
|
|
8
|
+
export type { GetSportsSearchOptions, SportType, SportsSearchEntityType } from "./search.types";
|
|
9
|
+
/**
|
|
10
|
+
* Search across all sports and entity types
|
|
11
|
+
*
|
|
12
|
+
* @param options - Search options
|
|
13
|
+
* @param config - Optional data layer config (uses global config if not provided)
|
|
14
|
+
* @returns Promise resolving to canonical search results
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* // Search for "Barcelona" across all sports
|
|
19
|
+
* const results = await search({ name: 'Barcelona' });
|
|
20
|
+
*
|
|
21
|
+
* // Search for teams only
|
|
22
|
+
* const teams = await search({
|
|
23
|
+
* name: 'Barcelona',
|
|
24
|
+
* entityTypes: ['team']
|
|
25
|
+
* });
|
|
26
|
+
*
|
|
27
|
+
* // Search for football teams only
|
|
28
|
+
* const footballTeams = await search({
|
|
29
|
+
* name: 'Barcelona',
|
|
30
|
+
* entityTypes: ['team'],
|
|
31
|
+
* sports: ['football']
|
|
32
|
+
* });
|
|
33
|
+
*
|
|
34
|
+
* // Search with pagination
|
|
35
|
+
* const page1 = await search({
|
|
36
|
+
* name: 'Barcelona',
|
|
37
|
+
* limit: 10,
|
|
38
|
+
* offset: 0
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function search(options?: GetSportsSearchOptions, config?: DataLayerConfig): Promise<FUSportsSportsSearchResults>;
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/sportal365-sports/search/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAChG,OAAO,EAAa,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElE,OAAO,KAAK,EAAE,sBAAsB,EAA2B,MAAM,gBAAgB,CAAC;AAItF,YAAY,EAAE,sBAAsB,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAEhG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,MAAM,CACxB,OAAO,GAAE,sBAA2B,EACpC,MAAM,CAAC,EAAE,eAAe,GACzB,OAAO,CAAC,2BAA2B,CAAC,CAoFtC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transformers for Sports Search API responses
|
|
3
|
+
*/
|
|
4
|
+
import type { FUSportsSportsSearchResult } from "../../../types/canonical/sports-search.types";
|
|
5
|
+
import type { RawSportsSearchResult } from "./search.types";
|
|
6
|
+
/**
|
|
7
|
+
* Transform raw search result to canonical format
|
|
8
|
+
*/
|
|
9
|
+
export declare function transformSportsSearchResult(raw: RawSportsSearchResult): FUSportsSportsSearchResult;
|
|
10
|
+
//# sourceMappingURL=search.transformer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"search.transformer.d.ts","sourceRoot":"","sources":["../../../../src/lib/api/sportal365-sports/search/search.transformer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EACR,0BAA0B,EAc7B,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EACR,qBAAqB,EAcxB,MAAM,gBAAgB,CAAC;AAmRxB;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,qBAAqB,GAAG,0BAA0B,CA4BlG"}
|