Skip to content

feat(api): typed response structs, batch 6 — webhooks, schedules, keys (#1196) - #1208

Merged
athvin merged 2 commits into
mainfrom
issue/1196-typed-webhooks-schedules-keys
Nov 24, 2026
Merged

athvin merged 2 commits into
mainfrom
issue/1196-typed-webhooks-schedules-keys

Conversation

@athvin

@athvin athvin commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Closes #1196

Part of #864 (batch 6 of 10: webhooks+schedules+keys).

🚧 Claimed by an agent session — 2026-11-24T16:16:24Z, session Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306 on Mac.
The claim is this open draft PR: closing it releases the ticket.

Post-merge is part of this pull request. The ledger below records whether
the follow-up work actually happened. /land-pr closes it.

What

Batch 6 of #864 converts API key issue and revoke, schedules (list, create, toggle, delete), and webhooks (list, create, delete, deliveries, event catalog) to typed structs. The shared Deleted also types delete_salesforce_connection. 12 more operations now publish a $ref success schema (52 → 64 of 119).

Why

OpenAPI is the customer integration contract (#857). Keys and webhooks are how an integrator authenticates and listens.

Proof

  • make check: 1,154 passed, 0 failed.
  • er-server --tests against Postgres: 388 passed.
  • Frontend tsc --noEmit is clean against the regenerated schema.d.ts.
  • envelopes.json is unchanged.

Risk & rollback

Bodies are value-equal to the old ones; only key order changes. The webhook list still never includes the secret. Rollback: git revert <merge-sha>.

Post-merge ledger

Closed by: agent · session Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306 on Mac · 2026-11-24T16:46:59Z

Specific to this change

Context — plan, discoveries, measurements, files

Plan

  • Structs: KeyIssued, KeyRevoked, Deleted, ScheduleItem (From<&pg::ScheduleRow>), ScheduleCreated, ScheduleToggled, WebhookItem (From<&WebhookWire>, the four list fields), WebhookCreated, WebhookDeliveryList (WebhookDeliveryWire, field-identical to the entity), WebhookEventCatalog/WebhookEventItem.
  • Value-equality tests in response_shape_tests. The catalog is compared against webhook::catalog_json().

Discoveries

Measurements

Files

rust/crates/er-server/src/{lib.rs,openapi.rs}, frontend/src/lib/api/{openapi.json,openapi.public.json,schema.d.ts}

#1196)

API key issue and revoke, the schedule list/create/toggle/delete, and
the webhook list/create/delete, deliveries and event catalog now return
Serialize + ToSchema structs. Deleted is shared by every {deleted}
body, so delete_salesforce_connection is typed too. 12 more operations
publish a $ref success schema (52 -> 64).

WebhookItem projects the secret-free WebhookWire to the four fields the
list served, and deliveries serialize through WebhookDeliveryWire,
which is field-identical to the entity.

Value equality against the previous json! builds is pinned in
response_shape_tests; envelopes.json is unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

The marketing preview was removed because this PR is closed or merged.

@athvin
athvin merged commit e51245b into main Nov 24, 2026
46 checks passed
@athvin
athvin temporarily deployed to marketing-preview November 24, 2026 16:34 — with GitHub Actions Inactive

This branch was previously deployed

1 inactive deployment
marketing-preview — cc18c5c7 Deployed Nov 24, 2026 by athvin via remove closed PR previews #27
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.

#864 batch 6: typed responses for webhooks+schedules+keys

2 participants