From c7e933319eae51ab6f03441c0c593c7bbb78bad3 Mon Sep 17 00:00:00 2001 From: "paperclip-resolver[bot]" <3736210+paperclip-resolver[bot]@users.noreply.github.com> Date: Tue, 2 Jun 2026 22:43:55 -0400 Subject: [PATCH] feat: add optional team_side + marketSegment to odds/EV/closing types (#76, #689) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- CHANGELOG.md | 15 +++++++++++++++ package.json | 2 +- src/index.ts | 19 +++++++++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) 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. */