Skip to content

Commit dce5382

Browse files
paperclip-resolver[bot]claude
andcommitted
feat: add optional teamSide + marketSegment to odds/EV/closing types (#76, #689)
Surfaces the structured side + segment axes the API now emits (sharp-api-go #76 Phase C / #689). NormalizedOdds + EVOpportunity gain optional teamSide + marketSegment; ClosingOdd gains snake_case team_side + market_segment (matching that endpoint's wire). selectionType/selection_type unions widen with (string & {}) so any server value is accepted without a major bump; compound team-total literals intentionally retained. Additive, non-breaking. Bump 0.3.2 → 0.3.3. Type: feat Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent ceef747 commit dce5382

3 files changed

Lines changed: 35 additions & 1 deletion

File tree

CHANGELOG.md

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

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

5+
## 0.3.3 — 2026-06-02
6+
7+
### Added — structured `teamSide` + `marketSegment` (issue #76 / #689)
8+
9+
- `NormalizedOdds` and `EVOpportunity` gain optional `teamSide`
10+
(`'home' | 'away' | 'draw' | 'over' | 'under'`) and `marketSegment` (`string`);
11+
`ClosingOdd` gains the snake_case `team_side` + `market_segment` (matching that
12+
endpoint's wire casing).
13+
- `teamSide` is the raw structured side decomposed out of the compound
14+
`selectionType` vocabulary — prefer it over parsing compound prefixes like
15+
`'home_over'`. `marketSegment` is the canonical contest slice.
16+
- Additive, optional, non-breaking. The `selectionType` / `selection_type`
17+
unions now also admit `(string & {})` so they accept any server value without
18+
a major bump; the compound team-total literals were intentionally **not**
19+
removed.
20+
521
## 0.3.2 — 2026-05-07
622

723
### 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.3.2",
3+
"version": "0.3.3",
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: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,16 @@ 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. Prefer this over parsing compound
309+
* selectionType prefixes (e.g. "home_over").
310+
*/
311+
teamSide?: 'home' | 'away' | 'draw' | 'over' | 'under'
312+
/** Canonical contest slice ("full_game" | "1st_half" | ...) — issue #689. */
313+
marketSegment?: string
304314
odds: OddsValue
305315
line?: number
306316
eventStartTime: string
@@ -324,6 +334,10 @@ export interface EVOpportunity extends NestedRefs {
324334
fairProbability: number
325335
evPercentage: number
326336
kellyPercent: number
337+
/** Raw structured side axis ("home" | "away" | "draw") — issue #76. Optional + additive. */
338+
teamSide?: 'home' | 'away' | 'draw' | 'over' | 'under'
339+
/** Canonical contest slice ("full_game" | "1st_half" | ...) — issue #689. */
340+
marketSegment?: string
327341
detectedAt: string
328342
}
329343

@@ -538,6 +552,10 @@ export interface ClosingOdd {
538552
| 'away_draw'
539553
| 'home_away'
540554
| (string & {})
555+
/** Raw structured side axis ("home" | "away" | "draw") — issue #76. Optional + additive. */
556+
team_side?: 'home' | 'away' | 'draw' | 'over' | 'under'
557+
/** Canonical contest slice ("full_game" | "1st_half" | ...) — issue #689. */
558+
market_segment?: string
541559
odds_american: number
542560
odds_decimal: number
543561
/** Spread / total line — present only on point-spread and totals markets. */

0 commit comments

Comments
 (0)