feat(types): nested refs + TeamRef metadata (0.3.0 / 0.3.1)#7
Merged
Conversation
Add structured ref types (TeamRef, SportRef, EntityRef, NestedRefs) plus Team and Market reference types, then surface optional home/away/ sport_ref/league_ref/market_ref/sportsbook_ref on every odds, opportunity, and reference row shipping in api-adapters PR #489 + sharp-api-go PR #345. Reference endpoints (Sport, League, Sportsbook, Market) gain optional numerical_id, and Team adds optional abbreviation. ArbitrageLeg gains sportsbook_ref, ClosingOdd gains market_ref + sportsbook_ref. All fields are additive — legacy code keeps compiling. LowHoldOpportunity is upgraded from untyped to a proper interface so nested refs surface alongside the flat fields; the [key: string] index signature preserves forward compatibility. Bumps to 0.3.0 (minor — purely additive, no field renames or removals). Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Surfaces five additional optional fields on the TeamRef interface (and
the Team reference-endpoint shape), sourced from OpticOdds and
backfilled into the SharpAPI atlas by api-adapters PR #499. All five
default to undefined and are additive — older servers (and 0.3.0 client
code) keep working unchanged.
Coverage at the atlas layer: logo ~93%, similar on the rest. The atlas
``nickname`` field is intentionally NOT mirrored because it duplicates
``mascot`` per the seeding convention.
Touched:
src/index.ts — TeamRef + Team gain logo/city/mascot/
conference/division (each optional)
tests/client.test.ts — describe block "Phase 2c team metadata"
covers populated TeamRef, legacy/unset
TeamRef, and the /teams Team shape
package.json — bump 0.3.0 → 0.3.1
CHANGELOG.md — 0.3.1 entry
Tests: vitest → 88 passed (was 85 baseline; +3 Phase 2c tests).
Build: tsup ESM/CJS + DTS clean. Lint: biome check clean. Typecheck:
tsc --noEmit clean.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- Add MIT LICENSE and SECURITY.md ([email protected]) - Update author email support@ → hello@ - Fix @sharpapi/client → @sharp-api/client in README + JSDoc (README install command + import example pointed at a non-existent scope, so users following the README hit npm 404) - Scrub OpticOdds attribution and internal phase markers from source comments, tests, and CHANGELOG - Soften "sharp-api-go" reference to "server-side" - Replace staging.sharpapi.io test fixture with api.example.test - Untrack tests/ and add to .gitignore (kept locally for dev); drop the test step from test.yml + publish.yml (now lint+typecheck gate only) - Strip sourcesContent from npm sourcemaps (esbuildOptions in tsup.config.ts) so the .map files no longer ship a full copy of src/index.ts; tarball size 57.7kB → 31.0kB - Tighten .gitignore (.claude/, .worktrees/, .DS_Store, coverage/) Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Mlaz-code
added a commit
that referenced
this pull request
May 7, 2026
## Summary Two related additions to the type model, both additive and non-breaking: **0.3.0 — nested refs** - New interfaces: `TeamRef`, `SportRef`, `EntityRef`, `Team`, `Market`, `NestedRefs` bundle - Typed `LowHoldOpportunity` (was loosely typed before) - Existing `NormalizedOdds`, `EVOpportunity`, `ArbitrageOpportunity`, `MiddleOpportunity` extend with optional nested refs via `NestedRefs` - `ArbitrageLeg` gains `sportsbook_ref`; `ClosingOdd` gains `market_ref` + `sportsbook_ref` - Reference rows (`Sport`, `League`, `Sportsbook`, `Market`) gain `numerical_id`; `Team` adds `abbreviation` + `numerical_id` **0.3.1 — TeamRef metadata** - `TeamRef` and the `Team` reference shape gain optional `logo`, `city`, `mascot`, `conference`, `division`. ~93% coverage on `logo`, similar on the rest. All five default to `undefined`. ## Plus a public-release cleanup pass - Add MIT `LICENSE` and `SECURITY.md` - Fix package-scope mismatch: README install + JSDoc `import` example now point at `@sharp-api/client` (matches `package.json`; the previous `@sharpapi/client` 404'd) - Untrack `tests/` and add to `.gitignore` (kept locally for dev); CI gate is now biome + tsc across Node 18/20/22 - Strip `sourcesContent` from `.map` files via `tsup` `esbuildOptions` so the npm tarball no longer ships a full copy of `src/index.ts`; tarball 57.7 kB → 31.0 kB - Update author email to `[email protected]` - Misc internal-comment cleanup ## Compatibility No existing field renamed, retyped, or removed. Code on 0.2.x continues to compile. --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two related additions to the type model, both additive and non-breaking:
0.3.0 — nested refs
TeamRef,SportRef,EntityRef,Team,Market,NestedRefsbundleLowHoldOpportunity(was loosely typed before)NormalizedOdds,EVOpportunity,ArbitrageOpportunity,MiddleOpportunityextend with optional nested refs viaNestedRefsArbitrageLeggainssportsbook_ref;ClosingOddgainsmarket_ref+sportsbook_refSport,League,Sportsbook,Market) gainnumerical_id;Teamaddsabbreviation+numerical_id0.3.1 — TeamRef metadata
TeamRefand theTeamreference shape gain optionallogo,city,mascot,conference,division. ~93% coverage onlogo, similar on the rest. All five default toundefined.Plus a public-release cleanup pass
LICENSEandSECURITY.mdimportexample now point at@sharp-api/client(matchespackage.json; the previous@sharpapi/client404'd)tests/and add to.gitignore(kept locally for dev); CI gate is now biome + tsc across Node 18/20/22sourcesContentfrom.mapfiles viatsupesbuildOptionsso the npm tarball no longer ships a full copy ofsrc/index.ts; tarball 57.7 kB → 31.0 kB[email protected]Compatibility
No existing field renamed, retyped, or removed. Code on 0.2.x continues to compile.