feat(api): add GET /api/actions/unified endpoint (closes #155)#185
Open
akuraposo wants to merge 1 commit into
Open
feat(api): add GET /api/actions/unified endpoint (closes #155)#185akuraposo wants to merge 1 commit into
akuraposo wants to merge 1 commit into
Conversation
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
Implements
GET /api/actions/unified— a merged, paginated action log endpoint that combines Instagram and Twitter actions into a single consistent JSON schema. Closes #155.This delivers the Unified action log (IG/Twitter/GitHub) roadmap item under 3) Data and Storage. GitHub actions are stubbed/omitted per the spec; the focus is on the IG + Twitter merge.
Endpoint
Query params
limitoffsetaccountstatussuccessorerrorsortdescascordesc(by timestamp)Response shape
{ "actions": [ { "platform": "twitter", "action": "tweet", "timestamp": "2026-07-01T11:00:00.000Z", "status": "success", "metadata": { "id": "tw-1", "account": "default", "username": "tw_user", "error": null, "details": { "tweetId": "999" } } } ], "pagination": { "total": 2, "limit": 20, "offset": 0, "hasMore": false } }Each action has the consistent shape required by the bounty:
platform,action,timestamp,status, andmetadata.Implementation notes
listActionLogsservice (withplatformfilter), over-fetching (limit * 2per platform, capped at 100) so that after merging + sorting + paginating the caller still gets a full page in the common case.ActionLogStatustype andlistActionLogsservice — no new DB schema, no new file-based store./api/docsendpoint list so it shows up in the API documentation.Acceptance criteria checklist
GET /api/actions/unifiedresponds with HTTP 200platform,action,timestamp,status, andmetadata?limit=and?offset=query paramsapps/api/src/routes/api.test.ts(4 new tests added)Tests
4 new test cases in
apps/api/src/routes/api.test.ts, all passing:responds with 401 without authenticationreturns a merged, paginated IG + Twitter action log— verifies both platforms present, consistent shape, sorted desc by timestamp, pagination metadatahonours limit and offset pagination paramsreturns 500 when the action log service throwsCloses #155
/claim #155