feat: update new log api schema #584
Draft
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.
New Log API Schema
Base:
logstorebranch (PR #580)Summary
Introduces new Log API endpoints focused on Delivery as the primary entity, with backward-compatible legacy endpoints.
Key Changes
Event-Centric → Delivery-Centric
GET /:tenantID/eventsGET /:tenantID/deliveriesGET /:tenantID/events/:eventIDGET /:tenantID/deliveries/:deliveryIDGET /destinations/:destID/eventsGET /:tenantID/deliveries?destination_id=XRetry: Event → Delivery
POST /:tenantID/events/:eventID/retryPOST /:tenantID/deliveries/:deliveryID/retryResponse Schema Changes
Delivery:
{ "id": "del_xxx", "event": "evt_xxx", // or expanded Event object "destination": "dest_xxx", "status": "success", "delivered_at": "2024-01-01T00:00:00Z", "code": "200", "response_data": {} }Event:
{ "id": "evt_xxx", "topic": "user.created", "time": "2024-01-01T00:00:00Z", "eligible_for_retry": true, "metadata": {}, "data": {} // only with expand=event.data }New Endpoints
/:tenantID/deliveries/:tenantID/deliveries/:deliveryID/:tenantID/deliveries/:deliveryID/retry/:tenantID/events/:eventIDQuery Parameters (List Deliveries)
destination_id- Filter by destinationevent_id- Filter by eventstatus- Filter by status (success, failed)expand=event- Include event summary (without data)expand=event.data- Include full event with payloadnext,prev,limit- PaginationLegacy Endpoints (Deprecated)
All legacy endpoints return
DeprecationandSunsetheaders but continue to work:GET /:tenantID/eventsGET /:tenantID/deliveriesGET /:tenantID/events/:eventIDGET /:tenantID/deliveries/:deliveryIDGET /:tenantID/events/:eventID/deliveriesGET /:tenantID/deliveries?event_id=XPOST /:tenantID/events/:eventID/retryPOST /:tenantID/deliveries/:deliveryID/retryGET /destinations/:destID/eventsGET /:tenantID/deliveries?destination_id=XGET /destinations/:destID/events/:eventIDGET /:tenantID/deliveries/:deliveryIDGET /destinations/:destID/events/:eventID/deliveriesGET /:tenantID/deliveries?event_id=X&destination_id=X