nhle-api 0.5.1

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/lib/index.js ADDED
@@ -0,0 +1,1899 @@
1
+ import { type } from 'arktype';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __export = (target, all) => {
5
+ for (var name in all)
6
+ __defProp(target, name, { get: all[name], enumerable: true });
7
+ };
8
+
9
+ // src/api/gamecenter/index.ts
10
+ var gamecenter_exports = {};
11
+ __export(gamecenter_exports, {
12
+ draft: () => draft_exports,
13
+ game: () => game_exports,
14
+ misc: () => misc_exports,
15
+ player: () => player_exports,
16
+ score: () => score,
17
+ scoreboard: () => scoreboard,
18
+ team: () => team_exports
19
+ });
20
+
21
+ // src/api/gamecenter/draft.ts
22
+ var draft_exports = {};
23
+ __export(draft_exports, {
24
+ picks: () => picks,
25
+ rankings: () => rankings,
26
+ tracker: () => tracker
27
+ });
28
+
29
+ // src/config/env.ts
30
+ function parseTimeout() {
31
+ const timeout = process.env.NHLE_API_TIMEOUT;
32
+ if (!timeout) return 5e3;
33
+ const parsed = parseInt(timeout, 10);
34
+ if (Number.isNaN(parsed) || parsed <= 0) {
35
+ console.warn(
36
+ `Invalid NHLE_API_TIMEOUT: "${timeout}". Using default 5000ms`
37
+ );
38
+ return 5e3;
39
+ }
40
+ return parsed;
41
+ }
42
+ function parseLanguage() {
43
+ const language = process.env.NHLE_API_LANGUAGE?.toLowerCase();
44
+ if (language === "fr") return "fr";
45
+ if (language && language !== "en") {
46
+ console.warn(
47
+ `Invalid NHLE_API_LANGUAGE: "${language}". Using default 'en'`
48
+ );
49
+ }
50
+ return "en";
51
+ }
52
+ function parseLogLevel() {
53
+ const logLevel = process.env.NHLE_API_LOGLEVEL?.toLowerCase();
54
+ const validLevels = [
55
+ "silent",
56
+ "error",
57
+ "warn",
58
+ "info",
59
+ "debug"
60
+ ];
61
+ if (!logLevel) return "warn";
62
+ if (validLevels.includes(logLevel)) {
63
+ return logLevel;
64
+ }
65
+ console.warn(
66
+ `Invalid NHLE_API_LOGLEVEL: "${logLevel}". Valid options: ${validLevels.join(", ")}. Using default 'warn'`
67
+ );
68
+ return "warn";
69
+ }
70
+ var envConfig = {
71
+ /**
72
+ * Request timeout in milliseconds
73
+ * Set via NHLE_API_TIMEOUT environment variable
74
+ * @default 5000
75
+ */
76
+ timeout: parseTimeout(),
77
+ /**
78
+ * Language code for API responses
79
+ * Set via NHLE_API_LANGUAGE environment variable
80
+ * @default 'en'
81
+ */
82
+ language: parseLanguage(),
83
+ /**
84
+ * Logging level for the client
85
+ * Set via NHLE_API_LOGLEVEL environment variable
86
+ * @default 'warn'
87
+ */
88
+ logLevel: parseLogLevel()
89
+ };
90
+ function logEnvConfig() {
91
+ const vars = {
92
+ timeout: process.env.NHLE_API_TIMEOUT,
93
+ language: process.env.NHLE_API_LANGUAGE,
94
+ logLevel: process.env.NHLE_API_LOGLEVEL
95
+ };
96
+ const configured = Object.entries(vars).filter(
97
+ ([, v]) => v !== void 0
98
+ );
99
+ if (configured.length > 0) {
100
+ console.debug("NHL API Environment Configuration:", {
101
+ ...Object.fromEntries(configured),
102
+ resolvedTimeout: envConfig.timeout,
103
+ resolvedLanguage: envConfig.language,
104
+ resolvedLogLevel: envConfig.logLevel
105
+ });
106
+ }
107
+ }
108
+
109
+ // src/errors/index.ts
110
+ var ErrorCategory = {
111
+ /** Network-level errors (connection refused, timeout, etc.) */
112
+ NETWORK: "NETWORK",
113
+ /** HTTP 4xx client errors (invalid params, not found, etc.) */
114
+ CLIENT: "CLIENT",
115
+ /** HTTP 5xx server errors */
116
+ SERVER: "SERVER",
117
+ /** Rate limiting (HTTP 429) */
118
+ RATE_LIMIT: "RATE_LIMIT",
119
+ /** Valid HTTP response but with error payload */
120
+ API_ERROR: "API_ERROR",
121
+ /** Response parsing/validation failures */
122
+ PARSE: "PARSE",
123
+ /** Invalid user input or configuration */
124
+ VALIDATION: "VALIDATION"
125
+ };
126
+ var LogLevel = {
127
+ ERROR: 1,
128
+ WARN: 2,
129
+ INFO: 3,
130
+ DEBUG: 4
131
+ };
132
+ var NHLError = class extends Error {
133
+ category;
134
+ context;
135
+ constructor(message, category, context = {}) {
136
+ super(message);
137
+ this.name = this.constructor.name;
138
+ this.category = category;
139
+ this.context = {
140
+ ...context,
141
+ timestamp: context.timestamp || /* @__PURE__ */ new Date()
142
+ };
143
+ Error.captureStackTrace?.(this, this.constructor);
144
+ }
145
+ /**
146
+ * Serialize error to JSON
147
+ */
148
+ toJSON() {
149
+ return {
150
+ name: this.name,
151
+ message: this.message,
152
+ category: this.category,
153
+ context: this.context,
154
+ ...this.stack && { stack: this.stack }
155
+ };
156
+ }
157
+ };
158
+ var NetworkError = class extends NHLError {
159
+ constructor(message, context = {}) {
160
+ super(message, ErrorCategory.NETWORK, context);
161
+ }
162
+ };
163
+ var ClientError = class extends NHLError {
164
+ constructor(message, context = {}) {
165
+ super(message, ErrorCategory.CLIENT, context);
166
+ }
167
+ };
168
+ var NotFoundError = class extends ClientError {
169
+ constructor(message = "Resource not found", context = {}) {
170
+ super(message, { ...context, statusCode: context.statusCode || 404 });
171
+ }
172
+ };
173
+ var ServerError = class extends NHLError {
174
+ constructor(message, context = {}) {
175
+ super(message, ErrorCategory.SERVER, context);
176
+ }
177
+ };
178
+ var RateLimitError = class extends NHLError {
179
+ retryAfter;
180
+ constructor(message = "Rate limit exceeded", context = {}, retryAfter) {
181
+ super(message, ErrorCategory.RATE_LIMIT, {
182
+ ...context,
183
+ statusCode: context.statusCode || 429
184
+ });
185
+ this.retryAfter = retryAfter || 0;
186
+ }
187
+ };
188
+ var APIError = class extends NHLError {
189
+ constructor(message, context = {}) {
190
+ super(message, ErrorCategory.API_ERROR, context);
191
+ }
192
+ };
193
+ var ValidationError = class extends NHLError {
194
+ constructor(message, context = {}) {
195
+ super(message, ErrorCategory.VALIDATION, context);
196
+ }
197
+ };
198
+ var ErrorHandler = class {
199
+ config;
200
+ constructor(config = {}) {
201
+ this.config = {
202
+ logLevel: config.logLevel ?? LogLevel.ERROR,
203
+ logger: config.logger ?? this.defaultLogger.bind(this),
204
+ includeStack: config.includeStack ?? true
205
+ };
206
+ }
207
+ /**
208
+ * Default console-based logger
209
+ */
210
+ defaultLogger(level, message, context) {
211
+ if (level > this.config.logLevel) return;
212
+ const logFn = level === LogLevel.ERROR ? console.error : level === LogLevel.WARN ? console.warn : console.log;
213
+ logFn(`[NHL API] ${message}`, context);
214
+ }
215
+ /**
216
+ * Log an error based on configuration
217
+ */
218
+ log(error) {
219
+ const level = this.getLogLevel(error.category);
220
+ const context = this.config.includeStack ? { ...error.context, stack: error.stack } : error.context;
221
+ this.config.logger(level, error.message, context);
222
+ }
223
+ /**
224
+ * Determine log level based on error category
225
+ */
226
+ getLogLevel(category) {
227
+ switch (category) {
228
+ case ErrorCategory.NETWORK:
229
+ case ErrorCategory.SERVER:
230
+ return LogLevel.ERROR;
231
+ case ErrorCategory.RATE_LIMIT:
232
+ return LogLevel.WARN;
233
+ case ErrorCategory.CLIENT:
234
+ case ErrorCategory.API_ERROR:
235
+ return LogLevel.INFO;
236
+ case ErrorCategory.PARSE:
237
+ case ErrorCategory.VALIDATION:
238
+ return LogLevel.DEBUG;
239
+ default:
240
+ return LogLevel.ERROR;
241
+ }
242
+ }
243
+ /**
244
+ * Create error from HTTP response
245
+ */
246
+ async fromResponse(response, context = {}) {
247
+ const statusCode = response.status;
248
+ const baseContext = {
249
+ ...context,
250
+ statusCode,
251
+ endpoint: context.endpoint || response.url
252
+ };
253
+ let responseBody;
254
+ try {
255
+ const text = await response.text();
256
+ responseBody = text ? JSON.parse(text) : null;
257
+ baseContext.responseBody = responseBody;
258
+ } catch {
259
+ }
260
+ const errorMessage = responseBody && typeof responseBody === "object" && "message" in responseBody ? String(responseBody.message) : `HTTP ${statusCode}: ${response.statusText}`;
261
+ if (statusCode === 429) {
262
+ const retryAfter = response.headers.get("Retry-After");
263
+ return new RateLimitError(
264
+ errorMessage,
265
+ baseContext,
266
+ retryAfter ? parseInt(retryAfter, 10) : void 0
267
+ );
268
+ }
269
+ if (statusCode === 404) {
270
+ return new NotFoundError(errorMessage, baseContext);
271
+ }
272
+ if (statusCode >= 500) {
273
+ return new ServerError(errorMessage, baseContext);
274
+ }
275
+ if (statusCode >= 400) {
276
+ return new ClientError(errorMessage, baseContext);
277
+ }
278
+ if (responseBody && typeof responseBody === "object" && "message" in responseBody) {
279
+ return new APIError(errorMessage, baseContext);
280
+ }
281
+ return new NHLError(errorMessage, ErrorCategory.CLIENT, baseContext);
282
+ }
283
+ /**
284
+ * Create error from caught exception
285
+ */
286
+ fromError(error, context = {}) {
287
+ if (error instanceof NHLError) {
288
+ return error;
289
+ }
290
+ if (error instanceof Error) {
291
+ if (error.name === "TypeError" || error.name === "NetworkError") {
292
+ return new NetworkError(error.message, {
293
+ ...context,
294
+ cause: error
295
+ });
296
+ }
297
+ return new NHLError(error.message, ErrorCategory.NETWORK, {
298
+ ...context,
299
+ cause: error
300
+ });
301
+ }
302
+ return new NHLError(
303
+ "An unknown error occurred",
304
+ ErrorCategory.NETWORK,
305
+ { ...context, cause: error }
306
+ );
307
+ }
308
+ /**
309
+ * Update configuration
310
+ */
311
+ configure(config) {
312
+ this.config = { ...this.config, ...config };
313
+ }
314
+ };
315
+ new ErrorHandler();
316
+
317
+ // src/client/types.ts
318
+ var API_BASE_URLS = {
319
+ "edge-adv": "https://api-web.nhle.com/v1",
320
+ "edge-stats": "https://api.nhle.com/stats/rest",
321
+ default: "https://api-web.nhle.com/v1"
322
+ };
323
+
324
+ // src/client/index.ts
325
+ var DEFAULT_CONFIG = {
326
+ baseUrl: "https://api-web.nhle.com/v1",
327
+ timeout: envConfig.timeout,
328
+ headers: {
329
+ Accept: "application/json"
330
+ },
331
+ language: envConfig.language
332
+ };
333
+ var NHLClient = class {
334
+ config;
335
+ errorHandler;
336
+ /**
337
+ * Creates a new NHL API client instance
338
+ * @param baseURL - Optional custom base URL or predefined API endpoint key
339
+ * @param errorConfig - Optional error handling configuration
340
+ */
341
+ constructor(baseURL, errorConfig) {
342
+ this.config = { ...DEFAULT_CONFIG };
343
+ if (baseURL && baseURL in API_BASE_URLS) {
344
+ this.config.baseUrl = API_BASE_URLS[baseURL];
345
+ } else if (baseURL) {
346
+ this.config.baseUrl = baseURL;
347
+ }
348
+ this.errorHandler = new ErrorHandler(errorConfig);
349
+ }
350
+ /**
351
+ * Helper to build URL with query parameters
352
+ * @private
353
+ */
354
+ buildUrl(endpoint, params) {
355
+ const cleanEndpoint = endpoint.startsWith("/") ? endpoint.slice(1) : endpoint;
356
+ const url = new URL(cleanEndpoint, `${this.config.baseUrl}/`);
357
+ if (params) {
358
+ Object.entries(params).forEach(([key, value]) => {
359
+ if (value !== void 0 && value !== null) {
360
+ url.searchParams.append(key, String(value));
361
+ }
362
+ });
363
+ }
364
+ return url.toString();
365
+ }
366
+ /**
367
+ * Send a GET request to the NHL API
368
+ * @param endpoint - API endpoint path
369
+ * @param params - Optional query parameters
370
+ * @returns Promise resolving to an APIResponse containing either data or error
371
+ */
372
+ async get(endpoint, params) {
373
+ const url = this.buildUrl(endpoint, params);
374
+ const controller = new AbortController();
375
+ const timeoutId = setTimeout(
376
+ () => controller.abort(),
377
+ this.config.timeout
378
+ );
379
+ try {
380
+ const response = await fetch(url, {
381
+ method: "GET",
382
+ headers: {
383
+ ...this.config.headers,
384
+ "Accept-Language": this.config.language
385
+ },
386
+ signal: controller.signal
387
+ });
388
+ clearTimeout(timeoutId);
389
+ if (!response.ok) {
390
+ const error = await this.errorHandler.fromResponse(response, {
391
+ endpoint: url
392
+ });
393
+ this.errorHandler.log(error);
394
+ return { status: "error", error };
395
+ }
396
+ return { data: await response.json(), status: "success" };
397
+ } catch (error) {
398
+ clearTimeout(timeoutId);
399
+ if (error instanceof NHLError) {
400
+ this.errorHandler.log(error);
401
+ return { status: "error", error };
402
+ }
403
+ let nhlError;
404
+ if (error instanceof Error && error.name === "AbortError") {
405
+ nhlError = new NHLError(
406
+ "Request timeout",
407
+ ErrorCategory.CLIENT,
408
+ {
409
+ endpoint
410
+ }
411
+ );
412
+ } else {
413
+ nhlError = this.errorHandler.fromError(error, {
414
+ endpoint,
415
+ method: "GET"
416
+ });
417
+ }
418
+ this.errorHandler.log(nhlError);
419
+ return { status: "error", error: nhlError };
420
+ }
421
+ }
422
+ /**
423
+ * Configure error handling behavior
424
+ * @param config - Error configuration options
425
+ */
426
+ configureErrorHandling(config) {
427
+ this.errorHandler.configure(config);
428
+ }
429
+ };
430
+ function createNHLClient(baseURL, errorConfig) {
431
+ return new NHLClient(baseURL, errorConfig);
432
+ }
433
+ var nhlClient = createNHLClient("default");
434
+ createNHLClient("edge-stats");
435
+ var client_default = nhlClient;
436
+
437
+ // src/utils/date.ts
438
+ var NHL_TIMEZONE = "America/New_York";
439
+ var getDate = (date) => new Intl.DateTimeFormat("en-CA", {
440
+ timeZone: NHL_TIMEZONE,
441
+ year: "numeric",
442
+ month: "2-digit",
443
+ day: "2-digit"
444
+ }).format(date);
445
+ var getCurrentDate = () => getDate(/* @__PURE__ */ new Date());
446
+ var getYear = (date) => new Intl.DateTimeFormat("en-CA", {
447
+ timeZone: NHL_TIMEZONE,
448
+ year: "numeric"
449
+ }).format(date);
450
+ var getCurrentYear = () => getYear(/* @__PURE__ */ new Date());
451
+ var getSeason = (date) => {
452
+ const format = new Intl.DateTimeFormat("en-CA", {
453
+ timeZone: NHL_TIMEZONE,
454
+ year: "numeric",
455
+ month: "numeric"
456
+ }).formatToParts(date instanceof Date ? date : new Date(date));
457
+ const month = format.find((part) => part.type === "month")?.value;
458
+ const year = format.find((part) => part.type === "year")?.value;
459
+ if (!year) {
460
+ throw new Error("Invalid date provided, could not extract year");
461
+ }
462
+ if (month && parseInt(month, 10) < 7) {
463
+ console.log(month, parseInt(month, 10) < 7);
464
+ return `${parseInt(year, 10) - 1}${year}`;
465
+ }
466
+ return `${year}${parseInt(year, 10) + 1}`;
467
+ };
468
+ var getCurrentSeason = () => getSeason(/* @__PURE__ */ new Date());
469
+
470
+ // src/constants/edge-adv.ts
471
+ var edge_adv_exports = {};
472
+ __export(edge_adv_exports, {
473
+ PositionFilterEnum: () => PositionFilterEnum,
474
+ SaveLocationCategoryEnum: () => SaveLocationCategoryEnum,
475
+ SaveLocationSortEnum: () => SaveLocationSortEnum,
476
+ SavePercentage5v5SortEnum: () => SavePercentage5v5SortEnum,
477
+ SavePercentageSortEnum: () => SavePercentageSortEnum,
478
+ ShotLocationCategoryEnum: () => ShotLocationCategoryEnum,
479
+ ShotLocationSortEnum: () => ShotLocationSortEnum,
480
+ ShotSpeedSortEnum: () => ShotSpeedSortEnum,
481
+ SkatersStrengthEnum: () => SkatersStrengthEnum,
482
+ SkatingDistanceSortEnum: () => SkatingDistanceSortEnum,
483
+ SkatingSpeedSortEnum: () => SkatingSpeedSortEnum,
484
+ ZoneTimeSortEnum: () => ZoneTimeSortEnum
485
+ });
486
+ var SaveLocationCategoryEnum = {
487
+ /** Save Percentage */
488
+ "SV%": "save-pctg",
489
+ /** Saves */
490
+ SV: "saves",
491
+ /** Shots Against */
492
+ SA: "shots-against",
493
+ /** Goals Against */
494
+ GA: "goals-against"
495
+ };
496
+ var ShotLocationSortEnum = {
497
+ /** All shot locations */
498
+ ALL: "all",
499
+ /** High-danger (i.e. close-range) shot locations */
500
+ HIGH: "high",
501
+ /** Mid-range shot locations */
502
+ MID: "mid",
503
+ /** Long-range shot locations */
504
+ LONG: "long"
505
+ };
506
+ var SaveLocationSortEnum = ShotLocationSortEnum;
507
+ var SavePercentage5v5SortEnum = {
508
+ /**5v5 Save %: The percentage of shots a goalie stops at even strength (5-on-5). */
509
+ "5v5-SV%": "save-pctg",
510
+ /**5v5 Save % in Close Situations: A “close situation” is the time during which a game is tied in the first or second period, or within one goal in the third period. This stats helps how goalies perform in high-pressure situations.*/
511
+ "5v5-SV%-Close": "save-pctg-close",
512
+ /**5v5 Shots Against: The total number of shots a goalie faces at even strength (5-on-5).*/
513
+ "5v5-SA": "shots",
514
+ /**5v5 Shots Against per 60 Minutes: The total number of shots a goalie faces at even strength (5-on-5) normalized to a 60-minute game. */
515
+ "5v5-SA/60": "shots-per-60"
516
+ };
517
+ var SavePercentageSortEnum = {
518
+ /** Starts above .900 */
519
+ GAMES: "games",
520
+ /** Percentage of starts above .900 */
521
+ PCTG: "pctg"
522
+ };
523
+ var PositionFilterEnum = {
524
+ /** Center */
525
+ ALL: "all",
526
+ /** Left Wing */
527
+ FWD: "forwards",
528
+ /** Right Wing */
529
+ DEF: "defense"
530
+ };
531
+ var SkatersStrengthEnum = {
532
+ /** All strengths */
533
+ ALL: "all",
534
+ /** Even strength */
535
+ ES: "es",
536
+ /** Power play */
537
+ PP: "pp",
538
+ /** Short-handed */
539
+ PK: "pk"
540
+ };
541
+ var ShotSpeedSortEnum = {
542
+ /** Hardest shot recorded by player */
543
+ MAX: "max",
544
+ /** Shots over 100 mph */
545
+ "OVER-100": "over-100",
546
+ /** Shots between 90 and 99 mph */
547
+ "90-99": "90-99",
548
+ /** Shots between 80 and 89 mph */
549
+ "80-89": "80-89",
550
+ /** Shots between 70 and 79 mph */
551
+ "70-79": "70-79"
552
+ };
553
+ var SkatingSpeedSortEnum = {
554
+ /** Fastest skating speed recorded by player */
555
+ TOP: "max",
556
+ /** Speed bursts recorded over 22 mph */
557
+ "OVER-22": "over-22",
558
+ /** Speed bursts recorded between 20 and 22 mph */
559
+ "20-22": "20-22",
560
+ /** Speed bursts recorded between 18 and 20 mph */
561
+ "18-20": "18-20"
562
+ };
563
+ var SkatingDistanceSortEnum = {
564
+ /** Total distance skated */
565
+ TOTAL: "total",
566
+ /** Average distance skated per 60 minutes */
567
+ "PER-60": "per-60",
568
+ /** Maximum distance skated in a single period */
569
+ "MAX-PERIOD": "max-period",
570
+ /** Maximum distance skated in a single game */
571
+ "MAX-GAME": "max-game"
572
+ };
573
+ var ShotLocationCategoryEnum = {
574
+ /** Total shots on goal */
575
+ SOG: "sog",
576
+ /** Total goals */
577
+ G: "goals",
578
+ /** Shooting percentage */
579
+ "SH%": "shooting-pctg"
580
+ };
581
+ var ZoneTimeSortEnum = {
582
+ /** Percentage of time spent in the offensive zone */
583
+ OZ: "offensive",
584
+ /** Percentage of time spent in the defensive zone */
585
+ DZ: "defensive",
586
+ /** Percentage of time spent in the neutral zone */
587
+ NZ: "neutral"
588
+ };
589
+
590
+ // src/constants/edge-stats.ts
591
+ var edge_stats_exports = {};
592
+
593
+ // src/constants/nhl.ts
594
+ var nhl_exports = {};
595
+ __export(nhl_exports, {
596
+ CURRENT: () => CURRENT,
597
+ END_SEASON: () => END_SEASON,
598
+ END_YEAR: () => END_YEAR,
599
+ GameStateEnum: () => GameStateEnum,
600
+ GameTypeEnum: () => GameTypeEnum,
601
+ InactiveTeamsEnum: () => InactiveTeamsEnum,
602
+ InactiveTeamsReverseEnum: () => InactiveTeamsReverseEnum,
603
+ PLAYER_ID_RANGE: () => PLAYER_ID_RANGE,
604
+ PeriodTypeEnum: () => PeriodTypeEnum,
605
+ PlayoffSeriesEnum: () => PlayoffSeriesEnum,
606
+ SEASON_RANGE: () => SEASON_RANGE,
607
+ START_SEASON: () => START_SEASON,
608
+ START_YEAR: () => START_YEAR,
609
+ SeasonsArray: () => SeasonsArray,
610
+ SeriesLetterByRound: () => SeriesLetterByRound,
611
+ SeriesLetterEnum: () => SeriesLetterEnum,
612
+ TEAM_ID_RANGE: () => TEAM_ID_RANGE,
613
+ TeamsEnum: () => TeamsEnum,
614
+ TeamsReverseEnum: () => TeamsReverseEnum,
615
+ YEAR_RANGE: () => YEAR_RANGE
616
+ });
617
+ var TeamsEnum = {
618
+ /** Anaheim Ducks */
619
+ ANA: 24,
620
+ /** Boston Bruins */
621
+ BOS: 6,
622
+ /** Buffalo Sabres */
623
+ BUF: 7,
624
+ /** Calgary Flames */
625
+ CGY: 20,
626
+ /** Carolina Hurricanes */
627
+ CAR: 12,
628
+ /** Chicago Blackhawks */
629
+ CHI: 16,
630
+ /** Colorado Avalanche */
631
+ COL: 21,
632
+ /** Columbus Blue Jackets */
633
+ CBJ: 29,
634
+ /** Dallas Stars */
635
+ DAL: 25,
636
+ /** Detroit Red Wings */
637
+ DET: 17,
638
+ /** Edmonton Oilers */
639
+ EDM: 22,
640
+ /** Florida Panthers */
641
+ FLA: 13,
642
+ /** Los Angeles Kings */
643
+ LAK: 26,
644
+ /** Minnesota Wild*/
645
+ MIN: 30,
646
+ /** Montreal Canadiens */
647
+ MTL: 8,
648
+ /** New Jersey Devils */
649
+ NJD: 1,
650
+ /** Nashville Predators */
651
+ NSH: 18,
652
+ /** New York Islanders */
653
+ NYI: 2,
654
+ /** New York Rangers */
655
+ NYR: 3,
656
+ /** Ottawa Senators */
657
+ OTT: 9,
658
+ /** Philadelphia Flyers */
659
+ PHI: 4,
660
+ /** Pittsburgh Penguins */
661
+ PIT: 5,
662
+ /** San Jose Sharks */
663
+ SJS: 28,
664
+ /** Seattle Kraken */
665
+ SEA: 55,
666
+ /** St. Louis Blues */
667
+ STL: 19,
668
+ /** Tampa Bay Lightning */
669
+ TBL: 14,
670
+ /** Toronto Maple Leafs */
671
+ TOR: 10,
672
+ /** Utah Hockey Club */
673
+ UTA: 59,
674
+ /** Vancouver Canucks */
675
+ VAN: 23,
676
+ /** Vegas Golden Knights */
677
+ VGK: 54,
678
+ /** Winnipeg Jets */
679
+ WPG: 52,
680
+ /** Washington Capitals */
681
+ WSH: 15
682
+ };
683
+ var TeamsReverseEnum = Object.fromEntries(
684
+ Object.entries(TeamsEnum).map(([key, value]) => [value, key])
685
+ );
686
+ var InactiveTeamsEnum = {
687
+ /** Atlanta Flames (not active) */
688
+ AFM: 47,
689
+ /** Arizona Coyotes (not active) */
690
+ ARI: 53,
691
+ /** Atlanta Thrashers (not active) */
692
+ ATL: 11,
693
+ /** Brooklyn Americans - (not active) */
694
+ BRK: 51,
695
+ /** California Golden Seals (aka Bay Area Seals) - (not active) */
696
+ CGS: 56,
697
+ /** Cleveland Barons - (not active) */
698
+ CLE: 49,
699
+ /** Colorado Rockies - (not active) */
700
+ CLR: 35,
701
+ /** Detroit Cougars - (not active) */
702
+ DCG: 40,
703
+ /** Detroit Falcons - (not active) */
704
+ DFL: 50,
705
+ /** Hamilton Tigers - (not active) */
706
+ HAM: 37,
707
+ /** Hartford Whalers - (not active) */
708
+ HFD: 34,
709
+ /** Kansas City Scouts - (not active) */
710
+ KCS: 48,
711
+ /** Montreal Maroons - (not active) */
712
+ MMR: 43,
713
+ /** Minnesota North Stars - (not active) */
714
+ MNS: 31,
715
+ /** Montreal Wanderers - (not active) */
716
+ MWN: 41,
717
+ /** New York Americans - (not active) */
718
+ NYA: 44,
719
+ /** California Seals (aka Oakland Seals) - (not active) */
720
+ OAK: 46,
721
+ /** Phoenix Coyotes - (not active) */
722
+ PHX: 27,
723
+ /** Pittsburgh Pirates - (not active) */
724
+ PIR: 38,
725
+ /** Quebec Bulldogs - (not active) */
726
+ QBD: 42,
727
+ /** Philadelphia Quakers - (not active) */
728
+ QUA: 39,
729
+ /** Quebec Nordiques - (not active) */
730
+ QUE: 32,
731
+ /** Ottawa Senators (original franchise) - (not active) */
732
+ SEN: 36,
733
+ /** St. Louis Eagles - (not active) */
734
+ SLE: 45,
735
+ /** Toronto Hockey Club (aka Toronto Arenas) - (not active) */
736
+ TAN: 57,
737
+ /** Toronto St. Patricks - (not active) */
738
+ TSP: 58,
739
+ /** Winnipeg Jets (original franchise) - (not active) */
740
+ WIN: 33
741
+ };
742
+ var InactiveTeamsReverseEnum = Object.fromEntries(
743
+ Object.entries(InactiveTeamsEnum).map(([key, value]) => [value, key])
744
+ );
745
+ var SeasonsArray = [
746
+ 19171918,
747
+ 19181919,
748
+ 19191920,
749
+ 19201921,
750
+ 19211922,
751
+ 19221923,
752
+ 19231924,
753
+ 19241925,
754
+ 19251926,
755
+ 19261927,
756
+ 19271928,
757
+ 19281929,
758
+ 19291930,
759
+ 19301931,
760
+ 19311932,
761
+ 19321933,
762
+ 19331934,
763
+ 19341935,
764
+ 19351936,
765
+ 19361937,
766
+ 19371938,
767
+ 19381939,
768
+ 19391940,
769
+ 19401941,
770
+ 19411942,
771
+ 19421943,
772
+ 19431944,
773
+ 19441945,
774
+ 19451946,
775
+ 19461947,
776
+ 19471948,
777
+ 19481949,
778
+ 19491950,
779
+ 19501951,
780
+ 19511952,
781
+ 19521953,
782
+ 19531954,
783
+ 19541955,
784
+ 19551956,
785
+ 19561957,
786
+ 19571958,
787
+ 19581959,
788
+ 19591960,
789
+ 19601961,
790
+ 19611962,
791
+ 19621963,
792
+ 19631964,
793
+ 19641965,
794
+ 19651966,
795
+ 19661967,
796
+ 19671968,
797
+ 19681969,
798
+ 19691970,
799
+ 19701971,
800
+ 19711972,
801
+ 19721973,
802
+ 19731974,
803
+ 19741975,
804
+ 19751976,
805
+ 19761977,
806
+ 19771978,
807
+ 19781979,
808
+ 19791980,
809
+ 19801981,
810
+ 19811982,
811
+ 19821983,
812
+ 19831984,
813
+ 19841985,
814
+ 19851986,
815
+ 19861987,
816
+ 19871988,
817
+ 19881989,
818
+ 19891990,
819
+ 19901991,
820
+ 19911992,
821
+ 19921993,
822
+ 19931994,
823
+ 19941995,
824
+ 19951996,
825
+ 19961997,
826
+ 19971998,
827
+ 19981999,
828
+ 19992e3,
829
+ 20002001,
830
+ 20012002,
831
+ 20022003,
832
+ 20032004,
833
+ 20052006,
834
+ 20062007,
835
+ 20072008,
836
+ 20082009,
837
+ 20092010,
838
+ 20102011,
839
+ 20112012,
840
+ 20122013,
841
+ 20132014,
842
+ 20142015,
843
+ 20152016,
844
+ 20162017,
845
+ 20172018,
846
+ 20182019,
847
+ 20192020,
848
+ 20202021,
849
+ 20212022,
850
+ 20222023,
851
+ 20232024,
852
+ 20242025,
853
+ 20252026
854
+ ];
855
+ var SeriesLetterEnum = {
856
+ /** Atlantic Division Round 1: D1 vs WC# */
857
+ A: "A",
858
+ /** Atlantic Division Round 1: D2 vs D3 */
859
+ B: "B",
860
+ /** Metropolitan Division Round 1: D1 vs WC# */
861
+ C: "C",
862
+ /** Metropolitan Division Round 1: D2 vs D3 */
863
+ D: "D",
864
+ /** Central Division Round 1: D1 vs WC# */
865
+ E: "E",
866
+ /** Central Division Round 1: D2 vs D3 */
867
+ F: "F",
868
+ /** Pacific Division Round 1: D1 vs WC# */
869
+ G: "G",
870
+ /** Pacific Division Round 1: D2 vs D3 */
871
+ H: "H",
872
+ /** Atlantic Division Round 2: Aw vs Bw */
873
+ I: "I",
874
+ /** Metropolitan Division Round 2: Cw vs Dw */
875
+ J: "J",
876
+ /** Central Division Round 2: Ew vs Fw */
877
+ K: "K",
878
+ /** Pacific Division Round 2: Gw vs Hw */
879
+ L: "L",
880
+ /** Eastern Conference Finals */
881
+ M: "M",
882
+ /** Western Conference Finals*/
883
+ N: "N",
884
+ /** Stanley Cup Finals */
885
+ O: "O"
886
+ };
887
+ var SeriesLetterByRound = {
888
+ R1: ["A", "B", "C", "D", "E", "F", "G", "H"],
889
+ R2: ["I", "J", "K", "L"],
890
+ CF: ["M", "N"],
891
+ SCF: ["O"]
892
+ };
893
+ var PlayoffSeriesEnum = {
894
+ Atlantic_R1_D1_vs_WC: "A",
895
+ Atlantic_R1_D2_vs_D3: "B",
896
+ Metropolitan_R1_D1_vs_WC: "C",
897
+ Metropolitan_R1_D2_vs_D3: "D",
898
+ Central_R1_D1_vs_WC: "E",
899
+ Central_R1_D2_vs_D3: "F",
900
+ Pacific_R1_D1_vs_WC: "G",
901
+ Pacific_R1_D2_vs_D3: "H",
902
+ Atlantic_R2_Aw_vs_Bw: "I",
903
+ Metropolitan_R2_Cw_vs_Dw: "J",
904
+ Central_R2_Ew_vs_Fw: "K",
905
+ Pacific_R2_Gw_vs_Hw: "L",
906
+ Eastern_Conference_Finals: "M",
907
+ Western_Conference_Finals: "N",
908
+ Stanley_Cup_Finals: "O"
909
+ };
910
+ var GameStateEnum = {
911
+ /** Future */
912
+ FUT: "FUT",
913
+ /** Live */
914
+ LIV: "LIV",
915
+ /** Finished */
916
+ FIN: "FIN"
917
+ };
918
+ var PeriodTypeEnum = {
919
+ /** Regulation */
920
+ REG: "REG",
921
+ /** Overtime */
922
+ OT: "OT",
923
+ /** Shootout */
924
+ SO: "SO"
925
+ };
926
+ var GameTypeEnum = {
927
+ /** Pre-season */
928
+ PRE: 1,
929
+ /** Regular season */
930
+ REG: 2,
931
+ /** Post-season (aka playoffs) */
932
+ POST: 3,
933
+ /** All-Star Game (unconfirmed) */
934
+ ASG: 4,
935
+ /** International (unconfirmed) */
936
+ INTL: 19
937
+ };
938
+ var SEASON_RANGE = {
939
+ START: SeasonsArray[0],
940
+ END: SeasonsArray.at(-1)
941
+ };
942
+ var START_SEASON = SEASON_RANGE.START;
943
+ var END_SEASON = SEASON_RANGE.END;
944
+ var YEAR_RANGE = {
945
+ START: parseInt(SEASON_RANGE.START.toString().slice(0, 4), 10),
946
+ END: parseInt(SEASON_RANGE.END.toString().slice(4, 8), 10)
947
+ };
948
+ var START_YEAR = YEAR_RANGE.START;
949
+ var END_YEAR = YEAR_RANGE.END;
950
+ var CURRENT = {
951
+ SEASON: SEASON_RANGE.END,
952
+ YEAR: YEAR_RANGE.END
953
+ };
954
+ var PLAYER_ID_RANGE = { MIN: 8444e3, MAX: 8489999 };
955
+ var TEAM_ID_RANGE = { MIN: 1, MAX: 59 };
956
+
957
+ // src/constants/index.ts
958
+ var EDGE = { ...edge_adv_exports, ...edge_stats_exports };
959
+
960
+ // src/utils/schemas.ts
961
+ function isParseError(value) {
962
+ return value instanceof type.errors;
963
+ }
964
+ var Year = type(`${nhl_exports.START_YEAR} <= number <= ${nhl_exports.END_YEAR}`).or(
965
+ type("string.numeric.parse").narrow((v) => {
966
+ return v >= nhl_exports.START_YEAR && v <= nhl_exports.END_YEAR;
967
+ })
968
+ ).describe(`a valid year from ${nhl_exports.START_YEAR} to ${nhl_exports.END_YEAR}`);
969
+ var Season = type("number.integer | string.numeric.parse").narrow((v) => {
970
+ const yr = Math.trunc(v / 1e4);
971
+ return typeof Year(yr) === "number" && yr + 1 === v % 1e4;
972
+ }).pipe((v) => v.toString()).describe(`a valid NHL season, e.g. ${nhl_exports.CURRENT.SEASON}`);
973
+ var TeamAbbrev = type.enumerated(
974
+ ...Object.keys(nhl_exports.TeamsEnum),
975
+ ...Object.keys(
976
+ nhl_exports.InactiveTeamsEnum
977
+ )
978
+ ).describe("a valid NHL team abbreviation");
979
+ var TeamId = type.enumerated(...Object.values(nhl_exports.TeamsEnum)).describe("a valid NHL team ID");
980
+ var GameType = type.enumerated(
981
+ ...Object.keys(
982
+ nhl_exports.GameTypeEnum
983
+ )
984
+ ).pipe((v) => nhl_exports.GameTypeEnum[v]).or(type('1|2|3|4|19|"1"|"2"|"3"|"4"|"19"')).describe("a valid NHL game type (e.g., REG, PRE, POST)");
985
+ var GameNumber = type("number").atLeast(1).atMost(82 * 32 / 2).or(
986
+ type("string.numeric.parse").narrow((v) => {
987
+ return v >= 1 && v <= 82 * 32 / 2;
988
+ })
989
+ ).pipe((v) => v.toString()).describe("a valid NHL game number between 1 and 1312");
990
+ var DraftRound = type("1 <= number <= 7").or(type(/^(1|2|3|4|5|6|7)$/)).pipe((v) => typeof v === "number" ? v.toString() : v).describe("a valid NHL draft round (1-7)");
991
+ type("1 <= number <= 4").or(type(/^(1|2|3|4)$/)).pipe((v) => typeof v === "number" ? v.toString() : v).describe("a valid NHL playoff round (1-4)");
992
+ var EventId = type("number.integer | string.numeric.parse").narrow((v) => Number.isInteger(v) && v > 0).describe("a positive integer representing an NHL event ID");
993
+ var NHLDate = type("Date | string.date.iso").pipe(
994
+ (v) => typeof v === "string" ? new Date(v).toISOString().slice(0, 10) : v.toISOString().slice(0, 10)
995
+ ).describe(
996
+ "a valid date, either as a string (ISO date string) or a Date object"
997
+ );
998
+ type("Date | string").narrow((v) => {
999
+ if (typeof v === "string") {
1000
+ return /^\d{4}-\d{2}$/.test(v);
1001
+ } else if (v instanceof Date) {
1002
+ return true;
1003
+ }
1004
+ return false;
1005
+ }).pipe((v) => typeof v === "string" ? v : v.toISOString().slice(0, 7)).describe(
1006
+ "a valid month, either as a string (formatted as YYYY-MM) or a Date object"
1007
+ );
1008
+ type("1|2|3|4|19").describe(
1009
+ "a valid NHL game type code (1=PRE, 2=REG, 3=POST, 4=ASG, 19=INTL)"
1010
+ );
1011
+ var parseGameIdParts = type({
1012
+ year: Year,
1013
+ gameType: GameType,
1014
+ gameNumber: GameNumber
1015
+ });
1016
+ var GameId = type("number.integer | string.numeric.parse").narrow((v) => {
1017
+ if (Number.isInteger(v) && v < 0) return false;
1018
+ const year = Math.trunc(v / 1e6);
1019
+ const gameType = Math.trunc(v / 1e4) % 100;
1020
+ const gameNumber = v % 1e4;
1021
+ const valid = !(parseGameIdParts({ year, gameType, gameNumber }) instanceof type.errors);
1022
+ return valid;
1023
+ }).describe("a positive integer representing an NHL game ID");
1024
+ var SeriesLetter = type.enumerated(...Object.values(nhl_exports.SeriesLetterEnum)).describe("a valid NHL playoff series letter (A-O)");
1025
+ type.enumerated(...Object.values(nhl_exports.GameStateEnum)).describe("a valid NHL game state");
1026
+ var CountryCode = type(/^[a-zA-Z]{2}$/).pipe((v) => v.toLowerCase()).describe("a valid ISO 3166-1 alpha-2 country code, e.g. US, CA, RU");
1027
+ var PostalCode = type(/^[a-zA-Z]\d[a-zA-Z] \d[a-zA-Z]\d$/).or(type(/^\d{5}$/)).describe(
1028
+ "a valid postal code, either US ZIP code (5 digit) or Canadian postal code (A1A 1A1 format; space required)"
1029
+ );
1030
+ var PlayerId = type("number").atLeast(nhl_exports.PLAYER_ID_RANGE.MIN).atMost(nhl_exports.PLAYER_ID_RANGE.MAX).or(
1031
+ type("string.numeric.parse").narrow((v) => {
1032
+ return v >= nhl_exports.PLAYER_ID_RANGE.MIN && v <= nhl_exports.PLAYER_ID_RANGE.MAX;
1033
+ })
1034
+ ).pipe((v) => v.toString()).describe("a valid NHL player ID");
1035
+ type.enumerated(
1036
+ ...Object.keys(
1037
+ EDGE.SaveLocationCategoryEnum
1038
+ )
1039
+ ).pipe((v) => EDGE.SaveLocationCategoryEnum[v]);
1040
+ type.enumerated(
1041
+ ...Object.keys(
1042
+ EDGE.ShotLocationSortEnum
1043
+ )
1044
+ ).pipe((v) => EDGE.ShotLocationSortEnum[v]);
1045
+ type.enumerated(
1046
+ ...Object.keys(
1047
+ EDGE.SaveLocationSortEnum
1048
+ )
1049
+ ).pipe((v) => EDGE.SaveLocationSortEnum[v]);
1050
+ type.enumerated(
1051
+ ...Object.keys(
1052
+ EDGE.SavePercentage5v5SortEnum
1053
+ )
1054
+ ).pipe((v) => EDGE.SavePercentage5v5SortEnum[v]);
1055
+ type.enumerated(
1056
+ ...Object.keys(
1057
+ EDGE.SavePercentageSortEnum
1058
+ )
1059
+ ).pipe((v) => EDGE.SavePercentageSortEnum[v]);
1060
+ var PositionFilter = type.enumerated(
1061
+ ...Object.keys(
1062
+ EDGE.PositionFilterEnum
1063
+ )
1064
+ ).pipe((v) => EDGE.PositionFilterEnum[v]);
1065
+ var SkatersStrength = type.enumerated(
1066
+ ...Object.keys(
1067
+ EDGE.SkatersStrengthEnum
1068
+ )
1069
+ ).pipe((v) => EDGE.SkatersStrengthEnum[v]);
1070
+ type.enumerated(
1071
+ ...Object.keys(
1072
+ EDGE.ShotSpeedSortEnum
1073
+ )
1074
+ ).pipe((v) => EDGE.ShotSpeedSortEnum[v]);
1075
+ type.enumerated(
1076
+ ...Object.keys(
1077
+ EDGE.SkatingSpeedSortEnum
1078
+ )
1079
+ ).pipe((v) => EDGE.SkatingSpeedSortEnum[v]);
1080
+ type.enumerated(
1081
+ ...Object.keys(
1082
+ EDGE.SkatingDistanceSortEnum
1083
+ )
1084
+ );
1085
+ type.enumerated(
1086
+ ...Object.keys(
1087
+ EDGE.ShotLocationCategoryEnum
1088
+ )
1089
+ ).pipe((v) => EDGE.ShotLocationCategoryEnum[v]);
1090
+ type.enumerated(
1091
+ ...Object.keys(
1092
+ EDGE.ZoneTimeSortEnum
1093
+ )
1094
+ ).pipe((v) => EDGE.ZoneTimeSortEnum[v]);
1095
+ var BaseParams = type({
1096
+ season: Season.or("undefined").pipe((v) => v ?? nhl_exports.CURRENT.SEASON),
1097
+ gameType: GameType.or("undefined").pipe(
1098
+ (v) => v ?? nhl_exports.GameTypeEnum.REG
1099
+ )
1100
+ });
1101
+ type({
1102
+ season: Season.or("undefined").optional(),
1103
+ gameType: GameType.or("undefined").optional()
1104
+ });
1105
+ BaseParams.merge({
1106
+ playerId: PlayerId,
1107
+ season: Season
1108
+ });
1109
+ BaseParams.merge({
1110
+ teamId: TeamId
1111
+ });
1112
+ BaseParams.merge({
1113
+ position: PositionFilter.default("ALL"),
1114
+ strength: SkatersStrength.default("ALL")
1115
+ });
1116
+ var DraftParams = type({
1117
+ year: Year.or("undefined").pipe((v) => v ?? nhl_exports.CURRENT.YEAR),
1118
+ round: DraftRound.or("undefined").optional()
1119
+ });
1120
+ var GameIdAndEventId = type({
1121
+ gameId: GameId,
1122
+ eventId: EventId
1123
+ });
1124
+ var TeamAndSeasonParams = type({
1125
+ team: TeamAbbrev,
1126
+ season: Season.or("undefined").pipe((v) => v ?? nhl_exports.CURRENT.SEASON)
1127
+ });
1128
+ var SeriesAndSeasonParams = type({
1129
+ seriesLetter: SeriesLetter,
1130
+ season: Season.or("undefined").pipe((v) => v ?? nhl_exports.CURRENT.SEASON)
1131
+ });
1132
+ var SeriesParams = type({
1133
+ seriesLetter: SeriesLetter,
1134
+ year: Year.or("undefined").pipe((v) => v ?? nhl_exports.CURRENT.YEAR)
1135
+ });
1136
+ var ScheduleParams = type({
1137
+ team: TeamAbbrev,
1138
+ date: NHLDate.or("undefined").pipe((v) => v ?? getCurrentDate()),
1139
+ period: type('"week" | "month" | undefined').pipe((v) => v ?? "week")
1140
+ });
1141
+
1142
+ // src/utils/utils.ts
1143
+ function route(template, params) {
1144
+ let route2 = template;
1145
+ for (const [key, value] of Object.entries(params)) {
1146
+ if (value === void 0) continue;
1147
+ route2 = route2.replace(`{${key}}`, String(value));
1148
+ }
1149
+ return route2;
1150
+ }
1151
+
1152
+ // src/api/gamecenter/draft.ts
1153
+ var _paths = {
1154
+ draftPicks: {
1155
+ byYearAndRound: "draft/picks/{year}/{round}",
1156
+ byYear: "draft/picks/{year}/all"
1157
+ },
1158
+ draftRankings: "draft/rankings/{year}/{type}",
1159
+ draftTracker: "draft-tracker/picks/now"
1160
+ };
1161
+ var DraftRankingsEnum = {
1162
+ skatersNA: "1",
1163
+ skatersIntl: "2",
1164
+ goaliesNA: "3",
1165
+ goaliesIntl: "4"
1166
+ };
1167
+ var picks = (year, round) => {
1168
+ const parsed = DraftParams({ year, round });
1169
+ if (isParseError(parsed)) {
1170
+ return Promise.resolve({
1171
+ status: "error",
1172
+ error: new ValidationError(parsed.summary, {
1173
+ endpoint: _paths.draftPicks.byYearAndRound
1174
+ })
1175
+ });
1176
+ }
1177
+ if (parsed.year && !parsed.round)
1178
+ return client_default.get(route(_paths.draftPicks.byYear, parsed));
1179
+ return client_default.get(route(_paths.draftPicks.byYearAndRound, parsed));
1180
+ };
1181
+ var tracker = () => client_default.get(_paths.draftTracker);
1182
+ var rankings = (year) => {
1183
+ const getRankings = (type2) => {
1184
+ const parsedYear = Year(year ?? getCurrentYear());
1185
+ if (isParseError(parsedYear)) {
1186
+ return Promise.resolve({
1187
+ status: "error",
1188
+ error: new ValidationError(parsedYear.summary, {
1189
+ endpoint: _paths.draftRankings
1190
+ })
1191
+ });
1192
+ }
1193
+ return client_default.get(
1194
+ route(_paths.draftRankings, {
1195
+ year: parsedYear,
1196
+ type: type2
1197
+ })
1198
+ );
1199
+ };
1200
+ return {
1201
+ skatersNA: () => getRankings(DraftRankingsEnum.skatersNA),
1202
+ skatersIntl: () => getRankings(DraftRankingsEnum.skatersIntl),
1203
+ goaliesNA: () => getRankings(DraftRankingsEnum.goaliesNA),
1204
+ goaliesIntl: () => getRankings(DraftRankingsEnum.goaliesIntl),
1205
+ all: () => Promise.all([
1206
+ getRankings(DraftRankingsEnum.skatersNA),
1207
+ getRankings(DraftRankingsEnum.skatersIntl),
1208
+ getRankings(DraftRankingsEnum.goaliesNA),
1209
+ getRankings(DraftRankingsEnum.goaliesIntl)
1210
+ ])
1211
+ };
1212
+ };
1213
+
1214
+ // src/api/gamecenter/game.ts
1215
+ var game_exports = {};
1216
+ __export(game_exports, {
1217
+ boxscore: () => boxscore,
1218
+ landing: () => landing,
1219
+ networkTVSchedule: () => networkTVSchedule,
1220
+ playByPlay: () => playByPlay,
1221
+ playoffBracket: () => playoffBracket,
1222
+ playoffSeries: () => playoffSeries,
1223
+ playoffSeriesSchedule: () => playoffSeriesSchedule,
1224
+ pptReplay: () => pptReplay,
1225
+ reports: () => reports,
1226
+ schedule: () => schedule,
1227
+ scheduleCalendar: () => scheduleCalendar,
1228
+ whereToWatch: () => whereToWatch,
1229
+ wsc: () => wsc
1230
+ });
1231
+ var _paths2 = {
1232
+ schedule: "schedule/{date}",
1233
+ scheduleCalendar: "schedule-calendar/{date}",
1234
+ playoffBracket: "playoff-bracket/{year}",
1235
+ playoffSeries: "playoff-series/{season}",
1236
+ playoffSeriesSchedule: "schedule/playoff-series/{season}/{seriesLetter}",
1237
+ gamecenter: {
1238
+ playByPlay: "gamecenter/{gameId}/play-by-play",
1239
+ reports: "gamecenter/{gameId}/right-rail",
1240
+ landing: "gamecenter/{gameId}/landing",
1241
+ boxscore: "gamecenter/{gameId}/boxscore"
1242
+ },
1243
+ wsc: {
1244
+ gameStory: "wsc/game-story/{gameId}",
1245
+ playByPlay: "wsc/play-by-play/{gameId}"
1246
+ },
1247
+ pptReplay: {
1248
+ goal: "ppt-replay/{gameId}/goal/{eventId}",
1249
+ event: "ppt-replay/{date}"
1250
+ },
1251
+ whereToWatch: "where-to-watch",
1252
+ networkTVSchedule: "network/tv-schedule/{date}"
1253
+ };
1254
+ var playByPlay = (gameId) => {
1255
+ const parsedGameId = GameId(gameId);
1256
+ if (isParseError(parsedGameId)) {
1257
+ return Promise.resolve({
1258
+ status: "error",
1259
+ error: new ValidationError(parsedGameId.summary, {
1260
+ endpoint: _paths2.gamecenter.playByPlay
1261
+ })
1262
+ });
1263
+ }
1264
+ return client_default.get(
1265
+ route(_paths2.gamecenter.playByPlay, { gameId: parsedGameId })
1266
+ );
1267
+ };
1268
+ var reports = (gameId) => {
1269
+ const parsedGameId = GameId(gameId);
1270
+ if (isParseError(parsedGameId)) {
1271
+ return Promise.resolve({
1272
+ status: "error",
1273
+ error: new ValidationError(parsedGameId.summary, {
1274
+ endpoint: _paths2.gamecenter.reports
1275
+ })
1276
+ });
1277
+ }
1278
+ return client_default.get(
1279
+ route(_paths2.gamecenter.reports, { gameId: parsedGameId })
1280
+ );
1281
+ };
1282
+ var landing = (gameId) => {
1283
+ const parsedGameId = GameId(gameId);
1284
+ if (isParseError(parsedGameId)) {
1285
+ return Promise.resolve({
1286
+ status: "error",
1287
+ error: new ValidationError(parsedGameId.summary, {
1288
+ endpoint: _paths2.gamecenter.landing
1289
+ })
1290
+ });
1291
+ }
1292
+ return client_default.get(
1293
+ route(_paths2.gamecenter.landing, { gameId: parsedGameId })
1294
+ );
1295
+ };
1296
+ var boxscore = (gameId) => {
1297
+ const parsedGameId = GameId(gameId);
1298
+ if (isParseError(parsedGameId)) {
1299
+ return Promise.resolve({
1300
+ status: "error",
1301
+ error: new ValidationError(parsedGameId.summary, {
1302
+ endpoint: _paths2.gamecenter.boxscore
1303
+ })
1304
+ });
1305
+ }
1306
+ return client_default.get(
1307
+ route(_paths2.gamecenter.boxscore, { gameId: parsedGameId })
1308
+ );
1309
+ };
1310
+ var wsc = {
1311
+ /**
1312
+ * Get game story data for a specific game
1313
+ * @param gameId - The unique identifier for the game
1314
+ * @returns Promise resolving to game story data
1315
+ */
1316
+ gameStory: (gameId) => {
1317
+ const parsedGameId = GameId(gameId);
1318
+ if (isParseError(parsedGameId)) {
1319
+ return Promise.resolve({
1320
+ status: "error",
1321
+ error: new ValidationError(parsedGameId.summary, {
1322
+ endpoint: _paths2.wsc.gameStory
1323
+ })
1324
+ });
1325
+ }
1326
+ return client_default.get(
1327
+ route(_paths2.wsc.gameStory, { gameId: parsedGameId })
1328
+ );
1329
+ },
1330
+ /**
1331
+ * Get play-by-play data for a specific game
1332
+ * @param gameId - The unique identifier for the game
1333
+ * @returns Promise resolving to play-by-play data
1334
+ */
1335
+ playByPlay: (gameId) => {
1336
+ const parsedGameId = GameId(gameId);
1337
+ if (isParseError(parsedGameId)) {
1338
+ return Promise.resolve({
1339
+ status: "error",
1340
+ error: new ValidationError(parsedGameId.summary, {
1341
+ endpoint: _paths2.wsc.playByPlay
1342
+ })
1343
+ });
1344
+ }
1345
+ return client_default.get(
1346
+ route(_paths2.wsc.playByPlay, { gameId: parsedGameId })
1347
+ );
1348
+ }
1349
+ };
1350
+ var pptReplay = {
1351
+ /**
1352
+ * Get goal replay data for a specific game and event
1353
+ * @param gameId - The unique identifier for the game
1354
+ * @param eventId - The unique identifier for the event
1355
+ * @returns Promise resolving to goal replay data
1356
+ */
1357
+ goal: (gameId, eventId) => {
1358
+ const parsed = GameIdAndEventId({ gameId, eventId });
1359
+ if (isParseError(parsed)) {
1360
+ return Promise.resolve({
1361
+ status: "error",
1362
+ error: new ValidationError(parsed.summary, {
1363
+ endpoint: _paths2.pptReplay.goal
1364
+ })
1365
+ });
1366
+ }
1367
+ return client_default.get(
1368
+ route(_paths2.pptReplay.goal, { gameId, eventId })
1369
+ );
1370
+ },
1371
+ /**
1372
+ * Get event replay data for a specific date
1373
+ * @param date - Date to get event replay data for (Date object or ISO date string)
1374
+ * @returns Promise resolving to event replay data
1375
+ */
1376
+ event: async (date) => {
1377
+ const parsedDate = NHLDate(date);
1378
+ if (isParseError(parsedDate)) {
1379
+ return Promise.resolve({
1380
+ status: "error",
1381
+ error: new ValidationError(parsedDate.summary, {
1382
+ endpoint: _paths2.pptReplay.event
1383
+ })
1384
+ });
1385
+ }
1386
+ return client_default.get(
1387
+ route(_paths2.pptReplay.event, { date: parsedDate })
1388
+ );
1389
+ }
1390
+ };
1391
+ var schedule = (date) => {
1392
+ const parsedDate = NHLDate(date ?? getCurrentDate());
1393
+ if (isParseError(parsedDate)) {
1394
+ return Promise.resolve({
1395
+ status: "error",
1396
+ error: new ValidationError(parsedDate.summary, {
1397
+ endpoint: _paths2.schedule
1398
+ })
1399
+ });
1400
+ }
1401
+ return client_default.get(route(_paths2.schedule, { date: parsedDate }));
1402
+ };
1403
+ var scheduleCalendar = (date) => {
1404
+ const parsedDate = NHLDate(date);
1405
+ if (isParseError(parsedDate)) {
1406
+ return Promise.resolve({
1407
+ status: "error",
1408
+ error: new ValidationError(parsedDate.summary, {
1409
+ endpoint: _paths2.scheduleCalendar
1410
+ })
1411
+ });
1412
+ }
1413
+ return client_default.get(
1414
+ route(_paths2.scheduleCalendar, { date: parsedDate })
1415
+ );
1416
+ };
1417
+ var playoffBracket = (year) => {
1418
+ const parsedYear = Year(year ?? getCurrentYear());
1419
+ if (isParseError(parsedYear)) {
1420
+ return Promise.resolve({
1421
+ status: "error",
1422
+ error: new ValidationError(parsedYear.summary, {
1423
+ endpoint: _paths2.playoffBracket
1424
+ })
1425
+ });
1426
+ }
1427
+ return client_default.get(route(_paths2.playoffBracket, { year: parsedYear }));
1428
+ };
1429
+ var playoffSeries = (season) => {
1430
+ const parsedSeason = Season(season ?? getCurrentSeason());
1431
+ if (isParseError(parsedSeason)) {
1432
+ return Promise.resolve({
1433
+ status: "error",
1434
+ error: new ValidationError(parsedSeason.summary, {
1435
+ endpoint: _paths2.playoffSeries
1436
+ })
1437
+ });
1438
+ }
1439
+ return client_default.get(
1440
+ route(_paths2.playoffSeries, { season: parsedSeason })
1441
+ );
1442
+ };
1443
+ var playoffSeriesSchedule = (seriesLetter, season) => {
1444
+ const parsed = SeriesAndSeasonParams({
1445
+ seriesLetter,
1446
+ season: season ?? getCurrentSeason()
1447
+ });
1448
+ if (isParseError(parsed)) {
1449
+ return Promise.resolve({
1450
+ status: "error",
1451
+ error: new ValidationError(parsed.summary, {
1452
+ endpoint: _paths2.playoffSeriesSchedule
1453
+ })
1454
+ });
1455
+ }
1456
+ return client_default.get(route(_paths2.playoffSeriesSchedule, parsed));
1457
+ };
1458
+ var whereToWatch = () => client_default.get(_paths2.whereToWatch);
1459
+ var networkTVSchedule = (date) => {
1460
+ const parsedDate = NHLDate(date ?? getCurrentDate());
1461
+ if (isParseError(parsedDate)) {
1462
+ return Promise.resolve({
1463
+ status: "error",
1464
+ error: new ValidationError(parsedDate.summary, {
1465
+ endpoint: _paths2.networkTVSchedule
1466
+ })
1467
+ });
1468
+ }
1469
+ return client_default.get(
1470
+ route(_paths2.networkTVSchedule, { date: parsedDate })
1471
+ );
1472
+ };
1473
+
1474
+ // src/api/gamecenter/misc.ts
1475
+ var misc_exports = {};
1476
+ __export(misc_exports, {
1477
+ location: () => location,
1478
+ meta: () => meta,
1479
+ partnerGame: () => partnerGame,
1480
+ postalLookup: () => postalLookup,
1481
+ seasons: () => seasons
1482
+ });
1483
+ var _paths3 = {
1484
+ season: "season",
1485
+ metaPlayoffSeries: "meta/playoff-series/{year}/{seriesLetter}",
1486
+ metaGame: "meta/game/{gameId}",
1487
+ postalLookup: "postal-lookup/{postalCode}",
1488
+ location: "location",
1489
+ partnerGame: "partner-game/{countryCode}/now"
1490
+ };
1491
+ var seasons = () => {
1492
+ return client_default.get(_paths3.season);
1493
+ };
1494
+ var meta = {
1495
+ /**
1496
+ * Get meta information for a playoff series
1497
+ *
1498
+ * @param year - The year in YYYY format
1499
+ * @param seriesLetter - Single letter identifier for the playoff series
1500
+ * @returns Promise resolving to playoff series meta information
1501
+ */
1502
+ playoffSeries: (seriesLetter, year) => {
1503
+ const parsed = SeriesParams({ year, seriesLetter });
1504
+ if (isParseError(parsed)) {
1505
+ return Promise.resolve({
1506
+ status: "error",
1507
+ error: new ValidationError(parsed.summary, {
1508
+ endpoint: _paths3.metaPlayoffSeries
1509
+ })
1510
+ });
1511
+ }
1512
+ return client_default.get(route(_paths3.metaPlayoffSeries, parsed));
1513
+ },
1514
+ /**
1515
+ * Get meta information for a specific game
1516
+ *
1517
+ * @param gameId - The unique game identifier
1518
+ * @returns Promise resolving to game meta information
1519
+ */
1520
+ game: (gameId) => {
1521
+ const parsedGameId = GameId(gameId);
1522
+ if (isParseError(parsedGameId)) {
1523
+ return Promise.resolve({
1524
+ status: "error",
1525
+ error: new ValidationError(parsedGameId.summary, {
1526
+ endpoint: _paths3.metaGame
1527
+ })
1528
+ });
1529
+ }
1530
+ return client_default.get(
1531
+ route(_paths3.metaGame, { gameId: parsedGameId })
1532
+ );
1533
+ }
1534
+ };
1535
+ var postalLookup = (postalCode) => {
1536
+ const parsedPostalCode = PostalCode(postalCode);
1537
+ if (isParseError(parsedPostalCode)) {
1538
+ return Promise.resolve({
1539
+ status: "error",
1540
+ error: new ValidationError(parsedPostalCode.summary, {
1541
+ endpoint: _paths3.postalLookup
1542
+ })
1543
+ });
1544
+ }
1545
+ return client_default.get(
1546
+ route(_paths3.postalLookup, { postalCode: parsedPostalCode })
1547
+ );
1548
+ };
1549
+ var location = () => {
1550
+ return client_default.get(_paths3.location);
1551
+ };
1552
+ var partnerGame = (countryCode) => {
1553
+ const parsedCountryCode = CountryCode(countryCode);
1554
+ if (isParseError(parsedCountryCode)) {
1555
+ return Promise.resolve({
1556
+ status: "error",
1557
+ error: new ValidationError(parsedCountryCode.summary, {
1558
+ endpoint: _paths3.partnerGame
1559
+ })
1560
+ });
1561
+ }
1562
+ return client_default.get(
1563
+ route(_paths3.partnerGame, { countryCode: parsedCountryCode })
1564
+ );
1565
+ };
1566
+
1567
+ // src/api/gamecenter/player.ts
1568
+ var player_exports = {};
1569
+ __export(player_exports, {
1570
+ gameLog: () => gameLog,
1571
+ landing: () => landing2,
1572
+ search: () => search,
1573
+ spotlight: () => spotlight,
1574
+ statsLeaders: () => statsLeaders
1575
+ });
1576
+ var _paths4 = {
1577
+ landing: "player/{playerId}/landing",
1578
+ gameLog: "player/{playerId}/game-log/{season}/{gameType}",
1579
+ spotlight: "player-spotlight",
1580
+ statsLeaders: {
1581
+ skaters: "skater-stats-leaders/{season}/{gameType}",
1582
+ goalies: "goalie-stats-leaders/{season}/{gameType}"
1583
+ },
1584
+ playerSearch: "https://search.d3.nhle.com/api/v1/search/player"
1585
+ };
1586
+ var nhlPlayerSearch = createNHLClient(_paths4.playerSearch);
1587
+ var searchUrlParams = { culture: "en", q: "" };
1588
+ var landing2 = (playerId) => {
1589
+ const parsedPlayerId = PlayerId(playerId);
1590
+ if (isParseError(parsedPlayerId)) {
1591
+ return Promise.resolve({
1592
+ status: "error",
1593
+ error: new ValidationError(parsedPlayerId.summary, {
1594
+ endpoint: _paths4.landing
1595
+ })
1596
+ });
1597
+ }
1598
+ return client_default.get(
1599
+ route(_paths4.landing, { playerId: parsedPlayerId })
1600
+ );
1601
+ };
1602
+ var gameLog = (playerId, season, gameType) => {
1603
+ const Parser = BaseParams.merge({
1604
+ playerId: PlayerId
1605
+ });
1606
+ const parsed = Parser({ playerId, season, gameType });
1607
+ if (isParseError(parsed)) {
1608
+ return Promise.resolve({
1609
+ status: "error",
1610
+ error: new ValidationError(parsed.summary, {
1611
+ endpoint: _paths4.gameLog
1612
+ })
1613
+ });
1614
+ }
1615
+ return client_default.get(route(_paths4.gameLog, parsed));
1616
+ };
1617
+ var spotlight = () => {
1618
+ return client_default.get(_paths4.spotlight);
1619
+ };
1620
+ var search = (query) => {
1621
+ return nhlPlayerSearch.get("", {
1622
+ ...searchUrlParams,
1623
+ q: query
1624
+ });
1625
+ };
1626
+ var statsLeaders = {
1627
+ /**
1628
+ * Get skater stats leaders
1629
+ * @param season - The season identifier (optional)
1630
+ * @param gameType - The game type identifier (optional)
1631
+ * @returns Promise resolving to skater stats leaders
1632
+ */
1633
+ skaters: (season, gameType) => {
1634
+ const parsed = BaseParams({ season, gameType });
1635
+ if (isParseError(parsed)) {
1636
+ return Promise.resolve({
1637
+ status: "error",
1638
+ error: new ValidationError(parsed.summary, {
1639
+ endpoint: _paths4.statsLeaders.skaters
1640
+ })
1641
+ });
1642
+ }
1643
+ return client_default.get(route(_paths4.statsLeaders.skaters, parsed));
1644
+ },
1645
+ /**
1646
+ * Get goalie stats leaders
1647
+ * @param season - The season identifier (optional)
1648
+ * @param gameType - The game type identifier (optional)
1649
+ * @returns Promise resolving to goalie stats leaders
1650
+ */
1651
+ goalies: (season, gameType) => {
1652
+ const parsed = BaseParams({ season, gameType });
1653
+ if (isParseError(parsed)) {
1654
+ return Promise.resolve({
1655
+ status: "error",
1656
+ error: new ValidationError(parsed.summary, {
1657
+ endpoint: _paths4.statsLeaders.goalies
1658
+ })
1659
+ });
1660
+ }
1661
+ return client_default.get(route(_paths4.statsLeaders.goalies, parsed));
1662
+ }
1663
+ };
1664
+
1665
+ // src/api/gamecenter/score.ts
1666
+ var _paths5 = {
1667
+ score: "score/{date}",
1668
+ scoreboard: {
1669
+ now: "scoreboard/now",
1670
+ byTeam: "scoreboard/{team}/now",
1671
+ byDate: "scoreboard/{date}"
1672
+ }
1673
+ };
1674
+ var score = (date) => {
1675
+ const parsed = NHLDate(date ?? getCurrentDate());
1676
+ if (isParseError(parsed)) {
1677
+ return Promise.resolve({
1678
+ status: "error",
1679
+ error: new ValidationError(parsed.summary, {
1680
+ endpoint: _paths5.score
1681
+ })
1682
+ });
1683
+ }
1684
+ return client_default.get(route(_paths5.score, { date: parsed }));
1685
+ };
1686
+ var scoreboard = () => client_default.get(_paths5.scoreboard.now);
1687
+ scoreboard.team = async (team) => {
1688
+ const parsed = TeamAbbrev(team);
1689
+ if (isParseError(parsed)) {
1690
+ return Promise.resolve({
1691
+ status: "error",
1692
+ error: new ValidationError(parsed.summary, {
1693
+ endpoint: _paths5.scoreboard.byTeam
1694
+ })
1695
+ });
1696
+ }
1697
+ return client_default.get(
1698
+ route(_paths5.scoreboard.byTeam, { team: parsed })
1699
+ );
1700
+ };
1701
+ scoreboard.date = async (date) => {
1702
+ const parsed = NHLDate(date);
1703
+ if (isParseError(parsed)) {
1704
+ return Promise.resolve({
1705
+ status: "error",
1706
+ error: new ValidationError(parsed.summary, {
1707
+ endpoint: _paths5.scoreboard.byDate
1708
+ })
1709
+ });
1710
+ }
1711
+ return client_default.get(
1712
+ route(_paths5.scoreboard.byDate, { date: parsed })
1713
+ );
1714
+ };
1715
+
1716
+ // src/api/gamecenter/team.ts
1717
+ var team_exports = {};
1718
+ __export(team_exports, {
1719
+ clubStats: () => clubStats,
1720
+ clubStatsSeason: () => clubStatsSeason,
1721
+ prospects: () => prospects,
1722
+ roster: () => roster,
1723
+ rosterSeasons: () => rosterSeasons,
1724
+ schedule: () => schedule2,
1725
+ standings: () => standings,
1726
+ standingsSeason: () => standingsSeason
1727
+ });
1728
+ var paths = {
1729
+ rosterSeasons: "roster-season/{team}",
1730
+ roster: "roster/{team}/{season}",
1731
+ prospects: "prospects/{team}",
1732
+ clubStats: "club-stats/{team}/{season}/{gameType}",
1733
+ clubStatsSeason: "club-stats-season/{team}",
1734
+ standings: "standings/{date}",
1735
+ standingsSeason: "standings-season",
1736
+ clubSchedule: "club-schedule/{team}/{period}/{date}",
1737
+ clubScheduleSeason: "club-schedule-season/{team}/{season}"
1738
+ };
1739
+ var rosterSeasons = (team) => {
1740
+ const parsed = TeamAbbrev(team);
1741
+ if (isParseError(parsed)) {
1742
+ return Promise.resolve({
1743
+ status: "error",
1744
+ error: new ValidationError(parsed.summary, {
1745
+ endpoint: paths.rosterSeasons
1746
+ })
1747
+ });
1748
+ }
1749
+ return client_default.get(route(paths.rosterSeasons, { team: parsed }));
1750
+ };
1751
+ var roster = (team, season) => {
1752
+ const parsed = TeamAndSeasonParams({ team, season });
1753
+ if (isParseError(parsed)) {
1754
+ return Promise.resolve({
1755
+ status: "error",
1756
+ error: new ValidationError(parsed.summary, {
1757
+ endpoint: paths.roster
1758
+ })
1759
+ });
1760
+ }
1761
+ return client_default.get(route(paths.roster, parsed));
1762
+ };
1763
+ var prospects = (team) => {
1764
+ const parsed = TeamAbbrev(team);
1765
+ if (isParseError(parsed)) {
1766
+ return Promise.resolve({
1767
+ status: "error",
1768
+ error: new ValidationError(parsed.summary, {
1769
+ endpoint: paths.prospects
1770
+ })
1771
+ });
1772
+ }
1773
+ return client_default.get(route(paths.prospects, { team: parsed }));
1774
+ };
1775
+ var clubStats = (team, season, gameType) => {
1776
+ const Parser = BaseParams.merge({
1777
+ team: TeamAbbrev
1778
+ });
1779
+ const parsed = Parser({ team, season, gameType });
1780
+ if (isParseError(parsed)) {
1781
+ return Promise.resolve({
1782
+ status: "error",
1783
+ error: new ValidationError(parsed.summary, {
1784
+ endpoint: paths.clubStats
1785
+ })
1786
+ });
1787
+ }
1788
+ return client_default.get(route(paths.clubStats, parsed));
1789
+ };
1790
+ var clubStatsSeason = (team) => {
1791
+ const parsed = TeamAbbrev(team);
1792
+ if (isParseError(parsed)) {
1793
+ return Promise.resolve({
1794
+ status: "error",
1795
+ error: new ValidationError(parsed.summary, {
1796
+ endpoint: paths.clubStatsSeason
1797
+ })
1798
+ });
1799
+ }
1800
+ return client_default.get(route(paths.clubStatsSeason, { team: parsed }));
1801
+ };
1802
+ var standings = (date) => {
1803
+ const parsed = NHLDate(date ?? getCurrentDate());
1804
+ if (isParseError(parsed)) {
1805
+ return Promise.resolve({
1806
+ status: "error",
1807
+ error: new ValidationError(parsed.summary, {
1808
+ endpoint: paths.standings
1809
+ })
1810
+ });
1811
+ }
1812
+ return client_default.get(route(paths.standings, { date: parsed }));
1813
+ };
1814
+ var standingsSeason = () => {
1815
+ return client_default.get(paths.standingsSeason);
1816
+ };
1817
+ var clubSchedule = (team, date, period) => {
1818
+ const parsed = ScheduleParams({ team, date, period });
1819
+ if (isParseError(parsed)) {
1820
+ return Promise.resolve({
1821
+ status: "error",
1822
+ error: new ValidationError(parsed.summary, {
1823
+ endpoint: paths.clubSchedule
1824
+ })
1825
+ });
1826
+ }
1827
+ if (period === "month") {
1828
+ parsed.date = parsed.date?.slice(0, 7);
1829
+ }
1830
+ return client_default.get(route(paths.clubSchedule, parsed));
1831
+ };
1832
+ var clubScheduleSeason = (team, season) => {
1833
+ const parsed = TeamAndSeasonParams({ team, season });
1834
+ if (isParseError(parsed)) {
1835
+ return Promise.resolve({
1836
+ status: "error",
1837
+ error: new ValidationError(parsed.summary, {
1838
+ endpoint: paths.clubScheduleSeason
1839
+ })
1840
+ });
1841
+ }
1842
+ return client_default.get(route(paths.clubScheduleSeason, parsed));
1843
+ };
1844
+ var schedule2 = {
1845
+ /** Returns the full season schedule for the provided team and season
1846
+ * @param team - The team abbreviation for the desired team
1847
+ * @param season - The specific season (e.g. 20222023); if not provided, defaults to the current season.
1848
+ * @returns A promise that resolves to the full season schedule for the specified team and season
1849
+ * @example
1850
+ * ```ts
1851
+ * // Get the full season schedule for the Boston Bruins for the 2022-2023 season
1852
+ * schedule.season('BOS', 20222023).then((data) => {
1853
+ * console.log(data);
1854
+ * });
1855
+ * ```
1856
+ */
1857
+ season: clubScheduleSeason,
1858
+ /**
1859
+ * Get the team schedule for any seven-day period
1860
+ * @param team - The team abbreviation
1861
+ * @param date - The date indicating the start of the seven-day period.
1862
+ * If not provided, defaults to the current date. format: 'YYYY-MM'
1863
+ * @returns A promise that resolves to the club schedule for the specified week
1864
+ *
1865
+ * @example
1866
+ * ```ts
1867
+ * import { schedule } from 'nhle-api';
1868
+ *
1869
+ * // Get the schedule for the Chicago Blackhawks for the week of November 4, 2023
1870
+ * // This returns the schedule from November 4 to November 10, 2023
1871
+ * schedule.week('CHI', '2023-11-04').then((data) => {
1872
+ * console.log(data);
1873
+ * });
1874
+ * ```
1875
+ */
1876
+ week: (team, date) => clubSchedule(team, date, "week"),
1877
+ /**
1878
+ * Get the team schedule for any month
1879
+ * @param team - The team abbreviation
1880
+ * @param date - The date indicating the month to get the schedule for.
1881
+ * If not provided, defaults to the current month. format: 'YYYY-MM'
1882
+ * @returns A promise that resolves to the club schedule for the specified month
1883
+ *
1884
+ * @example
1885
+ * ```ts
1886
+ * import { schedule } from 'nhle-api';
1887
+ *
1888
+ * // Get the schedule for the Toronto Maple Leafs for November 2023
1889
+ * schedule.month('TOR', '2023-11').then((data) => {
1890
+ * console.log(data);
1891
+ * });
1892
+ * ```
1893
+ */
1894
+ month: (team, date) => clubSchedule(team, date, "month")
1895
+ };
1896
+
1897
+ export { EDGE, nhl_exports as NHL, envConfig, gamecenter_exports as gc, logEnvConfig };
1898
+ //# sourceMappingURL=index.js.map
1899
+ //# sourceMappingURL=index.js.map