@gotza02/sequential-thinking 2026.2.40 → 2026.2.42
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/SYSTEM_INSTRUCTION.md +253 -37
- package/dist/http-server.js +45 -2
- package/dist/tools/filesystem.js +4 -3
- package/dist/tools/sports/core/base.d.ts +169 -0
- package/dist/tools/sports/core/base.js +289 -0
- package/dist/tools/sports/core/cache.d.ts +106 -0
- package/dist/tools/sports/core/cache.js +306 -0
- package/dist/tools/sports/core/constants.d.ts +179 -0
- package/dist/tools/sports/core/constants.js +149 -0
- package/dist/tools/sports/core/types.d.ts +379 -0
- package/dist/tools/sports/core/types.js +5 -0
- package/dist/tools/sports/index.d.ts +34 -0
- package/dist/tools/sports/index.js +50 -0
- package/dist/tools/sports/providers/api.d.ts +73 -0
- package/dist/tools/sports/providers/api.js +517 -0
- package/dist/tools/sports/providers/scraper.d.ts +66 -0
- package/dist/tools/sports/providers/scraper.js +186 -0
- package/dist/tools/sports/providers/search.d.ts +54 -0
- package/dist/tools/sports/providers/search.js +224 -0
- package/dist/tools/sports/tools/betting.d.ts +6 -0
- package/dist/tools/sports/tools/betting.js +251 -0
- package/dist/tools/sports/tools/league.d.ts +11 -0
- package/dist/tools/sports/tools/league.js +12 -0
- package/dist/tools/sports/tools/live.d.ts +9 -0
- package/dist/tools/sports/tools/live.js +235 -0
- package/dist/tools/sports/tools/match.d.ts +6 -0
- package/dist/tools/sports/tools/match.js +323 -0
- package/dist/tools/sports/tools/player.d.ts +6 -0
- package/dist/tools/sports/tools/player.js +152 -0
- package/dist/tools/sports/tools/team.d.ts +6 -0
- package/dist/tools/sports/tools/team.js +370 -0
- package/dist/tools/sports/utils/calculator.d.ts +69 -0
- package/dist/tools/sports/utils/calculator.js +156 -0
- package/dist/tools/sports/utils/formatter.d.ts +57 -0
- package/dist/tools/sports/utils/formatter.js +206 -0
- package/dist/tools/sports.d.ts +7 -0
- package/dist/tools/sports.js +27 -6
- package/dist/utils.d.ts +22 -0
- package/dist/utils.js +234 -6
- package/package.json +1 -1
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPORTS MODULE CONSTANTS
|
|
3
|
+
* Configuration values for the football intelligence system
|
|
4
|
+
*/
|
|
5
|
+
export declare const API_CONFIG: {
|
|
6
|
+
readonly API_FOOTBALL_KEY: string;
|
|
7
|
+
readonly API_FOOTBALL_BASE: "https://api-football-v1.p.rapidapi.com/v3";
|
|
8
|
+
readonly API_FOOTBALL_HOST: "api-football-v1.p.rapidapi.com";
|
|
9
|
+
readonly FOOTBALL_DATA_KEY: string;
|
|
10
|
+
readonly FOOTBALL_DATA_BASE: "https://api.football-data.org/v4";
|
|
11
|
+
readonly SPORTS_DB_KEY: string;
|
|
12
|
+
readonly SPORTS_DB_BASE: "https://www.thesportsdb.com/api/v1/json";
|
|
13
|
+
readonly RATE_LIMITS: {
|
|
14
|
+
readonly API_FOOTBALL: 10;
|
|
15
|
+
readonly FOOTBALL_DATA: 10;
|
|
16
|
+
readonly SPORTS_DB: 30;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const CACHE_CONFIG: {
|
|
20
|
+
readonly DEFAULT_TTL: number;
|
|
21
|
+
readonly TTL: {
|
|
22
|
+
readonly LIVE_SCORES: number;
|
|
23
|
+
readonly MATCH_DETAILS: number;
|
|
24
|
+
readonly STANDINGS: number;
|
|
25
|
+
readonly TEAM_STATS: number;
|
|
26
|
+
readonly PLAYER_STATS: number;
|
|
27
|
+
readonly ODDS: number;
|
|
28
|
+
readonly TRANSFER_NEWS: number;
|
|
29
|
+
};
|
|
30
|
+
readonly CACHE_PATH: string;
|
|
31
|
+
readonly MAX_SIZE: 1000;
|
|
32
|
+
};
|
|
33
|
+
export declare const SCRAPER_CONFIG: {
|
|
34
|
+
readonly PRIORITY_DOMAINS: readonly ["whoscored.com", "sofascore.com", "flashscore.com", "understat.com", "fbref.com", "bbc.co.uk/sport", "skysports.com", "sportsmole.co.uk", "goal.com", "thesquareball.net"];
|
|
35
|
+
readonly TIMEOUT: 15000;
|
|
36
|
+
readonly USER_AGENT: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36";
|
|
37
|
+
readonly MAX_CONTENT_LENGTH: 50000;
|
|
38
|
+
};
|
|
39
|
+
export declare const LEAGUES: {
|
|
40
|
+
readonly PREMIER_LEAGUE: {
|
|
41
|
+
readonly id: 39;
|
|
42
|
+
readonly name: "Premier League";
|
|
43
|
+
readonly country: "England";
|
|
44
|
+
readonly code: "PL";
|
|
45
|
+
};
|
|
46
|
+
readonly LA_LIGA: {
|
|
47
|
+
readonly id: 140;
|
|
48
|
+
readonly name: "La Liga";
|
|
49
|
+
readonly country: "Spain";
|
|
50
|
+
readonly code: "LL";
|
|
51
|
+
};
|
|
52
|
+
readonly BUNDESLIGA: {
|
|
53
|
+
readonly id: 78;
|
|
54
|
+
readonly name: "Bundesliga";
|
|
55
|
+
readonly country: "Germany";
|
|
56
|
+
readonly code: "BL1";
|
|
57
|
+
};
|
|
58
|
+
readonly SERIE_A: {
|
|
59
|
+
readonly id: 135;
|
|
60
|
+
readonly name: "Serie A";
|
|
61
|
+
readonly country: "Italy";
|
|
62
|
+
readonly code: "SA";
|
|
63
|
+
};
|
|
64
|
+
readonly LIGUE_1: {
|
|
65
|
+
readonly id: 61;
|
|
66
|
+
readonly name: "Ligue 1";
|
|
67
|
+
readonly country: "France";
|
|
68
|
+
readonly code: "FL1";
|
|
69
|
+
};
|
|
70
|
+
readonly EREDIVISIE: {
|
|
71
|
+
readonly id: 88;
|
|
72
|
+
readonly name: "Eredivisie";
|
|
73
|
+
readonly country: "Netherlands";
|
|
74
|
+
readonly code: "DED";
|
|
75
|
+
};
|
|
76
|
+
readonly PRIMEIRA_LIGA: {
|
|
77
|
+
readonly id: 94;
|
|
78
|
+
readonly name: "Primeira Liga";
|
|
79
|
+
readonly country: "Portugal";
|
|
80
|
+
readonly code: "PPL";
|
|
81
|
+
};
|
|
82
|
+
readonly CHAMPIONS_LEAGUE: {
|
|
83
|
+
readonly id: 2;
|
|
84
|
+
readonly name: "UEFA Champions League";
|
|
85
|
+
readonly country: "Europe";
|
|
86
|
+
readonly code: "CL";
|
|
87
|
+
};
|
|
88
|
+
readonly EUROPA_LEAGUE: {
|
|
89
|
+
readonly id: 3;
|
|
90
|
+
readonly name: "UEFA Europa League";
|
|
91
|
+
readonly country: "Europe";
|
|
92
|
+
readonly code: "EL";
|
|
93
|
+
};
|
|
94
|
+
readonly FA_CUP: {
|
|
95
|
+
readonly id: 45;
|
|
96
|
+
readonly name: "FA Cup";
|
|
97
|
+
readonly country: "England";
|
|
98
|
+
readonly code: "FAC";
|
|
99
|
+
};
|
|
100
|
+
readonly J_LEAGUE: {
|
|
101
|
+
readonly id: 98;
|
|
102
|
+
readonly name: "J1 League";
|
|
103
|
+
readonly country: "Japan";
|
|
104
|
+
readonly code: "J1";
|
|
105
|
+
};
|
|
106
|
+
readonly K_LEAGUE: {
|
|
107
|
+
readonly id: 251;
|
|
108
|
+
readonly name: "K League 1";
|
|
109
|
+
readonly country: "South Korea";
|
|
110
|
+
readonly code: "KL1";
|
|
111
|
+
};
|
|
112
|
+
readonly THAI_LEAGUE: {
|
|
113
|
+
readonly id: 305;
|
|
114
|
+
readonly name: "Thai League 1";
|
|
115
|
+
readonly country: "Thailand";
|
|
116
|
+
readonly code: "TL1";
|
|
117
|
+
};
|
|
118
|
+
readonly CSL: {
|
|
119
|
+
readonly id: 169;
|
|
120
|
+
readonly name: "Chinese Super League";
|
|
121
|
+
readonly country: "China";
|
|
122
|
+
readonly code: "CSL";
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
export declare const QUERY_TYPES: {
|
|
126
|
+
readonly GENERAL: "general";
|
|
127
|
+
readonly H2H: "h2h";
|
|
128
|
+
readonly FORM: "form";
|
|
129
|
+
readonly NEWS: "news";
|
|
130
|
+
readonly STATS: "stats";
|
|
131
|
+
readonly ODDS: "odds";
|
|
132
|
+
readonly REFEREE: "referee";
|
|
133
|
+
readonly WEATHER: "weather";
|
|
134
|
+
readonly FATIGUE: "fatigue";
|
|
135
|
+
readonly SETPIECES: "setpieces";
|
|
136
|
+
};
|
|
137
|
+
export declare const BETTING: {
|
|
138
|
+
readonly KELLY_FULL: "full";
|
|
139
|
+
readonly KELLY_HALF: "half";
|
|
140
|
+
readonly KELLY_QUARTER: "quarter";
|
|
141
|
+
readonly VALUE_THRESHOLD: 0.05;
|
|
142
|
+
readonly HIGH_VALUE_THRESHOLD: 0.1;
|
|
143
|
+
readonly CONFIDENCE: {
|
|
144
|
+
readonly LOW: 50;
|
|
145
|
+
readonly MEDIUM: 65;
|
|
146
|
+
readonly HIGH: 80;
|
|
147
|
+
readonly VERY_HIGH: 90;
|
|
148
|
+
};
|
|
149
|
+
readonly DEFAULT_BANKROLL: 1000;
|
|
150
|
+
readonly MAX_STAKE_PERCENTAGE: 0.05;
|
|
151
|
+
};
|
|
152
|
+
export declare const POSITIONS: {
|
|
153
|
+
readonly GOALKEEPER: "GK";
|
|
154
|
+
readonly DEFENDER: "DF";
|
|
155
|
+
readonly MIDFIELDER: "MF";
|
|
156
|
+
readonly FORWARD: "FW";
|
|
157
|
+
readonly SUBSTITUTE: "SUB";
|
|
158
|
+
};
|
|
159
|
+
export declare const MATCH_STATUS: {
|
|
160
|
+
readonly SCHEDULED: "scheduled";
|
|
161
|
+
readonly LIVE: "live";
|
|
162
|
+
readonly FINISHED: "finished";
|
|
163
|
+
readonly POSTPONED: "postponed";
|
|
164
|
+
readonly CANCELLED: "cancelled";
|
|
165
|
+
readonly ABANDONED: "abandoned";
|
|
166
|
+
};
|
|
167
|
+
export declare const ERRORS: {
|
|
168
|
+
readonly NO_API_KEY: "No API key configured. Please set environment variables.";
|
|
169
|
+
readonly RATE_LIMITED: "API rate limit exceeded. Please try again later.";
|
|
170
|
+
readonly NOT_FOUND: "Requested data not found.";
|
|
171
|
+
readonly TIMEOUT: "Request timed out.";
|
|
172
|
+
readonly INVALID_RESPONSE: "Invalid response from API.";
|
|
173
|
+
readonly ALL_PROVIDERS_FAILED: "All data providers failed.";
|
|
174
|
+
};
|
|
175
|
+
export declare const MODULE_INFO: {
|
|
176
|
+
readonly NAME: "sports-module";
|
|
177
|
+
readonly VERSION: "2.0.0";
|
|
178
|
+
readonly DESCRIPTION: "Football Intelligence System for MCP Server";
|
|
179
|
+
};
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPORTS MODULE CONSTANTS
|
|
3
|
+
* Configuration values for the football intelligence system
|
|
4
|
+
*/
|
|
5
|
+
// ============= API Configuration =============
|
|
6
|
+
export const API_CONFIG = {
|
|
7
|
+
// API-Football (RapidAPI)
|
|
8
|
+
API_FOOTBALL_KEY: process.env.API_FOOTBALL_KEY || '',
|
|
9
|
+
API_FOOTBALL_BASE: 'https://api-football-v1.p.rapidapi.com/v3',
|
|
10
|
+
API_FOOTBALL_HOST: 'api-football-v1.p.rapidapi.com',
|
|
11
|
+
// Football-Data.org
|
|
12
|
+
FOOTBALL_DATA_KEY: process.env.FOOTBALL_DATA_KEY || '',
|
|
13
|
+
FOOTBALL_DATA_BASE: 'https://api.football-data.org/v4',
|
|
14
|
+
// TheSportsDB
|
|
15
|
+
SPORTS_DB_KEY: process.env.SPORTS_DB_KEY || '',
|
|
16
|
+
SPORTS_DB_BASE: 'https://www.thesportsdb.com/api/v1/json',
|
|
17
|
+
// Rate limits (requests per minute)
|
|
18
|
+
RATE_LIMITS: {
|
|
19
|
+
API_FOOTBALL: 10,
|
|
20
|
+
FOOTBALL_DATA: 10,
|
|
21
|
+
SPORTS_DB: 30,
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
// ============= Cache Configuration =============
|
|
25
|
+
export const CACHE_CONFIG = {
|
|
26
|
+
// Default TTL in milliseconds
|
|
27
|
+
DEFAULT_TTL: parseInt(process.env.SPORTS_CACHE_TTL || '300000'), // 5 minutes
|
|
28
|
+
// Specific TTLs for different data types
|
|
29
|
+
TTL: {
|
|
30
|
+
LIVE_SCORES: 60 * 1000, // 1 minute
|
|
31
|
+
MATCH_DETAILS: 5 * 60 * 1000, // 5 minutes
|
|
32
|
+
STANDINGS: 30 * 60 * 1000, // 30 minutes
|
|
33
|
+
TEAM_STATS: 60 * 60 * 1000, // 1 hour
|
|
34
|
+
PLAYER_STATS: 60 * 60 * 1000, // 1 hour
|
|
35
|
+
ODDS: 2 * 60 * 1000, // 2 minutes
|
|
36
|
+
TRANSFER_NEWS: 15 * 60 * 1000, // 15 minutes
|
|
37
|
+
},
|
|
38
|
+
// Cache file path
|
|
39
|
+
CACHE_PATH: process.env.SPORTS_CACHE_PATH || '.sports_cache.json',
|
|
40
|
+
// Max cache size (number of entries)
|
|
41
|
+
MAX_SIZE: 1000,
|
|
42
|
+
};
|
|
43
|
+
// ============= Scraping Configuration =============
|
|
44
|
+
export const SCRAPER_CONFIG = {
|
|
45
|
+
// Priority domains for sports data
|
|
46
|
+
PRIORITY_DOMAINS: [
|
|
47
|
+
'whoscored.com',
|
|
48
|
+
'sofascore.com',
|
|
49
|
+
'flashscore.com',
|
|
50
|
+
'understat.com',
|
|
51
|
+
'fbref.com',
|
|
52
|
+
'bbc.co.uk/sport',
|
|
53
|
+
'skysports.com',
|
|
54
|
+
'sportsmole.co.uk',
|
|
55
|
+
'goal.com',
|
|
56
|
+
'thesquareball.net'
|
|
57
|
+
],
|
|
58
|
+
// Scraping timeout in milliseconds
|
|
59
|
+
TIMEOUT: 15000,
|
|
60
|
+
// User agent for scraping
|
|
61
|
+
USER_AGENT: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
|
|
62
|
+
// Maximum content length
|
|
63
|
+
MAX_CONTENT_LENGTH: 50000,
|
|
64
|
+
};
|
|
65
|
+
// ============= Leagues Configuration =============
|
|
66
|
+
export const LEAGUES = {
|
|
67
|
+
// Major European Leagues
|
|
68
|
+
PREMIER_LEAGUE: { id: 39, name: 'Premier League', country: 'England', code: 'PL' },
|
|
69
|
+
LA_LIGA: { id: 140, name: 'La Liga', country: 'Spain', code: 'LL' },
|
|
70
|
+
BUNDESLIGA: { id: 78, name: 'Bundesliga', country: 'Germany', code: 'BL1' },
|
|
71
|
+
SERIE_A: { id: 135, name: 'Serie A', country: 'Italy', code: 'SA' },
|
|
72
|
+
LIGUE_1: { id: 61, name: 'Ligue 1', country: 'France', code: 'FL1' },
|
|
73
|
+
// Other Top Leagues
|
|
74
|
+
EREDIVISIE: { id: 88, name: 'Eredivisie', country: 'Netherlands', code: 'DED' },
|
|
75
|
+
PRIMEIRA_LIGA: { id: 94, name: 'Primeira Liga', country: 'Portugal', code: 'PPL' },
|
|
76
|
+
CHAMPIONS_LEAGUE: { id: 2, name: 'UEFA Champions League', country: 'Europe', code: 'CL' },
|
|
77
|
+
EUROPA_LEAGUE: { id: 3, name: 'UEFA Europa League', country: 'Europe', code: 'EL' },
|
|
78
|
+
FA_CUP: { id: 45, name: 'FA Cup', country: 'England', code: 'FAC' },
|
|
79
|
+
// Asian Leagues
|
|
80
|
+
J_LEAGUE: { id: 98, name: 'J1 League', country: 'Japan', code: 'J1' },
|
|
81
|
+
K_LEAGUE: { id: 251, name: 'K League 1', country: 'South Korea', code: 'KL1' },
|
|
82
|
+
THAI_LEAGUE: { id: 305, name: 'Thai League 1', country: 'Thailand', code: 'TL1' },
|
|
83
|
+
CSL: { id: 169, name: 'Chinese Super League', country: 'China', code: 'CSL' },
|
|
84
|
+
};
|
|
85
|
+
// ============= Search Query Types =============
|
|
86
|
+
export const QUERY_TYPES = {
|
|
87
|
+
GENERAL: 'general',
|
|
88
|
+
H2H: 'h2h',
|
|
89
|
+
FORM: 'form',
|
|
90
|
+
NEWS: 'news',
|
|
91
|
+
STATS: 'stats',
|
|
92
|
+
ODDS: 'odds',
|
|
93
|
+
REFEREE: 'referee',
|
|
94
|
+
WEATHER: 'weather',
|
|
95
|
+
FATIGUE: 'fatigue',
|
|
96
|
+
SETPIECES: 'setpieces',
|
|
97
|
+
};
|
|
98
|
+
// ============= Betting Constants =============
|
|
99
|
+
export const BETTING = {
|
|
100
|
+
// Kelly Criterion variants
|
|
101
|
+
KELLY_FULL: 'full',
|
|
102
|
+
KELLY_HALF: 'half',
|
|
103
|
+
KELLY_QUARTER: 'quarter',
|
|
104
|
+
// Value thresholds
|
|
105
|
+
VALUE_THRESHOLD: 0.05, // 5% value is worth considering
|
|
106
|
+
HIGH_VALUE_THRESHOLD: 0.10, // 10% value is high value
|
|
107
|
+
// Confidence levels
|
|
108
|
+
CONFIDENCE: {
|
|
109
|
+
LOW: 50,
|
|
110
|
+
MEDIUM: 65,
|
|
111
|
+
HIGH: 80,
|
|
112
|
+
VERY_HIGH: 90,
|
|
113
|
+
},
|
|
114
|
+
// Bankroll management
|
|
115
|
+
DEFAULT_BANKROLL: 1000,
|
|
116
|
+
MAX_STAKE_PERCENTAGE: 0.05, // Max 5% of bankroll per bet
|
|
117
|
+
};
|
|
118
|
+
// ============= Position Types =============
|
|
119
|
+
export const POSITIONS = {
|
|
120
|
+
GOALKEEPER: 'GK',
|
|
121
|
+
DEFENDER: 'DF',
|
|
122
|
+
MIDFIELDER: 'MF',
|
|
123
|
+
FORWARD: 'FW',
|
|
124
|
+
SUBSTITUTE: 'SUB',
|
|
125
|
+
};
|
|
126
|
+
// ============= Match Status =============
|
|
127
|
+
export const MATCH_STATUS = {
|
|
128
|
+
SCHEDULED: 'scheduled',
|
|
129
|
+
LIVE: 'live',
|
|
130
|
+
FINISHED: 'finished',
|
|
131
|
+
POSTPONED: 'postponed',
|
|
132
|
+
CANCELLED: 'cancelled',
|
|
133
|
+
ABANDONED: 'abandoned',
|
|
134
|
+
};
|
|
135
|
+
// ============= Error Messages =============
|
|
136
|
+
export const ERRORS = {
|
|
137
|
+
NO_API_KEY: 'No API key configured. Please set environment variables.',
|
|
138
|
+
RATE_LIMITED: 'API rate limit exceeded. Please try again later.',
|
|
139
|
+
NOT_FOUND: 'Requested data not found.',
|
|
140
|
+
TIMEOUT: 'Request timed out.',
|
|
141
|
+
INVALID_RESPONSE: 'Invalid response from API.',
|
|
142
|
+
ALL_PROVIDERS_FAILED: 'All data providers failed.',
|
|
143
|
+
};
|
|
144
|
+
// ============= Version Info =============
|
|
145
|
+
export const MODULE_INFO = {
|
|
146
|
+
NAME: 'sports-module',
|
|
147
|
+
VERSION: '2.0.0',
|
|
148
|
+
DESCRIPTION: 'Football Intelligence System for MCP Server',
|
|
149
|
+
};
|
|
@@ -0,0 +1,379 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SPORTS MODULE TYPES
|
|
3
|
+
* Complete data models and interfaces for the football intelligence system
|
|
4
|
+
*/
|
|
5
|
+
export type Position = 'GK' | 'DF' | 'MF' | 'FW' | 'SUB';
|
|
6
|
+
export type MatchStatus = 'scheduled' | 'live' | 'finished' | 'postponed' | 'cancelled' | 'abandoned';
|
|
7
|
+
export type BetType = 'home' | 'draw' | 'away' | 'over' | 'under' | 'btts' | 'handicap';
|
|
8
|
+
export type KellyVariant = 'full' | 'half' | 'quarter';
|
|
9
|
+
export type QueryType = 'general' | 'h2h' | 'form' | 'news' | 'stats' | 'odds' | 'referee' | 'weather' | 'fatigue' | 'setpieces';
|
|
10
|
+
export type ProviderType = 'api-football' | 'football-data' | 'sports-db' | 'scraper';
|
|
11
|
+
export interface SearchQuery {
|
|
12
|
+
type: QueryType;
|
|
13
|
+
query: string;
|
|
14
|
+
priority: number;
|
|
15
|
+
}
|
|
16
|
+
export interface Score {
|
|
17
|
+
home: number;
|
|
18
|
+
away: number;
|
|
19
|
+
halfTime?: {
|
|
20
|
+
home: number;
|
|
21
|
+
away: number;
|
|
22
|
+
};
|
|
23
|
+
fullTime?: {
|
|
24
|
+
home: number;
|
|
25
|
+
away: number;
|
|
26
|
+
};
|
|
27
|
+
extraTime?: {
|
|
28
|
+
home: number;
|
|
29
|
+
away: number;
|
|
30
|
+
};
|
|
31
|
+
penalties?: {
|
|
32
|
+
home: number;
|
|
33
|
+
away: number;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export interface Team {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
code?: string;
|
|
40
|
+
country: string;
|
|
41
|
+
founded?: number;
|
|
42
|
+
logo?: string;
|
|
43
|
+
venue?: string;
|
|
44
|
+
website?: string;
|
|
45
|
+
stats?: TeamStats;
|
|
46
|
+
}
|
|
47
|
+
export interface TeamStats {
|
|
48
|
+
matchesPlayed: number;
|
|
49
|
+
wins: number;
|
|
50
|
+
draws: number;
|
|
51
|
+
losses: number;
|
|
52
|
+
goalsFor: number;
|
|
53
|
+
goalsAgainst: number;
|
|
54
|
+
goalDifference: number;
|
|
55
|
+
points?: number;
|
|
56
|
+
position?: number;
|
|
57
|
+
xG?: number;
|
|
58
|
+
xGA?: number;
|
|
59
|
+
xGDiff?: number;
|
|
60
|
+
possessionAvg?: number;
|
|
61
|
+
shotsPerGame?: number;
|
|
62
|
+
shotsOnTargetPerGame?: number;
|
|
63
|
+
cornersPerGame?: number;
|
|
64
|
+
foulsPerGame?: number;
|
|
65
|
+
yellowCardsPerGame?: number;
|
|
66
|
+
redCardsPerGame?: number;
|
|
67
|
+
homeStats?: TeamStats;
|
|
68
|
+
awayStats?: TeamStats;
|
|
69
|
+
form?: 'W' | 'D' | 'L'[];
|
|
70
|
+
}
|
|
71
|
+
export interface Player {
|
|
72
|
+
id: string;
|
|
73
|
+
name: string;
|
|
74
|
+
age?: number;
|
|
75
|
+
nationality: string;
|
|
76
|
+
position: Position;
|
|
77
|
+
number?: number;
|
|
78
|
+
photo?: string;
|
|
79
|
+
team?: Team;
|
|
80
|
+
stats?: PlayerStats;
|
|
81
|
+
marketValue?: number;
|
|
82
|
+
injured?: boolean;
|
|
83
|
+
suspended?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export interface PlayerStats {
|
|
86
|
+
season?: string;
|
|
87
|
+
league?: string;
|
|
88
|
+
matches: number;
|
|
89
|
+
starts: number;
|
|
90
|
+
minutes: number;
|
|
91
|
+
goals: number;
|
|
92
|
+
assists: number;
|
|
93
|
+
goalsPlusAssists?: number;
|
|
94
|
+
shots?: number;
|
|
95
|
+
shotsOnTarget?: number;
|
|
96
|
+
xG?: number;
|
|
97
|
+
xA?: number;
|
|
98
|
+
xGPlusXA?: number;
|
|
99
|
+
yellowCards: number;
|
|
100
|
+
redCards: number;
|
|
101
|
+
tackles?: number;
|
|
102
|
+
interceptions?: number;
|
|
103
|
+
dribbles?: number;
|
|
104
|
+
dribblesWon?: number;
|
|
105
|
+
passes?: number;
|
|
106
|
+
passAccuracy?: number;
|
|
107
|
+
keyPasses?: number;
|
|
108
|
+
aerialDuels?: number;
|
|
109
|
+
aerialDuelsWon?: number;
|
|
110
|
+
}
|
|
111
|
+
export interface League {
|
|
112
|
+
id: string;
|
|
113
|
+
name: string;
|
|
114
|
+
country: string;
|
|
115
|
+
code?: string;
|
|
116
|
+
season?: string;
|
|
117
|
+
type?: 'league' | 'cup' | 'playoff';
|
|
118
|
+
logo?: string;
|
|
119
|
+
standings?: TableEntry[];
|
|
120
|
+
topScorers?: PlayerStats[];
|
|
121
|
+
topAssists?: PlayerStats[];
|
|
122
|
+
}
|
|
123
|
+
export interface TableEntry {
|
|
124
|
+
position: number;
|
|
125
|
+
team: Team;
|
|
126
|
+
played: number;
|
|
127
|
+
won: number;
|
|
128
|
+
drawn: number;
|
|
129
|
+
lost: number;
|
|
130
|
+
goalsFor: number;
|
|
131
|
+
goalsAgainst: number;
|
|
132
|
+
goalDifference: number;
|
|
133
|
+
points: number;
|
|
134
|
+
form?: 'W' | 'D' | 'L'[];
|
|
135
|
+
homeRecord?: {
|
|
136
|
+
played: number;
|
|
137
|
+
won: number;
|
|
138
|
+
drawn: number;
|
|
139
|
+
lost: number;
|
|
140
|
+
goalsFor: number;
|
|
141
|
+
against: number;
|
|
142
|
+
};
|
|
143
|
+
awayRecord?: {
|
|
144
|
+
played: number;
|
|
145
|
+
won: number;
|
|
146
|
+
drawn: number;
|
|
147
|
+
lost: number;
|
|
148
|
+
goalsFor: number;
|
|
149
|
+
against: number;
|
|
150
|
+
};
|
|
151
|
+
lastFive?: {
|
|
152
|
+
result: 'W' | 'D' | 'L';
|
|
153
|
+
for: number;
|
|
154
|
+
against: number;
|
|
155
|
+
}[];
|
|
156
|
+
}
|
|
157
|
+
export interface Match {
|
|
158
|
+
id: string;
|
|
159
|
+
homeTeam: Team;
|
|
160
|
+
awayTeam: Team;
|
|
161
|
+
league: League;
|
|
162
|
+
date: Date;
|
|
163
|
+
status: MatchStatus;
|
|
164
|
+
venue?: string;
|
|
165
|
+
referee?: Referee;
|
|
166
|
+
score?: Score;
|
|
167
|
+
minute?: number;
|
|
168
|
+
extraMinute?: number;
|
|
169
|
+
half?: 'H1' | 'H2' | 'HT' | 'ET' | 'P';
|
|
170
|
+
odds?: MatchOdds;
|
|
171
|
+
attendance?: number;
|
|
172
|
+
weather?: WeatherInfo;
|
|
173
|
+
homeLineup?: Player[];
|
|
174
|
+
awayLineup?: Player[];
|
|
175
|
+
homeSubstitutes?: Player[];
|
|
176
|
+
awaySubstitutes?: Player[];
|
|
177
|
+
events?: MatchEvent[];
|
|
178
|
+
}
|
|
179
|
+
export interface MatchOdds {
|
|
180
|
+
homeWin: number;
|
|
181
|
+
draw: number;
|
|
182
|
+
awayWin: number;
|
|
183
|
+
asianHandicap?: {
|
|
184
|
+
home: number;
|
|
185
|
+
away: number;
|
|
186
|
+
line: number;
|
|
187
|
+
};
|
|
188
|
+
overUnder?: {
|
|
189
|
+
line: number;
|
|
190
|
+
over: number;
|
|
191
|
+
under: number;
|
|
192
|
+
};
|
|
193
|
+
btts?: {
|
|
194
|
+
yes: number;
|
|
195
|
+
no: number;
|
|
196
|
+
};
|
|
197
|
+
provider: string;
|
|
198
|
+
timestamp: Date;
|
|
199
|
+
opening?: MatchOdds;
|
|
200
|
+
}
|
|
201
|
+
export interface MatchEvent {
|
|
202
|
+
id: string;
|
|
203
|
+
type: 'goal' | 'card' | 'substitution' | 'var' | 'injury' | 'whistle';
|
|
204
|
+
team: 'home' | 'away';
|
|
205
|
+
player?: Player;
|
|
206
|
+
assistPlayer?: Player;
|
|
207
|
+
minute: number;
|
|
208
|
+
extraMinute?: number;
|
|
209
|
+
detail?: string;
|
|
210
|
+
}
|
|
211
|
+
export interface Referee {
|
|
212
|
+
id: string;
|
|
213
|
+
name: string;
|
|
214
|
+
country: string;
|
|
215
|
+
age?: number;
|
|
216
|
+
photo?: string;
|
|
217
|
+
stats: RefereeStats;
|
|
218
|
+
}
|
|
219
|
+
export interface RefereeStats {
|
|
220
|
+
matches: number;
|
|
221
|
+
yellowCardsAvg: number;
|
|
222
|
+
redCardsAvg: number;
|
|
223
|
+
penaltiesAvg: number;
|
|
224
|
+
homeWinRate: number;
|
|
225
|
+
awayWinRate: number;
|
|
226
|
+
drawRate: number;
|
|
227
|
+
avgGoals: number;
|
|
228
|
+
}
|
|
229
|
+
export interface ValueBet {
|
|
230
|
+
match: Match;
|
|
231
|
+
betType: BetType;
|
|
232
|
+
fairOdds: number;
|
|
233
|
+
marketOdds: number;
|
|
234
|
+
value: number;
|
|
235
|
+
confidence: number;
|
|
236
|
+
kellyFraction?: number;
|
|
237
|
+
recommendedStake?: number;
|
|
238
|
+
reasoning: string;
|
|
239
|
+
}
|
|
240
|
+
export interface WeatherInfo {
|
|
241
|
+
temperature?: number;
|
|
242
|
+
condition?: string;
|
|
243
|
+
humidity?: number;
|
|
244
|
+
windSpeed?: number;
|
|
245
|
+
windDirection?: string;
|
|
246
|
+
precipitation?: number;
|
|
247
|
+
}
|
|
248
|
+
export interface TransferNews {
|
|
249
|
+
id: string;
|
|
250
|
+
player: Player;
|
|
251
|
+
fromTeam?: Team;
|
|
252
|
+
toTeam?: Team;
|
|
253
|
+
type: 'rumor' | 'confirmed' | 'loan' | 'free_transfer';
|
|
254
|
+
fee?: number;
|
|
255
|
+
feeFormatted?: string;
|
|
256
|
+
source: string;
|
|
257
|
+
timestamp: Date;
|
|
258
|
+
reliability?: 'low' | 'medium' | 'high';
|
|
259
|
+
}
|
|
260
|
+
export interface HeadToHead {
|
|
261
|
+
homeTeam: Team;
|
|
262
|
+
awayTeam: Team;
|
|
263
|
+
totalMatches: number;
|
|
264
|
+
homeWins: number;
|
|
265
|
+
draws: number;
|
|
266
|
+
awayWins: number;
|
|
267
|
+
homeGoals: number;
|
|
268
|
+
awayGoals: number;
|
|
269
|
+
recentMatches: Match[];
|
|
270
|
+
}
|
|
271
|
+
export interface Formation {
|
|
272
|
+
name: string;
|
|
273
|
+
defenders: number;
|
|
274
|
+
midfielders: number;
|
|
275
|
+
forwards: number;
|
|
276
|
+
}
|
|
277
|
+
export interface TacticalAnalysis {
|
|
278
|
+
homeFormation?: Formation;
|
|
279
|
+
awayFormation?: Formation;
|
|
280
|
+
homeStyle?: string;
|
|
281
|
+
awayStyle?: string;
|
|
282
|
+
keyBattles?: TacticalBattle[];
|
|
283
|
+
strengths?: {
|
|
284
|
+
home: string[];
|
|
285
|
+
away: string[];
|
|
286
|
+
};
|
|
287
|
+
weaknesses?: {
|
|
288
|
+
home: string[];
|
|
289
|
+
away: string[];
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
export interface TacticalBattle {
|
|
293
|
+
area: string;
|
|
294
|
+
homePlayer?: Player;
|
|
295
|
+
awayPlayer?: Player;
|
|
296
|
+
analysis: string;
|
|
297
|
+
advantage?: 'home' | 'away' | 'neutral';
|
|
298
|
+
}
|
|
299
|
+
export interface FatigueInfo {
|
|
300
|
+
team: Team;
|
|
301
|
+
daysSinceLastMatch: number;
|
|
302
|
+
lastMatch?: Match;
|
|
303
|
+
upcomingMatches?: Match[];
|
|
304
|
+
travelDistance?: number;
|
|
305
|
+
squadDepth?: number;
|
|
306
|
+
injuries: number;
|
|
307
|
+
suspensions: number;
|
|
308
|
+
fatigueScore: number;
|
|
309
|
+
}
|
|
310
|
+
export interface SetPieceStats {
|
|
311
|
+
team: Team;
|
|
312
|
+
cornersPerGame: number;
|
|
313
|
+
cornersConcededPerGame: number;
|
|
314
|
+
freeKicksPerGame: number;
|
|
315
|
+
goalsFromCorners: number;
|
|
316
|
+
goalsFromFreeKicks: number;
|
|
317
|
+
concededFromCorners: number;
|
|
318
|
+
concededFromFreeKicks: number;
|
|
319
|
+
aerialDuelsWon: number;
|
|
320
|
+
aerialDuelsTotal: number;
|
|
321
|
+
aerialWinRate: number;
|
|
322
|
+
}
|
|
323
|
+
export interface WatchlistAlert {
|
|
324
|
+
id: string;
|
|
325
|
+
type: 'match' | 'odds' | 'news' | 'injury';
|
|
326
|
+
target: string;
|
|
327
|
+
condition: string;
|
|
328
|
+
triggered: boolean;
|
|
329
|
+
createdAt: Date;
|
|
330
|
+
triggeredAt?: Date;
|
|
331
|
+
data?: any;
|
|
332
|
+
}
|
|
333
|
+
export interface CacheEntry<T = any> {
|
|
334
|
+
key: string;
|
|
335
|
+
data: T;
|
|
336
|
+
timestamp: number;
|
|
337
|
+
ttl: number;
|
|
338
|
+
hits: number;
|
|
339
|
+
}
|
|
340
|
+
export interface APIResponse<T = any> {
|
|
341
|
+
success: boolean;
|
|
342
|
+
data?: T;
|
|
343
|
+
error?: string;
|
|
344
|
+
provider?: ProviderType;
|
|
345
|
+
cached?: boolean;
|
|
346
|
+
rateLimited?: boolean;
|
|
347
|
+
}
|
|
348
|
+
export interface ProviderStatus {
|
|
349
|
+
name: ProviderType;
|
|
350
|
+
available: boolean;
|
|
351
|
+
quotaRemaining: number;
|
|
352
|
+
quotaLimit: number;
|
|
353
|
+
rateLimitUntil?: Date;
|
|
354
|
+
lastCall?: Date;
|
|
355
|
+
}
|
|
356
|
+
export interface ComparisonResult {
|
|
357
|
+
teamA: Team;
|
|
358
|
+
teamB: Team;
|
|
359
|
+
metrics: ComparisonMetric[];
|
|
360
|
+
winner?: 'A' | 'B' | 'draw';
|
|
361
|
+
summary: string;
|
|
362
|
+
}
|
|
363
|
+
export interface ComparisonMetric {
|
|
364
|
+
name: string;
|
|
365
|
+
teamAValue: number | string;
|
|
366
|
+
teamBValue: number | string;
|
|
367
|
+
winner?: 'A' | 'B' | 'draw';
|
|
368
|
+
importance: 'high' | 'medium' | 'low';
|
|
369
|
+
analysis?: string;
|
|
370
|
+
}
|
|
371
|
+
export interface LiveScoreUpdate {
|
|
372
|
+
matchId: string;
|
|
373
|
+
homeTeam: string;
|
|
374
|
+
awayTeam: string;
|
|
375
|
+
score: Score;
|
|
376
|
+
minute: number;
|
|
377
|
+
events: MatchEvent[];
|
|
378
|
+
timestamp: Date;
|
|
379
|
+
}
|