fitzroy 1.4.2 → 1.6.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/dist/cli.js +220 -102
- package/dist/index.d.ts +75 -15
- package/dist/index.js +209 -94
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ interface MatchResult {
|
|
|
56
56
|
readonly season: number;
|
|
57
57
|
readonly roundNumber: number;
|
|
58
58
|
readonly roundType: RoundType;
|
|
59
|
+
/** Human-readable round name (e.g. "Round 1", "Qualifying Final"). Null for scraped sources. */
|
|
60
|
+
readonly roundName: string | null;
|
|
59
61
|
readonly date: Date;
|
|
60
62
|
readonly venue: string;
|
|
61
63
|
readonly homeTeam: string;
|
|
@@ -80,6 +82,11 @@ interface MatchResult {
|
|
|
80
82
|
readonly q4Away: QuarterScore | null;
|
|
81
83
|
readonly status: MatchStatus;
|
|
82
84
|
readonly attendance: number | null;
|
|
85
|
+
/** Weather conditions at the venue (null when unavailable). */
|
|
86
|
+
readonly weatherTempCelsius: number | null;
|
|
87
|
+
readonly weatherType: string | null;
|
|
88
|
+
/** Normalised round code (e.g. "R1", "QF", "GF"). Null for scraped sources. */
|
|
89
|
+
readonly roundCode: string | null;
|
|
83
90
|
/** Venue metadata (null for scraped sources). */
|
|
84
91
|
readonly venueState: string | null;
|
|
85
92
|
readonly venueTimezone: string | null;
|
|
@@ -104,6 +111,10 @@ interface PlayerStats {
|
|
|
104
111
|
readonly roundNumber: number;
|
|
105
112
|
readonly team: string;
|
|
106
113
|
readonly competition: CompetitionCode;
|
|
114
|
+
/** Match context for cross-source joins (null when unavailable). */
|
|
115
|
+
readonly date: Date | null;
|
|
116
|
+
readonly homeTeam: string | null;
|
|
117
|
+
readonly awayTeam: string | null;
|
|
107
118
|
/** Player identification. */
|
|
108
119
|
readonly playerId: string;
|
|
109
120
|
readonly givenName: string;
|
|
@@ -149,7 +160,16 @@ interface PlayerStats {
|
|
|
149
160
|
readonly totalPossessions: number | null;
|
|
150
161
|
readonly timeOnGroundPercentage: number | null;
|
|
151
162
|
readonly ratingPoints: number | null;
|
|
163
|
+
/** Position played in this match (e.g. "INT", "MIDFIELD"). Null when unavailable. */
|
|
164
|
+
readonly position: string | null;
|
|
165
|
+
/** Efficiency stats. */
|
|
166
|
+
readonly goalEfficiency: number | null;
|
|
167
|
+
readonly shotEfficiency: number | null;
|
|
168
|
+
readonly interchangeCounts: number | null;
|
|
169
|
+
/** Brownlow votes received in this match (null when unavailable). */
|
|
170
|
+
readonly brownlowVotes: number | null;
|
|
152
171
|
/** Fantasy. */
|
|
172
|
+
readonly supercoachScore: number | null;
|
|
153
173
|
readonly dreamTeamPoints: number | null;
|
|
154
174
|
/** Extended stats. */
|
|
155
175
|
readonly effectiveDisposals: number | null;
|
|
@@ -297,7 +317,8 @@ interface PlayerDetails {
|
|
|
297
317
|
/** Query parameters for fetching player details. */
|
|
298
318
|
interface PlayerDetailsQuery {
|
|
299
319
|
readonly source: DataSource;
|
|
300
|
-
|
|
320
|
+
/** Team name. When omitted, returns details for all teams. */
|
|
321
|
+
readonly team?: string | undefined;
|
|
301
322
|
readonly season?: number | undefined;
|
|
302
323
|
readonly current?: boolean | undefined;
|
|
303
324
|
readonly competition?: CompetitionCode | undefined;
|
|
@@ -505,8 +526,9 @@ declare function fetchMatchResults(query: SeasonRoundQuery): Promise<Result<Matc
|
|
|
505
526
|
* Fetch player biographical details (DOB, height, draft info, etc.).
|
|
506
527
|
*
|
|
507
528
|
* Dispatches to the appropriate data source based on `query.source`.
|
|
529
|
+
* When `query.team` is omitted, returns details for all teams.
|
|
508
530
|
*
|
|
509
|
-
* @param query -
|
|
531
|
+
* @param query - Source, optional team name, and optional season/competition filters.
|
|
510
532
|
* @returns Array of player details.
|
|
511
533
|
*
|
|
512
534
|
* @example
|
|
@@ -1085,6 +1107,11 @@ declare const MatchItemSchema: z2.ZodObject<{
|
|
|
1085
1107
|
roundId: z2.ZodString;
|
|
1086
1108
|
roundNumber: z2.ZodNumber;
|
|
1087
1109
|
}, z2.core.$loose>>;
|
|
1110
|
+
attendance: z2.ZodOptional<z2.ZodNullable<z2.ZodNumber>>;
|
|
1111
|
+
weather: z2.ZodOptional<z2.ZodNullable<z2.ZodObject<{
|
|
1112
|
+
tempInCelsius: z2.ZodOptional<z2.ZodNullable<z2.ZodNumber>>;
|
|
1113
|
+
weatherType: z2.ZodOptional<z2.ZodNullable<z2.ZodString>>;
|
|
1114
|
+
}, z2.core.$loose>>>;
|
|
1088
1115
|
}, z2.core.$loose>;
|
|
1089
1116
|
/** Schema for the match items (round results) response. */
|
|
1090
1117
|
declare const MatchItemListSchema: z2.ZodObject<{
|
|
@@ -1165,6 +1192,11 @@ declare const MatchItemListSchema: z2.ZodObject<{
|
|
|
1165
1192
|
roundId: z2.ZodString;
|
|
1166
1193
|
roundNumber: z2.ZodNumber;
|
|
1167
1194
|
}, z2.core.$loose>>;
|
|
1195
|
+
attendance: z2.ZodOptional<z2.ZodNullable<z2.ZodNumber>>;
|
|
1196
|
+
weather: z2.ZodOptional<z2.ZodNullable<z2.ZodObject<{
|
|
1197
|
+
tempInCelsius: z2.ZodOptional<z2.ZodNullable<z2.ZodNumber>>;
|
|
1198
|
+
weatherType: z2.ZodOptional<z2.ZodNullable<z2.ZodString>>;
|
|
1199
|
+
}, z2.core.$loose>>>;
|
|
1168
1200
|
}, z2.core.$loose>>;
|
|
1169
1201
|
}, z2.core.$loose>;
|
|
1170
1202
|
/** Inferred type for a single match item. */
|
|
@@ -1209,6 +1241,10 @@ declare const PlayerGameStatsSchema: z2.ZodObject<{
|
|
|
1209
1241
|
metresGained: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1210
1242
|
scoreInvolvements: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1211
1243
|
ratingPoints: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1244
|
+
goalEfficiency: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1245
|
+
shotEfficiency: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1246
|
+
interchangeCounts: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1247
|
+
brownlowVotes: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1212
1248
|
extendedStats: z2.ZodOptional<z2.ZodNullable<z2.ZodObject<{
|
|
1213
1249
|
effectiveDisposals: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1214
1250
|
effectiveKicks: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
@@ -1294,6 +1330,10 @@ declare const PlayerStatsItemSchema: z2.ZodObject<{
|
|
|
1294
1330
|
metresGained: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1295
1331
|
scoreInvolvements: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1296
1332
|
ratingPoints: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1333
|
+
goalEfficiency: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1334
|
+
shotEfficiency: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1335
|
+
interchangeCounts: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1336
|
+
brownlowVotes: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1297
1337
|
extendedStats: z2.ZodOptional<z2.ZodNullable<z2.ZodObject<{
|
|
1298
1338
|
effectiveDisposals: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1299
1339
|
effectiveKicks: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
@@ -1328,7 +1368,7 @@ declare const PlayerStatsItemSchema: z2.ZodObject<{
|
|
|
1328
1368
|
}, z2.core.$loose>;
|
|
1329
1369
|
/** Schema for the player stats response. */
|
|
1330
1370
|
declare const PlayerStatsListSchema: z2.ZodObject<{
|
|
1331
|
-
homeTeamPlayerStats: z2.ZodArray<z2.ZodObject<{
|
|
1371
|
+
homeTeamPlayerStats: z2.ZodDefault<z2.ZodNullable<z2.ZodArray<z2.ZodObject<{
|
|
1332
1372
|
player: z2.ZodObject<{
|
|
1333
1373
|
player: z2.ZodObject<{
|
|
1334
1374
|
position: z2.ZodOptional<z2.ZodString>;
|
|
@@ -1383,6 +1423,10 @@ declare const PlayerStatsListSchema: z2.ZodObject<{
|
|
|
1383
1423
|
metresGained: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1384
1424
|
scoreInvolvements: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1385
1425
|
ratingPoints: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1426
|
+
goalEfficiency: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1427
|
+
shotEfficiency: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1428
|
+
interchangeCounts: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1429
|
+
brownlowVotes: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1386
1430
|
extendedStats: z2.ZodOptional<z2.ZodNullable<z2.ZodObject<{
|
|
1387
1431
|
effectiveDisposals: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1388
1432
|
effectiveKicks: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
@@ -1414,8 +1458,8 @@ declare const PlayerStatsListSchema: z2.ZodObject<{
|
|
|
1414
1458
|
}, z2.core.$loose>;
|
|
1415
1459
|
timeOnGroundPercentage: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1416
1460
|
}, z2.core.$loose>>>;
|
|
1417
|
-
}, z2.core.$loose
|
|
1418
|
-
awayTeamPlayerStats: z2.ZodArray<z2.ZodObject<{
|
|
1461
|
+
}, z2.core.$loose>>>>;
|
|
1462
|
+
awayTeamPlayerStats: z2.ZodDefault<z2.ZodNullable<z2.ZodArray<z2.ZodObject<{
|
|
1419
1463
|
player: z2.ZodObject<{
|
|
1420
1464
|
player: z2.ZodObject<{
|
|
1421
1465
|
position: z2.ZodOptional<z2.ZodString>;
|
|
@@ -1470,6 +1514,10 @@ declare const PlayerStatsListSchema: z2.ZodObject<{
|
|
|
1470
1514
|
metresGained: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1471
1515
|
scoreInvolvements: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1472
1516
|
ratingPoints: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1517
|
+
goalEfficiency: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1518
|
+
shotEfficiency: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1519
|
+
interchangeCounts: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1520
|
+
brownlowVotes: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1473
1521
|
extendedStats: z2.ZodOptional<z2.ZodNullable<z2.ZodObject<{
|
|
1474
1522
|
effectiveDisposals: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1475
1523
|
effectiveKicks: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
@@ -1501,7 +1549,7 @@ declare const PlayerStatsListSchema: z2.ZodObject<{
|
|
|
1501
1549
|
}, z2.core.$loose>;
|
|
1502
1550
|
timeOnGroundPercentage: z2.ZodOptional<z2.ZodNullable<z2.ZodUnion<readonly [z2.ZodNumber, z2.ZodPipe<z2.ZodString, z2.ZodTransform<number | null, string>>, z2.ZodPipe<z2.ZodBoolean, z2.ZodTransform<1 | 0, boolean>>]>>>;
|
|
1503
1551
|
}, z2.core.$loose>>>;
|
|
1504
|
-
}, z2.core.$loose
|
|
1552
|
+
}, z2.core.$loose>>>>;
|
|
1505
1553
|
}, z2.core.$loose>;
|
|
1506
1554
|
/** Inferred type for a single player stats item. */
|
|
1507
1555
|
type PlayerStatsItem = z2.infer<typeof PlayerStatsItemSchema>;
|
|
@@ -2065,12 +2113,15 @@ declare class FootyWireClient {
|
|
|
2065
2113
|
/**
|
|
2066
2114
|
* Fetch match IDs from a season's match list page.
|
|
2067
2115
|
*
|
|
2068
|
-
* Extracts `mid=XXXX` values from score links.
|
|
2116
|
+
* Extracts `mid=XXXX` values from score links alongside round numbers.
|
|
2069
2117
|
*
|
|
2070
2118
|
* @param year - The season year.
|
|
2071
|
-
* @returns Array of match ID
|
|
2119
|
+
* @returns Array of match ID + round number pairs.
|
|
2072
2120
|
*/
|
|
2073
|
-
fetchSeasonMatchIds(year: number): Promise<Result<
|
|
2121
|
+
fetchSeasonMatchIds(year: number): Promise<Result<Array<{
|
|
2122
|
+
matchId: string;
|
|
2123
|
+
roundNumber: number;
|
|
2124
|
+
}>, ScrapeError>>;
|
|
2074
2125
|
/**
|
|
2075
2126
|
* Fetch player list (team history) from FootyWire.
|
|
2076
2127
|
*
|
|
@@ -2177,17 +2228,26 @@ declare function inferRoundType(roundName: string): RoundType;
|
|
|
2177
2228
|
* @returns Flattened, normalised MatchResult array.
|
|
2178
2229
|
*/
|
|
2179
2230
|
declare function transformMatchItems(items: readonly MatchItem[], season: number, competition: CompetitionCode, source?: DataSource): MatchResult[];
|
|
2231
|
+
/** Context for a single match transform. */
|
|
2232
|
+
interface TransformContext {
|
|
2233
|
+
readonly matchId: string;
|
|
2234
|
+
readonly season: number;
|
|
2235
|
+
readonly roundNumber: number;
|
|
2236
|
+
readonly competition: CompetitionCode;
|
|
2237
|
+
readonly source: DataSource;
|
|
2238
|
+
readonly teamIdMap?: ReadonlyMap<string, string>;
|
|
2239
|
+
readonly date?: Date | null;
|
|
2240
|
+
readonly homeTeam?: string | null;
|
|
2241
|
+
readonly awayTeam?: string | null;
|
|
2242
|
+
}
|
|
2180
2243
|
/**
|
|
2181
2244
|
* Transform raw AFL API player stats list into typed PlayerStats objects.
|
|
2182
2245
|
*
|
|
2183
2246
|
* @param data - Raw player stats response with home/away arrays.
|
|
2184
|
-
* @param
|
|
2185
|
-
* @param season - The season year.
|
|
2186
|
-
* @param roundNumber - The round number.
|
|
2187
|
-
* @param competition - The competition code.
|
|
2247
|
+
* @param ctx - Match context (IDs, season, round, source, team mappings, match metadata).
|
|
2188
2248
|
* @returns Flattened PlayerStats array (home players first, then away).
|
|
2189
2249
|
*/
|
|
2190
|
-
declare function transformPlayerStats(data: PlayerStatsList,
|
|
2250
|
+
declare function transformPlayerStats(data: PlayerStatsList, ctx: TransformContext): PlayerStats[];
|
|
2191
2251
|
/**
|
|
2192
2252
|
* Transform Squiggle games into MatchResult objects.
|
|
2193
2253
|
*
|
|
@@ -2204,4 +2264,4 @@ declare function transformSquiggleGamesToFixture(games: readonly SquiggleGame[],
|
|
|
2204
2264
|
* Transform Squiggle standings into LadderEntry objects.
|
|
2205
2265
|
*/
|
|
2206
2266
|
declare function transformSquiggleStandings(standings: readonly SquiggleStanding[]): LadderEntry[];
|
|
2207
|
-
export { transformSquiggleStandings, transformSquiggleGamesToResults, transformSquiggleGamesToFixture, transformPlayerStats, transformMatchRoster, transformMatchItems, transformLadderEntries, toAestString, parseFootyWireDate, parseAflTablesDate, parseAflApiDate, ok, normaliseVenueName, normaliseTeamName, inferRoundType, fetchTeams2 as fetchTeams, fetchTeamStats2 as fetchTeamStats, fetchSquad2 as fetchSquad, fetchPlayerStats2 as fetchPlayerStats, fetchPlayerDetails, fetchMatchResults, fetchLineup, fetchLadder2 as fetchLadder, fetchFryziggStats, fetchFixture, fetchCoachesVotes, fetchAwards, err, computeLadder, ValidationError, UnsupportedSourceError, TeamStatsSummaryType, TeamStatsQuery, TeamStatsEntry, TeamScoreSchema, TeamScore, TeamQuery, TeamPlayersSchema, TeamPlayers, TeamListSchema, TeamList, TeamItemSchema, TeamItem, Team, SquiggleStandingsResponseSchema, SquiggleStandingsResponse, SquiggleStandingSchema, SquiggleStanding, SquiggleGamesResponseSchema, SquiggleGamesResponse, SquiggleGameSchema, SquiggleGame, SquiggleClientOptions, SquiggleClient, SquadSchema, SquadQuery, SquadPlayerItemSchema, SquadPlayerItem, SquadPlayerInnerSchema, SquadPlayer, SquadListSchema, SquadList, Squad, SeasonRoundQuery, ScrapeError, ScoreSchema, Score, RoundType, RoundSchema, RoundListSchema, RoundList, Round, RosterPlayerSchema, RosterPlayer, RisingStarNomination, Result, QuarterScore, PlayerStatsQuery, PlayerStatsListSchema, PlayerStatsList, PlayerStatsItemSchema, PlayerStatsItem, PlayerStats, PlayerGameStatsSchema, PlayerGameStats, PlayerDetailsQuery, PlayerDetails, 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, CoachesVoteQuery, CoachesVote, CfsVenueSchema, CfsVenue, CfsScoreSchema, CfsScore, CfsMatchTeamSchema, CfsMatchTeam, CfsMatchSchema, CfsMatch, BrownlowVote, AwardType, AwardQuery, Award, AllAustralianSelection, AflTablesClientOptions, AflTablesClient, AflCoachesClientOptions, AflCoachesClient, AflApiTokenSchema, AflApiToken, AflApiError, AflApiClientOptions, AflApiClient };
|
|
2267
|
+
export { transformSquiggleStandings, transformSquiggleGamesToResults, transformSquiggleGamesToFixture, transformPlayerStats, transformMatchRoster, transformMatchItems, transformLadderEntries, toAestString, parseFootyWireDate, parseAflTablesDate, parseAflApiDate, ok, normaliseVenueName, normaliseTeamName, inferRoundType, fetchTeams2 as fetchTeams, fetchTeamStats2 as fetchTeamStats, fetchSquad2 as fetchSquad, fetchPlayerStats2 as fetchPlayerStats, fetchPlayerDetails, fetchMatchResults, fetchLineup, fetchLadder2 as fetchLadder, fetchFryziggStats, fetchFixture, fetchCoachesVotes, fetchAwards, err, computeLadder, ValidationError, UnsupportedSourceError, TransformContext, TeamStatsSummaryType, TeamStatsQuery, TeamStatsEntry, TeamScoreSchema, TeamScore, TeamQuery, TeamPlayersSchema, TeamPlayers, TeamListSchema, TeamList, TeamItemSchema, TeamItem, Team, SquiggleStandingsResponseSchema, SquiggleStandingsResponse, SquiggleStandingSchema, SquiggleStanding, SquiggleGamesResponseSchema, SquiggleGamesResponse, SquiggleGameSchema, SquiggleGame, SquiggleClientOptions, SquiggleClient, SquadSchema, SquadQuery, SquadPlayerItemSchema, SquadPlayerItem, SquadPlayerInnerSchema, SquadPlayer, SquadListSchema, SquadList, Squad, SeasonRoundQuery, ScrapeError, ScoreSchema, Score, RoundType, RoundSchema, RoundListSchema, RoundList, Round, RosterPlayerSchema, RosterPlayer, RisingStarNomination, Result, QuarterScore, PlayerStatsQuery, PlayerStatsListSchema, PlayerStatsList, PlayerStatsItemSchema, PlayerStatsItem, PlayerStats, PlayerGameStatsSchema, PlayerGameStats, PlayerDetailsQuery, PlayerDetails, 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, CoachesVoteQuery, CoachesVote, CfsVenueSchema, CfsVenue, CfsScoreSchema, CfsScore, CfsMatchTeamSchema, CfsMatchTeam, CfsMatchSchema, CfsMatch, BrownlowVote, AwardType, AwardQuery, Award, AllAustralianSelection, AflTablesClientOptions, AflTablesClient, AflCoachesClientOptions, AflCoachesClient, AflApiTokenSchema, AflApiToken, AflApiError, AflApiClientOptions, AflApiClient };
|