refactor(client): response cache stores serialized documents; drop structuredClone (#2468)

This commit is contained in:
Felix Weinberger 2026-07-13 17:39:41 +01:00 • committed by GitHub
commit 5db6e38f2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1588,7 +1588,7 @@ rewrite required unless noted.
instead of sending the request. Set `enforceStrictCapabilities: true` in `ClientOptions`
to restore the v1 throw.
- Called **without a `cursor`**, the same methods now **auto-aggregate every page** and
return `nextCursor: undefined`. Passing `{ cursor }` still fetches one page. Manual
return an aggregate with no `nextCursor`. Passing `{ cursor }` still fetches one page. Manual
pagination loops keep working (the first iteration returns everything); replace them
with the bare no-arg call. The walk is capped at `ClientOptions.listMaxPages` (default
64); overrun throws `SdkError(ListPaginationExceeded)`. There is no way to fetch only
@ -1606,6 +1606,9 @@ rewrite required unless noted.
trip. Per-call override: `{ cacheMode: 'refresh' | 'bypass' }`. New `ClientOptions`:
`cachePartition`, `defaultCacheTtlMs`. `ResponseCacheStore` gained `delete(key)`;
`InMemoryResponseCacheStore` is now bounded (`{ maxEntries }`, default 512).
`CacheEntry.value` (and the `set()` entry value) is the JSON-serialized result
document (`string`, not `unknown`): persist and return it verbatim, `JSON.parse`
it to inspect.
#### Server (Streamable HTTP transport)