Skip to content

pipes.connected_account.* events are missing from the Event union, so listEvents rejects them #1685

Description

@adume

SDK version: 10.10.0

Problem

The API emits pipes.connected_account.connected, .disconnected and .reauthorization_needed, and the SDK already knows those literals — they appear in CreateWebhookEndpointEvents and UpdateWebhookEndpointEvents.

But no corresponding event interface is in the Event union, and EventName is derived from it:

type EventName = Event['event'];

events.listEvents({ events: EventName[] }) therefore rejects all three, even though webhook endpoints accept them.

Repro

await workos.events.listEvents({
  events: ['pipes.connected_account.connected'],
});
// Type '"pipes.connected_account.connected"' is not assignable to type 'EventName'.

Workaround

events: [...(PIPES_CONNECTED_ACCOUNT_EVENT_TYPES as unknown as EventName[])],

Which also means the event field on the returned events is untyped for these, so the payload has to be validated by hand.

Expected

Pipes connected-account events in the Event union with their payload types, so EventName picks them up and listEvents narrows the result like it does for user.* and organization.*.

Consistency note: webhook endpoint events and listEvents events currently disagree about which event names are valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions