nhl-api-ts 0.2.1 → 0.3.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/README.md +72 -5
- package/dist/api/draft.d.mts +61 -0
- package/dist/api/draft.mjs +68 -0
- package/dist/api/edge.d.mts +198 -1
- package/dist/api/edge.mjs +207 -4
- package/dist/api/game-center.d.mts +49 -1
- package/dist/api/game-center.mjs +47 -0
- package/dist/api/misc.d.mts +115 -1
- package/dist/api/misc.mjs +147 -2
- package/dist/api/players.d.mts +55 -3
- package/dist/api/players.mjs +80 -3
- package/dist/api/query/cayenne.d.mts +4 -0
- package/dist/api/query/cayenne.mjs +13 -0
- package/dist/api/query/sorting/sorting-options.d.mts +8 -0
- package/dist/api/query/sorting/sorting-options.mjs +30 -0
- package/dist/api/schedule.d.mts +19 -6
- package/dist/api/schedule.mjs +17 -5
- package/dist/api/stats.d.mts +95 -6
- package/dist/api/stats.mjs +130 -30
- package/dist/api/teams.d.mts +43 -3
- package/dist/api/teams.mjs +51 -3
- package/dist/cli/commands.mjs +487 -22
- package/dist/http-client.d.mts +2 -1
- package/dist/http-client.mjs +8 -1
- package/dist/index.d.mts +8 -2
- package/dist/index.mjs +3 -0
- package/dist/nhl-client.d.mts +69 -14
- package/dist/nhl-client.mjs +33 -12
- package/dist/types/draft.d.mts +97 -0
- package/dist/types/draft.mjs +1 -0
- package/dist/types/edge.d.mts +299 -3
- package/dist/types/game-center.d.mts +223 -8
- package/dist/types/index.d.mts +1 -0
- package/dist/types/misc.d.mts +101 -0
- package/dist/types/misc.mjs +0 -1
- package/dist/types/players.d.mts +22 -0
- package/dist/types/schedule.d.mts +16 -0
- package/dist/types/stats.d.mts +207 -1
- package/dist/types/teams.d.mts +29 -1
- package/package.json +1 -1
package/dist/nhl-client.d.mts
CHANGED
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import { type GoalieStatsSummaryParams, type SkaterStatsWithQueryContextParams, statsApi } from '#src/api/stats.mjs';
|
|
2
1
|
import { type ClientOptions } from '#src/config.mjs';
|
|
3
2
|
import type { Context } from '#src/context.mjs';
|
|
4
|
-
import type { GoalieReportRows, SkaterReportRows, StatsApiPage } from '#src/types/index.mjs';
|
|
5
3
|
type Bound<Module> = {
|
|
6
4
|
[Method in keyof Module]: Module[Method] extends (ctx: Context, ...args: infer Args) => infer MethodResponse ? (...args: Args) => MethodResponse : never;
|
|
7
5
|
};
|
|
8
|
-
/**
|
|
9
|
-
* `Bound` erases generic parameters, so the report-typed stats methods are
|
|
10
|
-
* spelled out here (without `ctx`) to keep `reportType` / `statsType`
|
|
11
|
-
* flowing into the row type.
|
|
12
|
-
*/
|
|
13
|
-
interface StatsGenericMethods {
|
|
14
|
-
skaterStatsWithQueryContext<Report extends keyof SkaterReportRows>(params: SkaterStatsWithQueryContextParams<Report>): Promise<StatsApiPage<SkaterReportRows[Report]>>;
|
|
15
|
-
goalieStatsSummary<Report extends keyof GoalieReportRows = 'summary'>(params: GoalieStatsSummaryParams<Report>): Promise<GoalieReportRows[Report][]>;
|
|
16
|
-
}
|
|
17
|
-
type StatsClient = Omit<Bound<typeof statsApi>, 'skaterStatsWithQueryContext' | 'goalieStatsSummary'> & StatsGenericMethods;
|
|
18
6
|
/**
|
|
19
7
|
* Builds the main client used to access the NHL API.
|
|
20
8
|
*
|
|
21
9
|
* @example
|
|
22
10
|
* const client = createNHLClient();
|
|
23
|
-
* const client = createNHLClient({ debug: true }); // for a
|
|
11
|
+
* const client = createNHLClient({ debug: true }); // for a little extra logging
|
|
24
12
|
* const teams = await client.teams.teams();
|
|
25
13
|
*/
|
|
26
14
|
export declare function createNHLClient(options?: ClientOptions): {
|
|
@@ -28,7 +16,11 @@ export declare function createNHLClient(options?: ClientOptions): {
|
|
|
28
16
|
readonly teams: Bound<{
|
|
29
17
|
readonly teams: typeof import("#src/api/teams.mjs").teams;
|
|
30
18
|
readonly teamRoster: typeof import("#src/api/teams.mjs").teamRoster;
|
|
19
|
+
readonly rosterSeasons: typeof import("#src/api/teams.mjs").rosterSeasons;
|
|
20
|
+
readonly teamScoreboard: typeof import("#src/api/teams.mjs").teamScoreboard;
|
|
31
21
|
readonly franchises: typeof import("#src/api/teams.mjs").franchises;
|
|
22
|
+
readonly statsTeams: typeof import("#src/api/teams.mjs").statsTeams;
|
|
23
|
+
readonly teamById: typeof import("#src/api/teams.mjs").teamById;
|
|
32
24
|
}>;
|
|
33
25
|
readonly standings: Bound<{
|
|
34
26
|
readonly leagueStandings: typeof import("#src/api/standings.mjs").leagueStandings;
|
|
@@ -43,6 +35,7 @@ export declare function createNHLClient(options?: ClientOptions): {
|
|
|
43
35
|
readonly calendarSchedule: typeof import("#src/api/schedule.mjs").calendarSchedule;
|
|
44
36
|
readonly playoffCarousel: typeof import("#src/api/schedule.mjs").playoffCarousel;
|
|
45
37
|
readonly playoffSeriesSchedule: typeof import("#src/api/schedule.mjs").playoffSeriesSchedule;
|
|
38
|
+
readonly playoffSeriesMeta: typeof import("#src/api/schedule.mjs").playoffSeriesMeta;
|
|
46
39
|
readonly playoffBracket: typeof import("#src/api/schedule.mjs").playoffBracket;
|
|
47
40
|
}>;
|
|
48
41
|
readonly gameCenter: Bound<{
|
|
@@ -53,14 +46,54 @@ export declare function createNHLClient(options?: ClientOptions): {
|
|
|
53
46
|
readonly shiftChartData: typeof import("#src/api/game-center.mjs").shiftChartData;
|
|
54
47
|
readonly seasonSeriesMatchup: typeof import("#src/api/game-center.mjs").seasonSeriesMatchup;
|
|
55
48
|
readonly gameStory: typeof import("#src/api/game-center.mjs").gameStory;
|
|
49
|
+
readonly scoreboard: typeof import("#src/api/game-center.mjs").scoreboard;
|
|
50
|
+
readonly wscPlayByPlay: typeof import("#src/api/game-center.mjs").wscPlayByPlay;
|
|
51
|
+
readonly playReplay: typeof import("#src/api/game-center.mjs").playReplay;
|
|
52
|
+
readonly gameMeta: typeof import("#src/api/game-center.mjs").gameMeta;
|
|
56
53
|
}>;
|
|
57
|
-
readonly stats:
|
|
54
|
+
readonly stats: {
|
|
55
|
+
readonly gametypesPerSeasonDirectoryByTeam: (args_0: {
|
|
56
|
+
teamAbbr: string;
|
|
57
|
+
}) => Promise<import("./index.mjs").ClubStatsSeason[]>;
|
|
58
|
+
readonly playerCareerStats: (args_0: {
|
|
59
|
+
playerId: import("#src/utils.mjs").Id;
|
|
60
|
+
}) => Promise<import("./index.mjs").PlayerLanding>;
|
|
61
|
+
readonly playerGameLog: (args_0: {
|
|
62
|
+
playerId: import("#src/utils.mjs").Id;
|
|
63
|
+
seasonId?: import("#src/utils.mjs").Id;
|
|
64
|
+
gameType?: number;
|
|
65
|
+
}) => Promise<import("./index.mjs").GameLogEntry[]>;
|
|
66
|
+
readonly skaterStatsLeaders: (params?: import("#src/api/stats.mjs").StatsLeadersParams<import("./index.mjs").OpenUnion<import("./index.mjs").SkaterLeaderCategory>> | undefined) => Promise<import("./index.mjs").SkaterStatsLeaders>;
|
|
67
|
+
readonly goalieStatsLeaders: (params?: import("#src/api/stats.mjs").StatsLeadersParams<import("./index.mjs").OpenUnion<import("./index.mjs").GoalieLeaderCategory>> | undefined) => Promise<import("./index.mjs").GoalieStatsLeaders>;
|
|
68
|
+
readonly clubStats: (args_0: {
|
|
69
|
+
teamAbbr: string;
|
|
70
|
+
season?: import("#src/utils.mjs").Id;
|
|
71
|
+
gameType?: number;
|
|
72
|
+
}) => Promise<import("./index.mjs").ClubStats>;
|
|
73
|
+
readonly teamSummary: (args_0: import("#src/api/stats.mjs").TeamSummaryParams) => Promise<import("./index.mjs").TeamSummaryRow[]>;
|
|
74
|
+
readonly skaterStatsSummary: (args_0: import("#src/api/stats.mjs").SkaterStatsSummaryParams) => Promise<import("./index.mjs").SkaterSummaryRow[]>;
|
|
75
|
+
readonly skaterMilestones: () => Promise<import("./index.mjs").SkaterMilestone[]>;
|
|
76
|
+
readonly goalieMilestones: () => Promise<import("./index.mjs").GoalieMilestone[]>;
|
|
77
|
+
readonly skaterStatsWithQueryContext: <Report extends keyof import("./index.mjs").SkaterReportRows>(args_0: import("#src/api/stats.mjs").SkaterStatsWithQueryContextParams<Report>) => Promise<import("./index.mjs").StatsApiPage<import("./index.mjs").SkaterReportRows[Report]>>;
|
|
78
|
+
readonly goalieStatsSummary: <Report extends keyof import("./index.mjs").GoalieReportRows = "summary">(args_0: import("#src/api/stats.mjs").GoalieStatsSummaryParams<Report>) => Promise<import("./index.mjs").GoalieReportRows[Report][]>;
|
|
79
|
+
readonly skaterLeaders: <Attribute extends keyof import("./index.mjs").SkaterLeaderRows>(params: import("#src/api/stats.mjs").StatsApiLeadersParams<Attribute>) => Promise<import("./index.mjs").SkaterLeaderRows[Attribute][]>;
|
|
80
|
+
readonly goalieLeaders: <Attribute extends keyof import("./index.mjs").GoalieLeaderRows>(params: import("#src/api/stats.mjs").StatsApiLeadersParams<Attribute>) => Promise<import("./index.mjs").GoalieLeaderRows[Attribute][]>;
|
|
81
|
+
};
|
|
58
82
|
readonly misc: Bound<{
|
|
59
83
|
readonly glossary: typeof import("#src/api/misc.mjs").glossary;
|
|
60
84
|
readonly config: typeof import("#src/api/misc.mjs").config;
|
|
61
85
|
readonly countries: typeof import("#src/api/misc.mjs").countries;
|
|
62
86
|
readonly seasonSpecificRulesAndInfo: typeof import("#src/api/misc.mjs").seasonSpecificRulesAndInfo;
|
|
63
87
|
readonly draftYearAndRounds: typeof import("#src/api/misc.mjs").draftYearAndRounds;
|
|
88
|
+
readonly componentSeasons: typeof import("#src/api/misc.mjs").componentSeasons;
|
|
89
|
+
readonly games: typeof import("#src/api/misc.mjs").games;
|
|
90
|
+
readonly tvSchedule: typeof import("#src/api/misc.mjs").tvSchedule;
|
|
91
|
+
readonly partnerGameOdds: typeof import("#src/api/misc.mjs").partnerGameOdds;
|
|
92
|
+
readonly seasonIds: typeof import("#src/api/misc.mjs").seasonIds;
|
|
93
|
+
readonly meta: typeof import("#src/api/misc.mjs").meta;
|
|
94
|
+
readonly location: typeof import("#src/api/misc.mjs").location;
|
|
95
|
+
readonly postalLookup: typeof import("#src/api/misc.mjs").postalLookup;
|
|
96
|
+
readonly ping: typeof import("#src/api/misc.mjs").ping;
|
|
64
97
|
}>;
|
|
65
98
|
readonly helpers: Bound<{
|
|
66
99
|
readonly gameIdsBySeason: typeof import("#src/api/helpers.mjs").gameIdsBySeason;
|
|
@@ -70,6 +103,8 @@ export declare function createNHLClient(options?: ClientOptions): {
|
|
|
70
103
|
readonly players: Bound<{
|
|
71
104
|
readonly prospectsByTeam: typeof import("#src/api/players.mjs").prospectsByTeam;
|
|
72
105
|
readonly playersByTeam: typeof import("#src/api/players.mjs").playersByTeam;
|
|
106
|
+
readonly playerSpotlight: typeof import("#src/api/players.mjs").playerSpotlight;
|
|
107
|
+
readonly playerSearch: typeof import("#src/api/players.mjs").playerSearch;
|
|
73
108
|
}>;
|
|
74
109
|
readonly edge: Bound<{
|
|
75
110
|
readonly skaterDetail: typeof import("#src/api/edge.mjs").skaterDetail;
|
|
@@ -95,6 +130,26 @@ export declare function createNHLClient(options?: ClientOptions): {
|
|
|
95
130
|
readonly teamLanding: typeof import("#src/api/edge.mjs").teamLanding;
|
|
96
131
|
readonly teamShotSpeedDetail: typeof import("#src/api/edge.mjs").teamShotSpeedDetail;
|
|
97
132
|
readonly teamSkatingSpeedDetail: typeof import("#src/api/edge.mjs").teamSkatingSpeedDetail;
|
|
133
|
+
readonly skaterDistanceTop10: typeof import("#src/api/edge.mjs").skaterDistanceTop10;
|
|
134
|
+
readonly skaterSpeedTop10: typeof import("#src/api/edge.mjs").skaterSpeedTop10;
|
|
135
|
+
readonly skaterZoneTimeTop10: typeof import("#src/api/edge.mjs").skaterZoneTimeTop10;
|
|
136
|
+
readonly skaterShotSpeedTop10: typeof import("#src/api/edge.mjs").skaterShotSpeedTop10;
|
|
137
|
+
readonly skaterShotLocationTop10: typeof import("#src/api/edge.mjs").skaterShotLocationTop10;
|
|
138
|
+
readonly goalie5v5Top10: typeof import("#src/api/edge.mjs").goalie5v5Top10;
|
|
139
|
+
readonly goalieShotLocationTop10: typeof import("#src/api/edge.mjs").goalieShotLocationTop10;
|
|
140
|
+
readonly goalieSavePercentageTop10: typeof import("#src/api/edge.mjs").goalieSavePercentageTop10;
|
|
141
|
+
readonly teamSkatingDistanceTop10: typeof import("#src/api/edge.mjs").teamSkatingDistanceTop10;
|
|
142
|
+
readonly teamSkatingSpeedTop10: typeof import("#src/api/edge.mjs").teamSkatingSpeedTop10;
|
|
143
|
+
readonly teamZoneTimeTop10: typeof import("#src/api/edge.mjs").teamZoneTimeTop10;
|
|
144
|
+
readonly teamShotSpeedTop10: typeof import("#src/api/edge.mjs").teamShotSpeedTop10;
|
|
145
|
+
readonly teamShotLocationTop10: typeof import("#src/api/edge.mjs").teamShotLocationTop10;
|
|
146
|
+
readonly teamComparison: typeof import("#src/api/edge.mjs").teamComparison;
|
|
147
|
+
readonly byTheNumbers: typeof import("#src/api/edge.mjs").byTheNumbers;
|
|
148
|
+
}>;
|
|
149
|
+
readonly draft: Bound<{
|
|
150
|
+
readonly rankings: typeof import("#src/api/draft.mjs").rankings;
|
|
151
|
+
readonly tracker: typeof import("#src/api/draft.mjs").tracker;
|
|
152
|
+
readonly picks: typeof import("#src/api/draft.mjs").picks;
|
|
98
153
|
}>;
|
|
99
154
|
};
|
|
100
155
|
export type NHLClient = ReturnType<typeof createNHLClient>;
|
package/dist/nhl-client.mjs
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { draftApi } from '#src/api/draft.mjs';
|
|
1
2
|
import { edgeApi } from '#src/api/edge.mjs';
|
|
2
3
|
import { gameCenterApi } from '#src/api/game-center.mjs';
|
|
3
4
|
import { helpersApi } from '#src/api/helpers.mjs';
|
|
@@ -5,23 +6,36 @@ import { miscApi } from '#src/api/misc.mjs';
|
|
|
5
6
|
import { playersApi } from '#src/api/players.mjs';
|
|
6
7
|
import { scheduleApi } from '#src/api/schedule.mjs';
|
|
7
8
|
import { standingsApi } from '#src/api/standings.mjs';
|
|
8
|
-
import { statsApi
|
|
9
|
+
import { statsApi } from '#src/api/stats.mjs';
|
|
9
10
|
import { teamsApi } from '#src/api/teams.mjs';
|
|
10
11
|
import { resolveConfig } from '#src/config.mjs';
|
|
11
12
|
import { createGet } from '#src/http-client.mjs';
|
|
12
13
|
import { sleep } from '#src/utils.mjs';
|
|
13
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Binds `ctx` to every function in an API module. Generic methods lose their
|
|
16
|
+
* type parameters here (they're instantiated with their constraints), so
|
|
17
|
+
* override those with `bindFn`.
|
|
18
|
+
*/
|
|
19
|
+
function bindModule(ctx, api) {
|
|
14
20
|
return Object.fromEntries(Object.entries(api).map(([key, fn]) => [
|
|
15
21
|
key,
|
|
16
22
|
(...args) => fn(ctx, ...args),
|
|
17
23
|
]));
|
|
18
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* Binds `ctx` to a single function. Keeps its generics through higher-order
|
|
27
|
+
* function inference, e.g. so `reportType` / `statsType` still decide the
|
|
28
|
+
* row type.
|
|
29
|
+
*/
|
|
30
|
+
function bindFn(ctx, fn) {
|
|
31
|
+
return (...args) => fn(ctx, ...args);
|
|
32
|
+
}
|
|
19
33
|
/**
|
|
20
34
|
* Builds the main client used to access the NHL API.
|
|
21
35
|
*
|
|
22
36
|
* @example
|
|
23
37
|
* const client = createNHLClient();
|
|
24
|
-
* const client = createNHLClient({ debug: true }); // for a
|
|
38
|
+
* const client = createNHLClient({ debug: true }); // for a little extra logging
|
|
25
39
|
* const teams = await client.teams.teams();
|
|
26
40
|
*/
|
|
27
41
|
export function createNHLClient(options = {}) {
|
|
@@ -29,14 +43,21 @@ export function createNHLClient(options = {}) {
|
|
|
29
43
|
const ctx = { get: createGet(config), sleep };
|
|
30
44
|
return {
|
|
31
45
|
config,
|
|
32
|
-
teams:
|
|
33
|
-
standings:
|
|
34
|
-
schedule:
|
|
35
|
-
gameCenter:
|
|
36
|
-
stats:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
teams: bindModule(ctx, teamsApi),
|
|
47
|
+
standings: bindModule(ctx, standingsApi),
|
|
48
|
+
schedule: bindModule(ctx, scheduleApi),
|
|
49
|
+
gameCenter: bindModule(ctx, gameCenterApi),
|
|
50
|
+
stats: {
|
|
51
|
+
...bindModule(ctx, statsApi),
|
|
52
|
+
skaterStatsWithQueryContext: bindFn(ctx, statsApi.skaterStatsWithQueryContext),
|
|
53
|
+
goalieStatsSummary: bindFn(ctx, statsApi.goalieStatsSummary),
|
|
54
|
+
skaterLeaders: bindFn(ctx, statsApi.skaterLeaders),
|
|
55
|
+
goalieLeaders: bindFn(ctx, statsApi.goalieLeaders),
|
|
56
|
+
},
|
|
57
|
+
misc: bindModule(ctx, miscApi),
|
|
58
|
+
helpers: bindModule(ctx, helpersApi),
|
|
59
|
+
players: bindModule(ctx, playersApi),
|
|
60
|
+
edge: bindModule(ctx, edgeApi),
|
|
61
|
+
draft: bindModule(ctx, draftApi),
|
|
41
62
|
};
|
|
42
63
|
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { LocalizedString, OpenUnion } from '#src/types/common.mjs';
|
|
2
|
+
/** Draft prospect position. Wingers are LW / RW here, not L / R. */
|
|
3
|
+
export type DraftPositionCode = OpenUnion<'C' | 'LW' | 'RW' | 'D' | 'G'>;
|
|
4
|
+
export interface DraftRankingCategory {
|
|
5
|
+
id: number;
|
|
6
|
+
name: string;
|
|
7
|
+
consumerKey: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DraftProspect {
|
|
10
|
+
lastName: string;
|
|
11
|
+
firstName: string;
|
|
12
|
+
positionCode: DraftPositionCode;
|
|
13
|
+
shootsCatches: OpenUnion<'L' | 'R'>;
|
|
14
|
+
heightInInches: number;
|
|
15
|
+
weightInPounds: number;
|
|
16
|
+
lastAmateurClub?: string;
|
|
17
|
+
lastAmateurLeague?: string;
|
|
18
|
+
birthDate: string;
|
|
19
|
+
birthCity: string;
|
|
20
|
+
birthStateProvince?: string;
|
|
21
|
+
birthCountry: string;
|
|
22
|
+
midtermRank?: number;
|
|
23
|
+
finalRank?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface DraftRankings {
|
|
26
|
+
/** Draft year in YYYY format. */
|
|
27
|
+
draftYear: number;
|
|
28
|
+
categoryId: number;
|
|
29
|
+
categoryKey: string;
|
|
30
|
+
draftYears: number[];
|
|
31
|
+
categories: DraftRankingCategory[];
|
|
32
|
+
rankings: DraftProspect[];
|
|
33
|
+
}
|
|
34
|
+
export interface DraftTrackerTvBroadcast {
|
|
35
|
+
id: number;
|
|
36
|
+
market: string;
|
|
37
|
+
countryCode: string;
|
|
38
|
+
network: string;
|
|
39
|
+
sequenceNumber: number;
|
|
40
|
+
}
|
|
41
|
+
export interface DraftTrackerPick {
|
|
42
|
+
pickInRound: number;
|
|
43
|
+
overallPick: number;
|
|
44
|
+
teamId: number;
|
|
45
|
+
teamAbbrev: string;
|
|
46
|
+
teamFullName: LocalizedString;
|
|
47
|
+
teamCommonName: LocalizedString;
|
|
48
|
+
teamPlaceNameWithPreposition: LocalizedString;
|
|
49
|
+
teamLogoLight: string;
|
|
50
|
+
teamLogoDark: string;
|
|
51
|
+
state: string;
|
|
52
|
+
lastName: LocalizedString;
|
|
53
|
+
firstName: LocalizedString;
|
|
54
|
+
positionCode: DraftPositionCode;
|
|
55
|
+
}
|
|
56
|
+
export interface DraftTracker {
|
|
57
|
+
currentDraftDate: string;
|
|
58
|
+
broadcastStartTimeUTC: string;
|
|
59
|
+
tvBroadcasts: DraftTrackerTvBroadcast[];
|
|
60
|
+
logoUrl: string;
|
|
61
|
+
logoFrUrl: string;
|
|
62
|
+
uiAccentColor: string;
|
|
63
|
+
round: number;
|
|
64
|
+
state: string;
|
|
65
|
+
picks: DraftTrackerPick[];
|
|
66
|
+
}
|
|
67
|
+
export interface DraftPick {
|
|
68
|
+
round: number;
|
|
69
|
+
pickInRound: number;
|
|
70
|
+
overallPick: number;
|
|
71
|
+
teamId: number;
|
|
72
|
+
teamAbbrev: string;
|
|
73
|
+
teamName: LocalizedString;
|
|
74
|
+
teamCommonName: LocalizedString;
|
|
75
|
+
teamPlaceNameWithPreposition: LocalizedString;
|
|
76
|
+
displayAbbrev: LocalizedString;
|
|
77
|
+
teamLogoLight: string;
|
|
78
|
+
teamLogoDark: string;
|
|
79
|
+
teamPickHistory: string;
|
|
80
|
+
firstName: LocalizedString;
|
|
81
|
+
lastName: LocalizedString;
|
|
82
|
+
positionCode: DraftPositionCode;
|
|
83
|
+
countryCode: string;
|
|
84
|
+
height: number;
|
|
85
|
+
weight: number;
|
|
86
|
+
amateurLeague: string;
|
|
87
|
+
amateurClubName?: string;
|
|
88
|
+
}
|
|
89
|
+
export interface DraftPicks {
|
|
90
|
+
/** Draft year in YYYY format. */
|
|
91
|
+
draftYear: number;
|
|
92
|
+
draftYears: number[];
|
|
93
|
+
selectableRounds: number[];
|
|
94
|
+
state: string;
|
|
95
|
+
picks: DraftPick[];
|
|
96
|
+
broadcastStartTimeUTC?: string;
|
|
97
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/edge.d.mts
CHANGED
|
@@ -76,9 +76,18 @@ export interface EdgeRankedMeasurement {
|
|
|
76
76
|
leagueAvg: EdgeMeasurement;
|
|
77
77
|
}
|
|
78
78
|
export interface Goalie5v5Detail {
|
|
79
|
-
savePctg5v5Last10:
|
|
79
|
+
savePctg5v5Last10: Goalie5v5Last10Game[];
|
|
80
80
|
savePctg5v5Details: Goalie5v5Details;
|
|
81
81
|
}
|
|
82
|
+
export interface Goalie5v5Last10Game {
|
|
83
|
+
gameCenterLink: string;
|
|
84
|
+
savePctg: number;
|
|
85
|
+
gameDate: string;
|
|
86
|
+
decision: string;
|
|
87
|
+
playerOnHomeTeam: boolean;
|
|
88
|
+
homeTeam: EdgeGameTeam;
|
|
89
|
+
awayTeam: EdgeGameTeam;
|
|
90
|
+
}
|
|
82
91
|
export interface Goalie5v5Details {
|
|
83
92
|
savePctg: Goalie5v5Stat;
|
|
84
93
|
savePctgClose: Goalie5v5Stat;
|
|
@@ -90,11 +99,19 @@ export interface GoalieComparison {
|
|
|
90
99
|
seasonsWithEdgeStats: EdgeSeasonAvailability[];
|
|
91
100
|
shotLocationSummary: GoalieComparisonLocationSummary[];
|
|
92
101
|
shotLocationDetails: GoalieComparisonLocationArea[];
|
|
93
|
-
savePctg5v5Last10:
|
|
102
|
+
savePctg5v5Last10: GoalieComparisonLast10Game[];
|
|
94
103
|
savePctg5v5Details: GoalieComparison5v5Details;
|
|
95
|
-
savePctgLast10:
|
|
104
|
+
savePctgLast10: GoalieComparisonLast10Game[];
|
|
96
105
|
savePctgDetails: GoalieComparisonSaveDetails;
|
|
97
106
|
}
|
|
107
|
+
export interface GoalieComparisonLast10Game {
|
|
108
|
+
gameCenterLink: string;
|
|
109
|
+
savePctg: number;
|
|
110
|
+
gameDate: string;
|
|
111
|
+
playerOnHomeTeam: boolean;
|
|
112
|
+
homeTeam: EdgeTeamRef;
|
|
113
|
+
awayTeam: EdgeTeamRef;
|
|
114
|
+
}
|
|
98
115
|
export interface GoalieComparison5v5Details {
|
|
99
116
|
savePctg: number;
|
|
100
117
|
savePctgClose: number;
|
|
@@ -1022,3 +1039,282 @@ export interface ShotSpeedOverlay {
|
|
|
1022
1039
|
timeInPeriod: string;
|
|
1023
1040
|
gameType: GameType;
|
|
1024
1041
|
}
|
|
1042
|
+
/** Player of an EDGE top-10 row. `goalieShotLocationTop10` rows use `EdgeLeaderPlayer`. */
|
|
1043
|
+
export interface EdgeTop10Player {
|
|
1044
|
+
firstName: LocalizedString;
|
|
1045
|
+
lastName: LocalizedString;
|
|
1046
|
+
slug: string;
|
|
1047
|
+
headshot: string;
|
|
1048
|
+
position: string;
|
|
1049
|
+
sweaterNumber: number;
|
|
1050
|
+
team: EdgeGameTeam;
|
|
1051
|
+
}
|
|
1052
|
+
/** Team of the team skating speed and shot location top-10 rows. The others use `EdgeGameTeam` (no `id`). */
|
|
1053
|
+
export interface EdgeTop10Team {
|
|
1054
|
+
id: number;
|
|
1055
|
+
commonName: LocalizedString;
|
|
1056
|
+
placeNameWithPreposition: LocalizedString;
|
|
1057
|
+
abbrev: string;
|
|
1058
|
+
teamLogo: TeamLogo;
|
|
1059
|
+
slug: string;
|
|
1060
|
+
}
|
|
1061
|
+
export interface EdgeTeamDistanceMax {
|
|
1062
|
+
imperial: number;
|
|
1063
|
+
metric: number;
|
|
1064
|
+
overlay: TeamDistanceOverlay;
|
|
1065
|
+
}
|
|
1066
|
+
export interface SkaterDistanceTop10Row {
|
|
1067
|
+
player: EdgeTop10Player;
|
|
1068
|
+
distanceTotal: EdgeMeasurement;
|
|
1069
|
+
distancePer60: EdgeMeasurement;
|
|
1070
|
+
distanceMaxPerGame: SkaterComparisonDistanceMaxGame;
|
|
1071
|
+
distanceMaxPerPeriod: SkaterComparisonDistanceMaxGame;
|
|
1072
|
+
}
|
|
1073
|
+
export interface SkaterSpeedTop10Row {
|
|
1074
|
+
player: EdgeTop10Player;
|
|
1075
|
+
maxSpeed: SkaterComparisonMaxSpeed;
|
|
1076
|
+
burstsOver22: number;
|
|
1077
|
+
bursts20To22: number;
|
|
1078
|
+
bursts18To20: number;
|
|
1079
|
+
}
|
|
1080
|
+
export interface SkaterZoneTimeTop10Row {
|
|
1081
|
+
player: EdgeTop10Player;
|
|
1082
|
+
/** Share of time on ice, e.g. 0.4957. */
|
|
1083
|
+
offensiveZoneTime: number;
|
|
1084
|
+
neutralZoneTime: number;
|
|
1085
|
+
defensiveZoneTime: number;
|
|
1086
|
+
}
|
|
1087
|
+
export interface SkaterShotSpeedTop10Row {
|
|
1088
|
+
player: EdgeTop10Player;
|
|
1089
|
+
hardestShot: SkaterComparisonTopShot;
|
|
1090
|
+
shotAttemptsOver100: number;
|
|
1091
|
+
shotAttempts90To100: number;
|
|
1092
|
+
shotAttempts80To90: number;
|
|
1093
|
+
shotAttempts70To80: number;
|
|
1094
|
+
}
|
|
1095
|
+
export interface SkaterShotLocationTop10Row {
|
|
1096
|
+
player: EdgeTop10Player;
|
|
1097
|
+
all: number;
|
|
1098
|
+
highDanger: number;
|
|
1099
|
+
midRange: number;
|
|
1100
|
+
longRange: number;
|
|
1101
|
+
}
|
|
1102
|
+
export interface Goalie5v5Top10Row {
|
|
1103
|
+
player: EdgeTop10Player;
|
|
1104
|
+
savePctg: number;
|
|
1105
|
+
savePctgClose: number;
|
|
1106
|
+
shots: number;
|
|
1107
|
+
shotsPer60: number;
|
|
1108
|
+
}
|
|
1109
|
+
export interface GoalieShotLocationTop10Row {
|
|
1110
|
+
player: EdgeLeaderPlayer;
|
|
1111
|
+
all: number;
|
|
1112
|
+
highDanger: number;
|
|
1113
|
+
midRange: number;
|
|
1114
|
+
longRange: number;
|
|
1115
|
+
}
|
|
1116
|
+
export interface GoalieSavePercentageTop10Row {
|
|
1117
|
+
player: EdgeTop10Player;
|
|
1118
|
+
gamesOver900: number;
|
|
1119
|
+
pctgGamesOver900: number;
|
|
1120
|
+
}
|
|
1121
|
+
export interface TeamSkatingDistanceTop10Row {
|
|
1122
|
+
team: EdgeGameTeam;
|
|
1123
|
+
distanceTotal: EdgeMeasurement;
|
|
1124
|
+
distancePer60: EdgeMeasurement;
|
|
1125
|
+
distanceMaxPerGame: EdgeTeamDistanceMax;
|
|
1126
|
+
distanceMaxPerPeriod: EdgeTeamDistanceMax;
|
|
1127
|
+
}
|
|
1128
|
+
export interface TeamSkatingSpeedTop10Row {
|
|
1129
|
+
team: EdgeTop10Team;
|
|
1130
|
+
/** `maxSpeed` on the skater leaderboard. */
|
|
1131
|
+
maxSkatingSpeed: SkaterComparisonMaxSpeed;
|
|
1132
|
+
burstsOver22: number;
|
|
1133
|
+
bursts20To22: number;
|
|
1134
|
+
bursts18To20: number;
|
|
1135
|
+
}
|
|
1136
|
+
export interface TeamZoneTimeTop10Row {
|
|
1137
|
+
team: EdgeGameTeam;
|
|
1138
|
+
/** Share of time on ice, e.g. 0.4957. */
|
|
1139
|
+
offensiveZoneTime: number;
|
|
1140
|
+
neutralZoneTime: number;
|
|
1141
|
+
defensiveZoneTime: number;
|
|
1142
|
+
}
|
|
1143
|
+
export interface TeamShotSpeedTop10Row {
|
|
1144
|
+
team: EdgeGameTeam;
|
|
1145
|
+
hardestShot: SkaterComparisonTopShot;
|
|
1146
|
+
shotAttemptsOver100: number;
|
|
1147
|
+
shotAttempts90To100: number;
|
|
1148
|
+
shotAttempts80To90: number;
|
|
1149
|
+
shotAttempts70To80: number;
|
|
1150
|
+
}
|
|
1151
|
+
export interface TeamShotLocationTop10Row {
|
|
1152
|
+
team: EdgeTop10Team;
|
|
1153
|
+
all: number;
|
|
1154
|
+
highDanger: number;
|
|
1155
|
+
midRange: number;
|
|
1156
|
+
longRange: number;
|
|
1157
|
+
}
|
|
1158
|
+
export interface TeamComparisonTeam {
|
|
1159
|
+
id: number;
|
|
1160
|
+
commonName: LocalizedString;
|
|
1161
|
+
placeNameWithPreposition: LocalizedString;
|
|
1162
|
+
abbrev: string;
|
|
1163
|
+
teamLogo: TeamLogo;
|
|
1164
|
+
slug: string;
|
|
1165
|
+
conference: string;
|
|
1166
|
+
division: string;
|
|
1167
|
+
wins: number;
|
|
1168
|
+
losses: number;
|
|
1169
|
+
otLosses: number;
|
|
1170
|
+
gamesPlayed: number;
|
|
1171
|
+
points: number;
|
|
1172
|
+
}
|
|
1173
|
+
export interface TeamComparisonDistanceGame {
|
|
1174
|
+
gameCenterLink: string;
|
|
1175
|
+
gameDate: string;
|
|
1176
|
+
isHomeTeam: boolean;
|
|
1177
|
+
distanceSkated: EdgeMeasurement;
|
|
1178
|
+
homeTeam: EdgeGameTeam;
|
|
1179
|
+
awayTeam: EdgeGameTeam;
|
|
1180
|
+
}
|
|
1181
|
+
export interface TeamComparisonDistance {
|
|
1182
|
+
distanceTotal: EdgeMeasurement;
|
|
1183
|
+
distancePer60: EdgeMeasurement;
|
|
1184
|
+
distanceMaxGame: EdgeTeamDistanceMax;
|
|
1185
|
+
distanceMaxPeriod: EdgeTeamDistanceMax;
|
|
1186
|
+
}
|
|
1187
|
+
export interface TeamComparisonShotDifferential {
|
|
1188
|
+
shotAttemptDifferential: number;
|
|
1189
|
+
sogDifferential: number;
|
|
1190
|
+
}
|
|
1191
|
+
export interface TeamComparison {
|
|
1192
|
+
team: TeamComparisonTeam;
|
|
1193
|
+
seasonsWithEdgeStats: EdgeSeasonAvailability[];
|
|
1194
|
+
shotSpeedDetails: SkaterComparisonShotSpeed;
|
|
1195
|
+
skatingSpeedDetails: SkaterComparisonSpeed;
|
|
1196
|
+
skatingDistanceLast10: TeamComparisonDistanceGame[];
|
|
1197
|
+
skatingDistanceDetails: TeamComparisonDistance;
|
|
1198
|
+
shotLocationDetails: SkaterComparisonLocationArea[];
|
|
1199
|
+
shotLocationTotals: SkaterComparisonLocationTotal[];
|
|
1200
|
+
zoneTimeDetails: SkaterComparisonZoneTime;
|
|
1201
|
+
shotDifferential: TeamComparisonShotDifferential;
|
|
1202
|
+
}
|
|
1203
|
+
export interface ByTheNumbersPlayer {
|
|
1204
|
+
birthDate: string;
|
|
1205
|
+
id: number;
|
|
1206
|
+
firstName: LocalizedString;
|
|
1207
|
+
lastName: LocalizedString;
|
|
1208
|
+
sweaterNumber: number;
|
|
1209
|
+
position: string;
|
|
1210
|
+
slug: string;
|
|
1211
|
+
headshot: string;
|
|
1212
|
+
shootsCatches: ShootsCatches;
|
|
1213
|
+
team: EdgeTeamRef;
|
|
1214
|
+
}
|
|
1215
|
+
export interface ByTheNumbersTeam {
|
|
1216
|
+
id: number;
|
|
1217
|
+
commonName: LocalizedString;
|
|
1218
|
+
placeNameWithPreposition: LocalizedString;
|
|
1219
|
+
abbrev: string;
|
|
1220
|
+
slug: string;
|
|
1221
|
+
teamLogo: TeamLogo;
|
|
1222
|
+
conference: string;
|
|
1223
|
+
division: string;
|
|
1224
|
+
}
|
|
1225
|
+
export interface ByTheNumbersHardestShot {
|
|
1226
|
+
player: ByTheNumbersPlayer;
|
|
1227
|
+
overlay: ShotSpeedOverlay;
|
|
1228
|
+
shotSpeed: EdgeMeasurement;
|
|
1229
|
+
}
|
|
1230
|
+
export interface ByTheNumbersMaxSkatingSpeed {
|
|
1231
|
+
player: ByTheNumbersPlayer;
|
|
1232
|
+
overlay: SkatingSpeedOverlay;
|
|
1233
|
+
skatingSpeed: EdgeMeasurement;
|
|
1234
|
+
}
|
|
1235
|
+
export interface ByTheNumbersDistanceSkater {
|
|
1236
|
+
player: ByTheNumbersPlayer;
|
|
1237
|
+
distanceSkated: SkaterComparisonDistanceMaxGame;
|
|
1238
|
+
}
|
|
1239
|
+
export interface ByTheNumbersDistanceGame {
|
|
1240
|
+
gameCenterLink: string;
|
|
1241
|
+
gameDate: string;
|
|
1242
|
+
isHomeTeam: boolean;
|
|
1243
|
+
homeTeam: ByTheNumbersTeam;
|
|
1244
|
+
awayTeam: ByTheNumbersTeam;
|
|
1245
|
+
distanceSkated: EdgeMeasurement;
|
|
1246
|
+
}
|
|
1247
|
+
export interface ByTheNumbersTopSkaterName {
|
|
1248
|
+
name: LocalizedString;
|
|
1249
|
+
}
|
|
1250
|
+
export interface ByTheNumbersTopSkater {
|
|
1251
|
+
gameCenterLink: string;
|
|
1252
|
+
gameDate: string;
|
|
1253
|
+
playerOnHomeTeam: boolean;
|
|
1254
|
+
distanceSkated: EdgeMeasurement;
|
|
1255
|
+
toi: number;
|
|
1256
|
+
homeTeam: ByTheNumbersTeam;
|
|
1257
|
+
awayTeam: ByTheNumbersTeam;
|
|
1258
|
+
player: ByTheNumbersTopSkaterName;
|
|
1259
|
+
}
|
|
1260
|
+
export interface ByTheNumbersDistanceTeam {
|
|
1261
|
+
team: ByTheNumbersTeam;
|
|
1262
|
+
game: ByTheNumbersDistanceGame;
|
|
1263
|
+
topFiveSkaters: ByTheNumbersTopSkater[];
|
|
1264
|
+
}
|
|
1265
|
+
export interface ByTheNumbersDistanceLeague {
|
|
1266
|
+
distanceSkated: EdgeMeasurement;
|
|
1267
|
+
topFiveSkaters: ByTheNumbersTopSkater[];
|
|
1268
|
+
}
|
|
1269
|
+
export interface ByTheNumbersTeamOverlay {
|
|
1270
|
+
team: ByTheNumbersTeam;
|
|
1271
|
+
gameDate: string;
|
|
1272
|
+
awayTeam: OverlayTeam;
|
|
1273
|
+
homeTeam: OverlayTeam;
|
|
1274
|
+
gameOutcome: GameOutcome;
|
|
1275
|
+
periodDescriptor: OverlayPeriod;
|
|
1276
|
+
gameType: GameType;
|
|
1277
|
+
}
|
|
1278
|
+
export interface ByTheNumbersSogArea {
|
|
1279
|
+
area: string;
|
|
1280
|
+
shots: number;
|
|
1281
|
+
}
|
|
1282
|
+
export interface ByTheNumbersSogTeam {
|
|
1283
|
+
overlay: ByTheNumbersTeamOverlay;
|
|
1284
|
+
team: ByTheNumbersTeam;
|
|
1285
|
+
shots: number;
|
|
1286
|
+
sogDetails: ByTheNumbersSogArea[];
|
|
1287
|
+
}
|
|
1288
|
+
export interface ByTheNumbersSavesArea {
|
|
1289
|
+
area: string;
|
|
1290
|
+
saves: number;
|
|
1291
|
+
}
|
|
1292
|
+
export interface ByTheNumbersHighDangerSaves {
|
|
1293
|
+
overlay: SkatingDistanceOverlay;
|
|
1294
|
+
player: ByTheNumbersPlayer;
|
|
1295
|
+
saves: number;
|
|
1296
|
+
shotLocationDetails: ByTheNumbersSavesArea[];
|
|
1297
|
+
}
|
|
1298
|
+
export interface ByTheNumbersDistanceMaxGame {
|
|
1299
|
+
player: ByTheNumbersPlayer;
|
|
1300
|
+
overlay: SkatingDistanceOverlay;
|
|
1301
|
+
distanceSkated: EdgeMeasurement;
|
|
1302
|
+
}
|
|
1303
|
+
/**
|
|
1304
|
+
* League-wide EDGE highlights. The `/now` form describes the latest game
|
|
1305
|
+
* night (`games`, `gameDate` and the nightly leaders); an explicit season
|
|
1306
|
+
* returns the season bests (`hardestShotSkater`, `maxSkatingSpeedSkater`,
|
|
1307
|
+
* `distanceMaxGame`).
|
|
1308
|
+
*/
|
|
1309
|
+
export interface ByTheNumbers {
|
|
1310
|
+
games?: number;
|
|
1311
|
+
gameDate?: string;
|
|
1312
|
+
hardestShotSkater: ByTheNumbersHardestShot;
|
|
1313
|
+
maxSkatingSpeedSkater: ByTheNumbersMaxSkatingSpeed;
|
|
1314
|
+
totalDistanceSkatedSkater?: ByTheNumbersDistanceSkater;
|
|
1315
|
+
totalDistanceSkatedTeam?: ByTheNumbersDistanceTeam;
|
|
1316
|
+
totalDistanceSkatedLeague?: ByTheNumbersDistanceLeague;
|
|
1317
|
+
sogTeam?: ByTheNumbersSogTeam;
|
|
1318
|
+
highDangerSavesGoalie?: ByTheNumbersHighDangerSaves;
|
|
1319
|
+
distanceMaxGame?: ByTheNumbersDistanceMaxGame;
|
|
1320
|
+
}
|