Skip to content

feat(listReservations): lock in from/to ISO-8601 window passthrough (0.3.2)#103

Merged
amavashev merged 1 commit into
mainfrom
feat/list-reservations-from-to
May 21, 2026
Merged

feat(listReservations): lock in from/to ISO-8601 window passthrough (0.3.2)#103
amavashev merged 1 commit into
mainfrom
feat/list-reservations-from-to

Conversation

@amavashev
Copy link
Copy Markdown
Contributor

Summary

Client-side companion to cycles-protocol-v0.yaml revision 2026-05-21 and cycles-server#160 (which together added from / to ISO-8601 window-filter query params to GET /v1/reservations).

What this PR does

  • Adds a regression test for listReservations that verifies from / to ISO-8601 date-time values are URL-encoded and forwarded to the query string. The existing params?: Record<string, string> signature already accepts these — the test pins that down so future tightening cannot drop the new params silently.
  • Bumps to 0.3.2.
  • Updates AUDIT.md and CHANGELOG.md.

No production code change. Wire format unchanged.

Call-site syntax

Unlike the Python client (where from is a reserved keyword), TypeScript callers can write the new params directly:

await client.listReservations({
  tenant: "acme",
  from: "2026-05-21T00:00:00Z",
  to:   "2026-05-22T00:00:00Z",
});

The colons get URL-encoded to %3A over the wire.

Verification

  • npm test: 316 passed, 5 skipped.
  • npm run test:coverage: 98.4% statements / 99.62% lines (gate ≥95% per CLAUDE.md).

Test plan

  • CI green
  • (After merge) optional smoke against a v0.1.25.20 cycles-server

Out of scope

  • The client's permissive Record<string, string> signature is left as-is; an explicit ListReservationsParams strongly-typed interface would be a separate ergonomic discussion.

Closes the TypeScript-client side of the issue cluster for runcycles/cycles-server#159.

…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.
@amavashev amavashev merged commit 9c53083 into main May 21, 2026
9 checks passed
@amavashev amavashev deleted the feat/list-reservations-from-to branch May 21, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant