diff --git a/CHANGELOG.md b/CHANGELOG.md index 75346db..86bf554 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,21 @@ All notable changes to `@sharp-api/client` are documented here. +## 0.4.1 — 2026-06-02 + +### Added — structured `team_side` + `market_segment` (issue #76 / #689) + +- `NormalizedOdds`, `EVOpportunity`, and `ClosingOdd` gain optional `team_side` + (`'home' | 'away' | 'draw' | 'over' | 'under'`) and `market_segment` + (`string`). Wire keys are snake_case (the client returns raw JSON without key + transforms), matching `is_active`. +- `team_side` is the raw structured side decomposed out of the compound + `selectionType` / `selection_type` vocabulary — prefer it over parsing compound + prefixes like `'home_over'`. `market_segment` is the canonical contest slice. +- `NormalizedOdds.selectionType` widened with `(string & {})` so it accepts the + team-total compound forms (`'home_over'`, ...) the server emits without a major + bump. Additive, non-breaking. + ## 0.4.0 — 2026-06-02 ### Changed diff --git a/package.json b/package.json index dd6a09b..70ecb8a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@sharp-api/client", - "version": "0.4.0", + "version": "0.4.1", "description": "Official TypeScript/JavaScript client for the SharpAPI real-time sports betting odds API", "type": "module", "main": "./dist/index.cjs", diff --git a/src/index.ts b/src/index.ts index af563a6..8d7db24 100644 --- a/src/index.ts +++ b/src/index.ts @@ -301,6 +301,17 @@ export interface NormalizedOdds extends NestedRefs { | 'home_draw' | 'away_draw' | 'home_away' + | (string & {}) + /** + * Raw structured side axis ("home" | "away" | "draw") decomposed out of the + * compound selectionType vocabulary (issue #76). Optional + additive — absent + * when the adapter didn't stamp it. Wire key is snake_case `team_side` (the + * client returns raw JSON without key transforms). Prefer over parsing + * compound selectionType prefixes like "home_over". + */ + team_side?: 'home' | 'away' | 'draw' | 'over' | 'under' + /** Canonical contest slice ("full_game" | "1st_half" | ...) — issue #689. Wire key snake_case. */ + market_segment?: string odds: OddsValue line?: number eventStartTime: string @@ -336,6 +347,10 @@ export interface EVOpportunity extends NestedRefs { fairProbability: number evPercentage: number kellyPercent: number + /** Raw structured side axis ("home" | "away" | "draw") — issue #76. Optional; wire key snake_case `team_side`. */ + team_side?: 'home' | 'away' | 'draw' | 'over' | 'under' + /** Canonical contest slice ("full_game" | "1st_half" | ...) — issue #689. Wire key snake_case. */ + market_segment?: string detectedAt: string } @@ -550,6 +565,10 @@ export interface ClosingOdd { | 'away_draw' | 'home_away' | (string & {}) + /** Raw structured side axis ("home" | "away" | "draw") — issue #76. Optional + additive. */ + team_side?: 'home' | 'away' | 'draw' | 'over' | 'under' + /** Canonical contest slice ("full_game" | "1st_half" | ...) — issue #689. */ + market_segment?: string odds_american: number odds_decimal: number /** Spread / total line — present only on point-spread and totals markets. */