@bp1222/stats-api 0.2.4 → 0.2.5

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.mjs CHANGED
@@ -335,6 +335,66 @@ var TextApiResponse = class {
335
335
  }
336
336
  };
337
337
 
338
+ // src/models/Official.ts
339
+ function instanceOfOfficial(value) {
340
+ return true;
341
+ }
342
+ function OfficialFromJSON(json) {
343
+ return OfficialFromJSONTyped(json, false);
344
+ }
345
+ function OfficialFromJSONTyped(json, ignoreDiscriminator) {
346
+ if (json == null) {
347
+ return json;
348
+ }
349
+ return {
350
+ "id": json["id"] == null ? void 0 : json["id"],
351
+ "fullName": json["fullName"] == null ? void 0 : json["fullName"],
352
+ "link": json["link"] == null ? void 0 : json["link"]
353
+ };
354
+ }
355
+ function OfficialToJSON(json) {
356
+ return OfficialToJSONTyped(json, false);
357
+ }
358
+ function OfficialToJSONTyped(value, ignoreDiscriminator = false) {
359
+ if (value == null) {
360
+ return value;
361
+ }
362
+ return {
363
+ "id": value["id"],
364
+ "fullName": value["fullName"],
365
+ "link": value["link"]
366
+ };
367
+ }
368
+
369
+ // src/models/GameOfficial.ts
370
+ function instanceOfGameOfficial(value) {
371
+ return true;
372
+ }
373
+ function GameOfficialFromJSON(json) {
374
+ return GameOfficialFromJSONTyped(json, false);
375
+ }
376
+ function GameOfficialFromJSONTyped(json, ignoreDiscriminator) {
377
+ if (json == null) {
378
+ return json;
379
+ }
380
+ return {
381
+ "official": json["official"] == null ? void 0 : OfficialFromJSON(json["official"]),
382
+ "officialType": json["officialType"] == null ? void 0 : json["officialType"]
383
+ };
384
+ }
385
+ function GameOfficialToJSON(json) {
386
+ return GameOfficialToJSONTyped(json, false);
387
+ }
388
+ function GameOfficialToJSONTyped(value, ignoreDiscriminator = false) {
389
+ if (value == null) {
390
+ return value;
391
+ }
392
+ return {
393
+ "official": OfficialToJSON(value["official"]),
394
+ "officialType": value["officialType"]
395
+ };
396
+ }
397
+
338
398
  // src/models/LeagueDates.ts
339
399
  function instanceOfLeagueDates(value) {
340
400
  return true;
@@ -359,7 +419,10 @@ function LeagueDatesFromJSONTyped(json, ignoreDiscriminator) {
359
419
  "gameLevelGamedayType": json["gameLevelGamedayType"] == null ? void 0 : json["gameLevelGamedayType"]
360
420
  };
361
421
  }
362
- function LeagueDatesToJSON(value) {
422
+ function LeagueDatesToJSON(json) {
423
+ return LeagueDatesToJSONTyped(json, false);
424
+ }
425
+ function LeagueDatesToJSONTyped(value, ignoreDiscriminator = false) {
363
426
  if (value == null) {
364
427
  return value;
365
428
  }
@@ -409,7 +472,10 @@ function LeagueFromJSONTyped(json, ignoreDiscriminator) {
409
472
  "active": json["active"] == null ? void 0 : json["active"]
410
473
  };
411
474
  }
412
- function LeagueToJSON(value) {
475
+ function LeagueToJSON(json) {
476
+ return LeagueToJSONTyped(json, false);
477
+ }
478
+ function LeagueToJSONTyped(value, ignoreDiscriminator = false) {
413
479
  if (value == null) {
414
480
  return value;
415
481
  }
@@ -455,7 +521,10 @@ function SportFromJSONTyped(json, ignoreDiscriminator) {
455
521
  "activeStatus": json["activeStatus"] == null ? void 0 : json["activeStatus"]
456
522
  };
457
523
  }
458
- function SportToJSON(value) {
524
+ function SportToJSON(json) {
525
+ return SportToJSONTyped(json, false);
526
+ }
527
+ function SportToJSONTyped(value, ignoreDiscriminator = false) {
459
528
  if (value == null) {
460
529
  return value;
461
530
  }
@@ -470,6 +539,43 @@ function SportToJSON(value) {
470
539
  };
471
540
  }
472
541
 
542
+ // src/models/Venue.ts
543
+ function instanceOfVenue(value) {
544
+ if (!("id" in value) || value["id"] === void 0) return false;
545
+ if (!("name" in value) || value["name"] === void 0) return false;
546
+ return true;
547
+ }
548
+ function VenueFromJSON(json) {
549
+ return VenueFromJSONTyped(json, false);
550
+ }
551
+ function VenueFromJSONTyped(json, ignoreDiscriminator) {
552
+ if (json == null) {
553
+ return json;
554
+ }
555
+ return {
556
+ "id": json["id"],
557
+ "name": json["name"],
558
+ "link": json["link"] == null ? void 0 : json["link"],
559
+ "active": json["active"] == null ? void 0 : json["active"],
560
+ "season": json["season"] == null ? void 0 : json["season"]
561
+ };
562
+ }
563
+ function VenueToJSON(json) {
564
+ return VenueToJSONTyped(json, false);
565
+ }
566
+ function VenueToJSONTyped(value, ignoreDiscriminator = false) {
567
+ if (value == null) {
568
+ return value;
569
+ }
570
+ return {
571
+ "id": value["id"],
572
+ "name": value["name"],
573
+ "link": value["link"],
574
+ "active": value["active"],
575
+ "season": value["season"]
576
+ };
577
+ }
578
+
473
579
  // src/models/Division.ts
474
580
  function instanceOfDivision(value) {
475
581
  if (!("id" in value) || value["id"] === void 0) return false;
@@ -498,7 +604,10 @@ function DivisionFromJSONTyped(json, ignoreDiscriminator) {
498
604
  "active": json["active"] == null ? void 0 : json["active"]
499
605
  };
500
606
  }
501
- function DivisionToJSON(value) {
607
+ function DivisionToJSON(json) {
608
+ return DivisionToJSONTyped(json, false);
609
+ }
610
+ function DivisionToJSONTyped(value, ignoreDiscriminator = false) {
502
611
  if (value == null) {
503
612
  return value;
504
613
  }
@@ -519,10 +628,11 @@ function DivisionToJSON(value) {
519
628
  }
520
629
 
521
630
  // src/models/Streak.ts
522
- var StreakStreakTypeEnum = {
523
- Losing: "losses",
524
- Winning: "wins"
525
- };
631
+ var StreakStreakTypeEnum = /* @__PURE__ */ ((StreakStreakTypeEnum2) => {
632
+ StreakStreakTypeEnum2["Losing"] = "losses";
633
+ StreakStreakTypeEnum2["Winning"] = "wins";
634
+ return StreakStreakTypeEnum2;
635
+ })(StreakStreakTypeEnum || {});
526
636
  function instanceOfStreak(value) {
527
637
  return true;
528
638
  }
@@ -537,112 +647,15 @@ function StreakFromJSONTyped(json, ignoreDiscriminator) {
537
647
  "streakType": json["streakType"] == null ? void 0 : json["streakType"]
538
648
  };
539
649
  }
540
- function StreakToJSON(value) {
541
- if (value == null) {
542
- return value;
543
- }
544
- return {
545
- "streakType": value["streakType"]
546
- };
650
+ function StreakToJSON(json) {
651
+ return StreakToJSONTyped(json, false);
547
652
  }
548
-
549
- // src/models/Venue.ts
550
- function instanceOfVenue(value) {
551
- if (!("id" in value) || value["id"] === void 0) return false;
552
- if (!("name" in value) || value["name"] === void 0) return false;
553
- return true;
554
- }
555
- function VenueFromJSON(json) {
556
- return VenueFromJSONTyped(json, false);
557
- }
558
- function VenueFromJSONTyped(json, ignoreDiscriminator) {
559
- if (json == null) {
560
- return json;
561
- }
562
- return {
563
- "id": json["id"],
564
- "name": json["name"],
565
- "link": json["link"] == null ? void 0 : json["link"],
566
- "active": json["active"] == null ? void 0 : json["active"],
567
- "season": json["season"] == null ? void 0 : json["season"]
568
- };
569
- }
570
- function VenueToJSON(value) {
571
- if (value == null) {
572
- return value;
573
- }
574
- return {
575
- "id": value["id"],
576
- "name": value["name"],
577
- "link": value["link"],
578
- "active": value["active"],
579
- "season": value["season"]
580
- };
581
- }
582
-
583
- // src/models/Team.ts
584
- function instanceOfTeam(value) {
585
- if (!("id" in value) || value["id"] === void 0) return false;
586
- if (!("name" in value) || value["name"] === void 0) return false;
587
- return true;
588
- }
589
- function TeamFromJSON(json) {
590
- return TeamFromJSONTyped(json, false);
591
- }
592
- function TeamFromJSONTyped(json, ignoreDiscriminator) {
593
- if (json == null) {
594
- return json;
595
- }
596
- return {
597
- "id": json["id"],
598
- "name": json["name"],
599
- "link": json["link"] == null ? void 0 : json["link"],
600
- "allStarStatus": json["allStarStatus"] == null ? void 0 : json["allStarStatus"],
601
- "season": json["season"] == null ? void 0 : json["season"],
602
- "venue": json["venue"] == null ? void 0 : VenueFromJSON(json["venue"]),
603
- "springVenue": json["springVenue"] == null ? void 0 : VenueFromJSON(json["springVenue"]),
604
- "teamCode": json["teamCode"] == null ? void 0 : json["teamCode"],
605
- "fileCode": json["fileCode"] == null ? void 0 : json["fileCode"],
606
- "abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"],
607
- "teamName": json["teamName"] == null ? void 0 : json["teamName"],
608
- "locationName": json["locationName"] == null ? void 0 : json["locationName"],
609
- "firstYearOfPlay": json["firstYearOfPlay"] == null ? void 0 : json["firstYearOfPlay"],
610
- "league": json["league"] == null ? void 0 : LeagueFromJSON(json["league"]),
611
- "springLeague": json["springLeague"] == null ? void 0 : LeagueFromJSON(json["springLeague"]),
612
- "division": json["division"] == null ? void 0 : DivisionFromJSON(json["division"]),
613
- "sport": json["sport"] == null ? void 0 : SportFromJSON(json["sport"]),
614
- "shortName": json["shortName"] == null ? void 0 : json["shortName"],
615
- "franchiseName": json["franchiseName"] == null ? void 0 : json["franchiseName"],
616
- "clubName": json["clubName"] == null ? void 0 : json["clubName"],
617
- "active": json["active"] == null ? void 0 : json["active"]
618
- };
619
- }
620
- function TeamToJSON(value) {
653
+ function StreakToJSONTyped(value, ignoreDiscriminator = false) {
621
654
  if (value == null) {
622
655
  return value;
623
656
  }
624
657
  return {
625
- "id": value["id"],
626
- "name": value["name"],
627
- "link": value["link"],
628
- "allStarStatus": value["allStarStatus"],
629
- "season": value["season"],
630
- "venue": VenueToJSON(value["venue"]),
631
- "springVenue": VenueToJSON(value["springVenue"]),
632
- "teamCode": value["teamCode"],
633
- "fileCode": value["fileCode"],
634
- "abbreviation": value["abbreviation"],
635
- "teamName": value["teamName"],
636
- "locationName": value["locationName"],
637
- "firstYearOfPlay": value["firstYearOfPlay"],
638
- "league": LeagueToJSON(value["league"]),
639
- "springLeague": LeagueToJSON(value["springLeague"]),
640
- "division": DivisionToJSON(value["division"]),
641
- "sport": SportToJSON(value["sport"]),
642
- "shortName": value["shortName"],
643
- "franchiseName": value["franchiseName"],
644
- "clubName": value["clubName"],
645
- "active": value["active"]
658
+ "streakType": value["streakType"]
646
659
  };
647
660
  }
648
661
 
@@ -667,7 +680,10 @@ function LeagueRecordFromJSONTyped(json, ignoreDiscriminator) {
667
680
  "pct": json["pct"]
668
681
  };
669
682
  }
670
- function LeagueRecordToJSON(value) {
683
+ function LeagueRecordToJSON(json) {
684
+ return LeagueRecordToJSONTyped(json, false);
685
+ }
686
+ function LeagueRecordToJSONTyped(value, ignoreDiscriminator = false) {
671
687
  if (value == null) {
672
688
  return value;
673
689
  }
@@ -679,8 +695,8 @@ function LeagueRecordToJSON(value) {
679
695
  };
680
696
  }
681
697
 
682
- // src/models/TeamRecord.ts
683
- function instanceOfTeamRecord(value) {
698
+ // src/models/Record.ts
699
+ function instanceOfRecord(value) {
684
700
  if (!("team" in value) || value["team"] === void 0) return false;
685
701
  if (!("season" in value) || value["season"] === void 0) return false;
686
702
  if (!("streak" in value) || value["streak"] === void 0) return false;
@@ -692,10 +708,10 @@ function instanceOfTeamRecord(value) {
692
708
  if (!("losses" in value) || value["losses"] === void 0) return false;
693
709
  return true;
694
710
  }
695
- function TeamRecordFromJSON(json) {
696
- return TeamRecordFromJSONTyped(json, false);
711
+ function RecordFromJSON(json) {
712
+ return RecordFromJSONTyped(json, false);
697
713
  }
698
- function TeamRecordFromJSONTyped(json, ignoreDiscriminator) {
714
+ function RecordFromJSONTyped(json, ignoreDiscriminator) {
699
715
  if (json == null) {
700
716
  return json;
701
717
  }
@@ -734,7 +750,10 @@ function TeamRecordFromJSONTyped(json, ignoreDiscriminator) {
734
750
  "winningPercentage": json["winningPercentage"] == null ? void 0 : json["winningPercentage"]
735
751
  };
736
752
  }
737
- function TeamRecordToJSON(value) {
753
+ function RecordToJSON(json) {
754
+ return RecordToJSONTyped(json, false);
755
+ }
756
+ function RecordToJSONTyped(value, ignoreDiscriminator = false) {
738
757
  if (value == null) {
739
758
  return value;
740
759
  }
@@ -774,6 +793,135 @@ function TeamRecordToJSON(value) {
774
793
  };
775
794
  }
776
795
 
796
+ // src/models/Team.ts
797
+ function instanceOfTeam(value) {
798
+ if (!("id" in value) || value["id"] === void 0) return false;
799
+ if (!("name" in value) || value["name"] === void 0) return false;
800
+ return true;
801
+ }
802
+ function TeamFromJSON(json) {
803
+ return TeamFromJSONTyped2(json, false);
804
+ }
805
+ function TeamFromJSONTyped2(json, ignoreDiscriminator) {
806
+ if (json == null) {
807
+ return json;
808
+ }
809
+ return {
810
+ "id": json["id"],
811
+ "name": json["name"],
812
+ "link": json["link"] == null ? void 0 : json["link"],
813
+ "allStarStatus": json["allStarStatus"] == null ? void 0 : json["allStarStatus"],
814
+ "season": json["season"] == null ? void 0 : json["season"],
815
+ "venue": json["venue"] == null ? void 0 : VenueFromJSON(json["venue"]),
816
+ "springVenue": json["springVenue"] == null ? void 0 : VenueFromJSON(json["springVenue"]),
817
+ "teamCode": json["teamCode"] == null ? void 0 : json["teamCode"],
818
+ "fileCode": json["fileCode"] == null ? void 0 : json["fileCode"],
819
+ "abbreviation": json["abbreviation"] == null ? void 0 : json["abbreviation"],
820
+ "teamName": json["teamName"] == null ? void 0 : json["teamName"],
821
+ "locationName": json["locationName"] == null ? void 0 : json["locationName"],
822
+ "firstYearOfPlay": json["firstYearOfPlay"] == null ? void 0 : json["firstYearOfPlay"],
823
+ "league": json["league"] == null ? void 0 : LeagueFromJSON(json["league"]),
824
+ "springLeague": json["springLeague"] == null ? void 0 : LeagueFromJSON(json["springLeague"]),
825
+ "division": json["division"] == null ? void 0 : DivisionFromJSON(json["division"]),
826
+ "sport": json["sport"] == null ? void 0 : SportFromJSON(json["sport"]),
827
+ "record": json["record"] == null ? void 0 : RecordFromJSON(json["record"]),
828
+ "shortName": json["shortName"] == null ? void 0 : json["shortName"],
829
+ "franchiseName": json["franchiseName"] == null ? void 0 : json["franchiseName"],
830
+ "clubName": json["clubName"] == null ? void 0 : json["clubName"],
831
+ "active": json["active"] == null ? void 0 : json["active"]
832
+ };
833
+ }
834
+ function TeamToJSON(json) {
835
+ return TeamToJSONTyped2(json, false);
836
+ }
837
+ function TeamToJSONTyped2(value, ignoreDiscriminator = false) {
838
+ if (value == null) {
839
+ return value;
840
+ }
841
+ return {
842
+ "id": value["id"],
843
+ "name": value["name"],
844
+ "link": value["link"],
845
+ "allStarStatus": value["allStarStatus"],
846
+ "season": value["season"],
847
+ "venue": VenueToJSON(value["venue"]),
848
+ "springVenue": VenueToJSON(value["springVenue"]),
849
+ "teamCode": value["teamCode"],
850
+ "fileCode": value["fileCode"],
851
+ "abbreviation": value["abbreviation"],
852
+ "teamName": value["teamName"],
853
+ "locationName": value["locationName"],
854
+ "firstYearOfPlay": value["firstYearOfPlay"],
855
+ "league": LeagueToJSON(value["league"]),
856
+ "springLeague": LeagueToJSON(value["springLeague"]),
857
+ "division": DivisionToJSON(value["division"]),
858
+ "sport": SportToJSON(value["sport"]),
859
+ "record": RecordToJSON(value["record"]),
860
+ "shortName": value["shortName"],
861
+ "franchiseName": value["franchiseName"],
862
+ "clubName": value["clubName"],
863
+ "active": value["active"]
864
+ };
865
+ }
866
+
867
+ // src/models/BoxscoreTeams.ts
868
+ function instanceOfBoxscoreTeams(value) {
869
+ return true;
870
+ }
871
+ function BoxscoreTeamsFromJSON(json) {
872
+ return BoxscoreTeamsFromJSONTyped(json, false);
873
+ }
874
+ function BoxscoreTeamsFromJSONTyped(json, ignoreDiscriminator) {
875
+ if (json == null) {
876
+ return json;
877
+ }
878
+ return {
879
+ "away": json["away"] == null ? void 0 : TeamFromJSON(json["away"]),
880
+ "home": json["home"] == null ? void 0 : TeamFromJSON(json["home"])
881
+ };
882
+ }
883
+ function BoxscoreTeamsToJSON(json) {
884
+ return BoxscoreTeamsToJSONTyped(json, false);
885
+ }
886
+ function BoxscoreTeamsToJSONTyped(value, ignoreDiscriminator = false) {
887
+ if (value == null) {
888
+ return value;
889
+ }
890
+ return {
891
+ "away": TeamToJSON(value["away"]),
892
+ "home": TeamToJSON(value["home"])
893
+ };
894
+ }
895
+
896
+ // src/models/Boxscore.ts
897
+ function instanceOfBoxscore(value) {
898
+ return true;
899
+ }
900
+ function BoxscoreFromJSON(json) {
901
+ return BoxscoreFromJSONTyped(json, false);
902
+ }
903
+ function BoxscoreFromJSONTyped(json, ignoreDiscriminator) {
904
+ if (json == null) {
905
+ return json;
906
+ }
907
+ return {
908
+ "teams": json["teams"] == null ? void 0 : BoxscoreTeamsFromJSON(json["teams"]),
909
+ "officials": json["officials"] == null ? void 0 : json["officials"].map(GameOfficialFromJSON)
910
+ };
911
+ }
912
+ function BoxscoreToJSON(json) {
913
+ return BoxscoreToJSONTyped(json, false);
914
+ }
915
+ function BoxscoreToJSONTyped(value, ignoreDiscriminator = false) {
916
+ if (value == null) {
917
+ return value;
918
+ }
919
+ return {
920
+ "teams": BoxscoreTeamsToJSON(value["teams"]),
921
+ "officials": value["officials"] == null ? void 0 : value["officials"].map(GameOfficialToJSON)
922
+ };
923
+ }
924
+
777
925
  // src/models/DivisionStandings.ts
778
926
  function instanceOfDivisionStandings(value) {
779
927
  if (!("league" in value) || value["league"] === void 0) return false;
@@ -795,10 +943,13 @@ function DivisionStandingsFromJSONTyped(json, ignoreDiscriminator) {
795
943
  "division": DivisionFromJSON(json["division"]),
796
944
  "sport": SportFromJSON(json["sport"]),
797
945
  "lastUpdated": json["lastUpdated"] == null ? void 0 : json["lastUpdated"],
798
- "teamRecords": json["teamRecords"].map(TeamRecordFromJSON)
946
+ "teamRecords": json["teamRecords"].map(RecordFromJSON)
799
947
  };
800
948
  }
801
- function DivisionStandingsToJSON(value) {
949
+ function DivisionStandingsToJSON(json) {
950
+ return DivisionStandingsToJSONTyped(json, false);
951
+ }
952
+ function DivisionStandingsToJSONTyped(value, ignoreDiscriminator = false) {
802
953
  if (value == null) {
803
954
  return value;
804
955
  }
@@ -808,7 +959,7 @@ function DivisionStandingsToJSON(value) {
808
959
  "division": DivisionToJSON(value["division"]),
809
960
  "sport": SportToJSON(value["sport"]),
810
961
  "lastUpdated": value["lastUpdated"],
811
- "teamRecords": value["teamRecords"].map(TeamRecordToJSON)
962
+ "teamRecords": value["teamRecords"].map(RecordToJSON)
812
963
  };
813
964
  }
814
965
 
@@ -827,7 +978,10 @@ function DivisionStandingsListFromJSONTyped(json, ignoreDiscriminator) {
827
978
  "records": json["records"] == null ? void 0 : json["records"].map(DivisionStandingsFromJSON)
828
979
  };
829
980
  }
830
- function DivisionStandingsListToJSON(value) {
981
+ function DivisionStandingsListToJSON(json) {
982
+ return DivisionStandingsListToJSONTyped(json, false);
983
+ }
984
+ function DivisionStandingsListToJSONTyped(value, ignoreDiscriminator = false) {
831
985
  if (value == null) {
832
986
  return value;
833
987
  }
@@ -837,15 +991,16 @@ function DivisionStandingsListToJSON(value) {
837
991
  }
838
992
 
839
993
  // src/models/GameStatusCode.ts
840
- var GameStatusCode = {
841
- Final: "F",
842
- Postponed: "D",
843
- Scheduled: "S",
844
- InProgress: "I",
845
- Pregame: "P",
846
- GameOver: "O",
847
- Canceled: "C"
848
- };
994
+ var GameStatusCode = /* @__PURE__ */ ((GameStatusCode2) => {
995
+ GameStatusCode2["Final"] = "F";
996
+ GameStatusCode2["Postponed"] = "D";
997
+ GameStatusCode2["Scheduled"] = "S";
998
+ GameStatusCode2["InProgress"] = "I";
999
+ GameStatusCode2["Pregame"] = "P";
1000
+ GameStatusCode2["GameOver"] = "O";
1001
+ GameStatusCode2["Canceled"] = "C";
1002
+ return GameStatusCode2;
1003
+ })(GameStatusCode || {});
849
1004
  function instanceOfGameStatusCode(value) {
850
1005
  for (const key in GameStatusCode) {
851
1006
  if (Object.prototype.hasOwnProperty.call(GameStatusCode, key)) {
@@ -865,6 +1020,9 @@ function GameStatusCodeFromJSONTyped(json, ignoreDiscriminator) {
865
1020
  function GameStatusCodeToJSON(value) {
866
1021
  return value;
867
1022
  }
1023
+ function GameStatusCodeToJSONTyped(value, ignoreDiscriminator) {
1024
+ return value;
1025
+ }
868
1026
 
869
1027
  // src/models/GameStatus.ts
870
1028
  function instanceOfGameStatus(value) {
@@ -886,7 +1044,10 @@ function GameStatusFromJSONTyped(json, ignoreDiscriminator) {
886
1044
  "abstractGameCode": json["abstractGameCode"] == null ? void 0 : json["abstractGameCode"]
887
1045
  };
888
1046
  }
889
- function GameStatusToJSON(value) {
1047
+ function GameStatusToJSON(json) {
1048
+ return GameStatusToJSONTyped(json, false);
1049
+ }
1050
+ function GameStatusToJSONTyped(value, ignoreDiscriminator = false) {
890
1051
  if (value == null) {
891
1052
  return value;
892
1053
  }
@@ -923,7 +1084,10 @@ function GameTeamFromJSONTyped(json, ignoreDiscriminator) {
923
1084
  "seriesNumber": json["seriesNumber"] == null ? void 0 : json["seriesNumber"]
924
1085
  };
925
1086
  }
926
- function GameTeamToJSON(value) {
1087
+ function GameTeamToJSON(json) {
1088
+ return GameTeamToJSONTyped(json, false);
1089
+ }
1090
+ function GameTeamToJSONTyped(value, ignoreDiscriminator = false) {
927
1091
  if (value == null) {
928
1092
  return value;
929
1093
  }
@@ -955,7 +1119,10 @@ function GameTeamsFromJSONTyped(json, ignoreDiscriminator) {
955
1119
  "home": GameTeamFromJSON(json["home"])
956
1120
  };
957
1121
  }
958
- function GameTeamsToJSON(value) {
1122
+ function GameTeamsToJSON(json) {
1123
+ return GameTeamsToJSONTyped(json, false);
1124
+ }
1125
+ function GameTeamsToJSONTyped(value, ignoreDiscriminator = false) {
959
1126
  if (value == null) {
960
1127
  return value;
961
1128
  }
@@ -966,15 +1133,16 @@ function GameTeamsToJSON(value) {
966
1133
  }
967
1134
 
968
1135
  // src/models/GameType.ts
969
- var GameType = {
970
- Exhibition: "E",
971
- SpringTraining: "S",
972
- Regular: "R",
973
- WildCardSeries: "F",
974
- DivisionSeries: "D",
975
- LeagueChampionshipSeries: "L",
976
- WorldSeries: "W"
977
- };
1136
+ var GameType = /* @__PURE__ */ ((GameType2) => {
1137
+ GameType2["Exhibition"] = "E";
1138
+ GameType2["SpringTraining"] = "S";
1139
+ GameType2["Regular"] = "R";
1140
+ GameType2["WildCardSeries"] = "F";
1141
+ GameType2["DivisionSeries"] = "D";
1142
+ GameType2["LeagueChampionshipSeries"] = "L";
1143
+ GameType2["WorldSeries"] = "W";
1144
+ return GameType2;
1145
+ })(GameType || {});
978
1146
  function instanceOfGameType(value) {
979
1147
  for (const key in GameType) {
980
1148
  if (Object.prototype.hasOwnProperty.call(GameType, key)) {
@@ -994,6 +1162,9 @@ function GameTypeFromJSONTyped(json, ignoreDiscriminator) {
994
1162
  function GameTypeToJSON(value) {
995
1163
  return value;
996
1164
  }
1165
+ function GameTypeToJSONTyped(value, ignoreDiscriminator) {
1166
+ return value;
1167
+ }
997
1168
 
998
1169
  // src/models/Game.ts
999
1170
  function instanceOfGame(value) {
@@ -1053,7 +1224,10 @@ function GameFromJSONTyped(json, ignoreDiscriminator) {
1053
1224
  "ifNecessaryDescription": json["ifNecessaryDescription"] == null ? void 0 : json["ifNecessaryDescription"]
1054
1225
  };
1055
1226
  }
1056
- function GameToJSON(value) {
1227
+ function GameToJSON(json) {
1228
+ return GameToJSONTyped(json, false);
1229
+ }
1230
+ function GameToJSONTyped(value, ignoreDiscriminator = false) {
1057
1231
  if (value == null) {
1058
1232
  return value;
1059
1233
  }
@@ -1112,7 +1286,10 @@ function LinescoreTeamFromJSONTyped(json, ignoreDiscriminator) {
1112
1286
  "leftOnBase": json["leftOnBase"] == null ? void 0 : json["leftOnBase"]
1113
1287
  };
1114
1288
  }
1115
- function LinescoreTeamToJSON(value) {
1289
+ function LinescoreTeamToJSON(json) {
1290
+ return LinescoreTeamToJSONTyped(json, false);
1291
+ }
1292
+ function LinescoreTeamToJSONTyped(value, ignoreDiscriminator = false) {
1116
1293
  if (value == null) {
1117
1294
  return value;
1118
1295
  }
@@ -1142,7 +1319,10 @@ function InningFromJSONTyped(json, ignoreDiscriminator) {
1142
1319
  "away": json["away"] == null ? void 0 : LinescoreTeamFromJSON(json["away"])
1143
1320
  };
1144
1321
  }
1145
- function InningToJSON(value) {
1322
+ function InningToJSON(json) {
1323
+ return InningToJSONTyped(json, false);
1324
+ }
1325
+ function InningToJSONTyped(value, ignoreDiscriminator = false) {
1146
1326
  if (value == null) {
1147
1327
  return value;
1148
1328
  }
@@ -1170,7 +1350,10 @@ function LinescoreTeamsFromJSONTyped(json, ignoreDiscriminator) {
1170
1350
  "home": json["home"] == null ? void 0 : LinescoreTeamFromJSON(json["home"])
1171
1351
  };
1172
1352
  }
1173
- function LinescoreTeamsToJSON(value) {
1353
+ function LinescoreTeamsToJSON(json) {
1354
+ return LinescoreTeamsToJSONTyped(json, false);
1355
+ }
1356
+ function LinescoreTeamsToJSONTyped(value, ignoreDiscriminator = false) {
1174
1357
  if (value == null) {
1175
1358
  return value;
1176
1359
  }
@@ -1205,7 +1388,10 @@ function LinescoreFromJSONTyped(json, ignoreDiscriminator) {
1205
1388
  "outs": json["outs"] == null ? void 0 : json["outs"]
1206
1389
  };
1207
1390
  }
1208
- function LinescoreToJSON(value) {
1391
+ function LinescoreToJSON(json) {
1392
+ return LinescoreToJSONTyped(json, false);
1393
+ }
1394
+ function LinescoreToJSONTyped(value, ignoreDiscriminator = false) {
1209
1395
  if (value == null) {
1210
1396
  return value;
1211
1397
  }
@@ -1245,7 +1431,10 @@ function ScheduleDayFromJSONTyped(json, ignoreDiscriminator) {
1245
1431
  "games": json["games"].map(GameFromJSON)
1246
1432
  };
1247
1433
  }
1248
- function ScheduleDayToJSON(value) {
1434
+ function ScheduleDayToJSON(json) {
1435
+ return ScheduleDayToJSONTyped(json, false);
1436
+ }
1437
+ function ScheduleDayToJSONTyped(value, ignoreDiscriminator = false) {
1249
1438
  if (value == null) {
1250
1439
  return value;
1251
1440
  }
@@ -1283,7 +1472,10 @@ function ScheduleFromJSONTyped(json, ignoreDiscriminator) {
1283
1472
  "dates": json["dates"].map(ScheduleDayFromJSON)
1284
1473
  };
1285
1474
  }
1286
- function ScheduleToJSON(value) {
1475
+ function ScheduleToJSON(json) {
1476
+ return ScheduleToJSONTyped(json, false);
1477
+ }
1478
+ function ScheduleToJSONTyped(value, ignoreDiscriminator = false) {
1287
1479
  if (value == null) {
1288
1480
  return value;
1289
1481
  }
@@ -1336,7 +1528,10 @@ function SeasonFromJSONTyped(json, ignoreDiscriminator) {
1336
1528
  "qualifierOutsPitched": json["qualifierOutsPitched"] == null ? void 0 : json["qualifierOutsPitched"]
1337
1529
  };
1338
1530
  }
1339
- function SeasonToJSON(value) {
1531
+ function SeasonToJSON(json) {
1532
+ return SeasonToJSONTyped(json, false);
1533
+ }
1534
+ function SeasonToJSONTyped(value, ignoreDiscriminator = false) {
1340
1535
  if (value == null) {
1341
1536
  return value;
1342
1537
  }
@@ -1380,7 +1575,10 @@ function SeasonsFromJSONTyped(json, ignoreDiscriminator) {
1380
1575
  "seasons": json["seasons"] == null ? void 0 : json["seasons"].map(SeasonFromJSON)
1381
1576
  };
1382
1577
  }
1383
- function SeasonsToJSON(value) {
1578
+ function SeasonsToJSON(json) {
1579
+ return SeasonsToJSONTyped(json, false);
1580
+ }
1581
+ function SeasonsToJSONTyped(value, ignoreDiscriminator = false) {
1384
1582
  if (value == null) {
1385
1583
  return value;
1386
1584
  }
@@ -1404,7 +1602,10 @@ function TeamsFromJSONTyped(json, ignoreDiscriminator) {
1404
1602
  "teams": json["teams"] == null ? void 0 : json["teams"].map(TeamFromJSON)
1405
1603
  };
1406
1604
  }
1407
- function TeamsToJSON(value) {
1605
+ function TeamsToJSON(json) {
1606
+ return TeamsToJSONTyped(json, false);
1607
+ }
1608
+ function TeamsToJSONTyped(value, ignoreDiscriminator = false) {
1408
1609
  if (value == null) {
1409
1610
  return value;
1410
1611
  }
@@ -1451,6 +1652,42 @@ var MlbApi = class extends BaseAPI {
1451
1652
  return yield response.value();
1452
1653
  });
1453
1654
  }
1655
+ /**
1656
+ * Returns Boxscore
1657
+ * Retrieves boxscore
1658
+ */
1659
+ getBoxscoreRaw(requestParameters, initOverrides) {
1660
+ return __async(this, null, function* () {
1661
+ if (requestParameters["gamePk"] == null) {
1662
+ throw new RequiredError(
1663
+ "gamePk",
1664
+ 'Required parameter "gamePk" was null or undefined when calling getBoxscore().'
1665
+ );
1666
+ }
1667
+ const queryParameters = {};
1668
+ if (requestParameters["fields"] != null) {
1669
+ queryParameters["fields"] = requestParameters["fields"].join(COLLECTION_FORMATS["csv"]);
1670
+ }
1671
+ const headerParameters = {};
1672
+ const response = yield this.request({
1673
+ path: `/v1/game/{gamePk}/boxscore`.replace(`{${"gamePk"}}`, encodeURIComponent(String(requestParameters["gamePk"]))),
1674
+ method: "GET",
1675
+ headers: headerParameters,
1676
+ query: queryParameters
1677
+ }, initOverrides);
1678
+ return new JSONApiResponse(response, (jsonValue) => BoxscoreFromJSON(jsonValue));
1679
+ });
1680
+ }
1681
+ /**
1682
+ * Returns Boxscore
1683
+ * Retrieves boxscore
1684
+ */
1685
+ getBoxscore(requestParameters, initOverrides) {
1686
+ return __async(this, null, function* () {
1687
+ const response = yield this.getBoxscoreRaw(requestParameters, initOverrides);
1688
+ return yield response.value();
1689
+ });
1690
+ }
1454
1691
  /**
1455
1692
  * Returns Linescore
1456
1693
  * Retrieves linescore
@@ -1464,6 +1701,9 @@ var MlbApi = class extends BaseAPI {
1464
1701
  );
1465
1702
  }
1466
1703
  const queryParameters = {};
1704
+ if (requestParameters["fields"] != null) {
1705
+ queryParameters["fields"] = requestParameters["fields"].join(COLLECTION_FORMATS["csv"]);
1706
+ }
1467
1707
  const headerParameters = {};
1468
1708
  const response = yield this.request({
1469
1709
  path: `/v1/game/{gamePk}/linescore`.replace(`{${"gamePk"}}`, encodeURIComponent(String(requestParameters["gamePk"]))),
@@ -1690,6 +1930,14 @@ export {
1690
1930
  BASE_PATH,
1691
1931
  BaseAPI,
1692
1932
  BlobApiResponse,
1933
+ BoxscoreFromJSON,
1934
+ BoxscoreFromJSONTyped,
1935
+ BoxscoreTeamsFromJSON,
1936
+ BoxscoreTeamsFromJSONTyped,
1937
+ BoxscoreTeamsToJSON,
1938
+ BoxscoreTeamsToJSONTyped,
1939
+ BoxscoreToJSON,
1940
+ BoxscoreToJSONTyped,
1693
1941
  COLLECTION_FORMATS,
1694
1942
  Configuration,
1695
1943
  DefaultConfig,
@@ -1700,92 +1948,129 @@ export {
1700
1948
  DivisionStandingsListFromJSON,
1701
1949
  DivisionStandingsListFromJSONTyped,
1702
1950
  DivisionStandingsListToJSON,
1951
+ DivisionStandingsListToJSONTyped,
1703
1952
  DivisionStandingsToJSON,
1953
+ DivisionStandingsToJSONTyped,
1704
1954
  DivisionToJSON,
1955
+ DivisionToJSONTyped,
1705
1956
  FetchError,
1706
1957
  GameFromJSON,
1707
1958
  GameFromJSONTyped,
1959
+ GameOfficialFromJSON,
1960
+ GameOfficialFromJSONTyped,
1961
+ GameOfficialToJSON,
1962
+ GameOfficialToJSONTyped,
1708
1963
  GameStatusCode,
1709
1964
  GameStatusCodeFromJSON,
1710
1965
  GameStatusCodeFromJSONTyped,
1711
1966
  GameStatusCodeToJSON,
1967
+ GameStatusCodeToJSONTyped,
1712
1968
  GameStatusFromJSON,
1713
1969
  GameStatusFromJSONTyped,
1714
1970
  GameStatusToJSON,
1971
+ GameStatusToJSONTyped,
1715
1972
  GameTeamFromJSON,
1716
1973
  GameTeamFromJSONTyped,
1717
1974
  GameTeamToJSON,
1975
+ GameTeamToJSONTyped,
1718
1976
  GameTeamsFromJSON,
1719
1977
  GameTeamsFromJSONTyped,
1720
1978
  GameTeamsToJSON,
1979
+ GameTeamsToJSONTyped,
1721
1980
  GameToJSON,
1981
+ GameToJSONTyped,
1722
1982
  GameType,
1723
1983
  GameTypeFromJSON,
1724
1984
  GameTypeFromJSONTyped,
1725
1985
  GameTypeToJSON,
1986
+ GameTypeToJSONTyped,
1726
1987
  InningFromJSON,
1727
1988
  InningFromJSONTyped,
1728
1989
  InningToJSON,
1990
+ InningToJSONTyped,
1729
1991
  JSONApiResponse,
1730
1992
  LeagueDatesFromJSON,
1731
1993
  LeagueDatesFromJSONTyped,
1732
1994
  LeagueDatesToJSON,
1995
+ LeagueDatesToJSONTyped,
1733
1996
  LeagueFromJSON,
1734
1997
  LeagueFromJSONTyped,
1735
1998
  LeagueRecordFromJSON,
1736
1999
  LeagueRecordFromJSONTyped,
1737
2000
  LeagueRecordToJSON,
2001
+ LeagueRecordToJSONTyped,
1738
2002
  LeagueToJSON,
2003
+ LeagueToJSONTyped,
1739
2004
  LinescoreFromJSON,
1740
2005
  LinescoreFromJSONTyped,
1741
2006
  LinescoreTeamFromJSON,
1742
2007
  LinescoreTeamFromJSONTyped,
1743
2008
  LinescoreTeamToJSON,
2009
+ LinescoreTeamToJSONTyped,
1744
2010
  LinescoreTeamsFromJSON,
1745
2011
  LinescoreTeamsFromJSONTyped,
1746
2012
  LinescoreTeamsToJSON,
2013
+ LinescoreTeamsToJSONTyped,
1747
2014
  LinescoreToJSON,
2015
+ LinescoreToJSONTyped,
1748
2016
  MlbApi,
2017
+ OfficialFromJSON,
2018
+ OfficialFromJSONTyped,
2019
+ OfficialToJSON,
2020
+ OfficialToJSONTyped,
2021
+ RecordFromJSON,
2022
+ RecordFromJSONTyped,
2023
+ RecordToJSON,
2024
+ RecordToJSONTyped,
1749
2025
  RequiredError,
1750
2026
  ResponseError,
1751
2027
  ScheduleDayFromJSON,
1752
2028
  ScheduleDayFromJSONTyped,
1753
2029
  ScheduleDayToJSON,
2030
+ ScheduleDayToJSONTyped,
1754
2031
  ScheduleFromJSON,
1755
2032
  ScheduleFromJSONTyped,
1756
2033
  ScheduleToJSON,
2034
+ ScheduleToJSONTyped,
1757
2035
  SeasonFromJSON,
1758
2036
  SeasonFromJSONTyped,
1759
2037
  SeasonToJSON,
2038
+ SeasonToJSONTyped,
1760
2039
  SeasonsFromJSON,
1761
2040
  SeasonsFromJSONTyped,
1762
2041
  SeasonsToJSON,
2042
+ SeasonsToJSONTyped,
1763
2043
  SportFromJSON,
1764
2044
  SportFromJSONTyped,
1765
2045
  SportToJSON,
2046
+ SportToJSONTyped,
1766
2047
  StreakFromJSON,
1767
2048
  StreakFromJSONTyped,
1768
2049
  StreakStreakTypeEnum,
1769
2050
  StreakToJSON,
2051
+ StreakToJSONTyped,
1770
2052
  TeamFromJSON,
1771
- TeamFromJSONTyped,
1772
- TeamRecordFromJSON,
1773
- TeamRecordFromJSONTyped,
1774
- TeamRecordToJSON,
2053
+ TeamFromJSONTyped2 as TeamFromJSONTyped,
1775
2054
  TeamToJSON,
2055
+ TeamToJSONTyped2 as TeamToJSONTyped,
1776
2056
  TeamsFromJSON,
1777
2057
  TeamsFromJSONTyped,
1778
2058
  TeamsToJSON,
2059
+ TeamsToJSONTyped,
1779
2060
  TextApiResponse,
1780
2061
  VenueFromJSON,
1781
2062
  VenueFromJSONTyped,
1782
2063
  VenueToJSON,
2064
+ VenueToJSONTyped,
1783
2065
  VoidApiResponse,
1784
2066
  canConsumeForm,
2067
+ instanceOfBoxscore,
2068
+ instanceOfBoxscoreTeams,
1785
2069
  instanceOfDivision,
1786
2070
  instanceOfDivisionStandings,
1787
2071
  instanceOfDivisionStandingsList,
1788
2072
  instanceOfGame,
2073
+ instanceOfGameOfficial,
1789
2074
  instanceOfGameStatus,
1790
2075
  instanceOfGameStatusCode,
1791
2076
  instanceOfGameTeam,
@@ -1798,6 +2083,8 @@ export {
1798
2083
  instanceOfLinescore,
1799
2084
  instanceOfLinescoreTeam,
1800
2085
  instanceOfLinescoreTeams,
2086
+ instanceOfOfficial,
2087
+ instanceOfRecord,
1801
2088
  instanceOfSchedule,
1802
2089
  instanceOfScheduleDay,
1803
2090
  instanceOfSeason,
@@ -1805,7 +2092,6 @@ export {
1805
2092
  instanceOfSport,
1806
2093
  instanceOfStreak,
1807
2094
  instanceOfTeam,
1808
- instanceOfTeamRecord,
1809
2095
  instanceOfTeams,
1810
2096
  instanceOfVenue,
1811
2097
  mapValues,