nhl-api-ts 0.0.0-stage → 0.2.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.
Files changed (75) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +315 -2
  3. package/dist/api/edge.d.mts +180 -0
  4. package/dist/api/edge.mjs +184 -0
  5. package/dist/api/game-center.d.mts +84 -0
  6. package/dist/api/game-center.mjs +74 -0
  7. package/dist/api/helpers.d.mts +47 -0
  8. package/dist/api/helpers.mjs +106 -0
  9. package/dist/api/misc.d.mts +40 -0
  10. package/dist/api/misc.mjs +43 -0
  11. package/dist/api/players.d.mts +28 -0
  12. package/dist/api/players.mjs +18 -0
  13. package/dist/api/query/builder.d.mts +22 -0
  14. package/dist/api/query/builder.mjs +30 -0
  15. package/dist/api/query/filters.d.mts +93 -0
  16. package/dist/api/query/filters.mjs +118 -0
  17. package/dist/api/query/index.d.mts +4 -0
  18. package/dist/api/query/index.mjs +4 -0
  19. package/dist/api/query/sorting/goalie-sorts.d.mts +61 -0
  20. package/dist/api/query/sorting/goalie-sorts.mjs +54 -0
  21. package/dist/api/query/sorting/sorting-options.d.mts +136 -0
  22. package/dist/api/query/sorting/sorting-options.mjs +94 -0
  23. package/dist/api/schedule.d.mts +117 -0
  24. package/dist/api/schedule.mjs +131 -0
  25. package/dist/api/standings.d.mts +29 -0
  26. package/dist/api/standings.mjs +38 -0
  27. package/dist/api/stats.d.mts +153 -0
  28. package/dist/api/stats.mjs +166 -0
  29. package/dist/api/teams.d.mts +59 -0
  30. package/dist/api/teams.mjs +91 -0
  31. package/dist/cli/colors.d.mts +14 -0
  32. package/dist/cli/colors.mjs +13 -0
  33. package/dist/cli/commands.d.mts +27 -0
  34. package/dist/cli/commands.mjs +695 -0
  35. package/dist/cli/run.d.mts +9 -0
  36. package/dist/cli/run.mjs +313 -0
  37. package/dist/cli.d.mts +2 -0
  38. package/dist/cli.mjs +13 -0
  39. package/dist/config.d.mts +20 -0
  40. package/dist/config.mjs +4 -0
  41. package/dist/context.d.mts +6 -0
  42. package/dist/context.mjs +1 -0
  43. package/dist/errors.d.mts +35 -0
  44. package/dist/errors.mjs +49 -0
  45. package/dist/http-client.d.mts +27 -0
  46. package/dist/http-client.mjs +95 -0
  47. package/dist/index.d.mts +22 -0
  48. package/dist/index.mjs +15 -0
  49. package/dist/nhl-client.d.mts +101 -0
  50. package/dist/nhl-client.mjs +40 -0
  51. package/dist/types/common.d.mts +81 -0
  52. package/dist/types/common.mjs +2 -0
  53. package/dist/types/edge.d.mts +1024 -0
  54. package/dist/types/edge.mjs +1 -0
  55. package/dist/types/game-center.d.mts +1194 -0
  56. package/dist/types/game-center.mjs +1 -0
  57. package/dist/types/helpers.d.mts +17 -0
  58. package/dist/types/helpers.mjs +1 -0
  59. package/dist/types/index.d.mts +10 -0
  60. package/dist/types/index.mjs +1 -0
  61. package/dist/types/misc.d.mts +68 -0
  62. package/dist/types/misc.mjs +2 -0
  63. package/dist/types/players.d.mts +42 -0
  64. package/dist/types/players.mjs +1 -0
  65. package/dist/types/schedule.d.mts +456 -0
  66. package/dist/types/schedule.mjs +1 -0
  67. package/dist/types/standings.d.mts +104 -0
  68. package/dist/types/standings.mjs +1 -0
  69. package/dist/types/stats.d.mts +1086 -0
  70. package/dist/types/stats.mjs +1 -0
  71. package/dist/types/teams.d.mts +29 -0
  72. package/dist/types/teams.mjs +1 -0
  73. package/dist/utils.d.mts +4 -0
  74. package/dist/utils.mjs +3 -0
  75. package/package.json +85 -3
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,29 @@
1
+ import type { LocalizedString, PositionCode, ShootsCatches } from '#src/types/common.mjs';
2
+ export interface Franchise {
3
+ id: number;
4
+ fullName: string;
5
+ teamCommonName: string;
6
+ teamPlaceName: string;
7
+ }
8
+ export interface Roster {
9
+ forwards: RosterPlayer[];
10
+ defensemen: RosterPlayer[];
11
+ goalies: RosterPlayer[];
12
+ }
13
+ export interface RosterPlayer {
14
+ id: number;
15
+ headshot: string;
16
+ firstName: LocalizedString;
17
+ lastName: LocalizedString;
18
+ sweaterNumber?: number;
19
+ positionCode: PositionCode;
20
+ shootsCatches: ShootsCatches;
21
+ heightInInches: number;
22
+ weightInPounds: number;
23
+ heightInCentimeters: number;
24
+ weightInKilograms: number;
25
+ birthDate: string;
26
+ birthCity: LocalizedString;
27
+ birthCountry: string;
28
+ birthStateProvince?: LocalizedString;
29
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ /** Identifiers accepted by the API: player ids, game ids, seasons, etc. */
2
+ export type Id = string | number;
3
+ /** Sleeps for the given number of seconds. */
4
+ export declare const sleep: (seconds: number) => Promise<void>;
package/dist/utils.mjs ADDED
@@ -0,0 +1,3 @@
1
+ import { setTimeout as delay } from 'node:timers/promises';
2
+ /** Sleeps for the given number of seconds. */
3
+ export const sleep = (seconds) => delay(seconds * 1000);
package/package.json CHANGED
@@ -1,6 +1,88 @@
1
1
  {
2
2
  "name": "nhl-api-ts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0",
4
+ "description": "TypeScript SDK and CLI for the NHL API and NHL EDGE stats.",
5
+ "keywords": [
6
+ "nhl",
7
+ "api",
8
+ "hockey",
9
+ "sports",
10
+ "edge",
11
+ "stats",
12
+ "sdk",
13
+ "cli"
14
+ ],
15
+ "author": "andrewangelle@gmail.com",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/andrewangelle/nhl-api-ts.git"
20
+ },
21
+ "type": "module",
22
+ "sideEffects": false,
23
+ "main": "dist/index.mjs",
24
+ "types": "dist/index.d.mts",
25
+ "exports": {
26
+ ".": {
27
+ "types": "./dist/index.d.mts",
28
+ "default": "./dist/index.mjs"
29
+ },
30
+ "./package.json": "./package.json"
31
+ },
32
+ "imports": {
33
+ "#src/*.mjs": {
34
+ "source": "./src/*.mts",
35
+ "types": "./dist/*.d.mts",
36
+ "default": "./dist/*.mjs"
37
+ },
38
+ "#probe/*.mjs": "./scripts/probe/*.mts"
39
+ },
40
+ "bin": {
41
+ "nhl-api-ts": "dist/cli.mjs"
42
+ },
43
+ "engines": {
44
+ "node": ">=24.0.0"
45
+ },
46
+ "files": [
47
+ "dist"
48
+ ],
49
+ "devDependencies": {
50
+ "@biomejs/biome": "^2.5.15",
51
+ "@changesets/changelog-github": "^1.0.1",
52
+ "@changesets/cli": "^3.0.3",
53
+ "@microsoft/api-extractor": "^7.59.4",
54
+ "@types/node": "^26.2.0",
55
+ "husky": "^9.1.7",
56
+ "lint-staged": "^17.3.0",
57
+ "typescript": "^7.0.2"
58
+ },
59
+ "lint-staged": {
60
+ "*.{ts,tsx,js,jsx,mts,mjs}": [
61
+ "pnpm lint:fix",
62
+ "pnpm format"
63
+ ]
64
+ },
65
+ "scripts": {
66
+ "build": "pnpm exec tsc",
67
+ "test": "node --conditions=source --test \"test/**/*.test.mts\"",
68
+ "test:update-snapshots": "node --conditions=source --test --test-update-snapshots \"test/**/*.test.mts\"",
69
+ "lint:fix": "pnpm exec biome check . --write",
70
+ "lint:check": "pnpm exec biome check .",
71
+ "format": "pnpm exec biome format . --write",
72
+ "pre-commit": "lint-staged",
73
+ "changeset": "changeset",
74
+ "version-packages": "changeset version",
75
+ "release": "pnpm build && changeset publish",
76
+ "typecheck": "pnpm exec tsc --noEmit",
77
+ "typecheck:examples": "pnpm exec tsc -p examples",
78
+ "typecheck:types": "pnpm exec tsc -p test/types",
79
+ "typecheck:scripts": "pnpm exec tsc -p scripts",
80
+ "api:report": "pnpm build && mkdir -p node_modules/.api-extractor && pnpm exec api-extractor run --local && cp node_modules/.api-extractor/nhl-api-ts.api.md api-report.md",
81
+ "docs:llms": "node scripts/build-llms-full.mts",
82
+ "probe:fetch": "node --conditions=source scripts/probe/fetch.mts",
83
+ "probe:infer": "node --conditions=source scripts/probe/infer.mts",
84
+ "probe:check": "node --conditions=source scripts/probe/check.mts",
85
+ "probe:fixtures": "node --conditions=source scripts/probe/fixtures.mts",
86
+ "openapi:schemas": "node --conditions=source scripts/probe/openapi.mts"
87
+ }
6
88
  }