Skip to content

refactor(metrics): extract shared cursor-pagination helper - #415

Merged
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
thlpkee20-wq:refactor/metrics-01-validation-helper
Jul 28, 2026
Merged

refactor(metrics): extract shared cursor-pagination helper#415
mikewheeleer merged 1 commit into
Agentpay-Org:mainfrom
thlpkee20-wq:refactor/metrics-01-validation-helper

Conversation

@thlpkee20-wq

Copy link
Copy Markdown
Contributor

Closes #391

The /api/v1/health/deep checks handler inlined its own base64url
cursor encode/decode and page-slicing logic. Extracted it into a
generic paginateByCursor() in src/cursorPagination.ts — mirroring
the offset-pagination helper already shared between the api-keys and
webhooks list endpoints — and refactored the health handler to use it.
No behavior change; this is the shared entry point the metrics
pagination work (#387) builds on next.

Test plan

  • npm run build
  • npm run lint
  • npm test — targeted run of health-deep.test.js,
    openapi-routes.test.js, routes/operational.test.js: 12/12
    passing, no behavior change.

The health/deep checks handler inlined its own base64url cursor
encode/decode and page-slicing logic. Extracted it into a generic
paginateByCursor() in src/cursorPagination.ts (mirroring the offset
pagination helper already shared between the api-keys and webhooks list
endpoints) and refactored the health handler to use it. No behavior
change; this is the shared entry point subsequent metrics pagination
work will build on.
@mikewheeleer

Copy link
Copy Markdown
Contributor

polished work @thlpkee20-wq, merging it in 🚀

@mikewheeleer
mikewheeleer merged commit fbf3c33 into Agentpay-Org:main Jul 28, 2026
1 check passed
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.

Extract the shared metrics handler validation into a reusable helper

2 participants