Skip to content

feat(api): list analytics event types and their payload fields - #929

Merged
zaira-bibi merged 1 commit into
mainfrom
zaira/be/analytics-event-catalog
Oct 27, 2026
Merged

zaira-bibi merged 1 commit into
mainfrom
zaira/be/analytics-event-catalog

Conversation

@zaira-bibi

@zaira-bibi zaira-bibi commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Part of: Analytics viewers cannot create custom views or filter events

What

Analytics viewers have no way to discover which events and payload fields exist, so nothing can build a
view from them; this adds a catalog of every registered event type and its fields.

Changes

  • feat(api): GET /api/v1/analytics/events (gated by analytics.read) lists each event type with its
    payload fields: name, kind (string, enum, boolean, integer), allowed values for enums and literals, nullable
  • Built from the ANALYTICS_EVENTS hook, so plugin events appear while their plugin is installed; versions
    merge, the highest version's kind wins; unsupported kinds (e.g. float) are left out
  • event_catalog, catalog_entry and the models exported from sparkth.lib.analytics; API types regenerated

How to Test

  1. uv run pytest tests/analytics/test_event_catalog.py
  2. As a user with analytics.read, GET /api/v1/analytics/events and check user.logged_in lists
    method as an enum of password, google.
  3. Without analytics.read it returns 403; unauthenticated, 401.

Notes

First of five stacked PRs.

This PR description was written with the assistance of an LLM (Claude).

🤖 Generated with Claude Code

@zaira-bibi
zaira-bibi added this pull request to stack #934 October 21, 2026 08:28
@zaira-bibi zaira-bibi self-assigned this Oct 21, 2026
@zaira-bibi
zaira-bibi marked this pull request as ready for review October 21, 2026 08:37

@hamza-56 hamza-56 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@zaira-bibi
zaira-bibi force-pushed the zaira/be/analytics-event-catalog branch from e33038f to 8989100 Compare October 23, 2026 09:28
Comment thread sparkth/core/analytics/schemas/reads.py Outdated
Comment thread sparkth/core/analytics/catalog.py Outdated
Comment thread sparkth/api/v1/analytics.py Outdated
@zaira-bibi
zaira-bibi force-pushed the zaira/be/analytics-event-catalog branch 2 times, most recently from 23cfcd7 to e3dabfe Compare October 26, 2026 06:39
@zaira-bibi
zaira-bibi requested a review from hamza-56 October 26, 2026 06:47
@zaira-bibi
zaira-bibi force-pushed the zaira/be/analytics-event-catalog branch from e3dabfe to 5e250ea Compare October 26, 2026 06:47
@zaira-bibi
zaira-bibi removed this pull request from stack #934 October 26, 2026 07:05
@zaira-bibi
zaira-bibi added this pull request to stack #997 October 26, 2026 07:05
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@zaira-bibi
zaira-bibi force-pushed the zaira/be/analytics-event-catalog branch from 5e250ea to a5bcf24 Compare October 27, 2026 10:57

@abdulrafey1 abdulrafey1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small rename, rest looks good

Comment thread sparkth/core/analytics/schemas/reads.py Outdated
@zaira-bibi
zaira-bibi force-pushed the zaira/be/analytics-event-catalog branch from a5bcf24 to 04e5f4c Compare October 27, 2026 12:08
@zaira-bibi
zaira-bibi merged commit ad35427 into main Oct 27, 2026
12 checks passed
@zaira-bibi
zaira-bibi deleted the zaira/be/analytics-event-catalog branch October 27, 2026 12:15
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.

3 participants