@databallr/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/README.md CHANGED
@@ -37,9 +37,14 @@ const standings = await dbr.get("/v1/nba/standings", { query: { season: 2026 } }
37
37
  `code` is UPPER_SNAKE for errors any call can hit: `INVALID_TOKEN` (401),
38
38
  `INSUFFICIENT_SCOPE` (403), `RATE_LIMITED` (429), `UPSTREAM_ERROR` (502),
39
39
  or `HTTP_ERROR` when the body is not the API's error envelope. An
40
- operation's own errors (bad input, nothing found) may still carry a
41
- sentence as `code` until the API moves them to codes, so branch on
42
- `status` for those. The API does not send `type` yet, so it is
40
+ operation's own errors (bad input, nothing found) carry one code per
41
+ status: `INVALID_REQUEST` (400), `UNAUTHORIZED` (401), `FORBIDDEN` (403),
42
+ `NOT_FOUND` (404), `METHOD_NOT_ALLOWED` (405), `CONFLICT` (409),
43
+ `BODY_TOO_LARGE` (413), `RATE_LIMITED` (429), `INTERNAL_ERROR` (500),
44
+ `UPSTREAM_ERROR` (502), `SERVICE_UNAVAILABLE` (503). The reason
45
+ (`"Valid user_id is required"`) is the error's `message`; it is written
46
+ for people and can change, so branch on `code`. The API does not send
47
+ `type` yet, so it is
43
48
  `undefined` and `retryable` is `false`; the client's own retries do not
44
49
  depend on them. Network failures throw
45
50
  `DataballrConnectionError`, and timeouts its subclass
@@ -1,5 +1,5 @@
1
1
  /** First 12 hex characters of the SHA-256 of the key-callable spec these files came from. */
2
- export declare const SPEC_HASH = "bfc137c567e9";
2
+ export declare const SPEC_HASH = "1f310d89facc";
3
3
  /**
4
4
  * Every generated method: GET operations by path, POST queries as
5
5
  * `POST <path>`. `Databallr` turns this table into `dbr.nba.players.search(...)`.
@@ -1,4 +1,4 @@
1
- export const SPEC_HASH = "bfc137c567e9";
1
+ export const SPEC_HASH = "1f310d89facc";
2
2
  export const methods = {
3
3
  apps: {
4
4
  sixrings: {
@@ -610,7 +610,7 @@ export interface paths {
610
610
  put?: never;
611
611
  /**
612
612
  * Get combined NBA PBP analytics
613
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
613
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
614
614
  */
615
615
  post: operations["postNbaPbpEnhancedStats"];
616
616
  delete?: never;
@@ -630,7 +630,7 @@ export interface paths {
630
630
  put?: never;
631
631
  /**
632
632
  * Get NBA five-player lineup combinations
633
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
633
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
634
634
  */
635
635
  post: operations["postNbaPbpLineupCombos"];
636
636
  delete?: never;
@@ -650,7 +650,7 @@ export interface paths {
650
650
  put?: never;
651
651
  /**
652
652
  * Get NBA lineup player statistics
653
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
653
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
654
654
  */
655
655
  post: operations["postNbaPbpLineupPlayers"];
656
656
  delete?: never;
@@ -670,7 +670,7 @@ export interface paths {
670
670
  put?: never;
671
671
  /**
672
672
  * Get NBA lineup possession totals
673
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
673
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
674
674
  */
675
675
  post: operations["postNbaPbpLineupSummary"];
676
676
  delete?: never;
@@ -730,7 +730,7 @@ export interface paths {
730
730
  put?: never;
731
731
  /**
732
732
  * Get one player's production across teammate on/off combinations
733
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
733
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
734
734
  */
735
735
  post: operations["postNbaPbpPlayerWowy"];
736
736
  delete?: never;
@@ -810,7 +810,7 @@ export interface paths {
810
810
  put?: never;
811
811
  /**
812
812
  * Get NBA player on/off combinations
813
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
813
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
814
814
  */
815
815
  post: operations["postNbaPbpWowyCombosStats"];
816
816
  delete?: never;
@@ -1710,7 +1710,7 @@ export interface paths {
1710
1710
  put?: never;
1711
1711
  /**
1712
1712
  * Compare NBA team similarity
1713
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
1713
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
1714
1714
  */
1715
1715
  post: operations["postNbaTeamsSimilarity"];
1716
1716
  delete?: never;
@@ -2110,7 +2110,7 @@ export interface paths {
2110
2110
  put?: never;
2111
2111
  /**
2112
2112
  * Get combined WNBA PBP analytics
2113
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
2113
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
2114
2114
  */
2115
2115
  post: operations["postWnbaPbpEnhancedStats"];
2116
2116
  delete?: never;
@@ -2130,7 +2130,7 @@ export interface paths {
2130
2130
  put?: never;
2131
2131
  /**
2132
2132
  * Get WNBA five-player lineup combinations
2133
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
2133
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
2134
2134
  */
2135
2135
  post: operations["postWnbaPbpLineupCombos"];
2136
2136
  delete?: never;
@@ -2150,7 +2150,7 @@ export interface paths {
2150
2150
  put?: never;
2151
2151
  /**
2152
2152
  * Get WNBA lineup player statistics
2153
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
2153
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
2154
2154
  */
2155
2155
  post: operations["postWnbaPbpLineupPlayers"];
2156
2156
  delete?: never;
@@ -2170,7 +2170,7 @@ export interface paths {
2170
2170
  put?: never;
2171
2171
  /**
2172
2172
  * Get WNBA lineup possession totals
2173
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
2173
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
2174
2174
  */
2175
2175
  post: operations["postWnbaPbpLineupSummary"];
2176
2176
  delete?: never;
@@ -2230,7 +2230,7 @@ export interface paths {
2230
2230
  put?: never;
2231
2231
  /**
2232
2232
  * Get one WNBA player's production across teammate on/off combinations
2233
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
2233
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
2234
2234
  */
2235
2235
  post: operations["postWnbaPbpPlayerWowy"];
2236
2236
  delete?: never;
@@ -2310,7 +2310,7 @@ export interface paths {
2310
2310
  put?: never;
2311
2311
  /**
2312
2312
  * Get WNBA player on/off combinations
2313
- * @description **API key scope:** `stats:read`. Counts toward the 20-per-minute query budget as well as the 120-per-minute key budget.
2313
+ * @description **API key scope:** `stats:read`. Counts as 6 of the 120-per-minute key budget, so up to 20 a minute.
2314
2314
  */
2315
2315
  post: operations["postWnbaPbpWowyCombosStats"];
2316
2316
  delete?: never;
@@ -3090,6 +3090,13 @@ export interface components {
3090
3090
  exclude_garbage_time?: boolean;
3091
3091
  /** @description Also return the detail counters (possession start origin, turnover and foul types, rebounds by shot type, assists by type and zone, per-player possession phase). Off by default: on the lineup-stints fast path they need a second file read. */
3092
3092
  include_detail?: boolean;
3093
+ /**
3094
+ * @description Only the team's home or away games, from its game logs. A neutral site (the 2020 bubble, Cup finals, international games) counts for the NBA's designated home team. A game the logs do not list is left out and counted in quality.location_unknown_games. Listed in the manifest's options as `location`.
3095
+ * @enum {string}
3096
+ */
3097
+ location?: "home" | "away";
3098
+ /** @description Only games in these calendar months (1-12), in any of the seasons: [12] is every December. Listed in the manifest's options as `months`. */
3099
+ months?: number[];
3093
3100
  opp_filter?: {
3094
3101
  /** @description Only games against these teams. */
3095
3102
  opp_teams?: string[];
@@ -3098,7 +3105,7 @@ export interface components {
3098
3105
  opp_players_off?: (number | string)[];
3099
3106
  /** @description Only possessions with all of these opponents on the floor. */
3100
3107
  opp_players_on?: (number | string)[];
3101
- /** @description Up to 5 tracked players (on/off lattice for wowy-combos-stats; required there). */
3108
+ /** @description Up to 5 tracked players (on/off lattice for wowy-combos-stats; none answers for the team as a whole, in one state). */
3102
3109
  players?: {
3103
3110
  id: number | string;
3104
3111
  name?: string;
@@ -3158,6 +3165,7 @@ export interface components {
3158
3165
  playoffs: boolean;
3159
3166
  quality: {
3160
3167
  invalid_lineup_events: number;
3168
+ location_unknown_games?: number;
3161
3169
  unknown_team_events: number;
3162
3170
  };
3163
3171
  results?: {
@@ -3220,6 +3228,13 @@ export interface components {
3220
3228
  exclude_garbage_time?: boolean;
3221
3229
  /** @description Also return the detail counters (possession start origin, turnover and foul types, rebounds by shot type, assists by type and zone, per-player possession phase). Off by default: on the lineup-stints fast path they need a second file read. */
3222
3230
  include_detail?: boolean;
3231
+ /**
3232
+ * @description Only the team's home or away games, from its game logs. A neutral site (the 2020 bubble, Cup finals, international games) counts for the NBA's designated home team. A game the logs do not list is left out and counted in quality.location_unknown_games. Listed in the manifest's options as `location`.
3233
+ * @enum {string}
3234
+ */
3235
+ location?: "home" | "away";
3236
+ /** @description Only games in these calendar months (1-12), in any of the seasons: [12] is every December. Listed in the manifest's options as `months`. */
3237
+ months?: number[];
3223
3238
  /** @description The focus player. */
3224
3239
  player_id: number | string;
3225
3240
  /**
@@ -3259,6 +3274,7 @@ export interface components {
3259
3274
  playoffs: boolean;
3260
3275
  quality: {
3261
3276
  invalid_lineup_events: number;
3277
+ location_unknown_games?: number;
3262
3278
  unknown_team_events: number;
3263
3279
  };
3264
3280
  results: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@databallr/sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "TypeScript client for the databallr API (NBA and WNBA stats, SixRings)",
5
5
  "license": "MIT",
6
6
  "repository": {