@bp1222/stats-api 0.3.2 → 0.5.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.
- package/dist/index.d.ts +3811 -934
- package/dist/index.js +2052 -2834
- package/package.json +20 -10
- package/dist/index.d.mts +0 -934
- package/dist/index.mjs +0 -2787
package/dist/index.mjs
DELETED
|
@@ -1,2787 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
var __async = (__this, __arguments, generator) => {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
var fulfilled = (value) => {
|
|
23
|
-
try {
|
|
24
|
-
step(generator.next(value));
|
|
25
|
-
} catch (e) {
|
|
26
|
-
reject(e);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var rejected = (value) => {
|
|
30
|
-
try {
|
|
31
|
-
step(generator.throw(value));
|
|
32
|
-
} catch (e) {
|
|
33
|
-
reject(e);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// src/runtime.ts
|
|
42
|
-
var BASE_PATH = "https://statsapi.mlb.com/api".replace(/\/+$/, "");
|
|
43
|
-
var Configuration = class {
|
|
44
|
-
constructor(configuration = {}) {
|
|
45
|
-
this.configuration = configuration;
|
|
46
|
-
}
|
|
47
|
-
set config(configuration) {
|
|
48
|
-
this.configuration = configuration;
|
|
49
|
-
}
|
|
50
|
-
get basePath() {
|
|
51
|
-
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
|
|
52
|
-
}
|
|
53
|
-
get fetchApi() {
|
|
54
|
-
return this.configuration.fetchApi;
|
|
55
|
-
}
|
|
56
|
-
get middleware() {
|
|
57
|
-
return this.configuration.middleware || [];
|
|
58
|
-
}
|
|
59
|
-
get queryParamsStringify() {
|
|
60
|
-
return this.configuration.queryParamsStringify || querystring;
|
|
61
|
-
}
|
|
62
|
-
get username() {
|
|
63
|
-
return this.configuration.username;
|
|
64
|
-
}
|
|
65
|
-
get password() {
|
|
66
|
-
return this.configuration.password;
|
|
67
|
-
}
|
|
68
|
-
get apiKey() {
|
|
69
|
-
const apiKey = this.configuration.apiKey;
|
|
70
|
-
if (apiKey) {
|
|
71
|
-
return typeof apiKey === "function" ? apiKey : () => apiKey;
|
|
72
|
-
}
|
|
73
|
-
return void 0;
|
|
74
|
-
}
|
|
75
|
-
get accessToken() {
|
|
76
|
-
const accessToken = this.configuration.accessToken;
|
|
77
|
-
if (accessToken) {
|
|
78
|
-
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
|
|
79
|
-
return accessToken;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
return void 0;
|
|
83
|
-
}
|
|
84
|
-
get headers() {
|
|
85
|
-
return this.configuration.headers;
|
|
86
|
-
}
|
|
87
|
-
get credentials() {
|
|
88
|
-
return this.configuration.credentials;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
var DefaultConfig = new Configuration();
|
|
92
|
-
var _BaseAPI = class _BaseAPI {
|
|
93
|
-
constructor(configuration = DefaultConfig) {
|
|
94
|
-
this.configuration = configuration;
|
|
95
|
-
this.fetchApi = (url, init) => __async(this, null, function* () {
|
|
96
|
-
let fetchParams = { url, init };
|
|
97
|
-
for (const middleware of this.middleware) {
|
|
98
|
-
if (middleware.pre) {
|
|
99
|
-
fetchParams = (yield middleware.pre(__spreadValues({
|
|
100
|
-
fetch: this.fetchApi
|
|
101
|
-
}, fetchParams))) || fetchParams;
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
let response = void 0;
|
|
105
|
-
try {
|
|
106
|
-
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
107
|
-
} catch (e) {
|
|
108
|
-
for (const middleware of this.middleware) {
|
|
109
|
-
if (middleware.onError) {
|
|
110
|
-
response = (yield middleware.onError({
|
|
111
|
-
fetch: this.fetchApi,
|
|
112
|
-
url: fetchParams.url,
|
|
113
|
-
init: fetchParams.init,
|
|
114
|
-
error: e,
|
|
115
|
-
response: response ? response.clone() : void 0
|
|
116
|
-
})) || response;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
if (response === void 0) {
|
|
120
|
-
if (e instanceof Error) {
|
|
121
|
-
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
|
|
122
|
-
} else {
|
|
123
|
-
throw e;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
for (const middleware of this.middleware) {
|
|
128
|
-
if (middleware.post) {
|
|
129
|
-
response = (yield middleware.post({
|
|
130
|
-
fetch: this.fetchApi,
|
|
131
|
-
url: fetchParams.url,
|
|
132
|
-
init: fetchParams.init,
|
|
133
|
-
response: response.clone()
|
|
134
|
-
})) || response;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
return response;
|
|
138
|
-
});
|
|
139
|
-
this.middleware = configuration.middleware;
|
|
140
|
-
}
|
|
141
|
-
withMiddleware(...middlewares) {
|
|
142
|
-
const next = this.clone();
|
|
143
|
-
next.middleware = next.middleware.concat(...middlewares);
|
|
144
|
-
return next;
|
|
145
|
-
}
|
|
146
|
-
withPreMiddleware(...preMiddlewares) {
|
|
147
|
-
const middlewares = preMiddlewares.map((pre) => ({ pre }));
|
|
148
|
-
return this.withMiddleware(...middlewares);
|
|
149
|
-
}
|
|
150
|
-
withPostMiddleware(...postMiddlewares) {
|
|
151
|
-
const middlewares = postMiddlewares.map((post) => ({ post }));
|
|
152
|
-
return this.withMiddleware(...middlewares);
|
|
153
|
-
}
|
|
154
|
-
/**
|
|
155
|
-
* Check if the given MIME is a JSON MIME.
|
|
156
|
-
* JSON MIME examples:
|
|
157
|
-
* application/json
|
|
158
|
-
* application/json; charset=UTF8
|
|
159
|
-
* APPLICATION/JSON
|
|
160
|
-
* application/vnd.company+json
|
|
161
|
-
* @param mime - MIME (Multipurpose Internet Mail Extensions)
|
|
162
|
-
* @return True if the given MIME is JSON, false otherwise.
|
|
163
|
-
*/
|
|
164
|
-
isJsonMime(mime) {
|
|
165
|
-
if (!mime) {
|
|
166
|
-
return false;
|
|
167
|
-
}
|
|
168
|
-
return _BaseAPI.jsonRegex.test(mime);
|
|
169
|
-
}
|
|
170
|
-
request(context, initOverrides) {
|
|
171
|
-
return __async(this, null, function* () {
|
|
172
|
-
const { url, init } = yield this.createFetchParams(context, initOverrides);
|
|
173
|
-
const response = yield this.fetchApi(url, init);
|
|
174
|
-
if (response && (response.status >= 200 && response.status < 300)) {
|
|
175
|
-
return response;
|
|
176
|
-
}
|
|
177
|
-
throw new ResponseError(response, "Response returned an error code");
|
|
178
|
-
});
|
|
179
|
-
}
|
|
180
|
-
createFetchParams(context, initOverrides) {
|
|
181
|
-
return __async(this, null, function* () {
|
|
182
|
-
let url = this.configuration.basePath + context.path;
|
|
183
|
-
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
|
|
184
|
-
url += "?" + this.configuration.queryParamsStringify(context.query);
|
|
185
|
-
}
|
|
186
|
-
const headers = Object.assign({}, this.configuration.headers, context.headers);
|
|
187
|
-
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
|
|
188
|
-
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
|
|
189
|
-
return initOverrides;
|
|
190
|
-
});
|
|
191
|
-
const initParams = {
|
|
192
|
-
method: context.method,
|
|
193
|
-
headers,
|
|
194
|
-
body: context.body,
|
|
195
|
-
credentials: this.configuration.credentials
|
|
196
|
-
};
|
|
197
|
-
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
|
|
198
|
-
init: initParams,
|
|
199
|
-
context
|
|
200
|
-
}));
|
|
201
|
-
let body;
|
|
202
|
-
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
|
|
203
|
-
body = overriddenInit.body;
|
|
204
|
-
} else if (this.isJsonMime(headers["Content-Type"])) {
|
|
205
|
-
body = JSON.stringify(overriddenInit.body);
|
|
206
|
-
} else {
|
|
207
|
-
body = overriddenInit.body;
|
|
208
|
-
}
|
|
209
|
-
const init = __spreadProps(__spreadValues({}, overriddenInit), {
|
|
210
|
-
body
|
|
211
|
-
});
|
|
212
|
-
return { url, init };
|
|
213
|
-
});
|
|
214
|
-
}
|
|
215
|
-
/**
|
|
216
|
-
* Create a shallow clone of `this` by constructing a new instance
|
|
217
|
-
* and then shallow cloning data members.
|
|
218
|
-
*/
|
|
219
|
-
clone() {
|
|
220
|
-
const constructor = this.constructor;
|
|
221
|
-
const next = new constructor(this.configuration);
|
|
222
|
-
next.middleware = this.middleware.slice();
|
|
223
|
-
return next;
|
|
224
|
-
}
|
|
225
|
-
};
|
|
226
|
-
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
|
|
227
|
-
var BaseAPI = _BaseAPI;
|
|
228
|
-
function isBlob(value) {
|
|
229
|
-
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
230
|
-
}
|
|
231
|
-
function isFormData(value) {
|
|
232
|
-
return typeof FormData !== "undefined" && value instanceof FormData;
|
|
233
|
-
}
|
|
234
|
-
var ResponseError = class extends Error {
|
|
235
|
-
constructor(response, msg) {
|
|
236
|
-
super(msg);
|
|
237
|
-
this.response = response;
|
|
238
|
-
this.name = "ResponseError";
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
var FetchError = class extends Error {
|
|
242
|
-
constructor(cause, msg) {
|
|
243
|
-
super(msg);
|
|
244
|
-
this.cause = cause;
|
|
245
|
-
this.name = "FetchError";
|
|
246
|
-
}
|
|
247
|
-
};
|
|
248
|
-
var RequiredError = class extends Error {
|
|
249
|
-
constructor(field, msg) {
|
|
250
|
-
super(msg);
|
|
251
|
-
this.field = field;
|
|
252
|
-
this.name = "RequiredError";
|
|
253
|
-
}
|
|
254
|
-
};
|
|
255
|
-
var COLLECTION_FORMATS = {
|
|
256
|
-
csv: ",",
|
|
257
|
-
ssv: " ",
|
|
258
|
-
tsv: " ",
|
|
259
|
-
pipes: "|"
|
|
260
|
-
};
|
|
261
|
-
function querystring(params, prefix = "") {
|
|
262
|
-
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
|
|
263
|
-
}
|
|
264
|
-
function querystringSingleKey(key, value, keyPrefix = "") {
|
|
265
|
-
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
266
|
-
if (value instanceof Array) {
|
|
267
|
-
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
|
|
268
|
-
return `${encodeURIComponent(fullKey)}=${multiValue}`;
|
|
269
|
-
}
|
|
270
|
-
if (value instanceof Set) {
|
|
271
|
-
const valueAsArray = Array.from(value);
|
|
272
|
-
return querystringSingleKey(key, valueAsArray, keyPrefix);
|
|
273
|
-
}
|
|
274
|
-
if (value instanceof Date) {
|
|
275
|
-
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
|
|
276
|
-
}
|
|
277
|
-
if (value instanceof Object) {
|
|
278
|
-
return querystring(value, fullKey);
|
|
279
|
-
}
|
|
280
|
-
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
|
|
281
|
-
}
|
|
282
|
-
function exists(json, key) {
|
|
283
|
-
const value = json[key];
|
|
284
|
-
return value !== null && value !== void 0;
|
|
285
|
-
}
|
|
286
|
-
function mapValues(data, fn) {
|
|
287
|
-
return Object.keys(data).reduce(
|
|
288
|
-
(acc, key) => __spreadProps(__spreadValues({}, acc), { [key]: fn(data[key]) }),
|
|
289
|
-
{}
|
|
290
|
-
);
|
|
291
|
-
}
|
|
292
|
-
function canConsumeForm(consumes) {
|
|
293
|
-
for (const consume of consumes) {
|
|
294
|
-
if ("multipart/form-data" === consume.contentType) {
|
|
295
|
-
return true;
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
return false;
|
|
299
|
-
}
|
|
300
|
-
var JSONApiResponse = class {
|
|
301
|
-
constructor(raw, transformer = (jsonValue) => jsonValue) {
|
|
302
|
-
this.raw = raw;
|
|
303
|
-
this.transformer = transformer;
|
|
304
|
-
}
|
|
305
|
-
value() {
|
|
306
|
-
return __async(this, null, function* () {
|
|
307
|
-
return this.transformer(yield this.raw.json());
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
var VoidApiResponse = class {
|
|
312
|
-
constructor(raw) {
|
|
313
|
-
this.raw = raw;
|
|
314
|
-
}
|
|
315
|
-
value() {
|
|
316
|
-
return __async(this, null, function* () {
|
|
317
|
-
return void 0;
|
|
318
|
-
});
|
|
319
|
-
}
|
|
320
|
-
};
|
|
321
|
-
var BlobApiResponse = class {
|
|
322
|
-
constructor(raw) {
|
|
323
|
-
this.raw = raw;
|
|
324
|
-
}
|
|
325
|
-
value() {
|
|
326
|
-
return __async(this, null, function* () {
|
|
327
|
-
return yield this.raw.blob();
|
|
328
|
-
});
|
|
329
|
-
}
|
|
330
|
-
};
|
|
331
|
-
var TextApiResponse = class {
|
|
332
|
-
constructor(raw) {
|
|
333
|
-
this.raw = raw;
|
|
334
|
-
}
|
|
335
|
-
value() {
|
|
336
|
-
return __async(this, null, function* () {
|
|
337
|
-
return yield this.raw.text();
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
// src/models/BattingStats.ts
|
|
343
|
-
function instanceOfBattingStats(value) {
|
|
344
|
-
return true;
|
|
345
|
-
}
|
|
346
|
-
function BattingStatsFromJSON(json) {
|
|
347
|
-
return BattingStatsFromJSONTyped(json, false);
|
|
348
|
-
}
|
|
349
|
-
function BattingStatsFromJSONTyped(json, ignoreDiscriminator) {
|
|
350
|
-
if (json == null) {
|
|
351
|
-
return json;
|
|
352
|
-
}
|
|
353
|
-
return {
|
|
354
|
-
"flyOuts": json["flyOuts"] == null ? void 0 : json["flyOuts"],
|
|
355
|
-
"groundOuts": json["groundOuts"] == null ? void 0 : json["groundOuts"],
|
|
356
|
-
"airOuts": json["airOuts"] == null ? void 0 : json["airOuts"],
|
|
357
|
-
"runs": json["runs"] == null ? void 0 : json["runs"],
|
|
358
|
-
"doubles": json["doubles"] == null ? void 0 : json["doubles"],
|
|
359
|
-
"triples": json["triples"] == null ? void 0 : json["triples"],
|
|
360
|
-
"homeRuns": json["homeRuns"] == null ? void 0 : json["homeRuns"],
|
|
361
|
-
"strikeOuts": json["strikeOuts"] == null ? void 0 : json["strikeOuts"],
|
|
362
|
-
"baseOnBalls": json["baseOnBalls"] == null ? void 0 : json["baseOnBalls"],
|
|
363
|
-
"intentionalWalks": json["intentionalWalks"] == null ? void 0 : json["intentionalWalks"],
|
|
364
|
-
"hits": json["hits"] == null ? void 0 : json["hits"],
|
|
365
|
-
"hitByPitch": json["hitByPitch"] == null ? void 0 : json["hitByPitch"],
|
|
366
|
-
"avg": json["avg"] == null ? void 0 : json["avg"],
|
|
367
|
-
"atBats": json["atBats"] == null ? void 0 : json["atBats"],
|
|
368
|
-
"obp": json["obp"] == null ? void 0 : json["obp"],
|
|
369
|
-
"slg": json["slg"] == null ? void 0 : json["slg"],
|
|
370
|
-
"ops": json["ops"] == null ? void 0 : json["ops"],
|
|
371
|
-
"caughtStealing": json["caughtStealing"] == null ? void 0 : json["caughtStealing"],
|
|
372
|
-
"stolenBases": json["stolenBases"] == null ? void 0 : json["stolenBases"],
|
|
373
|
-
"stolenBasePercentage": json["stolenBasePercentage"] == null ? void 0 : json["stolenBasePercentage"],
|
|
374
|
-
"groundIntoDoublePlay": json["groundIntoDoublePlay"] == null ? void 0 : json["groundIntoDoublePlay"],
|
|
375
|
-
"groundIntoTriplePlay": json["groundIntoTriplePlay"] == null ? void 0 : json["groundIntoTriplePlay"],
|
|
376
|
-
"plateAppearances": json["plateAppearances"] == null ? void 0 : json["plateAppearances"],
|
|
377
|
-
"totalBases": json["totalBases"] == null ? void 0 : json["totalBases"],
|
|
378
|
-
"rbi": json["rbi"] == null ? void 0 : json["rbi"],
|
|
379
|
-
"leftOnBase": json["leftOnBase"] == null ? void 0 : json["leftOnBase"],
|
|
380
|
-
"sacBunts": json["sacBunts"] == null ? void 0 : json["sacBunts"],
|
|
381
|
-
"sacFlies": json["sacFlies"] == null ? void 0 : json["sacFlies"],
|
|
382
|
-
"catchersInterference": json["catchersInterference"] == null ? void 0 : json["catchersInterference"],
|
|
383
|
-
"pickoffs": json["pickoffs"] == null ? void 0 : json["pickoffs"],
|
|
384
|
-
"atBatsPerHomeRun": json["atBatsPerHomeRun"] == null ? void 0 : json["atBatsPerHomeRun"],
|
|
385
|
-
"popOuts": json["popOuts"] == null ? void 0 : json["popOuts"],
|
|
386
|
-
"lineOuts": json["lineOuts"] == null ? void 0 : json["lineOuts"]
|
|
387
|
-
};
|
|
388
|
-
}
|
|
389
|
-
function BattingStatsToJSON(json) {
|
|
390
|
-
return BattingStatsToJSONTyped(json, false);
|
|
391
|
-
}
|
|
392
|
-
function BattingStatsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
393
|
-
if (value == null) {
|
|
394
|
-
return value;
|
|
395
|
-
}
|
|
396
|
-
return {
|
|
397
|
-
"flyOuts": value["flyOuts"],
|
|
398
|
-
"groundOuts": value["groundOuts"],
|
|
399
|
-
"airOuts": value["airOuts"],
|
|
400
|
-
"runs": value["runs"],
|
|
401
|
-
"doubles": value["doubles"],
|
|
402
|
-
"triples": value["triples"],
|
|
403
|
-
"homeRuns": value["homeRuns"],
|
|
404
|
-
"strikeOuts": value["strikeOuts"],
|
|
405
|
-
"baseOnBalls": value["baseOnBalls"],
|
|
406
|
-
"intentionalWalks": value["intentionalWalks"],
|
|
407
|
-
"hits": value["hits"],
|
|
408
|
-
"hitByPitch": value["hitByPitch"],
|
|
409
|
-
"avg": value["avg"],
|
|
410
|
-
"atBats": value["atBats"],
|
|
411
|
-
"obp": value["obp"],
|
|
412
|
-
"slg": value["slg"],
|
|
413
|
-
"ops": value["ops"],
|
|
414
|
-
"caughtStealing": value["caughtStealing"],
|
|
415
|
-
"stolenBases": value["stolenBases"],
|
|
416
|
-
"stolenBasePercentage": value["stolenBasePercentage"],
|
|
417
|
-
"groundIntoDoublePlay": value["groundIntoDoublePlay"],
|
|
418
|
-
"groundIntoTriplePlay": value["groundIntoTriplePlay"],
|
|
419
|
-
"plateAppearances": value["plateAppearances"],
|
|
420
|
-
"totalBases": value["totalBases"],
|
|
421
|
-
"rbi": value["rbi"],
|
|
422
|
-
"leftOnBase": value["leftOnBase"],
|
|
423
|
-
"sacBunts": value["sacBunts"],
|
|
424
|
-
"sacFlies": value["sacFlies"],
|
|
425
|
-
"catchersInterference": value["catchersInterference"],
|
|
426
|
-
"pickoffs": value["pickoffs"],
|
|
427
|
-
"atBatsPerHomeRun": value["atBatsPerHomeRun"],
|
|
428
|
-
"popOuts": value["popOuts"],
|
|
429
|
-
"lineOuts": value["lineOuts"]
|
|
430
|
-
};
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
// src/models/Official.ts
|
|
434
|
-
function instanceOfOfficial(value) {
|
|
435
|
-
return true;
|
|
436
|
-
}
|
|
437
|
-
function OfficialFromJSON(json) {
|
|
438
|
-
return OfficialFromJSONTyped(json, false);
|
|
439
|
-
}
|
|
440
|
-
function OfficialFromJSONTyped(json, ignoreDiscriminator) {
|
|
441
|
-
if (json == null) {
|
|
442
|
-
return json;
|
|
443
|
-
}
|
|
444
|
-
return {
|
|
445
|
-
"id": json["id"] == null ? void 0 : json["id"],
|
|
446
|
-
"fullName": json["fullName"] == null ? void 0 : json["fullName"],
|
|
447
|
-
"link": json["link"] == null ? void 0 : json["link"]
|
|
448
|
-
};
|
|
449
|
-
}
|
|
450
|
-
function OfficialToJSON(json) {
|
|
451
|
-
return OfficialToJSONTyped(json, false);
|
|
452
|
-
}
|
|
453
|
-
function OfficialToJSONTyped(value, ignoreDiscriminator = false) {
|
|
454
|
-
if (value == null) {
|
|
455
|
-
return value;
|
|
456
|
-
}
|
|
457
|
-
return {
|
|
458
|
-
"id": value["id"],
|
|
459
|
-
"fullName": value["fullName"],
|
|
460
|
-
"link": value["link"]
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
// src/models/GameOfficial.ts
|
|
465
|
-
function instanceOfGameOfficial(value) {
|
|
466
|
-
return true;
|
|
467
|
-
}
|
|
468
|
-
function GameOfficialFromJSON(json) {
|
|
469
|
-
return GameOfficialFromJSONTyped(json, false);
|
|
470
|
-
}
|
|
471
|
-
function GameOfficialFromJSONTyped(json, ignoreDiscriminator) {
|
|
472
|
-
if (json == null) {
|
|
473
|
-
return json;
|
|
474
|
-
}
|
|
475
|
-
return {
|
|
476
|
-
"official": json["official"] == null ? void 0 : OfficialFromJSON(json["official"]),
|
|
477
|
-
"officialType": json["officialType"] == null ? void 0 : json["officialType"]
|
|
478
|
-
};
|
|
479
|
-
}
|
|
480
|
-
function GameOfficialToJSON(json) {
|
|
481
|
-
return GameOfficialToJSONTyped(json, false);
|
|
482
|
-
}
|
|
483
|
-
function GameOfficialToJSONTyped(value, ignoreDiscriminator = false) {
|
|
484
|
-
if (value == null) {
|
|
485
|
-
return value;
|
|
486
|
-
}
|
|
487
|
-
return {
|
|
488
|
-
"official": OfficialToJSON(value["official"]),
|
|
489
|
-
"officialType": value["officialType"]
|
|
490
|
-
};
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
// src/models/FieldingStats.ts
|
|
494
|
-
function instanceOfFieldingStats(value) {
|
|
495
|
-
return true;
|
|
496
|
-
}
|
|
497
|
-
function FieldingStatsFromJSON(json) {
|
|
498
|
-
return FieldingStatsFromJSONTyped(json, false);
|
|
499
|
-
}
|
|
500
|
-
function FieldingStatsFromJSONTyped(json, ignoreDiscriminator) {
|
|
501
|
-
if (json == null) {
|
|
502
|
-
return json;
|
|
503
|
-
}
|
|
504
|
-
return {
|
|
505
|
-
"caughtStealing": json["caughtStealing"] == null ? void 0 : json["caughtStealing"],
|
|
506
|
-
"stolenBases": json["stolenBases"] == null ? void 0 : json["stolenBases"],
|
|
507
|
-
"stolenBasePercentage": json["stolenBasePercentage"] == null ? void 0 : json["stolenBasePercentage"],
|
|
508
|
-
"assists": json["assists"] == null ? void 0 : json["assists"],
|
|
509
|
-
"putOuts": json["putOuts"] == null ? void 0 : json["putOuts"],
|
|
510
|
-
"errors": json["errors"] == null ? void 0 : json["errors"],
|
|
511
|
-
"chances": json["chances"] == null ? void 0 : json["chances"],
|
|
512
|
-
"passedBall": json["passedBall"] == null ? void 0 : json["passedBall"],
|
|
513
|
-
"pickoffs": json["pickoffs"] == null ? void 0 : json["pickoffs"]
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
function FieldingStatsToJSON(json) {
|
|
517
|
-
return FieldingStatsToJSONTyped(json, false);
|
|
518
|
-
}
|
|
519
|
-
function FieldingStatsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
520
|
-
if (value == null) {
|
|
521
|
-
return value;
|
|
522
|
-
}
|
|
523
|
-
return {
|
|
524
|
-
"caughtStealing": value["caughtStealing"],
|
|
525
|
-
"stolenBases": value["stolenBases"],
|
|
526
|
-
"stolenBasePercentage": value["stolenBasePercentage"],
|
|
527
|
-
"assists": value["assists"],
|
|
528
|
-
"putOuts": value["putOuts"],
|
|
529
|
-
"errors": value["errors"],
|
|
530
|
-
"chances": value["chances"],
|
|
531
|
-
"passedBall": value["passedBall"],
|
|
532
|
-
"pickoffs": value["pickoffs"]
|
|
533
|
-
};
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
// src/models/PitchingStats.ts
|
|
537
|
-
function instanceOfPitchingStats(value) {
|
|
538
|
-
return true;
|
|
539
|
-
}
|
|
540
|
-
function PitchingStatsFromJSON(json) {
|
|
541
|
-
return PitchingStatsFromJSONTyped(json, false);
|
|
542
|
-
}
|
|
543
|
-
function PitchingStatsFromJSONTyped(json, ignoreDiscriminator) {
|
|
544
|
-
if (json == null) {
|
|
545
|
-
return json;
|
|
546
|
-
}
|
|
547
|
-
return {
|
|
548
|
-
"flyOuts": json["flyOuts"] == null ? void 0 : json["flyOuts"],
|
|
549
|
-
"groundOuts": json["groundOuts"] == null ? void 0 : json["groundOuts"],
|
|
550
|
-
"airOuts": json["airOuts"] == null ? void 0 : json["airOuts"],
|
|
551
|
-
"runs": json["runs"] == null ? void 0 : json["runs"],
|
|
552
|
-
"doubles": json["doubles"] == null ? void 0 : json["doubles"],
|
|
553
|
-
"triples": json["triples"] == null ? void 0 : json["triples"],
|
|
554
|
-
"homeRuns": json["homeRuns"] == null ? void 0 : json["homeRuns"],
|
|
555
|
-
"strikeOuts": json["strikeOuts"] == null ? void 0 : json["strikeOuts"],
|
|
556
|
-
"baseOnBalls": json["baseOnBalls"] == null ? void 0 : json["baseOnBalls"],
|
|
557
|
-
"intentionalWalks": json["intentionalWalks"] == null ? void 0 : json["intentionalWalks"],
|
|
558
|
-
"hits": json["hits"] == null ? void 0 : json["hits"],
|
|
559
|
-
"hitByPitch": json["hitByPitch"] == null ? void 0 : json["hitByPitch"],
|
|
560
|
-
"atBats": json["atBats"] == null ? void 0 : json["atBats"],
|
|
561
|
-
"obp": json["obp"] == null ? void 0 : json["obp"],
|
|
562
|
-
"caughtStealing": json["caughtStealing"] == null ? void 0 : json["caughtStealing"],
|
|
563
|
-
"stolenBases": json["stolenBases"] == null ? void 0 : json["stolenBases"],
|
|
564
|
-
"stolenBasePercentage": json["stolenBasePercentage"] == null ? void 0 : json["stolenBasePercentage"],
|
|
565
|
-
"numberOfPitches": json["numberOfPitches"] == null ? void 0 : json["numberOfPitches"],
|
|
566
|
-
"era": json["era"] == null ? void 0 : json["era"],
|
|
567
|
-
"inningsPitched": json["inningsPitched"] == null ? void 0 : json["inningsPitched"],
|
|
568
|
-
"saveOpportunities": json["saveOpportunities"] == null ? void 0 : json["saveOpportunities"],
|
|
569
|
-
"earnedRuns": json["earnedRuns"] == null ? void 0 : json["earnedRuns"],
|
|
570
|
-
"whip": json["whip"] == null ? void 0 : json["whip"],
|
|
571
|
-
"battersFaced": json["battersFaced"] == null ? void 0 : json["battersFaced"],
|
|
572
|
-
"outs": json["outs"] == null ? void 0 : json["outs"],
|
|
573
|
-
"completeGames": json["completeGames"] == null ? void 0 : json["completeGames"],
|
|
574
|
-
"shutouts": json["shutouts"] == null ? void 0 : json["shutouts"],
|
|
575
|
-
"pitchesThrown": json["pitchesThrown"] == null ? void 0 : json["pitchesThrown"],
|
|
576
|
-
"balls": json["balls"] == null ? void 0 : json["balls"],
|
|
577
|
-
"strikes": json["strikes"] == null ? void 0 : json["strikes"],
|
|
578
|
-
"strikePercentage": json["strikePercentage"] == null ? void 0 : json["strikePercentage"],
|
|
579
|
-
"hitBatsmen": json["hitBatsmen"] == null ? void 0 : json["hitBatsmen"],
|
|
580
|
-
"balks": json["balks"] == null ? void 0 : json["balks"],
|
|
581
|
-
"wildPitches": json["wildPitches"] == null ? void 0 : json["wildPitches"],
|
|
582
|
-
"pickoffs": json["pickoffs"] == null ? void 0 : json["pickoffs"],
|
|
583
|
-
"groundOutsToAirouts": json["groundOutsToAirouts"] == null ? void 0 : json["groundOutsToAirouts"],
|
|
584
|
-
"rbi": json["rbi"] == null ? void 0 : json["rbi"],
|
|
585
|
-
"pitchesPerInning": json["pitchesPerInning"] == null ? void 0 : json["pitchesPerInning"],
|
|
586
|
-
"runsScoredPer9": json["runsScoredPer9"] == null ? void 0 : json["runsScoredPer9"],
|
|
587
|
-
"homeRunsPer9": json["homeRunsPer9"] == null ? void 0 : json["homeRunsPer9"],
|
|
588
|
-
"inheritedRunners": json["inheritedRunners"] == null ? void 0 : json["inheritedRunners"],
|
|
589
|
-
"inheritedRunnersScored": json["inheritedRunnersScored"] == null ? void 0 : json["inheritedRunnersScored"],
|
|
590
|
-
"catchersInterference": json["catchersInterference"] == null ? void 0 : json["catchersInterference"],
|
|
591
|
-
"sacBunts": json["sacBunts"] == null ? void 0 : json["sacBunts"],
|
|
592
|
-
"sacFlies": json["sacFlies"] == null ? void 0 : json["sacFlies"],
|
|
593
|
-
"passedBall": json["passedBall"] == null ? void 0 : json["passedBall"],
|
|
594
|
-
"popOuts": json["popOuts"] == null ? void 0 : json["popOuts"],
|
|
595
|
-
"lineOuts": json["lineOuts"] == null ? void 0 : json["lineOuts"]
|
|
596
|
-
};
|
|
597
|
-
}
|
|
598
|
-
function PitchingStatsToJSON(json) {
|
|
599
|
-
return PitchingStatsToJSONTyped(json, false);
|
|
600
|
-
}
|
|
601
|
-
function PitchingStatsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
602
|
-
if (value == null) {
|
|
603
|
-
return value;
|
|
604
|
-
}
|
|
605
|
-
return {
|
|
606
|
-
"flyOuts": value["flyOuts"],
|
|
607
|
-
"groundOuts": value["groundOuts"],
|
|
608
|
-
"airOuts": value["airOuts"],
|
|
609
|
-
"runs": value["runs"],
|
|
610
|
-
"doubles": value["doubles"],
|
|
611
|
-
"triples": value["triples"],
|
|
612
|
-
"homeRuns": value["homeRuns"],
|
|
613
|
-
"strikeOuts": value["strikeOuts"],
|
|
614
|
-
"baseOnBalls": value["baseOnBalls"],
|
|
615
|
-
"intentionalWalks": value["intentionalWalks"],
|
|
616
|
-
"hits": value["hits"],
|
|
617
|
-
"hitByPitch": value["hitByPitch"],
|
|
618
|
-
"atBats": value["atBats"],
|
|
619
|
-
"obp": value["obp"],
|
|
620
|
-
"caughtStealing": value["caughtStealing"],
|
|
621
|
-
"stolenBases": value["stolenBases"],
|
|
622
|
-
"stolenBasePercentage": value["stolenBasePercentage"],
|
|
623
|
-
"numberOfPitches": value["numberOfPitches"],
|
|
624
|
-
"era": value["era"],
|
|
625
|
-
"inningsPitched": value["inningsPitched"],
|
|
626
|
-
"saveOpportunities": value["saveOpportunities"],
|
|
627
|
-
"earnedRuns": value["earnedRuns"],
|
|
628
|
-
"whip": value["whip"],
|
|
629
|
-
"battersFaced": value["battersFaced"],
|
|
630
|
-
"outs": value["outs"],
|
|
631
|
-
"completeGames": value["completeGames"],
|
|
632
|
-
"shutouts": value["shutouts"],
|
|
633
|
-
"pitchesThrown": value["pitchesThrown"],
|
|
634
|
-
"balls": value["balls"],
|
|
635
|
-
"strikes": value["strikes"],
|
|
636
|
-
"strikePercentage": value["strikePercentage"],
|
|
637
|
-
"hitBatsmen": value["hitBatsmen"],
|
|
638
|
-
"balks": value["balks"],
|
|
639
|
-
"wildPitches": value["wildPitches"],
|
|
640
|
-
"pickoffs": value["pickoffs"],
|
|
641
|
-
"groundOutsToAirouts": value["groundOutsToAirouts"],
|
|
642
|
-
"rbi": value["rbi"],
|
|
643
|
-
"pitchesPerInning": value["pitchesPerInning"],
|
|
644
|
-
"runsScoredPer9": value["runsScoredPer9"],
|
|
645
|
-
"homeRunsPer9": value["homeRunsPer9"],
|
|
646
|
-
"inheritedRunners": value["inheritedRunners"],
|
|
647
|
-
"inheritedRunnersScored": value["inheritedRunnersScored"],
|
|
648
|
-
"catchersInterference": value["catchersInterference"],
|
|
649
|
-
"sacBunts": value["sacBunts"],
|
|
650
|
-
"sacFlies": value["sacFlies"],
|
|
651
|
-
"passedBall": value["passedBall"],
|
|
652
|
-
"popOuts": value["popOuts"],
|
|
653
|
-
"lineOuts": value["lineOuts"]
|
|
654
|
-
};
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
// src/models/PlayerSeasonStats.ts
|
|
658
|
-
function instanceOfPlayerSeasonStats(value) {
|
|
659
|
-
if (!("batting" in value) || value["batting"] === void 0) return false;
|
|
660
|
-
if (!("pitching" in value) || value["pitching"] === void 0) return false;
|
|
661
|
-
if (!("fielding" in value) || value["fielding"] === void 0) return false;
|
|
662
|
-
return true;
|
|
663
|
-
}
|
|
664
|
-
function PlayerSeasonStatsFromJSON(json) {
|
|
665
|
-
return PlayerSeasonStatsFromJSONTyped(json, false);
|
|
666
|
-
}
|
|
667
|
-
function PlayerSeasonStatsFromJSONTyped(json, ignoreDiscriminator) {
|
|
668
|
-
if (json == null) {
|
|
669
|
-
return json;
|
|
670
|
-
}
|
|
671
|
-
return {
|
|
672
|
-
"batting": BattingStatsFromJSON(json["batting"]),
|
|
673
|
-
"pitching": PitchingStatsFromJSON(json["pitching"]),
|
|
674
|
-
"fielding": FieldingStatsFromJSON(json["fielding"])
|
|
675
|
-
};
|
|
676
|
-
}
|
|
677
|
-
function PlayerSeasonStatsToJSON(json) {
|
|
678
|
-
return PlayerSeasonStatsToJSONTyped(json, false);
|
|
679
|
-
}
|
|
680
|
-
function PlayerSeasonStatsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
681
|
-
if (value == null) {
|
|
682
|
-
return value;
|
|
683
|
-
}
|
|
684
|
-
return {
|
|
685
|
-
"batting": BattingStatsToJSON(value["batting"]),
|
|
686
|
-
"pitching": PitchingStatsToJSON(value["pitching"]),
|
|
687
|
-
"fielding": FieldingStatsToJSON(value["fielding"])
|
|
688
|
-
};
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
// src/models/PlayerGameStatus.ts
|
|
692
|
-
function instanceOfPlayerGameStatus(value) {
|
|
693
|
-
return true;
|
|
694
|
-
}
|
|
695
|
-
function PlayerGameStatusFromJSON(json) {
|
|
696
|
-
return PlayerGameStatusFromJSONTyped(json, false);
|
|
697
|
-
}
|
|
698
|
-
function PlayerGameStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
699
|
-
if (json == null) {
|
|
700
|
-
return json;
|
|
701
|
-
}
|
|
702
|
-
return {
|
|
703
|
-
"isCurrentBatter": json["isCurrentBatter"] == null ? void 0 : json["isCurrentBatter"],
|
|
704
|
-
"isCurrentPitcher": json["isCurrentPitcher"] == null ? void 0 : json["isCurrentPitcher"],
|
|
705
|
-
"isOnBench": json["isOnBench"] == null ? void 0 : json["isOnBench"],
|
|
706
|
-
"isSubstitute": json["isSubstitute"] == null ? void 0 : json["isSubstitute"]
|
|
707
|
-
};
|
|
708
|
-
}
|
|
709
|
-
function PlayerGameStatusToJSON(json) {
|
|
710
|
-
return PlayerGameStatusToJSONTyped(json, false);
|
|
711
|
-
}
|
|
712
|
-
function PlayerGameStatusToJSONTyped(value, ignoreDiscriminator = false) {
|
|
713
|
-
if (value == null) {
|
|
714
|
-
return value;
|
|
715
|
-
}
|
|
716
|
-
return {
|
|
717
|
-
"isCurrentBatter": value["isCurrentBatter"],
|
|
718
|
-
"isCurrentPitcher": value["isCurrentPitcher"],
|
|
719
|
-
"isOnBench": value["isOnBench"],
|
|
720
|
-
"isSubstitute": value["isSubstitute"]
|
|
721
|
-
};
|
|
722
|
-
}
|
|
723
|
-
|
|
724
|
-
// src/models/Position.ts
|
|
725
|
-
function instanceOfPosition(value) {
|
|
726
|
-
return true;
|
|
727
|
-
}
|
|
728
|
-
function PositionFromJSON(json) {
|
|
729
|
-
return PositionFromJSONTyped(json, false);
|
|
730
|
-
}
|
|
731
|
-
function PositionFromJSONTyped(json, ignoreDiscriminator) {
|
|
732
|
-
if (json == null) {
|
|
733
|
-
return json;
|
|
734
|
-
}
|
|
735
|
-
return {
|
|
736
|
-
"code": json["code"] == null ? void 0 : json["code"],
|
|
737
|
-
"name": json["name"] == null ? void 0 : json["name"],
|
|
738
|
-
"type": json["type"] == null ? void 0 : json["type"],
|
|
739
|
-
"abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"]
|
|
740
|
-
};
|
|
741
|
-
}
|
|
742
|
-
function PositionToJSON(json) {
|
|
743
|
-
return PositionToJSONTyped(json, false);
|
|
744
|
-
}
|
|
745
|
-
function PositionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
746
|
-
if (value == null) {
|
|
747
|
-
return value;
|
|
748
|
-
}
|
|
749
|
-
return {
|
|
750
|
-
"code": value["code"],
|
|
751
|
-
"name": value["name"],
|
|
752
|
-
"type": value["type"],
|
|
753
|
-
"abbreviation": value["abbreviation"]
|
|
754
|
-
};
|
|
755
|
-
}
|
|
756
|
-
|
|
757
|
-
// src/models/PlayerPerson.ts
|
|
758
|
-
function instanceOfPlayerPerson(value) {
|
|
759
|
-
if (!("id" in value) || value["id"] === void 0) return false;
|
|
760
|
-
if (!("fullName" in value) || value["fullName"] === void 0) return false;
|
|
761
|
-
if (!("link" in value) || value["link"] === void 0) return false;
|
|
762
|
-
if (!("boxscoreName" in value) || value["boxscoreName"] === void 0) return false;
|
|
763
|
-
return true;
|
|
764
|
-
}
|
|
765
|
-
function PlayerPersonFromJSON(json) {
|
|
766
|
-
return PlayerPersonFromJSONTyped(json, false);
|
|
767
|
-
}
|
|
768
|
-
function PlayerPersonFromJSONTyped(json, ignoreDiscriminator) {
|
|
769
|
-
if (json == null) {
|
|
770
|
-
return json;
|
|
771
|
-
}
|
|
772
|
-
return {
|
|
773
|
-
"id": json["id"],
|
|
774
|
-
"fullName": json["fullName"],
|
|
775
|
-
"link": json["link"],
|
|
776
|
-
"boxscoreName": json["boxscoreName"]
|
|
777
|
-
};
|
|
778
|
-
}
|
|
779
|
-
function PlayerPersonToJSON(json) {
|
|
780
|
-
return PlayerPersonToJSONTyped(json, false);
|
|
781
|
-
}
|
|
782
|
-
function PlayerPersonToJSONTyped(value, ignoreDiscriminator = false) {
|
|
783
|
-
if (value == null) {
|
|
784
|
-
return value;
|
|
785
|
-
}
|
|
786
|
-
return {
|
|
787
|
-
"id": value["id"],
|
|
788
|
-
"fullName": value["fullName"],
|
|
789
|
-
"link": value["link"],
|
|
790
|
-
"boxscoreName": value["boxscoreName"]
|
|
791
|
-
};
|
|
792
|
-
}
|
|
793
|
-
|
|
794
|
-
// src/models/PlayerPosition.ts
|
|
795
|
-
function instanceOfPlayerPosition(value) {
|
|
796
|
-
return true;
|
|
797
|
-
}
|
|
798
|
-
function PlayerPositionFromJSON(json) {
|
|
799
|
-
return PlayerPositionFromJSONTyped(json, false);
|
|
800
|
-
}
|
|
801
|
-
function PlayerPositionFromJSONTyped(json, ignoreDiscriminator) {
|
|
802
|
-
if (json == null) {
|
|
803
|
-
return json;
|
|
804
|
-
}
|
|
805
|
-
return {
|
|
806
|
-
"code": json["code"] == null ? void 0 : json["code"],
|
|
807
|
-
"name": json["name"] == null ? void 0 : json["name"],
|
|
808
|
-
"type": json["type"] == null ? void 0 : json["type"],
|
|
809
|
-
"abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"]
|
|
810
|
-
};
|
|
811
|
-
}
|
|
812
|
-
function PlayerPositionToJSON(json) {
|
|
813
|
-
return PlayerPositionToJSONTyped(json, false);
|
|
814
|
-
}
|
|
815
|
-
function PlayerPositionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
816
|
-
if (value == null) {
|
|
817
|
-
return value;
|
|
818
|
-
}
|
|
819
|
-
return {
|
|
820
|
-
"code": value["code"],
|
|
821
|
-
"name": value["name"],
|
|
822
|
-
"type": value["type"],
|
|
823
|
-
"abbreviation": value["abbreviation"]
|
|
824
|
-
};
|
|
825
|
-
}
|
|
826
|
-
|
|
827
|
-
// src/models/PlayerStatus.ts
|
|
828
|
-
function instanceOfPlayerStatus(value) {
|
|
829
|
-
return true;
|
|
830
|
-
}
|
|
831
|
-
function PlayerStatusFromJSON(json) {
|
|
832
|
-
return PlayerStatusFromJSONTyped(json, false);
|
|
833
|
-
}
|
|
834
|
-
function PlayerStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
835
|
-
if (json == null) {
|
|
836
|
-
return json;
|
|
837
|
-
}
|
|
838
|
-
return {
|
|
839
|
-
"code": json["code"] == null ? void 0 : json["code"],
|
|
840
|
-
"description": json["description"] == null ? void 0 : json["description"]
|
|
841
|
-
};
|
|
842
|
-
}
|
|
843
|
-
function PlayerStatusToJSON(json) {
|
|
844
|
-
return PlayerStatusToJSONTyped(json, false);
|
|
845
|
-
}
|
|
846
|
-
function PlayerStatusToJSONTyped(value, ignoreDiscriminator = false) {
|
|
847
|
-
if (value == null) {
|
|
848
|
-
return value;
|
|
849
|
-
}
|
|
850
|
-
return {
|
|
851
|
-
"code": value["code"],
|
|
852
|
-
"description": value["description"]
|
|
853
|
-
};
|
|
854
|
-
}
|
|
855
|
-
|
|
856
|
-
// src/models/PlayerStats.ts
|
|
857
|
-
function instanceOfPlayerStats(value) {
|
|
858
|
-
if (!("batting" in value) || value["batting"] === void 0) return false;
|
|
859
|
-
if (!("pitching" in value) || value["pitching"] === void 0) return false;
|
|
860
|
-
if (!("fielding" in value) || value["fielding"] === void 0) return false;
|
|
861
|
-
return true;
|
|
862
|
-
}
|
|
863
|
-
function PlayerStatsFromJSON(json) {
|
|
864
|
-
return PlayerStatsFromJSONTyped(json, false);
|
|
865
|
-
}
|
|
866
|
-
function PlayerStatsFromJSONTyped(json, ignoreDiscriminator) {
|
|
867
|
-
if (json == null) {
|
|
868
|
-
return json;
|
|
869
|
-
}
|
|
870
|
-
return {
|
|
871
|
-
"batting": BattingStatsFromJSON(json["batting"]),
|
|
872
|
-
"pitching": PitchingStatsFromJSON(json["pitching"]),
|
|
873
|
-
"fielding": FieldingStatsFromJSON(json["fielding"])
|
|
874
|
-
};
|
|
875
|
-
}
|
|
876
|
-
function PlayerStatsToJSON(json) {
|
|
877
|
-
return PlayerStatsToJSONTyped(json, false);
|
|
878
|
-
}
|
|
879
|
-
function PlayerStatsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
880
|
-
if (value == null) {
|
|
881
|
-
return value;
|
|
882
|
-
}
|
|
883
|
-
return {
|
|
884
|
-
"batting": BattingStatsToJSON(value["batting"]),
|
|
885
|
-
"pitching": PitchingStatsToJSON(value["pitching"]),
|
|
886
|
-
"fielding": FieldingStatsToJSON(value["fielding"])
|
|
887
|
-
};
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
// src/models/Player.ts
|
|
891
|
-
function instanceOfPlayer(value) {
|
|
892
|
-
if (!("person" in value) || value["person"] === void 0) return false;
|
|
893
|
-
if (!("position" in value) || value["position"] === void 0) return false;
|
|
894
|
-
if (!("stats" in value) || value["stats"] === void 0) return false;
|
|
895
|
-
if (!("seasonStats" in value) || value["seasonStats"] === void 0) return false;
|
|
896
|
-
return true;
|
|
897
|
-
}
|
|
898
|
-
function PlayerFromJSON(json) {
|
|
899
|
-
return PlayerFromJSONTyped(json, false);
|
|
900
|
-
}
|
|
901
|
-
function PlayerFromJSONTyped(json, ignoreDiscriminator) {
|
|
902
|
-
if (json == null) {
|
|
903
|
-
return json;
|
|
904
|
-
}
|
|
905
|
-
return {
|
|
906
|
-
"person": PlayerPersonFromJSON(json["person"]),
|
|
907
|
-
"jerseyNumber": json["jerseyNumber"] == null ? void 0 : json["jerseyNumber"],
|
|
908
|
-
"position": PlayerPositionFromJSON(json["position"]),
|
|
909
|
-
"status": json["status"] == null ? void 0 : PlayerStatusFromJSON(json["status"]),
|
|
910
|
-
"parentTeamId": json["parentTeamId"] == null ? void 0 : json["parentTeamId"],
|
|
911
|
-
"battingOrder": json["battingOrder"] == null ? void 0 : json["battingOrder"],
|
|
912
|
-
"stats": PlayerStatsFromJSON(json["stats"]),
|
|
913
|
-
"seasonStats": PlayerSeasonStatsFromJSON(json["seasonStats"]),
|
|
914
|
-
"gameStatus": json["gameStatus"] == null ? void 0 : PlayerGameStatusFromJSON(json["gameStatus"]),
|
|
915
|
-
"allPositions": json["allPositions"] == null ? void 0 : json["allPositions"].map(PositionFromJSON),
|
|
916
|
-
"type": json["type"] == null ? void 0 : json["type"],
|
|
917
|
-
"gameScore": json["gameScore"] == null ? void 0 : json["gameScore"],
|
|
918
|
-
"hittingGameScore": json["hittingGameScore"] == null ? void 0 : json["hittingGameScore"]
|
|
919
|
-
};
|
|
920
|
-
}
|
|
921
|
-
function PlayerToJSON(json) {
|
|
922
|
-
return PlayerToJSONTyped(json, false);
|
|
923
|
-
}
|
|
924
|
-
function PlayerToJSONTyped(value, ignoreDiscriminator = false) {
|
|
925
|
-
if (value == null) {
|
|
926
|
-
return value;
|
|
927
|
-
}
|
|
928
|
-
return {
|
|
929
|
-
"person": PlayerPersonToJSON(value["person"]),
|
|
930
|
-
"jerseyNumber": value["jerseyNumber"],
|
|
931
|
-
"position": PlayerPositionToJSON(value["position"]),
|
|
932
|
-
"status": PlayerStatusToJSON(value["status"]),
|
|
933
|
-
"parentTeamId": value["parentTeamId"],
|
|
934
|
-
"battingOrder": value["battingOrder"],
|
|
935
|
-
"stats": PlayerStatsToJSON(value["stats"]),
|
|
936
|
-
"seasonStats": PlayerSeasonStatsToJSON(value["seasonStats"]),
|
|
937
|
-
"gameStatus": PlayerGameStatusToJSON(value["gameStatus"]),
|
|
938
|
-
"allPositions": value["allPositions"] == null ? void 0 : value["allPositions"].map(PositionToJSON),
|
|
939
|
-
"type": value["type"],
|
|
940
|
-
"gameScore": value["gameScore"],
|
|
941
|
-
"hittingGameScore": value["hittingGameScore"]
|
|
942
|
-
};
|
|
943
|
-
}
|
|
944
|
-
|
|
945
|
-
// src/models/LeagueDates.ts
|
|
946
|
-
function instanceOfLeagueDates(value) {
|
|
947
|
-
return true;
|
|
948
|
-
}
|
|
949
|
-
function LeagueDatesFromJSON(json) {
|
|
950
|
-
return LeagueDatesFromJSONTyped(json, false);
|
|
951
|
-
}
|
|
952
|
-
function LeagueDatesFromJSONTyped(json, ignoreDiscriminator) {
|
|
953
|
-
if (json == null) {
|
|
954
|
-
return json;
|
|
955
|
-
}
|
|
956
|
-
return {
|
|
957
|
-
"seasonId": json["seasonId"] == null ? void 0 : json["seasonId"],
|
|
958
|
-
"preSeasonStartDate": json["preSeasonStartDate"] == null ? void 0 : json["preSeasonStartDate"],
|
|
959
|
-
"preSeasonEndDate": json["preSeasonEndDate"] == null ? void 0 : json["preSeasonEndDate"],
|
|
960
|
-
"seasonStartDate": json["seasonStartDate"] == null ? void 0 : json["seasonStartDate"],
|
|
961
|
-
"springStartDate": json["springStartDate"] == null ? void 0 : json["springStartDate"],
|
|
962
|
-
"springEndDate": json["springEndDate"] == null ? void 0 : json["springEndDate"],
|
|
963
|
-
"offseasonStartDate": json["offseasonStartDate"] == null ? void 0 : json["offseasonStartDate"],
|
|
964
|
-
"offseasonEndDate": json["offseasonEndDate"] == null ? void 0 : json["offseasonEndDate"],
|
|
965
|
-
"seasonLevelGamedayType": json["seasonLevelGamedayType"] == null ? void 0 : json["seasonLevelGamedayType"],
|
|
966
|
-
"gameLevelGamedayType": json["gameLevelGamedayType"] == null ? void 0 : json["gameLevelGamedayType"]
|
|
967
|
-
};
|
|
968
|
-
}
|
|
969
|
-
function LeagueDatesToJSON(json) {
|
|
970
|
-
return LeagueDatesToJSONTyped(json, false);
|
|
971
|
-
}
|
|
972
|
-
function LeagueDatesToJSONTyped(value, ignoreDiscriminator = false) {
|
|
973
|
-
if (value == null) {
|
|
974
|
-
return value;
|
|
975
|
-
}
|
|
976
|
-
return {
|
|
977
|
-
"seasonId": value["seasonId"],
|
|
978
|
-
"preSeasonStartDate": value["preSeasonStartDate"],
|
|
979
|
-
"preSeasonEndDate": value["preSeasonEndDate"],
|
|
980
|
-
"seasonStartDate": value["seasonStartDate"],
|
|
981
|
-
"springStartDate": value["springStartDate"],
|
|
982
|
-
"springEndDate": value["springEndDate"],
|
|
983
|
-
"offseasonStartDate": value["offseasonStartDate"],
|
|
984
|
-
"offseasonEndDate": value["offseasonEndDate"],
|
|
985
|
-
"seasonLevelGamedayType": value["seasonLevelGamedayType"],
|
|
986
|
-
"gameLevelGamedayType": value["gameLevelGamedayType"]
|
|
987
|
-
};
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
// src/models/League.ts
|
|
991
|
-
function instanceOfLeague(value) {
|
|
992
|
-
if (!("id" in value) || value["id"] === void 0) return false;
|
|
993
|
-
if (!("name" in value) || value["name"] === void 0) return false;
|
|
994
|
-
return true;
|
|
995
|
-
}
|
|
996
|
-
function LeagueFromJSON(json) {
|
|
997
|
-
return LeagueFromJSONTyped(json, false);
|
|
998
|
-
}
|
|
999
|
-
function LeagueFromJSONTyped(json, ignoreDiscriminator) {
|
|
1000
|
-
if (json == null) {
|
|
1001
|
-
return json;
|
|
1002
|
-
}
|
|
1003
|
-
return {
|
|
1004
|
-
"id": json["id"],
|
|
1005
|
-
"name": json["name"],
|
|
1006
|
-
"link": json["link"] == null ? void 0 : json["link"],
|
|
1007
|
-
"abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"],
|
|
1008
|
-
"nameShort": json["nameShort"] == null ? void 0 : json["nameShort"],
|
|
1009
|
-
"seasonState": json["seasonState"] == null ? void 0 : json["seasonState"],
|
|
1010
|
-
"hasWildCard": json["hasWildCard"] == null ? void 0 : json["hasWildCard"],
|
|
1011
|
-
"hasSplitSeason": json["hasSplitSeason"] == null ? void 0 : json["hasSplitSeason"],
|
|
1012
|
-
"hasPlayoffPoints": json["hasPlayoffPoints"] == null ? void 0 : json["hasPlayoffPoints"],
|
|
1013
|
-
"seasonDateInfo": json["seasonDateInfo"] == null ? void 0 : LeagueDatesFromJSON(json["seasonDateInfo"]),
|
|
1014
|
-
"season": json["season"] == null ? void 0 : json["season"],
|
|
1015
|
-
"orgCode": json["orgCode"] == null ? void 0 : json["orgCode"],
|
|
1016
|
-
"conferencesInUse": json["conferencesInUse"] == null ? void 0 : json["conferencesInUse"],
|
|
1017
|
-
"divisionsInUse": json["divisionsInUse"] == null ? void 0 : json["divisionsInUse"],
|
|
1018
|
-
"sortOrder": json["sortOrder"] == null ? void 0 : json["sortOrder"],
|
|
1019
|
-
"active": json["active"] == null ? void 0 : json["active"]
|
|
1020
|
-
};
|
|
1021
|
-
}
|
|
1022
|
-
function LeagueToJSON(json) {
|
|
1023
|
-
return LeagueToJSONTyped(json, false);
|
|
1024
|
-
}
|
|
1025
|
-
function LeagueToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1026
|
-
if (value == null) {
|
|
1027
|
-
return value;
|
|
1028
|
-
}
|
|
1029
|
-
return {
|
|
1030
|
-
"id": value["id"],
|
|
1031
|
-
"name": value["name"],
|
|
1032
|
-
"link": value["link"],
|
|
1033
|
-
"abbreviation": value["abbreviation"],
|
|
1034
|
-
"nameShort": value["nameShort"],
|
|
1035
|
-
"seasonState": value["seasonState"],
|
|
1036
|
-
"hasWildCard": value["hasWildCard"],
|
|
1037
|
-
"hasSplitSeason": value["hasSplitSeason"],
|
|
1038
|
-
"hasPlayoffPoints": value["hasPlayoffPoints"],
|
|
1039
|
-
"seasonDateInfo": LeagueDatesToJSON(value["seasonDateInfo"]),
|
|
1040
|
-
"season": value["season"],
|
|
1041
|
-
"orgCode": value["orgCode"],
|
|
1042
|
-
"conferencesInUse": value["conferencesInUse"],
|
|
1043
|
-
"divisionsInUse": value["divisionsInUse"],
|
|
1044
|
-
"sortOrder": value["sortOrder"],
|
|
1045
|
-
"active": value["active"]
|
|
1046
|
-
};
|
|
1047
|
-
}
|
|
1048
|
-
|
|
1049
|
-
// src/models/Sport.ts
|
|
1050
|
-
function instanceOfSport(value) {
|
|
1051
|
-
if (!("id" in value) || value["id"] === void 0) return false;
|
|
1052
|
-
return true;
|
|
1053
|
-
}
|
|
1054
|
-
function SportFromJSON(json) {
|
|
1055
|
-
return SportFromJSONTyped(json, false);
|
|
1056
|
-
}
|
|
1057
|
-
function SportFromJSONTyped(json, ignoreDiscriminator) {
|
|
1058
|
-
if (json == null) {
|
|
1059
|
-
return json;
|
|
1060
|
-
}
|
|
1061
|
-
return {
|
|
1062
|
-
"id": json["id"],
|
|
1063
|
-
"code": json["code"] == null ? void 0 : json["code"],
|
|
1064
|
-
"link": json["link"] == null ? void 0 : json["link"],
|
|
1065
|
-
"name": json["name"] == null ? void 0 : json["name"],
|
|
1066
|
-
"abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"],
|
|
1067
|
-
"sortOrder": json["sortOrder"] == null ? void 0 : json["sortOrder"],
|
|
1068
|
-
"activeStatus": json["activeStatus"] == null ? void 0 : json["activeStatus"]
|
|
1069
|
-
};
|
|
1070
|
-
}
|
|
1071
|
-
function SportToJSON(json) {
|
|
1072
|
-
return SportToJSONTyped(json, false);
|
|
1073
|
-
}
|
|
1074
|
-
function SportToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1075
|
-
if (value == null) {
|
|
1076
|
-
return value;
|
|
1077
|
-
}
|
|
1078
|
-
return {
|
|
1079
|
-
"id": value["id"],
|
|
1080
|
-
"code": value["code"],
|
|
1081
|
-
"link": value["link"],
|
|
1082
|
-
"name": value["name"],
|
|
1083
|
-
"abbreviation": value["abbreviation"],
|
|
1084
|
-
"sortOrder": value["sortOrder"],
|
|
1085
|
-
"activeStatus": value["activeStatus"]
|
|
1086
|
-
};
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
// src/models/Venue.ts
|
|
1090
|
-
function instanceOfVenue(value) {
|
|
1091
|
-
if (!("id" in value) || value["id"] === void 0) return false;
|
|
1092
|
-
if (!("name" in value) || value["name"] === void 0) return false;
|
|
1093
|
-
return true;
|
|
1094
|
-
}
|
|
1095
|
-
function VenueFromJSON(json) {
|
|
1096
|
-
return VenueFromJSONTyped(json, false);
|
|
1097
|
-
}
|
|
1098
|
-
function VenueFromJSONTyped(json, ignoreDiscriminator) {
|
|
1099
|
-
if (json == null) {
|
|
1100
|
-
return json;
|
|
1101
|
-
}
|
|
1102
|
-
return {
|
|
1103
|
-
"id": json["id"],
|
|
1104
|
-
"name": json["name"],
|
|
1105
|
-
"link": json["link"] == null ? void 0 : json["link"],
|
|
1106
|
-
"active": json["active"] == null ? void 0 : json["active"],
|
|
1107
|
-
"season": json["season"] == null ? void 0 : json["season"]
|
|
1108
|
-
};
|
|
1109
|
-
}
|
|
1110
|
-
function VenueToJSON(json) {
|
|
1111
|
-
return VenueToJSONTyped(json, false);
|
|
1112
|
-
}
|
|
1113
|
-
function VenueToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1114
|
-
if (value == null) {
|
|
1115
|
-
return value;
|
|
1116
|
-
}
|
|
1117
|
-
return {
|
|
1118
|
-
"id": value["id"],
|
|
1119
|
-
"name": value["name"],
|
|
1120
|
-
"link": value["link"],
|
|
1121
|
-
"active": value["active"],
|
|
1122
|
-
"season": value["season"]
|
|
1123
|
-
};
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
// src/models/Division.ts
|
|
1127
|
-
function instanceOfDivision(value) {
|
|
1128
|
-
if (!("id" in value) || value["id"] === void 0) return false;
|
|
1129
|
-
if (!("name" in value) || value["name"] === void 0) return false;
|
|
1130
|
-
return true;
|
|
1131
|
-
}
|
|
1132
|
-
function DivisionFromJSON(json) {
|
|
1133
|
-
return DivisionFromJSONTyped(json, false);
|
|
1134
|
-
}
|
|
1135
|
-
function DivisionFromJSONTyped(json, ignoreDiscriminator) {
|
|
1136
|
-
if (json == null) {
|
|
1137
|
-
return json;
|
|
1138
|
-
}
|
|
1139
|
-
return {
|
|
1140
|
-
"id": json["id"],
|
|
1141
|
-
"name": json["name"],
|
|
1142
|
-
"season": json["season"] == null ? void 0 : json["season"],
|
|
1143
|
-
"nameShort": json["nameShort"] == null ? void 0 : json["nameShort"],
|
|
1144
|
-
"link": json["link"] == null ? void 0 : json["link"],
|
|
1145
|
-
"abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"],
|
|
1146
|
-
"league": json["league"] == null ? void 0 : LeagueFromJSON(json["league"]),
|
|
1147
|
-
"sport": json["sport"] == null ? void 0 : SportFromJSON(json["sport"]),
|
|
1148
|
-
"hasWildcard": json["hasWildcard"] == null ? void 0 : json["hasWildcard"],
|
|
1149
|
-
"sortOrder": json["sortOrder"] == null ? void 0 : json["sortOrder"],
|
|
1150
|
-
"numPlayoffTeams": json["numPlayoffTeams"] == null ? void 0 : json["numPlayoffTeams"],
|
|
1151
|
-
"active": json["active"] == null ? void 0 : json["active"]
|
|
1152
|
-
};
|
|
1153
|
-
}
|
|
1154
|
-
function DivisionToJSON(json) {
|
|
1155
|
-
return DivisionToJSONTyped(json, false);
|
|
1156
|
-
}
|
|
1157
|
-
function DivisionToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1158
|
-
if (value == null) {
|
|
1159
|
-
return value;
|
|
1160
|
-
}
|
|
1161
|
-
return {
|
|
1162
|
-
"id": value["id"],
|
|
1163
|
-
"name": value["name"],
|
|
1164
|
-
"season": value["season"],
|
|
1165
|
-
"nameShort": value["nameShort"],
|
|
1166
|
-
"link": value["link"],
|
|
1167
|
-
"abbreviation": value["abbreviation"],
|
|
1168
|
-
"league": LeagueToJSON(value["league"]),
|
|
1169
|
-
"sport": SportToJSON(value["sport"]),
|
|
1170
|
-
"hasWildcard": value["hasWildcard"],
|
|
1171
|
-
"sortOrder": value["sortOrder"],
|
|
1172
|
-
"numPlayoffTeams": value["numPlayoffTeams"],
|
|
1173
|
-
"active": value["active"]
|
|
1174
|
-
};
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
// src/models/Streak.ts
|
|
1178
|
-
var StreakStreakTypeEnum = /* @__PURE__ */ ((StreakStreakTypeEnum2) => {
|
|
1179
|
-
StreakStreakTypeEnum2["Losing"] = "losses";
|
|
1180
|
-
StreakStreakTypeEnum2["Winning"] = "wins";
|
|
1181
|
-
return StreakStreakTypeEnum2;
|
|
1182
|
-
})(StreakStreakTypeEnum || {});
|
|
1183
|
-
function instanceOfStreak(value) {
|
|
1184
|
-
return true;
|
|
1185
|
-
}
|
|
1186
|
-
function StreakFromJSON(json) {
|
|
1187
|
-
return StreakFromJSONTyped(json, false);
|
|
1188
|
-
}
|
|
1189
|
-
function StreakFromJSONTyped(json, ignoreDiscriminator) {
|
|
1190
|
-
if (json == null) {
|
|
1191
|
-
return json;
|
|
1192
|
-
}
|
|
1193
|
-
return {
|
|
1194
|
-
"streakType": json["streakType"] == null ? void 0 : json["streakType"]
|
|
1195
|
-
};
|
|
1196
|
-
}
|
|
1197
|
-
function StreakToJSON(json) {
|
|
1198
|
-
return StreakToJSONTyped(json, false);
|
|
1199
|
-
}
|
|
1200
|
-
function StreakToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1201
|
-
if (value == null) {
|
|
1202
|
-
return value;
|
|
1203
|
-
}
|
|
1204
|
-
return {
|
|
1205
|
-
"streakType": value["streakType"]
|
|
1206
|
-
};
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
// src/models/LeagueRecord.ts
|
|
1210
|
-
function instanceOfLeagueRecord(value) {
|
|
1211
|
-
if (!("wins" in value) || value["wins"] === void 0) return false;
|
|
1212
|
-
if (!("losses" in value) || value["losses"] === void 0) return false;
|
|
1213
|
-
if (!("pct" in value) || value["pct"] === void 0) return false;
|
|
1214
|
-
return true;
|
|
1215
|
-
}
|
|
1216
|
-
function LeagueRecordFromJSON(json) {
|
|
1217
|
-
return LeagueRecordFromJSONTyped(json, false);
|
|
1218
|
-
}
|
|
1219
|
-
function LeagueRecordFromJSONTyped(json, ignoreDiscriminator) {
|
|
1220
|
-
if (json == null) {
|
|
1221
|
-
return json;
|
|
1222
|
-
}
|
|
1223
|
-
return {
|
|
1224
|
-
"wins": json["wins"],
|
|
1225
|
-
"losses": json["losses"],
|
|
1226
|
-
"ties": json["ties"] == null ? void 0 : json["ties"],
|
|
1227
|
-
"pct": json["pct"]
|
|
1228
|
-
};
|
|
1229
|
-
}
|
|
1230
|
-
function LeagueRecordToJSON(json) {
|
|
1231
|
-
return LeagueRecordToJSONTyped(json, false);
|
|
1232
|
-
}
|
|
1233
|
-
function LeagueRecordToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1234
|
-
if (value == null) {
|
|
1235
|
-
return value;
|
|
1236
|
-
}
|
|
1237
|
-
return {
|
|
1238
|
-
"wins": value["wins"],
|
|
1239
|
-
"losses": value["losses"],
|
|
1240
|
-
"ties": value["ties"],
|
|
1241
|
-
"pct": value["pct"]
|
|
1242
|
-
};
|
|
1243
|
-
}
|
|
1244
|
-
|
|
1245
|
-
// src/models/Record.ts
|
|
1246
|
-
function instanceOfRecord(value) {
|
|
1247
|
-
if (!("team" in value) || value["team"] === void 0) return false;
|
|
1248
|
-
if (!("season" in value) || value["season"] === void 0) return false;
|
|
1249
|
-
if (!("streak" in value) || value["streak"] === void 0) return false;
|
|
1250
|
-
if (!("divisionRank" in value) || value["divisionRank"] === void 0) return false;
|
|
1251
|
-
if (!("leagueRank" in value) || value["leagueRank"] === void 0) return false;
|
|
1252
|
-
if (!("gamesBack" in value) || value["gamesBack"] === void 0) return false;
|
|
1253
|
-
if (!("leagueRecord" in value) || value["leagueRecord"] === void 0) return false;
|
|
1254
|
-
if (!("wins" in value) || value["wins"] === void 0) return false;
|
|
1255
|
-
if (!("losses" in value) || value["losses"] === void 0) return false;
|
|
1256
|
-
return true;
|
|
1257
|
-
}
|
|
1258
|
-
function RecordFromJSON(json) {
|
|
1259
|
-
return RecordFromJSONTyped(json, false);
|
|
1260
|
-
}
|
|
1261
|
-
function RecordFromJSONTyped(json, ignoreDiscriminator) {
|
|
1262
|
-
if (json == null) {
|
|
1263
|
-
return json;
|
|
1264
|
-
}
|
|
1265
|
-
return {
|
|
1266
|
-
"team": TeamFromJSON(json["team"]),
|
|
1267
|
-
"season": json["season"],
|
|
1268
|
-
"streak": StreakFromJSON(json["streak"]),
|
|
1269
|
-
"divisionRank": json["divisionRank"],
|
|
1270
|
-
"leagueRank": json["leagueRank"],
|
|
1271
|
-
"sportRank": json["sportRank"] == null ? void 0 : json["sportRank"],
|
|
1272
|
-
"gamesPlayed": json["gamesPlayed"] == null ? void 0 : json["gamesPlayed"],
|
|
1273
|
-
"gamesBack": json["gamesBack"],
|
|
1274
|
-
"wildCardGamesBack": json["wildCardGamesBack"] == null ? void 0 : json["wildCardGamesBack"],
|
|
1275
|
-
"leagueGamesBack": json["leagueGamesBack"] == null ? void 0 : json["leagueGamesBack"],
|
|
1276
|
-
"sportGamesBack": json["sportGamesBack"] == null ? void 0 : json["sportGamesBack"],
|
|
1277
|
-
"divisionGamesBack": json["divisionGamesBack"] == null ? void 0 : json["divisionGamesBack"],
|
|
1278
|
-
"conferenceGamesBack": json["conferenceGamesBack"] == null ? void 0 : json["conferenceGamesBack"],
|
|
1279
|
-
"leagueRecord": LeagueRecordFromJSON(json["leagueRecord"]),
|
|
1280
|
-
"lastUpdated": json["lastUpdated"] == null ? void 0 : json["lastUpdated"],
|
|
1281
|
-
"runsAllowed": json["runsAllowed"] == null ? void 0 : json["runsAllowed"],
|
|
1282
|
-
"runsScored": json["runsScored"] == null ? void 0 : json["runsScored"],
|
|
1283
|
-
"divisionChamp": json["divisionChamp"] == null ? void 0 : json["divisionChamp"],
|
|
1284
|
-
"divisionLeader": json["divisionLeader"] == null ? void 0 : json["divisionLeader"],
|
|
1285
|
-
"hasWildcard": json["hasWildcard"] == null ? void 0 : json["hasWildcard"],
|
|
1286
|
-
"clinched": json["clinched"] == null ? void 0 : json["clinched"],
|
|
1287
|
-
"eliminationNumber": json["eliminationNumber"] == null ? void 0 : json["eliminationNumber"],
|
|
1288
|
-
"eliminationNumberSport": json["eliminationNumberSport"] == null ? void 0 : json["eliminationNumberSport"],
|
|
1289
|
-
"eliminationNumberLeague": json["eliminationNumberLeague"] == null ? void 0 : json["eliminationNumberLeague"],
|
|
1290
|
-
"eliminationNumberDivision": json["eliminationNumberDivision"] == null ? void 0 : json["eliminationNumberDivision"],
|
|
1291
|
-
"eliminationNumberConference": json["eliminationNumberConference"] == null ? void 0 : json["eliminationNumberConference"],
|
|
1292
|
-
"wildCardEliminationNumber": json["wildCardEliminationNumber"] == null ? void 0 : json["wildCardEliminationNumber"],
|
|
1293
|
-
"magicNumber": json["magicNumber"] == null ? void 0 : json["magicNumber"],
|
|
1294
|
-
"wins": json["wins"],
|
|
1295
|
-
"losses": json["losses"],
|
|
1296
|
-
"runDifferential": json["runDifferential"] == null ? void 0 : json["runDifferential"],
|
|
1297
|
-
"winningPercentage": json["winningPercentage"] == null ? void 0 : json["winningPercentage"]
|
|
1298
|
-
};
|
|
1299
|
-
}
|
|
1300
|
-
function RecordToJSON(json) {
|
|
1301
|
-
return RecordToJSONTyped(json, false);
|
|
1302
|
-
}
|
|
1303
|
-
function RecordToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1304
|
-
if (value == null) {
|
|
1305
|
-
return value;
|
|
1306
|
-
}
|
|
1307
|
-
return {
|
|
1308
|
-
"team": TeamToJSON(value["team"]),
|
|
1309
|
-
"season": value["season"],
|
|
1310
|
-
"streak": StreakToJSON(value["streak"]),
|
|
1311
|
-
"divisionRank": value["divisionRank"],
|
|
1312
|
-
"leagueRank": value["leagueRank"],
|
|
1313
|
-
"sportRank": value["sportRank"],
|
|
1314
|
-
"gamesPlayed": value["gamesPlayed"],
|
|
1315
|
-
"gamesBack": value["gamesBack"],
|
|
1316
|
-
"wildCardGamesBack": value["wildCardGamesBack"],
|
|
1317
|
-
"leagueGamesBack": value["leagueGamesBack"],
|
|
1318
|
-
"sportGamesBack": value["sportGamesBack"],
|
|
1319
|
-
"divisionGamesBack": value["divisionGamesBack"],
|
|
1320
|
-
"conferenceGamesBack": value["conferenceGamesBack"],
|
|
1321
|
-
"leagueRecord": LeagueRecordToJSON(value["leagueRecord"]),
|
|
1322
|
-
"lastUpdated": value["lastUpdated"],
|
|
1323
|
-
"runsAllowed": value["runsAllowed"],
|
|
1324
|
-
"runsScored": value["runsScored"],
|
|
1325
|
-
"divisionChamp": value["divisionChamp"],
|
|
1326
|
-
"divisionLeader": value["divisionLeader"],
|
|
1327
|
-
"hasWildcard": value["hasWildcard"],
|
|
1328
|
-
"clinched": value["clinched"],
|
|
1329
|
-
"eliminationNumber": value["eliminationNumber"],
|
|
1330
|
-
"eliminationNumberSport": value["eliminationNumberSport"],
|
|
1331
|
-
"eliminationNumberLeague": value["eliminationNumberLeague"],
|
|
1332
|
-
"eliminationNumberDivision": value["eliminationNumberDivision"],
|
|
1333
|
-
"eliminationNumberConference": value["eliminationNumberConference"],
|
|
1334
|
-
"wildCardEliminationNumber": value["wildCardEliminationNumber"],
|
|
1335
|
-
"magicNumber": value["magicNumber"],
|
|
1336
|
-
"wins": value["wins"],
|
|
1337
|
-
"losses": value["losses"],
|
|
1338
|
-
"runDifferential": value["runDifferential"],
|
|
1339
|
-
"winningPercentage": value["winningPercentage"]
|
|
1340
|
-
};
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
// src/models/Team.ts
|
|
1344
|
-
function instanceOfTeam(value) {
|
|
1345
|
-
if (!("id" in value) || value["id"] === void 0) return false;
|
|
1346
|
-
if (!("name" in value) || value["name"] === void 0) return false;
|
|
1347
|
-
return true;
|
|
1348
|
-
}
|
|
1349
|
-
function TeamFromJSON(json) {
|
|
1350
|
-
return TeamFromJSONTyped2(json, false);
|
|
1351
|
-
}
|
|
1352
|
-
function TeamFromJSONTyped2(json, ignoreDiscriminator) {
|
|
1353
|
-
if (json == null) {
|
|
1354
|
-
return json;
|
|
1355
|
-
}
|
|
1356
|
-
return {
|
|
1357
|
-
"id": json["id"],
|
|
1358
|
-
"name": json["name"],
|
|
1359
|
-
"link": json["link"] == null ? void 0 : json["link"],
|
|
1360
|
-
"allStarStatus": json["allStarStatus"] == null ? void 0 : json["allStarStatus"],
|
|
1361
|
-
"season": json["season"] == null ? void 0 : json["season"],
|
|
1362
|
-
"venue": json["venue"] == null ? void 0 : VenueFromJSON(json["venue"]),
|
|
1363
|
-
"springVenue": json["springVenue"] == null ? void 0 : VenueFromJSON(json["springVenue"]),
|
|
1364
|
-
"teamCode": json["teamCode"] == null ? void 0 : json["teamCode"],
|
|
1365
|
-
"fileCode": json["fileCode"] == null ? void 0 : json["fileCode"],
|
|
1366
|
-
"abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"],
|
|
1367
|
-
"teamName": json["teamName"] == null ? void 0 : json["teamName"],
|
|
1368
|
-
"locationName": json["locationName"] == null ? void 0 : json["locationName"],
|
|
1369
|
-
"firstYearOfPlay": json["firstYearOfPlay"] == null ? void 0 : json["firstYearOfPlay"],
|
|
1370
|
-
"league": json["league"] == null ? void 0 : LeagueFromJSON(json["league"]),
|
|
1371
|
-
"springLeague": json["springLeague"] == null ? void 0 : LeagueFromJSON(json["springLeague"]),
|
|
1372
|
-
"division": json["division"] == null ? void 0 : DivisionFromJSON(json["division"]),
|
|
1373
|
-
"sport": json["sport"] == null ? void 0 : SportFromJSON(json["sport"]),
|
|
1374
|
-
"record": json["record"] == null ? void 0 : RecordFromJSON(json["record"]),
|
|
1375
|
-
"shortName": json["shortName"] == null ? void 0 : json["shortName"],
|
|
1376
|
-
"franchiseName": json["franchiseName"] == null ? void 0 : json["franchiseName"],
|
|
1377
|
-
"clubName": json["clubName"] == null ? void 0 : json["clubName"],
|
|
1378
|
-
"active": json["active"] == null ? void 0 : json["active"]
|
|
1379
|
-
};
|
|
1380
|
-
}
|
|
1381
|
-
function TeamToJSON(json) {
|
|
1382
|
-
return TeamToJSONTyped2(json, false);
|
|
1383
|
-
}
|
|
1384
|
-
function TeamToJSONTyped2(value, ignoreDiscriminator = false) {
|
|
1385
|
-
if (value == null) {
|
|
1386
|
-
return value;
|
|
1387
|
-
}
|
|
1388
|
-
return {
|
|
1389
|
-
"id": value["id"],
|
|
1390
|
-
"name": value["name"],
|
|
1391
|
-
"link": value["link"],
|
|
1392
|
-
"allStarStatus": value["allStarStatus"],
|
|
1393
|
-
"season": value["season"],
|
|
1394
|
-
"venue": VenueToJSON(value["venue"]),
|
|
1395
|
-
"springVenue": VenueToJSON(value["springVenue"]),
|
|
1396
|
-
"teamCode": value["teamCode"],
|
|
1397
|
-
"fileCode": value["fileCode"],
|
|
1398
|
-
"abbreviation": value["abbreviation"],
|
|
1399
|
-
"teamName": value["teamName"],
|
|
1400
|
-
"locationName": value["locationName"],
|
|
1401
|
-
"firstYearOfPlay": value["firstYearOfPlay"],
|
|
1402
|
-
"league": LeagueToJSON(value["league"]),
|
|
1403
|
-
"springLeague": LeagueToJSON(value["springLeague"]),
|
|
1404
|
-
"division": DivisionToJSON(value["division"]),
|
|
1405
|
-
"sport": SportToJSON(value["sport"]),
|
|
1406
|
-
"record": RecordToJSON(value["record"]),
|
|
1407
|
-
"shortName": value["shortName"],
|
|
1408
|
-
"franchiseName": value["franchiseName"],
|
|
1409
|
-
"clubName": value["clubName"],
|
|
1410
|
-
"active": value["active"]
|
|
1411
|
-
};
|
|
1412
|
-
}
|
|
1413
|
-
|
|
1414
|
-
// src/models/TeamStats.ts
|
|
1415
|
-
function instanceOfTeamStats(value) {
|
|
1416
|
-
if (!("batting" in value) || value["batting"] === void 0) return false;
|
|
1417
|
-
if (!("pitching" in value) || value["pitching"] === void 0) return false;
|
|
1418
|
-
if (!("fielding" in value) || value["fielding"] === void 0) return false;
|
|
1419
|
-
return true;
|
|
1420
|
-
}
|
|
1421
|
-
function TeamStatsFromJSON(json) {
|
|
1422
|
-
return TeamStatsFromJSONTyped(json, false);
|
|
1423
|
-
}
|
|
1424
|
-
function TeamStatsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1425
|
-
if (json == null) {
|
|
1426
|
-
return json;
|
|
1427
|
-
}
|
|
1428
|
-
return {
|
|
1429
|
-
"batting": BattingStatsFromJSON(json["batting"]),
|
|
1430
|
-
"pitching": PitchingStatsFromJSON(json["pitching"]),
|
|
1431
|
-
"fielding": FieldingStatsFromJSON(json["fielding"])
|
|
1432
|
-
};
|
|
1433
|
-
}
|
|
1434
|
-
function TeamStatsToJSON(json) {
|
|
1435
|
-
return TeamStatsToJSONTyped(json, false);
|
|
1436
|
-
}
|
|
1437
|
-
function TeamStatsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1438
|
-
if (value == null) {
|
|
1439
|
-
return value;
|
|
1440
|
-
}
|
|
1441
|
-
return {
|
|
1442
|
-
"batting": BattingStatsToJSON(value["batting"]),
|
|
1443
|
-
"pitching": PitchingStatsToJSON(value["pitching"]),
|
|
1444
|
-
"fielding": FieldingStatsToJSON(value["fielding"])
|
|
1445
|
-
};
|
|
1446
|
-
}
|
|
1447
|
-
|
|
1448
|
-
// src/models/BoxscoreTeam.ts
|
|
1449
|
-
function instanceOfBoxscoreTeam(value) {
|
|
1450
|
-
if (!("team" in value) || value["team"] === void 0) return false;
|
|
1451
|
-
if (!("teamStats" in value) || value["teamStats"] === void 0) return false;
|
|
1452
|
-
if (!("players" in value) || value["players"] === void 0) return false;
|
|
1453
|
-
return true;
|
|
1454
|
-
}
|
|
1455
|
-
function BoxscoreTeamFromJSON(json) {
|
|
1456
|
-
return BoxscoreTeamFromJSONTyped(json, false);
|
|
1457
|
-
}
|
|
1458
|
-
function BoxscoreTeamFromJSONTyped(json, ignoreDiscriminator) {
|
|
1459
|
-
if (json == null) {
|
|
1460
|
-
return json;
|
|
1461
|
-
}
|
|
1462
|
-
return {
|
|
1463
|
-
"team": TeamFromJSON(json["team"]),
|
|
1464
|
-
"teamStats": TeamStatsFromJSON(json["teamStats"]),
|
|
1465
|
-
"players": mapValues(json["players"], PlayerFromJSON)
|
|
1466
|
-
};
|
|
1467
|
-
}
|
|
1468
|
-
function BoxscoreTeamToJSON(json) {
|
|
1469
|
-
return BoxscoreTeamToJSONTyped(json, false);
|
|
1470
|
-
}
|
|
1471
|
-
function BoxscoreTeamToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1472
|
-
if (value == null) {
|
|
1473
|
-
return value;
|
|
1474
|
-
}
|
|
1475
|
-
return {
|
|
1476
|
-
"team": TeamToJSON(value["team"]),
|
|
1477
|
-
"teamStats": TeamStatsToJSON(value["teamStats"]),
|
|
1478
|
-
"players": mapValues(value["players"], PlayerToJSON)
|
|
1479
|
-
};
|
|
1480
|
-
}
|
|
1481
|
-
|
|
1482
|
-
// src/models/BoxscoreTeams.ts
|
|
1483
|
-
function instanceOfBoxscoreTeams(value) {
|
|
1484
|
-
if (!("away" in value) || value["away"] === void 0) return false;
|
|
1485
|
-
if (!("home" in value) || value["home"] === void 0) return false;
|
|
1486
|
-
return true;
|
|
1487
|
-
}
|
|
1488
|
-
function BoxscoreTeamsFromJSON(json) {
|
|
1489
|
-
return BoxscoreTeamsFromJSONTyped(json, false);
|
|
1490
|
-
}
|
|
1491
|
-
function BoxscoreTeamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1492
|
-
if (json == null) {
|
|
1493
|
-
return json;
|
|
1494
|
-
}
|
|
1495
|
-
return {
|
|
1496
|
-
"away": BoxscoreTeamFromJSON(json["away"]),
|
|
1497
|
-
"home": BoxscoreTeamFromJSON(json["home"])
|
|
1498
|
-
};
|
|
1499
|
-
}
|
|
1500
|
-
function BoxscoreTeamsToJSON(json) {
|
|
1501
|
-
return BoxscoreTeamsToJSONTyped(json, false);
|
|
1502
|
-
}
|
|
1503
|
-
function BoxscoreTeamsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1504
|
-
if (value == null) {
|
|
1505
|
-
return value;
|
|
1506
|
-
}
|
|
1507
|
-
return {
|
|
1508
|
-
"away": BoxscoreTeamToJSON(value["away"]),
|
|
1509
|
-
"home": BoxscoreTeamToJSON(value["home"])
|
|
1510
|
-
};
|
|
1511
|
-
}
|
|
1512
|
-
|
|
1513
|
-
// src/models/Boxscore.ts
|
|
1514
|
-
function instanceOfBoxscore(value) {
|
|
1515
|
-
if (!("teams" in value) || value["teams"] === void 0) return false;
|
|
1516
|
-
if (!("officials" in value) || value["officials"] === void 0) return false;
|
|
1517
|
-
return true;
|
|
1518
|
-
}
|
|
1519
|
-
function BoxscoreFromJSON(json) {
|
|
1520
|
-
return BoxscoreFromJSONTyped(json, false);
|
|
1521
|
-
}
|
|
1522
|
-
function BoxscoreFromJSONTyped(json, ignoreDiscriminator) {
|
|
1523
|
-
if (json == null) {
|
|
1524
|
-
return json;
|
|
1525
|
-
}
|
|
1526
|
-
return {
|
|
1527
|
-
"teams": BoxscoreTeamsFromJSON(json["teams"]),
|
|
1528
|
-
"officials": json["officials"].map(GameOfficialFromJSON)
|
|
1529
|
-
};
|
|
1530
|
-
}
|
|
1531
|
-
function BoxscoreToJSON(json) {
|
|
1532
|
-
return BoxscoreToJSONTyped(json, false);
|
|
1533
|
-
}
|
|
1534
|
-
function BoxscoreToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1535
|
-
if (value == null) {
|
|
1536
|
-
return value;
|
|
1537
|
-
}
|
|
1538
|
-
return {
|
|
1539
|
-
"teams": BoxscoreTeamsToJSON(value["teams"]),
|
|
1540
|
-
"officials": value["officials"].map(GameOfficialToJSON)
|
|
1541
|
-
};
|
|
1542
|
-
}
|
|
1543
|
-
|
|
1544
|
-
// src/models/DivisionStandings.ts
|
|
1545
|
-
function instanceOfDivisionStandings(value) {
|
|
1546
|
-
if (!("league" in value) || value["league"] === void 0) return false;
|
|
1547
|
-
if (!("division" in value) || value["division"] === void 0) return false;
|
|
1548
|
-
if (!("sport" in value) || value["sport"] === void 0) return false;
|
|
1549
|
-
if (!("teamRecords" in value) || value["teamRecords"] === void 0) return false;
|
|
1550
|
-
return true;
|
|
1551
|
-
}
|
|
1552
|
-
function DivisionStandingsFromJSON(json) {
|
|
1553
|
-
return DivisionStandingsFromJSONTyped(json, false);
|
|
1554
|
-
}
|
|
1555
|
-
function DivisionStandingsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1556
|
-
if (json == null) {
|
|
1557
|
-
return json;
|
|
1558
|
-
}
|
|
1559
|
-
return {
|
|
1560
|
-
"standingsType": json["standingsType"] == null ? void 0 : json["standingsType"],
|
|
1561
|
-
"league": LeagueFromJSON(json["league"]),
|
|
1562
|
-
"division": DivisionFromJSON(json["division"]),
|
|
1563
|
-
"sport": SportFromJSON(json["sport"]),
|
|
1564
|
-
"lastUpdated": json["lastUpdated"] == null ? void 0 : json["lastUpdated"],
|
|
1565
|
-
"teamRecords": json["teamRecords"].map(RecordFromJSON)
|
|
1566
|
-
};
|
|
1567
|
-
}
|
|
1568
|
-
function DivisionStandingsToJSON(json) {
|
|
1569
|
-
return DivisionStandingsToJSONTyped(json, false);
|
|
1570
|
-
}
|
|
1571
|
-
function DivisionStandingsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1572
|
-
if (value == null) {
|
|
1573
|
-
return value;
|
|
1574
|
-
}
|
|
1575
|
-
return {
|
|
1576
|
-
"standingsType": value["standingsType"],
|
|
1577
|
-
"league": LeagueToJSON(value["league"]),
|
|
1578
|
-
"division": DivisionToJSON(value["division"]),
|
|
1579
|
-
"sport": SportToJSON(value["sport"]),
|
|
1580
|
-
"lastUpdated": value["lastUpdated"],
|
|
1581
|
-
"teamRecords": value["teamRecords"].map(RecordToJSON)
|
|
1582
|
-
};
|
|
1583
|
-
}
|
|
1584
|
-
|
|
1585
|
-
// src/models/DivisionStandingsList.ts
|
|
1586
|
-
function instanceOfDivisionStandingsList(value) {
|
|
1587
|
-
return true;
|
|
1588
|
-
}
|
|
1589
|
-
function DivisionStandingsListFromJSON(json) {
|
|
1590
|
-
return DivisionStandingsListFromJSONTyped(json, false);
|
|
1591
|
-
}
|
|
1592
|
-
function DivisionStandingsListFromJSONTyped(json, ignoreDiscriminator) {
|
|
1593
|
-
if (json == null) {
|
|
1594
|
-
return json;
|
|
1595
|
-
}
|
|
1596
|
-
return {
|
|
1597
|
-
"records": json["records"] == null ? void 0 : json["records"].map(DivisionStandingsFromJSON)
|
|
1598
|
-
};
|
|
1599
|
-
}
|
|
1600
|
-
function DivisionStandingsListToJSON(json) {
|
|
1601
|
-
return DivisionStandingsListToJSONTyped(json, false);
|
|
1602
|
-
}
|
|
1603
|
-
function DivisionStandingsListToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1604
|
-
if (value == null) {
|
|
1605
|
-
return value;
|
|
1606
|
-
}
|
|
1607
|
-
return {
|
|
1608
|
-
"records": value["records"] == null ? void 0 : value["records"].map(DivisionStandingsToJSON)
|
|
1609
|
-
};
|
|
1610
|
-
}
|
|
1611
|
-
|
|
1612
|
-
// src/models/GameStatusCode.ts
|
|
1613
|
-
var GameStatusCode = /* @__PURE__ */ ((GameStatusCode2) => {
|
|
1614
|
-
GameStatusCode2["Final"] = "F";
|
|
1615
|
-
GameStatusCode2["Postponed"] = "D";
|
|
1616
|
-
GameStatusCode2["Scheduled"] = "S";
|
|
1617
|
-
GameStatusCode2["InProgress"] = "I";
|
|
1618
|
-
GameStatusCode2["Pregame"] = "P";
|
|
1619
|
-
GameStatusCode2["GameOver"] = "O";
|
|
1620
|
-
GameStatusCode2["Canceled"] = "C";
|
|
1621
|
-
return GameStatusCode2;
|
|
1622
|
-
})(GameStatusCode || {});
|
|
1623
|
-
function instanceOfGameStatusCode(value) {
|
|
1624
|
-
for (const key in GameStatusCode) {
|
|
1625
|
-
if (Object.prototype.hasOwnProperty.call(GameStatusCode, key)) {
|
|
1626
|
-
if (GameStatusCode[key] === value) {
|
|
1627
|
-
return true;
|
|
1628
|
-
}
|
|
1629
|
-
}
|
|
1630
|
-
}
|
|
1631
|
-
return false;
|
|
1632
|
-
}
|
|
1633
|
-
function GameStatusCodeFromJSON(json) {
|
|
1634
|
-
return GameStatusCodeFromJSONTyped(json, false);
|
|
1635
|
-
}
|
|
1636
|
-
function GameStatusCodeFromJSONTyped(json, ignoreDiscriminator) {
|
|
1637
|
-
return json;
|
|
1638
|
-
}
|
|
1639
|
-
function GameStatusCodeToJSON(value) {
|
|
1640
|
-
return value;
|
|
1641
|
-
}
|
|
1642
|
-
function GameStatusCodeToJSONTyped(value, ignoreDiscriminator) {
|
|
1643
|
-
return value;
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
|
-
// src/models/GameStatus.ts
|
|
1647
|
-
function instanceOfGameStatus(value) {
|
|
1648
|
-
return true;
|
|
1649
|
-
}
|
|
1650
|
-
function GameStatusFromJSON(json) {
|
|
1651
|
-
return GameStatusFromJSONTyped(json, false);
|
|
1652
|
-
}
|
|
1653
|
-
function GameStatusFromJSONTyped(json, ignoreDiscriminator) {
|
|
1654
|
-
if (json == null) {
|
|
1655
|
-
return json;
|
|
1656
|
-
}
|
|
1657
|
-
return {
|
|
1658
|
-
"abstractGameState": json["abstractGameState"] == null ? void 0 : json["abstractGameState"],
|
|
1659
|
-
"codedGameState": json["codedGameState"] == null ? void 0 : GameStatusCodeFromJSON(json["codedGameState"]),
|
|
1660
|
-
"detailedState": json["detailedState"] == null ? void 0 : json["detailedState"],
|
|
1661
|
-
"statusCode": json["statusCode"] == null ? void 0 : json["statusCode"],
|
|
1662
|
-
"startTimeTBD": json["startTimeTBD"] == null ? void 0 : json["startTimeTBD"],
|
|
1663
|
-
"abstractGameCode": json["abstractGameCode"] == null ? void 0 : json["abstractGameCode"]
|
|
1664
|
-
};
|
|
1665
|
-
}
|
|
1666
|
-
function GameStatusToJSON(json) {
|
|
1667
|
-
return GameStatusToJSONTyped(json, false);
|
|
1668
|
-
}
|
|
1669
|
-
function GameStatusToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1670
|
-
if (value == null) {
|
|
1671
|
-
return value;
|
|
1672
|
-
}
|
|
1673
|
-
return {
|
|
1674
|
-
"abstractGameState": value["abstractGameState"],
|
|
1675
|
-
"codedGameState": GameStatusCodeToJSON(value["codedGameState"]),
|
|
1676
|
-
"detailedState": value["detailedState"],
|
|
1677
|
-
"statusCode": value["statusCode"],
|
|
1678
|
-
"startTimeTBD": value["startTimeTBD"],
|
|
1679
|
-
"abstractGameCode": value["abstractGameCode"]
|
|
1680
|
-
};
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
// src/models/GameTeam.ts
|
|
1684
|
-
function instanceOfGameTeam(value) {
|
|
1685
|
-
if (!("score" in value) || value["score"] === void 0) return false;
|
|
1686
|
-
if (!("team" in value) || value["team"] === void 0) return false;
|
|
1687
|
-
if (!("isWinner" in value) || value["isWinner"] === void 0) return false;
|
|
1688
|
-
return true;
|
|
1689
|
-
}
|
|
1690
|
-
function GameTeamFromJSON(json) {
|
|
1691
|
-
return GameTeamFromJSONTyped(json, false);
|
|
1692
|
-
}
|
|
1693
|
-
function GameTeamFromJSONTyped(json, ignoreDiscriminator) {
|
|
1694
|
-
if (json == null) {
|
|
1695
|
-
return json;
|
|
1696
|
-
}
|
|
1697
|
-
return {
|
|
1698
|
-
"leagueRecord": json["leagueRecord"] == null ? void 0 : LeagueRecordFromJSON(json["leagueRecord"]),
|
|
1699
|
-
"score": json["score"],
|
|
1700
|
-
"team": TeamFromJSON(json["team"]),
|
|
1701
|
-
"isWinner": json["isWinner"],
|
|
1702
|
-
"splitSquad": json["splitSquad"] == null ? void 0 : json["splitSquad"],
|
|
1703
|
-
"seriesNumber": json["seriesNumber"] == null ? void 0 : json["seriesNumber"]
|
|
1704
|
-
};
|
|
1705
|
-
}
|
|
1706
|
-
function GameTeamToJSON(json) {
|
|
1707
|
-
return GameTeamToJSONTyped(json, false);
|
|
1708
|
-
}
|
|
1709
|
-
function GameTeamToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1710
|
-
if (value == null) {
|
|
1711
|
-
return value;
|
|
1712
|
-
}
|
|
1713
|
-
return {
|
|
1714
|
-
"leagueRecord": LeagueRecordToJSON(value["leagueRecord"]),
|
|
1715
|
-
"score": value["score"],
|
|
1716
|
-
"team": TeamToJSON(value["team"]),
|
|
1717
|
-
"isWinner": value["isWinner"],
|
|
1718
|
-
"splitSquad": value["splitSquad"],
|
|
1719
|
-
"seriesNumber": value["seriesNumber"]
|
|
1720
|
-
};
|
|
1721
|
-
}
|
|
1722
|
-
|
|
1723
|
-
// src/models/GameTeams.ts
|
|
1724
|
-
function instanceOfGameTeams(value) {
|
|
1725
|
-
if (!("away" in value) || value["away"] === void 0) return false;
|
|
1726
|
-
if (!("home" in value) || value["home"] === void 0) return false;
|
|
1727
|
-
return true;
|
|
1728
|
-
}
|
|
1729
|
-
function GameTeamsFromJSON(json) {
|
|
1730
|
-
return GameTeamsFromJSONTyped(json, false);
|
|
1731
|
-
}
|
|
1732
|
-
function GameTeamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1733
|
-
if (json == null) {
|
|
1734
|
-
return json;
|
|
1735
|
-
}
|
|
1736
|
-
return {
|
|
1737
|
-
"away": GameTeamFromJSON(json["away"]),
|
|
1738
|
-
"home": GameTeamFromJSON(json["home"])
|
|
1739
|
-
};
|
|
1740
|
-
}
|
|
1741
|
-
function GameTeamsToJSON(json) {
|
|
1742
|
-
return GameTeamsToJSONTyped(json, false);
|
|
1743
|
-
}
|
|
1744
|
-
function GameTeamsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1745
|
-
if (value == null) {
|
|
1746
|
-
return value;
|
|
1747
|
-
}
|
|
1748
|
-
return {
|
|
1749
|
-
"away": GameTeamToJSON(value["away"]),
|
|
1750
|
-
"home": GameTeamToJSON(value["home"])
|
|
1751
|
-
};
|
|
1752
|
-
}
|
|
1753
|
-
|
|
1754
|
-
// src/models/GameType.ts
|
|
1755
|
-
var GameType = /* @__PURE__ */ ((GameType2) => {
|
|
1756
|
-
GameType2["Exhibition"] = "E";
|
|
1757
|
-
GameType2["SpringTraining"] = "S";
|
|
1758
|
-
GameType2["Regular"] = "R";
|
|
1759
|
-
GameType2["WildCardSeries"] = "F";
|
|
1760
|
-
GameType2["DivisionSeries"] = "D";
|
|
1761
|
-
GameType2["LeagueChampionshipSeries"] = "L";
|
|
1762
|
-
GameType2["WorldSeries"] = "W";
|
|
1763
|
-
return GameType2;
|
|
1764
|
-
})(GameType || {});
|
|
1765
|
-
function instanceOfGameType(value) {
|
|
1766
|
-
for (const key in GameType) {
|
|
1767
|
-
if (Object.prototype.hasOwnProperty.call(GameType, key)) {
|
|
1768
|
-
if (GameType[key] === value) {
|
|
1769
|
-
return true;
|
|
1770
|
-
}
|
|
1771
|
-
}
|
|
1772
|
-
}
|
|
1773
|
-
return false;
|
|
1774
|
-
}
|
|
1775
|
-
function GameTypeFromJSON(json) {
|
|
1776
|
-
return GameTypeFromJSONTyped(json, false);
|
|
1777
|
-
}
|
|
1778
|
-
function GameTypeFromJSONTyped(json, ignoreDiscriminator) {
|
|
1779
|
-
return json;
|
|
1780
|
-
}
|
|
1781
|
-
function GameTypeToJSON(value) {
|
|
1782
|
-
return value;
|
|
1783
|
-
}
|
|
1784
|
-
function GameTypeToJSONTyped(value, ignoreDiscriminator) {
|
|
1785
|
-
return value;
|
|
1786
|
-
}
|
|
1787
|
-
|
|
1788
|
-
// src/models/Game.ts
|
|
1789
|
-
function instanceOfGame(value) {
|
|
1790
|
-
if (!("gamePk" in value) || value["gamePk"] === void 0) return false;
|
|
1791
|
-
if (!("gameGuid" in value) || value["gameGuid"] === void 0) return false;
|
|
1792
|
-
if (!("gameType" in value) || value["gameType"] === void 0) return false;
|
|
1793
|
-
if (!("season" in value) || value["season"] === void 0) return false;
|
|
1794
|
-
if (!("gameDate" in value) || value["gameDate"] === void 0) return false;
|
|
1795
|
-
if (!("officialDate" in value) || value["officialDate"] === void 0) return false;
|
|
1796
|
-
if (!("status" in value) || value["status"] === void 0) return false;
|
|
1797
|
-
if (!("teams" in value) || value["teams"] === void 0) return false;
|
|
1798
|
-
if (!("gameNumber" in value) || value["gameNumber"] === void 0) return false;
|
|
1799
|
-
if (!("gamesInSeries" in value) || value["gamesInSeries"] === void 0) return false;
|
|
1800
|
-
if (!("seriesGameNumber" in value) || value["seriesGameNumber"] === void 0) return false;
|
|
1801
|
-
return true;
|
|
1802
|
-
}
|
|
1803
|
-
function GameFromJSON(json) {
|
|
1804
|
-
return GameFromJSONTyped(json, false);
|
|
1805
|
-
}
|
|
1806
|
-
function GameFromJSONTyped(json, ignoreDiscriminator) {
|
|
1807
|
-
if (json == null) {
|
|
1808
|
-
return json;
|
|
1809
|
-
}
|
|
1810
|
-
return {
|
|
1811
|
-
"gamePk": json["gamePk"],
|
|
1812
|
-
"gameGuid": json["gameGuid"],
|
|
1813
|
-
"link": json["link"] == null ? void 0 : json["link"],
|
|
1814
|
-
"gameType": GameTypeFromJSON(json["gameType"]),
|
|
1815
|
-
"season": json["season"],
|
|
1816
|
-
"gameDate": json["gameDate"],
|
|
1817
|
-
"officialDate": json["officialDate"],
|
|
1818
|
-
"rescheduledTo": json["rescheduledTo"] == null ? void 0 : json["rescheduledTo"],
|
|
1819
|
-
"rescheduledToDate": json["rescheduledToDate"] == null ? void 0 : json["rescheduledToDate"],
|
|
1820
|
-
"rescheduledFrom": json["rescheduledFrom"] == null ? void 0 : json["rescheduledFrom"],
|
|
1821
|
-
"rescheduledFromDate": json["rescheduledFromDate"] == null ? void 0 : json["rescheduledFromDate"],
|
|
1822
|
-
"status": GameStatusFromJSON(json["status"]),
|
|
1823
|
-
"teams": GameTeamsFromJSON(json["teams"]),
|
|
1824
|
-
"venue": json["venue"] == null ? void 0 : VenueFromJSON(json["venue"]),
|
|
1825
|
-
"isTie": json["isTie"] == null ? void 0 : json["isTie"],
|
|
1826
|
-
"gameNumber": json["gameNumber"],
|
|
1827
|
-
"publicFacing": json["publicFacing"] == null ? void 0 : json["publicFacing"],
|
|
1828
|
-
"doubleHeader": json["doubleHeader"] == null ? void 0 : json["doubleHeader"],
|
|
1829
|
-
"gamedayType": json["gamedayType"] == null ? void 0 : json["gamedayType"],
|
|
1830
|
-
"tiebreaker": json["tiebreaker"] == null ? void 0 : json["tiebreaker"],
|
|
1831
|
-
"calendarEventID": json["calendarEventID"] == null ? void 0 : json["calendarEventID"],
|
|
1832
|
-
"seasonDisplay": json["seasonDisplay"] == null ? void 0 : json["seasonDisplay"],
|
|
1833
|
-
"dayNight": json["dayNight"] == null ? void 0 : json["dayNight"],
|
|
1834
|
-
"description": json["description"] == null ? void 0 : json["description"],
|
|
1835
|
-
"scheduledInnings": json["scheduledInnings"] == null ? void 0 : json["scheduledInnings"],
|
|
1836
|
-
"reverseHomeAwayStatus": json["reverseHomeAwayStatus"] == null ? void 0 : json["reverseHomeAwayStatus"],
|
|
1837
|
-
"inningBreakLength": json["inningBreakLength"] == null ? void 0 : json["inningBreakLength"],
|
|
1838
|
-
"gamesInSeries": json["gamesInSeries"],
|
|
1839
|
-
"seriesGameNumber": json["seriesGameNumber"],
|
|
1840
|
-
"seriesDescription": json["seriesDescription"] == null ? void 0 : json["seriesDescription"],
|
|
1841
|
-
"recordSource": json["recordSource"] == null ? void 0 : json["recordSource"],
|
|
1842
|
-
"ifNecessary": json["ifNecessary"] == null ? void 0 : json["ifNecessary"],
|
|
1843
|
-
"ifNecessaryDescription": json["ifNecessaryDescription"] == null ? void 0 : json["ifNecessaryDescription"]
|
|
1844
|
-
};
|
|
1845
|
-
}
|
|
1846
|
-
function GameToJSON(json) {
|
|
1847
|
-
return GameToJSONTyped(json, false);
|
|
1848
|
-
}
|
|
1849
|
-
function GameToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1850
|
-
if (value == null) {
|
|
1851
|
-
return value;
|
|
1852
|
-
}
|
|
1853
|
-
return {
|
|
1854
|
-
"gamePk": value["gamePk"],
|
|
1855
|
-
"gameGuid": value["gameGuid"],
|
|
1856
|
-
"link": value["link"],
|
|
1857
|
-
"gameType": GameTypeToJSON(value["gameType"]),
|
|
1858
|
-
"season": value["season"],
|
|
1859
|
-
"gameDate": value["gameDate"],
|
|
1860
|
-
"officialDate": value["officialDate"],
|
|
1861
|
-
"rescheduledTo": value["rescheduledTo"],
|
|
1862
|
-
"rescheduledToDate": value["rescheduledToDate"],
|
|
1863
|
-
"rescheduledFrom": value["rescheduledFrom"],
|
|
1864
|
-
"rescheduledFromDate": value["rescheduledFromDate"],
|
|
1865
|
-
"status": GameStatusToJSON(value["status"]),
|
|
1866
|
-
"teams": GameTeamsToJSON(value["teams"]),
|
|
1867
|
-
"venue": VenueToJSON(value["venue"]),
|
|
1868
|
-
"isTie": value["isTie"],
|
|
1869
|
-
"gameNumber": value["gameNumber"],
|
|
1870
|
-
"publicFacing": value["publicFacing"],
|
|
1871
|
-
"doubleHeader": value["doubleHeader"],
|
|
1872
|
-
"gamedayType": value["gamedayType"],
|
|
1873
|
-
"tiebreaker": value["tiebreaker"],
|
|
1874
|
-
"calendarEventID": value["calendarEventID"],
|
|
1875
|
-
"seasonDisplay": value["seasonDisplay"],
|
|
1876
|
-
"dayNight": value["dayNight"],
|
|
1877
|
-
"description": value["description"],
|
|
1878
|
-
"scheduledInnings": value["scheduledInnings"],
|
|
1879
|
-
"reverseHomeAwayStatus": value["reverseHomeAwayStatus"],
|
|
1880
|
-
"inningBreakLength": value["inningBreakLength"],
|
|
1881
|
-
"gamesInSeries": value["gamesInSeries"],
|
|
1882
|
-
"seriesGameNumber": value["seriesGameNumber"],
|
|
1883
|
-
"seriesDescription": value["seriesDescription"],
|
|
1884
|
-
"recordSource": value["recordSource"],
|
|
1885
|
-
"ifNecessary": value["ifNecessary"],
|
|
1886
|
-
"ifNecessaryDescription": value["ifNecessaryDescription"]
|
|
1887
|
-
};
|
|
1888
|
-
}
|
|
1889
|
-
|
|
1890
|
-
// src/models/LinescoreTeam.ts
|
|
1891
|
-
function instanceOfLinescoreTeam(value) {
|
|
1892
|
-
return true;
|
|
1893
|
-
}
|
|
1894
|
-
function LinescoreTeamFromJSON(json) {
|
|
1895
|
-
return LinescoreTeamFromJSONTyped(json, false);
|
|
1896
|
-
}
|
|
1897
|
-
function LinescoreTeamFromJSONTyped(json, ignoreDiscriminator) {
|
|
1898
|
-
if (json == null) {
|
|
1899
|
-
return json;
|
|
1900
|
-
}
|
|
1901
|
-
return {
|
|
1902
|
-
"runs": json["runs"] == null ? void 0 : json["runs"],
|
|
1903
|
-
"hits": json["hits"] == null ? void 0 : json["hits"],
|
|
1904
|
-
"errors": json["errors"] == null ? void 0 : json["errors"],
|
|
1905
|
-
"leftOnBase": json["leftOnBase"] == null ? void 0 : json["leftOnBase"]
|
|
1906
|
-
};
|
|
1907
|
-
}
|
|
1908
|
-
function LinescoreTeamToJSON(json) {
|
|
1909
|
-
return LinescoreTeamToJSONTyped(json, false);
|
|
1910
|
-
}
|
|
1911
|
-
function LinescoreTeamToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1912
|
-
if (value == null) {
|
|
1913
|
-
return value;
|
|
1914
|
-
}
|
|
1915
|
-
return {
|
|
1916
|
-
"runs": value["runs"],
|
|
1917
|
-
"hits": value["hits"],
|
|
1918
|
-
"errors": value["errors"],
|
|
1919
|
-
"leftOnBase": value["leftOnBase"]
|
|
1920
|
-
};
|
|
1921
|
-
}
|
|
1922
|
-
|
|
1923
|
-
// src/models/Inning.ts
|
|
1924
|
-
function instanceOfInning(value) {
|
|
1925
|
-
return true;
|
|
1926
|
-
}
|
|
1927
|
-
function InningFromJSON(json) {
|
|
1928
|
-
return InningFromJSONTyped(json, false);
|
|
1929
|
-
}
|
|
1930
|
-
function InningFromJSONTyped(json, ignoreDiscriminator) {
|
|
1931
|
-
if (json == null) {
|
|
1932
|
-
return json;
|
|
1933
|
-
}
|
|
1934
|
-
return {
|
|
1935
|
-
"num": json["num"] == null ? void 0 : json["num"],
|
|
1936
|
-
"ordinalNum": json["ordinalNum"] == null ? void 0 : json["ordinalNum"],
|
|
1937
|
-
"home": json["home"] == null ? void 0 : LinescoreTeamFromJSON(json["home"]),
|
|
1938
|
-
"away": json["away"] == null ? void 0 : LinescoreTeamFromJSON(json["away"])
|
|
1939
|
-
};
|
|
1940
|
-
}
|
|
1941
|
-
function InningToJSON(json) {
|
|
1942
|
-
return InningToJSONTyped(json, false);
|
|
1943
|
-
}
|
|
1944
|
-
function InningToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1945
|
-
if (value == null) {
|
|
1946
|
-
return value;
|
|
1947
|
-
}
|
|
1948
|
-
return {
|
|
1949
|
-
"num": value["num"],
|
|
1950
|
-
"ordinalNum": value["ordinalNum"],
|
|
1951
|
-
"home": LinescoreTeamToJSON(value["home"]),
|
|
1952
|
-
"away": LinescoreTeamToJSON(value["away"])
|
|
1953
|
-
};
|
|
1954
|
-
}
|
|
1955
|
-
|
|
1956
|
-
// src/models/LinescoreTeams.ts
|
|
1957
|
-
function instanceOfLinescoreTeams(value) {
|
|
1958
|
-
return true;
|
|
1959
|
-
}
|
|
1960
|
-
function LinescoreTeamsFromJSON(json) {
|
|
1961
|
-
return LinescoreTeamsFromJSONTyped(json, false);
|
|
1962
|
-
}
|
|
1963
|
-
function LinescoreTeamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
1964
|
-
if (json == null) {
|
|
1965
|
-
return json;
|
|
1966
|
-
}
|
|
1967
|
-
return {
|
|
1968
|
-
"away": json["away"] == null ? void 0 : LinescoreTeamFromJSON(json["away"]),
|
|
1969
|
-
"home": json["home"] == null ? void 0 : LinescoreTeamFromJSON(json["home"])
|
|
1970
|
-
};
|
|
1971
|
-
}
|
|
1972
|
-
function LinescoreTeamsToJSON(json) {
|
|
1973
|
-
return LinescoreTeamsToJSONTyped(json, false);
|
|
1974
|
-
}
|
|
1975
|
-
function LinescoreTeamsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
1976
|
-
if (value == null) {
|
|
1977
|
-
return value;
|
|
1978
|
-
}
|
|
1979
|
-
return {
|
|
1980
|
-
"away": LinescoreTeamToJSON(value["away"]),
|
|
1981
|
-
"home": LinescoreTeamToJSON(value["home"])
|
|
1982
|
-
};
|
|
1983
|
-
}
|
|
1984
|
-
|
|
1985
|
-
// src/models/Linescore.ts
|
|
1986
|
-
function instanceOfLinescore(value) {
|
|
1987
|
-
return true;
|
|
1988
|
-
}
|
|
1989
|
-
function LinescoreFromJSON(json) {
|
|
1990
|
-
return LinescoreFromJSONTyped(json, false);
|
|
1991
|
-
}
|
|
1992
|
-
function LinescoreFromJSONTyped(json, ignoreDiscriminator) {
|
|
1993
|
-
if (json == null) {
|
|
1994
|
-
return json;
|
|
1995
|
-
}
|
|
1996
|
-
return {
|
|
1997
|
-
"currentInning": json["currentInning"] == null ? void 0 : json["currentInning"],
|
|
1998
|
-
"currentInningOrdinal": json["currentInningOrdinal"] == null ? void 0 : json["currentInningOrdinal"],
|
|
1999
|
-
"inningState": json["inningState"] == null ? void 0 : json["inningState"],
|
|
2000
|
-
"inningHalf": json["inningHalf"] == null ? void 0 : json["inningHalf"],
|
|
2001
|
-
"isTopInning": json["isTopInning"] == null ? void 0 : json["isTopInning"],
|
|
2002
|
-
"scheduledInnings": json["scheduledInnings"] == null ? void 0 : json["scheduledInnings"],
|
|
2003
|
-
"innings": json["innings"] == null ? void 0 : json["innings"].map(InningFromJSON),
|
|
2004
|
-
"teams": json["teams"] == null ? void 0 : LinescoreTeamsFromJSON(json["teams"]),
|
|
2005
|
-
"balls": json["balls"] == null ? void 0 : json["balls"],
|
|
2006
|
-
"strikes": json["strikes"] == null ? void 0 : json["strikes"],
|
|
2007
|
-
"outs": json["outs"] == null ? void 0 : json["outs"]
|
|
2008
|
-
};
|
|
2009
|
-
}
|
|
2010
|
-
function LinescoreToJSON(json) {
|
|
2011
|
-
return LinescoreToJSONTyped(json, false);
|
|
2012
|
-
}
|
|
2013
|
-
function LinescoreToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2014
|
-
if (value == null) {
|
|
2015
|
-
return value;
|
|
2016
|
-
}
|
|
2017
|
-
return {
|
|
2018
|
-
"currentInning": value["currentInning"],
|
|
2019
|
-
"currentInningOrdinal": value["currentInningOrdinal"],
|
|
2020
|
-
"inningState": value["inningState"],
|
|
2021
|
-
"inningHalf": value["inningHalf"],
|
|
2022
|
-
"isTopInning": value["isTopInning"],
|
|
2023
|
-
"scheduledInnings": value["scheduledInnings"],
|
|
2024
|
-
"innings": value["innings"] == null ? void 0 : value["innings"].map(InningToJSON),
|
|
2025
|
-
"teams": LinescoreTeamsToJSON(value["teams"]),
|
|
2026
|
-
"balls": value["balls"],
|
|
2027
|
-
"strikes": value["strikes"],
|
|
2028
|
-
"outs": value["outs"]
|
|
2029
|
-
};
|
|
2030
|
-
}
|
|
2031
|
-
|
|
2032
|
-
// src/models/ScheduleDay.ts
|
|
2033
|
-
function instanceOfScheduleDay(value) {
|
|
2034
|
-
if (!("games" in value) || value["games"] === void 0) return false;
|
|
2035
|
-
return true;
|
|
2036
|
-
}
|
|
2037
|
-
function ScheduleDayFromJSON(json) {
|
|
2038
|
-
return ScheduleDayFromJSONTyped(json, false);
|
|
2039
|
-
}
|
|
2040
|
-
function ScheduleDayFromJSONTyped(json, ignoreDiscriminator) {
|
|
2041
|
-
if (json == null) {
|
|
2042
|
-
return json;
|
|
2043
|
-
}
|
|
2044
|
-
return {
|
|
2045
|
-
"date": json["date"] == null ? void 0 : json["date"],
|
|
2046
|
-
"totalItems": json["totalItems"] == null ? void 0 : json["totalItems"],
|
|
2047
|
-
"totalEvents": json["totalEvents"] == null ? void 0 : json["totalEvents"],
|
|
2048
|
-
"totalGames": json["totalGames"] == null ? void 0 : json["totalGames"],
|
|
2049
|
-
"totalGamesInProgress": json["totalGamesInProgress"] == null ? void 0 : json["totalGamesInProgress"],
|
|
2050
|
-
"games": json["games"].map(GameFromJSON)
|
|
2051
|
-
};
|
|
2052
|
-
}
|
|
2053
|
-
function ScheduleDayToJSON(json) {
|
|
2054
|
-
return ScheduleDayToJSONTyped(json, false);
|
|
2055
|
-
}
|
|
2056
|
-
function ScheduleDayToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2057
|
-
if (value == null) {
|
|
2058
|
-
return value;
|
|
2059
|
-
}
|
|
2060
|
-
return {
|
|
2061
|
-
"date": value["date"],
|
|
2062
|
-
"totalItems": value["totalItems"],
|
|
2063
|
-
"totalEvents": value["totalEvents"],
|
|
2064
|
-
"totalGames": value["totalGames"],
|
|
2065
|
-
"totalGamesInProgress": value["totalGamesInProgress"],
|
|
2066
|
-
"games": value["games"].map(GameToJSON)
|
|
2067
|
-
};
|
|
2068
|
-
}
|
|
2069
|
-
|
|
2070
|
-
// src/models/Schedule.ts
|
|
2071
|
-
function instanceOfSchedule(value) {
|
|
2072
|
-
if (!("totalItems" in value) || value["totalItems"] === void 0) return false;
|
|
2073
|
-
if (!("totalEvents" in value) || value["totalEvents"] === void 0) return false;
|
|
2074
|
-
if (!("totalGames" in value) || value["totalGames"] === void 0) return false;
|
|
2075
|
-
if (!("totalGamesInProgress" in value) || value["totalGamesInProgress"] === void 0) return false;
|
|
2076
|
-
if (!("dates" in value) || value["dates"] === void 0) return false;
|
|
2077
|
-
return true;
|
|
2078
|
-
}
|
|
2079
|
-
function ScheduleFromJSON(json) {
|
|
2080
|
-
return ScheduleFromJSONTyped(json, false);
|
|
2081
|
-
}
|
|
2082
|
-
function ScheduleFromJSONTyped(json, ignoreDiscriminator) {
|
|
2083
|
-
if (json == null) {
|
|
2084
|
-
return json;
|
|
2085
|
-
}
|
|
2086
|
-
return {
|
|
2087
|
-
"totalItems": json["totalItems"],
|
|
2088
|
-
"totalEvents": json["totalEvents"],
|
|
2089
|
-
"totalGames": json["totalGames"],
|
|
2090
|
-
"totalGamesInProgress": json["totalGamesInProgress"],
|
|
2091
|
-
"dates": json["dates"].map(ScheduleDayFromJSON)
|
|
2092
|
-
};
|
|
2093
|
-
}
|
|
2094
|
-
function ScheduleToJSON(json) {
|
|
2095
|
-
return ScheduleToJSONTyped(json, false);
|
|
2096
|
-
}
|
|
2097
|
-
function ScheduleToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2098
|
-
if (value == null) {
|
|
2099
|
-
return value;
|
|
2100
|
-
}
|
|
2101
|
-
return {
|
|
2102
|
-
"totalItems": value["totalItems"],
|
|
2103
|
-
"totalEvents": value["totalEvents"],
|
|
2104
|
-
"totalGames": value["totalGames"],
|
|
2105
|
-
"totalGamesInProgress": value["totalGamesInProgress"],
|
|
2106
|
-
"dates": value["dates"].map(ScheduleDayToJSON)
|
|
2107
|
-
};
|
|
2108
|
-
}
|
|
2109
|
-
|
|
2110
|
-
// src/models/Season.ts
|
|
2111
|
-
function instanceOfSeason(value) {
|
|
2112
|
-
if (!("seasonId" in value) || value["seasonId"] === void 0) return false;
|
|
2113
|
-
if (!("seasonStartDate" in value) || value["seasonStartDate"] === void 0) return false;
|
|
2114
|
-
if (!("seasonEndDate" in value) || value["seasonEndDate"] === void 0) return false;
|
|
2115
|
-
if (!("regularSeasonStartDate" in value) || value["regularSeasonStartDate"] === void 0) return false;
|
|
2116
|
-
if (!("regularSeasonEndDate" in value) || value["regularSeasonEndDate"] === void 0) return false;
|
|
2117
|
-
return true;
|
|
2118
|
-
}
|
|
2119
|
-
function SeasonFromJSON(json) {
|
|
2120
|
-
return SeasonFromJSONTyped(json, false);
|
|
2121
|
-
}
|
|
2122
|
-
function SeasonFromJSONTyped(json, ignoreDiscriminator) {
|
|
2123
|
-
if (json == null) {
|
|
2124
|
-
return json;
|
|
2125
|
-
}
|
|
2126
|
-
return {
|
|
2127
|
-
"seasonId": json["seasonId"],
|
|
2128
|
-
"hasWildcard": json["hasWildcard"] == null ? void 0 : json["hasWildcard"],
|
|
2129
|
-
"preSeasonStartDate": json["preSeasonStartDate"] == null ? void 0 : json["preSeasonStartDate"],
|
|
2130
|
-
"preSeasonEndDate": json["preSeasonEndDate"] == null ? void 0 : json["preSeasonEndDate"],
|
|
2131
|
-
"seasonStartDate": json["seasonStartDate"],
|
|
2132
|
-
"seasonEndDate": json["seasonEndDate"],
|
|
2133
|
-
"springStartDate": json["springStartDate"] == null ? void 0 : json["springStartDate"],
|
|
2134
|
-
"springEndDate": json["springEndDate"] == null ? void 0 : json["springEndDate"],
|
|
2135
|
-
"regularSeasonStartDate": json["regularSeasonStartDate"],
|
|
2136
|
-
"lastDate1stHalf": json["lastDate1stHalf"] == null ? void 0 : json["lastDate1stHalf"],
|
|
2137
|
-
"allStartDate": json["allStartDate"] == null ? void 0 : json["allStartDate"],
|
|
2138
|
-
"firstDate2ndHalf": json["firstDate2ndHalf"] == null ? void 0 : json["firstDate2ndHalf"],
|
|
2139
|
-
"regularSeasonEndDate": json["regularSeasonEndDate"],
|
|
2140
|
-
"postSeasonStartDate": json["postSeasonStartDate"] == null ? void 0 : json["postSeasonStartDate"],
|
|
2141
|
-
"postSeasonEndDate": json["postSeasonEndDate"] == null ? void 0 : json["postSeasonEndDate"],
|
|
2142
|
-
"offSeasonStartDate": json["offSeasonStartDate"] == null ? void 0 : json["offSeasonStartDate"],
|
|
2143
|
-
"offSeasonEndDate": json["offSeasonEndDate"] == null ? void 0 : json["offSeasonEndDate"],
|
|
2144
|
-
"seasonLevelGamedayType": json["seasonLevelGamedayType"] == null ? void 0 : json["seasonLevelGamedayType"],
|
|
2145
|
-
"gameLevelGamedayType": json["gameLevelGamedayType"] == null ? void 0 : json["gameLevelGamedayType"],
|
|
2146
|
-
"qualifierPlateAppearances": json["qualifierPlateAppearances"] == null ? void 0 : json["qualifierPlateAppearances"],
|
|
2147
|
-
"qualifierOutsPitched": json["qualifierOutsPitched"] == null ? void 0 : json["qualifierOutsPitched"]
|
|
2148
|
-
};
|
|
2149
|
-
}
|
|
2150
|
-
function SeasonToJSON(json) {
|
|
2151
|
-
return SeasonToJSONTyped(json, false);
|
|
2152
|
-
}
|
|
2153
|
-
function SeasonToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2154
|
-
if (value == null) {
|
|
2155
|
-
return value;
|
|
2156
|
-
}
|
|
2157
|
-
return {
|
|
2158
|
-
"seasonId": value["seasonId"],
|
|
2159
|
-
"hasWildcard": value["hasWildcard"],
|
|
2160
|
-
"preSeasonStartDate": value["preSeasonStartDate"],
|
|
2161
|
-
"preSeasonEndDate": value["preSeasonEndDate"],
|
|
2162
|
-
"seasonStartDate": value["seasonStartDate"],
|
|
2163
|
-
"seasonEndDate": value["seasonEndDate"],
|
|
2164
|
-
"springStartDate": value["springStartDate"],
|
|
2165
|
-
"springEndDate": value["springEndDate"],
|
|
2166
|
-
"regularSeasonStartDate": value["regularSeasonStartDate"],
|
|
2167
|
-
"lastDate1stHalf": value["lastDate1stHalf"],
|
|
2168
|
-
"allStartDate": value["allStartDate"],
|
|
2169
|
-
"firstDate2ndHalf": value["firstDate2ndHalf"],
|
|
2170
|
-
"regularSeasonEndDate": value["regularSeasonEndDate"],
|
|
2171
|
-
"postSeasonStartDate": value["postSeasonStartDate"],
|
|
2172
|
-
"postSeasonEndDate": value["postSeasonEndDate"],
|
|
2173
|
-
"offSeasonStartDate": value["offSeasonStartDate"],
|
|
2174
|
-
"offSeasonEndDate": value["offSeasonEndDate"],
|
|
2175
|
-
"seasonLevelGamedayType": value["seasonLevelGamedayType"],
|
|
2176
|
-
"gameLevelGamedayType": value["gameLevelGamedayType"],
|
|
2177
|
-
"qualifierPlateAppearances": value["qualifierPlateAppearances"],
|
|
2178
|
-
"qualifierOutsPitched": value["qualifierOutsPitched"]
|
|
2179
|
-
};
|
|
2180
|
-
}
|
|
2181
|
-
|
|
2182
|
-
// src/models/Seasons.ts
|
|
2183
|
-
function instanceOfSeasons(value) {
|
|
2184
|
-
return true;
|
|
2185
|
-
}
|
|
2186
|
-
function SeasonsFromJSON(json) {
|
|
2187
|
-
return SeasonsFromJSONTyped(json, false);
|
|
2188
|
-
}
|
|
2189
|
-
function SeasonsFromJSONTyped(json, ignoreDiscriminator) {
|
|
2190
|
-
if (json == null) {
|
|
2191
|
-
return json;
|
|
2192
|
-
}
|
|
2193
|
-
return {
|
|
2194
|
-
"seasons": json["seasons"] == null ? void 0 : json["seasons"].map(SeasonFromJSON)
|
|
2195
|
-
};
|
|
2196
|
-
}
|
|
2197
|
-
function SeasonsToJSON(json) {
|
|
2198
|
-
return SeasonsToJSONTyped(json, false);
|
|
2199
|
-
}
|
|
2200
|
-
function SeasonsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2201
|
-
if (value == null) {
|
|
2202
|
-
return value;
|
|
2203
|
-
}
|
|
2204
|
-
return {
|
|
2205
|
-
"seasons": value["seasons"] == null ? void 0 : value["seasons"].map(SeasonToJSON)
|
|
2206
|
-
};
|
|
2207
|
-
}
|
|
2208
|
-
|
|
2209
|
-
// src/models/Teams.ts
|
|
2210
|
-
function instanceOfTeams(value) {
|
|
2211
|
-
return true;
|
|
2212
|
-
}
|
|
2213
|
-
function TeamsFromJSON(json) {
|
|
2214
|
-
return TeamsFromJSONTyped(json, false);
|
|
2215
|
-
}
|
|
2216
|
-
function TeamsFromJSONTyped(json, ignoreDiscriminator) {
|
|
2217
|
-
if (json == null) {
|
|
2218
|
-
return json;
|
|
2219
|
-
}
|
|
2220
|
-
return {
|
|
2221
|
-
"teams": json["teams"] == null ? void 0 : json["teams"].map(TeamFromJSON)
|
|
2222
|
-
};
|
|
2223
|
-
}
|
|
2224
|
-
function TeamsToJSON(json) {
|
|
2225
|
-
return TeamsToJSONTyped(json, false);
|
|
2226
|
-
}
|
|
2227
|
-
function TeamsToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2228
|
-
if (value == null) {
|
|
2229
|
-
return value;
|
|
2230
|
-
}
|
|
2231
|
-
return {
|
|
2232
|
-
"teams": value["teams"] == null ? void 0 : value["teams"].map(TeamToJSON)
|
|
2233
|
-
};
|
|
2234
|
-
}
|
|
2235
|
-
|
|
2236
|
-
// src/apis/MlbApi.ts
|
|
2237
|
-
var MlbApi = class extends BaseAPI {
|
|
2238
|
-
/**
|
|
2239
|
-
* Returns All Seasons
|
|
2240
|
-
* Retrieves All Seasons over time
|
|
2241
|
-
*/
|
|
2242
|
-
getAllSeasonsRaw(requestParameters, initOverrides) {
|
|
2243
|
-
return __async(this, null, function* () {
|
|
2244
|
-
if (requestParameters["sportId"] == null) {
|
|
2245
|
-
throw new RequiredError(
|
|
2246
|
-
"sportId",
|
|
2247
|
-
'Required parameter "sportId" was null or undefined when calling getAllSeasons().'
|
|
2248
|
-
);
|
|
2249
|
-
}
|
|
2250
|
-
const queryParameters = {};
|
|
2251
|
-
if (requestParameters["sportId"] != null) {
|
|
2252
|
-
queryParameters["sportId"] = requestParameters["sportId"];
|
|
2253
|
-
}
|
|
2254
|
-
const headerParameters = {};
|
|
2255
|
-
const response = yield this.request({
|
|
2256
|
-
path: `/v1/seasons/all`,
|
|
2257
|
-
method: "GET",
|
|
2258
|
-
headers: headerParameters,
|
|
2259
|
-
query: queryParameters
|
|
2260
|
-
}, initOverrides);
|
|
2261
|
-
return new JSONApiResponse(response, (jsonValue) => SeasonsFromJSON(jsonValue));
|
|
2262
|
-
});
|
|
2263
|
-
}
|
|
2264
|
-
/**
|
|
2265
|
-
* Returns All Seasons
|
|
2266
|
-
* Retrieves All Seasons over time
|
|
2267
|
-
*/
|
|
2268
|
-
getAllSeasons(requestParameters, initOverrides) {
|
|
2269
|
-
return __async(this, null, function* () {
|
|
2270
|
-
const response = yield this.getAllSeasonsRaw(requestParameters, initOverrides);
|
|
2271
|
-
return yield response.value();
|
|
2272
|
-
});
|
|
2273
|
-
}
|
|
2274
|
-
/**
|
|
2275
|
-
* Returns Boxscore
|
|
2276
|
-
* Retrieves boxscore
|
|
2277
|
-
*/
|
|
2278
|
-
getBoxscoreRaw(requestParameters, initOverrides) {
|
|
2279
|
-
return __async(this, null, function* () {
|
|
2280
|
-
if (requestParameters["gamePk"] == null) {
|
|
2281
|
-
throw new RequiredError(
|
|
2282
|
-
"gamePk",
|
|
2283
|
-
'Required parameter "gamePk" was null or undefined when calling getBoxscore().'
|
|
2284
|
-
);
|
|
2285
|
-
}
|
|
2286
|
-
const queryParameters = {};
|
|
2287
|
-
if (requestParameters["fields"] != null) {
|
|
2288
|
-
queryParameters["fields"] = requestParameters["fields"].join(COLLECTION_FORMATS["csv"]);
|
|
2289
|
-
}
|
|
2290
|
-
const headerParameters = {};
|
|
2291
|
-
const response = yield this.request({
|
|
2292
|
-
path: `/v1/game/{gamePk}/boxscore`.replace(`{${"gamePk"}}`, encodeURIComponent(String(requestParameters["gamePk"]))),
|
|
2293
|
-
method: "GET",
|
|
2294
|
-
headers: headerParameters,
|
|
2295
|
-
query: queryParameters
|
|
2296
|
-
}, initOverrides);
|
|
2297
|
-
return new JSONApiResponse(response, (jsonValue) => BoxscoreFromJSON(jsonValue));
|
|
2298
|
-
});
|
|
2299
|
-
}
|
|
2300
|
-
/**
|
|
2301
|
-
* Returns Boxscore
|
|
2302
|
-
* Retrieves boxscore
|
|
2303
|
-
*/
|
|
2304
|
-
getBoxscore(requestParameters, initOverrides) {
|
|
2305
|
-
return __async(this, null, function* () {
|
|
2306
|
-
const response = yield this.getBoxscoreRaw(requestParameters, initOverrides);
|
|
2307
|
-
return yield response.value();
|
|
2308
|
-
});
|
|
2309
|
-
}
|
|
2310
|
-
/**
|
|
2311
|
-
* Returns Linescore
|
|
2312
|
-
* Retrieves linescore
|
|
2313
|
-
*/
|
|
2314
|
-
getLinescoreRaw(requestParameters, initOverrides) {
|
|
2315
|
-
return __async(this, null, function* () {
|
|
2316
|
-
if (requestParameters["gamePk"] == null) {
|
|
2317
|
-
throw new RequiredError(
|
|
2318
|
-
"gamePk",
|
|
2319
|
-
'Required parameter "gamePk" was null or undefined when calling getLinescore().'
|
|
2320
|
-
);
|
|
2321
|
-
}
|
|
2322
|
-
const queryParameters = {};
|
|
2323
|
-
if (requestParameters["fields"] != null) {
|
|
2324
|
-
queryParameters["fields"] = requestParameters["fields"].join(COLLECTION_FORMATS["csv"]);
|
|
2325
|
-
}
|
|
2326
|
-
const headerParameters = {};
|
|
2327
|
-
const response = yield this.request({
|
|
2328
|
-
path: `/v1/game/{gamePk}/linescore`.replace(`{${"gamePk"}}`, encodeURIComponent(String(requestParameters["gamePk"]))),
|
|
2329
|
-
method: "GET",
|
|
2330
|
-
headers: headerParameters,
|
|
2331
|
-
query: queryParameters
|
|
2332
|
-
}, initOverrides);
|
|
2333
|
-
return new JSONApiResponse(response, (jsonValue) => LinescoreFromJSON(jsonValue));
|
|
2334
|
-
});
|
|
2335
|
-
}
|
|
2336
|
-
/**
|
|
2337
|
-
* Returns Linescore
|
|
2338
|
-
* Retrieves linescore
|
|
2339
|
-
*/
|
|
2340
|
-
getLinescore(requestParameters, initOverrides) {
|
|
2341
|
-
return __async(this, null, function* () {
|
|
2342
|
-
const response = yield this.getLinescoreRaw(requestParameters, initOverrides);
|
|
2343
|
-
return yield response.value();
|
|
2344
|
-
});
|
|
2345
|
-
}
|
|
2346
|
-
/**
|
|
2347
|
-
* Returns Schedule
|
|
2348
|
-
* Retrieves schedule
|
|
2349
|
-
*/
|
|
2350
|
-
getScheduleRaw(requestParameters, initOverrides) {
|
|
2351
|
-
return __async(this, null, function* () {
|
|
2352
|
-
if (requestParameters["sportId"] == null) {
|
|
2353
|
-
throw new RequiredError(
|
|
2354
|
-
"sportId",
|
|
2355
|
-
'Required parameter "sportId" was null or undefined when calling getSchedule().'
|
|
2356
|
-
);
|
|
2357
|
-
}
|
|
2358
|
-
const queryParameters = {};
|
|
2359
|
-
if (requestParameters["sportId"] != null) {
|
|
2360
|
-
queryParameters["sportId"] = requestParameters["sportId"];
|
|
2361
|
-
}
|
|
2362
|
-
if (requestParameters["teamId"] != null) {
|
|
2363
|
-
queryParameters["teamId"] = requestParameters["teamId"];
|
|
2364
|
-
}
|
|
2365
|
-
if (requestParameters["gameTypes"] != null) {
|
|
2366
|
-
queryParameters["gameTypes"] = requestParameters["gameTypes"];
|
|
2367
|
-
}
|
|
2368
|
-
if (requestParameters["startDate"] != null) {
|
|
2369
|
-
queryParameters["startDate"] = requestParameters["startDate"];
|
|
2370
|
-
}
|
|
2371
|
-
if (requestParameters["endDate"] != null) {
|
|
2372
|
-
queryParameters["endDate"] = requestParameters["endDate"];
|
|
2373
|
-
}
|
|
2374
|
-
if (requestParameters["fields"] != null) {
|
|
2375
|
-
queryParameters["fields"] = requestParameters["fields"].join(COLLECTION_FORMATS["csv"]);
|
|
2376
|
-
}
|
|
2377
|
-
if (requestParameters["hydrate"] != null) {
|
|
2378
|
-
queryParameters["hydrate"] = requestParameters["hydrate"];
|
|
2379
|
-
}
|
|
2380
|
-
if (requestParameters["leagueIds"] != null) {
|
|
2381
|
-
queryParameters["leagueIds"] = requestParameters["leagueIds"];
|
|
2382
|
-
}
|
|
2383
|
-
const headerParameters = {};
|
|
2384
|
-
const response = yield this.request({
|
|
2385
|
-
path: `/v1/schedule`,
|
|
2386
|
-
method: "GET",
|
|
2387
|
-
headers: headerParameters,
|
|
2388
|
-
query: queryParameters
|
|
2389
|
-
}, initOverrides);
|
|
2390
|
-
return new JSONApiResponse(response, (jsonValue) => ScheduleFromJSON(jsonValue));
|
|
2391
|
-
});
|
|
2392
|
-
}
|
|
2393
|
-
/**
|
|
2394
|
-
* Returns Schedule
|
|
2395
|
-
* Retrieves schedule
|
|
2396
|
-
*/
|
|
2397
|
-
getSchedule(requestParameters, initOverrides) {
|
|
2398
|
-
return __async(this, null, function* () {
|
|
2399
|
-
const response = yield this.getScheduleRaw(requestParameters, initOverrides);
|
|
2400
|
-
return yield response.value();
|
|
2401
|
-
});
|
|
2402
|
-
}
|
|
2403
|
-
/**
|
|
2404
|
-
* Returns Season
|
|
2405
|
-
* Retrieves season
|
|
2406
|
-
*/
|
|
2407
|
-
getSeasonRaw(requestParameters, initOverrides) {
|
|
2408
|
-
return __async(this, null, function* () {
|
|
2409
|
-
if (requestParameters["sportId"] == null) {
|
|
2410
|
-
throw new RequiredError(
|
|
2411
|
-
"sportId",
|
|
2412
|
-
'Required parameter "sportId" was null or undefined when calling getSeason().'
|
|
2413
|
-
);
|
|
2414
|
-
}
|
|
2415
|
-
if (requestParameters["season"] == null) {
|
|
2416
|
-
throw new RequiredError(
|
|
2417
|
-
"season",
|
|
2418
|
-
'Required parameter "season" was null or undefined when calling getSeason().'
|
|
2419
|
-
);
|
|
2420
|
-
}
|
|
2421
|
-
const queryParameters = {};
|
|
2422
|
-
if (requestParameters["sportId"] != null) {
|
|
2423
|
-
queryParameters["sportId"] = requestParameters["sportId"];
|
|
2424
|
-
}
|
|
2425
|
-
if (requestParameters["season"] != null) {
|
|
2426
|
-
queryParameters["season"] = requestParameters["season"];
|
|
2427
|
-
}
|
|
2428
|
-
const headerParameters = {};
|
|
2429
|
-
const response = yield this.request({
|
|
2430
|
-
path: `/v1/seasons`,
|
|
2431
|
-
method: "GET",
|
|
2432
|
-
headers: headerParameters,
|
|
2433
|
-
query: queryParameters
|
|
2434
|
-
}, initOverrides);
|
|
2435
|
-
return new JSONApiResponse(response, (jsonValue) => SeasonsFromJSON(jsonValue));
|
|
2436
|
-
});
|
|
2437
|
-
}
|
|
2438
|
-
/**
|
|
2439
|
-
* Returns Season
|
|
2440
|
-
* Retrieves season
|
|
2441
|
-
*/
|
|
2442
|
-
getSeason(requestParameters, initOverrides) {
|
|
2443
|
-
return __async(this, null, function* () {
|
|
2444
|
-
const response = yield this.getSeasonRaw(requestParameters, initOverrides);
|
|
2445
|
-
return yield response.value();
|
|
2446
|
-
});
|
|
2447
|
-
}
|
|
2448
|
-
/**
|
|
2449
|
-
* Returns Standing
|
|
2450
|
-
* Retrieves Standings
|
|
2451
|
-
*/
|
|
2452
|
-
getStandingsRaw(requestParameters, initOverrides) {
|
|
2453
|
-
return __async(this, null, function* () {
|
|
2454
|
-
if (requestParameters["leagueId"] == null) {
|
|
2455
|
-
throw new RequiredError(
|
|
2456
|
-
"leagueId",
|
|
2457
|
-
'Required parameter "leagueId" was null or undefined when calling getStandings().'
|
|
2458
|
-
);
|
|
2459
|
-
}
|
|
2460
|
-
if (requestParameters["season"] == null) {
|
|
2461
|
-
throw new RequiredError(
|
|
2462
|
-
"season",
|
|
2463
|
-
'Required parameter "season" was null or undefined when calling getStandings().'
|
|
2464
|
-
);
|
|
2465
|
-
}
|
|
2466
|
-
const queryParameters = {};
|
|
2467
|
-
if (requestParameters["leagueId"] != null) {
|
|
2468
|
-
queryParameters["leagueId"] = requestParameters["leagueId"];
|
|
2469
|
-
}
|
|
2470
|
-
if (requestParameters["season"] != null) {
|
|
2471
|
-
queryParameters["season"] = requestParameters["season"];
|
|
2472
|
-
}
|
|
2473
|
-
if (requestParameters["date"] != null) {
|
|
2474
|
-
queryParameters["date"] = requestParameters["date"];
|
|
2475
|
-
}
|
|
2476
|
-
if (requestParameters["fields"] != null) {
|
|
2477
|
-
queryParameters["fields"] = requestParameters["fields"].join(COLLECTION_FORMATS["csv"]);
|
|
2478
|
-
}
|
|
2479
|
-
if (requestParameters["hydrate"] != null) {
|
|
2480
|
-
queryParameters["hydrate"] = requestParameters["hydrate"];
|
|
2481
|
-
}
|
|
2482
|
-
const headerParameters = {};
|
|
2483
|
-
const response = yield this.request({
|
|
2484
|
-
path: `/v1/standings`,
|
|
2485
|
-
method: "GET",
|
|
2486
|
-
headers: headerParameters,
|
|
2487
|
-
query: queryParameters
|
|
2488
|
-
}, initOverrides);
|
|
2489
|
-
return new JSONApiResponse(response, (jsonValue) => DivisionStandingsListFromJSON(jsonValue));
|
|
2490
|
-
});
|
|
2491
|
-
}
|
|
2492
|
-
/**
|
|
2493
|
-
* Returns Standing
|
|
2494
|
-
* Retrieves Standings
|
|
2495
|
-
*/
|
|
2496
|
-
getStandings(requestParameters, initOverrides) {
|
|
2497
|
-
return __async(this, null, function* () {
|
|
2498
|
-
const response = yield this.getStandingsRaw(requestParameters, initOverrides);
|
|
2499
|
-
return yield response.value();
|
|
2500
|
-
});
|
|
2501
|
-
}
|
|
2502
|
-
/**
|
|
2503
|
-
* Returns Teams
|
|
2504
|
-
* Retrieves Teams
|
|
2505
|
-
*/
|
|
2506
|
-
getTeamsRaw(requestParameters, initOverrides) {
|
|
2507
|
-
return __async(this, null, function* () {
|
|
2508
|
-
if (requestParameters["sportId"] == null) {
|
|
2509
|
-
throw new RequiredError(
|
|
2510
|
-
"sportId",
|
|
2511
|
-
'Required parameter "sportId" was null or undefined when calling getTeams().'
|
|
2512
|
-
);
|
|
2513
|
-
}
|
|
2514
|
-
if (requestParameters["season"] == null) {
|
|
2515
|
-
throw new RequiredError(
|
|
2516
|
-
"season",
|
|
2517
|
-
'Required parameter "season" was null or undefined when calling getTeams().'
|
|
2518
|
-
);
|
|
2519
|
-
}
|
|
2520
|
-
const queryParameters = {};
|
|
2521
|
-
if (requestParameters["sportId"] != null) {
|
|
2522
|
-
queryParameters["sportId"] = requestParameters["sportId"];
|
|
2523
|
-
}
|
|
2524
|
-
if (requestParameters["season"] != null) {
|
|
2525
|
-
queryParameters["season"] = requestParameters["season"];
|
|
2526
|
-
}
|
|
2527
|
-
if (requestParameters["leagueIds"] != null) {
|
|
2528
|
-
queryParameters["leagueIds"] = requestParameters["leagueIds"];
|
|
2529
|
-
}
|
|
2530
|
-
const headerParameters = {};
|
|
2531
|
-
const response = yield this.request({
|
|
2532
|
-
path: `/v1/teams`,
|
|
2533
|
-
method: "GET",
|
|
2534
|
-
headers: headerParameters,
|
|
2535
|
-
query: queryParameters
|
|
2536
|
-
}, initOverrides);
|
|
2537
|
-
return new JSONApiResponse(response, (jsonValue) => TeamsFromJSON(jsonValue));
|
|
2538
|
-
});
|
|
2539
|
-
}
|
|
2540
|
-
/**
|
|
2541
|
-
* Returns Teams
|
|
2542
|
-
* Retrieves Teams
|
|
2543
|
-
*/
|
|
2544
|
-
getTeams(requestParameters, initOverrides) {
|
|
2545
|
-
return __async(this, null, function* () {
|
|
2546
|
-
const response = yield this.getTeamsRaw(requestParameters, initOverrides);
|
|
2547
|
-
return yield response.value();
|
|
2548
|
-
});
|
|
2549
|
-
}
|
|
2550
|
-
};
|
|
2551
|
-
export {
|
|
2552
|
-
BASE_PATH,
|
|
2553
|
-
BaseAPI,
|
|
2554
|
-
BattingStatsFromJSON,
|
|
2555
|
-
BattingStatsFromJSONTyped,
|
|
2556
|
-
BattingStatsToJSON,
|
|
2557
|
-
BattingStatsToJSONTyped,
|
|
2558
|
-
BlobApiResponse,
|
|
2559
|
-
BoxscoreFromJSON,
|
|
2560
|
-
BoxscoreFromJSONTyped,
|
|
2561
|
-
BoxscoreTeamFromJSON,
|
|
2562
|
-
BoxscoreTeamFromJSONTyped,
|
|
2563
|
-
BoxscoreTeamToJSON,
|
|
2564
|
-
BoxscoreTeamToJSONTyped,
|
|
2565
|
-
BoxscoreTeamsFromJSON,
|
|
2566
|
-
BoxscoreTeamsFromJSONTyped,
|
|
2567
|
-
BoxscoreTeamsToJSON,
|
|
2568
|
-
BoxscoreTeamsToJSONTyped,
|
|
2569
|
-
BoxscoreToJSON,
|
|
2570
|
-
BoxscoreToJSONTyped,
|
|
2571
|
-
COLLECTION_FORMATS,
|
|
2572
|
-
Configuration,
|
|
2573
|
-
DefaultConfig,
|
|
2574
|
-
DivisionFromJSON,
|
|
2575
|
-
DivisionFromJSONTyped,
|
|
2576
|
-
DivisionStandingsFromJSON,
|
|
2577
|
-
DivisionStandingsFromJSONTyped,
|
|
2578
|
-
DivisionStandingsListFromJSON,
|
|
2579
|
-
DivisionStandingsListFromJSONTyped,
|
|
2580
|
-
DivisionStandingsListToJSON,
|
|
2581
|
-
DivisionStandingsListToJSONTyped,
|
|
2582
|
-
DivisionStandingsToJSON,
|
|
2583
|
-
DivisionStandingsToJSONTyped,
|
|
2584
|
-
DivisionToJSON,
|
|
2585
|
-
DivisionToJSONTyped,
|
|
2586
|
-
FetchError,
|
|
2587
|
-
FieldingStatsFromJSON,
|
|
2588
|
-
FieldingStatsFromJSONTyped,
|
|
2589
|
-
FieldingStatsToJSON,
|
|
2590
|
-
FieldingStatsToJSONTyped,
|
|
2591
|
-
GameFromJSON,
|
|
2592
|
-
GameFromJSONTyped,
|
|
2593
|
-
GameOfficialFromJSON,
|
|
2594
|
-
GameOfficialFromJSONTyped,
|
|
2595
|
-
GameOfficialToJSON,
|
|
2596
|
-
GameOfficialToJSONTyped,
|
|
2597
|
-
GameStatusCode,
|
|
2598
|
-
GameStatusCodeFromJSON,
|
|
2599
|
-
GameStatusCodeFromJSONTyped,
|
|
2600
|
-
GameStatusCodeToJSON,
|
|
2601
|
-
GameStatusCodeToJSONTyped,
|
|
2602
|
-
GameStatusFromJSON,
|
|
2603
|
-
GameStatusFromJSONTyped,
|
|
2604
|
-
GameStatusToJSON,
|
|
2605
|
-
GameStatusToJSONTyped,
|
|
2606
|
-
GameTeamFromJSON,
|
|
2607
|
-
GameTeamFromJSONTyped,
|
|
2608
|
-
GameTeamToJSON,
|
|
2609
|
-
GameTeamToJSONTyped,
|
|
2610
|
-
GameTeamsFromJSON,
|
|
2611
|
-
GameTeamsFromJSONTyped,
|
|
2612
|
-
GameTeamsToJSON,
|
|
2613
|
-
GameTeamsToJSONTyped,
|
|
2614
|
-
GameToJSON,
|
|
2615
|
-
GameToJSONTyped,
|
|
2616
|
-
GameType,
|
|
2617
|
-
GameTypeFromJSON,
|
|
2618
|
-
GameTypeFromJSONTyped,
|
|
2619
|
-
GameTypeToJSON,
|
|
2620
|
-
GameTypeToJSONTyped,
|
|
2621
|
-
InningFromJSON,
|
|
2622
|
-
InningFromJSONTyped,
|
|
2623
|
-
InningToJSON,
|
|
2624
|
-
InningToJSONTyped,
|
|
2625
|
-
JSONApiResponse,
|
|
2626
|
-
LeagueDatesFromJSON,
|
|
2627
|
-
LeagueDatesFromJSONTyped,
|
|
2628
|
-
LeagueDatesToJSON,
|
|
2629
|
-
LeagueDatesToJSONTyped,
|
|
2630
|
-
LeagueFromJSON,
|
|
2631
|
-
LeagueFromJSONTyped,
|
|
2632
|
-
LeagueRecordFromJSON,
|
|
2633
|
-
LeagueRecordFromJSONTyped,
|
|
2634
|
-
LeagueRecordToJSON,
|
|
2635
|
-
LeagueRecordToJSONTyped,
|
|
2636
|
-
LeagueToJSON,
|
|
2637
|
-
LeagueToJSONTyped,
|
|
2638
|
-
LinescoreFromJSON,
|
|
2639
|
-
LinescoreFromJSONTyped,
|
|
2640
|
-
LinescoreTeamFromJSON,
|
|
2641
|
-
LinescoreTeamFromJSONTyped,
|
|
2642
|
-
LinescoreTeamToJSON,
|
|
2643
|
-
LinescoreTeamToJSONTyped,
|
|
2644
|
-
LinescoreTeamsFromJSON,
|
|
2645
|
-
LinescoreTeamsFromJSONTyped,
|
|
2646
|
-
LinescoreTeamsToJSON,
|
|
2647
|
-
LinescoreTeamsToJSONTyped,
|
|
2648
|
-
LinescoreToJSON,
|
|
2649
|
-
LinescoreToJSONTyped,
|
|
2650
|
-
MlbApi,
|
|
2651
|
-
OfficialFromJSON,
|
|
2652
|
-
OfficialFromJSONTyped,
|
|
2653
|
-
OfficialToJSON,
|
|
2654
|
-
OfficialToJSONTyped,
|
|
2655
|
-
PitchingStatsFromJSON,
|
|
2656
|
-
PitchingStatsFromJSONTyped,
|
|
2657
|
-
PitchingStatsToJSON,
|
|
2658
|
-
PitchingStatsToJSONTyped,
|
|
2659
|
-
PlayerFromJSON,
|
|
2660
|
-
PlayerFromJSONTyped,
|
|
2661
|
-
PlayerGameStatusFromJSON,
|
|
2662
|
-
PlayerGameStatusFromJSONTyped,
|
|
2663
|
-
PlayerGameStatusToJSON,
|
|
2664
|
-
PlayerGameStatusToJSONTyped,
|
|
2665
|
-
PlayerPersonFromJSON,
|
|
2666
|
-
PlayerPersonFromJSONTyped,
|
|
2667
|
-
PlayerPersonToJSON,
|
|
2668
|
-
PlayerPersonToJSONTyped,
|
|
2669
|
-
PlayerPositionFromJSON,
|
|
2670
|
-
PlayerPositionFromJSONTyped,
|
|
2671
|
-
PlayerPositionToJSON,
|
|
2672
|
-
PlayerPositionToJSONTyped,
|
|
2673
|
-
PlayerSeasonStatsFromJSON,
|
|
2674
|
-
PlayerSeasonStatsFromJSONTyped,
|
|
2675
|
-
PlayerSeasonStatsToJSON,
|
|
2676
|
-
PlayerSeasonStatsToJSONTyped,
|
|
2677
|
-
PlayerStatsFromJSON,
|
|
2678
|
-
PlayerStatsFromJSONTyped,
|
|
2679
|
-
PlayerStatsToJSON,
|
|
2680
|
-
PlayerStatsToJSONTyped,
|
|
2681
|
-
PlayerStatusFromJSON,
|
|
2682
|
-
PlayerStatusFromJSONTyped,
|
|
2683
|
-
PlayerStatusToJSON,
|
|
2684
|
-
PlayerStatusToJSONTyped,
|
|
2685
|
-
PlayerToJSON,
|
|
2686
|
-
PlayerToJSONTyped,
|
|
2687
|
-
PositionFromJSON,
|
|
2688
|
-
PositionFromJSONTyped,
|
|
2689
|
-
PositionToJSON,
|
|
2690
|
-
PositionToJSONTyped,
|
|
2691
|
-
RecordFromJSON,
|
|
2692
|
-
RecordFromJSONTyped,
|
|
2693
|
-
RecordToJSON,
|
|
2694
|
-
RecordToJSONTyped,
|
|
2695
|
-
RequiredError,
|
|
2696
|
-
ResponseError,
|
|
2697
|
-
ScheduleDayFromJSON,
|
|
2698
|
-
ScheduleDayFromJSONTyped,
|
|
2699
|
-
ScheduleDayToJSON,
|
|
2700
|
-
ScheduleDayToJSONTyped,
|
|
2701
|
-
ScheduleFromJSON,
|
|
2702
|
-
ScheduleFromJSONTyped,
|
|
2703
|
-
ScheduleToJSON,
|
|
2704
|
-
ScheduleToJSONTyped,
|
|
2705
|
-
SeasonFromJSON,
|
|
2706
|
-
SeasonFromJSONTyped,
|
|
2707
|
-
SeasonToJSON,
|
|
2708
|
-
SeasonToJSONTyped,
|
|
2709
|
-
SeasonsFromJSON,
|
|
2710
|
-
SeasonsFromJSONTyped,
|
|
2711
|
-
SeasonsToJSON,
|
|
2712
|
-
SeasonsToJSONTyped,
|
|
2713
|
-
SportFromJSON,
|
|
2714
|
-
SportFromJSONTyped,
|
|
2715
|
-
SportToJSON,
|
|
2716
|
-
SportToJSONTyped,
|
|
2717
|
-
StreakFromJSON,
|
|
2718
|
-
StreakFromJSONTyped,
|
|
2719
|
-
StreakStreakTypeEnum,
|
|
2720
|
-
StreakToJSON,
|
|
2721
|
-
StreakToJSONTyped,
|
|
2722
|
-
TeamFromJSON,
|
|
2723
|
-
TeamFromJSONTyped2 as TeamFromJSONTyped,
|
|
2724
|
-
TeamStatsFromJSON,
|
|
2725
|
-
TeamStatsFromJSONTyped,
|
|
2726
|
-
TeamStatsToJSON,
|
|
2727
|
-
TeamStatsToJSONTyped,
|
|
2728
|
-
TeamToJSON,
|
|
2729
|
-
TeamToJSONTyped2 as TeamToJSONTyped,
|
|
2730
|
-
TeamsFromJSON,
|
|
2731
|
-
TeamsFromJSONTyped,
|
|
2732
|
-
TeamsToJSON,
|
|
2733
|
-
TeamsToJSONTyped,
|
|
2734
|
-
TextApiResponse,
|
|
2735
|
-
VenueFromJSON,
|
|
2736
|
-
VenueFromJSONTyped,
|
|
2737
|
-
VenueToJSON,
|
|
2738
|
-
VenueToJSONTyped,
|
|
2739
|
-
VoidApiResponse,
|
|
2740
|
-
canConsumeForm,
|
|
2741
|
-
exists,
|
|
2742
|
-
instanceOfBattingStats,
|
|
2743
|
-
instanceOfBoxscore,
|
|
2744
|
-
instanceOfBoxscoreTeam,
|
|
2745
|
-
instanceOfBoxscoreTeams,
|
|
2746
|
-
instanceOfDivision,
|
|
2747
|
-
instanceOfDivisionStandings,
|
|
2748
|
-
instanceOfDivisionStandingsList,
|
|
2749
|
-
instanceOfFieldingStats,
|
|
2750
|
-
instanceOfGame,
|
|
2751
|
-
instanceOfGameOfficial,
|
|
2752
|
-
instanceOfGameStatus,
|
|
2753
|
-
instanceOfGameStatusCode,
|
|
2754
|
-
instanceOfGameTeam,
|
|
2755
|
-
instanceOfGameTeams,
|
|
2756
|
-
instanceOfGameType,
|
|
2757
|
-
instanceOfInning,
|
|
2758
|
-
instanceOfLeague,
|
|
2759
|
-
instanceOfLeagueDates,
|
|
2760
|
-
instanceOfLeagueRecord,
|
|
2761
|
-
instanceOfLinescore,
|
|
2762
|
-
instanceOfLinescoreTeam,
|
|
2763
|
-
instanceOfLinescoreTeams,
|
|
2764
|
-
instanceOfOfficial,
|
|
2765
|
-
instanceOfPitchingStats,
|
|
2766
|
-
instanceOfPlayer,
|
|
2767
|
-
instanceOfPlayerGameStatus,
|
|
2768
|
-
instanceOfPlayerPerson,
|
|
2769
|
-
instanceOfPlayerPosition,
|
|
2770
|
-
instanceOfPlayerSeasonStats,
|
|
2771
|
-
instanceOfPlayerStats,
|
|
2772
|
-
instanceOfPlayerStatus,
|
|
2773
|
-
instanceOfPosition,
|
|
2774
|
-
instanceOfRecord,
|
|
2775
|
-
instanceOfSchedule,
|
|
2776
|
-
instanceOfScheduleDay,
|
|
2777
|
-
instanceOfSeason,
|
|
2778
|
-
instanceOfSeasons,
|
|
2779
|
-
instanceOfSport,
|
|
2780
|
-
instanceOfStreak,
|
|
2781
|
-
instanceOfTeam,
|
|
2782
|
-
instanceOfTeamStats,
|
|
2783
|
-
instanceOfTeams,
|
|
2784
|
-
instanceOfVenue,
|
|
2785
|
-
mapValues,
|
|
2786
|
-
querystring
|
|
2787
|
-
};
|