fix(track,growth): negotiate the API contract by date header instead of a v1 prefix - #355
Conversation
There was a problem hiding this comment.
Checked the sweep rather than the shape, since the risk in a change this mechanical is a missed call site.
At 0a24122, both packages are fully converted: 27 trackRequest and 27 growthRequest call sites, no remaining apiRequest, TRACK_API_URL or GROWTH_API_URL reference outside api-base.ts, no direct fetch anywhere in either package, and no /v1 left in either source tree. The remaining /v1 hits in the repo are the unified POST /v1/auth/exchange in the README, the CHANGELOG history, and ferrvault's vaults/v1 path segment, all unrelated.
Both helpers are byte-identical in shape to fleetRequest, and apiRequest merges headers before the credential headers, so the version header cannot displace Authorization or x-api-token. Test & Build is green.
The ordering constraint you flag is the real gate here, and it is a human call, not something this review can clear: #773 and #846 deployed before this merges.
## [8.1.1] - 2026-09-20 ### Bug Fixes - fix(track,growth): negotiate the API contract by date header instead of a v1 prefix (#355)
Closes #338
@ferrtrack/mcpand@ferrgrowth/mcpwere the last two clients still calling a/v1path. Both product APIs drop the prefix in FerrLabs/FerrTrack-Cloud#773 and FerrLabs/FerrGrowth-Cloud#846, so this moves the clients onto the date header, the same shape@ferrfleet/mcpalready uses.What changed
Each package gains a
trackRequest/growthRequesthelper inapi-base.ts, pinning the base URL and the version header in one place so 27 call sites per package stop repeating either:Paths lose
/v1.FERRTRACK_API_VERSIONandFERRGROWTH_API_VERSIONoverride the sent version and are documented in the README, so a caller can pin an older contract once transforms exist without waiting for an MCP release.Ordering
This is the client half. It must not ship before the two API PRs, or every tool in both packages 404s, which is exactly what happened to
@ferrfleet/mcpbetween #317 and #323.Since the APIs are the breaking side and these packages are unpublished against the new paths until a release goes out, the safe order is: merge and deploy #773 and #846 first, then merge this.
Verification
pnpm build,pnpm typecheck,pnpm format:check,pnpm testandpnpm smokeall pass. 117 tests, 2 skipped, 2 new.The two new tests are the ones that matter here, one per package:
The existing path assertions in both packages moved to the un-prefixed URLs, so a regression back to
/v1fails them rather than passing silently.