Skip to content

chore: regenerate schema from upstream spec - #41

Closed
tpw-drift[bot] wants to merge 1 commit into
mainfrom
automated/spec-drift
Closed

tpw-drift[bot] wants to merge 1 commit into
mainfrom
automated/spec-drift

Conversation

@tpw-drift

@tpw-drift tpw-drift Bot commented Sep 9, 2026

Copy link
Copy Markdown

Automated schema regeneration from the api.themeparks.wiki OpenAPI spec.

  • build: success
  • live smoke tests: success

A build failure here means the upstream contract changed in a way
this client cannot absorb automatically. Do not merge until it is
green.

@tpw-drift
tpw-drift Bot force-pushed the automated/spec-drift branch 3 times, most recently from a062db1 to 6a6e6c4 Compare September 18, 2026 11:18
@tpw-drift
tpw-drift Bot force-pushed the automated/spec-drift branch 2 times, most recently from f02c565 to ad73fdb Compare September 20, 2026 11:27
@cubehouse

Copy link
Copy Markdown
Member

Superseded by #46, which regenerates against the current spec as part of its own change. Leaving this open until #46 merges; it should go empty on the next drift run after that.

cubehouse added a commit that referenced this pull request Sep 23, 2026
* feat: the loop above the history calls

#45 exposed the three history endpoints. This adds what a backfill needs on
top of them, and fixes two things in the layer underneath.

span() returns archiveFrom, recordedTo and retrievableThrough in one shape.
The coverage documents do not: a park nests them under summary, an entity
carries them at the top level under different names, so every caller writes
that branch before their first question. retrievableThrough is the end date to
bound a backfill by, because it is what the key may read rather than what the
archive holds, and those differ on every plan below the top one.

days() pages until the server stops offering a next, follows that URL verbatim
rather than re-deriving it, and yields { entityId, row } as rows arrive instead
of collecting them. A park's daily call is the one paged call in the family, so
a park backfill previously stopped at the first 31 days without saying so.
changeRows() does the same for changes(). Both flatten a park envelope and an
entity envelope to the same stream, so the caller writes one loop.

BudgetExhaustedError carries retryAfterMs, so a run that hits the hourly budget
can checkpoint and come back.

Two fixes underneath:

- A 429 could park the client for hours. The transport honoured any
  Retry-After up to retry.max times, which is right for a REST 429 asking for
  seconds and wrong for a history one: that budget is hourly, so three waits is
  about two and a half hours of a silent process. RetryConfig gains
  maxRetryAfterMs, 120000 by default; past it the client does not sleep and
  throws RateLimitError with retryAfterMs set.

- EntityHistoryCoverage was missing the park shape. /history/coverage answers a
  PARK with HistoryParkCoverageDocument, exactly as /history and /history/daily
  do. A TypeScript user read .kinds off a park's coverage, got undefined, and
  the compiler said nothing. The fixture covering it was hand-written in the
  entity shape and named after a park, so it agreed with the code for the same
  reason the code was wrong; both coverage fixtures are now captured from
  production, and the live smoke test asserts the shape it actually gets.

Also: the user agent announced 7.0.0-alpha.0 from a package at 8.0.0, and the
schema is regenerated against the current spec, which supersedes #41.

examples/backfill.mjs is the whole thing end to end, with resume and CSV. Run
against production it pulled Disneyland Resort's entire daily archive, 98,452
rows, and matched the Python SDK's output row for row on every completed day;
the only rows that differed were today's, where operatingMinutes had grown by
the elapsed time between the two runs, which is what the spec says it does.

99 unit tests, 12 of them new. tsc, eslint, prettier and the build are clean.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* release: 8.1.0, and stop the version drifting again

The announced version was a literal and it had drifted: 7.0.0-alpha.0 in a
package at 8.0.0, so every request the SDK made named a version a major old and
nothing anywhere failed. The Python sibling had the same bug and was two majors
out, which is what made it worth fixing structurally rather than by hand.

A gate test now asserts the User-Agent the server actually receives carries the
version package.json declares. Checking the header rather than the constant
means a correct constant wired up wrongly fails too.

8.1.0 rather than 9.0.0: the only shape that changed, EntityHistoryCoverage
widening to a union, has never been published. 8.0.0 shipped before #45 merged,
so no consumer can be relying on the narrower type.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@cubehouse

Copy link
Copy Markdown
Member

Stale. #46 regenerated against the current spec on the way in, and regenerating main just now produces no diff, so this branch carries nothing that is not already on main. The next drift run will open a fresh one if the spec moves.

@cubehouse cubehouse closed this Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant