Repository navigation
feat: sync with the 2026-10-20 API release - #34
Conversation
- `CascadeTier.location` accepts the `PeopleLocationFilter` object the API takes since 2026-10-20 (at most 10 values per list, a 422 above); the `string[]` of country codes stays accepted as the legacy form. Code that reads `tier.location` back as an array must now narrow it. - `APIStatusError.fair_usage` exposes the `fair_usage` block of a 402 body, like the Python SDK. - Docs: rate limit is per plan and shared by every key of the account; 401 also means "no access to this route", 422/423 described; the search endpoints return only the matched position in `experiences`; department distribution counts jobs, not people; filters that used to be accepted and ignored now return 422.
| * A `string[]` of country codes is the legacy form, still accepted: it is read as | ||
| * `country_code`, and a list holding `"WORLD"` turns the country filter off. | ||
| */ | ||
| location?: PeopleLocationFilter | string[]; |
There was a problem hiding this comment.
CascadeTier.location now accepts an object, but neither waterfall request test sends a location. CLAUDE.md requires a request/response test when changing an endpoint. Add typed cases for the new object and the retained string[] form, and check the sent body. This repository requirement must be satisfied before merging.
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/types/filters.ts
Line: 303
Comment:
**Location forms lack tests**
`CascadeTier.location` now accepts an object, but neither waterfall request test sends a location. `CLAUDE.md` requires a request/response test when changing an endpoint. Add typed cases for the new object and the retained `string[]` form, and check the sent body. This repository requirement must be satisfied before merging.
**Context Used:** CLAUDE.md ([source](https://github.com/api-blitz/blitz-api-js/blob/main/CLAUDE.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| function parse_fair_usage(body: unknown): FairUsage | null { | ||
| if (body === null || typeof body !== "object" || Array.isArray(body)) return null; | ||
| const parsed = FairUsage.safeParse((body as Record<string, unknown>).fair_usage); | ||
| return parsed.success ? parsed.data : null; |
There was a problem hiding this comment.
APIStatusError.fair_usage has no test for a populated, missing, or malformed block. The existing 402 tests send only message, so they never check the new parsing behavior. Add these cases to test/errors.test.ts, including checks that malformed usage data leaves the original error class, status, and body intact. This would protect reset information and keep later parsing changes from hiding the HTTP error.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/errors.ts
Line: 115-118
Comment:
**Error usage lacks tests**
`APIStatusError.fair_usage` has no test for a populated, missing, or malformed block. The existing `402` tests send only `message`, so they never check the new parsing behavior. Add these cases to `test/errors.test.ts`, including checks that malformed usage data leaves the original error class, status, and body intact. This would protect reset information and keep later parsing changes from hiding the HTTP error.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Syncs the SDK with the API deployed up to the 2026-10-20 release, from the 2026-10-26 docs/SDK audit (each changed claim checked against the blitz-api code).
CascadeTier.locationtakes thePeopleLocationFilterobject (city,country_code,continent,sales_region; at most 10 values per list, a 422 above). Thestring[]of country codes stays accepted as the legacy form. Release note: code that readstier.locationback must narrow it (Array.isArray).APIStatusError.fair_usageexposes thefair_usageblock of a 402 body, like the Python SDK.experiences; department distribution counts jobs, not people; filters that used to be accepted and ignored now return 422.revenue_rangeandpeople.job_descriptionare not included (merged in the API, not deployed). No conflict with #33.Checks:
pnpm lint,pnpm typecheck,pnpm gen:enums:check,pnpm test(158 pass),pnpm build. No live API calls.The code changes appear sound, but the repository-required waterfall request tests must be added before merging.
Fix with agent prompt
Summary
Updates the SDK for the 2026-10-20 API release.
fair_usageblock when it parses.Reviews (1) · Last reviewed commit: "feat: sync with the 2026-10-20 API relea..." · Reviewed by Greptile