Skip to content

feat(types): nested refs + TeamRef metadata (0.3.0 / 0.3.1)#7

Merged
Mlaz-code merged 3 commits into
mainfrom
feat/team-metadata-phase-2c
May 7, 2026
Merged

feat(types): nested refs + TeamRef metadata (0.3.0 / 0.3.1)#7
Mlaz-code merged 3 commits into
mainfrom
feat/team-metadata-phase-2c

Conversation

@Mlaz-code
Copy link
Copy Markdown
Contributor

@Mlaz-code Mlaz-code commented 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.

Mlaz-code and others added 3 commits May 6, 2026 22:08
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 Mlaz-code changed the title feat(types): TeamRef logo/city/mascot/conference/division (Phase 2c) feat(types): nested refs + TeamRef metadata (0.3.0 / 0.3.1) May 7, 2026
@Mlaz-code Mlaz-code marked this pull request as ready for review May 7, 2026 14:22
@Mlaz-code Mlaz-code merged commit 995302f into main May 7, 2026
@Mlaz-code Mlaz-code deleted the feat/team-metadata-phase-2c branch May 7, 2026 14:22
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant