@bp1222/stats-api 0.0.1 → 0.0.2
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/Makefile +3 -2
- package/openapitools.json +16 -13
- package/package.json +8 -2
- package/spec/components/schemas/game.yaml +2 -6
- package/spec/components/schemas/gameTeam.yaml +1 -9
- package/spec/components/schemas/leagueRecord.yaml +15 -0
- package/spec/components/schemas/record.yaml +1 -16
- package/spec/components/schemas/schedule.yaml +1 -1
- package/spec/components/schemas/schemas.yaml +2 -0
- package/src/.openapi-generator/FILES +14 -16
- package/src/.openapi-generator/VERSION +1 -1
- package/src/apis/MlbApi.ts +112 -13
- package/src/models/MLBGame.ts +1 -15
- package/src/models/MLBGameTeam.ts +10 -10
- package/src/models/{MLBTeamRecord1.ts → MLBLeagueRecord.ts} +14 -15
- package/src/models/MLBRecord.ts +9 -9
- package/src/models/MLBSchedule.ts +9 -9
- package/src/models/{MLBScheduleDay.ts → MLBScheduleDays.ts} +23 -23
- package/src/models/MLBSeasons.ts +9 -9
- package/src/models/MLBStandingsList.ts +9 -9
- package/src/models/MLBTeams.ts +9 -9
- package/src/models/index.ts +14 -16
- package/spec/components/parameters/query/eventTypes.yaml +0 -5
- package/spec/components/parameters/query/gamePks.yaml +0 -5
- package/spec/components/parameters/query/gameTypes.yaml +0 -5
- package/spec/components/parameters/query/opponentId.yaml +0 -5
- package/spec/components/parameters/query/scheduleType.yaml +0 -5
- package/spec/components/parameters/query/venueIds.yaml +0 -5
- package/src/models/Division.ts +0 -164
- package/src/models/Game.ts +0 -385
- package/src/models/GameContent.ts +0 -60
- package/src/models/GameTeam.ts +0 -117
- package/src/models/GameTeams.ts +0 -77
- package/src/models/League.ts +0 -190
- package/src/models/MLBGameContent.ts +0 -60
- package/src/models/MLBTeamRecord.ts +0 -76
- package/src/models/Record.ts +0 -337
- package/src/models/Schedule.ts +0 -105
- package/src/models/Season.ts +0 -226
- package/src/models/Sport.ts +0 -110
- package/src/models/Standings.ts +0 -130
- package/src/models/Team.ts +0 -248
- package/src/models/Venue.ts +0 -95
package/Makefile
CHANGED
|
@@ -19,8 +19,9 @@ help: ## Display this help page
|
|
|
19
19
|
|
|
20
20
|
.PHONY: bundle
|
|
21
21
|
bundle: ## Builds the yaml bundle
|
|
22
|
-
npx --yes @redocly/cli bundle -o bundle.yaml spec/openapi.yaml
|
|
22
|
+
npx --yes @redocly/cli bundle -d --remove-unused-components -o bundle.yaml spec/openapi.yaml
|
|
23
23
|
|
|
24
|
-
gen
|
|
24
|
+
.PHONY: gen
|
|
25
|
+
gen: bundle
|
|
25
26
|
npx --yes @openapitools/openapi-generator-cli generate --generator-key v0-client
|
|
26
27
|
|
package/openapitools.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bp1222/stats-api",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"main": "src/index.js",
|
|
3
|
+
"version": "0.0.2",
|
|
5
4
|
"module": "dist/index.mjs",
|
|
6
5
|
"types": "dist/index.d.ts",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/bp1222/stats-api.git"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
"./src": "./index.ts"
|
|
12
|
+
},
|
|
7
13
|
"scripts": {
|
|
8
14
|
"build": "tsup src/index.ts --format cjs,esm --dts"
|
|
9
15
|
},
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
title: MLBGame
|
|
2
2
|
description: >
|
|
3
|
-
Game
|
|
3
|
+
Game Thing
|
|
4
4
|
type: object
|
|
5
5
|
required:
|
|
6
6
|
- gamePk
|
|
@@ -101,6 +101,7 @@ properties:
|
|
|
101
101
|
abstractGameCode:
|
|
102
102
|
type: string
|
|
103
103
|
teams:
|
|
104
|
+
title: MLBGameTeams
|
|
104
105
|
type: object
|
|
105
106
|
required:
|
|
106
107
|
- away
|
|
@@ -112,11 +113,6 @@ properties:
|
|
|
112
113
|
$ref: ./schemas.yaml#/MLBGameTeam
|
|
113
114
|
venue:
|
|
114
115
|
$ref: ./schemas.yaml#/MLBVenue
|
|
115
|
-
content: # What is this!?
|
|
116
|
-
type: object
|
|
117
|
-
properties:
|
|
118
|
-
link:
|
|
119
|
-
type: string
|
|
120
116
|
isTie:
|
|
121
117
|
type: boolean
|
|
122
118
|
gameNumber:
|
|
@@ -9,15 +9,7 @@ required:
|
|
|
9
9
|
- team
|
|
10
10
|
properties:
|
|
11
11
|
leagueRecord:
|
|
12
|
-
|
|
13
|
-
type: object
|
|
14
|
-
properties:
|
|
15
|
-
wins:
|
|
16
|
-
type: number
|
|
17
|
-
losses:
|
|
18
|
-
type: number
|
|
19
|
-
pct:
|
|
20
|
-
type: string
|
|
12
|
+
$ref: ./schemas.yaml#/MLBLeagueRecord
|
|
21
13
|
score:
|
|
22
14
|
type: number
|
|
23
15
|
team:
|
|
@@ -54,22 +54,7 @@ properties:
|
|
|
54
54
|
conferenceGamesBack:
|
|
55
55
|
type: string
|
|
56
56
|
leagueRecord:
|
|
57
|
-
|
|
58
|
-
type: object
|
|
59
|
-
required:
|
|
60
|
-
- wins
|
|
61
|
-
- losses
|
|
62
|
-
- ties
|
|
63
|
-
- pct
|
|
64
|
-
properties:
|
|
65
|
-
wins:
|
|
66
|
-
type: number
|
|
67
|
-
losses:
|
|
68
|
-
type: number
|
|
69
|
-
ties:
|
|
70
|
-
type: number
|
|
71
|
-
pct:
|
|
72
|
-
type: string
|
|
57
|
+
$ref: ./schemas.yaml#/MLBLeagueRecord
|
|
73
58
|
lastUpdated:
|
|
74
59
|
type: string
|
|
75
60
|
# records: NEED TO FILL OUT MORE
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
apis/MlbApi.ts
|
|
2
2
|
apis/index.ts
|
|
3
3
|
index.ts
|
|
4
|
-
models/
|
|
5
|
-
models/
|
|
6
|
-
models/GameContent.ts
|
|
7
|
-
models/GameTeam.ts
|
|
8
|
-
models/GameTeams.ts
|
|
9
|
-
models/League.ts
|
|
4
|
+
models/MLBDivision.ts
|
|
5
|
+
models/MLBGame.ts
|
|
10
6
|
models/MLBGameStatus.ts
|
|
7
|
+
models/MLBGameTeam.ts
|
|
8
|
+
models/MLBGameTeams.ts
|
|
9
|
+
models/MLBLeague.ts
|
|
11
10
|
models/MLBLeagueDates.ts
|
|
12
|
-
models/
|
|
11
|
+
models/MLBLeagueRecord.ts
|
|
12
|
+
models/MLBRecord.ts
|
|
13
|
+
models/MLBSchedule.ts
|
|
14
|
+
models/MLBScheduleDays.ts
|
|
15
|
+
models/MLBSeason.ts
|
|
13
16
|
models/MLBSeasons.ts
|
|
17
|
+
models/MLBSport.ts
|
|
18
|
+
models/MLBStandings.ts
|
|
14
19
|
models/MLBStandingsList.ts
|
|
15
20
|
models/MLBStreak.ts
|
|
16
|
-
models/
|
|
17
|
-
models/MLBTeamRecord1.ts
|
|
21
|
+
models/MLBTeam.ts
|
|
18
22
|
models/MLBTeams.ts
|
|
19
|
-
models/
|
|
20
|
-
models/Schedule.ts
|
|
21
|
-
models/Season.ts
|
|
22
|
-
models/Sport.ts
|
|
23
|
-
models/Standings.ts
|
|
24
|
-
models/Team.ts
|
|
25
|
-
models/Venue.ts
|
|
23
|
+
models/MLBVenue.ts
|
|
26
24
|
models/index.ts
|
|
27
25
|
runtime.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
7.
|
|
1
|
+
7.8.0
|
package/src/apis/MlbApi.ts
CHANGED
|
@@ -15,23 +15,23 @@
|
|
|
15
15
|
|
|
16
16
|
import * as runtime from '../runtime';
|
|
17
17
|
import type {
|
|
18
|
+
MLBSchedule,
|
|
19
|
+
MLBSeason,
|
|
18
20
|
MLBSeasons,
|
|
19
21
|
MLBStandingsList,
|
|
20
22
|
MLBTeams,
|
|
21
|
-
Schedule,
|
|
22
|
-
Season,
|
|
23
23
|
} from '../models/index';
|
|
24
24
|
import {
|
|
25
|
+
MLBScheduleFromJSON,
|
|
26
|
+
MLBScheduleToJSON,
|
|
27
|
+
MLBSeasonFromJSON,
|
|
28
|
+
MLBSeasonToJSON,
|
|
25
29
|
MLBSeasonsFromJSON,
|
|
26
30
|
MLBSeasonsToJSON,
|
|
27
31
|
MLBStandingsListFromJSON,
|
|
28
32
|
MLBStandingsListToJSON,
|
|
29
33
|
MLBTeamsFromJSON,
|
|
30
34
|
MLBTeamsToJSON,
|
|
31
|
-
ScheduleFromJSON,
|
|
32
|
-
ScheduleToJSON,
|
|
33
|
-
SeasonFromJSON,
|
|
34
|
-
SeasonToJSON,
|
|
35
35
|
} from '../models/index';
|
|
36
36
|
|
|
37
37
|
export interface GetAllSeasonsRequest {
|
|
@@ -65,9 +65,108 @@ export interface GetTeamsRequest {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
|
+
* MlbApi - interface
|
|
68
69
|
*
|
|
70
|
+
* @export
|
|
71
|
+
* @interface MlbApiInterface
|
|
69
72
|
*/
|
|
70
|
-
export
|
|
73
|
+
export interface MlbApiInterface {
|
|
74
|
+
/**
|
|
75
|
+
* Returns All Seasons
|
|
76
|
+
* @summary Retrieves All Seasons over time
|
|
77
|
+
* @param {number} sportId
|
|
78
|
+
* @param {*} [options] Override http request option.
|
|
79
|
+
* @throws {RequiredError}
|
|
80
|
+
* @memberof MlbApiInterface
|
|
81
|
+
*/
|
|
82
|
+
getAllSeasonsRaw(requestParameters: GetAllSeasonsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBSeasons>>;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Returns All Seasons
|
|
86
|
+
* Retrieves All Seasons over time
|
|
87
|
+
*/
|
|
88
|
+
getAllSeasons(requestParameters: GetAllSeasonsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBSeasons>;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Returns Schedule
|
|
92
|
+
* @summary Retrieves schedule
|
|
93
|
+
* @param {number} sportId
|
|
94
|
+
* @param {number} [teamId]
|
|
95
|
+
* @param {string} [startDate]
|
|
96
|
+
* @param {string} [endDate]
|
|
97
|
+
* @param {*} [options] Override http request option.
|
|
98
|
+
* @throws {RequiredError}
|
|
99
|
+
* @memberof MlbApiInterface
|
|
100
|
+
*/
|
|
101
|
+
getScheduleRaw(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBSchedule>>;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Returns Schedule
|
|
105
|
+
* Retrieves schedule
|
|
106
|
+
*/
|
|
107
|
+
getSchedule(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBSchedule>;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Returns Season
|
|
111
|
+
* @summary Retrieves season
|
|
112
|
+
* @param {number} sportId
|
|
113
|
+
* @param {string} season
|
|
114
|
+
* @param {*} [options] Override http request option.
|
|
115
|
+
* @throws {RequiredError}
|
|
116
|
+
* @memberof MlbApiInterface
|
|
117
|
+
*/
|
|
118
|
+
getSeasonRaw(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBSeason>>;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Returns Season
|
|
122
|
+
* Retrieves season
|
|
123
|
+
*/
|
|
124
|
+
getSeason(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBSeason>;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Returns Standing
|
|
128
|
+
* @summary Retrieves Standings
|
|
129
|
+
* @param {number} leagueId
|
|
130
|
+
* @param {string} season
|
|
131
|
+
* @param {string} [date]
|
|
132
|
+
* @param {Array<string>} [fields]
|
|
133
|
+
* @param {string} [hydrate]
|
|
134
|
+
* @param {*} [options] Override http request option.
|
|
135
|
+
* @throws {RequiredError}
|
|
136
|
+
* @memberof MlbApiInterface
|
|
137
|
+
*/
|
|
138
|
+
getStandingsRaw(requestParameters: GetStandingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBStandingsList>>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Returns Standing
|
|
142
|
+
* Retrieves Standings
|
|
143
|
+
*/
|
|
144
|
+
getStandings(requestParameters: GetStandingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBStandingsList>;
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Returns Teams
|
|
148
|
+
* @summary Retrieves Teams
|
|
149
|
+
* @param {number} sportId
|
|
150
|
+
* @param {string} season
|
|
151
|
+
* @param {Array<number>} [leagueIds]
|
|
152
|
+
* @param {*} [options] Override http request option.
|
|
153
|
+
* @throws {RequiredError}
|
|
154
|
+
* @memberof MlbApiInterface
|
|
155
|
+
*/
|
|
156
|
+
getTeamsRaw(requestParameters: GetTeamsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBTeams>>;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Returns Teams
|
|
160
|
+
* Retrieves Teams
|
|
161
|
+
*/
|
|
162
|
+
getTeams(requestParameters: GetTeamsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBTeams>;
|
|
163
|
+
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
*
|
|
168
|
+
*/
|
|
169
|
+
export class MlbApi extends runtime.BaseAPI implements MlbApiInterface {
|
|
71
170
|
|
|
72
171
|
/**
|
|
73
172
|
* Returns All Seasons
|
|
@@ -112,7 +211,7 @@ export class MlbApi extends runtime.BaseAPI {
|
|
|
112
211
|
* Returns Schedule
|
|
113
212
|
* Retrieves schedule
|
|
114
213
|
*/
|
|
115
|
-
async getScheduleRaw(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
214
|
+
async getScheduleRaw(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBSchedule>> {
|
|
116
215
|
if (requestParameters['sportId'] == null) {
|
|
117
216
|
throw new runtime.RequiredError(
|
|
118
217
|
'sportId',
|
|
@@ -147,14 +246,14 @@ export class MlbApi extends runtime.BaseAPI {
|
|
|
147
246
|
query: queryParameters,
|
|
148
247
|
}, initOverrides);
|
|
149
248
|
|
|
150
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
249
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MLBScheduleFromJSON(jsonValue));
|
|
151
250
|
}
|
|
152
251
|
|
|
153
252
|
/**
|
|
154
253
|
* Returns Schedule
|
|
155
254
|
* Retrieves schedule
|
|
156
255
|
*/
|
|
157
|
-
async getSchedule(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
256
|
+
async getSchedule(requestParameters: GetScheduleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBSchedule> {
|
|
158
257
|
const response = await this.getScheduleRaw(requestParameters, initOverrides);
|
|
159
258
|
return await response.value();
|
|
160
259
|
}
|
|
@@ -163,7 +262,7 @@ export class MlbApi extends runtime.BaseAPI {
|
|
|
163
262
|
* Returns Season
|
|
164
263
|
* Retrieves season
|
|
165
264
|
*/
|
|
166
|
-
async getSeasonRaw(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<
|
|
265
|
+
async getSeasonRaw(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MLBSeason>> {
|
|
167
266
|
if (requestParameters['sportId'] == null) {
|
|
168
267
|
throw new runtime.RequiredError(
|
|
169
268
|
'sportId',
|
|
@@ -197,14 +296,14 @@ export class MlbApi extends runtime.BaseAPI {
|
|
|
197
296
|
query: queryParameters,
|
|
198
297
|
}, initOverrides);
|
|
199
298
|
|
|
200
|
-
return new runtime.JSONApiResponse(response, (jsonValue) =>
|
|
299
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => MLBSeasonFromJSON(jsonValue));
|
|
201
300
|
}
|
|
202
301
|
|
|
203
302
|
/**
|
|
204
303
|
* Returns Season
|
|
205
304
|
* Retrieves season
|
|
206
305
|
*/
|
|
207
|
-
async getSeason(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<
|
|
306
|
+
async getSeason(requestParameters: GetSeasonRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MLBSeason> {
|
|
208
307
|
const response = await this.getSeasonRaw(requestParameters, initOverrides);
|
|
209
308
|
return await response.value();
|
|
210
309
|
}
|
package/src/models/MLBGame.ts
CHANGED
|
@@ -19,12 +19,6 @@ import {
|
|
|
19
19
|
MLBVenueFromJSONTyped,
|
|
20
20
|
MLBVenueToJSON,
|
|
21
21
|
} from './MLBVenue';
|
|
22
|
-
import type { MLBGameContent } from './MLBGameContent';
|
|
23
|
-
import {
|
|
24
|
-
MLBGameContentFromJSON,
|
|
25
|
-
MLBGameContentFromJSONTyped,
|
|
26
|
-
MLBGameContentToJSON,
|
|
27
|
-
} from './MLBGameContent';
|
|
28
22
|
import type { MLBGameStatus } from './MLBGameStatus';
|
|
29
23
|
import {
|
|
30
24
|
MLBGameStatusFromJSON,
|
|
@@ -39,7 +33,7 @@ import {
|
|
|
39
33
|
} from './MLBGameTeams';
|
|
40
34
|
|
|
41
35
|
/**
|
|
42
|
-
* Game
|
|
36
|
+
* Game Thing
|
|
43
37
|
*
|
|
44
38
|
* @export
|
|
45
39
|
* @interface MLBGame
|
|
@@ -137,12 +131,6 @@ export interface MLBGame {
|
|
|
137
131
|
* @memberof MLBGame
|
|
138
132
|
*/
|
|
139
133
|
venue?: MLBVenue;
|
|
140
|
-
/**
|
|
141
|
-
*
|
|
142
|
-
* @type {MLBGameContent}
|
|
143
|
-
* @memberof MLBGame
|
|
144
|
-
*/
|
|
145
|
-
content?: MLBGameContent;
|
|
146
134
|
/**
|
|
147
135
|
*
|
|
148
136
|
* @type {boolean}
|
|
@@ -317,7 +305,6 @@ export function MLBGameFromJSONTyped(json: any, ignoreDiscriminator: boolean): M
|
|
|
317
305
|
'status': MLBGameStatusFromJSON(json['status']),
|
|
318
306
|
'teams': MLBGameTeamsFromJSON(json['teams']),
|
|
319
307
|
'venue': json['venue'] == null ? undefined : MLBVenueFromJSON(json['venue']),
|
|
320
|
-
'content': json['content'] == null ? undefined : MLBGameContentFromJSON(json['content']),
|
|
321
308
|
'isTie': json['isTie'] == null ? undefined : json['isTie'],
|
|
322
309
|
'gameNumber': json['gameNumber'],
|
|
323
310
|
'publicFacing': json['publicFacing'] == null ? undefined : json['publicFacing'],
|
|
@@ -360,7 +347,6 @@ export function MLBGameToJSON(value?: MLBGame | null): any {
|
|
|
360
347
|
'status': MLBGameStatusToJSON(value['status']),
|
|
361
348
|
'teams': MLBGameTeamsToJSON(value['teams']),
|
|
362
349
|
'venue': MLBVenueToJSON(value['venue']),
|
|
363
|
-
'content': MLBGameContentToJSON(value['content']),
|
|
364
350
|
'isTie': value['isTie'],
|
|
365
351
|
'gameNumber': value['gameNumber'],
|
|
366
352
|
'publicFacing': value['publicFacing'],
|
|
@@ -13,18 +13,18 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { mapValues } from '../runtime';
|
|
16
|
-
import type { MLBTeamRecord } from './MLBTeamRecord';
|
|
17
|
-
import {
|
|
18
|
-
MLBTeamRecordFromJSON,
|
|
19
|
-
MLBTeamRecordFromJSONTyped,
|
|
20
|
-
MLBTeamRecordToJSON,
|
|
21
|
-
} from './MLBTeamRecord';
|
|
22
16
|
import type { MLBTeam } from './MLBTeam';
|
|
23
17
|
import {
|
|
24
18
|
MLBTeamFromJSON,
|
|
25
19
|
MLBTeamFromJSONTyped,
|
|
26
20
|
MLBTeamToJSON,
|
|
27
21
|
} from './MLBTeam';
|
|
22
|
+
import type { MLBLeagueRecord } from './MLBLeagueRecord';
|
|
23
|
+
import {
|
|
24
|
+
MLBLeagueRecordFromJSON,
|
|
25
|
+
MLBLeagueRecordFromJSONTyped,
|
|
26
|
+
MLBLeagueRecordToJSON,
|
|
27
|
+
} from './MLBLeagueRecord';
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Game Team
|
|
@@ -35,10 +35,10 @@ import {
|
|
|
35
35
|
export interface MLBGameTeam {
|
|
36
36
|
/**
|
|
37
37
|
*
|
|
38
|
-
* @type {
|
|
38
|
+
* @type {MLBLeagueRecord}
|
|
39
39
|
* @memberof MLBGameTeam
|
|
40
40
|
*/
|
|
41
|
-
leagueRecord?:
|
|
41
|
+
leagueRecord?: MLBLeagueRecord;
|
|
42
42
|
/**
|
|
43
43
|
*
|
|
44
44
|
* @type {number}
|
|
@@ -91,7 +91,7 @@ export function MLBGameTeamFromJSONTyped(json: any, ignoreDiscriminator: boolean
|
|
|
91
91
|
}
|
|
92
92
|
return {
|
|
93
93
|
|
|
94
|
-
'leagueRecord': json['leagueRecord'] == null ? undefined :
|
|
94
|
+
'leagueRecord': json['leagueRecord'] == null ? undefined : MLBLeagueRecordFromJSON(json['leagueRecord']),
|
|
95
95
|
'score': json['score'],
|
|
96
96
|
'team': MLBTeamFromJSON(json['team']),
|
|
97
97
|
'isWinner': json['isWinner'],
|
|
@@ -106,7 +106,7 @@ export function MLBGameTeamToJSON(value?: MLBGameTeam | null): any {
|
|
|
106
106
|
}
|
|
107
107
|
return {
|
|
108
108
|
|
|
109
|
-
'leagueRecord':
|
|
109
|
+
'leagueRecord': MLBLeagueRecordToJSON(value['leagueRecord']),
|
|
110
110
|
'score': value['score'],
|
|
111
111
|
'team': MLBTeamToJSON(value['team']),
|
|
112
112
|
'isWinner': value['isWinner'],
|
|
@@ -16,51 +16,50 @@ import { mapValues } from '../runtime';
|
|
|
16
16
|
/**
|
|
17
17
|
*
|
|
18
18
|
* @export
|
|
19
|
-
* @interface
|
|
19
|
+
* @interface MLBLeagueRecord
|
|
20
20
|
*/
|
|
21
|
-
export interface
|
|
21
|
+
export interface MLBLeagueRecord {
|
|
22
22
|
/**
|
|
23
23
|
*
|
|
24
24
|
* @type {number}
|
|
25
|
-
* @memberof
|
|
25
|
+
* @memberof MLBLeagueRecord
|
|
26
26
|
*/
|
|
27
27
|
wins: number;
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* @type {number}
|
|
31
|
-
* @memberof
|
|
31
|
+
* @memberof MLBLeagueRecord
|
|
32
32
|
*/
|
|
33
33
|
losses: number;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @type {number}
|
|
37
|
-
* @memberof
|
|
37
|
+
* @memberof MLBLeagueRecord
|
|
38
38
|
*/
|
|
39
|
-
ties
|
|
39
|
+
ties?: number;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* @type {string}
|
|
43
|
-
* @memberof
|
|
43
|
+
* @memberof MLBLeagueRecord
|
|
44
44
|
*/
|
|
45
45
|
pct: string;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
* Check if a given object implements the
|
|
49
|
+
* Check if a given object implements the MLBLeagueRecord interface.
|
|
50
50
|
*/
|
|
51
|
-
export function
|
|
51
|
+
export function instanceOfMLBLeagueRecord(value: object): value is MLBLeagueRecord {
|
|
52
52
|
if (!('wins' in value) || value['wins'] === undefined) return false;
|
|
53
53
|
if (!('losses' in value) || value['losses'] === undefined) return false;
|
|
54
|
-
if (!('ties' in value) || value['ties'] === undefined) return false;
|
|
55
54
|
if (!('pct' in value) || value['pct'] === undefined) return false;
|
|
56
55
|
return true;
|
|
57
56
|
}
|
|
58
57
|
|
|
59
|
-
export function
|
|
60
|
-
return
|
|
58
|
+
export function MLBLeagueRecordFromJSON(json: any): MLBLeagueRecord {
|
|
59
|
+
return MLBLeagueRecordFromJSONTyped(json, false);
|
|
61
60
|
}
|
|
62
61
|
|
|
63
|
-
export function
|
|
62
|
+
export function MLBLeagueRecordFromJSONTyped(json: any, ignoreDiscriminator: boolean): MLBLeagueRecord {
|
|
64
63
|
if (json == null) {
|
|
65
64
|
return json;
|
|
66
65
|
}
|
|
@@ -68,12 +67,12 @@ export function MLBTeamRecord1FromJSONTyped(json: any, ignoreDiscriminator: bool
|
|
|
68
67
|
|
|
69
68
|
'wins': json['wins'],
|
|
70
69
|
'losses': json['losses'],
|
|
71
|
-
'ties': json['ties'],
|
|
70
|
+
'ties': json['ties'] == null ? undefined : json['ties'],
|
|
72
71
|
'pct': json['pct'],
|
|
73
72
|
};
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
export function
|
|
75
|
+
export function MLBLeagueRecordToJSON(value?: MLBLeagueRecord | null): any {
|
|
77
76
|
if (value == null) {
|
|
78
77
|
return value;
|
|
79
78
|
}
|
package/src/models/MLBRecord.ts
CHANGED
|
@@ -25,12 +25,12 @@ import {
|
|
|
25
25
|
MLBTeamFromJSONTyped,
|
|
26
26
|
MLBTeamToJSON,
|
|
27
27
|
} from './MLBTeam';
|
|
28
|
-
import type {
|
|
28
|
+
import type { MLBLeagueRecord } from './MLBLeagueRecord';
|
|
29
29
|
import {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
} from './
|
|
30
|
+
MLBLeagueRecordFromJSON,
|
|
31
|
+
MLBLeagueRecordFromJSONTyped,
|
|
32
|
+
MLBLeagueRecordToJSON,
|
|
33
|
+
} from './MLBLeagueRecord';
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Record
|
|
@@ -119,10 +119,10 @@ export interface MLBRecord {
|
|
|
119
119
|
conferenceGamesBack?: string;
|
|
120
120
|
/**
|
|
121
121
|
*
|
|
122
|
-
* @type {
|
|
122
|
+
* @type {MLBLeagueRecord}
|
|
123
123
|
* @memberof MLBRecord
|
|
124
124
|
*/
|
|
125
|
-
leagueRecord:
|
|
125
|
+
leagueRecord: MLBLeagueRecord;
|
|
126
126
|
/**
|
|
127
127
|
*
|
|
128
128
|
* @type {string}
|
|
@@ -272,7 +272,7 @@ export function MLBRecordFromJSONTyped(json: any, ignoreDiscriminator: boolean):
|
|
|
272
272
|
'sportGamesBack': json['sportGamesBack'] == null ? undefined : json['sportGamesBack'],
|
|
273
273
|
'divisionGamesBack': json['divisionGamesBack'] == null ? undefined : json['divisionGamesBack'],
|
|
274
274
|
'conferenceGamesBack': json['conferenceGamesBack'] == null ? undefined : json['conferenceGamesBack'],
|
|
275
|
-
'leagueRecord':
|
|
275
|
+
'leagueRecord': MLBLeagueRecordFromJSON(json['leagueRecord']),
|
|
276
276
|
'lastUpdated': json['lastUpdated'] == null ? undefined : json['lastUpdated'],
|
|
277
277
|
'runsAllowed': json['runsAllowed'] == null ? undefined : json['runsAllowed'],
|
|
278
278
|
'runsScored': json['runsScored'] == null ? undefined : json['runsScored'],
|
|
@@ -313,7 +313,7 @@ export function MLBRecordToJSON(value?: MLBRecord | null): any {
|
|
|
313
313
|
'sportGamesBack': value['sportGamesBack'],
|
|
314
314
|
'divisionGamesBack': value['divisionGamesBack'],
|
|
315
315
|
'conferenceGamesBack': value['conferenceGamesBack'],
|
|
316
|
-
'leagueRecord':
|
|
316
|
+
'leagueRecord': MLBLeagueRecordToJSON(value['leagueRecord']),
|
|
317
317
|
'lastUpdated': value['lastUpdated'],
|
|
318
318
|
'runsAllowed': value['runsAllowed'],
|
|
319
319
|
'runsScored': value['runsScored'],
|