Skip to content

Commit 3ee4813

Browse files
cubehouseclaude
andauthored
docs: correct the 8.0.0 changelog purchases example (#40)
Two errors in the example shipped with 8.0.0, both mine. `entity(id).schedule` is a property holding a ScheduleApi, not a method, so the snippet as written threw 'schedule is not a function'. The call is `.schedule.upcoming()`. The snippet also filtered on `day.type === 'TICKETED_EVENT'`, which matches nothing useful: purchases are Lightning Lane entries attached to ordinary OPERATING days. Measured against Magic Kingdom today — 48 TICKETED_EVENT entries with no purchases, 26 OPERATING entries with them. The filter is removed and the distinction called out, since filtering on type is the obvious wrong guess. The example is now run verbatim against the published 8.0.0 package rather than written from memory of the API. The entry count is stated as a dated snapshot because the schedule window rolls. No code change; the package is unaffected. Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 32159b5 commit 3ee4813

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
path is the one this client uses, so `purchases` was invisible and `type`
1616
was a bare `string`.
1717

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:
18+
Magic Kingdom served 26 of 79 upcoming entries with `purchases` on the day
19+
this shipped. If you reached them before, you did it with a cast. You no
20+
longer need to:
2021

2122
```ts
22-
const sched = await tp.entity(parkId).schedule();
23+
const sched = await tp.entity(parkId).schedule.upcoming();
2324
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);
25+
for (const p of day.purchases ?? []) {
26+
console.log(day.date, p.name, p.price.amount, p.price.currency);
27+
// 2026-09-08 Lightning Lane for Seven Dwarfs Mine Train 1100 USD
2628
}
2729
}
2830
```
2931

32+
Purchases are not limited to `TICKETED_EVENT` days — Lightning Lane entries
33+
attach to ordinary `OPERATING` days, so do not filter on `type` to find
34+
them.
35+
3036
- **`purchases[].price.amount` is nullable, matching `PriceData`.** 7.1.0 made
3137
`PriceData.amount` nullable but the schedule path carried a second, inline
3238
copy of the price shape that kept `amount` non-nullable. Both now resolve to

0 commit comments

Comments
 (0)