Skip to content

Commit 32159b5

Browse files
cubehouseclaude
andauthored
release: v8.0.0 (#39)
Ships the corrected schema, regenerated after the upstream spec stopped describing a park's schedule two different ways. The headline fix is that schedule entries expose `purchases` and a `type` union again. The spec described the nested-under-a-destination path precisely and the direct path loosely, and the direct path is the one this client uses, so 27 Magic Kingdom entries carrying purchases were invisible without a cast. `purchases[].price.amount` is also nullable now, matching PriceData — 7.1.0 fixed one copy of the price shape and there was a second, inline one. Breaking for strict TypeScript consumers in three places, each documented in the changelog: `tags[].value` becomes `unknown` because the spec declares no type for it, `location` and `purchases[].type` lose a `| null` the API never sends, and the Node floor moves to 20. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent cab0dd9 commit 32159b5

2 files changed

Lines changed: 56 additions & 7 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 55 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,71 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [8.0.0] - 2026-09-08
9+
10+
### Fixed
11+
12+
- **Schedule entries now expose `purchases`, and `type` is a union again.**
13+
The upstream spec described a park's schedule two different ways: precisely
14+
when nested under a destination, loosely when fetched directly. The direct
15+
path is the one this client uses, so `purchases` was invisible and `type`
16+
was a bare `string`.
17+
18+
Magic Kingdom alone serves 27 schedule entries carrying `purchases`. If you
19+
reached them before, you did it with a cast. You no longer need to:
20+
21+
```ts
22+
const sched = await tp.entity(parkId).schedule();
23+
for (const day of sched.schedule ?? []) {
24+
if (day.type === 'TICKETED_EVENT') {
25+
for (const p of day.purchases ?? []) console.log(p.name, p.price.amount);
26+
}
27+
}
28+
```
29+
30+
- **`purchases[].price.amount` is nullable, matching `PriceData`.** 7.1.0 made
31+
`PriceData.amount` nullable but the schedule path carried a second, inline
32+
copy of the price shape that kept `amount` non-nullable. Both now resolve to
33+
one `PriceData`. Tokyo Disneyland serves six Premier Access rows with a null
34+
amount right now, so this was a type that disagreed with production.
35+
36+
- Schedule entries gained the `description` field the API has always sent.
937

1038
### Changed
1139

12-
- **Minimum supported Node is now 20.** Node 18 reached end of life on
13-
2025-04-30 and is no longer tested. `engines` moves from `>=18` to `>=20`,
14-
and CI now runs Node 20, 22 and 24.
40+
- **BREAKING — `tags[].value` is now `unknown`.** The spec declares no type
41+
for it, only a prose description, so the previous
42+
`string | number | Record<string, never>` was an invention. Narrow before
43+
use:
44+
45+
```ts
46+
const v = entity.tags?.[0]?.value;
47+
if (typeof v === 'string') {
48+
/* ... */
49+
}
50+
```
51+
52+
- **BREAKING — nullability tightened where the API never sends null.**
53+
`location` on entities and children is no longer `| null`, and
54+
`purchases[].type` is no longer `| null`. Verified against production: 412
55+
sampled children all carried a location, 255 sampled purchases all carried a
56+
type. Comparisons against `null` on these will now fail to compile.
57+
58+
- `destinations` on the destinations response is required rather than
59+
optional, and a destination's `parks` are typed as their own shape rather
60+
than recursively as a schedule response.
61+
62+
- **BREAKING — minimum supported Node is now 20.** Node 18 reached end of life
63+
on 2025-04-30 and is no longer tested. `engines` moves from `>=18` to
64+
`>=20`, and CI runs Node 20, 22 and 24.
1565

1666
Nothing in the shipped bundle needed Node 18 specifically; the constraint
1767
arrives from the dev toolchain, where eslint 10 and vitest 4 both require
1868
Node 20 or newer. Rather than keep claiming support for a runtime nothing
1969
verifies, the claim is withdrawn. If you are still on Node 18, stay on
2070
7.1.x.
2171

22-
- Dev dependencies: eslint 9 to 10, vitest 1 to 4. No change to the published
23-
type surface: `dist/index.d.ts` is byte-identical to 7.1.0's.
72+
- Dev dependencies: eslint 9 to 10, vitest 1 to 4.
2473

2574
TypeScript stays on 5.x. `openapi-typescript@7.13.0` still declares
2675
`peer typescript@"^5.x"`, so TypeScript 6 cannot be installed here until

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "themeparks",
3-
"version": "7.1.0",
3+
"version": "8.0.0",
44
"description": "Official SDK for the ThemeParks.wiki API",
55
"license": "MIT",
66
"repository": "github:ThemeParks/ThemeParks_JavaScript",

0 commit comments

Comments
 (0)