feat(#706): add actor and to date filters to GET /api/events - #907
feat(#706): add actor and to date filters to GET /api/events#907malaysiaonelove wants to merge 1 commit into
Conversation
Add two new query parameters to the global event feed endpoint:
- `actor` — filter events by the Stellar account that performed the action
- `to` — filter events with timestamps less than or equal to a unix timestamp (upper date bound)
These complement the existing `eventType`, `streamId`, `since` (lower bound),
and `cursor` filters. All filter combinations work correctly, and empty results
return `{data: [], total: 0}`.
Changes:
- validation/schemas.ts: add `actor` and `to` to listEventsQuerySchema
- services/eventHistory.ts: extend getGlobalEvents and countAllEvents with new params
- index.ts: pass new filters through to service layer
- index.test.ts: add unit tests for actor/to filters; fix missing adminJwtAuth mock
- integration.test.ts: add integration tests for actor/to filter combinations
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
|
@malaysiaonelove is attempting to deploy a commit to the ritik4ever's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@malaysiaonelove Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
Adds
actorandtoquery parameters to theGET /api/eventsglobal event feed endpoint, completing the filter set described in #706.What Changed
validation/schemas.tsactor(string) andto(unix timestamp) tolistEventsQuerySchemaservices/eventHistory.tsgetGlobalEvents()andcountAllEvents()withactorandtoparameters — appliesactor = ?andtimestamp <= ?SQL conditionsindex.tsindex.test.tsadminJwtAuth/getJwtSecretmocksintegration.test.tsEndpoint Before
Endpoint After
New Parameters
actorstringtonumbertimestamp <= toare returnedAcceptance Criteria
{data: [], total: 0}Example Usage
Notes
stream_eventstable columnsadminJwtAuth) are fixed as part of this PRCloses #706