All Posts
February 13, 20260.1.18Calmony Sanctions Monitor

v0.1.18 — feat: add auto-topup settings UI and API endpoint

Release v0.1.18: Auto-Topup Settings

13 February 2026

What changed

  • Auto-Topup UI on the billing page — new section with a toggle to enable/disable, a threshold input ("top up when balance falls below X credits"), a package selector dropdown, a summary card showing what will happen, and a save button with dirty-state tracking.
  • New API endpointsGET /api/credits/auto-topup returns current settings and available packages; PUT /api/credits/auto-topup saves settings with Zod validation and audit logging (IP + user agent).
  • Bug fixgetCreditBalance() now returns the autoTopupPackageId field that was present in the DB schema but missing from the response.
  • Stripe dependency addedstripe ^17.0.0 added to prepare for payment integration.
  • 14 new tests covering authentication, validation, business rules, and success paths for both endpoints.

Why it matters

You can now configure auto-topup directly from the billing page so your monitoring never lapses because you ran out of credits. Set a threshold, pick a package, and credits will be purchased automatically when your balance drops.

Technical notes

  • When enabling auto-topup, both threshold (1–10,000) and packageId are required; when disabling, they're optional.
  • Audit log failures are caught silently so they never break the main save flow.
  • Form state initialises from existing account data on page load.

Release Notes

Successfully merged PR #33 and published release v0.1.18.

PR #33: "feat: add auto-topup settings UI and API endpoint"

  • Squash merged to main (SHA: 47b4e54)

Release: v0.1.18 — Auto-Topup Settings UI & API

Key changes in this release:

  • New Auto-Topup settings section on the billing page with toggle, threshold input, package selector, and save functionality
  • New GET and PUT /api/credits/auto-topup API endpoints with Clerk auth, Zod validation, and audit logging
  • Fixed getCreditBalance() to return the missing autoTopupPackageId field
  • 14 new test cases covering auth, validation, business rules, and success paths
  • Added stripe (^17.0.0) dependency