Skip to content

fix(events): Type Pipes connected account events - #1686

Open
workos-tars[bot] wants to merge 2 commits into
mainfrom
fix/pipes-connected-account-events
Open

fix(events): Type Pipes connected account events#1686
workos-tars[bot] wants to merge 2 commits into
mainfrom
fix/pipes-connected-account-events

Conversation

@workos-tars

@workos-tars workos-tars Bot commented Aug 25, 2026

Copy link
Copy Markdown

Summary

  • add typed event and response variants for all four Pipes connected-account events supported by the Events API
  • deserialize connected-account and connection-failure payloads to the SDK's camelCase conventions
  • allow all four event names in listEvents filters and align webhook endpoint event enums with the current OpenAPI spec
  • cover filter typing and payload deserialization with a focused Events API test

Addresses #1685.

Requested by heather@workos.com via TARS

Pipes events are available through listEvents, but EventName excluded
them and returned payloads fell through the untyped serializer path.
Aligning the SDK with the API schema removes consumer casts.

Addresses #1685
@workos-tars
workos-tars Bot requested review from a team as code owners August 25, 2026 21:28
@workos-tars
workos-tars Bot requested a review from imkesin August 25, 2026 21:28
@greptile-apps

greptile-apps Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds typed support for four Pipes connected-account events across event retrieval and webhook subscriptions.

  • Adds wire and normalized payload interfaces for connected-account and connection-failure events.
  • Normalizes Pipes event payload fields to the SDK’s camelCase conventions.
  • Adds all four event variants to the public event unions and webhook endpoint subscription enums.
  • Tests event filtering and payload deserialization, including the disconnected state.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
src/common/interfaces/event.interface.ts Adds public wire and SDK payload variants for all four Pipes connected-account events and correctly includes the disconnected state.
src/common/serializers/event.serializer.ts Dispatches the new event names and normalizes their nested payload fields into the public SDK shape.
src/events/events.spec.ts Covers event-filter typing and deserialization for connected, disconnected, and connection-failure payloads.
src/webhooks/interfaces/create-webhook-endpoint-events.interface.ts Adds the connection-failure event to create-endpoint subscription values.
src/webhooks/interfaces/update-webhook-endpoint-events.interface.ts Adds the connection-failure event to update-endpoint subscription values.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  API[Events API or verified webhook] --> Wire[Typed Pipes event response]
  Wire --> Dispatcher[deserializeEvent]
  Dispatcher --> Account[Connected-account deserializer]
  Dispatcher --> Failure[Connection-failure deserializer]
  Account --> SDK[Public camelCase Event union]
  Failure --> SDK
  SDK --> Consumer[SDK consumer]
Loading

Reviews (2): Last reviewed commit: "fix(events): Allow disconnected Pipes st..." | Re-trigger Greptile

Comment thread src/common/interfaces/event.interface.ts Outdated
Disconnected account events can carry a disconnected state at runtime.
The public event payload type must represent that lifecycle value.
@workos-tars

workos-tars Bot commented Aug 25, 2026

Copy link
Copy Markdown
Author

Valid finding—fixed in 79a0a07.

  • Added disconnected to the Pipes event-specific state type.
  • Added typed deserialization coverage for a disconnected payload.
  • Local event tests (22), typecheck, ESLint, and Prettier pass.

PR #1686 is updated; CI is pending on the new head.

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.

0 participants