nhle-api 0.5.3 → 0.5.4
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/CHANGELOG.md +38 -0
- package/README.md +161 -80
- package/lib/index.cjs +966 -252
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +378 -72
- package/lib/index.d.ts +378 -72
- package/lib/index.js +966 -253
- package/lib/index.js.map +1 -1
- package/package.json +6 -4
package/lib/index.d.cts
CHANGED
|
@@ -4,76 +4,6 @@ import * as arktype_internal_variants_object_ts from 'arktype/internal/variants/
|
|
|
4
4
|
import * as arktype from 'arktype';
|
|
5
5
|
import * as arktype_internal_attributes_ts from 'arktype/internal/attributes.ts';
|
|
6
6
|
|
|
7
|
-
/**
|
|
8
|
-
* Error handling module for NHL Sports Data API wrapper
|
|
9
|
-
* Provides structured error classification and logging for API interactions
|
|
10
|
-
*/
|
|
11
|
-
declare const ErrorCategory: {
|
|
12
|
-
/** Network-level errors (connection refused, timeout, etc.) */
|
|
13
|
-
readonly NETWORK: "NETWORK";
|
|
14
|
-
/** HTTP 4xx client errors (invalid params, not found, etc.) */
|
|
15
|
-
readonly CLIENT: "CLIENT";
|
|
16
|
-
/** HTTP 5xx server errors */
|
|
17
|
-
readonly SERVER: "SERVER";
|
|
18
|
-
/** Rate limiting (HTTP 429) */
|
|
19
|
-
readonly RATE_LIMIT: "RATE_LIMIT";
|
|
20
|
-
/** Valid HTTP response but with error payload */
|
|
21
|
-
readonly API_ERROR: "API_ERROR";
|
|
22
|
-
/** Response parsing/validation failures */
|
|
23
|
-
readonly PARSE: "PARSE";
|
|
24
|
-
/** Invalid user input or configuration */
|
|
25
|
-
readonly VALIDATION: "VALIDATION";
|
|
26
|
-
};
|
|
27
|
-
type ErrorCategory = (typeof ErrorCategory)[keyof typeof ErrorCategory];
|
|
28
|
-
interface ErrorContext {
|
|
29
|
-
/** HTTP status code if applicable */
|
|
30
|
-
statusCode?: number;
|
|
31
|
-
/** Original error object */
|
|
32
|
-
cause?: unknown;
|
|
33
|
-
/** Request URL or endpoint */
|
|
34
|
-
endpoint?: string;
|
|
35
|
-
/** Request method */
|
|
36
|
-
method?: string;
|
|
37
|
-
/** Request parameters */
|
|
38
|
-
params?: Record<string, unknown>;
|
|
39
|
-
/** Response body if available */
|
|
40
|
-
responseBody?: unknown;
|
|
41
|
-
/** Timestamp of error */
|
|
42
|
-
timestamp?: Date;
|
|
43
|
-
/** Additional metadata */
|
|
44
|
-
metadata?: Record<string, unknown>;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Base error class for all NHL API errors
|
|
48
|
-
*/
|
|
49
|
-
declare class NHLError extends Error {
|
|
50
|
-
readonly category: ErrorCategory;
|
|
51
|
-
readonly context: ErrorContext;
|
|
52
|
-
constructor(message: string, category: ErrorCategory, context?: ErrorContext);
|
|
53
|
-
/**
|
|
54
|
-
* Serialize error to JSON
|
|
55
|
-
*/
|
|
56
|
-
toJSON(): {
|
|
57
|
-
stack?: string;
|
|
58
|
-
name: string;
|
|
59
|
-
message: string;
|
|
60
|
-
category: ErrorCategory;
|
|
61
|
-
context: ErrorContext;
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* NHL API Client Type Definitions
|
|
67
|
-
*/
|
|
68
|
-
|
|
69
|
-
type APIResponse<T> = {
|
|
70
|
-
status: 'success';
|
|
71
|
-
data: T;
|
|
72
|
-
} | {
|
|
73
|
-
status: 'error';
|
|
74
|
-
error: NHLError;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
7
|
/** Categories for save location top-10 list */
|
|
78
8
|
declare const SaveLocationCategoryEnum: {
|
|
79
9
|
/** Save Percentage */
|
|
@@ -199,6 +129,64 @@ declare const ZoneTimeSortEnum: {
|
|
|
199
129
|
readonly NZ: "neutral";
|
|
200
130
|
};
|
|
201
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Error handling module for NHL Sports Data API wrapper
|
|
134
|
+
* Provides structured error classification and logging for API interactions
|
|
135
|
+
*/
|
|
136
|
+
declare const ErrorCategory: {
|
|
137
|
+
/** Network-level errors (connection refused, timeout, etc.) */
|
|
138
|
+
readonly NETWORK: "NETWORK";
|
|
139
|
+
/** HTTP 4xx client errors (invalid params, not found, etc.) */
|
|
140
|
+
readonly CLIENT: "CLIENT";
|
|
141
|
+
/** HTTP 5xx server errors */
|
|
142
|
+
readonly SERVER: "SERVER";
|
|
143
|
+
/** Rate limiting (HTTP 429) */
|
|
144
|
+
readonly RATE_LIMIT: "RATE_LIMIT";
|
|
145
|
+
/** Valid HTTP response but with error payload */
|
|
146
|
+
readonly API_ERROR: "API_ERROR";
|
|
147
|
+
/** Response parsing/validation failures */
|
|
148
|
+
readonly PARSE: "PARSE";
|
|
149
|
+
/** Invalid user input or configuration */
|
|
150
|
+
readonly VALIDATION: "VALIDATION";
|
|
151
|
+
};
|
|
152
|
+
type ErrorCategory = (typeof ErrorCategory)[keyof typeof ErrorCategory];
|
|
153
|
+
interface ErrorContext {
|
|
154
|
+
/** HTTP status code if applicable */
|
|
155
|
+
statusCode?: number;
|
|
156
|
+
/** Original error object */
|
|
157
|
+
cause?: unknown;
|
|
158
|
+
/** Request URL or endpoint */
|
|
159
|
+
endpoint?: string;
|
|
160
|
+
/** Request method */
|
|
161
|
+
method?: string;
|
|
162
|
+
/** Request parameters */
|
|
163
|
+
params?: Record<string, unknown>;
|
|
164
|
+
/** Response body if available */
|
|
165
|
+
responseBody?: unknown;
|
|
166
|
+
/** Timestamp of error */
|
|
167
|
+
timestamp?: Date;
|
|
168
|
+
/** Additional metadata */
|
|
169
|
+
metadata?: Record<string, unknown>;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Base error class for all NHL API errors
|
|
173
|
+
*/
|
|
174
|
+
declare class NHLError extends Error {
|
|
175
|
+
readonly category: ErrorCategory;
|
|
176
|
+
readonly context: ErrorContext;
|
|
177
|
+
constructor(message: string, category: ErrorCategory, context?: ErrorContext);
|
|
178
|
+
/**
|
|
179
|
+
* Serialize error to JSON
|
|
180
|
+
*/
|
|
181
|
+
toJSON(): {
|
|
182
|
+
stack?: string;
|
|
183
|
+
name: string;
|
|
184
|
+
message: string;
|
|
185
|
+
category: ErrorCategory;
|
|
186
|
+
context: ErrorContext;
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
|
|
202
190
|
declare const Year$1: arktype.BaseType<number | ((In: string) => arktype_internal_attributes_ts.To<number>), {}>;
|
|
203
191
|
declare const NHLMonth$1: arktype_internal_variants_object_ts.ObjectType<(In: string | Date) => arktype.Out<string>, {}>;
|
|
204
192
|
declare const NHLDate$1: arktype_internal_variants_object_ts.ObjectType<(In: string | Date) => arktype.Out<string>, {}>;
|
|
@@ -317,6 +305,320 @@ type SkatingDistanceSort = keyof typeof SkatingDistanceSortEnum;
|
|
|
317
305
|
/** Sort options for zone time top-10 lists. */
|
|
318
306
|
type ZoneTimeSort = keyof typeof ZoneTimeSortEnum;
|
|
319
307
|
|
|
308
|
+
/**
|
|
309
|
+
* ======================================================================
|
|
310
|
+
* API endpoints for goalie-related data.
|
|
311
|
+
* Base url: api-web.nhle.com/v1/edge
|
|
312
|
+
*
|
|
313
|
+
* Notes:
|
|
314
|
+
* - Convenience endpoints using 'now' for season have been
|
|
315
|
+
* excluded in favor of using calculated current season. You can optionally
|
|
316
|
+
* configure the switch over date for how current season is calculated.
|
|
317
|
+
* See README for details.
|
|
318
|
+
* - There is an extra endpoint that appears to duplicate
|
|
319
|
+
* the functionality of /skater-detail at `v1/cat/edge/skater-detail`
|
|
320
|
+
* As such, it has been excluded from this implementation.
|
|
321
|
+
* ======================================================================
|
|
322
|
+
*/
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Goalie Edge Advanced Stats API helpers.
|
|
326
|
+
*
|
|
327
|
+
* Lightweight wrapper exposing functions that call the underlying nhlClient
|
|
328
|
+
* for goalie-related endpoints. Each method returns the raw Promise from the
|
|
329
|
+
* client.get call.
|
|
330
|
+
*/
|
|
331
|
+
/**
|
|
332
|
+
* Get goalie detail for a player.
|
|
333
|
+
* @param playerId - The player's numeric id.
|
|
334
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
335
|
+
* @param gameType - Optional game type id.
|
|
336
|
+
* @returns Promise resolving to the raw API response.
|
|
337
|
+
*/
|
|
338
|
+
declare function player$1(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
339
|
+
/**
|
|
340
|
+
* Get goalie comparison data for a player.
|
|
341
|
+
* @param playerId - The player's numeric id.
|
|
342
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
343
|
+
* @param gameType - Optional game type id.
|
|
344
|
+
* @returns Promise resolving to the raw API response.
|
|
345
|
+
*/
|
|
346
|
+
declare function compare$1(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
347
|
+
/**
|
|
348
|
+
* Get goalie landing / leaders for a season.
|
|
349
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
350
|
+
* @param gameType - Optional game type id.
|
|
351
|
+
* @returns Promise resolving to the raw API response.
|
|
352
|
+
*/
|
|
353
|
+
declare function leaders$2(season?: Season, gameType?: GameType): Promise<unknown>;
|
|
354
|
+
/**
|
|
355
|
+
* Get 5v5 save percentage details for a goalie.
|
|
356
|
+
* @param playerId - The player's numeric id.
|
|
357
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
358
|
+
* @param gameType - Optional game type id.
|
|
359
|
+
* @returns Promise resolving to the raw API response.
|
|
360
|
+
*/
|
|
361
|
+
declare function savePercentage5v5(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
362
|
+
/**
|
|
363
|
+
* Get save percentage details for a goalie.
|
|
364
|
+
* @param playerId - The player's numeric id.
|
|
365
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
366
|
+
* @param gameType - Optional game type id.
|
|
367
|
+
* @returns Promise resolving to the raw API response.
|
|
368
|
+
*/
|
|
369
|
+
declare function savePercentage(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
370
|
+
/**
|
|
371
|
+
* Get save location details for a goalie.
|
|
372
|
+
* @param playerId - The player's numeric id.
|
|
373
|
+
* @param season - Optional season (numeric season format or 'now' via argParse).
|
|
374
|
+
* @param gameType - Optional game type id.
|
|
375
|
+
* @returns Promise resolving to the raw API response.
|
|
376
|
+
*/
|
|
377
|
+
declare function saveLocation(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
378
|
+
/**
|
|
379
|
+
* Accessor for top-10 leaderboards.
|
|
380
|
+
* @returns Object with methods to fetch various top-10 lists.
|
|
381
|
+
*/
|
|
382
|
+
declare const top10$2: {
|
|
383
|
+
savePercentage: typeof top10SavePercentage;
|
|
384
|
+
savePercentage5v5: typeof top10SavePercentage5v5;
|
|
385
|
+
saveLocation: typeof top10SaveLocation;
|
|
386
|
+
};
|
|
387
|
+
/**
|
|
388
|
+
* Top-10 edge save percentage lists.
|
|
389
|
+
* @param sortBy - Sorting key for the leaderboard.
|
|
390
|
+
* @param season - Optional season (numeric or 'now').
|
|
391
|
+
* @param gameType - Optional game type id.
|
|
392
|
+
* @returns Promise resolving to the raw API response.
|
|
393
|
+
*/
|
|
394
|
+
declare function top10SavePercentage(season?: Season, gameType?: GameType, sortBy?: SavePercentageSort): Promise<unknown>;
|
|
395
|
+
/**
|
|
396
|
+
* Top-10 5v5 save percentage lists.
|
|
397
|
+
* @param sortBy - Sorting key for the leaderboard.
|
|
398
|
+
* @param season - Optional season (numeric or 'now').
|
|
399
|
+
* @param gameType - Optional game type id.
|
|
400
|
+
* @returns Promise resolving to the raw API response.
|
|
401
|
+
*/
|
|
402
|
+
declare function top10SavePercentage5v5(season?: Season, gameType?: GameType, sortBy?: SavePercentage5v5Sort): Promise<unknown>;
|
|
403
|
+
/**
|
|
404
|
+
* Top-10 save location lists.
|
|
405
|
+
* @param category - Category key (see SaveLocationCategoryEnum).
|
|
406
|
+
* @param sortBy - Sorting key for the leaderboard (see SaveLocationSortEnum).
|
|
407
|
+
* @param season - Optional season (e.g. 20242025).
|
|
408
|
+
* @param gameType - Optional game type.
|
|
409
|
+
* @returns Promise resolving to the raw API response.
|
|
410
|
+
*/
|
|
411
|
+
declare function top10SaveLocation(season?: Season, gameType?: GameType, category?: SaveLocationCategory, sortBy?: SaveLocationSort): Promise<unknown>;
|
|
412
|
+
|
|
413
|
+
declare const goalies_saveLocation: typeof saveLocation;
|
|
414
|
+
declare const goalies_savePercentage: typeof savePercentage;
|
|
415
|
+
declare const goalies_savePercentage5v5: typeof savePercentage5v5;
|
|
416
|
+
declare namespace goalies {
|
|
417
|
+
export { compare$1 as compare, leaders$2 as leaders, player$1 as player, goalies_saveLocation as saveLocation, goalies_savePercentage as savePercentage, goalies_savePercentage5v5 as savePercentage5v5, top10$2 as top10 };
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* ======================================================================
|
|
422
|
+
* API endpoints for skater-related data.
|
|
423
|
+
* Base url: api-web.nhle.com/v1/edge
|
|
424
|
+
*
|
|
425
|
+
* Notes:
|
|
426
|
+
* - Convenience endpoints using 'now' for season have been
|
|
427
|
+
* excluded in favor of using calculated current season. You can optionally
|
|
428
|
+
* configure the switch over date for how current season is calculated.
|
|
429
|
+
* See README for details.
|
|
430
|
+
* - There is an extra endpoint that appears to duplicate
|
|
431
|
+
* the functionality of /skater-detail at `v1/cat/edge/skater-detail`
|
|
432
|
+
* As such, it has been excluded from this implementation.
|
|
433
|
+
* =====================================================================
|
|
434
|
+
*/
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Skater Edge Advanced Stats API helpers.
|
|
438
|
+
*
|
|
439
|
+
* Lightweight wrapper exposing functions that call the underlying nhlClient
|
|
440
|
+
* for skater-related endpoints. Each method returns the raw Promise from the
|
|
441
|
+
* client.get call.
|
|
442
|
+
*/
|
|
443
|
+
/** Get skater detail for a player. */
|
|
444
|
+
declare function detail(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
445
|
+
/** Get skater shot location details for a player. */
|
|
446
|
+
declare function shotLocation$1(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
447
|
+
/** Get skater shot speed details for a player. */
|
|
448
|
+
declare function shotSpeed$1(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
449
|
+
/** Get skater skating distance details for a player. */
|
|
450
|
+
declare function skatingDistance$1(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
451
|
+
/** Get skater skating speed details for a player. */
|
|
452
|
+
declare function skatingSpeed$1(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
453
|
+
/** Get skater zone time for a player. */
|
|
454
|
+
declare function zoneTime$1(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
455
|
+
/** Get skater comparison data for a player. */
|
|
456
|
+
declare function comparison(playerId: PlayerId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
457
|
+
/** Get skater landing / leaders for a season. */
|
|
458
|
+
declare function leaders$1(season?: Season, gameType?: GameType): Promise<unknown>;
|
|
459
|
+
declare const top10$1: {
|
|
460
|
+
distance: typeof top10Distance;
|
|
461
|
+
shotLocation: typeof top10ShotLocation$1;
|
|
462
|
+
shotSpeed: typeof top10ShotSpeed$1;
|
|
463
|
+
speed: typeof top10Speed;
|
|
464
|
+
zoneTime: typeof top10ZoneTime$1;
|
|
465
|
+
};
|
|
466
|
+
/** Top-10 skating distance lists. */
|
|
467
|
+
declare function top10Distance(season?: Season, gameType?: GameType, position?: PositionFilter, strength?: SkatersStrength, sortBy?: SkatingDistanceSort): Promise<unknown>;
|
|
468
|
+
/** Top-10 shot location lists. */
|
|
469
|
+
declare function top10ShotLocation$1(season?: Season, gameType?: GameType, position?: PositionFilter, category?: ShotLocationCategory, sortBy?: ShotLocationSort): Promise<unknown>;
|
|
470
|
+
/** Top-10 shot speed lists. */
|
|
471
|
+
declare function top10ShotSpeed$1(season?: Season, gameType?: GameType, position?: PositionFilter, sortBy?: ShotSpeedSort): Promise<unknown>;
|
|
472
|
+
/** Top-10 skating speed lists. */
|
|
473
|
+
declare function top10Speed(season?: Season, gameType?: GameType, position?: PositionFilter, sortBy?: SkatingSpeedSort): Promise<unknown>;
|
|
474
|
+
/** Top-10 zone time lists. */
|
|
475
|
+
declare function top10ZoneTime$1(season?: Season, gameType?: GameType, position?: PositionFilter, strength?: SkatersStrength, sortBy?: ZoneTimeSort): Promise<unknown>;
|
|
476
|
+
|
|
477
|
+
declare const skaters_comparison: typeof comparison;
|
|
478
|
+
declare const skaters_detail: typeof detail;
|
|
479
|
+
declare namespace skaters {
|
|
480
|
+
export { skaters_comparison as comparison, skaters_detail as detail, leaders$1 as leaders, shotLocation$1 as shotLocation, shotSpeed$1 as shotSpeed, skatingDistance$1 as skatingDistance, skatingSpeed$1 as skatingSpeed, top10$1 as top10, zoneTime$1 as zoneTime };
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* NHL API Client Type Definitions
|
|
485
|
+
*/
|
|
486
|
+
|
|
487
|
+
type APIResponse<T> = {
|
|
488
|
+
success: true;
|
|
489
|
+
data: T;
|
|
490
|
+
} | {
|
|
491
|
+
success: false;
|
|
492
|
+
error: NHLError;
|
|
493
|
+
};
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Edge Advanced Stats API helpers.
|
|
497
|
+
*
|
|
498
|
+
* Lightweight wrapper exposing functions that call the underlying nhlClient
|
|
499
|
+
* for related endpoints. Each method returns the raw Promise from the
|
|
500
|
+
* client.get call.
|
|
501
|
+
*/
|
|
502
|
+
/**
|
|
503
|
+
* Get the "by the numbers" data for the current day, updated daily with
|
|
504
|
+
* insights from the previous days games.
|
|
505
|
+
* @returns A promise that resolves to the "by the numbers" data.
|
|
506
|
+
*/
|
|
507
|
+
declare function byTheNumbers(): Promise<APIResponse<unknown>>;
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* ======================================================================
|
|
511
|
+
* API endpoints for team-related data.
|
|
512
|
+
* Base url: api-web.nhle.com/v1/edge
|
|
513
|
+
*
|
|
514
|
+
* note: the season and game-type params on any endpoint can
|
|
515
|
+
* be replaced with 'now' to get current season data.
|
|
516
|
+
* ex. `/team-detail/{team-id}/now`
|
|
517
|
+
* ======================================================================
|
|
518
|
+
*/
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Team Edge Advanced Stats API helpers.
|
|
522
|
+
*
|
|
523
|
+
* Lightweight wrapper exposing functions that call the underlying nhlClient
|
|
524
|
+
* for team-related endpoints. Each method returns the raw Promise from the
|
|
525
|
+
* client.get call.
|
|
526
|
+
*/
|
|
527
|
+
/**
|
|
528
|
+
* Get team detail stats for a team.
|
|
529
|
+
* @param teamId - Team numeric id.
|
|
530
|
+
* @param season - Optional season (numeric season format or 'now').
|
|
531
|
+
* @param gameType - Optional game type id (defaults to Regular Season).
|
|
532
|
+
*/
|
|
533
|
+
declare function stats$1(teamId: TeamId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
534
|
+
/**
|
|
535
|
+
* Get team comparison data for a single team.
|
|
536
|
+
*/
|
|
537
|
+
declare function compare(teamId: TeamId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
538
|
+
/**
|
|
539
|
+
* Get team landing/leaders for a season.
|
|
540
|
+
*/
|
|
541
|
+
declare function leaders(season?: Season, gameType?: GameType): Promise<unknown>;
|
|
542
|
+
/**
|
|
543
|
+
* Get shot location details for a team.
|
|
544
|
+
*/
|
|
545
|
+
declare function shotLocation(teamId: TeamId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
546
|
+
/**
|
|
547
|
+
* Get shot speed details for a team.
|
|
548
|
+
*/
|
|
549
|
+
declare function shotSpeed(teamId: TeamId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
550
|
+
/**
|
|
551
|
+
* Get skating distance details for a team.
|
|
552
|
+
*/
|
|
553
|
+
declare function skatingDistance(teamId: TeamId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
554
|
+
/**
|
|
555
|
+
* Get skating speed details for a team.
|
|
556
|
+
*/
|
|
557
|
+
declare function skatingSpeed(teamId: TeamId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
558
|
+
/**
|
|
559
|
+
* Get zone time details for a team.
|
|
560
|
+
*/
|
|
561
|
+
declare function zoneTime(teamId: TeamId, season?: Season, gameType?: GameType): Promise<unknown>;
|
|
562
|
+
declare const top10: {
|
|
563
|
+
shotLocation: typeof top10ShotLocation;
|
|
564
|
+
shotSpeed: typeof top10ShotSpeed;
|
|
565
|
+
skatingDistance: typeof top10SkatingDistance;
|
|
566
|
+
skatingSpeed: typeof top10SkatingSpeed;
|
|
567
|
+
zoneTime: typeof top10ZoneTime;
|
|
568
|
+
};
|
|
569
|
+
/**
|
|
570
|
+
* Top-10 team shot location lists.
|
|
571
|
+
*/
|
|
572
|
+
declare function top10ShotLocation(season?: Season, gameType?: GameType, position?: PositionFilter, category?: ShotLocationCategory, sortBy?: ShotLocationSort): Promise<unknown>;
|
|
573
|
+
/**
|
|
574
|
+
* Top-10 team shot speed lists.
|
|
575
|
+
*/
|
|
576
|
+
declare function top10ShotSpeed(season?: Season, gameType?: GameType, position?: PositionFilter, sortBy?: ShotSpeedSort): Promise<unknown>;
|
|
577
|
+
/**
|
|
578
|
+
* Top-10 team skating distance lists.
|
|
579
|
+
*/
|
|
580
|
+
declare function top10SkatingDistance(season?: Season, gameType?: GameType, position?: PositionFilter, strength?: SkatersStrength, sortBy?: SkatingDistanceSort): Promise<unknown>;
|
|
581
|
+
/**
|
|
582
|
+
* Top-10 team skating speed lists.
|
|
583
|
+
*/
|
|
584
|
+
declare function top10SkatingSpeed(season?: Season, gameType?: GameType, position?: PositionFilter, sortBy?: SkatingSpeedSort): Promise<unknown>;
|
|
585
|
+
/**
|
|
586
|
+
* Top-10 team zone time lists.
|
|
587
|
+
*/
|
|
588
|
+
declare function top10ZoneTime(season?: Season, gameType?: GameType, strength?: SkatersStrength, sortBy?: ZoneTimeSort): Promise<unknown>;
|
|
589
|
+
|
|
590
|
+
declare const teams_compare: typeof compare;
|
|
591
|
+
declare const teams_leaders: typeof leaders;
|
|
592
|
+
declare const teams_shotLocation: typeof shotLocation;
|
|
593
|
+
declare const teams_shotSpeed: typeof shotSpeed;
|
|
594
|
+
declare const teams_skatingDistance: typeof skatingDistance;
|
|
595
|
+
declare const teams_skatingSpeed: typeof skatingSpeed;
|
|
596
|
+
declare const teams_top10: typeof top10;
|
|
597
|
+
declare const teams_zoneTime: typeof zoneTime;
|
|
598
|
+
declare namespace teams {
|
|
599
|
+
export { teams_compare as compare, teams_leaders as leaders, teams_shotLocation as shotLocation, teams_shotSpeed as shotSpeed, teams_skatingDistance as skatingDistance, teams_skatingSpeed as skatingSpeed, stats$1 as stats, teams_top10 as top10, teams_zoneTime as zoneTime };
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
/**
|
|
603
|
+
* ========================================================================
|
|
604
|
+
* NHL Edge Advanced Stats API Module Exports
|
|
605
|
+
* Base URL: https://api.nhle.com/stats/rest
|
|
606
|
+
* ========================================================================
|
|
607
|
+
* Complete NHL Edge Advanced Stats API implementation with modules for:
|
|
608
|
+
* - Players (skaters, goalies)
|
|
609
|
+
* - Teams and franchises
|
|
610
|
+
* - Advanced statistical numbers
|
|
611
|
+
* ========================================================================
|
|
612
|
+
*/
|
|
613
|
+
|
|
614
|
+
declare const index$1_byTheNumbers: typeof byTheNumbers;
|
|
615
|
+
declare const index$1_goalies: typeof goalies;
|
|
616
|
+
declare const index$1_skaters: typeof skaters;
|
|
617
|
+
declare const index$1_teams: typeof teams;
|
|
618
|
+
declare namespace index$1 {
|
|
619
|
+
export { index$1_byTheNumbers as byTheNumbers, index$1_goalies as goalies, index$1_skaters as skaters, index$1_teams as teams };
|
|
620
|
+
}
|
|
621
|
+
|
|
320
622
|
/**
|
|
321
623
|
* Common types used in Gamecenter API responses
|
|
322
624
|
*/
|
|
@@ -2825,6 +3127,7 @@ declare function playoffSeries(season?: Season): Promise<APIResponse<PlayoffSeri
|
|
|
2825
3127
|
* ```
|
|
2826
3128
|
*/
|
|
2827
3129
|
declare function playoffSeriesSchedule(seriesLetter: SeriesLetter$1, season?: Season): Promise<APIResponse<PlayoffSeriesSchedule>>;
|
|
3130
|
+
declare function playoffSeriesSchedule(seriesLetter: string, season?: Season): Promise<APIResponse<PlayoffSeriesSchedule>>;
|
|
2828
3131
|
/**
|
|
2829
3132
|
* Get information about where games are available to watch
|
|
2830
3133
|
* @returns Promise resolving to streaming and broadcast availability information
|
|
@@ -2905,6 +3208,7 @@ declare function metaGame(gameId: GameId): Promise<APIResponse<GameMeta>>;
|
|
|
2905
3208
|
* ```
|
|
2906
3209
|
*/
|
|
2907
3210
|
declare function metaPlayoffSeries(seriesLetter: SeriesLetter$1, year?: Year): Promise<APIResponse<PlayoffSeriesMeta>>;
|
|
3211
|
+
declare function metaPlayoffSeries(seriesLetter: string, year?: Year): Promise<APIResponse<PlayoffSeriesMeta>>;
|
|
2908
3212
|
/**
|
|
2909
3213
|
* Lookup information based on postal/zip code
|
|
2910
3214
|
*
|
|
@@ -2976,6 +3280,7 @@ declare function landing(playerId: number | string): Promise<APIResponse<PlayerL
|
|
|
2976
3280
|
* ```
|
|
2977
3281
|
*/
|
|
2978
3282
|
declare function gameLog(playerId: number | string, season?: Season, gameType?: GameType): Promise<APIResponse<PlayerGameLog>>;
|
|
3283
|
+
declare function gameLog(playerId: number | string, season?: Season, gameType?: number | string): Promise<APIResponse<PlayerGameLog>>;
|
|
2979
3284
|
/**
|
|
2980
3285
|
* Get player spotlight featuring highlighted players
|
|
2981
3286
|
* @returns Promise resolving to featured/spotlight players
|
|
@@ -2989,12 +3294,13 @@ declare function spotlight(): Promise<APIResponse<PlayerSpotlight[]>>;
|
|
|
2989
3294
|
* Search for players by name
|
|
2990
3295
|
* @param query - The search query string (player name)
|
|
2991
3296
|
* @returns Promise resolving to player search results
|
|
3297
|
+
* @deprecated This endpoint is deprecated and may be removed in future versions. Use the NHL Stats API player endpoint instead.
|
|
2992
3298
|
* @example
|
|
2993
3299
|
* ```ts
|
|
2994
3300
|
* search('McDavid').then((data) => console.log(data));
|
|
2995
3301
|
* ```
|
|
2996
3302
|
*/
|
|
2997
|
-
declare function search(query: string): Promise<APIResponse<PlayerSearchResult>>;
|
|
3303
|
+
declare function search(query: string): Promise<APIResponse<PlayerSearchResult[] | undefined>>;
|
|
2998
3304
|
/**
|
|
2999
3305
|
* Access stats leaders endpoints for skaters and goalies
|
|
3000
3306
|
* @description Get statistical leaders across various categories
|
|
@@ -3589,4 +3895,4 @@ declare const EDGE: {
|
|
|
3589
3895
|
};
|
|
3590
3896
|
};
|
|
3591
3897
|
|
|
3592
|
-
export { type CountryCode$1 as CountryCode, type DraftPicks, type DraftRankings, type DraftRound, type DraftTracker, EDGE, type EventId, type GameId, type GameMeta, type GameNumber, type GameState$1 as GameState, type GameType, type GamecenterBoxscore, type GamecenterLanding, type GamecenterPlayByPlay, type GamecenterReports, type GoalieStatsLeaders, type LeagueSchedule, type LocationInfo, nhl as NHL, type NHLDate, type NHLMonth, type NHLSeasons, type NHLStandings, type NHLStandingsSeason, type NetworkTVSchedule, type PPTReplayEvent, type PPTReplayGoal, type PartnerGameInfo, type PlayerGameLog, type PlayerId, type PlayerLanding, type PlayerSearchResult, type PlayerSpotlight, type PlayoffBracket, type PlayoffRound, type PlayoffSeries, type PlayoffSeriesMeta, type PlayoffSeriesSchedule, type PositionFilter, type PostalCode, type PostalCodeInfo, type SaveLocationCategory, type SaveLocationSort, type SavePercentage5v5Sort, type SavePercentageSort, type ScheduleCalendar, type Score, type Scoreboard, type Season, type SeriesLetter$1 as SeriesLetter, type ShotLocationCategory, type ShotLocationSort, type ShotSpeedSort, type SkaterStatsLeaders, type SkatersStrength, type SkatingDistanceSort, type SkatingSpeedSort, type TeamAbbrev, type TeamId, type TeamProspects, type TeamRoster, type TeamRosterSeasons, type TeamScheduleMonth, type TeamScheduleSeason, type TeamScheduleWeek, type TeamStats, type TeamStatsSeason, type WSCGameStory, type WSCPlayByPlay, type WSCPlayByPlayEvent, type WhereToWatch, type Year, type ZoneTimeSort, index as gc };
|
|
3898
|
+
export { type CountryCode$1 as CountryCode, type DraftPicks, type DraftRankings, type DraftRound, type DraftTracker, EDGE, type EventId, type GameId, type GameMeta, type GameNumber, type GameState$1 as GameState, type GameType, type GamecenterBoxscore, type GamecenterLanding, type GamecenterPlayByPlay, type GamecenterReports, type GoalieStatsLeaders, type LeagueSchedule, type LocationInfo, nhl as NHL, type NHLDate, type NHLMonth, type NHLSeasons, type NHLStandings, type NHLStandingsSeason, type NetworkTVSchedule, type PPTReplayEvent, type PPTReplayGoal, type PartnerGameInfo, type PlayerGameLog, type PlayerId, type PlayerLanding, type PlayerSearchResult, type PlayerSpotlight, type PlayoffBracket, type PlayoffRound, type PlayoffSeries, type PlayoffSeriesMeta, type PlayoffSeriesSchedule, type PositionFilter, type PostalCode, type PostalCodeInfo, type SaveLocationCategory, type SaveLocationSort, type SavePercentage5v5Sort, type SavePercentageSort, type ScheduleCalendar, type Score, type Scoreboard, type Season, type SeriesLetter$1 as SeriesLetter, type ShotLocationCategory, type ShotLocationSort, type ShotSpeedSort, type SkaterStatsLeaders, type SkatersStrength, type SkatingDistanceSort, type SkatingSpeedSort, type TeamAbbrev, type TeamId, type TeamProspects, type TeamRoster, type TeamRosterSeasons, type TeamScheduleMonth, type TeamScheduleSeason, type TeamScheduleWeek, type TeamStats, type TeamStatsSeason, type WSCGameStory, type WSCPlayByPlay, type WSCPlayByPlayEvent, type WhereToWatch, type Year, type ZoneTimeSort, index$1 as adv, index as gc };
|