fansunited-data-layer 0.0.11 → 0.0.13
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/dist/api/sportal365-sports/constants.d.ts +0 -2
- package/dist/api/sportal365-sports/constants.d.ts.map +1 -1
- package/dist/api/sportal365-sports/football/index.d.ts +1 -1
- package/dist/api/sportal365-sports/football/index.d.ts.map +1 -1
- package/dist/api/sportal365-sports/football/standings/index.d.ts +5 -6
- package/dist/api/sportal365-sports/football/standings/index.d.ts.map +1 -1
- package/dist/api/sportal365-sports/football/standings/standing.transformer.d.ts +7 -6
- package/dist/api/sportal365-sports/football/standings/standing.transformer.d.ts.map +1 -1
- package/dist/api/sportal365-sports/football/standings/standing.types.d.ts +47 -107
- package/dist/api/sportal365-sports/football/standings/standing.types.d.ts.map +1 -1
- package/dist/api/sportal365-sports/index.d.ts +1 -1
- package/dist/api/sportal365-sports/index.d.ts.map +1 -1
- package/dist/client.cjs +2 -2
- package/dist/client.js +29 -28
- package/dist/fansunited-data-layer.cjs +1 -1
- package/dist/fansunited-data-layer.js +3 -3
- package/dist/{index-BKakLA9I.js → index-D1EJvAqY.js} +141 -203
- package/dist/index-DbaLZvqQ.cjs +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/providers/competition.provider.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/api/sportal365-sports/football/standings/http.d.ts +0 -13
- package/dist/api/sportal365-sports/football/standings/http.d.ts.map +0 -1
- package/dist/index-BUOIeK50.cjs +0 -1
|
@@ -9,6 +9,4 @@ export declare const SPORTAL365_FOOTBALL_DOMAIN = "https://football.api.sportal3
|
|
|
9
9
|
export declare const SPORTAL365_BASKETBALL_DOMAIN = "https://basketball.api.sportal365.com";
|
|
10
10
|
/** Tennis API domain */
|
|
11
11
|
export declare const SPORTAL365_TENNIS_DOMAIN = "https://tennis.api.sportal365.com";
|
|
12
|
-
/** Standings API domain */
|
|
13
|
-
export declare const SPORTAL365_STANDINGS_DOMAIN = "https://standing.api.sportal365.com";
|
|
14
12
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +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
|
|
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"}
|
|
@@ -11,5 +11,5 @@ export type { GetFootballTeamOptions } from "./teams";
|
|
|
11
11
|
export { getFootballCompetition, getFootballSeasonDetails } from "./competitions";
|
|
12
12
|
export type { GetFootballCompetitionOptions, GetFootballSeasonDetailsOptions } from "./competitions";
|
|
13
13
|
export { getFootballStandings } from "./standings";
|
|
14
|
-
export type { GetFootballStandingsOptions,
|
|
14
|
+
export type { GetFootballStandingsOptions, FootballStandingsExpandOption } from "./standings";
|
|
15
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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;AAGtD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAClF,YAAY,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAGrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,2BAA2B,EAAE,
|
|
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;AAGtD,OAAO,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAClF,YAAY,EAAE,6BAA6B,EAAE,+BAA+B,EAAE,MAAM,gBAAgB,CAAC;AAGrG,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACnD,YAAY,EAAE,2BAA2B,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Sportal365 Sports API - Football Standings
|
|
3
3
|
*
|
|
4
|
-
* Fetches standings data and transforms to canonical FUSports types.
|
|
4
|
+
* Fetches standings data from the Football API and transforms to canonical FUSports types.
|
|
5
5
|
*/
|
|
6
6
|
import type { FUSportsStandings } from "../../../../types/canonical";
|
|
7
7
|
import type { GetFootballStandingsOptions } from "./standing.types";
|
|
8
|
-
export type {
|
|
8
|
+
export type { RawFootballStandingTeam, RawFootballEventStatus, RawFootballFormEvent, RawFootballFormEntry, RawFootballStandingRule, RawFootballStandingEntry, RawFootballStandingsResponse, GetFootballStandingsOptions, FootballStandingsExpandOption, } from "./standing.types";
|
|
9
9
|
/**
|
|
10
10
|
* Get football standings for a stage
|
|
11
11
|
*
|
|
12
|
-
* @param options - Options including stageId (required)
|
|
12
|
+
* @param options - Options including stageId (required) and expand options
|
|
13
13
|
* @returns FUSportsStandings object with entries and metadata (including legend)
|
|
14
14
|
*
|
|
15
15
|
* @example
|
|
16
16
|
* ```typescript
|
|
17
17
|
* // Get all standings with form data
|
|
18
18
|
* const standings = await getFootballStandings({
|
|
19
|
-
* stageId: '
|
|
20
|
-
*
|
|
21
|
-
* optionalData: ['form']
|
|
19
|
+
* stageId: '8009708',
|
|
20
|
+
* expand: ['rules', 'form.events']
|
|
22
21
|
* });
|
|
23
22
|
*
|
|
24
23
|
* // Access entries and metadata
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/standings/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/standings/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAErE,OAAO,KAAK,EAAgC,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAIlG,YAAY,EACR,uBAAuB,EACvB,sBAAsB,EACtB,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,4BAA4B,EAC5B,2BAA2B,EAC3B,6BAA6B,GAChC,MAAM,kBAAkB,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAkB3G"}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Football API Standings Transformer
|
|
3
|
+
* Converts raw Football API standings to canonical FUSports types
|
|
3
4
|
*/
|
|
4
5
|
import type { FUSportsStandingEntry, FUSportsStandings } from "../../../../types/canonical";
|
|
5
|
-
import type {
|
|
6
|
+
import type { RawFootballStandingEntry } from "./standing.types";
|
|
6
7
|
/**
|
|
7
|
-
* Transform a single
|
|
8
|
+
* Transform a single Football API standing entry to canonical format
|
|
8
9
|
*/
|
|
9
|
-
export declare function transformStandingEntry(raw:
|
|
10
|
+
export declare function transformStandingEntry(raw: RawFootballStandingEntry): FUSportsStandingEntry;
|
|
10
11
|
/**
|
|
11
|
-
* Transform
|
|
12
|
+
* Transform Football API standing entries to canonical standings with legend
|
|
12
13
|
*/
|
|
13
|
-
export declare function transformStandings(rawEntries:
|
|
14
|
+
export declare function transformStandings(rawEntries: RawFootballStandingEntry[]): FUSportsStandings;
|
|
14
15
|
//# sourceMappingURL=standing.transformer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standing.transformer.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/standings/standing.transformer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"standing.transformer.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/standings/standing.transformer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAER,qBAAqB,EAErB,iBAAiB,EACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,wBAAwB,EAAiD,MAAM,kBAAkB,CAAC;AA2EhH;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,wBAAwB,GAAG,qBAAqB,CA+B3F;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,wBAAwB,EAAE,GAAG,iBAAiB,CAuB5F"}
|
|
@@ -1,130 +1,70 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
* Based on the
|
|
2
|
+
* Football API Standings Types
|
|
3
|
+
* Based on the Football API response structure from /tournaments/seasons/stages/{stageId}/standing
|
|
4
4
|
*/
|
|
5
|
-
import type { RawAsset, RawAssets, RawCompetition } from "../../shared/types";
|
|
6
5
|
import type { NextCacheOptions } from "../../http";
|
|
7
|
-
export interface
|
|
8
|
-
id:
|
|
6
|
+
export interface RawFootballStandingTeam {
|
|
7
|
+
id: number;
|
|
9
8
|
name: string;
|
|
10
|
-
entity_type: "stage";
|
|
11
|
-
short_name: string | null;
|
|
12
9
|
slug: string;
|
|
13
|
-
assets: RawAssets | null;
|
|
14
|
-
start_date: string | null;
|
|
15
|
-
}
|
|
16
|
-
export interface RawStandingsGroup {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
type: "OVERALL" | "HOME" | "AWAY";
|
|
20
|
-
entity_type: "group";
|
|
21
|
-
short_name: string | null;
|
|
22
|
-
assets: RawAssets | null;
|
|
23
|
-
}
|
|
24
|
-
export interface RawStandingsTeam {
|
|
25
|
-
id: string;
|
|
26
|
-
name: string;
|
|
27
|
-
type: "CLUB" | "NATIONAL";
|
|
28
|
-
gender: "MALE" | "FEMALE";
|
|
29
10
|
three_letter_code: string;
|
|
30
|
-
|
|
31
|
-
|
|
11
|
+
type: string;
|
|
12
|
+
gender: string;
|
|
32
13
|
short_name: string | null;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
export interface RawStandingRule {
|
|
37
|
-
id: string;
|
|
38
|
-
name: string;
|
|
39
|
-
type: "TOP" | "BOTTOM" | "MIDDLE";
|
|
40
|
-
standing_api_rule_type: RawStandingRuleType;
|
|
41
|
-
entity_type: "standing_position";
|
|
42
|
-
assets: RawAssets | null;
|
|
14
|
+
uuid: string;
|
|
15
|
+
url_logo: string;
|
|
16
|
+
form?: RawFootballFormEntry[];
|
|
43
17
|
}
|
|
44
|
-
export
|
|
45
|
-
|
|
46
|
-
id: string;
|
|
18
|
+
export interface RawFootballEventStatus {
|
|
19
|
+
id: number;
|
|
47
20
|
name: string;
|
|
48
|
-
|
|
49
|
-
|
|
21
|
+
type: string;
|
|
22
|
+
code: string;
|
|
50
23
|
short_name: string;
|
|
51
|
-
|
|
24
|
+
uuid: string | null;
|
|
52
25
|
}
|
|
53
|
-
export interface
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
export interface RawStandingFormStatus {
|
|
58
|
-
type: "FINISHED" | "LIVE" | "NOT_STARTED";
|
|
59
|
-
name: string;
|
|
60
|
-
short_name: string;
|
|
61
|
-
}
|
|
62
|
-
export interface RawStandingFormResult {
|
|
63
|
-
type: "display";
|
|
64
|
-
results: Array<{
|
|
65
|
-
value: string;
|
|
66
|
-
position: "1" | "2";
|
|
67
|
-
}>;
|
|
68
|
-
}
|
|
69
|
-
export interface RawStandingFormParticipant {
|
|
70
|
-
id: string;
|
|
71
|
-
name: string;
|
|
72
|
-
slug: string;
|
|
73
|
-
position: "1" | "2";
|
|
74
|
-
three_letter_code: string;
|
|
75
|
-
short_name: string | null;
|
|
76
|
-
entity_type: "team";
|
|
77
|
-
display_asset: RawAsset;
|
|
78
|
-
legacy_id: string;
|
|
79
|
-
assets: RawAssets | null;
|
|
80
|
-
}
|
|
81
|
-
export type RawStandingFormOutcome = "win" | "loss" | "draw";
|
|
82
|
-
export interface RawStandingFormMatch {
|
|
83
|
-
id: string;
|
|
84
|
-
status: RawStandingFormStatus;
|
|
85
|
-
result: RawStandingFormResult[];
|
|
86
|
-
outcome: RawStandingFormOutcome;
|
|
87
|
-
participants: RawStandingFormParticipant[];
|
|
88
|
-
slug: string;
|
|
26
|
+
export interface RawFootballFormEvent {
|
|
27
|
+
id: number;
|
|
28
|
+
event_status: RawFootballEventStatus;
|
|
89
29
|
start_time: string;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
columns: RawStandingColumn[];
|
|
97
|
-
form: RawStandingFormMatch[];
|
|
30
|
+
home_team: RawFootballStandingTeam;
|
|
31
|
+
away_team: RawFootballStandingTeam;
|
|
32
|
+
round: string;
|
|
33
|
+
goal_home: number;
|
|
34
|
+
goal_away: number;
|
|
35
|
+
slug: string;
|
|
98
36
|
}
|
|
99
|
-
export
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
export interface RawStandingsTable {
|
|
103
|
-
group: RawStandingsGroup;
|
|
104
|
-
type: RawStandingsType;
|
|
105
|
-
filter: RawStandingsFilter;
|
|
106
|
-
ranking_type: RawStandingsRankingType;
|
|
107
|
-
standing: RawStandingEntry[];
|
|
37
|
+
export interface RawFootballFormEntry {
|
|
38
|
+
outcome: "W" | "L" | "D";
|
|
39
|
+
event: RawFootballFormEvent;
|
|
108
40
|
}
|
|
109
|
-
export interface
|
|
110
|
-
|
|
111
|
-
|
|
41
|
+
export interface RawFootballStandingRule {
|
|
42
|
+
id: number;
|
|
43
|
+
code: string;
|
|
44
|
+
name: string;
|
|
45
|
+
type: string;
|
|
112
46
|
}
|
|
113
|
-
export interface
|
|
114
|
-
|
|
47
|
+
export interface RawFootballStandingEntry {
|
|
48
|
+
rank: number;
|
|
49
|
+
team: RawFootballStandingTeam;
|
|
50
|
+
played: number;
|
|
51
|
+
wins: number;
|
|
52
|
+
draws: number;
|
|
53
|
+
defeits: number;
|
|
54
|
+
goals_for: number;
|
|
55
|
+
goals_against: number;
|
|
56
|
+
points: number;
|
|
57
|
+
rules: RawFootballStandingRule[];
|
|
115
58
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
export type StandingsOptionalData = "form";
|
|
59
|
+
export type RawFootballStandingsResponse = RawFootballStandingEntry[];
|
|
60
|
+
/** Expand options for football API standings */
|
|
61
|
+
export type FootballStandingsExpandOption = "rules" | "form.events";
|
|
120
62
|
/** Options for fetching football standings */
|
|
121
63
|
export interface GetFootballStandingsOptions {
|
|
122
64
|
/** Stage ID (required) */
|
|
123
65
|
stageId: string;
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
-
/** Optional data to include (e.g., "form" for recent results) */
|
|
127
|
-
optionalData?: StandingsOptionalData[];
|
|
66
|
+
/** Expand options to include additional data (e.g., "rules", "form.events") */
|
|
67
|
+
expand?: FootballStandingsExpandOption[];
|
|
128
68
|
/** Next.js cache options for ISR/on-demand revalidation */
|
|
129
69
|
next?: NextCacheOptions;
|
|
130
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standing.types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/standings/standing.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"standing.types.d.ts","sourceRoot":"","sources":["../../../../../src/lib/api/sportal365-sports/football/standings/standing.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMnD,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,oBAAoB,EAAE,CAAC;CACjC;AAMD,MAAM,WAAW,sBAAsB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,sBAAsB,CAAC;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,uBAAuB,CAAC;IACnC,SAAS,EAAE,uBAAuB,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACjC,OAAO,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IACzB,KAAK,EAAE,oBAAoB,CAAC;CAC/B;AAMD,MAAM,WAAW,uBAAuB;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAMD,MAAM,WAAW,wBAAwB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,uBAAuB,CAAC;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,uBAAuB,EAAE,CAAC;CACpC;AAMD,MAAM,MAAM,4BAA4B,GAAG,wBAAwB,EAAE,CAAC;AAMtE,gDAAgD;AAChD,MAAM,MAAM,6BAA6B,GAAG,OAAO,GAAG,aAAa,CAAC;AAEpE,8CAA8C;AAC9C,MAAM,WAAW,2BAA2B;IACxC,0BAA0B;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,+EAA+E;IAC/E,MAAM,CAAC,EAAE,6BAA6B,EAAE,CAAC;IACzC,2DAA2D;IAC3D,IAAI,CAAC,EAAE,gBAAgB,CAAC;CAC3B"}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* All public functions return canonical FUSports types.
|
|
6
6
|
*/
|
|
7
7
|
export { getFootballMatch, getFootballMatchEvents, getFootballMatchLineups, getFootballMatchOdds, getFootballMatchStatistics, getFootballMatchCommentary, getFootballMatches, getFootballTeam, getFootballCompetition, getFootballSeasonDetails, getFootballStandings, } from "./football";
|
|
8
|
-
export type { GetFootballMatchOptions, GetFootballMatchEventsOptions, GetFootballMatchLineupsOptions, GetFootballMatchOddsOptions, GetFootballMatchStatisticsOptions, GetFootballMatchCommentaryOptions, GetFootballMatchesOptions, GetFootballTeamOptions, GetFootballCompetitionOptions, GetFootballSeasonDetailsOptions, GetFootballStandingsOptions,
|
|
8
|
+
export type { GetFootballMatchOptions, GetFootballMatchEventsOptions, GetFootballMatchLineupsOptions, GetFootballMatchOddsOptions, GetFootballMatchStatisticsOptions, GetFootballMatchCommentaryOptions, GetFootballMatchesOptions, GetFootballTeamOptions, GetFootballCompetitionOptions, GetFootballSeasonDetailsOptions, GetFootballStandingsOptions, FootballStandingsExpandOption, OddType, ScopeType, OddFormat, MarketType, OptionalMatchData, MatchStatusType, SortDirection, } from "./football";
|
|
9
9
|
export type { NextCacheOptions } from "./http";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +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,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,GACvB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACR,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,
|
|
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,sBAAsB,EACtB,wBAAwB,EACxB,oBAAoB,GACvB,MAAM,YAAY,CAAC;AAEpB,YAAY,EACR,uBAAuB,EACvB,6BAA6B,EAC7B,8BAA8B,EAC9B,2BAA2B,EAC3B,iCAAiC,EACjC,iCAAiC,EACjC,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,+BAA+B,EAC/B,2BAA2B,EAC3B,6BAA6B,EAC7B,OAAO,EACP,SAAS,EACT,SAAS,EACT,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,aAAa,GAChB,MAAM,YAAY,CAAC;AAGpB,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC"}
|
package/dist/client.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),N=require("./index-
|
|
1
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react"),N=require("./index-DbaLZvqQ.cjs");var G={exports:{}},D={};var Q;function re(){if(Q)return D;Q=1;var l=Symbol.for("react.transitional.element"),b=Symbol.for("react.fragment");function E(T,u,f){var k=null;if(f!==void 0&&(k=""+f),u.key!==void 0&&(k=""+u.key),"key"in u){f={};for(var d in u)d!=="key"&&(f[d]=u[d])}else f=u;return u=f.ref,{$$typeof:l,type:T,key:k,ref:u!==void 0?u:null,props:f}}return D.Fragment=b,D.jsx=E,D.jsxs=E,D}var M={};var K;function ne(){return K||(K=1,process.env.NODE_ENV!=="production"&&(function(){function l(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===z?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case c:return"Fragment";case g:return"Profiler";case U:return"StrictMode";case V:return"Suspense";case X:return"SuspenseList";case J:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case L:return"Portal";case q:return e.displayName||"Context";case W:return(e._context.displayName||"Context")+".Consumer";case I:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case h:return n=e.displayName||null,n!==null?n:l(e.type)||"Memo";case C:n=e._payload,e=e._init;try{return l(e(n))}catch{}}return null}function b(e){return""+e}function E(e){try{b(e);var n=!1}catch{n=!0}if(n){n=console;var s=n.error,t=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return s.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",t),b(e)}}function T(e){if(e===c)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===C)return"<...>";try{var n=l(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function u(){var e=S.A;return e===null?null:e.getOwner()}function f(){return Error("react-stack-top-frame")}function k(e){if(O.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function d(e,n){function s(){R||(R=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}s.isReactWarning=!0,Object.defineProperty(e,"key",{get:s,configurable:!0})}function F(){var e=l(this.type);return y[e]||(y[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function Y(e,n,s,t,r,i){var a=s.ref;return e={$$typeof:m,type:e,key:n,props:s,_owner:t},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:F}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:r}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:i}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function w(e,n,s,t,r,i){var a=n.children;if(a!==void 0)if(t)if(B(a)){for(t=0;t<a.length;t++)$(a[t]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else $(a);if(O.call(n,"key")){a=l(e);var v=Object.keys(n).filter(function(te){return te!=="key"});t=0<v.length?"{key: someKey, "+v.join(": ..., ")+": ...}":"{key: someKey}",j[a+t]||(v=0<v.length?"{"+v.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
2
2
|
let props = %s;
|
|
3
3
|
<%s {...props} />
|
|
4
4
|
React keys must be passed directly to JSX without using spread:
|
|
5
5
|
let props = %s;
|
|
6
|
-
<%s key={someKey} {...props} />`,t,a,
|
|
6
|
+
<%s key={someKey} {...props} />`,t,a,v,a),j[a+t]=!0)}if(a=null,s!==void 0&&(E(s),a=""+s),k(n)&&(E(n.key),a=""+n.key),"key"in n){s={};for(var H in n)H!=="key"&&(s[H]=n[H])}else s=n;return a&&d(s,typeof e=="function"?e.displayName||e.name||"Unknown":e),Y(e,a,s,u(),r,i)}function $(e){_(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===C&&(e._payload.status==="fulfilled"?_(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function _(e){return typeof e=="object"&&e!==null&&e.$$typeof===m}var p=o,m=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),g=Symbol.for("react.profiler"),W=Symbol.for("react.consumer"),q=Symbol.for("react.context"),I=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),J=Symbol.for("react.activity"),z=Symbol.for("react.client.reference"),S=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,O=Object.prototype.hasOwnProperty,B=Array.isArray,P=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function(e){return e()}};var R,y={},x=p.react_stack_bottom_frame.bind(p,f)(),A=P(T(f)),j={};M.Fragment=c,M.jsx=function(e,n,s){var t=1e4>S.recentlyCreatedOwnerStacks++;return w(e,n,s,!1,t?Error("react-stack-top-frame"):x,t?P(T(e)):A)},M.jsxs=function(e,n,s){var t=1e4>S.recentlyCreatedOwnerStacks++;return w(e,n,s,!0,t?Error("react-stack-top-frame"):x,t?P(T(e)):A)}})()),M}var ee;function ae(){return ee||(ee=1,process.env.NODE_ENV==="production"?G.exports=re():G.exports=ne()),G.exports}var oe=ae();const Z=o.createContext(null);function se(){const l=o.useContext(Z);if(!l)throw new Error("useCompetition must be used within CompetitionProvider");return l}function ie({competitionId:l,seasonId:b,stageId:E,competition:T,season:u,matches:f,standings:k,previousSeasons:d,config:F,autoRefresh:Y=!0,refreshInterval:w=3e4,children:$}){const[_,p]=o.useState(T),[m,L]=o.useState(u),[c,U]=o.useState(f??[]),[g,W]=o.useState(k??{entries:[],metadata:{legend:[]}}),[q,I]=o.useState(!1),[V,X]=o.useState(void 0);o.useEffect(()=>{p(T)},[T]),o.useEffect(()=>{L(u)},[u]),o.useEffect(()=>{U(f??[])},[f]),o.useEffect(()=>{W(k??{entries:[],metadata:{legend:[]}})},[k]),o.useEffect(()=>{if(_&&m)return;(async()=>{try{const r=b??m?.id,[i,a]=await Promise.all([_?Promise.resolve(_):N.getFootballCompetition(l),m?Promise.resolve(m):r?N.getFootballSeasonDetails({seasonId:r}):N.getFootballSeasonDetails({competitionId:l,status:"CURRENT"})]);_||p(i),m||L(a)}catch(r){console.error("[CompetitionProvider] Error fetching initial data:",r)}})()},[l,b]);const h=o.useCallback(async()=>{const t=b??m?.id;if(t){I(!0);try{const r=E??m?.stages?.find(v=>v.status==="ACTIVE")?.id,[i,a]=await Promise.all([N.getFootballMatches({tournamentIds:[l],seasonIds:[t],stageIds:r?[r]:void 0,limit:552,offset:0}),r?N.getFootballStandings({stageId:r,expand:["rules","form.events"]}):Promise.resolve({entries:[],metadata:{legend:[]}})]);U(i),W(a),X(new Date)}catch(r){console.error("[CompetitionProvider] Error refreshing matches/standings:",r)}finally{I(!1)}}},[l,b,E,m?.id,m?.stages]);o.useEffect(()=>{if(!Y||!c.some(i=>i.status.code==="live"))return;const r=setInterval(()=>{h()},w);return()=>clearInterval(r)},[Y,w,c,h]);const C=o.useCallback(t=>c.find(r=>r.id===t),[c]),J=o.useCallback(t=>c.filter(r=>r.competitorOne.id===t||r.competitorTwo.id===t),[c]),z=o.useCallback(t=>c.filter(r=>r.timing.kickoffTime.toISOString().startsWith(t)),[c]),S=o.useCallback(t=>c.filter(r=>r.round?.id===t),[c]),O=o.useCallback(()=>c.filter(t=>t.status.code==="live"),[c]),B=o.useCallback(t=>{const r=new Date;let i=c.filter(a=>a.status.code==="not_started"&&a.timing.kickoffTime>r);return t&&(i=i.filter(a=>a.competitorOne.id===t||a.competitorTwo.id===t)),i.sort((a,v)=>a.timing.kickoffTime.getTime()-v.timing.kickoffTime.getTime())},[c]),P=o.useCallback(t=>{let r=c.filter(i=>i.status.code==="finished");return t&&(r=r.filter(i=>i.competitorOne.id===t||i.competitorTwo.id===t)),r.sort((i,a)=>a.timing.kickoffTime.getTime()-i.timing.kickoffTime.getTime())},[c]),R=o.useCallback(t=>g.entries.find(r=>r.competitor.id===t),[g]),y=o.useCallback(t=>R(t)?.form?.formString,[R]),x=o.useCallback(t=>R(t)?.stats,[R]),A=o.useCallback(t=>[...g.entries].sort((r,i)=>r.rank-i.rank).slice(0,t),[g]),j=o.useCallback(t=>[...g.entries].sort((r,i)=>i.rank-r.rank).slice(0,t),[g]),e=o.useCallback(t=>d?.find(r=>r.id===t)?.matches,[d]),n=o.useCallback(t=>d?.find(r=>r.id===t)?.standings,[d]),s=o.useMemo(()=>({competitionId:l,seasonId:b,stageId:E,competition:_,season:m,isRefreshing:q,lastRefreshed:V,matches:c,standings:g,previousSeasons:d,config:F,refresh:h,getMatch:C,getMatchesByTeam:J,getMatchesByDate:z,getMatchesByRound:S,getLiveMatches:O,getUpcomingMatches:B,getFinishedMatches:P,getTeamStanding:R,getTeamForm:y,getTeamStats:x,getTopTeams:A,getBottomTeams:j,getSeasonMatches:e,getSeasonStandings:n}),[l,b,E,_,m,q,V,c,g,d,F,h,C,J,z,S,O,B,P,R,y,x,A,j,e,n]);return oe.jsx(Z.Provider,{value:s,children:$})}exports.CompetitionContext=Z;exports.CompetitionProvider=ie;exports.useCompetition=se;
|
package/dist/client.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import oe, { createContext as ae, useContext as se, useState as S, useEffect as y, useCallback as u, useMemo as ie } from "react";
|
|
3
|
-
import { j as ce, m as le, k as ue, l as Q } from "./index-
|
|
3
|
+
import { j as ce, m as le, k as ue, l as Q } from "./index-D1EJvAqY.js";
|
|
4
4
|
var X = { exports: {} }, M = {};
|
|
5
5
|
var K;
|
|
6
6
|
function fe() {
|
|
@@ -110,7 +110,7 @@ function me() {
|
|
|
110
110
|
return Error("react-stack-top-frame");
|
|
111
111
|
}
|
|
112
112
|
function R(e) {
|
|
113
|
-
if (
|
|
113
|
+
if (A.call(e, "key")) {
|
|
114
114
|
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
115
115
|
if (n && n.isReactWarning) return !1;
|
|
116
116
|
}
|
|
@@ -118,7 +118,7 @@ function me() {
|
|
|
118
118
|
}
|
|
119
119
|
function d(e, n) {
|
|
120
120
|
function a() {
|
|
121
|
-
|
|
121
|
+
b || (b = !0, console.error(
|
|
122
122
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
123
123
|
n
|
|
124
124
|
));
|
|
@@ -167,7 +167,7 @@ function me() {
|
|
|
167
167
|
value: s
|
|
168
168
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
170
|
+
function x(e, n, a, t, r, s) {
|
|
171
171
|
var o = n.children;
|
|
172
172
|
if (o !== void 0)
|
|
173
173
|
if (t)
|
|
@@ -180,7 +180,7 @@ function me() {
|
|
|
180
180
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
181
181
|
);
|
|
182
182
|
else L(o);
|
|
183
|
-
if (
|
|
183
|
+
if (A.call(n, "key")) {
|
|
184
184
|
o = c(e);
|
|
185
185
|
var v = Object.keys(n).filter(function(ne) {
|
|
186
186
|
return ne !== "key";
|
|
@@ -216,12 +216,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
216
216
|
);
|
|
217
217
|
}
|
|
218
218
|
function L(e) {
|
|
219
|
-
|
|
219
|
+
p(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === P && (e._payload.status === "fulfilled" ? p(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
220
220
|
}
|
|
221
|
-
function
|
|
221
|
+
function p(e) {
|
|
222
222
|
return typeof e == "object" && e !== null && e.$$typeof === m;
|
|
223
223
|
}
|
|
224
|
-
var k = oe, m = Symbol.for("react.transitional.element"), U = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), I = Symbol.for("react.consumer"), V = Symbol.for("react.context"), q = Symbol.for("react.forward_ref"), J = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), z = Symbol.for("react.activity"), B = Symbol.for("react.client.reference"), w = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,
|
|
224
|
+
var k = oe, m = Symbol.for("react.transitional.element"), U = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), T = Symbol.for("react.profiler"), I = Symbol.for("react.consumer"), V = Symbol.for("react.context"), q = Symbol.for("react.forward_ref"), J = Symbol.for("react.suspense"), H = Symbol.for("react.suspense_list"), h = Symbol.for("react.memo"), P = Symbol.for("react.lazy"), z = Symbol.for("react.activity"), B = Symbol.for("react.client.reference"), w = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, A = Object.prototype.hasOwnProperty, G = Array.isArray, O = console.createTask ? console.createTask : function() {
|
|
225
225
|
return null;
|
|
226
226
|
};
|
|
227
227
|
k = {
|
|
@@ -229,13 +229,13 @@ React keys must be passed directly to JSX without using spread:
|
|
|
229
229
|
return e();
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
-
var
|
|
232
|
+
var b, j = {}, C = k.react_stack_bottom_frame.bind(
|
|
233
233
|
k,
|
|
234
234
|
f
|
|
235
235
|
)(), N = O(_(f)), D = {};
|
|
236
236
|
F.Fragment = i, F.jsx = function(e, n, a) {
|
|
237
237
|
var t = 1e4 > w.recentlyCreatedOwnerStacks++;
|
|
238
|
-
return
|
|
238
|
+
return x(
|
|
239
239
|
e,
|
|
240
240
|
n,
|
|
241
241
|
a,
|
|
@@ -245,7 +245,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
245
245
|
);
|
|
246
246
|
}, F.jsxs = function(e, n, a) {
|
|
247
247
|
var t = 1e4 > w.recentlyCreatedOwnerStacks++;
|
|
248
|
-
return
|
|
248
|
+
return x(
|
|
249
249
|
e,
|
|
250
250
|
n,
|
|
251
251
|
a,
|
|
@@ -279,10 +279,10 @@ function _e({
|
|
|
279
279
|
previousSeasons: d,
|
|
280
280
|
config: Y,
|
|
281
281
|
autoRefresh: $ = !0,
|
|
282
|
-
refreshInterval:
|
|
282
|
+
refreshInterval: x = 3e4,
|
|
283
283
|
children: L
|
|
284
284
|
}) {
|
|
285
|
-
const [
|
|
285
|
+
const [p, k] = S(_), [m, U] = S(l), [i, W] = S(f ?? []), [T, I] = S(
|
|
286
286
|
R ?? { entries: [], metadata: { legend: [] } }
|
|
287
287
|
), [V, q] = S(!1), [J, H] = S(void 0);
|
|
288
288
|
y(() => {
|
|
@@ -294,14 +294,14 @@ function _e({
|
|
|
294
294
|
}, [f]), y(() => {
|
|
295
295
|
I(R ?? { entries: [], metadata: { legend: [] } });
|
|
296
296
|
}, [R]), y(() => {
|
|
297
|
-
if (
|
|
297
|
+
if (p && m) return;
|
|
298
298
|
(async () => {
|
|
299
299
|
try {
|
|
300
300
|
const r = E ?? m?.id, [s, o] = await Promise.all([
|
|
301
|
-
|
|
301
|
+
p ? Promise.resolve(p) : ue(c),
|
|
302
302
|
m ? Promise.resolve(m) : r ? Q({ seasonId: r }) : Q({ competitionId: c, status: "CURRENT" })
|
|
303
303
|
]);
|
|
304
|
-
|
|
304
|
+
p || k(s), m || U(o);
|
|
305
305
|
} catch (r) {
|
|
306
306
|
console.error("[CompetitionProvider] Error fetching initial data:", r);
|
|
307
307
|
}
|
|
@@ -321,7 +321,8 @@ function _e({
|
|
|
321
321
|
offset: 0
|
|
322
322
|
}),
|
|
323
323
|
r ? le({
|
|
324
|
-
stageId: r
|
|
324
|
+
stageId: r,
|
|
325
|
+
expand: ["rules", "form.events"]
|
|
325
326
|
}) : Promise.resolve({ entries: [], metadata: { legend: [] } })
|
|
326
327
|
]);
|
|
327
328
|
W(s), I(o), H(/* @__PURE__ */ new Date());
|
|
@@ -336,9 +337,9 @@ function _e({
|
|
|
336
337
|
if (!$ || !i.some((s) => s.status.code === "live")) return;
|
|
337
338
|
const r = setInterval(() => {
|
|
338
339
|
h();
|
|
339
|
-
},
|
|
340
|
+
}, x);
|
|
340
341
|
return () => clearInterval(r);
|
|
341
|
-
}, [$,
|
|
342
|
+
}, [$, x, i, h]);
|
|
342
343
|
const P = u((t) => i.find((r) => r.id === t), [i]), z = u(
|
|
343
344
|
(t) => i.filter((r) => r.competitorOne.id === t || r.competitorTwo.id === t),
|
|
344
345
|
[i]
|
|
@@ -348,7 +349,7 @@ function _e({
|
|
|
348
349
|
), w = u(
|
|
349
350
|
(t) => i.filter((r) => r.round?.id === t),
|
|
350
351
|
[i]
|
|
351
|
-
),
|
|
352
|
+
), A = u(() => i.filter((t) => t.status.code === "live"), [i]), G = u(
|
|
352
353
|
(t) => {
|
|
353
354
|
const r = /* @__PURE__ */ new Date();
|
|
354
355
|
let s = i.filter((o) => o.status.code === "not_started" && o.timing.kickoffTime > r);
|
|
@@ -361,10 +362,10 @@ function _e({
|
|
|
361
362
|
return t && (r = r.filter((s) => s.competitorOne.id === t || s.competitorTwo.id === t)), r.sort((s, o) => o.timing.kickoffTime.getTime() - s.timing.kickoffTime.getTime());
|
|
362
363
|
},
|
|
363
364
|
[i]
|
|
364
|
-
),
|
|
365
|
+
), b = u(
|
|
365
366
|
(t) => T.entries.find((r) => r.competitor.id === t),
|
|
366
367
|
[T]
|
|
367
|
-
), j = u((t) =>
|
|
368
|
+
), j = u((t) => b(t)?.form?.formString, [b]), C = u((t) => b(t)?.stats, [b]), N = u(
|
|
368
369
|
(t) => [...T.entries].sort((r, s) => r.rank - s.rank).slice(0, t),
|
|
369
370
|
[T]
|
|
370
371
|
), D = u(
|
|
@@ -383,7 +384,7 @@ function _e({
|
|
|
383
384
|
seasonId: E,
|
|
384
385
|
stageId: g,
|
|
385
386
|
// Competition and season info
|
|
386
|
-
competition:
|
|
387
|
+
competition: p,
|
|
387
388
|
season: m,
|
|
388
389
|
// Loading and refresh state
|
|
389
390
|
isRefreshing: V,
|
|
@@ -402,11 +403,11 @@ function _e({
|
|
|
402
403
|
getMatchesByTeam: z,
|
|
403
404
|
getMatchesByDate: B,
|
|
404
405
|
getMatchesByRound: w,
|
|
405
|
-
getLiveMatches:
|
|
406
|
+
getLiveMatches: A,
|
|
406
407
|
getUpcomingMatches: G,
|
|
407
408
|
getFinishedMatches: O,
|
|
408
409
|
// Standings helpers
|
|
409
|
-
getTeamStanding:
|
|
410
|
+
getTeamStanding: b,
|
|
410
411
|
getTeamForm: j,
|
|
411
412
|
getTeamStats: C,
|
|
412
413
|
getTopTeams: N,
|
|
@@ -419,7 +420,7 @@ function _e({
|
|
|
419
420
|
c,
|
|
420
421
|
E,
|
|
421
422
|
g,
|
|
422
|
-
|
|
423
|
+
p,
|
|
423
424
|
m,
|
|
424
425
|
V,
|
|
425
426
|
J,
|
|
@@ -432,10 +433,10 @@ function _e({
|
|
|
432
433
|
z,
|
|
433
434
|
B,
|
|
434
435
|
w,
|
|
435
|
-
|
|
436
|
+
A,
|
|
436
437
|
G,
|
|
437
438
|
O,
|
|
438
|
-
|
|
439
|
+
b,
|
|
439
440
|
j,
|
|
440
441
|
C,
|
|
441
442
|
N,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("./index-DbaLZvqQ.cjs");function b(e){return{id:e.id,name:e.name,shortName:e.short_name??void 0,threeLetterCode:e.three_letter_code,slug:e.slug,type:e.type==="placeholder"?"club":e.type,gender:e.gender,country:e.country?{id:e.country.id,name:e.country.name,code:e.country.code??void 0,flag:e.country.assets?.flag?.url,providerRef:e.country.uuid}:void 0,assets:e.assets?{logo:e.assets.logo?.url,homeKit:e.assets.home_kit?.url,awayKit:e.assets.away_kit?.url,squadImage:e.assets.squad_image?.url}:void 0,providerRef:e.uuid}}async function y(e,n={}){const{sportal365Sports:i}=a.getConfig(),s=await a.footballHttp.get({path:`/v2/teams/${e}`,params:{language_code:n.languageCode??i?.languageCode??"en",optional_data:"form"},next:n.next});return b(s)}function M(e){return!e.seasons||e.seasons.length===0?void 0:e.seasons.find(i=>i.active)??e.seasons[0]}function D(e,n){const i=new Date,s=n.filter(o=>{const l=o.competitorOne.id===e||o.competitorTwo.id===e,r=o.status.type==="NOT_STARTED"||o.status.type==="LIVE",c=new Date(o.timing.kickoffTime)>=i||o.status.type==="LIVE";return l&&r&&c});return s.sort((o,l)=>new Date(o.timing.kickoffTime).getTime()-new Date(l.timing.kickoffTime).getTime()),s[0]}function w(e,n){const i=new Date,s=n.filter(o=>{const l=o.competitorOne.id===e||o.competitorTwo.id===e,r=o.status.type==="FINISHED",c=new Date(o.timing.kickoffTime)<=i;return l&&r&&c});return s.sort((o,l)=>new Date(l.timing.kickoffTime).getTime()-new Date(o.timing.kickoffTime).getTime()),s[0]}const v={championsLeague:"#0066cc",europaLeague:"#ff6600",conferenceLeague:"#009933",promotion:"#00cc66",playoff:"#ffcc00",relegation:"#cc0000"};function C(e,n){const{columns:i,zoneColors:s=v,teamDecorator:o}=n??{},l={rank:{key:"rank",header:"#",align:"center",width:"xs"},team:{key:"team",header:"Team",align:"left",width:"flex"},played:{key:"played",header:"P",align:"center",width:"sm"},won:{key:"won",header:"W",align:"center",width:"sm"},drawn:{key:"drawn",header:"D",align:"center",width:"sm"},lost:{key:"lost",header:"L",align:"center",width:"sm"},goalsFor:{key:"goalsFor",header:"GF",align:"center",width:"sm"},goalsAgainst:{key:"goalsAgainst",header:"GA",align:"center",width:"sm"},goalDifference:{key:"goalDifference",header:"GD",align:"center",width:"sm"},points:{key:"points",header:"Pts",align:"center",width:"md",className:"font-bold"},form:{key:"form",header:"Form",align:"center",width:"lg"}},c=i??["rank","team","played","won","drawn","lost","goalsFor","goalsAgainst","goalDifference","points"],p=c.map(t=>l[t]),F=e.entries.map(t=>{let u;if(t.rules&&t.rules.length>0){const g=t.rules[0],h=e.metadata.legend.find(T=>T.key===g);h&&(u={color:s[g]??"#999999",label:h.name})}let d={name:t.competitor.name,logo:t.competitor.logo};o&&(d=o(d,t));const k={rank:t.rank,team:d,played:t.stats.played??"-",won:t.stats.won??"-",drawn:t.stats.drawn??"-",lost:t.stats.lost??"-",goalsFor:t.stats.goalsFor??"-",goalsAgainst:t.stats.goalsAgainst??"-",goalDifference:t.stats.goalDifference??"-",points:t.stats.points??"-",form:t.form??void 0},f={id:t.competitor.id,zone:u};for(const g of c)f[g]=k[g];return f}),m=e.metadata.legend.map(t=>({color:s[t.key]??"#999999",label:t.name}));return{columns:p,rows:F,legend:m.length>0?m:void 0}}exports.getConfig=a.getConfig;exports.getFootballCompetition=a.getFootballCompetition;exports.getFootballMatch=a.getFootballMatch;exports.getFootballMatchCommentary=a.getFootballMatchCommentary;exports.getFootballMatchEvents=a.getFootballMatchEvents;exports.getFootballMatchLineups=a.getFootballMatchLineups;exports.getFootballMatchOdds=a.getFootballMatchOdds;exports.getFootballMatchStatistics=a.getFootballMatchStatistics;exports.getFootballMatches=a.getFootballMatches;exports.getFootballSeasonDetails=a.getFootballSeasonDetails;exports.getFootballStandings=a.getFootballStandings;exports.isConfigured=a.isConfigured;exports.setConfig=a.setConfig;exports.getActiveSeason=M;exports.getFootballTeam=y;exports.getTeamNextMatch=D;exports.getTeamPreviousMatch=w;exports.standingsToStatsTable=C;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { g as y, f as F } from "./index-
|
|
2
|
-
import { k as x, a as E, h as O, b as N, c as R, d as I, e as K, j as P, l as G, m as U, i as q, s as z } from "./index-
|
|
1
|
+
import { g as y, f as F } from "./index-D1EJvAqY.js";
|
|
2
|
+
import { k as x, a as E, h as O, b as N, c as R, d as I, e as K, j as P, l as G, m as U, i as q, s as z } from "./index-D1EJvAqY.js";
|
|
3
3
|
function w(e) {
|
|
4
4
|
return {
|
|
5
5
|
id: e.id,
|
|
@@ -110,7 +110,7 @@ function _(e, s) {
|
|
|
110
110
|
goalsAgainst: t.stats.goalsAgainst ?? "-",
|
|
111
111
|
goalDifference: t.stats.goalDifference ?? "-",
|
|
112
112
|
points: t.stats.points ?? "-",
|
|
113
|
-
form: t.form
|
|
113
|
+
form: t.form ?? void 0
|
|
114
114
|
}, f = {
|
|
115
115
|
id: t.competitor.id,
|
|
116
116
|
zone: m
|