@bp1222/stats-api 0.0.7 → 0.0.8

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 (68) hide show
  1. package/dist/index.d.mts +4 -1574
  2. package/dist/index.d.ts +4 -1574
  3. package/dist/index.js +1 -1
  4. package/dist/index.mjs +1 -1
  5. package/package.json +5 -4
  6. package/.github/workflows/publish.yaml +0 -24
  7. package/Makefile +0 -27
  8. package/openapitools.json +0 -17
  9. package/spec/components/parameters/parameters.yaml +0 -21
  10. package/spec/components/parameters/query/date.yaml +0 -5
  11. package/spec/components/parameters/query/endDate.yaml +0 -5
  12. package/spec/components/parameters/query/fields.yaml +0 -10
  13. package/spec/components/parameters/query/hydrate.yaml +0 -5
  14. package/spec/components/parameters/query/leagueId.yaml +0 -5
  15. package/spec/components/parameters/query/leagueIds.yaml +0 -7
  16. package/spec/components/parameters/query/season.yaml +0 -5
  17. package/spec/components/parameters/query/sportId.yaml +0 -6
  18. package/spec/components/parameters/query/startDate.yaml +0 -5
  19. package/spec/components/parameters/query/teamId.yaml +0 -5
  20. package/spec/components/schemas/division.yaml +0 -32
  21. package/spec/components/schemas/game.yaml +0 -153
  22. package/spec/components/schemas/gameTeam.yaml +0 -22
  23. package/spec/components/schemas/league.yaml +0 -62
  24. package/spec/components/schemas/leagueRecord.yaml +0 -15
  25. package/spec/components/schemas/record.yaml +0 -95
  26. package/spec/components/schemas/schedule.yaml +0 -41
  27. package/spec/components/schemas/schemas.yaml +0 -24
  28. package/spec/components/schemas/season.yaml +0 -53
  29. package/spec/components/schemas/sport.yaml +0 -21
  30. package/spec/components/schemas/standings.yaml +0 -24
  31. package/spec/components/schemas/team.yaml +0 -50
  32. package/spec/components/schemas/venue.yaml +0 -18
  33. package/spec/openapi.yaml +0 -32
  34. package/spec/paths/allSeasons.yaml +0 -23
  35. package/spec/paths/schedule.yaml +0 -20
  36. package/spec/paths/season.yaml +0 -18
  37. package/spec/paths/standings.yaml +0 -27
  38. package/spec/paths/teams.yaml +0 -33
  39. package/src/.openapi-generator/FILES +0 -25
  40. package/src/.openapi-generator/VERSION +0 -1
  41. package/src/.openapi-generator-ignore +0 -23
  42. package/src/apis/MlbApi.ts +0 -427
  43. package/src/apis/index.ts +0 -3
  44. package/src/index.ts +0 -5
  45. package/src/models/MLBDivision.ts +0 -164
  46. package/src/models/MLBGame.ts +0 -371
  47. package/src/models/MLBGameStatus.ts +0 -122
  48. package/src/models/MLBGameTeam.ts +0 -117
  49. package/src/models/MLBGameTeams.ts +0 -77
  50. package/src/models/MLBLeague.ts +0 -190
  51. package/src/models/MLBLeagueDates.ts +0 -132
  52. package/src/models/MLBLeagueRecord.ts +0 -87
  53. package/src/models/MLBRecord.ts +0 -337
  54. package/src/models/MLBSchedule.ts +0 -105
  55. package/src/models/MLBScheduleDay.ts +0 -108
  56. package/src/models/MLBScheduleDays.ts +0 -108
  57. package/src/models/MLBSeason.ts +0 -226
  58. package/src/models/MLBSeasons.ts +0 -67
  59. package/src/models/MLBSport.ts +0 -110
  60. package/src/models/MLBStandings.ts +0 -130
  61. package/src/models/MLBStandingsList.ts +0 -67
  62. package/src/models/MLBStreak.ts +0 -74
  63. package/src/models/MLBTeam.ts +0 -248
  64. package/src/models/MLBTeams.ts +0 -67
  65. package/src/models/MLBVenue.ts +0 -95
  66. package/src/models/index.ts +0 -22
  67. package/src/runtime.ts +0 -426
  68. package/tsconfig.json +0 -108
package/dist/index.js CHANGED
@@ -1476,7 +1476,7 @@ var MlbApi = class extends BaseAPI {
1476
1476
  headers: headerParameters,
1477
1477
  query: queryParameters
1478
1478
  }, initOverrides);
1479
- return new JSONApiResponse(response, (jsonValue) => MLBSeasonFromJSON(jsonValue));
1479
+ return new JSONApiResponse(response, (jsonValue) => MLBSeasonsFromJSON(jsonValue));
1480
1480
  });
1481
1481
  }
1482
1482
  /**
package/dist/index.mjs CHANGED
@@ -1355,7 +1355,7 @@ var MlbApi = class extends BaseAPI {
1355
1355
  headers: headerParameters,
1356
1356
  query: queryParameters
1357
1357
  }, initOverrides);
1358
- return new JSONApiResponse(response, (jsonValue) => MLBSeasonFromJSON(jsonValue));
1358
+ return new JSONApiResponse(response, (jsonValue) => MLBSeasonsFromJSON(jsonValue));
1359
1359
  });
1360
1360
  }
1361
1361
  /**
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "name": "@bp1222/stats-api",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
+ "main": "dist/index.js",
4
5
  "module": "dist/index.mjs",
5
6
  "types": "dist/index.d.ts",
6
7
  "repository": {
7
8
  "type": "git",
8
9
  "url": "https://github.com/bp1222/stats-api.git"
9
10
  },
10
- "exports": {
11
- ".": "./src/index.ts"
12
- },
13
11
  "scripts": {
14
12
  "build": "tsup src/index.ts --format cjs,esm --dts"
15
13
  },
14
+ "files": [
15
+ "dist/**"
16
+ ],
16
17
  "keywords": ["mlb", "stats-api"],
17
18
  "author": "Dave Walker",
18
19
  "license": "ISC",
@@ -1,24 +0,0 @@
1
- name: Publish Package to npmjs
2
- on:
3
- release:
4
- types: [published]
5
- jobs:
6
- build:
7
- runs-on: ubuntu-latest
8
- permissions:
9
- contents: read
10
- id-token: write
11
- steps:
12
- - uses: actions/checkout@v4
13
-
14
- # Setup .npmrc file to publish to npm
15
- - uses: actions/setup-node@v4
16
- with:
17
- node-version: '20.x'
18
- registry-url: 'https://registry.npmjs.org'
19
-
20
- - run: npm install
21
-
22
- - run: npm publish --provenance --access public
23
- env:
24
- NODE_AUTH_TOKEN: ${{ secrets.NPM_KEY }}
package/Makefile DELETED
@@ -1,27 +0,0 @@
1
- # Colors
2
- RESET=\033[0m
3
- GREEN=\033[32m
4
- YELLOW=\033[33m
5
- CYAN=\033[36m
6
-
7
- .PHONY: all
8
- all: help
9
-
10
- # Cite: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
11
- .PHONY: help
12
- help: ## Display this help page
13
- @grep -E '^[a-zA-Z0-9/_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
14
- sort | \
15
- awk ' \
16
- BEGIN {FS = ":.*?## "; print "${GREEN}mlb-season help:\n"} \
17
- {printf "${CYAN}%-30s${RESET} %s\n", $$1, $$2} \
18
- END {print "\n${YELLOW}See README.md for more information${RESET}\n"}'
19
-
20
- .PHONY: bundle
21
- bundle: ## Builds the yaml bundle
22
- npx --yes @redocly/cli bundle -d --remove-unused-components -o bundle.yaml spec/openapi.yaml
23
-
24
- .PHONY: gen
25
- gen: bundle
26
- npx --yes @openapitools/openapi-generator-cli generate --generator-key v0-client
27
-
package/openapitools.json DELETED
@@ -1,17 +0,0 @@
1
- {
2
- "$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
3
- "spaces": 2,
4
- "generator-cli": {
5
- "version": "7.8.0",
6
- "generators": {
7
- "v0-client": {
8
- "generatorName": "typescript-fetch",
9
- "inputSpec": "bundle.yaml",
10
- "output": "src",
11
- "additionalProperties": {
12
- "withInterfaces": true
13
- }
14
- }
15
- }
16
- }
17
- }
@@ -1,21 +0,0 @@
1
- # ./query
2
- Date:
3
- $ref: "./query/date.yaml"
4
- EndDate:
5
- $ref: "./query/endDate.yaml"
6
- Fields:
7
- $ref: "./query/fields.yaml"
8
- Hydrate:
9
- $ref: "./query/hydrate.yaml"
10
- LeagueId:
11
- $ref: "./query/leagueId.yaml"
12
- LeagueIds:
13
- $ref: "./query/leagueIds.yaml"
14
- Season:
15
- $ref: "./query/season.yaml"
16
- SportId:
17
- $ref: "./query/sportId.yaml"
18
- StartDate:
19
- $ref: "./query/startDate.yaml"
20
- TeamId:
21
- $ref: "./query/teamId.yaml"
@@ -1,5 +0,0 @@
1
- in: query
2
- name: date
3
- required: false
4
- schema:
5
- type: string
@@ -1,5 +0,0 @@
1
- in: query
2
- name: endDate
3
- required: false
4
- schema:
5
- type: string
@@ -1,10 +0,0 @@
1
- in: query
2
- name: fields
3
- required: false
4
- schema:
5
- type: array
6
- items:
7
- type: string
8
- style: form
9
- explode: false
10
-
@@ -1,5 +0,0 @@
1
- in: query
2
- name: hydrate
3
- required: false
4
- schema:
5
- type: string
@@ -1,5 +0,0 @@
1
- in: query
2
- name: leagueId
3
- required: true
4
- schema:
5
- type: number
@@ -1,7 +0,0 @@
1
- in: query
2
- name: leagueIds
3
- required: false
4
- schema:
5
- type: array
6
- items:
7
- type: number
@@ -1,5 +0,0 @@
1
- in: query
2
- name: season
3
- required: true
4
- schema:
5
- type: string
@@ -1,6 +0,0 @@
1
- in: query
2
- name: sportId
3
- required: true
4
- schema:
5
- type: number
6
- default: 1
@@ -1,5 +0,0 @@
1
- in: query
2
- name: startDate
3
- required: false
4
- schema:
5
- type: string
@@ -1,5 +0,0 @@
1
- in: query
2
- name: teamId
3
- required: false
4
- schema:
5
- type: number
@@ -1,32 +0,0 @@
1
- title: MLBDivision
2
- description: >
3
- Division
4
- type: object
5
- required:
6
- - id
7
- - name
8
- properties:
9
- id:
10
- type: number
11
- name:
12
- type: string
13
- season:
14
- type: string
15
- nameShort:
16
- type: string
17
- link:
18
- type: string
19
- abbreviation:
20
- type: string
21
- league:
22
- $ref: ./schemas.yaml#/MLBLeague
23
- sport:
24
- $ref: ./schemas.yaml#/MLBSport
25
- hasWildcard:
26
- type: boolean
27
- sortOrder:
28
- type: number
29
- numPlayoffTeams:
30
- type: number
31
- active:
32
- type: boolean
@@ -1,153 +0,0 @@
1
- title: MLBGame
2
- description: >
3
- Game Thing
4
- type: object
5
- required:
6
- - gamePk
7
- - gameGuid
8
- - gameType
9
- - season
10
- - gameDate
11
- - officialDate
12
- - status
13
- - teams
14
- - gameNumber
15
- - gamesInSeries
16
- - seriesGameNumber
17
- properties:
18
- gamePk:
19
- type: number
20
- gameGuid:
21
- type: string
22
- link:
23
- type: string
24
- gameType:
25
- type: string
26
- enum:
27
- - "E"
28
- - "S"
29
- - "R"
30
- - "F"
31
- - "D"
32
- - "L"
33
- - "W"
34
- x-enum-varnames:
35
- - Exhibition
36
- - SpringTraining
37
- - Regular
38
- - WildCardSeries
39
- - DivisionSeries
40
- - LeagueChampionshipSeries
41
- - WorldSeries
42
- description: >
43
- Game Type:
44
- * `E` - Exhibition
45
- * `S` - Spring Training
46
- * `R` - Regular Season
47
- * `F` - Wild Card Series
48
- * `D` - Division Series
49
- * `L` - League Championship Series
50
- * `W` - World Series
51
- season:
52
- type: number
53
- gameDate:
54
- type: string
55
- officialDate:
56
- type: string
57
- rescheduledTo:
58
- type: number
59
- rescheduledToDate:
60
- type: string
61
- rescheduledFrom:
62
- type: number
63
- rescheduledFromDate:
64
- type: string
65
- status:
66
- title: MLBGameStatus
67
- type: object
68
- properties:
69
- abstractGameState:
70
- type: string
71
- codedGameState:
72
- type: string
73
- enum:
74
- - "F"
75
- - "D"
76
- - "S"
77
- - "I"
78
- - "P"
79
- - "O"
80
- x-enum-varnames:
81
- - Final
82
- - Postponed
83
- - Scheduled
84
- - InProgress
85
- - Pregame
86
- - GameOver
87
- description: >
88
- Coded Game State
89
- * `F` - Final
90
- * `D` - Delayed/Postponed
91
- * `S` - Scheduled
92
- * `I` - In Progress
93
- * `P` - Pregame
94
- * `O` - Game Over
95
- detailedState:
96
- type: string
97
- statusCode:
98
- type: string
99
- startTimeTBD:
100
- type: boolean
101
- abstractGameCode:
102
- type: string
103
- teams:
104
- title: MLBGameTeams
105
- type: object
106
- required:
107
- - away
108
- - home
109
- properties:
110
- away:
111
- $ref: ./schemas.yaml#/MLBGameTeam
112
- home:
113
- $ref: ./schemas.yaml#/MLBGameTeam
114
- venue:
115
- $ref: ./schemas.yaml#/MLBVenue
116
- isTie:
117
- type: boolean
118
- gameNumber:
119
- type: number
120
- publicFacing:
121
- type: boolean
122
- doubleHeader:
123
- type: string # enum?
124
- gamedayType:
125
- type: string # enum?
126
- tiebreaker:
127
- type: string # enum?
128
- calendarEventID:
129
- type: string
130
- seasonDisplay:
131
- type: string
132
- dayNight:
133
- type: string # enum?
134
- description:
135
- type: string
136
- scheduledInnings:
137
- type: number
138
- reverseHomeAwayStatus:
139
- type: boolean
140
- inningBreakLength:
141
- type: number
142
- gamesInSeries:
143
- type: number
144
- seriesGameNumber:
145
- type: number
146
- seriesDescription:
147
- type: string
148
- recordSource:
149
- type: string # enum
150
- ifNecessary:
151
- type: string # enum
152
- ifNecessaryDescription:
153
- type: string
@@ -1,22 +0,0 @@
1
- title: MLBGameTeam
2
- description: >
3
- Game Team
4
- type: object
5
- required:
6
- - leagueReccord
7
- - score
8
- - isWinner
9
- - team
10
- properties:
11
- leagueRecord:
12
- $ref: ./schemas.yaml#/MLBLeagueRecord
13
- score:
14
- type: number
15
- team:
16
- $ref: ./schemas.yaml#/MLBTeam
17
- isWinner:
18
- type: boolean
19
- splitSquad:
20
- type: boolean
21
- seriesNumber:
22
- type: number
@@ -1,62 +0,0 @@
1
- title: MLBLeague
2
- description: >
3
- League
4
- type: object
5
- required:
6
- - id
7
- - name
8
- properties:
9
- id:
10
- type: number
11
- name:
12
- type: string
13
- link:
14
- type: string
15
- abbreviation:
16
- type: string
17
- nameShort:
18
- type: string
19
- seasonState:
20
- type: string
21
- hasWildCard:
22
- type: boolean
23
- hasSplitSeason:
24
- type: boolean
25
- hasPlayoffPoints:
26
- type: boolean
27
- seasonDateInfo:
28
- title: MLBLeagueDates
29
- type: object
30
- properties:
31
- seasonId:
32
- type: string
33
- preSeasonStartDate:
34
- type: string
35
- preSeasonEndDate:
36
- type: string
37
- seasonStartDate:
38
- type: string
39
- springStartDate:
40
- type: string
41
- springEndDate:
42
- type: string
43
- offseasonStartDate:
44
- type: string
45
- offseasonEndDate:
46
- type: string
47
- seasonLevelGamedayType:
48
- type: string
49
- gameLevelGamedayType:
50
- type: string
51
- season:
52
- type: string
53
- orgCode:
54
- type: string
55
- conferencesInUse:
56
- type: boolean
57
- divisionsInUse:
58
- type: boolean
59
- sortOrder:
60
- type: number
61
- active:
62
- type: boolean
@@ -1,15 +0,0 @@
1
- title: MLBLeagueRecord
2
- type: object
3
- required:
4
- - wins
5
- - losses
6
- - pct
7
- properties:
8
- wins:
9
- type: number
10
- losses:
11
- type: number
12
- ties:
13
- type: number
14
- pct:
15
- type: string
@@ -1,95 +0,0 @@
1
- title: MLBRecord
2
- description: >
3
- Record
4
- type: object
5
- required:
6
- - team
7
- - season
8
- - streak
9
- - divisionRank
10
- - leagueRank
11
- - gamesBack
12
- - leagueRecord
13
- - wins
14
- - losses
15
- properties:
16
- team:
17
- $ref: ./schemas.yaml#/MLBTeam
18
- season:
19
- type: string
20
- streak:
21
- title: MLBStreak
22
- type: object
23
- properties:
24
- streakType:
25
- type: string
26
- enum:
27
- - "losses"
28
- - "wins"
29
- x-enum-varnames:
30
- - Losing
31
- - Winning
32
- description: >
33
- Streak Type:
34
- * Losing Streak
35
- * Winning Streak
36
- divisionRank:
37
- type: string
38
- leagueRank:
39
- type: string
40
- sportRank:
41
- type: string
42
- gamesPlayed:
43
- type: number
44
- gamesBack:
45
- type: string
46
- wildCardGamesBack:
47
- type: string
48
- leagueGamesBack:
49
- type: string
50
- sportGamesBack:
51
- type: string
52
- divisionGamesBack:
53
- type: string
54
- conferenceGamesBack:
55
- type: string
56
- leagueRecord:
57
- $ref: ./schemas.yaml#/MLBLeagueRecord
58
- lastUpdated:
59
- type: string
60
- # records: NEED TO FILL OUT MORE
61
- # type: object
62
- runsAllowed:
63
- type: number
64
- runsScored:
65
- type: number
66
- divisionChamp:
67
- type: boolean
68
- divisionLeader:
69
- type: boolean
70
- hasWildcard:
71
- type: boolean
72
- clinched:
73
- type: boolean
74
- eliminationNumber:
75
- type: string
76
- eliminationNumberSport:
77
- type: string
78
- eliminationNumberLeague:
79
- type: string
80
- eliminationNumberDivision:
81
- type: string
82
- eliminationNumberConference:
83
- type: string
84
- wildCardEliminationNumber:
85
- type: string
86
- magicNumber:
87
- type: string
88
- wins:
89
- type: number
90
- losses:
91
- type: number
92
- runDifferential:
93
- type: number
94
- winningPercentage:
95
- type: string
@@ -1,41 +0,0 @@
1
- title: MLBSchedule
2
- description: >
3
- Schedule
4
- type: object
5
- required:
6
- - totalItems
7
- - totalEvents
8
- - totalGames
9
- - totalGamesInProgress
10
- - dates
11
- properties:
12
- totalItems:
13
- type: number
14
- totalEvents:
15
- type: number
16
- totalGames:
17
- type: number
18
- totalGamesInProgress:
19
- type: number
20
- dates:
21
- type: array
22
- items:
23
- title: MLBScheduleDay
24
- type: object
25
- required:
26
- - games
27
- properties:
28
- date:
29
- type: string
30
- totalItems:
31
- type: number
32
- totalEvents:
33
- type: number
34
- totalGames:
35
- type: number
36
- totalGamesInProgress:
37
- type: number
38
- games:
39
- type: array
40
- items:
41
- $ref: ./schemas.yaml#/MLBGame
@@ -1,24 +0,0 @@
1
- MLBDivision:
2
- $ref: ./division.yaml
3
- MLBGame:
4
- $ref: ./game.yaml
5
- MLBGameTeam:
6
- $ref: ./gameTeam.yaml
7
- MLBLeague:
8
- $ref: ./league.yaml
9
- MLBLeagueRecord:
10
- $ref: ./leagueRecord.yaml
11
- MLBSeason:
12
- $ref: ./season.yaml
13
- MLBSchedule:
14
- $ref: ./schedule.yaml
15
- MLBSport:
16
- $ref: ./sport.yaml
17
- MLBStandings:
18
- $ref: ./standings.yaml
19
- MLBRecord:
20
- $ref: ./record.yaml
21
- MLBTeam:
22
- $ref: ./team.yaml
23
- MLBVenue:
24
- $ref: ./venue.yaml