Skip to content

Release 9.1.0: Events API, housekeeping#286

Merged
bartes merged 9 commits into
developfrom
feature/events-api-9.1.0
May 28, 2026
Merged

Release 9.1.0: Events API, housekeeping#286
bartes merged 9 commits into
developfrom
feature/events-api-9.1.0

Conversation

@bartes
Copy link
Copy Markdown
Contributor

@bartes bartes commented May 28, 2026

What

Add SDK support for the Events API (enterprise) and clean up unused internal code.

New: Events API

Three new client methods for querying event data sent to Castle:

Method Endpoint Description
events_schema GET /v1/events/schema Available fields and supported operations
query_events POST /v1/events/query Search raw event records
group_events POST /v1/events/group Aggregate and group events
client = Castle::Client.from_request(request)

# Fetch the schema
schema = client.events_schema

# Query raw events
results = client.query_events(
  filters: [{ field: 'user.id', op: '$eq', value: 'u-42' }],
  query_type: '$records_with_count'
)

# Aggregate events
groups = client.group_events(
  filters: [{ field: 'user.id', op: '$eq', value: 'u-42' }]
)

Follows the existing layered architecture (Command -> API -> ClientAction) used by Lists and ListItems. Filters and sort parameters are validated client-side.

Housekeeping

  • Removed Castle::Validators::NotSupported — dead code, never called
  • Inlined HTTPS_SCHEME string comparison in GetConnection — single-use constant

Version

9.0.0 -> 9.1.0

@bartes bartes force-pushed the feature/events-api-9.1.0 branch 2 times, most recently from e2ce550 to 0499e8e Compare May 28, 2026 09:26
@bartes bartes changed the title Release 9.1.0: Events API support, remove dead code Release 9.1.0: Events API, housekeeping May 28, 2026
@bartes bartes marked this pull request as ready for review May 28, 2026 09:28
bartes added 5 commits May 28, 2026 11:28
This validator was defined and had specs but was never called from any
command or API module. Removing dead code to keep the codebase lean.
Expose Castle's enterprise Events API through three new endpoints:

- GET  /v1/events/schema — fetch available fields and their operations
- POST /v1/events/query  — search raw event records
- POST /v1/events/group  — aggregate and group events

Follows the same layered pattern as Lists/ListItems: command builder,
API module, client action mixin. Filters and sort options are validated
client-side via Castle::Validators::Present.
Duplicate of GetConnection::HTTPS_SCHEME which is the one actually used
in the connection logic.
@bartes bartes force-pushed the feature/events-api-9.1.0 branch from 0499e8e to 11f9b3e Compare May 28, 2026 09:28
bartes added 2 commits May 28, 2026 11:32
Bundler 2.7+ deprecates these platform selectors in favour of :windows.
Updated across Gemfile and all Rails gemfiles.
@bartes bartes requested a review from zuchmanski May 28, 2026 09:44
@bartes bartes force-pushed the feature/events-api-9.1.0 branch from 9f12a44 to a838e09 Compare May 28, 2026 12:45
@bartes bartes merged commit 66c0523 into develop May 28, 2026
9 checks passed
@bartes bartes deleted the feature/events-api-9.1.0 branch May 28, 2026 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants