Skip to content

Commit c7e9333

Browse files
paperclip-resolver[bot]claude
andcommitted
feat: add optional team_side + marketSegment to odds/EV/closing types (#76, #689)
NormalizedOdds, EVOpportunity, ClosingOdd gain optional team_side ("home"|"away"|"draw") + market_segment. Wire keys snake_case (raw JSON, no key transforms — matches is_active). selectionType widened with (string & {}) to accept server-emitted team-total compound forms (home_over, ...). Additive, non-breaking. Bump 0.4.0 → 0.4.1. Type: feat Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b4c1252 commit c7e9333

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@
22

33
All notable changes to `@sharp-api/client` are documented here.
44

5+
## 0.4.1 — 2026-06-02
6+
7+
### Added — structured `team_side` + `market_segment` (issue #76 / #689)
8+
9+
- `NormalizedOdds`, `EVOpportunity`, and `ClosingOdd` gain optional `team_side`
10+
(`'home' | 'away' | 'draw' | 'over' | 'under'`) and `market_segment`
11+
(`string`). Wire keys are snake_case (the client returns raw JSON without key
12+
transforms), matching `is_active`.
13+
- `team_side` is the raw structured side decomposed out of the compound
14+
`selectionType` / `selection_type` vocabulary — prefer it over parsing compound
15+
prefixes like `'home_over'`. `market_segment` is the canonical contest slice.
16+
- `NormalizedOdds.selectionType` widened with `(string & {})` so it accepts the
17+
team-total compound forms (`'home_over'`, ...) the server emits without a major
18+
bump. Additive, non-breaking.
19+
520
## 0.4.0 — 2026-06-02
621

722
### Changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sharp-api/client",
3-
"version": "0.4.0",
3+
"version": "0.4.1",
44
"description": "Official TypeScript/JavaScript client for the SharpAPI real-time sports betting odds API",
55
"type": "module",
66
"main": "./dist/index.cjs",

src/index.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,17 @@ export interface NormalizedOdds extends NestedRefs {
301301
| 'home_draw'
302302
| 'away_draw'
303303
| 'home_away'
304+
| (string & {})
305+
/**
306+
* Raw structured side axis ("home" | "away" | "draw") decomposed out of the
307+
* compound selectionType vocabulary (issue #76). Optional + additive — absent
308+
* when the adapter didn't stamp it. Wire key is snake_case `team_side` (the
309+
* client returns raw JSON without key transforms). Prefer over parsing
310+
* compound selectionType prefixes like "home_over".
311+
*/
312+
team_side?: 'home' | 'away' | 'draw' | 'over' | 'under'
313+
/** Canonical contest slice ("full_game" | "1st_half" | ...) — issue #689. Wire key snake_case. */
314+
market_segment?: string
304315
odds: OddsValue
305316
line?: number
306317
eventStartTime: string
@@ -336,6 +347,10 @@ export interface EVOpportunity extends NestedRefs {
336347
fairProbability: number
337348
evPercentage: number
338349
kellyPercent: number
350+
/** Raw structured side axis ("home" | "away" | "draw") — issue #76. Optional; wire key snake_case `team_side`. */
351+
team_side?: 'home' | 'away' | 'draw' | 'over' | 'under'
352+
/** Canonical contest slice ("full_game" | "1st_half" | ...) — issue #689. Wire key snake_case. */
353+
market_segment?: string
339354
detectedAt: string
340355
}
341356

@@ -550,6 +565,10 @@ export interface ClosingOdd {
550565
| 'away_draw'
551566
| 'home_away'
552567
| (string & {})
568+
/** Raw structured side axis ("home" | "away" | "draw") — issue #76. Optional + additive. */
569+
team_side?: 'home' | 'away' | 'draw' | 'over' | 'under'
570+
/** Canonical contest slice ("full_game" | "1st_half" | ...) — issue #689. */
571+
market_segment?: string
553572
odds_american: number
554573
odds_decimal: number
555574
/** Spread / total line — present only on point-spread and totals markets. */

0 commit comments

Comments
 (0)