diff --git a/CHANGELOG.md b/CHANGELOG.md index 3e360fa..8f122c0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,13 +5,63 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [8.0.0] - 2026-09-08 + +### Fixed + +- **Schedule entries now expose `purchases`, and `type` is a union again.** + The upstream spec described a park's schedule two different ways: precisely + when nested under a destination, loosely when fetched directly. The direct + path is the one this client uses, so `purchases` was invisible and `type` + was a bare `string`. + + Magic Kingdom alone serves 27 schedule entries carrying `purchases`. If you + reached them before, you did it with a cast. You no longer need to: + + ```ts + const sched = await tp.entity(parkId).schedule(); + for (const day of sched.schedule ?? []) { + if (day.type === 'TICKETED_EVENT') { + for (const p of day.purchases ?? []) console.log(p.name, p.price.amount); + } + } + ``` + +- **`purchases[].price.amount` is nullable, matching `PriceData`.** 7.1.0 made + `PriceData.amount` nullable but the schedule path carried a second, inline + copy of the price shape that kept `amount` non-nullable. Both now resolve to + one `PriceData`. Tokyo Disneyland serves six Premier Access rows with a null + amount right now, so this was a type that disagreed with production. + +- Schedule entries gained the `description` field the API has always sent. ### Changed -- **Minimum supported Node is now 20.** Node 18 reached end of life on - 2025-04-30 and is no longer tested. `engines` moves from `>=18` to `>=20`, - and CI now runs Node 20, 22 and 24. +- **BREAKING — `tags[].value` is now `unknown`.** The spec declares no type + for it, only a prose description, so the previous + `string | number | Record` was an invention. Narrow before + use: + + ```ts + const v = entity.tags?.[0]?.value; + if (typeof v === 'string') { + /* ... */ + } + ``` + +- **BREAKING — nullability tightened where the API never sends null.** + `location` on entities and children is no longer `| null`, and + `purchases[].type` is no longer `| null`. Verified against production: 412 + sampled children all carried a location, 255 sampled purchases all carried a + type. Comparisons against `null` on these will now fail to compile. + +- `destinations` on the destinations response is required rather than + optional, and a destination's `parks` are typed as their own shape rather + than recursively as a schedule response. + +- **BREAKING — minimum supported Node is now 20.** Node 18 reached end of life + on 2025-04-30 and is no longer tested. `engines` moves from `>=18` to + `>=20`, and CI runs Node 20, 22 and 24. Nothing in the shipped bundle needed Node 18 specifically; the constraint arrives from the dev toolchain, where eslint 10 and vitest 4 both require @@ -19,8 +69,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 verifies, the claim is withdrawn. If you are still on Node 18, stay on 7.1.x. -- Dev dependencies: eslint 9 to 10, vitest 1 to 4. No change to the published - type surface: `dist/index.d.ts` is byte-identical to 7.1.0's. +- Dev dependencies: eslint 9 to 10, vitest 1 to 4. TypeScript stays on 5.x. `openapi-typescript@7.13.0` still declares `peer typescript@"^5.x"`, so TypeScript 6 cannot be installed here until diff --git a/package.json b/package.json index ef655d4..f080937 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "themeparks", - "version": "7.1.0", + "version": "8.0.0", "description": "Official SDK for the ThemeParks.wiki API", "license": "MIT", "repository": "github:ThemeParks/ThemeParks_JavaScript",