fitzroy 1.0.0
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/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/cli.js +90 -0
- package/dist/index.d.ts +1709 -0
- package/dist/index.js +119 -0
- package/dist/shared/chunk-99nkfy8s.js +65 -0
- package/dist/shared/chunk-9zcjfgwe.js +66 -0
- package/dist/shared/chunk-b380x0p6.js +54 -0
- package/dist/shared/chunk-c7vawngt.js +63 -0
- package/dist/shared/chunk-d6fkap72.js +67 -0
- package/dist/shared/chunk-eyrvakjt.js +1 -0
- package/dist/shared/chunk-kr78ch1j.js +67 -0
- package/dist/shared/chunk-ngvkaczn.js +70 -0
- package/dist/shared/chunk-xv8z2kms.js +4 -0
- package/dist/shared/chunk-z78xs4nr.js +185 -0
- package/package.json +58 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1709 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result type for representing success/failure without exceptions.
|
|
3
|
+
*
|
|
4
|
+
* Use `ok(value)` for successes and `err(error)` for expected failures.
|
|
5
|
+
* Prefer this over throwing for operations that can predictably fail
|
|
6
|
+
* (network requests, parsing, validation).
|
|
7
|
+
*/
|
|
8
|
+
/** A successful result containing data of type `T`. */
|
|
9
|
+
interface Ok<T> {
|
|
10
|
+
readonly success: true;
|
|
11
|
+
readonly data: T;
|
|
12
|
+
}
|
|
13
|
+
/** A failed result containing an error of type `E`. */
|
|
14
|
+
interface Err<E> {
|
|
15
|
+
readonly success: false;
|
|
16
|
+
readonly error: E;
|
|
17
|
+
}
|
|
18
|
+
/** Discriminated union representing either success or failure. */
|
|
19
|
+
type Result<
|
|
20
|
+
T,
|
|
21
|
+
E = Error
|
|
22
|
+
> = Ok<T> | Err<E>;
|
|
23
|
+
/** Create a successful result. */
|
|
24
|
+
declare function ok<T>(data: T): Ok<T>;
|
|
25
|
+
/** Create a failed result. */
|
|
26
|
+
declare function err<E>(error: E): Err<E>;
|
|
27
|
+
/**
|
|
28
|
+
* Shared domain types for fitzRoy-ts.
|
|
29
|
+
*
|
|
30
|
+
* Define all domain types here before writing implementation code.
|
|
31
|
+
* Types are the single source of truth for the data model.
|
|
32
|
+
*/
|
|
33
|
+
/** AFL competition codes. */
|
|
34
|
+
type CompetitionCode = "AFLM" | "AFLW";
|
|
35
|
+
/** Round classification. */
|
|
36
|
+
type RoundType = "HomeAndAway" | "Finals";
|
|
37
|
+
/** Supported data sources mirroring the R package's `source` parameter. */
|
|
38
|
+
type DataSource = "afl-api" | "footywire" | "afl-tables";
|
|
39
|
+
/** Match status as reported by the AFL API. */
|
|
40
|
+
type MatchStatus = "Upcoming" | "Live" | "Complete" | "Postponed" | "Cancelled";
|
|
41
|
+
/** Goals-behinds-points breakdown for a single quarter. */
|
|
42
|
+
interface QuarterScore {
|
|
43
|
+
readonly goals: number;
|
|
44
|
+
readonly behinds: number;
|
|
45
|
+
readonly points: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* A completed or in-progress match with scores.
|
|
49
|
+
*
|
|
50
|
+
* One row per match. Quarter scores are optional — historical data
|
|
51
|
+
* from AFL Tables may not include them.
|
|
52
|
+
*/
|
|
53
|
+
interface MatchResult {
|
|
54
|
+
/** Provider-assigned match identifier (e.g. AFL API `matchProviderId`). */
|
|
55
|
+
readonly matchId: string;
|
|
56
|
+
readonly season: number;
|
|
57
|
+
readonly roundNumber: number;
|
|
58
|
+
readonly roundType: RoundType;
|
|
59
|
+
readonly date: Date;
|
|
60
|
+
readonly venue: string;
|
|
61
|
+
readonly homeTeam: string;
|
|
62
|
+
readonly awayTeam: string;
|
|
63
|
+
/** Total goals-behinds-points for each team. */
|
|
64
|
+
readonly homeGoals: number;
|
|
65
|
+
readonly homeBehinds: number;
|
|
66
|
+
readonly homePoints: number;
|
|
67
|
+
readonly awayGoals: number;
|
|
68
|
+
readonly awayBehinds: number;
|
|
69
|
+
readonly awayPoints: number;
|
|
70
|
+
/** Positive = home win, negative = away win. */
|
|
71
|
+
readonly margin: number;
|
|
72
|
+
/** Per-quarter scores (null when unavailable). */
|
|
73
|
+
readonly q1Home: QuarterScore | null;
|
|
74
|
+
readonly q2Home: QuarterScore | null;
|
|
75
|
+
readonly q3Home: QuarterScore | null;
|
|
76
|
+
readonly q4Home: QuarterScore | null;
|
|
77
|
+
readonly q1Away: QuarterScore | null;
|
|
78
|
+
readonly q2Away: QuarterScore | null;
|
|
79
|
+
readonly q3Away: QuarterScore | null;
|
|
80
|
+
readonly q4Away: QuarterScore | null;
|
|
81
|
+
readonly status: MatchStatus;
|
|
82
|
+
readonly attendance: number | null;
|
|
83
|
+
/** Venue metadata (null for scraped sources). */
|
|
84
|
+
readonly venueState: string | null;
|
|
85
|
+
readonly venueTimezone: string | null;
|
|
86
|
+
/** Rushed behinds per team (null when unavailable). */
|
|
87
|
+
readonly homeRushedBehinds: number | null;
|
|
88
|
+
readonly awayRushedBehinds: number | null;
|
|
89
|
+
/** Minutes each team spent in front (null when unavailable). */
|
|
90
|
+
readonly homeMinutesInFront: number | null;
|
|
91
|
+
readonly awayMinutesInFront: number | null;
|
|
92
|
+
readonly source: DataSource;
|
|
93
|
+
readonly competition: CompetitionCode;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Per-player statistics for a single match.
|
|
97
|
+
*
|
|
98
|
+
* Fields are nullable because not all stats are available for every
|
|
99
|
+
* era or source.
|
|
100
|
+
*/
|
|
101
|
+
interface PlayerStats {
|
|
102
|
+
readonly matchId: string;
|
|
103
|
+
readonly season: number;
|
|
104
|
+
readonly roundNumber: number;
|
|
105
|
+
readonly team: string;
|
|
106
|
+
readonly competition: CompetitionCode;
|
|
107
|
+
/** Player identification. */
|
|
108
|
+
readonly playerId: string;
|
|
109
|
+
readonly givenName: string;
|
|
110
|
+
readonly surname: string;
|
|
111
|
+
readonly displayName: string;
|
|
112
|
+
readonly jumperNumber: number | null;
|
|
113
|
+
/** Core stats. */
|
|
114
|
+
readonly kicks: number | null;
|
|
115
|
+
readonly handballs: number | null;
|
|
116
|
+
readonly disposals: number | null;
|
|
117
|
+
readonly marks: number | null;
|
|
118
|
+
readonly goals: number | null;
|
|
119
|
+
readonly behinds: number | null;
|
|
120
|
+
readonly tackles: number | null;
|
|
121
|
+
readonly hitouts: number | null;
|
|
122
|
+
readonly freesFor: number | null;
|
|
123
|
+
readonly freesAgainst: number | null;
|
|
124
|
+
/** Contested/uncontested. */
|
|
125
|
+
readonly contestedPossessions: number | null;
|
|
126
|
+
readonly uncontestedPossessions: number | null;
|
|
127
|
+
readonly contestedMarks: number | null;
|
|
128
|
+
readonly intercepts: number | null;
|
|
129
|
+
/** Clearances. */
|
|
130
|
+
readonly centreClearances: number | null;
|
|
131
|
+
readonly stoppageClearances: number | null;
|
|
132
|
+
readonly totalClearances: number | null;
|
|
133
|
+
/** Other stats. */
|
|
134
|
+
readonly inside50s: number | null;
|
|
135
|
+
readonly rebound50s: number | null;
|
|
136
|
+
readonly clangers: number | null;
|
|
137
|
+
readonly turnovers: number | null;
|
|
138
|
+
readonly onePercenters: number | null;
|
|
139
|
+
readonly bounces: number | null;
|
|
140
|
+
readonly goalAssists: number | null;
|
|
141
|
+
readonly disposalEfficiency: number | null;
|
|
142
|
+
readonly metresGained: number | null;
|
|
143
|
+
/** Additional base stats. */
|
|
144
|
+
readonly goalAccuracy: number | null;
|
|
145
|
+
readonly marksInside50: number | null;
|
|
146
|
+
readonly tacklesInside50: number | null;
|
|
147
|
+
readonly shotsAtGoal: number | null;
|
|
148
|
+
readonly scoreInvolvements: number | null;
|
|
149
|
+
readonly totalPossessions: number | null;
|
|
150
|
+
readonly timeOnGroundPercentage: number | null;
|
|
151
|
+
readonly ratingPoints: number | null;
|
|
152
|
+
/** Fantasy. */
|
|
153
|
+
readonly dreamTeamPoints: number | null;
|
|
154
|
+
/** Extended stats. */
|
|
155
|
+
readonly effectiveDisposals: number | null;
|
|
156
|
+
readonly effectiveKicks: number | null;
|
|
157
|
+
readonly kickEfficiency: number | null;
|
|
158
|
+
readonly kickToHandballRatio: number | null;
|
|
159
|
+
readonly pressureActs: number | null;
|
|
160
|
+
readonly defHalfPressureActs: number | null;
|
|
161
|
+
readonly spoils: number | null;
|
|
162
|
+
readonly hitoutsToAdvantage: number | null;
|
|
163
|
+
readonly hitoutWinPercentage: number | null;
|
|
164
|
+
readonly hitoutToAdvantageRate: number | null;
|
|
165
|
+
readonly groundBallGets: number | null;
|
|
166
|
+
readonly f50GroundBallGets: number | null;
|
|
167
|
+
readonly interceptMarks: number | null;
|
|
168
|
+
readonly marksOnLead: number | null;
|
|
169
|
+
readonly contestedPossessionRate: number | null;
|
|
170
|
+
readonly contestOffOneOnOnes: number | null;
|
|
171
|
+
readonly contestOffWins: number | null;
|
|
172
|
+
readonly contestOffWinsPercentage: number | null;
|
|
173
|
+
readonly contestDefOneOnOnes: number | null;
|
|
174
|
+
readonly contestDefLosses: number | null;
|
|
175
|
+
readonly contestDefLossPercentage: number | null;
|
|
176
|
+
readonly centreBounceAttendances: number | null;
|
|
177
|
+
readonly kickins: number | null;
|
|
178
|
+
readonly kickinsPlayon: number | null;
|
|
179
|
+
readonly ruckContests: number | null;
|
|
180
|
+
readonly scoreLaunches: number | null;
|
|
181
|
+
readonly source: DataSource;
|
|
182
|
+
}
|
|
183
|
+
/** A scheduled match (may not yet have scores). */
|
|
184
|
+
interface Fixture {
|
|
185
|
+
readonly matchId: string;
|
|
186
|
+
readonly season: number;
|
|
187
|
+
readonly roundNumber: number;
|
|
188
|
+
readonly roundType: RoundType;
|
|
189
|
+
readonly date: Date;
|
|
190
|
+
readonly venue: string;
|
|
191
|
+
readonly homeTeam: string;
|
|
192
|
+
readonly awayTeam: string;
|
|
193
|
+
readonly status: MatchStatus;
|
|
194
|
+
readonly competition: CompetitionCode;
|
|
195
|
+
}
|
|
196
|
+
/** A single player's position in a match lineup. */
|
|
197
|
+
interface LineupPlayer {
|
|
198
|
+
readonly playerId: string;
|
|
199
|
+
readonly givenName: string;
|
|
200
|
+
readonly surname: string;
|
|
201
|
+
readonly displayName: string;
|
|
202
|
+
readonly jumperNumber: number | null;
|
|
203
|
+
readonly position: string | null;
|
|
204
|
+
readonly isEmergency: boolean;
|
|
205
|
+
readonly isSubstitute: boolean;
|
|
206
|
+
}
|
|
207
|
+
/** Full lineup for a match (both teams). */
|
|
208
|
+
interface Lineup {
|
|
209
|
+
readonly matchId: string;
|
|
210
|
+
readonly season: number;
|
|
211
|
+
readonly roundNumber: number;
|
|
212
|
+
readonly homeTeam: string;
|
|
213
|
+
readonly awayTeam: string;
|
|
214
|
+
readonly homePlayers: readonly LineupPlayer[];
|
|
215
|
+
readonly awayPlayers: readonly LineupPlayer[];
|
|
216
|
+
readonly competition: CompetitionCode;
|
|
217
|
+
}
|
|
218
|
+
/** A single team's standing in the ladder. */
|
|
219
|
+
interface LadderEntry {
|
|
220
|
+
readonly position: number;
|
|
221
|
+
readonly team: string;
|
|
222
|
+
readonly played: number;
|
|
223
|
+
readonly wins: number;
|
|
224
|
+
readonly losses: number;
|
|
225
|
+
readonly draws: number;
|
|
226
|
+
readonly pointsFor: number;
|
|
227
|
+
readonly pointsAgainst: number;
|
|
228
|
+
readonly percentage: number;
|
|
229
|
+
readonly premiershipsPoints: number;
|
|
230
|
+
readonly form: string | null;
|
|
231
|
+
}
|
|
232
|
+
/** Season ladder snapshot (optionally for a specific round). */
|
|
233
|
+
interface Ladder {
|
|
234
|
+
readonly season: number;
|
|
235
|
+
readonly roundNumber: number | null;
|
|
236
|
+
readonly entries: readonly LadderEntry[];
|
|
237
|
+
readonly competition: CompetitionCode;
|
|
238
|
+
}
|
|
239
|
+
/** An AFL team. */
|
|
240
|
+
interface Team {
|
|
241
|
+
readonly teamId: string;
|
|
242
|
+
readonly name: string;
|
|
243
|
+
readonly abbreviation: string;
|
|
244
|
+
readonly competition: CompetitionCode;
|
|
245
|
+
}
|
|
246
|
+
/** A player within a team squad for a season. */
|
|
247
|
+
interface SquadPlayer {
|
|
248
|
+
readonly playerId: string;
|
|
249
|
+
readonly givenName: string;
|
|
250
|
+
readonly surname: string;
|
|
251
|
+
readonly displayName: string;
|
|
252
|
+
readonly jumperNumber: number | null;
|
|
253
|
+
readonly position: string | null;
|
|
254
|
+
readonly dateOfBirth: Date | null;
|
|
255
|
+
readonly heightCm: number | null;
|
|
256
|
+
readonly weightKg: number | null;
|
|
257
|
+
readonly draftYear: number | null;
|
|
258
|
+
readonly draftPosition: number | null;
|
|
259
|
+
readonly draftType: string | null;
|
|
260
|
+
readonly debutYear: number | null;
|
|
261
|
+
readonly recruitedFrom: string | null;
|
|
262
|
+
}
|
|
263
|
+
/** A team's squad for a given season. */
|
|
264
|
+
interface Squad {
|
|
265
|
+
readonly teamId: string;
|
|
266
|
+
readonly teamName: string;
|
|
267
|
+
readonly season: number;
|
|
268
|
+
readonly players: readonly SquadPlayer[];
|
|
269
|
+
readonly competition: CompetitionCode;
|
|
270
|
+
}
|
|
271
|
+
/** Query for data by season and optional round. */
|
|
272
|
+
interface SeasonRoundQuery {
|
|
273
|
+
readonly source: DataSource;
|
|
274
|
+
readonly season: number;
|
|
275
|
+
readonly round?: number | undefined;
|
|
276
|
+
readonly competition?: CompetitionCode | undefined;
|
|
277
|
+
}
|
|
278
|
+
/** Query for a specific match. */
|
|
279
|
+
interface MatchQuery {
|
|
280
|
+
readonly source: DataSource;
|
|
281
|
+
readonly matchId: string;
|
|
282
|
+
}
|
|
283
|
+
/** Query for player stats (by season/round or specific match). */
|
|
284
|
+
interface PlayerStatsQuery {
|
|
285
|
+
readonly source: DataSource;
|
|
286
|
+
readonly season: number;
|
|
287
|
+
readonly round?: number | undefined;
|
|
288
|
+
readonly matchId?: string | undefined;
|
|
289
|
+
readonly competition?: CompetitionCode | undefined;
|
|
290
|
+
}
|
|
291
|
+
/** Query for lineup data. */
|
|
292
|
+
interface LineupQuery {
|
|
293
|
+
readonly source: DataSource;
|
|
294
|
+
readonly season: number;
|
|
295
|
+
readonly round: number;
|
|
296
|
+
readonly matchId?: string | undefined;
|
|
297
|
+
readonly competition?: CompetitionCode | undefined;
|
|
298
|
+
}
|
|
299
|
+
/** Query for ladder standings. */
|
|
300
|
+
interface LadderQuery {
|
|
301
|
+
readonly source: DataSource;
|
|
302
|
+
readonly season: number;
|
|
303
|
+
readonly round?: number | undefined;
|
|
304
|
+
readonly competition?: CompetitionCode | undefined;
|
|
305
|
+
}
|
|
306
|
+
/** Query for team lists. */
|
|
307
|
+
interface TeamQuery {
|
|
308
|
+
readonly competition?: CompetitionCode | undefined;
|
|
309
|
+
readonly teamType?: string | undefined;
|
|
310
|
+
}
|
|
311
|
+
/** Query for a team's squad. */
|
|
312
|
+
interface SquadQuery {
|
|
313
|
+
readonly teamId: string;
|
|
314
|
+
readonly season: number;
|
|
315
|
+
readonly competition?: CompetitionCode | undefined;
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Fetch fixture (schedule) data for a season.
|
|
319
|
+
*
|
|
320
|
+
* @param query - Source, season, optional round, and competition.
|
|
321
|
+
* @returns Array of fixture entries.
|
|
322
|
+
*/
|
|
323
|
+
declare function fetchFixture(query: SeasonRoundQuery): Promise<Result<Fixture[], Error>>;
|
|
324
|
+
/**
|
|
325
|
+
* Fetch ladder standings for a season (optionally for a specific round).
|
|
326
|
+
*
|
|
327
|
+
* @param query - Source, season, optional round, and competition.
|
|
328
|
+
* @returns Ladder standings.
|
|
329
|
+
*
|
|
330
|
+
* @example
|
|
331
|
+
* ```ts
|
|
332
|
+
* const result = await fetchLadder({ source: "afl-api", season: 2024, round: 10 });
|
|
333
|
+
* ```
|
|
334
|
+
*/
|
|
335
|
+
declare function fetchLadder2(query: LadderQuery): Promise<Result<Ladder, Error>>;
|
|
336
|
+
/**
|
|
337
|
+
* Fetch match lineup data for a round or specific match.
|
|
338
|
+
*
|
|
339
|
+
* When `matchId` is provided, returns a single-element array for that match.
|
|
340
|
+
* When omitted, returns lineups for all matches in the round.
|
|
341
|
+
*
|
|
342
|
+
* @param query - Source, season, round, optional matchId, and competition.
|
|
343
|
+
* @returns Array of lineups.
|
|
344
|
+
*/
|
|
345
|
+
declare function fetchLineup(query: LineupQuery): Promise<Result<Lineup[], Error>>;
|
|
346
|
+
/**
|
|
347
|
+
* Fetch match results for a season (and optionally a specific round).
|
|
348
|
+
*
|
|
349
|
+
* @param query - Source, season, optional round, and competition.
|
|
350
|
+
* @returns Array of match results.
|
|
351
|
+
*
|
|
352
|
+
* @example
|
|
353
|
+
* ```ts
|
|
354
|
+
* const result = await fetchMatchResults({ source: "afl-api", season: 2025, competition: "AFLM" });
|
|
355
|
+
* ```
|
|
356
|
+
*/
|
|
357
|
+
declare function fetchMatchResults(query: SeasonRoundQuery): Promise<Result<MatchResult[], Error>>;
|
|
358
|
+
/**
|
|
359
|
+
* Fetch per-player match statistics.
|
|
360
|
+
*
|
|
361
|
+
* @param query - Source, season, optional round/matchId, and competition.
|
|
362
|
+
* @returns Array of player stats.
|
|
363
|
+
*
|
|
364
|
+
* @example
|
|
365
|
+
* ```ts
|
|
366
|
+
* const result = await fetchPlayerStats({
|
|
367
|
+
* source: "afl-api", season: 2025, round: 1, competition: "AFLM"
|
|
368
|
+
* });
|
|
369
|
+
* ```
|
|
370
|
+
*/
|
|
371
|
+
declare function fetchPlayerStats2(query: PlayerStatsQuery): Promise<Result<PlayerStats[], Error>>;
|
|
372
|
+
/**
|
|
373
|
+
* Fetch team lists.
|
|
374
|
+
*
|
|
375
|
+
* @param query - Optional competition and team type filters.
|
|
376
|
+
* @returns Array of teams.
|
|
377
|
+
*/
|
|
378
|
+
declare function fetchTeams2(query?: TeamQuery): Promise<Result<Team[], Error>>;
|
|
379
|
+
/**
|
|
380
|
+
* Fetch a team's squad roster for a season.
|
|
381
|
+
*
|
|
382
|
+
* @param query - Team ID, season, and optional competition.
|
|
383
|
+
* @returns Squad with player list.
|
|
384
|
+
*/
|
|
385
|
+
declare function fetchSquad2(query: SquadQuery): Promise<Result<Squad, Error>>;
|
|
386
|
+
/**
|
|
387
|
+
* AEST/AEDT-aware date parsing and formatting utilities.
|
|
388
|
+
*
|
|
389
|
+
* All functions use only Web Standard APIs (Date, Intl.DateTimeFormat).
|
|
390
|
+
* No Node.js built-ins or third-party date libraries.
|
|
391
|
+
*
|
|
392
|
+
* @module
|
|
393
|
+
*/
|
|
394
|
+
/**
|
|
395
|
+
* Parse a UTC ISO 8601 string from the AFL API into a Date.
|
|
396
|
+
*
|
|
397
|
+
* The AFL API returns dates like `"2024-03-14T06:20:00.000Z"` or
|
|
398
|
+
* `"2024-03-14T06:20:00Z"`.
|
|
399
|
+
*
|
|
400
|
+
* @param iso - A UTC ISO 8601 date string
|
|
401
|
+
* @returns A Date object, or null if parsing fails
|
|
402
|
+
*
|
|
403
|
+
* @example
|
|
404
|
+
* ```ts
|
|
405
|
+
* parseAflApiDate("2024-03-14T06:20:00.000Z")
|
|
406
|
+
* // => Date(2024-03-14T06:20:00.000Z)
|
|
407
|
+
* ```
|
|
408
|
+
*/
|
|
409
|
+
declare function parseAflApiDate(iso: string): Date | null;
|
|
410
|
+
/**
|
|
411
|
+
* Parse a date string from FootyWire into a Date.
|
|
412
|
+
*
|
|
413
|
+
* FootyWire uses formats like:
|
|
414
|
+
* - `"Sat 16 Mar 2024"` (day-of-week, day, month-abbrev, year)
|
|
415
|
+
* - `"16 Mar 2024"` (day, month-abbrev, year)
|
|
416
|
+
* - `"16-Mar-2024"` (day-month-year with hyphens)
|
|
417
|
+
*
|
|
418
|
+
* @param dateStr - A FootyWire date string
|
|
419
|
+
* @returns A Date object (midnight UTC), or null if parsing fails
|
|
420
|
+
*
|
|
421
|
+
* @example
|
|
422
|
+
* ```ts
|
|
423
|
+
* parseFootyWireDate("Sat 16 Mar 2024")
|
|
424
|
+
* // => Date(2024-03-16T00:00:00.000Z)
|
|
425
|
+
* ```
|
|
426
|
+
*/
|
|
427
|
+
declare function parseFootyWireDate(dateStr: string): Date | null;
|
|
428
|
+
/**
|
|
429
|
+
* Parse a date string from AFL Tables into a Date.
|
|
430
|
+
*
|
|
431
|
+
* AFL Tables uses formats like:
|
|
432
|
+
* - `"16-Mar-2024"` (DD-Mon-YYYY)
|
|
433
|
+
* - `"Sat 16-Mar-2024"` (Dow DD-Mon-YYYY)
|
|
434
|
+
* - `"16 Mar 2024"` (DD Mon YYYY)
|
|
435
|
+
*
|
|
436
|
+
* For very old historical matches, dates may be partial (e.g. just a year),
|
|
437
|
+
* which are not supported and return null.
|
|
438
|
+
*
|
|
439
|
+
* @param dateStr - An AFL Tables date string
|
|
440
|
+
* @returns A Date object (midnight UTC), or null if parsing fails
|
|
441
|
+
*
|
|
442
|
+
* @example
|
|
443
|
+
* ```ts
|
|
444
|
+
* parseAflTablesDate("16-Mar-2024")
|
|
445
|
+
* // => Date(2024-03-16T00:00:00.000Z)
|
|
446
|
+
* ```
|
|
447
|
+
*/
|
|
448
|
+
declare function parseAflTablesDate(dateStr: string): Date | null;
|
|
449
|
+
/**
|
|
450
|
+
* Format a Date as an AEST/AEDT-aware display string.
|
|
451
|
+
*
|
|
452
|
+
* Uses `Intl.DateTimeFormat` with the `"Australia/Melbourne"` timezone,
|
|
453
|
+
* which automatically handles AEST (UTC+10) and AEDT (UTC+11) transitions.
|
|
454
|
+
*
|
|
455
|
+
* @param date - The Date to format
|
|
456
|
+
* @returns A formatted string like `"Thu 14 Mar 2024 5:20 PM AEDT"`
|
|
457
|
+
*
|
|
458
|
+
* @example
|
|
459
|
+
* ```ts
|
|
460
|
+
* toAestString(new Date("2024-03-14T06:20:00.000Z"))
|
|
461
|
+
* // => "Thu 14 Mar 2024 5:20 PM AEDT"
|
|
462
|
+
* ```
|
|
463
|
+
*/
|
|
464
|
+
declare function toAestString(date: Date): string;
|
|
465
|
+
/**
|
|
466
|
+
* Custom error classes for fitzRoy-ts.
|
|
467
|
+
*
|
|
468
|
+
* Each error class represents a distinct failure domain:
|
|
469
|
+
* - {@link AflApiError} — failures when communicating with the AFL API
|
|
470
|
+
* - {@link ScrapeError} — failures when scraping HTML sources (FootyWire, AFL Tables)
|
|
471
|
+
* - {@link ValidationError} — failures when validating data against Zod schemas
|
|
472
|
+
* - {@link UnsupportedSourceError} — when a data source doesn't support the requested operation
|
|
473
|
+
*/
|
|
474
|
+
/** Error from the AFL official API (auth failures, bad responses, timeouts). */
|
|
475
|
+
declare class AflApiError extends Error {
|
|
476
|
+
readonly statusCode?: number | undefined;
|
|
477
|
+
readonly name = "AflApiError";
|
|
478
|
+
constructor(message: string, statusCode?: number | undefined);
|
|
479
|
+
}
|
|
480
|
+
/** Error when scraping HTML data sources. */
|
|
481
|
+
declare class ScrapeError extends Error {
|
|
482
|
+
readonly source?: string | undefined;
|
|
483
|
+
readonly name = "ScrapeError";
|
|
484
|
+
constructor(message: string, source?: string | undefined);
|
|
485
|
+
}
|
|
486
|
+
/** Error when a data source does not support the requested operation. */
|
|
487
|
+
declare class UnsupportedSourceError extends Error {
|
|
488
|
+
readonly source?: string | undefined;
|
|
489
|
+
readonly name = "UnsupportedSourceError";
|
|
490
|
+
constructor(message: string, source?: string | undefined);
|
|
491
|
+
}
|
|
492
|
+
/** Error when data fails Zod schema validation. */
|
|
493
|
+
declare class ValidationError extends Error {
|
|
494
|
+
readonly issues?: ReadonlyArray<{
|
|
495
|
+
path: string;
|
|
496
|
+
message: string;
|
|
497
|
+
}> | undefined;
|
|
498
|
+
readonly name = "ValidationError";
|
|
499
|
+
constructor(message: string, issues?: ReadonlyArray<{
|
|
500
|
+
path: string;
|
|
501
|
+
message: string;
|
|
502
|
+
}> | undefined);
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Team name normalisation across AFL data sources.
|
|
506
|
+
*
|
|
507
|
+
* Maps abbreviations, short names, and historical names to the canonical
|
|
508
|
+
* AFL API team names. Lookups are case-insensitive.
|
|
509
|
+
*
|
|
510
|
+
* @example
|
|
511
|
+
* ```ts
|
|
512
|
+
* normaliseTeamName("GWS"); // "GWS Giants"
|
|
513
|
+
* normaliseTeamName("footscray"); // "Western Bulldogs"
|
|
514
|
+
* normaliseTeamName("KANGAROOS"); // "North Melbourne"
|
|
515
|
+
* normaliseTeamName("Sydney"); // "Sydney Swans"
|
|
516
|
+
* ```
|
|
517
|
+
*/
|
|
518
|
+
/**
|
|
519
|
+
* Normalise a team name to its canonical form.
|
|
520
|
+
*
|
|
521
|
+
* Performs a case-insensitive lookup against all known team names,
|
|
522
|
+
* abbreviations, and historical names. Returns the input unchanged
|
|
523
|
+
* if no mapping is found.
|
|
524
|
+
*
|
|
525
|
+
* @param raw - The raw team name string from any data source.
|
|
526
|
+
* @returns The canonical team name, or the trimmed input if unknown.
|
|
527
|
+
*/
|
|
528
|
+
declare function normaliseTeamName(raw: string): string;
|
|
529
|
+
import { z } from "zod/v4";
|
|
530
|
+
/** Schema for the AFL API WMCTok token response. */
|
|
531
|
+
declare const AflApiTokenSchema: z.ZodObject<{
|
|
532
|
+
token: z.ZodString;
|
|
533
|
+
disclaimer: z.ZodOptional<z.ZodString>;
|
|
534
|
+
}, z.core.$loose>;
|
|
535
|
+
/** Inferred type for the AFL API token response. */
|
|
536
|
+
type AflApiToken = z.infer<typeof AflApiTokenSchema>;
|
|
537
|
+
/** Schema for a single competition entry. */
|
|
538
|
+
declare const CompetitionSchema: z.ZodObject<{
|
|
539
|
+
id: z.ZodNumber;
|
|
540
|
+
name: z.ZodString;
|
|
541
|
+
code: z.ZodOptional<z.ZodString>;
|
|
542
|
+
}, z.core.$loose>;
|
|
543
|
+
/** Schema for the competition list response. */
|
|
544
|
+
declare const CompetitionListSchema: z.ZodObject<{
|
|
545
|
+
competitions: z.ZodArray<z.ZodObject<{
|
|
546
|
+
id: z.ZodNumber;
|
|
547
|
+
name: z.ZodString;
|
|
548
|
+
code: z.ZodOptional<z.ZodString>;
|
|
549
|
+
}, z.core.$loose>>;
|
|
550
|
+
}, z.core.$loose>;
|
|
551
|
+
/** Inferred type for a single competition. */
|
|
552
|
+
type Competition = z.infer<typeof CompetitionSchema>;
|
|
553
|
+
/** Inferred type for the competition list response. */
|
|
554
|
+
type CompetitionList = z.infer<typeof CompetitionListSchema>;
|
|
555
|
+
/** Schema for a single compseason (competition-season) entry. */
|
|
556
|
+
declare const CompseasonSchema: z.ZodObject<{
|
|
557
|
+
id: z.ZodNumber;
|
|
558
|
+
name: z.ZodString;
|
|
559
|
+
shortName: z.ZodOptional<z.ZodString>;
|
|
560
|
+
currentRoundNumber: z.ZodOptional<z.ZodNumber>;
|
|
561
|
+
}, z.core.$loose>;
|
|
562
|
+
/** Schema for the compseason list response. */
|
|
563
|
+
declare const CompseasonListSchema: z.ZodObject<{
|
|
564
|
+
compSeasons: z.ZodArray<z.ZodObject<{
|
|
565
|
+
id: z.ZodNumber;
|
|
566
|
+
name: z.ZodString;
|
|
567
|
+
shortName: z.ZodOptional<z.ZodString>;
|
|
568
|
+
currentRoundNumber: z.ZodOptional<z.ZodNumber>;
|
|
569
|
+
}, z.core.$loose>>;
|
|
570
|
+
}, z.core.$loose>;
|
|
571
|
+
/** Inferred type for a single compseason. */
|
|
572
|
+
type Compseason = z.infer<typeof CompseasonSchema>;
|
|
573
|
+
/** Inferred type for the compseason list response. */
|
|
574
|
+
type CompseasonList = z.infer<typeof CompseasonListSchema>;
|
|
575
|
+
/** Schema for a single round entry. */
|
|
576
|
+
declare const RoundSchema: z.ZodObject<{
|
|
577
|
+
id: z.ZodNumber;
|
|
578
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
579
|
+
name: z.ZodString;
|
|
580
|
+
abbreviation: z.ZodOptional<z.ZodString>;
|
|
581
|
+
roundNumber: z.ZodNumber;
|
|
582
|
+
utcStartTime: z.ZodOptional<z.ZodString>;
|
|
583
|
+
utcEndTime: z.ZodOptional<z.ZodString>;
|
|
584
|
+
}, z.core.$loose>;
|
|
585
|
+
/** Schema for the round list response. */
|
|
586
|
+
declare const RoundListSchema: z.ZodObject<{
|
|
587
|
+
rounds: z.ZodArray<z.ZodObject<{
|
|
588
|
+
id: z.ZodNumber;
|
|
589
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
590
|
+
name: z.ZodString;
|
|
591
|
+
abbreviation: z.ZodOptional<z.ZodString>;
|
|
592
|
+
roundNumber: z.ZodNumber;
|
|
593
|
+
utcStartTime: z.ZodOptional<z.ZodString>;
|
|
594
|
+
utcEndTime: z.ZodOptional<z.ZodString>;
|
|
595
|
+
}, z.core.$loose>>;
|
|
596
|
+
}, z.core.$loose>;
|
|
597
|
+
/** Inferred type for a single round. */
|
|
598
|
+
type Round = z.infer<typeof RoundSchema>;
|
|
599
|
+
/** Inferred type for the round list response. */
|
|
600
|
+
type RoundList = z.infer<typeof RoundListSchema>;
|
|
601
|
+
/** Schema for a goals/behinds/total score object (used in match and period scores). */
|
|
602
|
+
declare const ScoreSchema: z.ZodObject<{
|
|
603
|
+
totalScore: z.ZodNumber;
|
|
604
|
+
goals: z.ZodNumber;
|
|
605
|
+
behinds: z.ZodNumber;
|
|
606
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
607
|
+
}, z.core.$loose>;
|
|
608
|
+
/** Schema for a period (quarter) score entry within a match. */
|
|
609
|
+
declare const PeriodScoreSchema: z.ZodObject<{
|
|
610
|
+
periodNumber: z.ZodNumber;
|
|
611
|
+
score: z.ZodObject<{
|
|
612
|
+
totalScore: z.ZodNumber;
|
|
613
|
+
goals: z.ZodNumber;
|
|
614
|
+
behinds: z.ZodNumber;
|
|
615
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
616
|
+
}, z.core.$loose>;
|
|
617
|
+
}, z.core.$loose>;
|
|
618
|
+
/** Schema for a team's total score (match + period breakdown). */
|
|
619
|
+
declare const TeamScoreSchema: z.ZodObject<{
|
|
620
|
+
matchScore: z.ZodObject<{
|
|
621
|
+
totalScore: z.ZodNumber;
|
|
622
|
+
goals: z.ZodNumber;
|
|
623
|
+
behinds: z.ZodNumber;
|
|
624
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
625
|
+
}, z.core.$loose>;
|
|
626
|
+
periodScore: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
627
|
+
periodNumber: z.ZodNumber;
|
|
628
|
+
score: z.ZodObject<{
|
|
629
|
+
totalScore: z.ZodNumber;
|
|
630
|
+
goals: z.ZodNumber;
|
|
631
|
+
behinds: z.ZodNumber;
|
|
632
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
633
|
+
}, z.core.$loose>;
|
|
634
|
+
}, z.core.$loose>>>;
|
|
635
|
+
rushedBehinds: z.ZodOptional<z.ZodNumber>;
|
|
636
|
+
minutesInFront: z.ZodOptional<z.ZodNumber>;
|
|
637
|
+
}, z.core.$loose>;
|
|
638
|
+
/** Inferred type for a score object. */
|
|
639
|
+
type Score = z.infer<typeof ScoreSchema>;
|
|
640
|
+
/** Inferred type for a period score. */
|
|
641
|
+
type PeriodScore = z.infer<typeof PeriodScoreSchema>;
|
|
642
|
+
/** Inferred type for a team score. */
|
|
643
|
+
type TeamScore = z.infer<typeof TeamScoreSchema>;
|
|
644
|
+
/** Schema for a team entry within a /cfs/ match object. */
|
|
645
|
+
declare const CfsMatchTeamSchema: z.ZodObject<{
|
|
646
|
+
name: z.ZodString;
|
|
647
|
+
teamId: z.ZodString;
|
|
648
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
649
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
650
|
+
}, z.core.$loose>;
|
|
651
|
+
/** Inferred type for a /cfs/ match team. */
|
|
652
|
+
type CfsMatchTeam = z.infer<typeof CfsMatchTeamSchema>;
|
|
653
|
+
/** Schema for the inner match object within a /cfs/ match item. */
|
|
654
|
+
declare const CfsMatchSchema: z.ZodObject<{
|
|
655
|
+
matchId: z.ZodString;
|
|
656
|
+
name: z.ZodOptional<z.ZodString>;
|
|
657
|
+
status: z.ZodString;
|
|
658
|
+
utcStartTime: z.ZodString;
|
|
659
|
+
homeTeamId: z.ZodString;
|
|
660
|
+
awayTeamId: z.ZodString;
|
|
661
|
+
homeTeam: z.ZodObject<{
|
|
662
|
+
name: z.ZodString;
|
|
663
|
+
teamId: z.ZodString;
|
|
664
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
665
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
666
|
+
}, z.core.$loose>;
|
|
667
|
+
awayTeam: z.ZodObject<{
|
|
668
|
+
name: z.ZodString;
|
|
669
|
+
teamId: z.ZodString;
|
|
670
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
671
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
672
|
+
}, z.core.$loose>;
|
|
673
|
+
round: z.ZodOptional<z.ZodString>;
|
|
674
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
675
|
+
}, z.core.$loose>;
|
|
676
|
+
/** Inferred type for a /cfs/ match. */
|
|
677
|
+
type CfsMatch = z.infer<typeof CfsMatchSchema>;
|
|
678
|
+
/** Schema for the score wrapper within a /cfs/ match item. */
|
|
679
|
+
declare const CfsScoreSchema: z.ZodObject<{
|
|
680
|
+
status: z.ZodString;
|
|
681
|
+
matchId: z.ZodString;
|
|
682
|
+
homeTeamScore: z.ZodObject<{
|
|
683
|
+
matchScore: z.ZodObject<{
|
|
684
|
+
totalScore: z.ZodNumber;
|
|
685
|
+
goals: z.ZodNumber;
|
|
686
|
+
behinds: z.ZodNumber;
|
|
687
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
688
|
+
}, z.core.$loose>;
|
|
689
|
+
periodScore: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
690
|
+
periodNumber: z.ZodNumber;
|
|
691
|
+
score: z.ZodObject<{
|
|
692
|
+
totalScore: z.ZodNumber;
|
|
693
|
+
goals: z.ZodNumber;
|
|
694
|
+
behinds: z.ZodNumber;
|
|
695
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
696
|
+
}, z.core.$loose>;
|
|
697
|
+
}, z.core.$loose>>>;
|
|
698
|
+
rushedBehinds: z.ZodOptional<z.ZodNumber>;
|
|
699
|
+
minutesInFront: z.ZodOptional<z.ZodNumber>;
|
|
700
|
+
}, z.core.$loose>;
|
|
701
|
+
awayTeamScore: z.ZodObject<{
|
|
702
|
+
matchScore: z.ZodObject<{
|
|
703
|
+
totalScore: z.ZodNumber;
|
|
704
|
+
goals: z.ZodNumber;
|
|
705
|
+
behinds: z.ZodNumber;
|
|
706
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
707
|
+
}, z.core.$loose>;
|
|
708
|
+
periodScore: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
709
|
+
periodNumber: z.ZodNumber;
|
|
710
|
+
score: z.ZodObject<{
|
|
711
|
+
totalScore: z.ZodNumber;
|
|
712
|
+
goals: z.ZodNumber;
|
|
713
|
+
behinds: z.ZodNumber;
|
|
714
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
715
|
+
}, z.core.$loose>;
|
|
716
|
+
}, z.core.$loose>>>;
|
|
717
|
+
rushedBehinds: z.ZodOptional<z.ZodNumber>;
|
|
718
|
+
minutesInFront: z.ZodOptional<z.ZodNumber>;
|
|
719
|
+
}, z.core.$loose>;
|
|
720
|
+
}, z.core.$loose>;
|
|
721
|
+
/** Inferred type for a /cfs/ score wrapper. */
|
|
722
|
+
type CfsScore = z.infer<typeof CfsScoreSchema>;
|
|
723
|
+
/** Schema for venue info in /cfs/ responses. */
|
|
724
|
+
declare const CfsVenueSchema: z.ZodObject<{
|
|
725
|
+
name: z.ZodString;
|
|
726
|
+
venueId: z.ZodOptional<z.ZodString>;
|
|
727
|
+
state: z.ZodOptional<z.ZodString>;
|
|
728
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
729
|
+
}, z.core.$loose>;
|
|
730
|
+
/** Inferred type for a /cfs/ venue. */
|
|
731
|
+
type CfsVenue = z.infer<typeof CfsVenueSchema>;
|
|
732
|
+
/** Schema for a single match item in round results. */
|
|
733
|
+
declare const MatchItemSchema: z.ZodObject<{
|
|
734
|
+
match: z.ZodObject<{
|
|
735
|
+
matchId: z.ZodString;
|
|
736
|
+
name: z.ZodOptional<z.ZodString>;
|
|
737
|
+
status: z.ZodString;
|
|
738
|
+
utcStartTime: z.ZodString;
|
|
739
|
+
homeTeamId: z.ZodString;
|
|
740
|
+
awayTeamId: z.ZodString;
|
|
741
|
+
homeTeam: z.ZodObject<{
|
|
742
|
+
name: z.ZodString;
|
|
743
|
+
teamId: z.ZodString;
|
|
744
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
745
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
746
|
+
}, z.core.$loose>;
|
|
747
|
+
awayTeam: z.ZodObject<{
|
|
748
|
+
name: z.ZodString;
|
|
749
|
+
teamId: z.ZodString;
|
|
750
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
751
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
752
|
+
}, z.core.$loose>;
|
|
753
|
+
round: z.ZodOptional<z.ZodString>;
|
|
754
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
755
|
+
}, z.core.$loose>;
|
|
756
|
+
score: z.ZodOptional<z.ZodObject<{
|
|
757
|
+
status: z.ZodString;
|
|
758
|
+
matchId: z.ZodString;
|
|
759
|
+
homeTeamScore: z.ZodObject<{
|
|
760
|
+
matchScore: z.ZodObject<{
|
|
761
|
+
totalScore: z.ZodNumber;
|
|
762
|
+
goals: z.ZodNumber;
|
|
763
|
+
behinds: z.ZodNumber;
|
|
764
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
765
|
+
}, z.core.$loose>;
|
|
766
|
+
periodScore: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
767
|
+
periodNumber: z.ZodNumber;
|
|
768
|
+
score: z.ZodObject<{
|
|
769
|
+
totalScore: z.ZodNumber;
|
|
770
|
+
goals: z.ZodNumber;
|
|
771
|
+
behinds: z.ZodNumber;
|
|
772
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
773
|
+
}, z.core.$loose>;
|
|
774
|
+
}, z.core.$loose>>>;
|
|
775
|
+
rushedBehinds: z.ZodOptional<z.ZodNumber>;
|
|
776
|
+
minutesInFront: z.ZodOptional<z.ZodNumber>;
|
|
777
|
+
}, z.core.$loose>;
|
|
778
|
+
awayTeamScore: z.ZodObject<{
|
|
779
|
+
matchScore: z.ZodObject<{
|
|
780
|
+
totalScore: z.ZodNumber;
|
|
781
|
+
goals: z.ZodNumber;
|
|
782
|
+
behinds: z.ZodNumber;
|
|
783
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
784
|
+
}, z.core.$loose>;
|
|
785
|
+
periodScore: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
786
|
+
periodNumber: z.ZodNumber;
|
|
787
|
+
score: z.ZodObject<{
|
|
788
|
+
totalScore: z.ZodNumber;
|
|
789
|
+
goals: z.ZodNumber;
|
|
790
|
+
behinds: z.ZodNumber;
|
|
791
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
792
|
+
}, z.core.$loose>;
|
|
793
|
+
}, z.core.$loose>>>;
|
|
794
|
+
rushedBehinds: z.ZodOptional<z.ZodNumber>;
|
|
795
|
+
minutesInFront: z.ZodOptional<z.ZodNumber>;
|
|
796
|
+
}, z.core.$loose>;
|
|
797
|
+
}, z.core.$loose>>;
|
|
798
|
+
venue: z.ZodOptional<z.ZodObject<{
|
|
799
|
+
name: z.ZodString;
|
|
800
|
+
venueId: z.ZodOptional<z.ZodString>;
|
|
801
|
+
state: z.ZodOptional<z.ZodString>;
|
|
802
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
803
|
+
}, z.core.$loose>>;
|
|
804
|
+
round: z.ZodOptional<z.ZodObject<{
|
|
805
|
+
name: z.ZodString;
|
|
806
|
+
roundId: z.ZodString;
|
|
807
|
+
roundNumber: z.ZodNumber;
|
|
808
|
+
}, z.core.$loose>>;
|
|
809
|
+
}, z.core.$loose>;
|
|
810
|
+
/** Schema for the match items (round results) response. */
|
|
811
|
+
declare const MatchItemListSchema: z.ZodObject<{
|
|
812
|
+
roundId: z.ZodOptional<z.ZodString>;
|
|
813
|
+
items: z.ZodArray<z.ZodObject<{
|
|
814
|
+
match: z.ZodObject<{
|
|
815
|
+
matchId: z.ZodString;
|
|
816
|
+
name: z.ZodOptional<z.ZodString>;
|
|
817
|
+
status: z.ZodString;
|
|
818
|
+
utcStartTime: z.ZodString;
|
|
819
|
+
homeTeamId: z.ZodString;
|
|
820
|
+
awayTeamId: z.ZodString;
|
|
821
|
+
homeTeam: z.ZodObject<{
|
|
822
|
+
name: z.ZodString;
|
|
823
|
+
teamId: z.ZodString;
|
|
824
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
825
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
826
|
+
}, z.core.$loose>;
|
|
827
|
+
awayTeam: z.ZodObject<{
|
|
828
|
+
name: z.ZodString;
|
|
829
|
+
teamId: z.ZodString;
|
|
830
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
831
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
832
|
+
}, z.core.$loose>;
|
|
833
|
+
round: z.ZodOptional<z.ZodString>;
|
|
834
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
835
|
+
}, z.core.$loose>;
|
|
836
|
+
score: z.ZodOptional<z.ZodObject<{
|
|
837
|
+
status: z.ZodString;
|
|
838
|
+
matchId: z.ZodString;
|
|
839
|
+
homeTeamScore: z.ZodObject<{
|
|
840
|
+
matchScore: z.ZodObject<{
|
|
841
|
+
totalScore: z.ZodNumber;
|
|
842
|
+
goals: z.ZodNumber;
|
|
843
|
+
behinds: z.ZodNumber;
|
|
844
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
845
|
+
}, z.core.$loose>;
|
|
846
|
+
periodScore: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
847
|
+
periodNumber: z.ZodNumber;
|
|
848
|
+
score: z.ZodObject<{
|
|
849
|
+
totalScore: z.ZodNumber;
|
|
850
|
+
goals: z.ZodNumber;
|
|
851
|
+
behinds: z.ZodNumber;
|
|
852
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
853
|
+
}, z.core.$loose>;
|
|
854
|
+
}, z.core.$loose>>>;
|
|
855
|
+
rushedBehinds: z.ZodOptional<z.ZodNumber>;
|
|
856
|
+
minutesInFront: z.ZodOptional<z.ZodNumber>;
|
|
857
|
+
}, z.core.$loose>;
|
|
858
|
+
awayTeamScore: z.ZodObject<{
|
|
859
|
+
matchScore: z.ZodObject<{
|
|
860
|
+
totalScore: z.ZodNumber;
|
|
861
|
+
goals: z.ZodNumber;
|
|
862
|
+
behinds: z.ZodNumber;
|
|
863
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
864
|
+
}, z.core.$loose>;
|
|
865
|
+
periodScore: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
866
|
+
periodNumber: z.ZodNumber;
|
|
867
|
+
score: z.ZodObject<{
|
|
868
|
+
totalScore: z.ZodNumber;
|
|
869
|
+
goals: z.ZodNumber;
|
|
870
|
+
behinds: z.ZodNumber;
|
|
871
|
+
superGoals: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
872
|
+
}, z.core.$loose>;
|
|
873
|
+
}, z.core.$loose>>>;
|
|
874
|
+
rushedBehinds: z.ZodOptional<z.ZodNumber>;
|
|
875
|
+
minutesInFront: z.ZodOptional<z.ZodNumber>;
|
|
876
|
+
}, z.core.$loose>;
|
|
877
|
+
}, z.core.$loose>>;
|
|
878
|
+
venue: z.ZodOptional<z.ZodObject<{
|
|
879
|
+
name: z.ZodString;
|
|
880
|
+
venueId: z.ZodOptional<z.ZodString>;
|
|
881
|
+
state: z.ZodOptional<z.ZodString>;
|
|
882
|
+
timeZone: z.ZodOptional<z.ZodString>;
|
|
883
|
+
}, z.core.$loose>>;
|
|
884
|
+
round: z.ZodOptional<z.ZodObject<{
|
|
885
|
+
name: z.ZodString;
|
|
886
|
+
roundId: z.ZodString;
|
|
887
|
+
roundNumber: z.ZodNumber;
|
|
888
|
+
}, z.core.$loose>>;
|
|
889
|
+
}, z.core.$loose>>;
|
|
890
|
+
}, z.core.$loose>;
|
|
891
|
+
/** Inferred type for a single match item. */
|
|
892
|
+
type MatchItem = z.infer<typeof MatchItemSchema>;
|
|
893
|
+
/** Inferred type for the match items list response. */
|
|
894
|
+
type MatchItemList = z.infer<typeof MatchItemListSchema>;
|
|
895
|
+
/** Schema for stat values (clearances is nested). */
|
|
896
|
+
declare const PlayerGameStatsSchema: z.ZodObject<{
|
|
897
|
+
goals: z.ZodOptional<z.ZodNumber>;
|
|
898
|
+
behinds: z.ZodOptional<z.ZodNumber>;
|
|
899
|
+
kicks: z.ZodOptional<z.ZodNumber>;
|
|
900
|
+
handballs: z.ZodOptional<z.ZodNumber>;
|
|
901
|
+
disposals: z.ZodOptional<z.ZodNumber>;
|
|
902
|
+
marks: z.ZodOptional<z.ZodNumber>;
|
|
903
|
+
bounces: z.ZodOptional<z.ZodNumber>;
|
|
904
|
+
tackles: z.ZodOptional<z.ZodNumber>;
|
|
905
|
+
contestedPossessions: z.ZodOptional<z.ZodNumber>;
|
|
906
|
+
uncontestedPossessions: z.ZodOptional<z.ZodNumber>;
|
|
907
|
+
totalPossessions: z.ZodOptional<z.ZodNumber>;
|
|
908
|
+
inside50s: z.ZodOptional<z.ZodNumber>;
|
|
909
|
+
marksInside50: z.ZodOptional<z.ZodNumber>;
|
|
910
|
+
contestedMarks: z.ZodOptional<z.ZodNumber>;
|
|
911
|
+
hitouts: z.ZodOptional<z.ZodNumber>;
|
|
912
|
+
onePercenters: z.ZodOptional<z.ZodNumber>;
|
|
913
|
+
disposalEfficiency: z.ZodOptional<z.ZodNumber>;
|
|
914
|
+
clangers: z.ZodOptional<z.ZodNumber>;
|
|
915
|
+
freesFor: z.ZodOptional<z.ZodNumber>;
|
|
916
|
+
freesAgainst: z.ZodOptional<z.ZodNumber>;
|
|
917
|
+
dreamTeamPoints: z.ZodOptional<z.ZodNumber>;
|
|
918
|
+
clearances: z.ZodOptional<z.ZodObject<{
|
|
919
|
+
centreClearances: z.ZodOptional<z.ZodNumber>;
|
|
920
|
+
stoppageClearances: z.ZodOptional<z.ZodNumber>;
|
|
921
|
+
totalClearances: z.ZodOptional<z.ZodNumber>;
|
|
922
|
+
}, z.core.$loose>>;
|
|
923
|
+
rebound50s: z.ZodOptional<z.ZodNumber>;
|
|
924
|
+
goalAssists: z.ZodOptional<z.ZodNumber>;
|
|
925
|
+
goalAccuracy: z.ZodOptional<z.ZodNumber>;
|
|
926
|
+
turnovers: z.ZodOptional<z.ZodNumber>;
|
|
927
|
+
intercepts: z.ZodOptional<z.ZodNumber>;
|
|
928
|
+
tacklesInside50: z.ZodOptional<z.ZodNumber>;
|
|
929
|
+
shotsAtGoal: z.ZodOptional<z.ZodNumber>;
|
|
930
|
+
metresGained: z.ZodOptional<z.ZodNumber>;
|
|
931
|
+
scoreInvolvements: z.ZodOptional<z.ZodNumber>;
|
|
932
|
+
ratingPoints: z.ZodOptional<z.ZodNumber>;
|
|
933
|
+
extendedStats: z.ZodOptional<z.ZodObject<{
|
|
934
|
+
effectiveDisposals: z.ZodOptional<z.ZodNumber>;
|
|
935
|
+
effectiveKicks: z.ZodOptional<z.ZodNumber>;
|
|
936
|
+
kickEfficiency: z.ZodOptional<z.ZodNumber>;
|
|
937
|
+
kickToHandballRatio: z.ZodOptional<z.ZodNumber>;
|
|
938
|
+
pressureActs: z.ZodOptional<z.ZodNumber>;
|
|
939
|
+
defHalfPressureActs: z.ZodOptional<z.ZodNumber>;
|
|
940
|
+
spoils: z.ZodOptional<z.ZodNumber>;
|
|
941
|
+
hitoutsToAdvantage: z.ZodOptional<z.ZodNumber>;
|
|
942
|
+
hitoutWinPercentage: z.ZodOptional<z.ZodNumber>;
|
|
943
|
+
hitoutToAdvantageRate: z.ZodOptional<z.ZodNumber>;
|
|
944
|
+
groundBallGets: z.ZodOptional<z.ZodNumber>;
|
|
945
|
+
f50GroundBallGets: z.ZodOptional<z.ZodNumber>;
|
|
946
|
+
interceptMarks: z.ZodOptional<z.ZodNumber>;
|
|
947
|
+
marksOnLead: z.ZodOptional<z.ZodNumber>;
|
|
948
|
+
contestedPossessionRate: z.ZodOptional<z.ZodNumber>;
|
|
949
|
+
contestOffOneOnOnes: z.ZodOptional<z.ZodNumber>;
|
|
950
|
+
contestOffWins: z.ZodOptional<z.ZodNumber>;
|
|
951
|
+
contestOffWinsPercentage: z.ZodOptional<z.ZodNumber>;
|
|
952
|
+
contestDefOneOnOnes: z.ZodOptional<z.ZodNumber>;
|
|
953
|
+
contestDefLosses: z.ZodOptional<z.ZodNumber>;
|
|
954
|
+
contestDefLossPercentage: z.ZodOptional<z.ZodNumber>;
|
|
955
|
+
centreBounceAttendances: z.ZodOptional<z.ZodNumber>;
|
|
956
|
+
kickins: z.ZodOptional<z.ZodNumber>;
|
|
957
|
+
kickinsPlayon: z.ZodOptional<z.ZodNumber>;
|
|
958
|
+
ruckContests: z.ZodOptional<z.ZodNumber>;
|
|
959
|
+
scoreLaunches: z.ZodOptional<z.ZodNumber>;
|
|
960
|
+
}, z.core.$loose>>;
|
|
961
|
+
}, z.core.$loose>;
|
|
962
|
+
/** Schema for a single player's statistics in a match. */
|
|
963
|
+
declare const PlayerStatsItemSchema: z.ZodObject<{
|
|
964
|
+
player: z.ZodObject<{
|
|
965
|
+
player: z.ZodObject<{
|
|
966
|
+
position: z.ZodOptional<z.ZodString>;
|
|
967
|
+
player: z.ZodObject<{
|
|
968
|
+
playerId: z.ZodString;
|
|
969
|
+
playerName: z.ZodObject<{
|
|
970
|
+
givenName: z.ZodString;
|
|
971
|
+
surname: z.ZodString;
|
|
972
|
+
}, z.core.$loose>;
|
|
973
|
+
captain: z.ZodOptional<z.ZodBoolean>;
|
|
974
|
+
playerJumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
975
|
+
}, z.core.$loose>;
|
|
976
|
+
}, z.core.$loose>;
|
|
977
|
+
jumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
978
|
+
}, z.core.$loose>;
|
|
979
|
+
teamId: z.ZodString;
|
|
980
|
+
playerStats: z.ZodObject<{
|
|
981
|
+
stats: z.ZodObject<{
|
|
982
|
+
goals: z.ZodOptional<z.ZodNumber>;
|
|
983
|
+
behinds: z.ZodOptional<z.ZodNumber>;
|
|
984
|
+
kicks: z.ZodOptional<z.ZodNumber>;
|
|
985
|
+
handballs: z.ZodOptional<z.ZodNumber>;
|
|
986
|
+
disposals: z.ZodOptional<z.ZodNumber>;
|
|
987
|
+
marks: z.ZodOptional<z.ZodNumber>;
|
|
988
|
+
bounces: z.ZodOptional<z.ZodNumber>;
|
|
989
|
+
tackles: z.ZodOptional<z.ZodNumber>;
|
|
990
|
+
contestedPossessions: z.ZodOptional<z.ZodNumber>;
|
|
991
|
+
uncontestedPossessions: z.ZodOptional<z.ZodNumber>;
|
|
992
|
+
totalPossessions: z.ZodOptional<z.ZodNumber>;
|
|
993
|
+
inside50s: z.ZodOptional<z.ZodNumber>;
|
|
994
|
+
marksInside50: z.ZodOptional<z.ZodNumber>;
|
|
995
|
+
contestedMarks: z.ZodOptional<z.ZodNumber>;
|
|
996
|
+
hitouts: z.ZodOptional<z.ZodNumber>;
|
|
997
|
+
onePercenters: z.ZodOptional<z.ZodNumber>;
|
|
998
|
+
disposalEfficiency: z.ZodOptional<z.ZodNumber>;
|
|
999
|
+
clangers: z.ZodOptional<z.ZodNumber>;
|
|
1000
|
+
freesFor: z.ZodOptional<z.ZodNumber>;
|
|
1001
|
+
freesAgainst: z.ZodOptional<z.ZodNumber>;
|
|
1002
|
+
dreamTeamPoints: z.ZodOptional<z.ZodNumber>;
|
|
1003
|
+
clearances: z.ZodOptional<z.ZodObject<{
|
|
1004
|
+
centreClearances: z.ZodOptional<z.ZodNumber>;
|
|
1005
|
+
stoppageClearances: z.ZodOptional<z.ZodNumber>;
|
|
1006
|
+
totalClearances: z.ZodOptional<z.ZodNumber>;
|
|
1007
|
+
}, z.core.$loose>>;
|
|
1008
|
+
rebound50s: z.ZodOptional<z.ZodNumber>;
|
|
1009
|
+
goalAssists: z.ZodOptional<z.ZodNumber>;
|
|
1010
|
+
goalAccuracy: z.ZodOptional<z.ZodNumber>;
|
|
1011
|
+
turnovers: z.ZodOptional<z.ZodNumber>;
|
|
1012
|
+
intercepts: z.ZodOptional<z.ZodNumber>;
|
|
1013
|
+
tacklesInside50: z.ZodOptional<z.ZodNumber>;
|
|
1014
|
+
shotsAtGoal: z.ZodOptional<z.ZodNumber>;
|
|
1015
|
+
metresGained: z.ZodOptional<z.ZodNumber>;
|
|
1016
|
+
scoreInvolvements: z.ZodOptional<z.ZodNumber>;
|
|
1017
|
+
ratingPoints: z.ZodOptional<z.ZodNumber>;
|
|
1018
|
+
extendedStats: z.ZodOptional<z.ZodObject<{
|
|
1019
|
+
effectiveDisposals: z.ZodOptional<z.ZodNumber>;
|
|
1020
|
+
effectiveKicks: z.ZodOptional<z.ZodNumber>;
|
|
1021
|
+
kickEfficiency: z.ZodOptional<z.ZodNumber>;
|
|
1022
|
+
kickToHandballRatio: z.ZodOptional<z.ZodNumber>;
|
|
1023
|
+
pressureActs: z.ZodOptional<z.ZodNumber>;
|
|
1024
|
+
defHalfPressureActs: z.ZodOptional<z.ZodNumber>;
|
|
1025
|
+
spoils: z.ZodOptional<z.ZodNumber>;
|
|
1026
|
+
hitoutsToAdvantage: z.ZodOptional<z.ZodNumber>;
|
|
1027
|
+
hitoutWinPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1028
|
+
hitoutToAdvantageRate: z.ZodOptional<z.ZodNumber>;
|
|
1029
|
+
groundBallGets: z.ZodOptional<z.ZodNumber>;
|
|
1030
|
+
f50GroundBallGets: z.ZodOptional<z.ZodNumber>;
|
|
1031
|
+
interceptMarks: z.ZodOptional<z.ZodNumber>;
|
|
1032
|
+
marksOnLead: z.ZodOptional<z.ZodNumber>;
|
|
1033
|
+
contestedPossessionRate: z.ZodOptional<z.ZodNumber>;
|
|
1034
|
+
contestOffOneOnOnes: z.ZodOptional<z.ZodNumber>;
|
|
1035
|
+
contestOffWins: z.ZodOptional<z.ZodNumber>;
|
|
1036
|
+
contestOffWinsPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1037
|
+
contestDefOneOnOnes: z.ZodOptional<z.ZodNumber>;
|
|
1038
|
+
contestDefLosses: z.ZodOptional<z.ZodNumber>;
|
|
1039
|
+
contestDefLossPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1040
|
+
centreBounceAttendances: z.ZodOptional<z.ZodNumber>;
|
|
1041
|
+
kickins: z.ZodOptional<z.ZodNumber>;
|
|
1042
|
+
kickinsPlayon: z.ZodOptional<z.ZodNumber>;
|
|
1043
|
+
ruckContests: z.ZodOptional<z.ZodNumber>;
|
|
1044
|
+
scoreLaunches: z.ZodOptional<z.ZodNumber>;
|
|
1045
|
+
}, z.core.$loose>>;
|
|
1046
|
+
}, z.core.$loose>;
|
|
1047
|
+
timeOnGroundPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1048
|
+
}, z.core.$loose>;
|
|
1049
|
+
}, z.core.$loose>;
|
|
1050
|
+
/** Schema for the player stats response. */
|
|
1051
|
+
declare const PlayerStatsListSchema: z.ZodObject<{
|
|
1052
|
+
homeTeamPlayerStats: z.ZodArray<z.ZodObject<{
|
|
1053
|
+
player: z.ZodObject<{
|
|
1054
|
+
player: z.ZodObject<{
|
|
1055
|
+
position: z.ZodOptional<z.ZodString>;
|
|
1056
|
+
player: z.ZodObject<{
|
|
1057
|
+
playerId: z.ZodString;
|
|
1058
|
+
playerName: z.ZodObject<{
|
|
1059
|
+
givenName: z.ZodString;
|
|
1060
|
+
surname: z.ZodString;
|
|
1061
|
+
}, z.core.$loose>;
|
|
1062
|
+
captain: z.ZodOptional<z.ZodBoolean>;
|
|
1063
|
+
playerJumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1064
|
+
}, z.core.$loose>;
|
|
1065
|
+
}, z.core.$loose>;
|
|
1066
|
+
jumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1067
|
+
}, z.core.$loose>;
|
|
1068
|
+
teamId: z.ZodString;
|
|
1069
|
+
playerStats: z.ZodObject<{
|
|
1070
|
+
stats: z.ZodObject<{
|
|
1071
|
+
goals: z.ZodOptional<z.ZodNumber>;
|
|
1072
|
+
behinds: z.ZodOptional<z.ZodNumber>;
|
|
1073
|
+
kicks: z.ZodOptional<z.ZodNumber>;
|
|
1074
|
+
handballs: z.ZodOptional<z.ZodNumber>;
|
|
1075
|
+
disposals: z.ZodOptional<z.ZodNumber>;
|
|
1076
|
+
marks: z.ZodOptional<z.ZodNumber>;
|
|
1077
|
+
bounces: z.ZodOptional<z.ZodNumber>;
|
|
1078
|
+
tackles: z.ZodOptional<z.ZodNumber>;
|
|
1079
|
+
contestedPossessions: z.ZodOptional<z.ZodNumber>;
|
|
1080
|
+
uncontestedPossessions: z.ZodOptional<z.ZodNumber>;
|
|
1081
|
+
totalPossessions: z.ZodOptional<z.ZodNumber>;
|
|
1082
|
+
inside50s: z.ZodOptional<z.ZodNumber>;
|
|
1083
|
+
marksInside50: z.ZodOptional<z.ZodNumber>;
|
|
1084
|
+
contestedMarks: z.ZodOptional<z.ZodNumber>;
|
|
1085
|
+
hitouts: z.ZodOptional<z.ZodNumber>;
|
|
1086
|
+
onePercenters: z.ZodOptional<z.ZodNumber>;
|
|
1087
|
+
disposalEfficiency: z.ZodOptional<z.ZodNumber>;
|
|
1088
|
+
clangers: z.ZodOptional<z.ZodNumber>;
|
|
1089
|
+
freesFor: z.ZodOptional<z.ZodNumber>;
|
|
1090
|
+
freesAgainst: z.ZodOptional<z.ZodNumber>;
|
|
1091
|
+
dreamTeamPoints: z.ZodOptional<z.ZodNumber>;
|
|
1092
|
+
clearances: z.ZodOptional<z.ZodObject<{
|
|
1093
|
+
centreClearances: z.ZodOptional<z.ZodNumber>;
|
|
1094
|
+
stoppageClearances: z.ZodOptional<z.ZodNumber>;
|
|
1095
|
+
totalClearances: z.ZodOptional<z.ZodNumber>;
|
|
1096
|
+
}, z.core.$loose>>;
|
|
1097
|
+
rebound50s: z.ZodOptional<z.ZodNumber>;
|
|
1098
|
+
goalAssists: z.ZodOptional<z.ZodNumber>;
|
|
1099
|
+
goalAccuracy: z.ZodOptional<z.ZodNumber>;
|
|
1100
|
+
turnovers: z.ZodOptional<z.ZodNumber>;
|
|
1101
|
+
intercepts: z.ZodOptional<z.ZodNumber>;
|
|
1102
|
+
tacklesInside50: z.ZodOptional<z.ZodNumber>;
|
|
1103
|
+
shotsAtGoal: z.ZodOptional<z.ZodNumber>;
|
|
1104
|
+
metresGained: z.ZodOptional<z.ZodNumber>;
|
|
1105
|
+
scoreInvolvements: z.ZodOptional<z.ZodNumber>;
|
|
1106
|
+
ratingPoints: z.ZodOptional<z.ZodNumber>;
|
|
1107
|
+
extendedStats: z.ZodOptional<z.ZodObject<{
|
|
1108
|
+
effectiveDisposals: z.ZodOptional<z.ZodNumber>;
|
|
1109
|
+
effectiveKicks: z.ZodOptional<z.ZodNumber>;
|
|
1110
|
+
kickEfficiency: z.ZodOptional<z.ZodNumber>;
|
|
1111
|
+
kickToHandballRatio: z.ZodOptional<z.ZodNumber>;
|
|
1112
|
+
pressureActs: z.ZodOptional<z.ZodNumber>;
|
|
1113
|
+
defHalfPressureActs: z.ZodOptional<z.ZodNumber>;
|
|
1114
|
+
spoils: z.ZodOptional<z.ZodNumber>;
|
|
1115
|
+
hitoutsToAdvantage: z.ZodOptional<z.ZodNumber>;
|
|
1116
|
+
hitoutWinPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1117
|
+
hitoutToAdvantageRate: z.ZodOptional<z.ZodNumber>;
|
|
1118
|
+
groundBallGets: z.ZodOptional<z.ZodNumber>;
|
|
1119
|
+
f50GroundBallGets: z.ZodOptional<z.ZodNumber>;
|
|
1120
|
+
interceptMarks: z.ZodOptional<z.ZodNumber>;
|
|
1121
|
+
marksOnLead: z.ZodOptional<z.ZodNumber>;
|
|
1122
|
+
contestedPossessionRate: z.ZodOptional<z.ZodNumber>;
|
|
1123
|
+
contestOffOneOnOnes: z.ZodOptional<z.ZodNumber>;
|
|
1124
|
+
contestOffWins: z.ZodOptional<z.ZodNumber>;
|
|
1125
|
+
contestOffWinsPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1126
|
+
contestDefOneOnOnes: z.ZodOptional<z.ZodNumber>;
|
|
1127
|
+
contestDefLosses: z.ZodOptional<z.ZodNumber>;
|
|
1128
|
+
contestDefLossPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1129
|
+
centreBounceAttendances: z.ZodOptional<z.ZodNumber>;
|
|
1130
|
+
kickins: z.ZodOptional<z.ZodNumber>;
|
|
1131
|
+
kickinsPlayon: z.ZodOptional<z.ZodNumber>;
|
|
1132
|
+
ruckContests: z.ZodOptional<z.ZodNumber>;
|
|
1133
|
+
scoreLaunches: z.ZodOptional<z.ZodNumber>;
|
|
1134
|
+
}, z.core.$loose>>;
|
|
1135
|
+
}, z.core.$loose>;
|
|
1136
|
+
timeOnGroundPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1137
|
+
}, z.core.$loose>;
|
|
1138
|
+
}, z.core.$loose>>;
|
|
1139
|
+
awayTeamPlayerStats: z.ZodArray<z.ZodObject<{
|
|
1140
|
+
player: z.ZodObject<{
|
|
1141
|
+
player: z.ZodObject<{
|
|
1142
|
+
position: z.ZodOptional<z.ZodString>;
|
|
1143
|
+
player: z.ZodObject<{
|
|
1144
|
+
playerId: z.ZodString;
|
|
1145
|
+
playerName: z.ZodObject<{
|
|
1146
|
+
givenName: z.ZodString;
|
|
1147
|
+
surname: z.ZodString;
|
|
1148
|
+
}, z.core.$loose>;
|
|
1149
|
+
captain: z.ZodOptional<z.ZodBoolean>;
|
|
1150
|
+
playerJumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1151
|
+
}, z.core.$loose>;
|
|
1152
|
+
}, z.core.$loose>;
|
|
1153
|
+
jumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1154
|
+
}, z.core.$loose>;
|
|
1155
|
+
teamId: z.ZodString;
|
|
1156
|
+
playerStats: z.ZodObject<{
|
|
1157
|
+
stats: z.ZodObject<{
|
|
1158
|
+
goals: z.ZodOptional<z.ZodNumber>;
|
|
1159
|
+
behinds: z.ZodOptional<z.ZodNumber>;
|
|
1160
|
+
kicks: z.ZodOptional<z.ZodNumber>;
|
|
1161
|
+
handballs: z.ZodOptional<z.ZodNumber>;
|
|
1162
|
+
disposals: z.ZodOptional<z.ZodNumber>;
|
|
1163
|
+
marks: z.ZodOptional<z.ZodNumber>;
|
|
1164
|
+
bounces: z.ZodOptional<z.ZodNumber>;
|
|
1165
|
+
tackles: z.ZodOptional<z.ZodNumber>;
|
|
1166
|
+
contestedPossessions: z.ZodOptional<z.ZodNumber>;
|
|
1167
|
+
uncontestedPossessions: z.ZodOptional<z.ZodNumber>;
|
|
1168
|
+
totalPossessions: z.ZodOptional<z.ZodNumber>;
|
|
1169
|
+
inside50s: z.ZodOptional<z.ZodNumber>;
|
|
1170
|
+
marksInside50: z.ZodOptional<z.ZodNumber>;
|
|
1171
|
+
contestedMarks: z.ZodOptional<z.ZodNumber>;
|
|
1172
|
+
hitouts: z.ZodOptional<z.ZodNumber>;
|
|
1173
|
+
onePercenters: z.ZodOptional<z.ZodNumber>;
|
|
1174
|
+
disposalEfficiency: z.ZodOptional<z.ZodNumber>;
|
|
1175
|
+
clangers: z.ZodOptional<z.ZodNumber>;
|
|
1176
|
+
freesFor: z.ZodOptional<z.ZodNumber>;
|
|
1177
|
+
freesAgainst: z.ZodOptional<z.ZodNumber>;
|
|
1178
|
+
dreamTeamPoints: z.ZodOptional<z.ZodNumber>;
|
|
1179
|
+
clearances: z.ZodOptional<z.ZodObject<{
|
|
1180
|
+
centreClearances: z.ZodOptional<z.ZodNumber>;
|
|
1181
|
+
stoppageClearances: z.ZodOptional<z.ZodNumber>;
|
|
1182
|
+
totalClearances: z.ZodOptional<z.ZodNumber>;
|
|
1183
|
+
}, z.core.$loose>>;
|
|
1184
|
+
rebound50s: z.ZodOptional<z.ZodNumber>;
|
|
1185
|
+
goalAssists: z.ZodOptional<z.ZodNumber>;
|
|
1186
|
+
goalAccuracy: z.ZodOptional<z.ZodNumber>;
|
|
1187
|
+
turnovers: z.ZodOptional<z.ZodNumber>;
|
|
1188
|
+
intercepts: z.ZodOptional<z.ZodNumber>;
|
|
1189
|
+
tacklesInside50: z.ZodOptional<z.ZodNumber>;
|
|
1190
|
+
shotsAtGoal: z.ZodOptional<z.ZodNumber>;
|
|
1191
|
+
metresGained: z.ZodOptional<z.ZodNumber>;
|
|
1192
|
+
scoreInvolvements: z.ZodOptional<z.ZodNumber>;
|
|
1193
|
+
ratingPoints: z.ZodOptional<z.ZodNumber>;
|
|
1194
|
+
extendedStats: z.ZodOptional<z.ZodObject<{
|
|
1195
|
+
effectiveDisposals: z.ZodOptional<z.ZodNumber>;
|
|
1196
|
+
effectiveKicks: z.ZodOptional<z.ZodNumber>;
|
|
1197
|
+
kickEfficiency: z.ZodOptional<z.ZodNumber>;
|
|
1198
|
+
kickToHandballRatio: z.ZodOptional<z.ZodNumber>;
|
|
1199
|
+
pressureActs: z.ZodOptional<z.ZodNumber>;
|
|
1200
|
+
defHalfPressureActs: z.ZodOptional<z.ZodNumber>;
|
|
1201
|
+
spoils: z.ZodOptional<z.ZodNumber>;
|
|
1202
|
+
hitoutsToAdvantage: z.ZodOptional<z.ZodNumber>;
|
|
1203
|
+
hitoutWinPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1204
|
+
hitoutToAdvantageRate: z.ZodOptional<z.ZodNumber>;
|
|
1205
|
+
groundBallGets: z.ZodOptional<z.ZodNumber>;
|
|
1206
|
+
f50GroundBallGets: z.ZodOptional<z.ZodNumber>;
|
|
1207
|
+
interceptMarks: z.ZodOptional<z.ZodNumber>;
|
|
1208
|
+
marksOnLead: z.ZodOptional<z.ZodNumber>;
|
|
1209
|
+
contestedPossessionRate: z.ZodOptional<z.ZodNumber>;
|
|
1210
|
+
contestOffOneOnOnes: z.ZodOptional<z.ZodNumber>;
|
|
1211
|
+
contestOffWins: z.ZodOptional<z.ZodNumber>;
|
|
1212
|
+
contestOffWinsPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1213
|
+
contestDefOneOnOnes: z.ZodOptional<z.ZodNumber>;
|
|
1214
|
+
contestDefLosses: z.ZodOptional<z.ZodNumber>;
|
|
1215
|
+
contestDefLossPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1216
|
+
centreBounceAttendances: z.ZodOptional<z.ZodNumber>;
|
|
1217
|
+
kickins: z.ZodOptional<z.ZodNumber>;
|
|
1218
|
+
kickinsPlayon: z.ZodOptional<z.ZodNumber>;
|
|
1219
|
+
ruckContests: z.ZodOptional<z.ZodNumber>;
|
|
1220
|
+
scoreLaunches: z.ZodOptional<z.ZodNumber>;
|
|
1221
|
+
}, z.core.$loose>>;
|
|
1222
|
+
}, z.core.$loose>;
|
|
1223
|
+
timeOnGroundPercentage: z.ZodOptional<z.ZodNumber>;
|
|
1224
|
+
}, z.core.$loose>;
|
|
1225
|
+
}, z.core.$loose>>;
|
|
1226
|
+
}, z.core.$loose>;
|
|
1227
|
+
/** Inferred type for a single player stats item. */
|
|
1228
|
+
type PlayerStatsItem = z.infer<typeof PlayerStatsItemSchema>;
|
|
1229
|
+
/** Inferred type for player game stats. */
|
|
1230
|
+
type PlayerGameStats = z.infer<typeof PlayerGameStatsSchema>;
|
|
1231
|
+
/** Inferred type for the player stats list response. */
|
|
1232
|
+
type PlayerStatsList = z.infer<typeof PlayerStatsListSchema>;
|
|
1233
|
+
/** Schema for a player entry within a match roster. */
|
|
1234
|
+
declare const RosterPlayerSchema: z.ZodObject<{
|
|
1235
|
+
player: z.ZodObject<{
|
|
1236
|
+
position: z.ZodOptional<z.ZodString>;
|
|
1237
|
+
player: z.ZodObject<{
|
|
1238
|
+
playerId: z.ZodString;
|
|
1239
|
+
playerName: z.ZodObject<{
|
|
1240
|
+
givenName: z.ZodString;
|
|
1241
|
+
surname: z.ZodString;
|
|
1242
|
+
}, z.core.$loose>;
|
|
1243
|
+
captain: z.ZodOptional<z.ZodBoolean>;
|
|
1244
|
+
playerJumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1245
|
+
}, z.core.$loose>;
|
|
1246
|
+
}, z.core.$loose>;
|
|
1247
|
+
jumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1248
|
+
}, z.core.$loose>;
|
|
1249
|
+
/** Schema for a team's player list in the roster. */
|
|
1250
|
+
declare const TeamPlayersSchema: z.ZodObject<{
|
|
1251
|
+
teamId: z.ZodString;
|
|
1252
|
+
players: z.ZodArray<z.ZodObject<{
|
|
1253
|
+
player: z.ZodObject<{
|
|
1254
|
+
position: z.ZodOptional<z.ZodString>;
|
|
1255
|
+
player: z.ZodObject<{
|
|
1256
|
+
playerId: z.ZodString;
|
|
1257
|
+
playerName: z.ZodObject<{
|
|
1258
|
+
givenName: z.ZodString;
|
|
1259
|
+
surname: z.ZodString;
|
|
1260
|
+
}, z.core.$loose>;
|
|
1261
|
+
captain: z.ZodOptional<z.ZodBoolean>;
|
|
1262
|
+
playerJumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1263
|
+
}, z.core.$loose>;
|
|
1264
|
+
}, z.core.$loose>;
|
|
1265
|
+
jumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1266
|
+
}, z.core.$loose>>;
|
|
1267
|
+
}, z.core.$loose>;
|
|
1268
|
+
/** Schema for the full match roster response. */
|
|
1269
|
+
declare const MatchRosterSchema: z.ZodObject<{
|
|
1270
|
+
match: z.ZodObject<{
|
|
1271
|
+
matchId: z.ZodString;
|
|
1272
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1273
|
+
status: z.ZodString;
|
|
1274
|
+
utcStartTime: z.ZodString;
|
|
1275
|
+
homeTeamId: z.ZodString;
|
|
1276
|
+
awayTeamId: z.ZodString;
|
|
1277
|
+
homeTeam: z.ZodObject<{
|
|
1278
|
+
name: z.ZodString;
|
|
1279
|
+
teamId: z.ZodString;
|
|
1280
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
1281
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
1282
|
+
}, z.core.$loose>;
|
|
1283
|
+
awayTeam: z.ZodObject<{
|
|
1284
|
+
name: z.ZodString;
|
|
1285
|
+
teamId: z.ZodString;
|
|
1286
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
1287
|
+
nickname: z.ZodOptional<z.ZodString>;
|
|
1288
|
+
}, z.core.$loose>;
|
|
1289
|
+
round: z.ZodOptional<z.ZodString>;
|
|
1290
|
+
abbr: z.ZodOptional<z.ZodString>;
|
|
1291
|
+
}, z.core.$loose>;
|
|
1292
|
+
teamPlayers: z.ZodArray<z.ZodObject<{
|
|
1293
|
+
teamId: z.ZodString;
|
|
1294
|
+
players: z.ZodArray<z.ZodObject<{
|
|
1295
|
+
player: z.ZodObject<{
|
|
1296
|
+
position: z.ZodOptional<z.ZodString>;
|
|
1297
|
+
player: z.ZodObject<{
|
|
1298
|
+
playerId: z.ZodString;
|
|
1299
|
+
playerName: z.ZodObject<{
|
|
1300
|
+
givenName: z.ZodString;
|
|
1301
|
+
surname: z.ZodString;
|
|
1302
|
+
}, z.core.$loose>;
|
|
1303
|
+
captain: z.ZodOptional<z.ZodBoolean>;
|
|
1304
|
+
playerJumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1305
|
+
}, z.core.$loose>;
|
|
1306
|
+
}, z.core.$loose>;
|
|
1307
|
+
jumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1308
|
+
}, z.core.$loose>>;
|
|
1309
|
+
}, z.core.$loose>>;
|
|
1310
|
+
}, z.core.$loose>;
|
|
1311
|
+
/** Inferred type for a roster player. */
|
|
1312
|
+
type RosterPlayer = z.infer<typeof RosterPlayerSchema>;
|
|
1313
|
+
/** Inferred type for a team's player list. */
|
|
1314
|
+
type TeamPlayers = z.infer<typeof TeamPlayersSchema>;
|
|
1315
|
+
/** Inferred type for the match roster response. */
|
|
1316
|
+
type MatchRoster = z.infer<typeof MatchRosterSchema>;
|
|
1317
|
+
/** Schema for a single team entry. */
|
|
1318
|
+
declare const TeamItemSchema: z.ZodObject<{
|
|
1319
|
+
id: z.ZodNumber;
|
|
1320
|
+
name: z.ZodString;
|
|
1321
|
+
abbreviation: z.ZodOptional<z.ZodString>;
|
|
1322
|
+
teamType: z.ZodOptional<z.ZodString>;
|
|
1323
|
+
}, z.core.$loose>;
|
|
1324
|
+
/** Schema for the team list response. */
|
|
1325
|
+
declare const TeamListSchema: z.ZodObject<{
|
|
1326
|
+
teams: z.ZodArray<z.ZodObject<{
|
|
1327
|
+
id: z.ZodNumber;
|
|
1328
|
+
name: z.ZodString;
|
|
1329
|
+
abbreviation: z.ZodOptional<z.ZodString>;
|
|
1330
|
+
teamType: z.ZodOptional<z.ZodString>;
|
|
1331
|
+
}, z.core.$loose>>;
|
|
1332
|
+
}, z.core.$loose>;
|
|
1333
|
+
/** Inferred type for a single team item. */
|
|
1334
|
+
type TeamItem = z.infer<typeof TeamItemSchema>;
|
|
1335
|
+
/** Inferred type for the team list response. */
|
|
1336
|
+
type TeamList = z.infer<typeof TeamListSchema>;
|
|
1337
|
+
/** Schema for a player's inner identity within a squad. */
|
|
1338
|
+
declare const SquadPlayerInnerSchema: z.ZodObject<{
|
|
1339
|
+
id: z.ZodNumber;
|
|
1340
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
1341
|
+
firstName: z.ZodString;
|
|
1342
|
+
surname: z.ZodString;
|
|
1343
|
+
dateOfBirth: z.ZodOptional<z.ZodString>;
|
|
1344
|
+
heightInCm: z.ZodOptional<z.ZodNumber>;
|
|
1345
|
+
weightInKg: z.ZodOptional<z.ZodNumber>;
|
|
1346
|
+
draftYear: z.ZodOptional<z.ZodString>;
|
|
1347
|
+
draftPosition: z.ZodOptional<z.ZodString>;
|
|
1348
|
+
draftType: z.ZodOptional<z.ZodString>;
|
|
1349
|
+
debutYear: z.ZodOptional<z.ZodString>;
|
|
1350
|
+
recruitedFrom: z.ZodOptional<z.ZodString>;
|
|
1351
|
+
}, z.core.$loose>;
|
|
1352
|
+
/** Schema for a single squad player entry. */
|
|
1353
|
+
declare const SquadPlayerItemSchema: z.ZodObject<{
|
|
1354
|
+
player: z.ZodObject<{
|
|
1355
|
+
id: z.ZodNumber;
|
|
1356
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
1357
|
+
firstName: z.ZodString;
|
|
1358
|
+
surname: z.ZodString;
|
|
1359
|
+
dateOfBirth: z.ZodOptional<z.ZodString>;
|
|
1360
|
+
heightInCm: z.ZodOptional<z.ZodNumber>;
|
|
1361
|
+
weightInKg: z.ZodOptional<z.ZodNumber>;
|
|
1362
|
+
draftYear: z.ZodOptional<z.ZodString>;
|
|
1363
|
+
draftPosition: z.ZodOptional<z.ZodString>;
|
|
1364
|
+
draftType: z.ZodOptional<z.ZodString>;
|
|
1365
|
+
debutYear: z.ZodOptional<z.ZodString>;
|
|
1366
|
+
recruitedFrom: z.ZodOptional<z.ZodString>;
|
|
1367
|
+
}, z.core.$loose>;
|
|
1368
|
+
jumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1369
|
+
position: z.ZodOptional<z.ZodString>;
|
|
1370
|
+
}, z.core.$loose>;
|
|
1371
|
+
/** Schema for the squad wrapper object. */
|
|
1372
|
+
declare const SquadSchema: z.ZodObject<{
|
|
1373
|
+
team: z.ZodOptional<z.ZodObject<{
|
|
1374
|
+
name: z.ZodString;
|
|
1375
|
+
}, z.core.$loose>>;
|
|
1376
|
+
players: z.ZodArray<z.ZodObject<{
|
|
1377
|
+
player: z.ZodObject<{
|
|
1378
|
+
id: z.ZodNumber;
|
|
1379
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
1380
|
+
firstName: z.ZodString;
|
|
1381
|
+
surname: z.ZodString;
|
|
1382
|
+
dateOfBirth: z.ZodOptional<z.ZodString>;
|
|
1383
|
+
heightInCm: z.ZodOptional<z.ZodNumber>;
|
|
1384
|
+
weightInKg: z.ZodOptional<z.ZodNumber>;
|
|
1385
|
+
draftYear: z.ZodOptional<z.ZodString>;
|
|
1386
|
+
draftPosition: z.ZodOptional<z.ZodString>;
|
|
1387
|
+
draftType: z.ZodOptional<z.ZodString>;
|
|
1388
|
+
debutYear: z.ZodOptional<z.ZodString>;
|
|
1389
|
+
recruitedFrom: z.ZodOptional<z.ZodString>;
|
|
1390
|
+
}, z.core.$loose>;
|
|
1391
|
+
jumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1392
|
+
position: z.ZodOptional<z.ZodString>;
|
|
1393
|
+
}, z.core.$loose>>;
|
|
1394
|
+
}, z.core.$loose>;
|
|
1395
|
+
/** Schema for the squad response. */
|
|
1396
|
+
declare const SquadListSchema: z.ZodObject<{
|
|
1397
|
+
squad: z.ZodObject<{
|
|
1398
|
+
team: z.ZodOptional<z.ZodObject<{
|
|
1399
|
+
name: z.ZodString;
|
|
1400
|
+
}, z.core.$loose>>;
|
|
1401
|
+
players: z.ZodArray<z.ZodObject<{
|
|
1402
|
+
player: z.ZodObject<{
|
|
1403
|
+
id: z.ZodNumber;
|
|
1404
|
+
providerId: z.ZodOptional<z.ZodString>;
|
|
1405
|
+
firstName: z.ZodString;
|
|
1406
|
+
surname: z.ZodString;
|
|
1407
|
+
dateOfBirth: z.ZodOptional<z.ZodString>;
|
|
1408
|
+
heightInCm: z.ZodOptional<z.ZodNumber>;
|
|
1409
|
+
weightInKg: z.ZodOptional<z.ZodNumber>;
|
|
1410
|
+
draftYear: z.ZodOptional<z.ZodString>;
|
|
1411
|
+
draftPosition: z.ZodOptional<z.ZodString>;
|
|
1412
|
+
draftType: z.ZodOptional<z.ZodString>;
|
|
1413
|
+
debutYear: z.ZodOptional<z.ZodString>;
|
|
1414
|
+
recruitedFrom: z.ZodOptional<z.ZodString>;
|
|
1415
|
+
}, z.core.$loose>;
|
|
1416
|
+
jumperNumber: z.ZodOptional<z.ZodNumber>;
|
|
1417
|
+
position: z.ZodOptional<z.ZodString>;
|
|
1418
|
+
}, z.core.$loose>>;
|
|
1419
|
+
}, z.core.$loose>;
|
|
1420
|
+
}, z.core.$loose>;
|
|
1421
|
+
/** Inferred type for a single squad player item. */
|
|
1422
|
+
type SquadPlayerItem = z.infer<typeof SquadPlayerItemSchema>;
|
|
1423
|
+
/** Inferred type for the squad response. */
|
|
1424
|
+
type SquadList = z.infer<typeof SquadListSchema>;
|
|
1425
|
+
/** Schema for a single ladder entry from the AFL API. */
|
|
1426
|
+
declare const LadderEntryRawSchema: z.ZodObject<{
|
|
1427
|
+
position: z.ZodNumber;
|
|
1428
|
+
team: z.ZodObject<{
|
|
1429
|
+
name: z.ZodString;
|
|
1430
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1431
|
+
abbreviation: z.ZodOptional<z.ZodString>;
|
|
1432
|
+
}, z.core.$loose>;
|
|
1433
|
+
played: z.ZodOptional<z.ZodNumber>;
|
|
1434
|
+
pointsFor: z.ZodOptional<z.ZodNumber>;
|
|
1435
|
+
pointsAgainst: z.ZodOptional<z.ZodNumber>;
|
|
1436
|
+
thisSeasonRecord: z.ZodOptional<z.ZodObject<{
|
|
1437
|
+
aggregatePoints: z.ZodOptional<z.ZodNumber>;
|
|
1438
|
+
percentage: z.ZodOptional<z.ZodNumber>;
|
|
1439
|
+
winLossRecord: z.ZodOptional<z.ZodObject<{
|
|
1440
|
+
wins: z.ZodNumber;
|
|
1441
|
+
losses: z.ZodNumber;
|
|
1442
|
+
draws: z.ZodNumber;
|
|
1443
|
+
played: z.ZodOptional<z.ZodNumber>;
|
|
1444
|
+
}, z.core.$loose>>;
|
|
1445
|
+
}, z.core.$loose>>;
|
|
1446
|
+
form: z.ZodOptional<z.ZodString>;
|
|
1447
|
+
}, z.core.$loose>;
|
|
1448
|
+
/** Schema for the ladder API response. */
|
|
1449
|
+
declare const LadderResponseSchema: z.ZodObject<{
|
|
1450
|
+
ladders: z.ZodArray<z.ZodObject<{
|
|
1451
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
1452
|
+
position: z.ZodNumber;
|
|
1453
|
+
team: z.ZodObject<{
|
|
1454
|
+
name: z.ZodString;
|
|
1455
|
+
id: z.ZodOptional<z.ZodNumber>;
|
|
1456
|
+
abbreviation: z.ZodOptional<z.ZodString>;
|
|
1457
|
+
}, z.core.$loose>;
|
|
1458
|
+
played: z.ZodOptional<z.ZodNumber>;
|
|
1459
|
+
pointsFor: z.ZodOptional<z.ZodNumber>;
|
|
1460
|
+
pointsAgainst: z.ZodOptional<z.ZodNumber>;
|
|
1461
|
+
thisSeasonRecord: z.ZodOptional<z.ZodObject<{
|
|
1462
|
+
aggregatePoints: z.ZodOptional<z.ZodNumber>;
|
|
1463
|
+
percentage: z.ZodOptional<z.ZodNumber>;
|
|
1464
|
+
winLossRecord: z.ZodOptional<z.ZodObject<{
|
|
1465
|
+
wins: z.ZodNumber;
|
|
1466
|
+
losses: z.ZodNumber;
|
|
1467
|
+
draws: z.ZodNumber;
|
|
1468
|
+
played: z.ZodOptional<z.ZodNumber>;
|
|
1469
|
+
}, z.core.$loose>>;
|
|
1470
|
+
}, z.core.$loose>>;
|
|
1471
|
+
form: z.ZodOptional<z.ZodString>;
|
|
1472
|
+
}, z.core.$loose>>;
|
|
1473
|
+
}, z.core.$loose>>;
|
|
1474
|
+
round: z.ZodOptional<z.ZodObject<{
|
|
1475
|
+
roundNumber: z.ZodNumber;
|
|
1476
|
+
name: z.ZodOptional<z.ZodString>;
|
|
1477
|
+
}, z.core.$loose>>;
|
|
1478
|
+
}, z.core.$loose>;
|
|
1479
|
+
/** Inferred type for a raw ladder entry. */
|
|
1480
|
+
type LadderEntryRaw = z.infer<typeof LadderEntryRawSchema>;
|
|
1481
|
+
/** Inferred type for the ladder API response. */
|
|
1482
|
+
type LadderResponse = z.infer<typeof LadderResponseSchema>;
|
|
1483
|
+
import { z as z2 } from "zod/v4";
|
|
1484
|
+
/** Options for constructing an {@link AflApiClient}. */
|
|
1485
|
+
interface AflApiClientOptions {
|
|
1486
|
+
/** Custom fetch implementation (defaults to global `fetch`). */
|
|
1487
|
+
readonly fetchFn?: typeof fetch | undefined;
|
|
1488
|
+
/** Token endpoint override (useful for testing). */
|
|
1489
|
+
readonly tokenUrl?: string | undefined;
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* AFL API client that handles token authentication and provides typed fetch helpers.
|
|
1493
|
+
*
|
|
1494
|
+
* @example
|
|
1495
|
+
* ```ts
|
|
1496
|
+
* const client = new AflApiClient();
|
|
1497
|
+
* await client.authenticate();
|
|
1498
|
+
* const result = await client.fetchJson("https://api.afl.com.au/cfs/afl/matchItems/round/123", MatchItemListSchema);
|
|
1499
|
+
* ```
|
|
1500
|
+
*/
|
|
1501
|
+
declare class AflApiClient {
|
|
1502
|
+
private readonly fetchFn;
|
|
1503
|
+
private readonly tokenUrl;
|
|
1504
|
+
private cachedToken;
|
|
1505
|
+
constructor(options?: AflApiClientOptions);
|
|
1506
|
+
/**
|
|
1507
|
+
* Authenticate with the WMCTok token endpoint and cache the token.
|
|
1508
|
+
*
|
|
1509
|
+
* @returns The access token on success, or an error Result.
|
|
1510
|
+
*/
|
|
1511
|
+
authenticate(): Promise<Result<string, AflApiError>>;
|
|
1512
|
+
/**
|
|
1513
|
+
* Whether the cached token is still valid (not expired).
|
|
1514
|
+
*/
|
|
1515
|
+
get isAuthenticated(): boolean;
|
|
1516
|
+
/**
|
|
1517
|
+
* Perform an authenticated fetch, automatically adding the bearer token.
|
|
1518
|
+
* Retries once on 401 by re-authenticating.
|
|
1519
|
+
*
|
|
1520
|
+
* @param url - The URL to fetch.
|
|
1521
|
+
* @param init - Additional fetch options.
|
|
1522
|
+
* @returns The Response on success, or an error Result.
|
|
1523
|
+
*/
|
|
1524
|
+
authedFetch(url: string, init?: RequestInit): Promise<Result<Response, AflApiError>>;
|
|
1525
|
+
/**
|
|
1526
|
+
* Fetch JSON from a URL, validate with a Zod schema, and return a typed Result.
|
|
1527
|
+
*
|
|
1528
|
+
* @param url - The URL to fetch.
|
|
1529
|
+
* @param schema - Zod schema to validate the response against.
|
|
1530
|
+
* @returns Validated data on success, or an error Result.
|
|
1531
|
+
*/
|
|
1532
|
+
fetchJson<T>(url: string, schema: z2.ZodType<T>): Promise<Result<T, AflApiError | ValidationError>>;
|
|
1533
|
+
/**
|
|
1534
|
+
* Resolve a competition code (e.g. "AFLM") to its API competition ID.
|
|
1535
|
+
*
|
|
1536
|
+
* @param code - The competition code to resolve.
|
|
1537
|
+
* @returns The competition ID string on success.
|
|
1538
|
+
*/
|
|
1539
|
+
resolveCompetitionId(code: CompetitionCode): Promise<Result<number, AflApiError | ValidationError>>;
|
|
1540
|
+
/**
|
|
1541
|
+
* Resolve a season (compseason) ID from a competition ID and year.
|
|
1542
|
+
*
|
|
1543
|
+
* @param competitionId - The competition ID (from {@link resolveCompetitionId}).
|
|
1544
|
+
* @param year - The season year (e.g. 2024).
|
|
1545
|
+
* @returns The compseason ID string on success.
|
|
1546
|
+
*/
|
|
1547
|
+
resolveSeasonId(competitionId: number, year: number): Promise<Result<number, AflApiError | ValidationError>>;
|
|
1548
|
+
/**
|
|
1549
|
+
* Resolve a season ID from a competition code and year in one step.
|
|
1550
|
+
*
|
|
1551
|
+
* @param code - The competition code (e.g. "AFLM").
|
|
1552
|
+
* @param year - The season year (e.g. 2025).
|
|
1553
|
+
* @returns The compseason ID on success.
|
|
1554
|
+
*/
|
|
1555
|
+
resolveCompSeason(code: CompetitionCode, year: number): Promise<Result<number, AflApiError | ValidationError>>;
|
|
1556
|
+
/**
|
|
1557
|
+
* Fetch all rounds for a season with their metadata.
|
|
1558
|
+
*
|
|
1559
|
+
* @param seasonId - The compseason ID (from {@link resolveSeasonId}).
|
|
1560
|
+
* @returns Array of round objects on success.
|
|
1561
|
+
*/
|
|
1562
|
+
resolveRounds(seasonId: number): Promise<Result<Round[], AflApiError | ValidationError>>;
|
|
1563
|
+
/**
|
|
1564
|
+
* Fetch match items for a round using the /cfs/ endpoint.
|
|
1565
|
+
*
|
|
1566
|
+
* @param roundProviderId - The round provider ID (e.g. "CD_R202501401").
|
|
1567
|
+
* @returns Array of match items on success.
|
|
1568
|
+
*/
|
|
1569
|
+
fetchRoundMatchItems(roundProviderId: string): Promise<Result<MatchItem[], AflApiError | ValidationError>>;
|
|
1570
|
+
/**
|
|
1571
|
+
* Fetch match items for a round by resolving the round provider ID from season and round number.
|
|
1572
|
+
*
|
|
1573
|
+
* @param seasonId - The compseason ID.
|
|
1574
|
+
* @param roundNumber - The round number.
|
|
1575
|
+
* @returns Array of match items on success.
|
|
1576
|
+
*/
|
|
1577
|
+
fetchRoundMatchItemsByNumber(seasonId: number, roundNumber: number): Promise<Result<MatchItem[], AflApiError | ValidationError>>;
|
|
1578
|
+
/**
|
|
1579
|
+
* Fetch match items for all completed rounds in a season.
|
|
1580
|
+
*
|
|
1581
|
+
* @param seasonId - The compseason ID.
|
|
1582
|
+
* @returns Aggregated array of match items from all completed rounds.
|
|
1583
|
+
*/
|
|
1584
|
+
fetchSeasonMatchItems(seasonId: number): Promise<Result<MatchItem[], AflApiError | ValidationError>>;
|
|
1585
|
+
/**
|
|
1586
|
+
* Fetch per-player statistics for a match.
|
|
1587
|
+
*
|
|
1588
|
+
* @param matchProviderId - The match provider ID (e.g. "CD_M20250140101").
|
|
1589
|
+
* @returns Player stats list with home and away arrays.
|
|
1590
|
+
*/
|
|
1591
|
+
fetchPlayerStats(matchProviderId: string): Promise<Result<PlayerStatsList, AflApiError | ValidationError>>;
|
|
1592
|
+
/**
|
|
1593
|
+
* Fetch match roster (lineup) for a match.
|
|
1594
|
+
*
|
|
1595
|
+
* @param matchProviderId - The match provider ID (e.g. "CD_M20250140101").
|
|
1596
|
+
* @returns Match roster with team players.
|
|
1597
|
+
*/
|
|
1598
|
+
fetchMatchRoster(matchProviderId: string): Promise<Result<MatchRoster, AflApiError | ValidationError>>;
|
|
1599
|
+
/**
|
|
1600
|
+
* Fetch team list, optionally filtered by team type.
|
|
1601
|
+
*
|
|
1602
|
+
* @param teamType - Optional filter (e.g. "MEN", "WOMEN").
|
|
1603
|
+
* @returns Array of team items.
|
|
1604
|
+
*/
|
|
1605
|
+
fetchTeams(teamType?: string): Promise<Result<TeamItem[], AflApiError | ValidationError>>;
|
|
1606
|
+
/**
|
|
1607
|
+
* Fetch squad (roster) for a team in a specific season.
|
|
1608
|
+
*
|
|
1609
|
+
* @param teamId - The numeric team ID.
|
|
1610
|
+
* @param compSeasonId - The compseason ID.
|
|
1611
|
+
* @returns Squad list response.
|
|
1612
|
+
*/
|
|
1613
|
+
fetchSquad(teamId: number, compSeasonId: number): Promise<Result<SquadList, AflApiError | ValidationError>>;
|
|
1614
|
+
/**
|
|
1615
|
+
* Fetch ladder standings for a season (optionally for a specific round).
|
|
1616
|
+
*
|
|
1617
|
+
* @param seasonId - The compseason ID.
|
|
1618
|
+
* @param roundId - Optional round ID (numeric `id`, not `providerId`).
|
|
1619
|
+
* @returns Ladder response with entries.
|
|
1620
|
+
*/
|
|
1621
|
+
fetchLadder(seasonId: number, roundId?: number): Promise<Result<LadderResponse, AflApiError | ValidationError>>;
|
|
1622
|
+
}
|
|
1623
|
+
/** Options for constructing an AFL Tables client. */
|
|
1624
|
+
interface AflTablesClientOptions {
|
|
1625
|
+
readonly fetchFn?: typeof fetch | undefined;
|
|
1626
|
+
}
|
|
1627
|
+
/**
|
|
1628
|
+
* AFL Tables scraper client.
|
|
1629
|
+
*/
|
|
1630
|
+
declare class AflTablesClient {
|
|
1631
|
+
private readonly fetchFn;
|
|
1632
|
+
constructor(options?: AflTablesClientOptions);
|
|
1633
|
+
/**
|
|
1634
|
+
* Fetch season match results from AFL Tables.
|
|
1635
|
+
*
|
|
1636
|
+
* @param year - The season year (1897 to present).
|
|
1637
|
+
* @returns Array of match results.
|
|
1638
|
+
*/
|
|
1639
|
+
fetchSeasonResults(year: number): Promise<Result<MatchResult[], ScrapeError>>;
|
|
1640
|
+
}
|
|
1641
|
+
/** Options for constructing a FootyWire client. */
|
|
1642
|
+
interface FootyWireClientOptions {
|
|
1643
|
+
readonly fetchFn?: typeof fetch | undefined;
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* FootyWire scraper client.
|
|
1647
|
+
*/
|
|
1648
|
+
declare class FootyWireClient {
|
|
1649
|
+
private readonly fetchFn;
|
|
1650
|
+
constructor(options?: FootyWireClientOptions);
|
|
1651
|
+
/**
|
|
1652
|
+
* Fetch the HTML content of a FootyWire page.
|
|
1653
|
+
*/
|
|
1654
|
+
private fetchHtml;
|
|
1655
|
+
/**
|
|
1656
|
+
* Fetch season match results from FootyWire.
|
|
1657
|
+
*
|
|
1658
|
+
* @param year - The season year.
|
|
1659
|
+
* @returns Array of match results.
|
|
1660
|
+
*/
|
|
1661
|
+
fetchSeasonResults(year: number): Promise<Result<MatchResult[], ScrapeError>>;
|
|
1662
|
+
}
|
|
1663
|
+
/**
|
|
1664
|
+
* Attempt to fetch advanced player statistics from Fryzigg.
|
|
1665
|
+
*
|
|
1666
|
+
* @returns Always returns an error Result explaining that Fryzigg is
|
|
1667
|
+
* not supported in the TypeScript port.
|
|
1668
|
+
*/
|
|
1669
|
+
declare function fetchFryziggStats(): Result<PlayerStats[], ScrapeError>;
|
|
1670
|
+
/**
|
|
1671
|
+
* Transform raw AFL API ladder entries into typed LadderEntry objects.
|
|
1672
|
+
*
|
|
1673
|
+
* @param entries - Raw ladder entries from the API response.
|
|
1674
|
+
* @returns Array of typed ladder entries.
|
|
1675
|
+
*/
|
|
1676
|
+
declare function transformLadderEntries(entries: readonly LadderEntryRaw[]): LadderEntry[];
|
|
1677
|
+
/**
|
|
1678
|
+
* Transform a raw match roster into a typed Lineup object.
|
|
1679
|
+
*
|
|
1680
|
+
* @param roster - Raw match roster from the /cfs/ endpoint.
|
|
1681
|
+
* @param season - The season year.
|
|
1682
|
+
* @param roundNumber - The round number.
|
|
1683
|
+
* @param competition - The competition code.
|
|
1684
|
+
* @returns Typed Lineup with normalised team names and player lists.
|
|
1685
|
+
*/
|
|
1686
|
+
declare function transformMatchRoster(roster: MatchRoster, season: number, roundNumber: number, competition: CompetitionCode): Lineup;
|
|
1687
|
+
/** Infer RoundType from a round name string. */
|
|
1688
|
+
declare function inferRoundType(roundName: string): RoundType;
|
|
1689
|
+
/**
|
|
1690
|
+
* Transform raw AFL API match items into typed MatchResult objects.
|
|
1691
|
+
*
|
|
1692
|
+
* @param items - Raw match items from the /cfs/ endpoint.
|
|
1693
|
+
* @param season - The season year for these matches.
|
|
1694
|
+
* @param competition - The competition code.
|
|
1695
|
+
* @returns Flattened, normalised MatchResult array.
|
|
1696
|
+
*/
|
|
1697
|
+
declare function transformMatchItems(items: readonly MatchItem[], season: number, competition: CompetitionCode, source?: DataSource): MatchResult[];
|
|
1698
|
+
/**
|
|
1699
|
+
* Transform raw AFL API player stats list into typed PlayerStats objects.
|
|
1700
|
+
*
|
|
1701
|
+
* @param data - Raw player stats response with home/away arrays.
|
|
1702
|
+
* @param matchId - The match provider ID.
|
|
1703
|
+
* @param season - The season year.
|
|
1704
|
+
* @param roundNumber - The round number.
|
|
1705
|
+
* @param competition - The competition code.
|
|
1706
|
+
* @returns Flattened PlayerStats array (home players first, then away).
|
|
1707
|
+
*/
|
|
1708
|
+
declare function transformPlayerStats(data: PlayerStatsList, matchId: string, season: number, roundNumber: number, competition: CompetitionCode, source?: DataSource, teamIdMap?: ReadonlyMap<string, string>): PlayerStats[];
|
|
1709
|
+
export { transformPlayerStats, transformMatchRoster, transformMatchItems, transformLadderEntries, toAestString, parseFootyWireDate, parseAflTablesDate, parseAflApiDate, ok, normaliseTeamName, inferRoundType, fetchTeams2 as fetchTeams, fetchSquad2 as fetchSquad, fetchPlayerStats2 as fetchPlayerStats, fetchMatchResults, fetchLineup, fetchLadder2 as fetchLadder, fetchFryziggStats, fetchFixture, err, ValidationError, UnsupportedSourceError, TeamScoreSchema, TeamScore, TeamQuery, TeamPlayersSchema, TeamPlayers, TeamListSchema, TeamList, TeamItemSchema, TeamItem, Team, SquadSchema, SquadQuery, SquadPlayerItemSchema, SquadPlayerItem, SquadPlayerInnerSchema, SquadPlayer, SquadListSchema, SquadList, Squad, SeasonRoundQuery, ScrapeError, ScoreSchema, Score, RoundType, RoundSchema, RoundListSchema, RoundList, Round, RosterPlayerSchema, RosterPlayer, Result, QuarterScore, PlayerStatsQuery, PlayerStatsListSchema, PlayerStatsList, PlayerStatsItemSchema, PlayerStatsItem, PlayerStats, PlayerGameStatsSchema, PlayerGameStats, PeriodScoreSchema, PeriodScore, Ok, MatchStatus, MatchRosterSchema, MatchRoster, MatchResult, MatchQuery, MatchItemSchema, MatchItemListSchema, MatchItemList, MatchItem, LineupQuery, LineupPlayer, Lineup, LadderResponseSchema, LadderResponse, LadderQuery, LadderEntryRawSchema, LadderEntryRaw, LadderEntry, Ladder, FootyWireClientOptions, FootyWireClient, Fixture, Err, DataSource, CompseasonSchema, CompseasonListSchema, CompseasonList, Compseason, CompetitionSchema, CompetitionListSchema, CompetitionList, CompetitionCode, Competition, CfsVenueSchema, CfsVenue, CfsScoreSchema, CfsScore, CfsMatchTeamSchema, CfsMatchTeam, CfsMatchSchema, CfsMatch, AflTablesClientOptions, AflTablesClient, AflApiTokenSchema, AflApiToken, AflApiError, AflApiClientOptions, AflApiClient };
|