@playcaller/sdk 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1126 -7
- package/dist/index.d.ts +1126 -7
- package/dist/index.js +1706 -383
- package/dist/index.mjs +1705 -382
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8,6 +8,8 @@ var __export = (target, all) => {
|
|
|
8
8
|
var api_exports = {};
|
|
9
9
|
__export(api_exports, {
|
|
10
10
|
BadRequestError: () => BadRequestError,
|
|
11
|
+
BatchPlayerSignalsRequest: () => BatchPlayerSignalsRequest,
|
|
12
|
+
BatchPlayersRequest: () => BatchPlayersRequest,
|
|
11
13
|
BeatReporterSignal: () => BeatReporterSignal,
|
|
12
14
|
ComparePlayersRequestSport: () => ComparePlayersRequestSport,
|
|
13
15
|
ConflictError: () => ConflictError,
|
|
@@ -24,16 +26,24 @@ __export(api_exports, {
|
|
|
24
26
|
GetIntelligenceNewsRequestSeverity: () => GetIntelligenceNewsRequestSeverity,
|
|
25
27
|
GetIntelligenceNewsRequestSignalType: () => GetIntelligenceNewsRequestSignalType,
|
|
26
28
|
GetIntelligenceNewsRequestSport: () => GetIntelligenceNewsRequestSport,
|
|
29
|
+
GetIntelligenceSignalsRequestSeverity: () => GetIntelligenceSignalsRequestSeverity,
|
|
30
|
+
GetIntelligenceSignalsRequestSport: () => GetIntelligenceSignalsRequestSport,
|
|
31
|
+
GetIntelligenceSignalsResponse: () => GetIntelligenceSignalsResponse,
|
|
27
32
|
GetMlbScoringLeadersRequestPosition: () => GetMlbScoringLeadersRequestPosition,
|
|
28
33
|
GetMlbTeamRosterRequestPosition: () => GetMlbTeamRosterRequestPosition,
|
|
29
34
|
GetNbaConfidenceResponse: () => GetNbaConfidenceResponse,
|
|
30
35
|
GetNbaStandingsRequestConference: () => GetNbaStandingsRequestConference,
|
|
31
36
|
GetNbaTeamRosterRequestPosition: () => GetNbaTeamRosterRequestPosition,
|
|
37
|
+
GetNflCustomRankingsRequest: () => GetNflCustomRankingsRequest,
|
|
38
|
+
GetNflDepthChartChangesRequestChangeType: () => GetNflDepthChartChangesRequestChangeType,
|
|
39
|
+
GetNflDepthChartChangesRequestPosition: () => GetNflDepthChartChangesRequestPosition,
|
|
40
|
+
GetNflDepthChartChangesResponse: () => GetNflDepthChartChangesResponse,
|
|
32
41
|
GetNflRankingsRequestFormat: () => GetNflRankingsRequestFormat,
|
|
33
42
|
GetNflRankingsRequestPosition: () => GetNflRankingsRequestPosition,
|
|
34
43
|
GetNflRankingsResponse: () => GetNflRankingsResponse,
|
|
35
44
|
GetNflStandingsRequestConference: () => GetNflStandingsRequestConference,
|
|
36
45
|
GetNflTeamRosterRequestPosition: () => GetNflTeamRosterRequestPosition,
|
|
46
|
+
GetOddsHistoryRequestSport: () => GetOddsHistoryRequestSport,
|
|
37
47
|
GetPlayerAlphaMetricsRequestSport: () => GetPlayerAlphaMetricsRequestSport,
|
|
38
48
|
GetPlayerNewsRequestSport: () => GetPlayerNewsRequestSport,
|
|
39
49
|
GetPlayerNewsResponse: () => GetPlayerNewsResponse,
|
|
@@ -41,12 +51,15 @@ __export(api_exports, {
|
|
|
41
51
|
GetSoccerStandingsRequestLeague: () => GetSoccerStandingsRequestLeague,
|
|
42
52
|
GetTeamInjuriesRequestSport: () => GetTeamInjuriesRequestSport,
|
|
43
53
|
GetTeamInjuriesResponse: () => GetTeamInjuriesResponse,
|
|
54
|
+
GetTeamRosterPulseRequestSport: () => GetTeamRosterPulseRequestSport,
|
|
44
55
|
GetTeamScheduleRequestSport: () => GetTeamScheduleRequestSport,
|
|
45
56
|
GetTeamScheduleRequestStatus: () => GetTeamScheduleRequestStatus,
|
|
46
57
|
GetTennisMatchesRequestTour: () => GetTennisMatchesRequestTour,
|
|
47
58
|
GetTrendingRequestSport: () => GetTrendingRequestSport,
|
|
48
59
|
GetUfcEventsRequestState: () => GetUfcEventsRequestState,
|
|
49
60
|
GetWaiverArticlesRequestSport: () => GetWaiverArticlesRequestSport,
|
|
61
|
+
GetWaiverPriorityRequestSport: () => GetWaiverPriorityRequestSport,
|
|
62
|
+
GetWaiverPriorityResponse: () => GetWaiverPriorityResponse,
|
|
50
63
|
InternalServerError: () => InternalServerError,
|
|
51
64
|
InvokeMcpToolRequest: () => InvokeMcpToolRequest,
|
|
52
65
|
ListCfbGamesRequestState: () => ListCfbGamesRequestState,
|
|
@@ -64,6 +77,7 @@ __export(api_exports, {
|
|
|
64
77
|
MlbGame: () => MlbGame,
|
|
65
78
|
MlbPlayer: () => MlbPlayer,
|
|
66
79
|
NotFoundError: () => NotFoundError,
|
|
80
|
+
PaymentRequiredError: () => PaymentRequiredError,
|
|
67
81
|
PlayerIdentity: () => PlayerIdentity,
|
|
68
82
|
SearchPlayersRequestSport: () => SearchPlayersRequestSport,
|
|
69
83
|
StreamEventsRequestSport: () => StreamEventsRequestSport,
|
|
@@ -237,6 +251,23 @@ var NotFoundError = class extends PlaycallerApiError {
|
|
|
237
251
|
}
|
|
238
252
|
};
|
|
239
253
|
|
|
254
|
+
// api/errors/PaymentRequiredError.ts
|
|
255
|
+
var PaymentRequiredError = class extends PlaycallerApiError {
|
|
256
|
+
constructor(body, rawResponse) {
|
|
257
|
+
super({
|
|
258
|
+
message: "PaymentRequiredError",
|
|
259
|
+
statusCode: 402,
|
|
260
|
+
body,
|
|
261
|
+
rawResponse
|
|
262
|
+
});
|
|
263
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
264
|
+
if (Error.captureStackTrace) {
|
|
265
|
+
Error.captureStackTrace(this, this.constructor);
|
|
266
|
+
}
|
|
267
|
+
this.name = "PaymentRequiredError";
|
|
268
|
+
}
|
|
269
|
+
};
|
|
270
|
+
|
|
240
271
|
// api/errors/TooManyRequestsError.ts
|
|
241
272
|
var TooManyRequestsError = class extends PlaycallerApiError {
|
|
242
273
|
constructor(body, rawResponse) {
|
|
@@ -346,7 +377,12 @@ __export(intelligence_exports, {
|
|
|
346
377
|
GetIntelligenceInjuriesRequestSport: () => GetIntelligenceInjuriesRequestSport,
|
|
347
378
|
GetIntelligenceNewsRequestSeverity: () => GetIntelligenceNewsRequestSeverity,
|
|
348
379
|
GetIntelligenceNewsRequestSignalType: () => GetIntelligenceNewsRequestSignalType,
|
|
349
|
-
GetIntelligenceNewsRequestSport: () => GetIntelligenceNewsRequestSport
|
|
380
|
+
GetIntelligenceNewsRequestSport: () => GetIntelligenceNewsRequestSport,
|
|
381
|
+
GetIntelligenceSignalsRequestSeverity: () => GetIntelligenceSignalsRequestSeverity,
|
|
382
|
+
GetIntelligenceSignalsRequestSport: () => GetIntelligenceSignalsRequestSport,
|
|
383
|
+
GetIntelligenceSignalsResponse: () => GetIntelligenceSignalsResponse,
|
|
384
|
+
GetWaiverPriorityRequestSport: () => GetWaiverPriorityRequestSport,
|
|
385
|
+
GetWaiverPriorityResponse: () => GetWaiverPriorityResponse
|
|
350
386
|
});
|
|
351
387
|
|
|
352
388
|
// api/resources/intelligence/types/GetAnalyticsTrendsRequestSport.ts
|
|
@@ -395,6 +431,63 @@ var GetIntelligenceNewsRequestSport = {
|
|
|
395
431
|
All: "all"
|
|
396
432
|
};
|
|
397
433
|
|
|
434
|
+
// api/resources/intelligence/types/GetIntelligenceSignalsRequestSeverity.ts
|
|
435
|
+
var GetIntelligenceSignalsRequestSeverity = {
|
|
436
|
+
High: "high",
|
|
437
|
+
Medium: "medium",
|
|
438
|
+
Low: "low"
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
// api/resources/intelligence/types/GetIntelligenceSignalsRequestSport.ts
|
|
442
|
+
var GetIntelligenceSignalsRequestSport = {
|
|
443
|
+
Nfl: "nfl",
|
|
444
|
+
Nba: "nba",
|
|
445
|
+
Mlb: "mlb",
|
|
446
|
+
Nhl: "nhl",
|
|
447
|
+
Golf: "golf",
|
|
448
|
+
Soccer: "soccer"
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
// api/resources/intelligence/types/GetIntelligenceSignalsResponse.ts
|
|
452
|
+
var GetIntelligenceSignalsResponse;
|
|
453
|
+
((GetIntelligenceSignalsResponse2) => {
|
|
454
|
+
let Data;
|
|
455
|
+
((Data2) => {
|
|
456
|
+
let Item;
|
|
457
|
+
((Item2) => {
|
|
458
|
+
Item2.Severity = {
|
|
459
|
+
High: "high",
|
|
460
|
+
Medium: "medium",
|
|
461
|
+
Low: "low"
|
|
462
|
+
};
|
|
463
|
+
})(Item = Data2.Item || (Data2.Item = {}));
|
|
464
|
+
})(Data = GetIntelligenceSignalsResponse2.Data || (GetIntelligenceSignalsResponse2.Data = {}));
|
|
465
|
+
})(GetIntelligenceSignalsResponse || (GetIntelligenceSignalsResponse = {}));
|
|
466
|
+
|
|
467
|
+
// api/resources/intelligence/types/GetWaiverPriorityRequestSport.ts
|
|
468
|
+
var GetWaiverPriorityRequestSport = {
|
|
469
|
+
Nfl: "nfl",
|
|
470
|
+
Nba: "nba",
|
|
471
|
+
Mlb: "mlb",
|
|
472
|
+
Nhl: "nhl"
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
// api/resources/intelligence/types/GetWaiverPriorityResponse.ts
|
|
476
|
+
var GetWaiverPriorityResponse;
|
|
477
|
+
((GetWaiverPriorityResponse2) => {
|
|
478
|
+
let WaiverCandidates;
|
|
479
|
+
((WaiverCandidates2) => {
|
|
480
|
+
let Item;
|
|
481
|
+
((Item2) => {
|
|
482
|
+
Item2.Severity = {
|
|
483
|
+
High: "high",
|
|
484
|
+
Medium: "medium",
|
|
485
|
+
Low: "low"
|
|
486
|
+
};
|
|
487
|
+
})(Item = WaiverCandidates2.Item || (WaiverCandidates2.Item = {}));
|
|
488
|
+
})(WaiverCandidates = GetWaiverPriorityResponse2.WaiverCandidates || (GetWaiverPriorityResponse2.WaiverCandidates = {}));
|
|
489
|
+
})(GetWaiverPriorityResponse || (GetWaiverPriorityResponse = {}));
|
|
490
|
+
|
|
398
491
|
// api/resources/mcp/client/requests/InvokeMcpToolRequest.ts
|
|
399
492
|
var InvokeMcpToolRequest;
|
|
400
493
|
((InvokeMcpToolRequest2) => {
|
|
@@ -481,17 +574,53 @@ var ListMlbPlayersRequestStatus = {
|
|
|
481
574
|
Inactive: "inactive"
|
|
482
575
|
};
|
|
483
576
|
|
|
577
|
+
// api/resources/multi/client/requests/BatchPlayerSignalsRequest.ts
|
|
578
|
+
var BatchPlayerSignalsRequest;
|
|
579
|
+
((BatchPlayerSignalsRequest2) => {
|
|
580
|
+
let Players;
|
|
581
|
+
((Players2) => {
|
|
582
|
+
let Item;
|
|
583
|
+
((Item2) => {
|
|
584
|
+
Item2.Sport = {
|
|
585
|
+
Nfl: "nfl",
|
|
586
|
+
Mlb: "mlb",
|
|
587
|
+
Nba: "nba",
|
|
588
|
+
Nhl: "nhl",
|
|
589
|
+
Golf: "golf",
|
|
590
|
+
Soccer: "soccer"
|
|
591
|
+
};
|
|
592
|
+
})(Item = Players2.Item || (Players2.Item = {}));
|
|
593
|
+
})(Players = BatchPlayerSignalsRequest2.Players || (BatchPlayerSignalsRequest2.Players = {}));
|
|
594
|
+
})(BatchPlayerSignalsRequest || (BatchPlayerSignalsRequest = {}));
|
|
595
|
+
|
|
596
|
+
// api/resources/multi/client/requests/BatchPlayersRequest.ts
|
|
597
|
+
var BatchPlayersRequest;
|
|
598
|
+
((BatchPlayersRequest2) => {
|
|
599
|
+
let Include;
|
|
600
|
+
((Include2) => {
|
|
601
|
+
Include2.Item = {
|
|
602
|
+
Stats: "stats",
|
|
603
|
+
Injuries: "injuries",
|
|
604
|
+
Anomalies: "anomalies"
|
|
605
|
+
};
|
|
606
|
+
})(Include = BatchPlayersRequest2.Include || (BatchPlayersRequest2.Include = {}));
|
|
607
|
+
})(BatchPlayersRequest || (BatchPlayersRequest = {}));
|
|
608
|
+
|
|
484
609
|
// api/resources/multi/index.ts
|
|
485
610
|
var multi_exports = {};
|
|
486
611
|
__export(multi_exports, {
|
|
612
|
+
BatchPlayerSignalsRequest: () => BatchPlayerSignalsRequest,
|
|
613
|
+
BatchPlayersRequest: () => BatchPlayersRequest,
|
|
487
614
|
ComparePlayersRequestSport: () => ComparePlayersRequestSport,
|
|
488
615
|
GetGamesHistoryRequestSport: () => GetGamesHistoryRequestSport,
|
|
616
|
+
GetOddsHistoryRequestSport: () => GetOddsHistoryRequestSport,
|
|
489
617
|
GetPlayerAlphaMetricsRequestSport: () => GetPlayerAlphaMetricsRequestSport,
|
|
490
618
|
GetPlayerNewsRequestSport: () => GetPlayerNewsRequestSport,
|
|
491
619
|
GetPlayerNewsResponse: () => GetPlayerNewsResponse,
|
|
492
620
|
GetSimilarPlayersRequestSport: () => GetSimilarPlayersRequestSport,
|
|
493
621
|
GetTeamInjuriesRequestSport: () => GetTeamInjuriesRequestSport,
|
|
494
622
|
GetTeamInjuriesResponse: () => GetTeamInjuriesResponse,
|
|
623
|
+
GetTeamRosterPulseRequestSport: () => GetTeamRosterPulseRequestSport,
|
|
495
624
|
GetTeamScheduleRequestSport: () => GetTeamScheduleRequestSport,
|
|
496
625
|
GetTeamScheduleRequestStatus: () => GetTeamScheduleRequestStatus,
|
|
497
626
|
GetTrendingRequestSport: () => GetTrendingRequestSport,
|
|
@@ -514,6 +643,14 @@ var GetGamesHistoryRequestSport = {
|
|
|
514
643
|
Mlb: "mlb"
|
|
515
644
|
};
|
|
516
645
|
|
|
646
|
+
// api/resources/multi/types/GetOddsHistoryRequestSport.ts
|
|
647
|
+
var GetOddsHistoryRequestSport = {
|
|
648
|
+
Nfl: "nfl",
|
|
649
|
+
Nba: "nba",
|
|
650
|
+
Mlb: "mlb",
|
|
651
|
+
Nhl: "nhl"
|
|
652
|
+
};
|
|
653
|
+
|
|
517
654
|
// api/resources/multi/types/GetPlayerAlphaMetricsRequestSport.ts
|
|
518
655
|
var GetPlayerAlphaMetricsRequestSport = {
|
|
519
656
|
Nfl: "nfl",
|
|
@@ -578,6 +715,14 @@ var GetTeamInjuriesResponse;
|
|
|
578
715
|
})(Data = GetTeamInjuriesResponse2.Data || (GetTeamInjuriesResponse2.Data = {}));
|
|
579
716
|
})(GetTeamInjuriesResponse || (GetTeamInjuriesResponse = {}));
|
|
580
717
|
|
|
718
|
+
// api/resources/multi/types/GetTeamRosterPulseRequestSport.ts
|
|
719
|
+
var GetTeamRosterPulseRequestSport = {
|
|
720
|
+
Nfl: "nfl",
|
|
721
|
+
Nba: "nba",
|
|
722
|
+
Mlb: "mlb",
|
|
723
|
+
Nhl: "nhl"
|
|
724
|
+
};
|
|
725
|
+
|
|
581
726
|
// api/resources/multi/types/GetTeamScheduleRequestSport.ts
|
|
582
727
|
var GetTeamScheduleRequestSport = {
|
|
583
728
|
Nfl: "nfl",
|
|
@@ -692,9 +837,25 @@ var ListNbaTeamsRequestConference = {
|
|
|
692
837
|
West: "West"
|
|
693
838
|
};
|
|
694
839
|
|
|
840
|
+
// api/resources/nfl/client/requests/GetNflCustomRankingsRequest.ts
|
|
841
|
+
var GetNflCustomRankingsRequest;
|
|
842
|
+
((GetNflCustomRankingsRequest2) => {
|
|
843
|
+
GetNflCustomRankingsRequest2.Position = {
|
|
844
|
+
Qb: "QB",
|
|
845
|
+
Rb: "RB",
|
|
846
|
+
Wr: "WR",
|
|
847
|
+
Te: "TE",
|
|
848
|
+
K: "K"
|
|
849
|
+
};
|
|
850
|
+
})(GetNflCustomRankingsRequest || (GetNflCustomRankingsRequest = {}));
|
|
851
|
+
|
|
695
852
|
// api/resources/nfl/index.ts
|
|
696
853
|
var nfl_exports = {};
|
|
697
854
|
__export(nfl_exports, {
|
|
855
|
+
GetNflCustomRankingsRequest: () => GetNflCustomRankingsRequest,
|
|
856
|
+
GetNflDepthChartChangesRequestChangeType: () => GetNflDepthChartChangesRequestChangeType,
|
|
857
|
+
GetNflDepthChartChangesRequestPosition: () => GetNflDepthChartChangesRequestPosition,
|
|
858
|
+
GetNflDepthChartChangesResponse: () => GetNflDepthChartChangesResponse,
|
|
698
859
|
GetNflRankingsRequestFormat: () => GetNflRankingsRequestFormat,
|
|
699
860
|
GetNflRankingsRequestPosition: () => GetNflRankingsRequestPosition,
|
|
700
861
|
GetNflRankingsResponse: () => GetNflRankingsResponse,
|
|
@@ -705,6 +866,39 @@ __export(nfl_exports, {
|
|
|
705
866
|
ListNflTeamsRequestConference: () => ListNflTeamsRequestConference
|
|
706
867
|
});
|
|
707
868
|
|
|
869
|
+
// api/resources/nfl/types/GetNflDepthChartChangesRequestChangeType.ts
|
|
870
|
+
var GetNflDepthChartChangesRequestChangeType = {
|
|
871
|
+
Promoted: "promoted",
|
|
872
|
+
Demoted: "demoted",
|
|
873
|
+
Added: "added",
|
|
874
|
+
Removed: "removed"
|
|
875
|
+
};
|
|
876
|
+
|
|
877
|
+
// api/resources/nfl/types/GetNflDepthChartChangesRequestPosition.ts
|
|
878
|
+
var GetNflDepthChartChangesRequestPosition = {
|
|
879
|
+
Qb: "QB",
|
|
880
|
+
Rb: "RB",
|
|
881
|
+
Wr: "WR",
|
|
882
|
+
Te: "TE"
|
|
883
|
+
};
|
|
884
|
+
|
|
885
|
+
// api/resources/nfl/types/GetNflDepthChartChangesResponse.ts
|
|
886
|
+
var GetNflDepthChartChangesResponse;
|
|
887
|
+
((GetNflDepthChartChangesResponse2) => {
|
|
888
|
+
let Data;
|
|
889
|
+
((Data2) => {
|
|
890
|
+
let Item;
|
|
891
|
+
((Item2) => {
|
|
892
|
+
Item2.ChangeType = {
|
|
893
|
+
Promoted: "promoted",
|
|
894
|
+
Demoted: "demoted",
|
|
895
|
+
Added: "added",
|
|
896
|
+
Removed: "removed"
|
|
897
|
+
};
|
|
898
|
+
})(Item = Data2.Item || (Data2.Item = {}));
|
|
899
|
+
})(Data = GetNflDepthChartChangesResponse2.Data || (GetNflDepthChartChangesResponse2.Data = {}));
|
|
900
|
+
})(GetNflDepthChartChangesResponse || (GetNflDepthChartChangesResponse = {}));
|
|
901
|
+
|
|
708
902
|
// api/resources/nfl/types/GetNflRankingsRequestFormat.ts
|
|
709
903
|
var GetNflRankingsRequestFormat = {
|
|
710
904
|
Ppr: "ppr",
|
|
@@ -4190,38 +4384,51 @@ var IntelligenceClient = class {
|
|
|
4190
4384
|
}
|
|
4191
4385
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/analytics/trends");
|
|
4192
4386
|
}
|
|
4193
|
-
};
|
|
4194
|
-
|
|
4195
|
-
// api/resources/mcp/client/Client.ts
|
|
4196
|
-
var McpClient = class {
|
|
4197
|
-
constructor(options = {}) {
|
|
4198
|
-
this._options = normalizeClientOptionsWithAuth(options);
|
|
4199
|
-
}
|
|
4200
4387
|
/**
|
|
4201
|
-
*
|
|
4388
|
+
* Full beat reporter signal feed with sport, severity, and type filters. More flexible than `/intelligence/news` — supports date ranges up to 200 signals, all sports, and granular filtering. Signals are refreshed continuously from ESPN, Reddit, and AI-extracted injury intel.
|
|
4202
4389
|
*
|
|
4203
|
-
*
|
|
4390
|
+
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
4204
4391
|
*
|
|
4205
|
-
*
|
|
4392
|
+
* @param {PlaycallerApi.GetIntelligenceSignalsRequest} request
|
|
4393
|
+
* @param {IntelligenceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4206
4394
|
*
|
|
4207
|
-
* @
|
|
4395
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
4396
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
4397
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4398
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4208
4399
|
*
|
|
4209
4400
|
* @example
|
|
4210
|
-
* await client.
|
|
4401
|
+
* await client.intelligence.getIntelligenceSignals({
|
|
4402
|
+
* type: "injury",
|
|
4403
|
+
* since: "2026-07-10"
|
|
4404
|
+
* })
|
|
4211
4405
|
*/
|
|
4212
|
-
|
|
4213
|
-
return HttpResponsePromise.fromPromise(this.
|
|
4406
|
+
getIntelligenceSignals(request = {}, requestOptions) {
|
|
4407
|
+
return HttpResponsePromise.fromPromise(this.__getIntelligenceSignals(request, requestOptions));
|
|
4214
4408
|
}
|
|
4215
|
-
async
|
|
4216
|
-
const
|
|
4409
|
+
async __getIntelligenceSignals(request = {}, requestOptions) {
|
|
4410
|
+
const { sport, severity, type: type_, since, limit } = request;
|
|
4411
|
+
const _queryParams = {
|
|
4412
|
+
sport: sport != null ? sport : void 0,
|
|
4413
|
+
severity: severity != null ? severity : void 0,
|
|
4414
|
+
type: type_,
|
|
4415
|
+
since: since != null ? since : void 0,
|
|
4416
|
+
limit
|
|
4417
|
+
};
|
|
4418
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4419
|
+
const _headers = mergeHeaders(
|
|
4420
|
+
_authRequest.headers,
|
|
4421
|
+
this._options?.headers,
|
|
4422
|
+
requestOptions?.headers
|
|
4423
|
+
);
|
|
4217
4424
|
const _response = await fetcher({
|
|
4218
4425
|
url: url_exports.join(
|
|
4219
4426
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4220
|
-
"
|
|
4427
|
+
"v1/intelligence/signals"
|
|
4221
4428
|
),
|
|
4222
4429
|
method: "GET",
|
|
4223
4430
|
headers: _headers,
|
|
4224
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4431
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4225
4432
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4226
4433
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4227
4434
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -4229,96 +4436,71 @@ var McpClient = class {
|
|
|
4229
4436
|
logging: this._options.logging
|
|
4230
4437
|
});
|
|
4231
4438
|
if (_response.ok) {
|
|
4232
|
-
return {
|
|
4439
|
+
return {
|
|
4440
|
+
data: _response.body,
|
|
4441
|
+
rawResponse: _response.rawResponse
|
|
4442
|
+
};
|
|
4233
4443
|
}
|
|
4234
4444
|
if (_response.error.reason === "status-code") {
|
|
4235
|
-
|
|
4236
|
-
|
|
4237
|
-
|
|
4238
|
-
|
|
4239
|
-
|
|
4445
|
+
switch (_response.error.statusCode) {
|
|
4446
|
+
case 401:
|
|
4447
|
+
throw new UnauthorizedError(
|
|
4448
|
+
_response.error.body,
|
|
4449
|
+
_response.rawResponse
|
|
4450
|
+
);
|
|
4451
|
+
case 402:
|
|
4452
|
+
throw new PaymentRequiredError(
|
|
4453
|
+
_response.error.body,
|
|
4454
|
+
_response.rawResponse
|
|
4455
|
+
);
|
|
4456
|
+
case 429:
|
|
4457
|
+
throw new TooManyRequestsError(
|
|
4458
|
+
_response.error.body,
|
|
4459
|
+
_response.rawResponse
|
|
4460
|
+
);
|
|
4461
|
+
case 500:
|
|
4462
|
+
throw new InternalServerError(
|
|
4463
|
+
_response.error.body,
|
|
4464
|
+
_response.rawResponse
|
|
4465
|
+
);
|
|
4466
|
+
default:
|
|
4467
|
+
throw new PlaycallerApiError({
|
|
4468
|
+
statusCode: _response.error.statusCode,
|
|
4469
|
+
body: _response.error.body,
|
|
4470
|
+
rawResponse: _response.rawResponse
|
|
4471
|
+
});
|
|
4472
|
+
}
|
|
4240
4473
|
}
|
|
4241
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/
|
|
4474
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/intelligence/signals");
|
|
4242
4475
|
}
|
|
4243
4476
|
/**
|
|
4244
|
-
*
|
|
4245
|
-
*
|
|
4246
|
-
* **Available tools (10):**
|
|
4247
|
-
* - `get_injury_signals` — Active beat reporter signals filtered by sport/severity
|
|
4248
|
-
* - `get_player_identity` — Resolve a player name or platform ID across ESPN, Sleeper, Yahoo, NFL.com
|
|
4249
|
-
* - `get_anomaly_scores` — Players with usage patterns deviating from 3-season baseline (score 0–100)
|
|
4250
|
-
* - `get_prediction_markets` — Active Kalshi prop markets with AI confidence scores
|
|
4251
|
-
* - `get_player_projections` — AI fantasy point projections using recent game logs and injury signals
|
|
4252
|
-
* - `get_player_stats` — Game log for any player by name across NFL/MLB/NBA historical_performance
|
|
4253
|
-
* - `get_team_roster` — Active roster for any team by sport and abbreviation
|
|
4254
|
-
* - `get_games` — Schedule and scores for all 9 sports (NFL, MLB, NBA, NHL, CFB, Soccer, Tennis, Golf, UFC)
|
|
4255
|
-
* - `get_standings` — Division/conference standings for any sport and season
|
|
4256
|
-
* - `get_player_dossier` — Consolidated single-call profile: identity + injury + anomaly score + recent stats
|
|
4257
|
-
*
|
|
4258
|
-
* **Config for Cursor (.cursor/mcp.json):**
|
|
4259
|
-
* ```json
|
|
4260
|
-
* {
|
|
4261
|
-
* "mcpServers": {
|
|
4262
|
-
* "playcaller": {
|
|
4263
|
-
* "url": "https://playcallerapp.com/mcp",
|
|
4264
|
-
* "headers": { "X-PlayCaller-Key": "YOUR_API_KEY" }
|
|
4265
|
-
* }
|
|
4266
|
-
* }
|
|
4267
|
-
* }
|
|
4268
|
-
* ```
|
|
4269
|
-
*
|
|
4270
|
-
* **Get a free trial key instantly — no card required:**
|
|
4271
|
-
* ```bash
|
|
4272
|
-
* curl -X POST https://playcallerapp.com/mcp/start-trial \
|
|
4273
|
-
* -H "Content-Type: application/json" \
|
|
4274
|
-
* -d '{"email": "you@example.com"}'
|
|
4275
|
-
* ```
|
|
4276
|
-
*
|
|
4277
|
-
* **Tier access:** Developer Sandbox, Build, Growth, Pro Insights, Syndicate Alpha
|
|
4477
|
+
* Returns per-week NFL confidence model predictions for a player, including resolved outcomes (actual fantasy points vs. positional median) and rolling hit rate. Useful for validating our model's accuracy on specific players and building ML training pipelines.
|
|
4278
4478
|
*
|
|
4279
|
-
*
|
|
4280
|
-
* @param {McpClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4479
|
+
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
4281
4480
|
*
|
|
4282
|
-
* @
|
|
4283
|
-
*
|
|
4284
|
-
* jsonrpc: "2.0",
|
|
4285
|
-
* id: 1,
|
|
4286
|
-
* method: "tools/list"
|
|
4287
|
-
* })
|
|
4481
|
+
* @param {PlaycallerApi.GetModelPredictionsRequest} request
|
|
4482
|
+
* @param {IntelligenceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4288
4483
|
*
|
|
4289
|
-
* @
|
|
4290
|
-
*
|
|
4291
|
-
*
|
|
4292
|
-
*
|
|
4293
|
-
* method: "tools/call",
|
|
4294
|
-
* params: {
|
|
4295
|
-
* name: "get_injury_signals",
|
|
4296
|
-
* arguments: {
|
|
4297
|
-
* "sport": "nfl",
|
|
4298
|
-
* "severity": "high",
|
|
4299
|
-
* "limit": 5
|
|
4300
|
-
* }
|
|
4301
|
-
* }
|
|
4302
|
-
* })
|
|
4484
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
4485
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
4486
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4487
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4303
4488
|
*
|
|
4304
4489
|
* @example
|
|
4305
|
-
* await client.
|
|
4306
|
-
*
|
|
4307
|
-
* id: 3,
|
|
4308
|
-
* method: "tools/call",
|
|
4309
|
-
* params: {
|
|
4310
|
-
* name: "get_player_identity",
|
|
4311
|
-
* arguments: {
|
|
4312
|
-
* "name": "Christian McCaffrey",
|
|
4313
|
-
* "sport": "nfl"
|
|
4314
|
-
* }
|
|
4315
|
-
* }
|
|
4490
|
+
* await client.intelligence.getModelPredictions({
|
|
4491
|
+
* playerId: "playerId"
|
|
4316
4492
|
* })
|
|
4317
4493
|
*/
|
|
4318
|
-
|
|
4319
|
-
return HttpResponsePromise.fromPromise(this.
|
|
4494
|
+
getModelPredictions(request, requestOptions) {
|
|
4495
|
+
return HttpResponsePromise.fromPromise(this.__getModelPredictions(request, requestOptions));
|
|
4320
4496
|
}
|
|
4321
|
-
async
|
|
4497
|
+
async __getModelPredictions(request, requestOptions) {
|
|
4498
|
+
const { playerId, limit, season, model_type: modelType } = request;
|
|
4499
|
+
const _queryParams = {
|
|
4500
|
+
limit,
|
|
4501
|
+
season,
|
|
4502
|
+
model_type: modelType
|
|
4503
|
+
};
|
|
4322
4504
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4323
4505
|
const _headers = mergeHeaders(
|
|
4324
4506
|
_authRequest.headers,
|
|
@@ -4328,14 +4510,11 @@ var McpClient = class {
|
|
|
4328
4510
|
const _response = await fetcher({
|
|
4329
4511
|
url: url_exports.join(
|
|
4330
4512
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4331
|
-
|
|
4513
|
+
`v1/model/predictions/${url_exports.encodePathParam(playerId)}`
|
|
4332
4514
|
),
|
|
4333
|
-
method: "
|
|
4515
|
+
method: "GET",
|
|
4334
4516
|
headers: _headers,
|
|
4335
|
-
|
|
4336
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4337
|
-
requestType: "json",
|
|
4338
|
-
body: request,
|
|
4517
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4339
4518
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4340
4519
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4341
4520
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -4343,44 +4522,273 @@ var McpClient = class {
|
|
|
4343
4522
|
logging: this._options.logging
|
|
4344
4523
|
});
|
|
4345
4524
|
if (_response.ok) {
|
|
4346
|
-
return {
|
|
4347
|
-
|
|
4348
|
-
if (_response.error.reason === "status-code") {
|
|
4349
|
-
throw new PlaycallerApiError({
|
|
4350
|
-
statusCode: _response.error.statusCode,
|
|
4351
|
-
body: _response.error.body,
|
|
4525
|
+
return {
|
|
4526
|
+
data: _response.body,
|
|
4352
4527
|
rawResponse: _response.rawResponse
|
|
4353
|
-
}
|
|
4528
|
+
};
|
|
4354
4529
|
}
|
|
4355
|
-
|
|
4356
|
-
|
|
4530
|
+
if (_response.error.reason === "status-code") {
|
|
4531
|
+
switch (_response.error.statusCode) {
|
|
4532
|
+
case 401:
|
|
4533
|
+
throw new UnauthorizedError(
|
|
4534
|
+
_response.error.body,
|
|
4535
|
+
_response.rawResponse
|
|
4536
|
+
);
|
|
4537
|
+
case 402:
|
|
4538
|
+
throw new PaymentRequiredError(
|
|
4539
|
+
_response.error.body,
|
|
4540
|
+
_response.rawResponse
|
|
4541
|
+
);
|
|
4542
|
+
case 429:
|
|
4543
|
+
throw new TooManyRequestsError(
|
|
4544
|
+
_response.error.body,
|
|
4545
|
+
_response.rawResponse
|
|
4546
|
+
);
|
|
4547
|
+
case 500:
|
|
4548
|
+
throw new InternalServerError(
|
|
4549
|
+
_response.error.body,
|
|
4550
|
+
_response.rawResponse
|
|
4551
|
+
);
|
|
4552
|
+
default:
|
|
4553
|
+
throw new PlaycallerApiError({
|
|
4554
|
+
statusCode: _response.error.statusCode,
|
|
4555
|
+
body: _response.error.body,
|
|
4556
|
+
rawResponse: _response.rawResponse
|
|
4557
|
+
});
|
|
4558
|
+
}
|
|
4559
|
+
}
|
|
4560
|
+
return handleNonStatusCodeError(
|
|
4561
|
+
_response.error,
|
|
4562
|
+
_response.rawResponse,
|
|
4563
|
+
"GET",
|
|
4564
|
+
"/v1/model/predictions/{playerId}"
|
|
4565
|
+
);
|
|
4566
|
+
}
|
|
4357
4567
|
/**
|
|
4358
|
-
*
|
|
4359
|
-
*
|
|
4360
|
-
* **Rate limit:** 5 requests per IP per hour
|
|
4568
|
+
* Returns a ranked list of waiver-eligible players ordered by anomaly signal strength. Combines usage spikes, snap-share shifts, and target-rate anomalies into a single priority score — no client-side merging required. Optionally excludes injured players.
|
|
4361
4569
|
*
|
|
4362
|
-
* **
|
|
4570
|
+
* **Tier access:** Growth, Pro Insights, Syndicate Alpha
|
|
4363
4571
|
*
|
|
4364
|
-
* @param {PlaycallerApi.
|
|
4365
|
-
* @param {
|
|
4572
|
+
* @param {PlaycallerApi.GetWaiverPriorityRequest} request
|
|
4573
|
+
* @param {IntelligenceClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4366
4574
|
*
|
|
4367
|
-
* @throws {@link PlaycallerApi.
|
|
4575
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
4576
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
4368
4577
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4578
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4369
4579
|
*
|
|
4370
4580
|
* @example
|
|
4371
|
-
* await client.
|
|
4372
|
-
*
|
|
4581
|
+
* await client.intelligence.getWaiverPriority({
|
|
4582
|
+
* sport: "nfl"
|
|
4373
4583
|
* })
|
|
4374
4584
|
*/
|
|
4375
|
-
|
|
4376
|
-
return HttpResponsePromise.fromPromise(this.
|
|
4585
|
+
getWaiverPriority(request, requestOptions) {
|
|
4586
|
+
return HttpResponsePromise.fromPromise(this.__getWaiverPriority(request, requestOptions));
|
|
4377
4587
|
}
|
|
4378
|
-
async
|
|
4588
|
+
async __getWaiverPriority(request, requestOptions) {
|
|
4589
|
+
const { sport, limit, position, exclude_injured: excludeInjured } = request;
|
|
4590
|
+
const _queryParams = {
|
|
4591
|
+
limit,
|
|
4592
|
+
position,
|
|
4593
|
+
exclude_injured: excludeInjured
|
|
4594
|
+
};
|
|
4595
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4596
|
+
const _headers = mergeHeaders(
|
|
4597
|
+
_authRequest.headers,
|
|
4598
|
+
this._options?.headers,
|
|
4599
|
+
requestOptions?.headers
|
|
4600
|
+
);
|
|
4601
|
+
const _response = await fetcher({
|
|
4602
|
+
url: url_exports.join(
|
|
4603
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4604
|
+
`v1/${url_exports.encodePathParam(sport)}/waiver-priority`
|
|
4605
|
+
),
|
|
4606
|
+
method: "GET",
|
|
4607
|
+
headers: _headers,
|
|
4608
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4609
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4610
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4611
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4612
|
+
fetchFn: this._options?.fetch,
|
|
4613
|
+
logging: this._options.logging
|
|
4614
|
+
});
|
|
4615
|
+
if (_response.ok) {
|
|
4616
|
+
return {
|
|
4617
|
+
data: _response.body,
|
|
4618
|
+
rawResponse: _response.rawResponse
|
|
4619
|
+
};
|
|
4620
|
+
}
|
|
4621
|
+
if (_response.error.reason === "status-code") {
|
|
4622
|
+
switch (_response.error.statusCode) {
|
|
4623
|
+
case 401:
|
|
4624
|
+
throw new UnauthorizedError(
|
|
4625
|
+
_response.error.body,
|
|
4626
|
+
_response.rawResponse
|
|
4627
|
+
);
|
|
4628
|
+
case 402:
|
|
4629
|
+
throw new PaymentRequiredError(
|
|
4630
|
+
_response.error.body,
|
|
4631
|
+
_response.rawResponse
|
|
4632
|
+
);
|
|
4633
|
+
case 429:
|
|
4634
|
+
throw new TooManyRequestsError(
|
|
4635
|
+
_response.error.body,
|
|
4636
|
+
_response.rawResponse
|
|
4637
|
+
);
|
|
4638
|
+
case 500:
|
|
4639
|
+
throw new InternalServerError(
|
|
4640
|
+
_response.error.body,
|
|
4641
|
+
_response.rawResponse
|
|
4642
|
+
);
|
|
4643
|
+
default:
|
|
4644
|
+
throw new PlaycallerApiError({
|
|
4645
|
+
statusCode: _response.error.statusCode,
|
|
4646
|
+
body: _response.error.body,
|
|
4647
|
+
rawResponse: _response.rawResponse
|
|
4648
|
+
});
|
|
4649
|
+
}
|
|
4650
|
+
}
|
|
4651
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/{sport}/waiver-priority");
|
|
4652
|
+
}
|
|
4653
|
+
};
|
|
4654
|
+
|
|
4655
|
+
// api/resources/mcp/client/Client.ts
|
|
4656
|
+
var McpClient = class {
|
|
4657
|
+
constructor(options = {}) {
|
|
4658
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
4659
|
+
}
|
|
4660
|
+
/**
|
|
4661
|
+
* Returns human-readable JSON describing the PlayCaller MCP server: endpoint URL, auth method, all available tools with descriptions, and links to documentation.
|
|
4662
|
+
*
|
|
4663
|
+
* Point Cursor, Claude Desktop, or any MCP-compatible client at this URL to discover available tools automatically.
|
|
4664
|
+
*
|
|
4665
|
+
* **Auth:** No authentication required for GET (tool invocation requires X-PlayCaller-Key)
|
|
4666
|
+
*
|
|
4667
|
+
* @param {McpClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4668
|
+
*
|
|
4669
|
+
* @example
|
|
4670
|
+
* await client.mcp.getMcpInfo()
|
|
4671
|
+
*/
|
|
4672
|
+
getMcpInfo(requestOptions) {
|
|
4673
|
+
return HttpResponsePromise.fromPromise(this.__getMcpInfo(requestOptions));
|
|
4674
|
+
}
|
|
4675
|
+
async __getMcpInfo(requestOptions) {
|
|
4379
4676
|
const _headers = mergeHeaders(this._options?.headers, requestOptions?.headers);
|
|
4380
4677
|
const _response = await fetcher({
|
|
4381
4678
|
url: url_exports.join(
|
|
4382
4679
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4383
|
-
"mcp
|
|
4680
|
+
"mcp"
|
|
4681
|
+
),
|
|
4682
|
+
method: "GET",
|
|
4683
|
+
headers: _headers,
|
|
4684
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4685
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4686
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4687
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4688
|
+
fetchFn: this._options?.fetch,
|
|
4689
|
+
logging: this._options.logging
|
|
4690
|
+
});
|
|
4691
|
+
if (_response.ok) {
|
|
4692
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4693
|
+
}
|
|
4694
|
+
if (_response.error.reason === "status-code") {
|
|
4695
|
+
throw new PlaycallerApiError({
|
|
4696
|
+
statusCode: _response.error.statusCode,
|
|
4697
|
+
body: _response.error.body,
|
|
4698
|
+
rawResponse: _response.rawResponse
|
|
4699
|
+
});
|
|
4700
|
+
}
|
|
4701
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/mcp");
|
|
4702
|
+
}
|
|
4703
|
+
/**
|
|
4704
|
+
* The PlayCaller MCP server implements Anthropic's Model Context Protocol over HTTP transport. Send JSON-RPC 2.0 messages to invoke sports intelligence tools from any AI application.
|
|
4705
|
+
*
|
|
4706
|
+
* **Available tools (10):**
|
|
4707
|
+
* - `get_injury_signals` — Active beat reporter signals filtered by sport/severity
|
|
4708
|
+
* - `get_player_identity` — Resolve a player name or platform ID across ESPN, Sleeper, Yahoo, NFL.com
|
|
4709
|
+
* - `get_anomaly_scores` — Players with usage patterns deviating from 3-season baseline (score 0–100)
|
|
4710
|
+
* - `get_prediction_markets` — Active Kalshi prop markets with AI confidence scores
|
|
4711
|
+
* - `get_player_projections` — AI fantasy point projections using recent game logs and injury signals
|
|
4712
|
+
* - `get_player_stats` — Game log for any player by name across NFL/MLB/NBA historical_performance
|
|
4713
|
+
* - `get_team_roster` — Active roster for any team by sport and abbreviation
|
|
4714
|
+
* - `get_games` — Schedule and scores for all 9 sports (NFL, MLB, NBA, NHL, CFB, Soccer, Tennis, Golf, UFC)
|
|
4715
|
+
* - `get_standings` — Division/conference standings for any sport and season
|
|
4716
|
+
* - `get_player_dossier` — Consolidated single-call profile: identity + injury + anomaly score + recent stats
|
|
4717
|
+
*
|
|
4718
|
+
* **Config for Cursor (.cursor/mcp.json):**
|
|
4719
|
+
* ```json
|
|
4720
|
+
* {
|
|
4721
|
+
* "mcpServers": {
|
|
4722
|
+
* "playcaller": {
|
|
4723
|
+
* "url": "https://playcallerapp.com/mcp",
|
|
4724
|
+
* "headers": { "X-PlayCaller-Key": "YOUR_API_KEY" }
|
|
4725
|
+
* }
|
|
4726
|
+
* }
|
|
4727
|
+
* }
|
|
4728
|
+
* ```
|
|
4729
|
+
*
|
|
4730
|
+
* **Get a free trial key instantly — no card required:**
|
|
4731
|
+
* ```bash
|
|
4732
|
+
* curl -X POST https://playcallerapp.com/mcp/start-trial \
|
|
4733
|
+
* -H "Content-Type: application/json" \
|
|
4734
|
+
* -d '{"email": "you@example.com"}'
|
|
4735
|
+
* ```
|
|
4736
|
+
*
|
|
4737
|
+
* **Tier access:** Developer Sandbox, Build, Growth, Pro Insights, Syndicate Alpha
|
|
4738
|
+
*
|
|
4739
|
+
* @param {PlaycallerApi.InvokeMcpToolRequest} request
|
|
4740
|
+
* @param {McpClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4741
|
+
*
|
|
4742
|
+
* @example
|
|
4743
|
+
* await client.mcp.invokeMcpTool({
|
|
4744
|
+
* jsonrpc: "2.0",
|
|
4745
|
+
* id: 1,
|
|
4746
|
+
* method: "tools/list"
|
|
4747
|
+
* })
|
|
4748
|
+
*
|
|
4749
|
+
* @example
|
|
4750
|
+
* await client.mcp.invokeMcpTool({
|
|
4751
|
+
* jsonrpc: "2.0",
|
|
4752
|
+
* id: 2,
|
|
4753
|
+
* method: "tools/call",
|
|
4754
|
+
* params: {
|
|
4755
|
+
* name: "get_injury_signals",
|
|
4756
|
+
* arguments: {
|
|
4757
|
+
* "sport": "nfl",
|
|
4758
|
+
* "severity": "high",
|
|
4759
|
+
* "limit": 5
|
|
4760
|
+
* }
|
|
4761
|
+
* }
|
|
4762
|
+
* })
|
|
4763
|
+
*
|
|
4764
|
+
* @example
|
|
4765
|
+
* await client.mcp.invokeMcpTool({
|
|
4766
|
+
* jsonrpc: "2.0",
|
|
4767
|
+
* id: 3,
|
|
4768
|
+
* method: "tools/call",
|
|
4769
|
+
* params: {
|
|
4770
|
+
* name: "get_player_identity",
|
|
4771
|
+
* arguments: {
|
|
4772
|
+
* "name": "Christian McCaffrey",
|
|
4773
|
+
* "sport": "nfl"
|
|
4774
|
+
* }
|
|
4775
|
+
* }
|
|
4776
|
+
* })
|
|
4777
|
+
*/
|
|
4778
|
+
invokeMcpTool(request, requestOptions) {
|
|
4779
|
+
return HttpResponsePromise.fromPromise(this.__invokeMcpTool(request, requestOptions));
|
|
4780
|
+
}
|
|
4781
|
+
async __invokeMcpTool(request, requestOptions) {
|
|
4782
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4783
|
+
const _headers = mergeHeaders(
|
|
4784
|
+
_authRequest.headers,
|
|
4785
|
+
this._options?.headers,
|
|
4786
|
+
requestOptions?.headers
|
|
4787
|
+
);
|
|
4788
|
+
const _response = await fetcher({
|
|
4789
|
+
url: url_exports.join(
|
|
4790
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4791
|
+
"mcp"
|
|
4384
4792
|
),
|
|
4385
4793
|
method: "POST",
|
|
4386
4794
|
headers: _headers,
|
|
@@ -4397,15 +4805,541 @@ var McpClient = class {
|
|
|
4397
4805
|
if (_response.ok) {
|
|
4398
4806
|
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4399
4807
|
}
|
|
4808
|
+
if (_response.error.reason === "status-code") {
|
|
4809
|
+
throw new PlaycallerApiError({
|
|
4810
|
+
statusCode: _response.error.statusCode,
|
|
4811
|
+
body: _response.error.body,
|
|
4812
|
+
rawResponse: _response.rawResponse
|
|
4813
|
+
});
|
|
4814
|
+
}
|
|
4815
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/mcp");
|
|
4816
|
+
}
|
|
4817
|
+
/**
|
|
4818
|
+
* Provisions a 14-day Sandbox API key and returns it immediately in the response body — no email verification gate, no credit card required. Use this to start calling PlayCaller MCP tools from Claude Desktop, Cursor, Windsurf, or any MCP-compatible AI agent within seconds.
|
|
4819
|
+
*
|
|
4820
|
+
* **Rate limit:** 5 requests per IP per hour
|
|
4821
|
+
*
|
|
4822
|
+
* **Trial limits:** 200 requests/day for 14 days (Sandbox tier). Upgrade at playcallerapp.com/developer#pricing to keep access.
|
|
4823
|
+
*
|
|
4824
|
+
* @param {PlaycallerApi.StartMcpTrialRequest} request
|
|
4825
|
+
* @param {McpClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4826
|
+
*
|
|
4827
|
+
* @throws {@link PlaycallerApi.BadRequestError}
|
|
4828
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4829
|
+
*
|
|
4830
|
+
* @example
|
|
4831
|
+
* await client.mcp.startMcpTrial({
|
|
4832
|
+
* email: "dev@example.com"
|
|
4833
|
+
* })
|
|
4834
|
+
*/
|
|
4835
|
+
startMcpTrial(request, requestOptions) {
|
|
4836
|
+
return HttpResponsePromise.fromPromise(this.__startMcpTrial(request, requestOptions));
|
|
4837
|
+
}
|
|
4838
|
+
async __startMcpTrial(request, requestOptions) {
|
|
4839
|
+
const _headers = mergeHeaders(this._options?.headers, requestOptions?.headers);
|
|
4840
|
+
const _response = await fetcher({
|
|
4841
|
+
url: url_exports.join(
|
|
4842
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4843
|
+
"mcp/start-trial"
|
|
4844
|
+
),
|
|
4845
|
+
method: "POST",
|
|
4846
|
+
headers: _headers,
|
|
4847
|
+
contentType: "application/json",
|
|
4848
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4849
|
+
requestType: "json",
|
|
4850
|
+
body: request,
|
|
4851
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4852
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4853
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4854
|
+
fetchFn: this._options?.fetch,
|
|
4855
|
+
logging: this._options.logging
|
|
4856
|
+
});
|
|
4857
|
+
if (_response.ok) {
|
|
4858
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4859
|
+
}
|
|
4860
|
+
if (_response.error.reason === "status-code") {
|
|
4861
|
+
switch (_response.error.statusCode) {
|
|
4862
|
+
case 400:
|
|
4863
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4864
|
+
case 429:
|
|
4865
|
+
throw new TooManyRequestsError(
|
|
4866
|
+
_response.error.body,
|
|
4867
|
+
_response.rawResponse
|
|
4868
|
+
);
|
|
4869
|
+
default:
|
|
4870
|
+
throw new PlaycallerApiError({
|
|
4871
|
+
statusCode: _response.error.statusCode,
|
|
4872
|
+
body: _response.error.body,
|
|
4873
|
+
rawResponse: _response.rawResponse
|
|
4874
|
+
});
|
|
4875
|
+
}
|
|
4876
|
+
}
|
|
4877
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/mcp/start-trial");
|
|
4878
|
+
}
|
|
4879
|
+
};
|
|
4880
|
+
|
|
4881
|
+
// api/resources/mlb/client/Client.ts
|
|
4882
|
+
var MlbClient = class {
|
|
4883
|
+
constructor(options = {}) {
|
|
4884
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
4885
|
+
}
|
|
4886
|
+
/**
|
|
4887
|
+
* Returns all active MLB players (966 total). Positions, teams, and statuses are normalized from MLB Stats API and reconciled against ESPN for accuracy.
|
|
4888
|
+
*
|
|
4889
|
+
* Filter by position and team to build DFS pools or lineup constraints without doing the normalization yourself.
|
|
4890
|
+
*
|
|
4891
|
+
* **Tier access:** Developer Sandbox, Build, Growth, Pro Insights, Syndicate Alpha
|
|
4892
|
+
*
|
|
4893
|
+
* @param {PlaycallerApi.ListMlbPlayersRequest} request
|
|
4894
|
+
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4895
|
+
*
|
|
4896
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
4897
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4898
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4899
|
+
*
|
|
4900
|
+
* @example
|
|
4901
|
+
* await client.mlb.listMlbPlayers({
|
|
4902
|
+
* team: "NYY",
|
|
4903
|
+
* search: "Ohtani"
|
|
4904
|
+
* })
|
|
4905
|
+
*/
|
|
4906
|
+
listMlbPlayers(request = {}, requestOptions) {
|
|
4907
|
+
return HttpResponsePromise.fromPromise(this.__listMlbPlayers(request, requestOptions));
|
|
4908
|
+
}
|
|
4909
|
+
async __listMlbPlayers(request = {}, requestOptions) {
|
|
4910
|
+
const { position, team, status, search, limit, offset } = request;
|
|
4911
|
+
const _queryParams = {
|
|
4912
|
+
position: position != null ? position : void 0,
|
|
4913
|
+
team,
|
|
4914
|
+
status: status != null ? status : void 0,
|
|
4915
|
+
search,
|
|
4916
|
+
limit,
|
|
4917
|
+
offset
|
|
4918
|
+
};
|
|
4919
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4920
|
+
const _headers = mergeHeaders(
|
|
4921
|
+
_authRequest.headers,
|
|
4922
|
+
this._options?.headers,
|
|
4923
|
+
requestOptions?.headers
|
|
4924
|
+
);
|
|
4925
|
+
const _response = await fetcher({
|
|
4926
|
+
url: url_exports.join(
|
|
4927
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4928
|
+
"v1/mlb/players"
|
|
4929
|
+
),
|
|
4930
|
+
method: "GET",
|
|
4931
|
+
headers: _headers,
|
|
4932
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4933
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4934
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4935
|
+
abortSignal: requestOptions?.abortSignal,
|
|
4936
|
+
fetchFn: this._options?.fetch,
|
|
4937
|
+
logging: this._options.logging
|
|
4938
|
+
});
|
|
4939
|
+
if (_response.ok) {
|
|
4940
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4941
|
+
}
|
|
4942
|
+
if (_response.error.reason === "status-code") {
|
|
4943
|
+
switch (_response.error.statusCode) {
|
|
4944
|
+
case 401:
|
|
4945
|
+
throw new UnauthorizedError(
|
|
4946
|
+
_response.error.body,
|
|
4947
|
+
_response.rawResponse
|
|
4948
|
+
);
|
|
4949
|
+
case 429:
|
|
4950
|
+
throw new TooManyRequestsError(
|
|
4951
|
+
_response.error.body,
|
|
4952
|
+
_response.rawResponse
|
|
4953
|
+
);
|
|
4954
|
+
case 500:
|
|
4955
|
+
throw new InternalServerError(
|
|
4956
|
+
_response.error.body,
|
|
4957
|
+
_response.rawResponse
|
|
4958
|
+
);
|
|
4959
|
+
default:
|
|
4960
|
+
throw new PlaycallerApiError({
|
|
4961
|
+
statusCode: _response.error.statusCode,
|
|
4962
|
+
body: _response.error.body,
|
|
4963
|
+
rawResponse: _response.rawResponse
|
|
4964
|
+
});
|
|
4965
|
+
}
|
|
4966
|
+
}
|
|
4967
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/players");
|
|
4968
|
+
}
|
|
4969
|
+
/**
|
|
4970
|
+
* Returns the full profile for a single MLB player by PlayCaller ID. Use `/v1/mlb/players?search=` to find IDs by name.
|
|
4971
|
+
*
|
|
4972
|
+
* **Tier access:** Developer Sandbox, Build, Growth, Pro Insights, Syndicate Alpha
|
|
4973
|
+
*
|
|
4974
|
+
* @param {PlaycallerApi.GetMlbPlayerRequest} request
|
|
4975
|
+
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4976
|
+
*
|
|
4977
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
4978
|
+
* @throws {@link PlaycallerApi.NotFoundError}
|
|
4979
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4980
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4981
|
+
*
|
|
4982
|
+
* @example
|
|
4983
|
+
* await client.mlb.getMlbPlayer({
|
|
4984
|
+
* id: "pc_mlb_001234"
|
|
4985
|
+
* })
|
|
4986
|
+
*/
|
|
4987
|
+
getMlbPlayer(request, requestOptions) {
|
|
4988
|
+
return HttpResponsePromise.fromPromise(this.__getMlbPlayer(request, requestOptions));
|
|
4989
|
+
}
|
|
4990
|
+
async __getMlbPlayer(request, requestOptions) {
|
|
4991
|
+
const { id } = request;
|
|
4992
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4993
|
+
const _headers = mergeHeaders(
|
|
4994
|
+
_authRequest.headers,
|
|
4995
|
+
this._options?.headers,
|
|
4996
|
+
requestOptions?.headers
|
|
4997
|
+
);
|
|
4998
|
+
const _response = await fetcher({
|
|
4999
|
+
url: url_exports.join(
|
|
5000
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
5001
|
+
`v1/mlb/players/${url_exports.encodePathParam(id)}`
|
|
5002
|
+
),
|
|
5003
|
+
method: "GET",
|
|
5004
|
+
headers: _headers,
|
|
5005
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5006
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5007
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5008
|
+
abortSignal: requestOptions?.abortSignal,
|
|
5009
|
+
fetchFn: this._options?.fetch,
|
|
5010
|
+
logging: this._options.logging
|
|
5011
|
+
});
|
|
5012
|
+
if (_response.ok) {
|
|
5013
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
5014
|
+
}
|
|
5015
|
+
if (_response.error.reason === "status-code") {
|
|
5016
|
+
switch (_response.error.statusCode) {
|
|
5017
|
+
case 401:
|
|
5018
|
+
throw new UnauthorizedError(
|
|
5019
|
+
_response.error.body,
|
|
5020
|
+
_response.rawResponse
|
|
5021
|
+
);
|
|
5022
|
+
case 404:
|
|
5023
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5024
|
+
case 429:
|
|
5025
|
+
throw new TooManyRequestsError(
|
|
5026
|
+
_response.error.body,
|
|
5027
|
+
_response.rawResponse
|
|
5028
|
+
);
|
|
5029
|
+
case 500:
|
|
5030
|
+
throw new InternalServerError(
|
|
5031
|
+
_response.error.body,
|
|
5032
|
+
_response.rawResponse
|
|
5033
|
+
);
|
|
5034
|
+
default:
|
|
5035
|
+
throw new PlaycallerApiError({
|
|
5036
|
+
statusCode: _response.error.statusCode,
|
|
5037
|
+
body: _response.error.body,
|
|
5038
|
+
rawResponse: _response.rawResponse
|
|
5039
|
+
});
|
|
5040
|
+
}
|
|
5041
|
+
}
|
|
5042
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/players/{id}");
|
|
5043
|
+
}
|
|
5044
|
+
/**
|
|
5045
|
+
* Returns daily batting and pitching stat lines with pre-calculated fantasy points. Useful for tracking recent form, streaks, and park-factor-adjusted production.
|
|
5046
|
+
*
|
|
5047
|
+
* **Tier access:** Developer Sandbox, Build, Growth, Pro Insights, Syndicate Alpha
|
|
5048
|
+
*
|
|
5049
|
+
* @param {PlaycallerApi.GetMlbPlayerStatsRequest} request
|
|
5050
|
+
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5051
|
+
*
|
|
5052
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5053
|
+
* @throws {@link PlaycallerApi.NotFoundError}
|
|
5054
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
5055
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
5056
|
+
*
|
|
5057
|
+
* @example
|
|
5058
|
+
* await client.mlb.getMlbPlayerStats({
|
|
5059
|
+
* id: "pc_mlb_001234",
|
|
5060
|
+
* date: "2026-05-01"
|
|
5061
|
+
* })
|
|
5062
|
+
*/
|
|
5063
|
+
getMlbPlayerStats(request, requestOptions) {
|
|
5064
|
+
return HttpResponsePromise.fromPromise(this.__getMlbPlayerStats(request, requestOptions));
|
|
5065
|
+
}
|
|
5066
|
+
async __getMlbPlayerStats(request, requestOptions) {
|
|
5067
|
+
const { id, date, limit } = request;
|
|
5068
|
+
const _queryParams = {
|
|
5069
|
+
date: date != null ? date : void 0,
|
|
5070
|
+
limit
|
|
5071
|
+
};
|
|
5072
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5073
|
+
const _headers = mergeHeaders(
|
|
5074
|
+
_authRequest.headers,
|
|
5075
|
+
this._options?.headers,
|
|
5076
|
+
requestOptions?.headers
|
|
5077
|
+
);
|
|
5078
|
+
const _response = await fetcher({
|
|
5079
|
+
url: url_exports.join(
|
|
5080
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
5081
|
+
`v1/mlb/players/${url_exports.encodePathParam(id)}/stats`
|
|
5082
|
+
),
|
|
5083
|
+
method: "GET",
|
|
5084
|
+
headers: _headers,
|
|
5085
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5086
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5087
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5088
|
+
abortSignal: requestOptions?.abortSignal,
|
|
5089
|
+
fetchFn: this._options?.fetch,
|
|
5090
|
+
logging: this._options.logging
|
|
5091
|
+
});
|
|
5092
|
+
if (_response.ok) {
|
|
5093
|
+
return {
|
|
5094
|
+
data: _response.body,
|
|
5095
|
+
rawResponse: _response.rawResponse
|
|
5096
|
+
};
|
|
5097
|
+
}
|
|
5098
|
+
if (_response.error.reason === "status-code") {
|
|
5099
|
+
switch (_response.error.statusCode) {
|
|
5100
|
+
case 401:
|
|
5101
|
+
throw new UnauthorizedError(
|
|
5102
|
+
_response.error.body,
|
|
5103
|
+
_response.rawResponse
|
|
5104
|
+
);
|
|
5105
|
+
case 404:
|
|
5106
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5107
|
+
case 429:
|
|
5108
|
+
throw new TooManyRequestsError(
|
|
5109
|
+
_response.error.body,
|
|
5110
|
+
_response.rawResponse
|
|
5111
|
+
);
|
|
5112
|
+
case 500:
|
|
5113
|
+
throw new InternalServerError(
|
|
5114
|
+
_response.error.body,
|
|
5115
|
+
_response.rawResponse
|
|
5116
|
+
);
|
|
5117
|
+
default:
|
|
5118
|
+
throw new PlaycallerApiError({
|
|
5119
|
+
statusCode: _response.error.statusCode,
|
|
5120
|
+
body: _response.error.body,
|
|
5121
|
+
rawResponse: _response.rawResponse
|
|
5122
|
+
});
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
5125
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/players/{id}/stats");
|
|
5126
|
+
}
|
|
5127
|
+
/**
|
|
5128
|
+
* Returns metadata for all 30 MLB teams including roster depth. Abbreviations are normalized (e.g. NYY, BOS, LAD).
|
|
5129
|
+
*
|
|
5130
|
+
* **Tier access:** Developer Sandbox, Build, Growth, Pro Insights, Syndicate Alpha
|
|
5131
|
+
*
|
|
5132
|
+
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5133
|
+
*
|
|
5134
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5135
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
5136
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
5137
|
+
*
|
|
5138
|
+
* @example
|
|
5139
|
+
* await client.mlb.listMlbTeams()
|
|
5140
|
+
*/
|
|
5141
|
+
listMlbTeams(requestOptions) {
|
|
5142
|
+
return HttpResponsePromise.fromPromise(this.__listMlbTeams(requestOptions));
|
|
5143
|
+
}
|
|
5144
|
+
async __listMlbTeams(requestOptions) {
|
|
5145
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5146
|
+
const _headers = mergeHeaders(
|
|
5147
|
+
_authRequest.headers,
|
|
5148
|
+
this._options?.headers,
|
|
5149
|
+
requestOptions?.headers
|
|
5150
|
+
);
|
|
5151
|
+
const _response = await fetcher({
|
|
5152
|
+
url: url_exports.join(
|
|
5153
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
5154
|
+
"v1/mlb/teams"
|
|
5155
|
+
),
|
|
5156
|
+
method: "GET",
|
|
5157
|
+
headers: _headers,
|
|
5158
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5159
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5160
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5161
|
+
abortSignal: requestOptions?.abortSignal,
|
|
5162
|
+
fetchFn: this._options?.fetch,
|
|
5163
|
+
logging: this._options.logging
|
|
5164
|
+
});
|
|
5165
|
+
if (_response.ok) {
|
|
5166
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
5167
|
+
}
|
|
5168
|
+
if (_response.error.reason === "status-code") {
|
|
5169
|
+
switch (_response.error.statusCode) {
|
|
5170
|
+
case 401:
|
|
5171
|
+
throw new UnauthorizedError(
|
|
5172
|
+
_response.error.body,
|
|
5173
|
+
_response.rawResponse
|
|
5174
|
+
);
|
|
5175
|
+
case 429:
|
|
5176
|
+
throw new TooManyRequestsError(
|
|
5177
|
+
_response.error.body,
|
|
5178
|
+
_response.rawResponse
|
|
5179
|
+
);
|
|
5180
|
+
case 500:
|
|
5181
|
+
throw new InternalServerError(
|
|
5182
|
+
_response.error.body,
|
|
5183
|
+
_response.rawResponse
|
|
5184
|
+
);
|
|
5185
|
+
default:
|
|
5186
|
+
throw new PlaycallerApiError({
|
|
5187
|
+
statusCode: _response.error.statusCode,
|
|
5188
|
+
body: _response.error.body,
|
|
5189
|
+
rawResponse: _response.rawResponse
|
|
5190
|
+
});
|
|
5191
|
+
}
|
|
5192
|
+
}
|
|
5193
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/teams");
|
|
5194
|
+
}
|
|
5195
|
+
/**
|
|
5196
|
+
* Returns the active roster for a specific team. Filter by position to pull only starting pitchers or corner infielders for lineup construction.
|
|
5197
|
+
*
|
|
5198
|
+
* **Tier access:** Developer Sandbox, Build, Growth, Pro Insights, Syndicate Alpha
|
|
5199
|
+
*
|
|
5200
|
+
* @param {PlaycallerApi.GetMlbTeamRosterRequest} request
|
|
5201
|
+
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5202
|
+
*
|
|
5203
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5204
|
+
* @throws {@link PlaycallerApi.NotFoundError}
|
|
5205
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
5206
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
5207
|
+
*
|
|
5208
|
+
* @example
|
|
5209
|
+
* await client.mlb.getMlbTeamRoster({
|
|
5210
|
+
* team: "NYY"
|
|
5211
|
+
* })
|
|
5212
|
+
*/
|
|
5213
|
+
getMlbTeamRoster(request, requestOptions) {
|
|
5214
|
+
return HttpResponsePromise.fromPromise(this.__getMlbTeamRoster(request, requestOptions));
|
|
5215
|
+
}
|
|
5216
|
+
async __getMlbTeamRoster(request, requestOptions) {
|
|
5217
|
+
const { team, position } = request;
|
|
5218
|
+
const _queryParams = {
|
|
5219
|
+
position: position != null ? position : void 0
|
|
5220
|
+
};
|
|
5221
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5222
|
+
const _headers = mergeHeaders(
|
|
5223
|
+
_authRequest.headers,
|
|
5224
|
+
this._options?.headers,
|
|
5225
|
+
requestOptions?.headers
|
|
5226
|
+
);
|
|
5227
|
+
const _response = await fetcher({
|
|
5228
|
+
url: url_exports.join(
|
|
5229
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
5230
|
+
`v1/mlb/teams/${url_exports.encodePathParam(team)}/roster`
|
|
5231
|
+
),
|
|
5232
|
+
method: "GET",
|
|
5233
|
+
headers: _headers,
|
|
5234
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5235
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5236
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5237
|
+
abortSignal: requestOptions?.abortSignal,
|
|
5238
|
+
fetchFn: this._options?.fetch,
|
|
5239
|
+
logging: this._options.logging
|
|
5240
|
+
});
|
|
5241
|
+
if (_response.ok) {
|
|
5242
|
+
return {
|
|
5243
|
+
data: _response.body,
|
|
5244
|
+
rawResponse: _response.rawResponse
|
|
5245
|
+
};
|
|
5246
|
+
}
|
|
5247
|
+
if (_response.error.reason === "status-code") {
|
|
5248
|
+
switch (_response.error.statusCode) {
|
|
5249
|
+
case 401:
|
|
5250
|
+
throw new UnauthorizedError(
|
|
5251
|
+
_response.error.body,
|
|
5252
|
+
_response.rawResponse
|
|
5253
|
+
);
|
|
5254
|
+
case 404:
|
|
5255
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5256
|
+
case 429:
|
|
5257
|
+
throw new TooManyRequestsError(
|
|
5258
|
+
_response.error.body,
|
|
5259
|
+
_response.rawResponse
|
|
5260
|
+
);
|
|
5261
|
+
case 500:
|
|
5262
|
+
throw new InternalServerError(
|
|
5263
|
+
_response.error.body,
|
|
5264
|
+
_response.rawResponse
|
|
5265
|
+
);
|
|
5266
|
+
default:
|
|
5267
|
+
throw new PlaycallerApiError({
|
|
5268
|
+
statusCode: _response.error.statusCode,
|
|
5269
|
+
body: _response.error.body,
|
|
5270
|
+
rawResponse: _response.rawResponse
|
|
5271
|
+
});
|
|
5272
|
+
}
|
|
5273
|
+
}
|
|
5274
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/teams/{team}/roster");
|
|
5275
|
+
}
|
|
5276
|
+
/**
|
|
5277
|
+
* Live inning-by-inning game state from the MLB Stats API pipeline. Defaults to today's games. Scores update on a polling cycle throughout the game day.
|
|
5278
|
+
*
|
|
5279
|
+
* **Tier access:** Developer Sandbox, Build, Growth, Pro Insights, Syndicate Alpha
|
|
5280
|
+
*
|
|
5281
|
+
* @param {PlaycallerApi.ListMlbGamesRequest} request
|
|
5282
|
+
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5283
|
+
*
|
|
5284
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5285
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
5286
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
5287
|
+
*
|
|
5288
|
+
* @example
|
|
5289
|
+
* await client.mlb.listMlbGames({
|
|
5290
|
+
* date: "2026-05-01"
|
|
5291
|
+
* })
|
|
5292
|
+
*/
|
|
5293
|
+
listMlbGames(request = {}, requestOptions) {
|
|
5294
|
+
return HttpResponsePromise.fromPromise(this.__listMlbGames(request, requestOptions));
|
|
5295
|
+
}
|
|
5296
|
+
async __listMlbGames(request = {}, requestOptions) {
|
|
5297
|
+
const { date, state, limit } = request;
|
|
5298
|
+
const _queryParams = {
|
|
5299
|
+
date: date != null ? date : void 0,
|
|
5300
|
+
state: state != null ? state : void 0,
|
|
5301
|
+
limit
|
|
5302
|
+
};
|
|
5303
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5304
|
+
const _headers = mergeHeaders(
|
|
5305
|
+
_authRequest.headers,
|
|
5306
|
+
this._options?.headers,
|
|
5307
|
+
requestOptions?.headers
|
|
5308
|
+
);
|
|
5309
|
+
const _response = await fetcher({
|
|
5310
|
+
url: url_exports.join(
|
|
5311
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
5312
|
+
"v1/mlb/games"
|
|
5313
|
+
),
|
|
5314
|
+
method: "GET",
|
|
5315
|
+
headers: _headers,
|
|
5316
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
5317
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5318
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5319
|
+
abortSignal: requestOptions?.abortSignal,
|
|
5320
|
+
fetchFn: this._options?.fetch,
|
|
5321
|
+
logging: this._options.logging
|
|
5322
|
+
});
|
|
5323
|
+
if (_response.ok) {
|
|
5324
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
5325
|
+
}
|
|
4400
5326
|
if (_response.error.reason === "status-code") {
|
|
4401
5327
|
switch (_response.error.statusCode) {
|
|
4402
|
-
case
|
|
4403
|
-
throw new
|
|
5328
|
+
case 401:
|
|
5329
|
+
throw new UnauthorizedError(
|
|
5330
|
+
_response.error.body,
|
|
5331
|
+
_response.rawResponse
|
|
5332
|
+
);
|
|
4404
5333
|
case 429:
|
|
4405
5334
|
throw new TooManyRequestsError(
|
|
4406
5335
|
_response.error.body,
|
|
4407
5336
|
_response.rawResponse
|
|
4408
5337
|
);
|
|
5338
|
+
case 500:
|
|
5339
|
+
throw new InternalServerError(
|
|
5340
|
+
_response.error.body,
|
|
5341
|
+
_response.rawResponse
|
|
5342
|
+
);
|
|
4409
5343
|
default:
|
|
4410
5344
|
throw new PlaycallerApiError({
|
|
4411
5345
|
statusCode: _response.error.statusCode,
|
|
@@ -4414,23 +5348,14 @@ var McpClient = class {
|
|
|
4414
5348
|
});
|
|
4415
5349
|
}
|
|
4416
5350
|
}
|
|
4417
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
4418
|
-
}
|
|
4419
|
-
};
|
|
4420
|
-
|
|
4421
|
-
// api/resources/mlb/client/Client.ts
|
|
4422
|
-
var MlbClient = class {
|
|
4423
|
-
constructor(options = {}) {
|
|
4424
|
-
this._options = normalizeClientOptionsWithAuth(options);
|
|
5351
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/games");
|
|
4425
5352
|
}
|
|
4426
5353
|
/**
|
|
4427
|
-
*
|
|
4428
|
-
*
|
|
4429
|
-
* Filter by position and team to build DFS pools or lineup constraints without doing the normalization yourself.
|
|
5354
|
+
* Current MLB standings by division sourced from ESPN. Includes win %, streak, home/away splits, and runs differential.
|
|
4430
5355
|
*
|
|
4431
5356
|
* **Tier access:** Developer Sandbox, Build, Growth, Pro Insights, Syndicate Alpha
|
|
4432
5357
|
*
|
|
4433
|
-
* @param {PlaycallerApi.
|
|
5358
|
+
* @param {PlaycallerApi.GetMlbStandingsRequest} request
|
|
4434
5359
|
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4435
5360
|
*
|
|
4436
5361
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
@@ -4438,23 +5363,18 @@ var MlbClient = class {
|
|
|
4438
5363
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4439
5364
|
*
|
|
4440
5365
|
* @example
|
|
4441
|
-
* await client.mlb.
|
|
4442
|
-
*
|
|
4443
|
-
* search: "Ohtani"
|
|
5366
|
+
* await client.mlb.getMlbStandings({
|
|
5367
|
+
* division: "AL East"
|
|
4444
5368
|
* })
|
|
4445
5369
|
*/
|
|
4446
|
-
|
|
4447
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5370
|
+
getMlbStandings(request = {}, requestOptions) {
|
|
5371
|
+
return HttpResponsePromise.fromPromise(this.__getMlbStandings(request, requestOptions));
|
|
4448
5372
|
}
|
|
4449
|
-
async
|
|
4450
|
-
const {
|
|
5373
|
+
async __getMlbStandings(request = {}, requestOptions) {
|
|
5374
|
+
const { season, division } = request;
|
|
4451
5375
|
const _queryParams = {
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
status: status != null ? status : void 0,
|
|
4455
|
-
search,
|
|
4456
|
-
limit,
|
|
4457
|
-
offset
|
|
5376
|
+
season,
|
|
5377
|
+
division
|
|
4458
5378
|
};
|
|
4459
5379
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4460
5380
|
const _headers = mergeHeaders(
|
|
@@ -4465,7 +5385,7 @@ var MlbClient = class {
|
|
|
4465
5385
|
const _response = await fetcher({
|
|
4466
5386
|
url: url_exports.join(
|
|
4467
5387
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4468
|
-
"v1/mlb/
|
|
5388
|
+
"v1/mlb/standings"
|
|
4469
5389
|
),
|
|
4470
5390
|
method: "GET",
|
|
4471
5391
|
headers: _headers,
|
|
@@ -4477,7 +5397,10 @@ var MlbClient = class {
|
|
|
4477
5397
|
logging: this._options.logging
|
|
4478
5398
|
});
|
|
4479
5399
|
if (_response.ok) {
|
|
4480
|
-
return {
|
|
5400
|
+
return {
|
|
5401
|
+
data: _response.body,
|
|
5402
|
+
rawResponse: _response.rawResponse
|
|
5403
|
+
};
|
|
4481
5404
|
}
|
|
4482
5405
|
if (_response.error.reason === "status-code") {
|
|
4483
5406
|
switch (_response.error.statusCode) {
|
|
@@ -4504,31 +5427,40 @@ var MlbClient = class {
|
|
|
4504
5427
|
});
|
|
4505
5428
|
}
|
|
4506
5429
|
}
|
|
4507
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/
|
|
5430
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/standings");
|
|
4508
5431
|
}
|
|
4509
5432
|
/**
|
|
4510
|
-
*
|
|
5433
|
+
* Top fantasy scorers for any game day, ranked by total points. Uses the PlayCaller scoring engine with standard roto weights (H, HR, RBI, SB, R, BB for batters; IP, K, SV for pitchers).
|
|
4511
5434
|
*
|
|
4512
|
-
*
|
|
5435
|
+
* Useful for identifying daily stack targets and late-swap pivots before lock.
|
|
4513
5436
|
*
|
|
4514
|
-
*
|
|
5437
|
+
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
5438
|
+
*
|
|
5439
|
+
* @param {PlaycallerApi.GetMlbScoringLeadersRequest} request
|
|
4515
5440
|
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4516
5441
|
*
|
|
4517
5442
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
4518
|
-
* @throws {@link PlaycallerApi.
|
|
5443
|
+
* @throws {@link PlaycallerApi.ForbiddenError}
|
|
4519
5444
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4520
5445
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4521
5446
|
*
|
|
4522
5447
|
* @example
|
|
4523
|
-
* await client.mlb.
|
|
4524
|
-
*
|
|
5448
|
+
* await client.mlb.getMlbScoringLeaders({
|
|
5449
|
+
* date: "2026-05-01",
|
|
5450
|
+
* team: "NYY"
|
|
4525
5451
|
* })
|
|
4526
5452
|
*/
|
|
4527
|
-
|
|
4528
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5453
|
+
getMlbScoringLeaders(request = {}, requestOptions) {
|
|
5454
|
+
return HttpResponsePromise.fromPromise(this.__getMlbScoringLeaders(request, requestOptions));
|
|
4529
5455
|
}
|
|
4530
|
-
async
|
|
4531
|
-
const {
|
|
5456
|
+
async __getMlbScoringLeaders(request = {}, requestOptions) {
|
|
5457
|
+
const { date, position, team, limit } = request;
|
|
5458
|
+
const _queryParams = {
|
|
5459
|
+
date: date != null ? date : void 0,
|
|
5460
|
+
position: position != null ? position : void 0,
|
|
5461
|
+
team,
|
|
5462
|
+
limit
|
|
5463
|
+
};
|
|
4532
5464
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4533
5465
|
const _headers = mergeHeaders(
|
|
4534
5466
|
_authRequest.headers,
|
|
@@ -4538,11 +5470,11 @@ var MlbClient = class {
|
|
|
4538
5470
|
const _response = await fetcher({
|
|
4539
5471
|
url: url_exports.join(
|
|
4540
5472
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4541
|
-
|
|
5473
|
+
"v1/mlb/scoring/leaders"
|
|
4542
5474
|
),
|
|
4543
5475
|
method: "GET",
|
|
4544
5476
|
headers: _headers,
|
|
4545
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5477
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4546
5478
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4547
5479
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4548
5480
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -4550,7 +5482,10 @@ var MlbClient = class {
|
|
|
4550
5482
|
logging: this._options.logging
|
|
4551
5483
|
});
|
|
4552
5484
|
if (_response.ok) {
|
|
4553
|
-
return {
|
|
5485
|
+
return {
|
|
5486
|
+
data: _response.body,
|
|
5487
|
+
rawResponse: _response.rawResponse
|
|
5488
|
+
};
|
|
4554
5489
|
}
|
|
4555
5490
|
if (_response.error.reason === "status-code") {
|
|
4556
5491
|
switch (_response.error.statusCode) {
|
|
@@ -4559,8 +5494,11 @@ var MlbClient = class {
|
|
|
4559
5494
|
_response.error.body,
|
|
4560
5495
|
_response.rawResponse
|
|
4561
5496
|
);
|
|
4562
|
-
case
|
|
4563
|
-
throw new
|
|
5497
|
+
case 403:
|
|
5498
|
+
throw new ForbiddenError(
|
|
5499
|
+
_response.error.body,
|
|
5500
|
+
_response.rawResponse
|
|
5501
|
+
);
|
|
4564
5502
|
case 429:
|
|
4565
5503
|
throw new TooManyRequestsError(
|
|
4566
5504
|
_response.error.body,
|
|
@@ -4579,35 +5517,33 @@ var MlbClient = class {
|
|
|
4579
5517
|
});
|
|
4580
5518
|
}
|
|
4581
5519
|
}
|
|
4582
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/
|
|
5520
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/scoring/leaders");
|
|
4583
5521
|
}
|
|
4584
5522
|
/**
|
|
4585
|
-
*
|
|
5523
|
+
* Top 10 players per rotisserie scoring category (HR, RBI, SB, R, BB, IP, K, SV) for a given date. Ideal for roto league managers tracking category races and daily contributions.
|
|
4586
5524
|
*
|
|
4587
|
-
* **Tier access:**
|
|
5525
|
+
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
4588
5526
|
*
|
|
4589
|
-
* @param {PlaycallerApi.
|
|
5527
|
+
* @param {PlaycallerApi.GetMlbScoringCategoriesRequest} request
|
|
4590
5528
|
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4591
5529
|
*
|
|
4592
5530
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
4593
|
-
* @throws {@link PlaycallerApi.
|
|
5531
|
+
* @throws {@link PlaycallerApi.ForbiddenError}
|
|
4594
5532
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4595
5533
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4596
5534
|
*
|
|
4597
5535
|
* @example
|
|
4598
|
-
* await client.mlb.
|
|
4599
|
-
* id: "pc_mlb_001234",
|
|
5536
|
+
* await client.mlb.getMlbScoringCategories({
|
|
4600
5537
|
* date: "2026-05-01"
|
|
4601
5538
|
* })
|
|
4602
5539
|
*/
|
|
4603
|
-
|
|
4604
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5540
|
+
getMlbScoringCategories(request = {}, requestOptions) {
|
|
5541
|
+
return HttpResponsePromise.fromPromise(this.__getMlbScoringCategories(request, requestOptions));
|
|
4605
5542
|
}
|
|
4606
|
-
async
|
|
4607
|
-
const {
|
|
5543
|
+
async __getMlbScoringCategories(request = {}, requestOptions) {
|
|
5544
|
+
const { date } = request;
|
|
4608
5545
|
const _queryParams = {
|
|
4609
|
-
date: date != null ? date : void 0
|
|
4610
|
-
limit
|
|
5546
|
+
date: date != null ? date : void 0
|
|
4611
5547
|
};
|
|
4612
5548
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4613
5549
|
const _headers = mergeHeaders(
|
|
@@ -4618,7 +5554,7 @@ var MlbClient = class {
|
|
|
4618
5554
|
const _response = await fetcher({
|
|
4619
5555
|
url: url_exports.join(
|
|
4620
5556
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4621
|
-
|
|
5557
|
+
"v1/mlb/scoring/categories"
|
|
4622
5558
|
),
|
|
4623
5559
|
method: "GET",
|
|
4624
5560
|
headers: _headers,
|
|
@@ -4642,8 +5578,11 @@ var MlbClient = class {
|
|
|
4642
5578
|
_response.error.body,
|
|
4643
5579
|
_response.rawResponse
|
|
4644
5580
|
);
|
|
4645
|
-
case
|
|
4646
|
-
throw new
|
|
5581
|
+
case 403:
|
|
5582
|
+
throw new ForbiddenError(
|
|
5583
|
+
_response.error.body,
|
|
5584
|
+
_response.rawResponse
|
|
5585
|
+
);
|
|
4647
5586
|
case 429:
|
|
4648
5587
|
throw new TooManyRequestsError(
|
|
4649
5588
|
_response.error.body,
|
|
@@ -4662,26 +5601,38 @@ var MlbClient = class {
|
|
|
4662
5601
|
});
|
|
4663
5602
|
}
|
|
4664
5603
|
}
|
|
4665
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/
|
|
5604
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/scoring/categories");
|
|
4666
5605
|
}
|
|
4667
5606
|
/**
|
|
4668
|
-
*
|
|
5607
|
+
* Recent MLB roster transactions including IL placements/activations, DFA designations, trade acquisitions, and minor-league call-ups. Sourced from MLB Stats API (statsapi.mlb.com). Cached 1 hour.
|
|
4669
5608
|
*
|
|
4670
|
-
* **Tier access:**
|
|
5609
|
+
* **Tier access:** Build, Growth, Pro Insights, Syndicate Alpha
|
|
4671
5610
|
*
|
|
5611
|
+
* @param {PlaycallerApi.GetMlbTransactionsRequest} request
|
|
4672
5612
|
* @param {MlbClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4673
5613
|
*
|
|
4674
5614
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5615
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
4675
5616
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4676
5617
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4677
5618
|
*
|
|
4678
5619
|
* @example
|
|
4679
|
-
* await client.mlb.
|
|
5620
|
+
* await client.mlb.getMlbTransactions({
|
|
5621
|
+
* startDate: "2026-07-10",
|
|
5622
|
+
* endDate: "2026-07-17",
|
|
5623
|
+
* type: "IL"
|
|
5624
|
+
* })
|
|
4680
5625
|
*/
|
|
4681
|
-
|
|
4682
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5626
|
+
getMlbTransactions(request = {}, requestOptions) {
|
|
5627
|
+
return HttpResponsePromise.fromPromise(this.__getMlbTransactions(request, requestOptions));
|
|
4683
5628
|
}
|
|
4684
|
-
async
|
|
5629
|
+
async __getMlbTransactions(request = {}, requestOptions) {
|
|
5630
|
+
const { startDate, endDate, type: type_ } = request;
|
|
5631
|
+
const _queryParams = {
|
|
5632
|
+
startDate: startDate != null ? startDate : void 0,
|
|
5633
|
+
endDate: endDate != null ? endDate : void 0,
|
|
5634
|
+
type: type_
|
|
5635
|
+
};
|
|
4685
5636
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4686
5637
|
const _headers = mergeHeaders(
|
|
4687
5638
|
_authRequest.headers,
|
|
@@ -4691,11 +5642,11 @@ var MlbClient = class {
|
|
|
4691
5642
|
const _response = await fetcher({
|
|
4692
5643
|
url: url_exports.join(
|
|
4693
5644
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4694
|
-
"v1/mlb/
|
|
5645
|
+
"v1/mlb/transactions"
|
|
4695
5646
|
),
|
|
4696
5647
|
method: "GET",
|
|
4697
5648
|
headers: _headers,
|
|
4698
|
-
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5649
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
4699
5650
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4700
5651
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4701
5652
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -4703,7 +5654,10 @@ var MlbClient = class {
|
|
|
4703
5654
|
logging: this._options.logging
|
|
4704
5655
|
});
|
|
4705
5656
|
if (_response.ok) {
|
|
4706
|
-
return {
|
|
5657
|
+
return {
|
|
5658
|
+
data: _response.body,
|
|
5659
|
+
rawResponse: _response.rawResponse
|
|
5660
|
+
};
|
|
4707
5661
|
}
|
|
4708
5662
|
if (_response.error.reason === "status-code") {
|
|
4709
5663
|
switch (_response.error.statusCode) {
|
|
@@ -4712,6 +5666,11 @@ var MlbClient = class {
|
|
|
4712
5666
|
_response.error.body,
|
|
4713
5667
|
_response.rawResponse
|
|
4714
5668
|
);
|
|
5669
|
+
case 402:
|
|
5670
|
+
throw new PaymentRequiredError(
|
|
5671
|
+
_response.error.body,
|
|
5672
|
+
_response.rawResponse
|
|
5673
|
+
);
|
|
4715
5674
|
case 429:
|
|
4716
5675
|
throw new TooManyRequestsError(
|
|
4717
5676
|
_response.error.body,
|
|
@@ -4730,34 +5689,46 @@ var MlbClient = class {
|
|
|
4730
5689
|
});
|
|
4731
5690
|
}
|
|
4732
5691
|
}
|
|
4733
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/
|
|
5692
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/mlb/transactions");
|
|
5693
|
+
}
|
|
5694
|
+
};
|
|
5695
|
+
|
|
5696
|
+
// api/resources/multi/client/Client.ts
|
|
5697
|
+
var MultiClient = class {
|
|
5698
|
+
constructor(options = {}) {
|
|
5699
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
4734
5700
|
}
|
|
4735
5701
|
/**
|
|
4736
|
-
* Returns
|
|
5702
|
+
* Returns three proprietary ML-derived signals computed from the player's last 8 games:
|
|
4737
5703
|
*
|
|
4738
|
-
* **
|
|
5704
|
+
* - **Consistency Score (0–100)** — how stable the player's usage/floor is. Higher = more reliable starter.
|
|
5705
|
+
* - **Momentum Delta** — signed float. Positive = trending up vs. prior 3-game baseline; negative = cooling off.
|
|
5706
|
+
* - **Opportunity Ceiling** — 90th-percentile fantasy output from the sample window. Represents the player's peak upside.
|
|
4739
5707
|
*
|
|
4740
|
-
*
|
|
4741
|
-
*
|
|
5708
|
+
* Results are pre-computed weekly (Tuesday 3 AM ET, post-MNF) and cached. Fresh players compute on-the-fly.
|
|
5709
|
+
*
|
|
5710
|
+
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
5711
|
+
*
|
|
5712
|
+
* @param {PlaycallerApi.GetPlayerAlphaMetricsRequest} request
|
|
5713
|
+
* @param {MultiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4742
5714
|
*
|
|
4743
5715
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5716
|
+
* @throws {@link PlaycallerApi.ForbiddenError}
|
|
4744
5717
|
* @throws {@link PlaycallerApi.NotFoundError}
|
|
4745
5718
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4746
5719
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4747
5720
|
*
|
|
4748
5721
|
* @example
|
|
4749
|
-
* await client.
|
|
4750
|
-
*
|
|
5722
|
+
* await client.multi.getPlayerAlphaMetrics({
|
|
5723
|
+
* sport: "nfl",
|
|
5724
|
+
* id: "pc_nfl_001234"
|
|
4751
5725
|
* })
|
|
4752
5726
|
*/
|
|
4753
|
-
|
|
4754
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5727
|
+
getPlayerAlphaMetrics(request, requestOptions) {
|
|
5728
|
+
return HttpResponsePromise.fromPromise(this.__getPlayerAlphaMetrics(request, requestOptions));
|
|
4755
5729
|
}
|
|
4756
|
-
async
|
|
4757
|
-
const {
|
|
4758
|
-
const _queryParams = {
|
|
4759
|
-
position: position != null ? position : void 0
|
|
4760
|
-
};
|
|
5730
|
+
async __getPlayerAlphaMetrics(request, requestOptions) {
|
|
5731
|
+
const { sport, id } = request;
|
|
4761
5732
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4762
5733
|
const _headers = mergeHeaders(
|
|
4763
5734
|
_authRequest.headers,
|
|
@@ -4767,11 +5738,11 @@ var MlbClient = class {
|
|
|
4767
5738
|
const _response = await fetcher({
|
|
4768
5739
|
url: url_exports.join(
|
|
4769
5740
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4770
|
-
`v1/
|
|
5741
|
+
`v1/${url_exports.encodePathParam(sport)}/players/${url_exports.encodePathParam(id)}/alpha`
|
|
4771
5742
|
),
|
|
4772
5743
|
method: "GET",
|
|
4773
5744
|
headers: _headers,
|
|
4774
|
-
queryString: url_exports.queryBuilder().
|
|
5745
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
4775
5746
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
4776
5747
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
4777
5748
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -4791,6 +5762,11 @@ var MlbClient = class {
|
|
|
4791
5762
|
_response.error.body,
|
|
4792
5763
|
_response.rawResponse
|
|
4793
5764
|
);
|
|
5765
|
+
case 403:
|
|
5766
|
+
throw new ForbiddenError(
|
|
5767
|
+
_response.error.body,
|
|
5768
|
+
_response.rawResponse
|
|
5769
|
+
);
|
|
4794
5770
|
case 404:
|
|
4795
5771
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4796
5772
|
case 429:
|
|
@@ -4811,33 +5787,52 @@ var MlbClient = class {
|
|
|
4811
5787
|
});
|
|
4812
5788
|
}
|
|
4813
5789
|
}
|
|
4814
|
-
return handleNonStatusCodeError(
|
|
5790
|
+
return handleNonStatusCodeError(
|
|
5791
|
+
_response.error,
|
|
5792
|
+
_response.rawResponse,
|
|
5793
|
+
"GET",
|
|
5794
|
+
"/v1/{sport}/players/{id}/alpha"
|
|
5795
|
+
);
|
|
4815
5796
|
}
|
|
4816
5797
|
/**
|
|
4817
|
-
*
|
|
5798
|
+
* Returns the N most similar players by cosine distance across an 8-dimension stat-profile vector:
|
|
4818
5799
|
*
|
|
4819
|
-
*
|
|
5800
|
+
* 1. Average fantasy points
|
|
5801
|
+
* 2. Usage rate (snap% for NFL, minutes for NBA)
|
|
5802
|
+
* 3. Opportunity rate (target share for NFL, usage% for NBA)
|
|
5803
|
+
* 4. Average rushing yards
|
|
5804
|
+
* 5. Average receiving yards
|
|
5805
|
+
* 6. Consistency Score (from Alpha Metrics)
|
|
5806
|
+
* 7. Momentum Delta (normalized)
|
|
5807
|
+
* 8. Opportunity Ceiling (from Alpha Metrics)
|
|
4820
5808
|
*
|
|
4821
|
-
*
|
|
4822
|
-
*
|
|
5809
|
+
* Use case: "Find WRs with the same profile as CeeDee Lamb," "Identify breakout candidates with similar usage to Cooper Kupp Year 2," DFS stack-building, dynasty trade comps.
|
|
5810
|
+
*
|
|
5811
|
+
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
4823
5812
|
*
|
|
5813
|
+
* @param {PlaycallerApi.GetSimilarPlayersRequest} request
|
|
5814
|
+
* @param {MultiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5815
|
+
*
|
|
5816
|
+
* @throws {@link PlaycallerApi.BadRequestError}
|
|
4824
5817
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5818
|
+
* @throws {@link PlaycallerApi.ForbiddenError}
|
|
5819
|
+
* @throws {@link PlaycallerApi.NotFoundError}
|
|
4825
5820
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4826
5821
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4827
5822
|
*
|
|
4828
5823
|
* @example
|
|
4829
|
-
* await client.
|
|
4830
|
-
*
|
|
5824
|
+
* await client.multi.getSimilarPlayers({
|
|
5825
|
+
* id: "pc_nfl_001234",
|
|
5826
|
+
* sport: "nfl"
|
|
4831
5827
|
* })
|
|
4832
5828
|
*/
|
|
4833
|
-
|
|
4834
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5829
|
+
getSimilarPlayers(request, requestOptions) {
|
|
5830
|
+
return HttpResponsePromise.fromPromise(this.__getSimilarPlayers(request, requestOptions));
|
|
4835
5831
|
}
|
|
4836
|
-
async
|
|
4837
|
-
const {
|
|
5832
|
+
async __getSimilarPlayers(request, requestOptions) {
|
|
5833
|
+
const { id, sport, limit } = request;
|
|
4838
5834
|
const _queryParams = {
|
|
4839
|
-
|
|
4840
|
-
state: state != null ? state : void 0,
|
|
5835
|
+
sport,
|
|
4841
5836
|
limit
|
|
4842
5837
|
};
|
|
4843
5838
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
@@ -4849,7 +5844,7 @@ var MlbClient = class {
|
|
|
4849
5844
|
const _response = await fetcher({
|
|
4850
5845
|
url: url_exports.join(
|
|
4851
5846
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4852
|
-
|
|
5847
|
+
`v1/players/similar/${url_exports.encodePathParam(id)}`
|
|
4853
5848
|
),
|
|
4854
5849
|
method: "GET",
|
|
4855
5850
|
headers: _headers,
|
|
@@ -4861,15 +5856,27 @@ var MlbClient = class {
|
|
|
4861
5856
|
logging: this._options.logging
|
|
4862
5857
|
});
|
|
4863
5858
|
if (_response.ok) {
|
|
4864
|
-
return {
|
|
5859
|
+
return {
|
|
5860
|
+
data: _response.body,
|
|
5861
|
+
rawResponse: _response.rawResponse
|
|
5862
|
+
};
|
|
4865
5863
|
}
|
|
4866
5864
|
if (_response.error.reason === "status-code") {
|
|
4867
5865
|
switch (_response.error.statusCode) {
|
|
5866
|
+
case 400:
|
|
5867
|
+
throw new BadRequestError(_response.error.body, _response.rawResponse);
|
|
4868
5868
|
case 401:
|
|
4869
5869
|
throw new UnauthorizedError(
|
|
4870
5870
|
_response.error.body,
|
|
4871
5871
|
_response.rawResponse
|
|
4872
5872
|
);
|
|
5873
|
+
case 403:
|
|
5874
|
+
throw new ForbiddenError(
|
|
5875
|
+
_response.error.body,
|
|
5876
|
+
_response.rawResponse
|
|
5877
|
+
);
|
|
5878
|
+
case 404:
|
|
5879
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
4873
5880
|
case 429:
|
|
4874
5881
|
throw new TooManyRequestsError(
|
|
4875
5882
|
_response.error.body,
|
|
@@ -4888,33 +5895,33 @@ var MlbClient = class {
|
|
|
4888
5895
|
});
|
|
4889
5896
|
}
|
|
4890
5897
|
}
|
|
4891
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/
|
|
5898
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/players/similar/{id}");
|
|
4892
5899
|
}
|
|
4893
5900
|
/**
|
|
4894
|
-
*
|
|
5901
|
+
* Returns a paginated, time-ordered audit trail of key management events (key rotation, IP allowlist changes) and administrative actions associated with your API key. Rolling 90-day retention.
|
|
4895
5902
|
*
|
|
4896
|
-
* **Tier access:**
|
|
5903
|
+
* **Tier access:** Build, Growth, Pro Insights, Syndicate Alpha
|
|
4897
5904
|
*
|
|
4898
|
-
* @param {PlaycallerApi.
|
|
4899
|
-
* @param {
|
|
5905
|
+
* @param {PlaycallerApi.GetAuditEventsRequest} request
|
|
5906
|
+
* @param {MultiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4900
5907
|
*
|
|
4901
5908
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5909
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
4902
5910
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4903
5911
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4904
5912
|
*
|
|
4905
5913
|
* @example
|
|
4906
|
-
* await client.
|
|
4907
|
-
* division: "AL East"
|
|
4908
|
-
* })
|
|
5914
|
+
* await client.multi.getAuditEvents()
|
|
4909
5915
|
*/
|
|
4910
|
-
|
|
4911
|
-
return HttpResponsePromise.fromPromise(this.
|
|
5916
|
+
getAuditEvents(request = {}, requestOptions) {
|
|
5917
|
+
return HttpResponsePromise.fromPromise(this.__getAuditEvents(request, requestOptions));
|
|
4912
5918
|
}
|
|
4913
|
-
async
|
|
4914
|
-
const {
|
|
5919
|
+
async __getAuditEvents(request = {}, requestOptions) {
|
|
5920
|
+
const { limit, before, action } = request;
|
|
4915
5921
|
const _queryParams = {
|
|
4916
|
-
|
|
4917
|
-
|
|
5922
|
+
limit,
|
|
5923
|
+
before: before != null ? before : void 0,
|
|
5924
|
+
action
|
|
4918
5925
|
};
|
|
4919
5926
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
4920
5927
|
const _headers = mergeHeaders(
|
|
@@ -4925,7 +5932,7 @@ var MlbClient = class {
|
|
|
4925
5932
|
const _response = await fetcher({
|
|
4926
5933
|
url: url_exports.join(
|
|
4927
5934
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
4928
|
-
"v1/
|
|
5935
|
+
"v1/audit/events"
|
|
4929
5936
|
),
|
|
4930
5937
|
method: "GET",
|
|
4931
5938
|
headers: _headers,
|
|
@@ -4937,10 +5944,7 @@ var MlbClient = class {
|
|
|
4937
5944
|
logging: this._options.logging
|
|
4938
5945
|
});
|
|
4939
5946
|
if (_response.ok) {
|
|
4940
|
-
return {
|
|
4941
|
-
data: _response.body,
|
|
4942
|
-
rawResponse: _response.rawResponse
|
|
4943
|
-
};
|
|
5947
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
4944
5948
|
}
|
|
4945
5949
|
if (_response.error.reason === "status-code") {
|
|
4946
5950
|
switch (_response.error.statusCode) {
|
|
@@ -4949,6 +5953,11 @@ var MlbClient = class {
|
|
|
4949
5953
|
_response.error.body,
|
|
4950
5954
|
_response.rawResponse
|
|
4951
5955
|
);
|
|
5956
|
+
case 402:
|
|
5957
|
+
throw new PaymentRequiredError(
|
|
5958
|
+
_response.error.body,
|
|
5959
|
+
_response.rawResponse
|
|
5960
|
+
);
|
|
4952
5961
|
case 429:
|
|
4953
5962
|
throw new TooManyRequestsError(
|
|
4954
5963
|
_response.error.body,
|
|
@@ -4967,40 +5976,35 @@ var MlbClient = class {
|
|
|
4967
5976
|
});
|
|
4968
5977
|
}
|
|
4969
5978
|
}
|
|
4970
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/
|
|
5979
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/audit/events");
|
|
4971
5980
|
}
|
|
4972
5981
|
/**
|
|
4973
|
-
*
|
|
5982
|
+
* Fetch ML signals for up to 25 players in a single request. Returns confidence score, confidence tier, alpha metrics, and ADP for each player. Each player in the batch counts as one call against your daily limit.
|
|
4974
5983
|
*
|
|
4975
|
-
*
|
|
5984
|
+
* Supported sports for confidence: NFL, MLB, NBA, NHL. Golf and Soccer return `confidence_score: null` (no validated model).
|
|
4976
5985
|
*
|
|
4977
5986
|
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
4978
5987
|
*
|
|
4979
|
-
* @param {PlaycallerApi.
|
|
4980
|
-
* @param {
|
|
5988
|
+
* @param {PlaycallerApi.BatchPlayerSignalsRequest} request
|
|
5989
|
+
* @param {MultiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4981
5990
|
*
|
|
4982
5991
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
4983
|
-
* @throws {@link PlaycallerApi.
|
|
5992
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
4984
5993
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
4985
5994
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
4986
5995
|
*
|
|
4987
5996
|
* @example
|
|
4988
|
-
* await client.
|
|
4989
|
-
*
|
|
4990
|
-
*
|
|
5997
|
+
* await client.multi.batchPlayerSignals({
|
|
5998
|
+
* players: [{
|
|
5999
|
+
* player_id: "pc_nfl_001234",
|
|
6000
|
+
* sport: "nfl"
|
|
6001
|
+
* }]
|
|
4991
6002
|
* })
|
|
4992
6003
|
*/
|
|
4993
|
-
|
|
4994
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6004
|
+
batchPlayerSignals(request, requestOptions) {
|
|
6005
|
+
return HttpResponsePromise.fromPromise(this.__batchPlayerSignals(request, requestOptions));
|
|
4995
6006
|
}
|
|
4996
|
-
async
|
|
4997
|
-
const { date, position, team, limit } = request;
|
|
4998
|
-
const _queryParams = {
|
|
4999
|
-
date: date != null ? date : void 0,
|
|
5000
|
-
position: position != null ? position : void 0,
|
|
5001
|
-
team,
|
|
5002
|
-
limit
|
|
5003
|
-
};
|
|
6007
|
+
async __batchPlayerSignals(request, requestOptions) {
|
|
5004
6008
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5005
6009
|
const _headers = mergeHeaders(
|
|
5006
6010
|
_authRequest.headers,
|
|
@@ -5010,11 +6014,14 @@ var MlbClient = class {
|
|
|
5010
6014
|
const _response = await fetcher({
|
|
5011
6015
|
url: url_exports.join(
|
|
5012
6016
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
5013
|
-
"v1/
|
|
6017
|
+
"v1/batch/signals"
|
|
5014
6018
|
),
|
|
5015
|
-
method: "
|
|
6019
|
+
method: "POST",
|
|
5016
6020
|
headers: _headers,
|
|
5017
|
-
|
|
6021
|
+
contentType: "application/json",
|
|
6022
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6023
|
+
requestType: "json",
|
|
6024
|
+
body: request,
|
|
5018
6025
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5019
6026
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5020
6027
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5034,8 +6041,8 @@ var MlbClient = class {
|
|
|
5034
6041
|
_response.error.body,
|
|
5035
6042
|
_response.rawResponse
|
|
5036
6043
|
);
|
|
5037
|
-
case
|
|
5038
|
-
throw new
|
|
6044
|
+
case 402:
|
|
6045
|
+
throw new PaymentRequiredError(
|
|
5039
6046
|
_response.error.body,
|
|
5040
6047
|
_response.rawResponse
|
|
5041
6048
|
);
|
|
@@ -5057,34 +6064,33 @@ var MlbClient = class {
|
|
|
5057
6064
|
});
|
|
5058
6065
|
}
|
|
5059
6066
|
}
|
|
5060
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
6067
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/batch/signals");
|
|
5061
6068
|
}
|
|
5062
6069
|
/**
|
|
5063
|
-
*
|
|
6070
|
+
* Returns all captured odds snapshots for a specific game, ordered chronologically. Useful for detecting line movement, sharp action, and steam moves. History depth depends on how early the game was tracked.
|
|
5064
6071
|
*
|
|
5065
6072
|
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
5066
6073
|
*
|
|
5067
|
-
* @param {PlaycallerApi.
|
|
5068
|
-
* @param {
|
|
6074
|
+
* @param {PlaycallerApi.GetOddsHistoryRequest} request
|
|
6075
|
+
* @param {MultiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5069
6076
|
*
|
|
5070
6077
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5071
|
-
* @throws {@link PlaycallerApi.
|
|
6078
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
6079
|
+
* @throws {@link PlaycallerApi.NotFoundError}
|
|
5072
6080
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
5073
6081
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
5074
6082
|
*
|
|
5075
6083
|
* @example
|
|
5076
|
-
* await client.
|
|
5077
|
-
*
|
|
6084
|
+
* await client.multi.getOddsHistory({
|
|
6085
|
+
* sport: "nfl",
|
|
6086
|
+
* gameId: "abc12345"
|
|
5078
6087
|
* })
|
|
5079
6088
|
*/
|
|
5080
|
-
|
|
5081
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6089
|
+
getOddsHistory(request, requestOptions) {
|
|
6090
|
+
return HttpResponsePromise.fromPromise(this.__getOddsHistory(request, requestOptions));
|
|
5082
6091
|
}
|
|
5083
|
-
async
|
|
5084
|
-
const {
|
|
5085
|
-
const _queryParams = {
|
|
5086
|
-
date: date != null ? date : void 0
|
|
5087
|
-
};
|
|
6092
|
+
async __getOddsHistory(request, requestOptions) {
|
|
6093
|
+
const { sport, gameId } = request;
|
|
5088
6094
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5089
6095
|
const _headers = mergeHeaders(
|
|
5090
6096
|
_authRequest.headers,
|
|
@@ -5094,11 +6100,11 @@ var MlbClient = class {
|
|
|
5094
6100
|
const _response = await fetcher({
|
|
5095
6101
|
url: url_exports.join(
|
|
5096
6102
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
5097
|
-
|
|
6103
|
+
`v1/${url_exports.encodePathParam(sport)}/odds/history/${url_exports.encodePathParam(gameId)}`
|
|
5098
6104
|
),
|
|
5099
6105
|
method: "GET",
|
|
5100
6106
|
headers: _headers,
|
|
5101
|
-
queryString: url_exports.queryBuilder().
|
|
6107
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
5102
6108
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5103
6109
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5104
6110
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5106,10 +6112,7 @@ var MlbClient = class {
|
|
|
5106
6112
|
logging: this._options.logging
|
|
5107
6113
|
});
|
|
5108
6114
|
if (_response.ok) {
|
|
5109
|
-
return {
|
|
5110
|
-
data: _response.body,
|
|
5111
|
-
rawResponse: _response.rawResponse
|
|
5112
|
-
};
|
|
6115
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
5113
6116
|
}
|
|
5114
6117
|
if (_response.error.reason === "status-code") {
|
|
5115
6118
|
switch (_response.error.statusCode) {
|
|
@@ -5118,11 +6121,13 @@ var MlbClient = class {
|
|
|
5118
6121
|
_response.error.body,
|
|
5119
6122
|
_response.rawResponse
|
|
5120
6123
|
);
|
|
5121
|
-
case
|
|
5122
|
-
throw new
|
|
6124
|
+
case 402:
|
|
6125
|
+
throw new PaymentRequiredError(
|
|
5123
6126
|
_response.error.body,
|
|
5124
6127
|
_response.rawResponse
|
|
5125
6128
|
);
|
|
6129
|
+
case 404:
|
|
6130
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5126
6131
|
case 429:
|
|
5127
6132
|
throw new TooManyRequestsError(
|
|
5128
6133
|
_response.error.body,
|
|
@@ -5141,46 +6146,37 @@ var MlbClient = class {
|
|
|
5141
6146
|
});
|
|
5142
6147
|
}
|
|
5143
6148
|
}
|
|
5144
|
-
return handleNonStatusCodeError(
|
|
5145
|
-
|
|
5146
|
-
|
|
5147
|
-
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
constructor(options = {}) {
|
|
5151
|
-
this._options = normalizeClientOptionsWithAuth(options);
|
|
6149
|
+
return handleNonStatusCodeError(
|
|
6150
|
+
_response.error,
|
|
6151
|
+
_response.rawResponse,
|
|
6152
|
+
"GET",
|
|
6153
|
+
"/v1/{sport}/odds/history/{gameId}"
|
|
6154
|
+
);
|
|
5152
6155
|
}
|
|
5153
6156
|
/**
|
|
5154
|
-
*
|
|
5155
|
-
*
|
|
5156
|
-
* - **Consistency Score (0–100)** — how stable the player's usage/floor is. Higher = more reliable starter.
|
|
5157
|
-
* - **Momentum Delta** — signed float. Positive = trending up vs. prior 3-game baseline; negative = cooling off.
|
|
5158
|
-
* - **Opportunity Ceiling** — 90th-percentile fantasy output from the sample window. Represents the player's peak upside.
|
|
5159
|
-
*
|
|
5160
|
-
* Results are pre-computed weekly (Tuesday 3 AM ET, post-MNF) and cached. Fresh players compute on-the-fly.
|
|
6157
|
+
* Single-call team lineup intelligence: returns the current roster, recent injury updates, depth chart changes (NFL only), and active anomaly signals for any player on the team. Aggregates 4 data sources in one request. Counts as 4 requests toward your rate limit (`X-PC-Request-Weight: 4` response header).
|
|
5161
6158
|
*
|
|
5162
|
-
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
6159
|
+
* **Tier access:** Growth, Pro Insights, Syndicate Alpha
|
|
5163
6160
|
*
|
|
5164
|
-
* @param {PlaycallerApi.
|
|
6161
|
+
* @param {PlaycallerApi.GetTeamRosterPulseRequest} request
|
|
5165
6162
|
* @param {MultiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5166
6163
|
*
|
|
5167
6164
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5168
|
-
* @throws {@link PlaycallerApi.
|
|
5169
|
-
* @throws {@link PlaycallerApi.NotFoundError}
|
|
6165
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
5170
6166
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
5171
6167
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
5172
6168
|
*
|
|
5173
6169
|
* @example
|
|
5174
|
-
* await client.multi.
|
|
6170
|
+
* await client.multi.getTeamRosterPulse({
|
|
5175
6171
|
* sport: "nfl",
|
|
5176
|
-
*
|
|
6172
|
+
* team: "KC"
|
|
5177
6173
|
* })
|
|
5178
6174
|
*/
|
|
5179
|
-
|
|
5180
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6175
|
+
getTeamRosterPulse(request, requestOptions) {
|
|
6176
|
+
return HttpResponsePromise.fromPromise(this.__getTeamRosterPulse(request, requestOptions));
|
|
5181
6177
|
}
|
|
5182
|
-
async
|
|
5183
|
-
const { sport,
|
|
6178
|
+
async __getTeamRosterPulse(request, requestOptions) {
|
|
6179
|
+
const { sport, team } = request;
|
|
5184
6180
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5185
6181
|
const _headers = mergeHeaders(
|
|
5186
6182
|
_authRequest.headers,
|
|
@@ -5190,7 +6186,7 @@ var MultiClient = class {
|
|
|
5190
6186
|
const _response = await fetcher({
|
|
5191
6187
|
url: url_exports.join(
|
|
5192
6188
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
5193
|
-
`v1/${url_exports.encodePathParam(sport)}/
|
|
6189
|
+
`v1/${url_exports.encodePathParam(sport)}/teams/${url_exports.encodePathParam(team)}/roster-pulse`
|
|
5194
6190
|
),
|
|
5195
6191
|
method: "GET",
|
|
5196
6192
|
headers: _headers,
|
|
@@ -5214,13 +6210,11 @@ var MultiClient = class {
|
|
|
5214
6210
|
_response.error.body,
|
|
5215
6211
|
_response.rawResponse
|
|
5216
6212
|
);
|
|
5217
|
-
case
|
|
5218
|
-
throw new
|
|
6213
|
+
case 402:
|
|
6214
|
+
throw new PaymentRequiredError(
|
|
5219
6215
|
_response.error.body,
|
|
5220
6216
|
_response.rawResponse
|
|
5221
6217
|
);
|
|
5222
|
-
case 404:
|
|
5223
|
-
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5224
6218
|
case 429:
|
|
5225
6219
|
throw new TooManyRequestsError(
|
|
5226
6220
|
_response.error.body,
|
|
@@ -5243,50 +6237,32 @@ var MultiClient = class {
|
|
|
5243
6237
|
_response.error,
|
|
5244
6238
|
_response.rawResponse,
|
|
5245
6239
|
"GET",
|
|
5246
|
-
"/v1/{sport}/
|
|
6240
|
+
"/v1/{sport}/teams/{team}/roster-pulse"
|
|
5247
6241
|
);
|
|
5248
6242
|
}
|
|
5249
6243
|
/**
|
|
5250
|
-
*
|
|
5251
|
-
*
|
|
5252
|
-
* 1. Average fantasy points
|
|
5253
|
-
* 2. Usage rate (snap% for NFL, minutes for NBA)
|
|
5254
|
-
* 3. Opportunity rate (target share for NFL, usage% for NBA)
|
|
5255
|
-
* 4. Average rushing yards
|
|
5256
|
-
* 5. Average receiving yards
|
|
5257
|
-
* 6. Consistency Score (from Alpha Metrics)
|
|
5258
|
-
* 7. Momentum Delta (normalized)
|
|
5259
|
-
* 8. Opportunity Ceiling (from Alpha Metrics)
|
|
5260
|
-
*
|
|
5261
|
-
* Use case: "Find WRs with the same profile as CeeDee Lamb," "Identify breakout candidates with similar usage to Cooper Kupp Year 2," DFS stack-building, dynasty trade comps.
|
|
6244
|
+
* Fetch profile, stats, and optional injury/anomaly data for up to 50 players in a single API call. Reduces round-trips for clients that need to hydrate a lineup, compare a watchlist, or build a dashboard.
|
|
5262
6245
|
*
|
|
5263
|
-
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
6246
|
+
* **Tier access:** Growth, Pro Insights, Syndicate Alpha
|
|
5264
6247
|
*
|
|
5265
|
-
* @param {PlaycallerApi.
|
|
6248
|
+
* @param {PlaycallerApi.BatchPlayersRequest} request
|
|
5266
6249
|
* @param {MultiClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
5267
6250
|
*
|
|
5268
6251
|
* @throws {@link PlaycallerApi.BadRequestError}
|
|
5269
6252
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
5270
|
-
* @throws {@link PlaycallerApi.
|
|
5271
|
-
* @throws {@link PlaycallerApi.NotFoundError}
|
|
6253
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
5272
6254
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
5273
6255
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
5274
6256
|
*
|
|
5275
6257
|
* @example
|
|
5276
|
-
* await client.multi.
|
|
5277
|
-
*
|
|
5278
|
-
* sport: "nfl"
|
|
6258
|
+
* await client.multi.batchPlayers({
|
|
6259
|
+
* player_ids: ["nfl_001234", "nfl_005678"]
|
|
5279
6260
|
* })
|
|
5280
6261
|
*/
|
|
5281
|
-
|
|
5282
|
-
return HttpResponsePromise.fromPromise(this.
|
|
6262
|
+
batchPlayers(request, requestOptions) {
|
|
6263
|
+
return HttpResponsePromise.fromPromise(this.__batchPlayers(request, requestOptions));
|
|
5283
6264
|
}
|
|
5284
|
-
async
|
|
5285
|
-
const { id, sport, limit } = request;
|
|
5286
|
-
const _queryParams = {
|
|
5287
|
-
sport,
|
|
5288
|
-
limit
|
|
5289
|
-
};
|
|
6265
|
+
async __batchPlayers(request, requestOptions) {
|
|
5290
6266
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
5291
6267
|
const _headers = mergeHeaders(
|
|
5292
6268
|
_authRequest.headers,
|
|
@@ -5296,11 +6272,14 @@ var MultiClient = class {
|
|
|
5296
6272
|
const _response = await fetcher({
|
|
5297
6273
|
url: url_exports.join(
|
|
5298
6274
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
5299
|
-
|
|
6275
|
+
"v1/batch/players"
|
|
5300
6276
|
),
|
|
5301
|
-
method: "
|
|
6277
|
+
method: "POST",
|
|
5302
6278
|
headers: _headers,
|
|
5303
|
-
|
|
6279
|
+
contentType: "application/json",
|
|
6280
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
6281
|
+
requestType: "json",
|
|
6282
|
+
body: request,
|
|
5304
6283
|
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
5305
6284
|
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
5306
6285
|
abortSignal: requestOptions?.abortSignal,
|
|
@@ -5308,10 +6287,7 @@ var MultiClient = class {
|
|
|
5308
6287
|
logging: this._options.logging
|
|
5309
6288
|
});
|
|
5310
6289
|
if (_response.ok) {
|
|
5311
|
-
return {
|
|
5312
|
-
data: _response.body,
|
|
5313
|
-
rawResponse: _response.rawResponse
|
|
5314
|
-
};
|
|
6290
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
5315
6291
|
}
|
|
5316
6292
|
if (_response.error.reason === "status-code") {
|
|
5317
6293
|
switch (_response.error.statusCode) {
|
|
@@ -5322,13 +6298,11 @@ var MultiClient = class {
|
|
|
5322
6298
|
_response.error.body,
|
|
5323
6299
|
_response.rawResponse
|
|
5324
6300
|
);
|
|
5325
|
-
case
|
|
5326
|
-
throw new
|
|
6301
|
+
case 402:
|
|
6302
|
+
throw new PaymentRequiredError(
|
|
5327
6303
|
_response.error.body,
|
|
5328
6304
|
_response.rawResponse
|
|
5329
6305
|
);
|
|
5330
|
-
case 404:
|
|
5331
|
-
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
5332
6306
|
case 429:
|
|
5333
6307
|
throw new TooManyRequestsError(
|
|
5334
6308
|
_response.error.body,
|
|
@@ -5347,7 +6321,7 @@ var MultiClient = class {
|
|
|
5347
6321
|
});
|
|
5348
6322
|
}
|
|
5349
6323
|
}
|
|
5350
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "
|
|
6324
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/batch/players");
|
|
5351
6325
|
}
|
|
5352
6326
|
/**
|
|
5353
6327
|
* Returns active beat reporter signals and injury reports for a specific player. Works across NFL, MLB, NBA, NHL, and all covered sports. Signals are refreshed every 2 hours.
|
|
@@ -6772,10 +7746,92 @@ var NbaClient = class {
|
|
|
6772
7746
|
getNbaTeamRoster(request, requestOptions) {
|
|
6773
7747
|
return HttpResponsePromise.fromPromise(this.__getNbaTeamRoster(request, requestOptions));
|
|
6774
7748
|
}
|
|
6775
|
-
async __getNbaTeamRoster(request, requestOptions) {
|
|
6776
|
-
const { team, position } = request;
|
|
7749
|
+
async __getNbaTeamRoster(request, requestOptions) {
|
|
7750
|
+
const { team, position } = request;
|
|
7751
|
+
const _queryParams = {
|
|
7752
|
+
position: position != null ? position : void 0
|
|
7753
|
+
};
|
|
7754
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
7755
|
+
const _headers = mergeHeaders(
|
|
7756
|
+
_authRequest.headers,
|
|
7757
|
+
this._options?.headers,
|
|
7758
|
+
requestOptions?.headers
|
|
7759
|
+
);
|
|
7760
|
+
const _response = await fetcher({
|
|
7761
|
+
url: url_exports.join(
|
|
7762
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
7763
|
+
`v1/nba/teams/${url_exports.encodePathParam(team)}/roster`
|
|
7764
|
+
),
|
|
7765
|
+
method: "GET",
|
|
7766
|
+
headers: _headers,
|
|
7767
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
7768
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
7769
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
7770
|
+
abortSignal: requestOptions?.abortSignal,
|
|
7771
|
+
fetchFn: this._options?.fetch,
|
|
7772
|
+
logging: this._options.logging
|
|
7773
|
+
});
|
|
7774
|
+
if (_response.ok) {
|
|
7775
|
+
return {
|
|
7776
|
+
data: _response.body,
|
|
7777
|
+
rawResponse: _response.rawResponse
|
|
7778
|
+
};
|
|
7779
|
+
}
|
|
7780
|
+
if (_response.error.reason === "status-code") {
|
|
7781
|
+
switch (_response.error.statusCode) {
|
|
7782
|
+
case 401:
|
|
7783
|
+
throw new UnauthorizedError(
|
|
7784
|
+
_response.error.body,
|
|
7785
|
+
_response.rawResponse
|
|
7786
|
+
);
|
|
7787
|
+
case 404:
|
|
7788
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
7789
|
+
case 429:
|
|
7790
|
+
throw new TooManyRequestsError(
|
|
7791
|
+
_response.error.body,
|
|
7792
|
+
_response.rawResponse
|
|
7793
|
+
);
|
|
7794
|
+
case 500:
|
|
7795
|
+
throw new InternalServerError(
|
|
7796
|
+
_response.error.body,
|
|
7797
|
+
_response.rawResponse
|
|
7798
|
+
);
|
|
7799
|
+
default:
|
|
7800
|
+
throw new PlaycallerApiError({
|
|
7801
|
+
statusCode: _response.error.statusCode,
|
|
7802
|
+
body: _response.error.body,
|
|
7803
|
+
rawResponse: _response.rawResponse
|
|
7804
|
+
});
|
|
7805
|
+
}
|
|
7806
|
+
}
|
|
7807
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/nba/teams/{team}/roster");
|
|
7808
|
+
}
|
|
7809
|
+
/**
|
|
7810
|
+
* Full detail behind PlayCaller's best-validated signal in the entire portfolio — AUC-ROC 0.855, 84.23x decile lift, promoted ACTIVE 2026-06-19. `/v1/feed` returns a capped display score for this same model; this endpoint exposes the raw (pre-cap) score, percentile, and the 5 underlying signal components including `usage_vacuum`.
|
|
7811
|
+
*
|
|
7812
|
+
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
7813
|
+
*
|
|
7814
|
+
* @param {PlaycallerApi.GetNbaConfidenceRequest} request
|
|
7815
|
+
* @param {NbaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
7816
|
+
*
|
|
7817
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
7818
|
+
* @throws {@link PlaycallerApi.ForbiddenError}
|
|
7819
|
+
* @throws {@link PlaycallerApi.NotFoundError}
|
|
7820
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
7821
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
7822
|
+
*
|
|
7823
|
+
* @example
|
|
7824
|
+
* await client.nba.getNbaConfidence({
|
|
7825
|
+
* player: "Nikola Jokic"
|
|
7826
|
+
* })
|
|
7827
|
+
*/
|
|
7828
|
+
getNbaConfidence(request, requestOptions) {
|
|
7829
|
+
return HttpResponsePromise.fromPromise(this.__getNbaConfidence(request, requestOptions));
|
|
7830
|
+
}
|
|
7831
|
+
async __getNbaConfidence(request, requestOptions) {
|
|
7832
|
+
const { player } = request;
|
|
6777
7833
|
const _queryParams = {
|
|
6778
|
-
|
|
7834
|
+
player
|
|
6779
7835
|
};
|
|
6780
7836
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6781
7837
|
const _headers = mergeHeaders(
|
|
@@ -6786,7 +7842,7 @@ var NbaClient = class {
|
|
|
6786
7842
|
const _response = await fetcher({
|
|
6787
7843
|
url: url_exports.join(
|
|
6788
7844
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
6789
|
-
|
|
7845
|
+
"v1/nba/confidence"
|
|
6790
7846
|
),
|
|
6791
7847
|
method: "GET",
|
|
6792
7848
|
headers: _headers,
|
|
@@ -6810,6 +7866,11 @@ var NbaClient = class {
|
|
|
6810
7866
|
_response.error.body,
|
|
6811
7867
|
_response.rawResponse
|
|
6812
7868
|
);
|
|
7869
|
+
case 403:
|
|
7870
|
+
throw new ForbiddenError(
|
|
7871
|
+
_response.error.body,
|
|
7872
|
+
_response.rawResponse
|
|
7873
|
+
);
|
|
6813
7874
|
case 404:
|
|
6814
7875
|
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
6815
7876
|
case 429:
|
|
@@ -6830,34 +7891,35 @@ var NbaClient = class {
|
|
|
6830
7891
|
});
|
|
6831
7892
|
}
|
|
6832
7893
|
}
|
|
6833
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/nba/
|
|
7894
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/nba/confidence");
|
|
6834
7895
|
}
|
|
6835
7896
|
/**
|
|
6836
|
-
*
|
|
7897
|
+
* Per-game box score stats for an NBA player from `player_game_logs`, populated by the NBA Stats connector (stats.nba.com). Returns up to 82 games for a given season.
|
|
6837
7898
|
*
|
|
6838
|
-
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
7899
|
+
* **Tier access:** Build, Growth, Pro Insights, Syndicate Alpha
|
|
6839
7900
|
*
|
|
6840
|
-
* @param {PlaycallerApi.
|
|
7901
|
+
* @param {PlaycallerApi.GetNbaPlayerGameLogRequest} request
|
|
6841
7902
|
* @param {NbaClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
6842
7903
|
*
|
|
6843
7904
|
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
6844
|
-
* @throws {@link PlaycallerApi.
|
|
7905
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
6845
7906
|
* @throws {@link PlaycallerApi.NotFoundError}
|
|
6846
7907
|
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
6847
7908
|
* @throws {@link PlaycallerApi.InternalServerError}
|
|
6848
7909
|
*
|
|
6849
7910
|
* @example
|
|
6850
|
-
* await client.nba.
|
|
6851
|
-
*
|
|
7911
|
+
* await client.nba.getNbaPlayerGameLog({
|
|
7912
|
+
* id: "nba_2544",
|
|
7913
|
+
* season: "2024-25"
|
|
6852
7914
|
* })
|
|
6853
7915
|
*/
|
|
6854
|
-
|
|
6855
|
-
return HttpResponsePromise.fromPromise(this.
|
|
7916
|
+
getNbaPlayerGameLog(request, requestOptions) {
|
|
7917
|
+
return HttpResponsePromise.fromPromise(this.__getNbaPlayerGameLog(request, requestOptions));
|
|
6856
7918
|
}
|
|
6857
|
-
async
|
|
6858
|
-
const {
|
|
7919
|
+
async __getNbaPlayerGameLog(request, requestOptions) {
|
|
7920
|
+
const { id, season } = request;
|
|
6859
7921
|
const _queryParams = {
|
|
6860
|
-
|
|
7922
|
+
season
|
|
6861
7923
|
};
|
|
6862
7924
|
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
6863
7925
|
const _headers = mergeHeaders(
|
|
@@ -6868,7 +7930,7 @@ var NbaClient = class {
|
|
|
6868
7930
|
const _response = await fetcher({
|
|
6869
7931
|
url: url_exports.join(
|
|
6870
7932
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
6871
|
-
|
|
7933
|
+
`v1/nba/players/${url_exports.encodePathParam(id)}/game-log`
|
|
6872
7934
|
),
|
|
6873
7935
|
method: "GET",
|
|
6874
7936
|
headers: _headers,
|
|
@@ -6892,8 +7954,8 @@ var NbaClient = class {
|
|
|
6892
7954
|
_response.error.body,
|
|
6893
7955
|
_response.rawResponse
|
|
6894
7956
|
);
|
|
6895
|
-
case
|
|
6896
|
-
throw new
|
|
7957
|
+
case 402:
|
|
7958
|
+
throw new PaymentRequiredError(
|
|
6897
7959
|
_response.error.body,
|
|
6898
7960
|
_response.rawResponse
|
|
6899
7961
|
);
|
|
@@ -6917,7 +7979,7 @@ var NbaClient = class {
|
|
|
6917
7979
|
});
|
|
6918
7980
|
}
|
|
6919
7981
|
}
|
|
6920
|
-
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/nba/
|
|
7982
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/nba/players/{id}/game-log");
|
|
6921
7983
|
}
|
|
6922
7984
|
};
|
|
6923
7985
|
|
|
@@ -7166,7 +8228,7 @@ var NflClient = class {
|
|
|
7166
8228
|
/**
|
|
7167
8229
|
* Players ranked by consensus Average Draft Position (ADP), blended from Sleeper and FantasyCalc. Includes position rank, tier, and our validated confidence score where available. Refreshed weekly.
|
|
7168
8230
|
*
|
|
7169
|
-
* **Tier access:**
|
|
8231
|
+
* **Tier access:** Growth, Pro Insights, Syndicate Alpha
|
|
7170
8232
|
*
|
|
7171
8233
|
* @param {PlaycallerApi.GetNflRankingsRequest} request
|
|
7172
8234
|
* @param {NflClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -7553,6 +8615,267 @@ var NflClient = class {
|
|
|
7553
8615
|
}
|
|
7554
8616
|
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/nfl/standings");
|
|
7555
8617
|
}
|
|
8618
|
+
/**
|
|
8619
|
+
* Rank NFL players by expected fantasy points in your league's exact scoring system. Pass scoring weights in the request body; receive players sorted by `custom_pts_per_game` — computed from prior-season per-game averages.
|
|
8620
|
+
*
|
|
8621
|
+
* **Example use case:** Get PPR rankings (`rec: 1`), half-PPR (`rec: 0.5`), or any custom scoring system.
|
|
8622
|
+
*
|
|
8623
|
+
* **Tier access:** Pro Insights, Syndicate Alpha
|
|
8624
|
+
*
|
|
8625
|
+
* @param {PlaycallerApi.GetNflCustomRankingsRequest} request
|
|
8626
|
+
* @param {NflClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8627
|
+
*
|
|
8628
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
8629
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
8630
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
8631
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
8632
|
+
*
|
|
8633
|
+
* @example
|
|
8634
|
+
* await client.nfl.getNflCustomRankings()
|
|
8635
|
+
*/
|
|
8636
|
+
getNflCustomRankings(request = {}, requestOptions) {
|
|
8637
|
+
return HttpResponsePromise.fromPromise(this.__getNflCustomRankings(request, requestOptions));
|
|
8638
|
+
}
|
|
8639
|
+
async __getNflCustomRankings(request = {}, requestOptions) {
|
|
8640
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
8641
|
+
const _headers = mergeHeaders(
|
|
8642
|
+
_authRequest.headers,
|
|
8643
|
+
this._options?.headers,
|
|
8644
|
+
requestOptions?.headers
|
|
8645
|
+
);
|
|
8646
|
+
const _response = await fetcher({
|
|
8647
|
+
url: url_exports.join(
|
|
8648
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
8649
|
+
"v1/nfl/rankings/custom"
|
|
8650
|
+
),
|
|
8651
|
+
method: "POST",
|
|
8652
|
+
headers: _headers,
|
|
8653
|
+
contentType: "application/json",
|
|
8654
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
8655
|
+
requestType: "json",
|
|
8656
|
+
body: request,
|
|
8657
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
8658
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
8659
|
+
abortSignal: requestOptions?.abortSignal,
|
|
8660
|
+
fetchFn: this._options?.fetch,
|
|
8661
|
+
logging: this._options.logging
|
|
8662
|
+
});
|
|
8663
|
+
if (_response.ok) {
|
|
8664
|
+
return {
|
|
8665
|
+
data: _response.body,
|
|
8666
|
+
rawResponse: _response.rawResponse
|
|
8667
|
+
};
|
|
8668
|
+
}
|
|
8669
|
+
if (_response.error.reason === "status-code") {
|
|
8670
|
+
switch (_response.error.statusCode) {
|
|
8671
|
+
case 401:
|
|
8672
|
+
throw new UnauthorizedError(
|
|
8673
|
+
_response.error.body,
|
|
8674
|
+
_response.rawResponse
|
|
8675
|
+
);
|
|
8676
|
+
case 402:
|
|
8677
|
+
throw new PaymentRequiredError(
|
|
8678
|
+
_response.error.body,
|
|
8679
|
+
_response.rawResponse
|
|
8680
|
+
);
|
|
8681
|
+
case 429:
|
|
8682
|
+
throw new TooManyRequestsError(
|
|
8683
|
+
_response.error.body,
|
|
8684
|
+
_response.rawResponse
|
|
8685
|
+
);
|
|
8686
|
+
case 500:
|
|
8687
|
+
throw new InternalServerError(
|
|
8688
|
+
_response.error.body,
|
|
8689
|
+
_response.rawResponse
|
|
8690
|
+
);
|
|
8691
|
+
default:
|
|
8692
|
+
throw new PlaycallerApiError({
|
|
8693
|
+
statusCode: _response.error.statusCode,
|
|
8694
|
+
body: _response.error.body,
|
|
8695
|
+
rawResponse: _response.rawResponse
|
|
8696
|
+
});
|
|
8697
|
+
}
|
|
8698
|
+
}
|
|
8699
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/nfl/rankings/custom");
|
|
8700
|
+
}
|
|
8701
|
+
/**
|
|
8702
|
+
* Training camp and in-season depth chart moves detected from Sleeper daily snapshots. Includes AI-generated blurbs explaining fantasy impact. Active Jul 20–Feb; returns empty array off-season.
|
|
8703
|
+
*
|
|
8704
|
+
* **Tier access:** Growth, Pro Insights, Syndicate Alpha
|
|
8705
|
+
*
|
|
8706
|
+
* @param {PlaycallerApi.GetNflDepthChartChangesRequest} request
|
|
8707
|
+
* @param {NflClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8708
|
+
*
|
|
8709
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
8710
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
8711
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
8712
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
8713
|
+
*
|
|
8714
|
+
* @example
|
|
8715
|
+
* await client.nfl.getNflDepthChartChanges({
|
|
8716
|
+
* since: "2026-07-10",
|
|
8717
|
+
* team: "KC"
|
|
8718
|
+
* })
|
|
8719
|
+
*/
|
|
8720
|
+
getNflDepthChartChanges(request = {}, requestOptions) {
|
|
8721
|
+
return HttpResponsePromise.fromPromise(this.__getNflDepthChartChanges(request, requestOptions));
|
|
8722
|
+
}
|
|
8723
|
+
async __getNflDepthChartChanges(request = {}, requestOptions) {
|
|
8724
|
+
const { since, team, position, change_type: changeType, limit } = request;
|
|
8725
|
+
const _queryParams = {
|
|
8726
|
+
since: since != null ? since : void 0,
|
|
8727
|
+
team,
|
|
8728
|
+
position: position != null ? position : void 0,
|
|
8729
|
+
change_type: changeType != null ? changeType : void 0,
|
|
8730
|
+
limit
|
|
8731
|
+
};
|
|
8732
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
8733
|
+
const _headers = mergeHeaders(
|
|
8734
|
+
_authRequest.headers,
|
|
8735
|
+
this._options?.headers,
|
|
8736
|
+
requestOptions?.headers
|
|
8737
|
+
);
|
|
8738
|
+
const _response = await fetcher({
|
|
8739
|
+
url: url_exports.join(
|
|
8740
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
8741
|
+
"v1/nfl/depth-chart/changes"
|
|
8742
|
+
),
|
|
8743
|
+
method: "GET",
|
|
8744
|
+
headers: _headers,
|
|
8745
|
+
queryString: url_exports.queryBuilder().addMany(_queryParams).mergeAdditional(requestOptions?.queryParams).build(),
|
|
8746
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
8747
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
8748
|
+
abortSignal: requestOptions?.abortSignal,
|
|
8749
|
+
fetchFn: this._options?.fetch,
|
|
8750
|
+
logging: this._options.logging
|
|
8751
|
+
});
|
|
8752
|
+
if (_response.ok) {
|
|
8753
|
+
return {
|
|
8754
|
+
data: _response.body,
|
|
8755
|
+
rawResponse: _response.rawResponse
|
|
8756
|
+
};
|
|
8757
|
+
}
|
|
8758
|
+
if (_response.error.reason === "status-code") {
|
|
8759
|
+
switch (_response.error.statusCode) {
|
|
8760
|
+
case 401:
|
|
8761
|
+
throw new UnauthorizedError(
|
|
8762
|
+
_response.error.body,
|
|
8763
|
+
_response.rawResponse
|
|
8764
|
+
);
|
|
8765
|
+
case 402:
|
|
8766
|
+
throw new PaymentRequiredError(
|
|
8767
|
+
_response.error.body,
|
|
8768
|
+
_response.rawResponse
|
|
8769
|
+
);
|
|
8770
|
+
case 429:
|
|
8771
|
+
throw new TooManyRequestsError(
|
|
8772
|
+
_response.error.body,
|
|
8773
|
+
_response.rawResponse
|
|
8774
|
+
);
|
|
8775
|
+
case 500:
|
|
8776
|
+
throw new InternalServerError(
|
|
8777
|
+
_response.error.body,
|
|
8778
|
+
_response.rawResponse
|
|
8779
|
+
);
|
|
8780
|
+
default:
|
|
8781
|
+
throw new PlaycallerApiError({
|
|
8782
|
+
statusCode: _response.error.statusCode,
|
|
8783
|
+
body: _response.error.body,
|
|
8784
|
+
rawResponse: _response.rawResponse
|
|
8785
|
+
});
|
|
8786
|
+
}
|
|
8787
|
+
}
|
|
8788
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/nfl/depth-chart/changes");
|
|
8789
|
+
}
|
|
8790
|
+
/**
|
|
8791
|
+
* Aggregated training camp snapshot: current depth chart position changes (last 30 days), practice status, anomaly signals, and recent game stats. Replaces 5 separate endpoint calls with a single request.
|
|
8792
|
+
*
|
|
8793
|
+
* **Tier access:** Build, Growth, Pro Insights, Syndicate Alpha
|
|
8794
|
+
*
|
|
8795
|
+
* @param {PlaycallerApi.GetNflCampIntelRequest} request
|
|
8796
|
+
* @param {NflClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
8797
|
+
*
|
|
8798
|
+
* @throws {@link PlaycallerApi.UnauthorizedError}
|
|
8799
|
+
* @throws {@link PlaycallerApi.PaymentRequiredError}
|
|
8800
|
+
* @throws {@link PlaycallerApi.NotFoundError}
|
|
8801
|
+
* @throws {@link PlaycallerApi.TooManyRequestsError}
|
|
8802
|
+
* @throws {@link PlaycallerApi.InternalServerError}
|
|
8803
|
+
*
|
|
8804
|
+
* @example
|
|
8805
|
+
* await client.nfl.getNflCampIntel({
|
|
8806
|
+
* id: "id"
|
|
8807
|
+
* })
|
|
8808
|
+
*/
|
|
8809
|
+
getNflCampIntel(request, requestOptions) {
|
|
8810
|
+
return HttpResponsePromise.fromPromise(this.__getNflCampIntel(request, requestOptions));
|
|
8811
|
+
}
|
|
8812
|
+
async __getNflCampIntel(request, requestOptions) {
|
|
8813
|
+
const { id } = request;
|
|
8814
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
8815
|
+
const _headers = mergeHeaders(
|
|
8816
|
+
_authRequest.headers,
|
|
8817
|
+
this._options?.headers,
|
|
8818
|
+
requestOptions?.headers
|
|
8819
|
+
);
|
|
8820
|
+
const _response = await fetcher({
|
|
8821
|
+
url: url_exports.join(
|
|
8822
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment) ?? PlaycallerApiEnvironment.Production,
|
|
8823
|
+
`v1/nfl/players/${url_exports.encodePathParam(id)}/camp-intel`
|
|
8824
|
+
),
|
|
8825
|
+
method: "GET",
|
|
8826
|
+
headers: _headers,
|
|
8827
|
+
queryString: url_exports.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
8828
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1e3,
|
|
8829
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
8830
|
+
abortSignal: requestOptions?.abortSignal,
|
|
8831
|
+
fetchFn: this._options?.fetch,
|
|
8832
|
+
logging: this._options.logging
|
|
8833
|
+
});
|
|
8834
|
+
if (_response.ok) {
|
|
8835
|
+
return {
|
|
8836
|
+
data: _response.body,
|
|
8837
|
+
rawResponse: _response.rawResponse
|
|
8838
|
+
};
|
|
8839
|
+
}
|
|
8840
|
+
if (_response.error.reason === "status-code") {
|
|
8841
|
+
switch (_response.error.statusCode) {
|
|
8842
|
+
case 401:
|
|
8843
|
+
throw new UnauthorizedError(
|
|
8844
|
+
_response.error.body,
|
|
8845
|
+
_response.rawResponse
|
|
8846
|
+
);
|
|
8847
|
+
case 402:
|
|
8848
|
+
throw new PaymentRequiredError(
|
|
8849
|
+
_response.error.body,
|
|
8850
|
+
_response.rawResponse
|
|
8851
|
+
);
|
|
8852
|
+
case 404:
|
|
8853
|
+
throw new NotFoundError(_response.error.body, _response.rawResponse);
|
|
8854
|
+
case 429:
|
|
8855
|
+
throw new TooManyRequestsError(
|
|
8856
|
+
_response.error.body,
|
|
8857
|
+
_response.rawResponse
|
|
8858
|
+
);
|
|
8859
|
+
case 500:
|
|
8860
|
+
throw new InternalServerError(
|
|
8861
|
+
_response.error.body,
|
|
8862
|
+
_response.rawResponse
|
|
8863
|
+
);
|
|
8864
|
+
default:
|
|
8865
|
+
throw new PlaycallerApiError({
|
|
8866
|
+
statusCode: _response.error.statusCode,
|
|
8867
|
+
body: _response.error.body,
|
|
8868
|
+
rawResponse: _response.rawResponse
|
|
8869
|
+
});
|
|
8870
|
+
}
|
|
8871
|
+
}
|
|
8872
|
+
return handleNonStatusCodeError(
|
|
8873
|
+
_response.error,
|
|
8874
|
+
_response.rawResponse,
|
|
8875
|
+
"GET",
|
|
8876
|
+
"/v1/nfl/players/{id}/camp-intel"
|
|
8877
|
+
);
|
|
8878
|
+
}
|
|
7556
8879
|
};
|
|
7557
8880
|
|
|
7558
8881
|
// api/resources/nhl/client/Client.ts
|