feat(listReservations): lock in from/to ISO-8601 window passthrough (0.3.2)#103
Merged
Conversation
…0.3.2) Client-side companion to cycles-protocol-v0.yaml revision 2026-05-21 (runcycles/cycles-protocol#97) and runcycles/cycles-server#160. Closes the TypeScript-client side of issue #159. The existing `listReservations(params?: Record<string, string>)` signature already forwards arbitrary keys to the URL query string, so the new `from` and `to` ISO-8601 date-time params work over the wire today without a code change. This commit adds a regression test that pins the contract: URL-encoded form "from=2026-05-21T00%3A00%3A00Z&to=2026-05-22T00%3A00%3A00Z" must land in fetch's call. Future tightening of the Record signature cannot silently drop the new params. Unlike Python, TypeScript has no reserved-keyword issue — callers can write `client.listReservations({ from: "...", to: "..." })` directly. No protocol or wire-format change; servers older than v0.1.25.20 silently ignore the new params per the additive-parameter guarantee in cycles-protocol-v0.yaml. 316 tests pass at 98.4% statement coverage / 99.62% line coverage (gate ≥95%). Bumped to 0.3.2, updated AUDIT.md and CHANGELOG.md.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Client-side companion to cycles-protocol-v0.yaml revision 2026-05-21 and cycles-server#160 (which together added
from/toISO-8601 window-filter query params toGET /v1/reservations).What this PR does
listReservationsthat verifiesfrom/toISO-8601 date-time values are URL-encoded and forwarded to the query string. The existingparams?: Record<string, string>signature already accepts these — the test pins that down so future tightening cannot drop the new params silently.AUDIT.mdandCHANGELOG.md.No production code change. Wire format unchanged.
Call-site syntax
Unlike the Python client (where
fromis a reserved keyword), TypeScript callers can write the new params directly:The colons get URL-encoded to
%3Aover the wire.Verification
npm test: 316 passed, 5 skipped.npm run test:coverage: 98.4% statements / 99.62% lines (gate ≥95% perCLAUDE.md).Test plan
Out of scope
Record<string, string>signature is left as-is; an explicitListReservationsParamsstrongly-typed interface would be a separate ergonomic discussion.Closes the TypeScript-client side of the issue cluster for runcycles/cycles-server#159.