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.
SDK version: 10.10.0
Problem
The API emits
pipes.connected_account.connected,.disconnectedand.reauthorization_needed, and the SDK already knows those literals — they appear inCreateWebhookEndpointEventsandUpdateWebhookEndpointEvents.But no corresponding event interface is in the
Eventunion, andEventNameis derived from it:events.listEvents({ events: EventName[] })therefore rejects all three, even though webhook endpoints accept them.Repro
Workaround
Which also means the
eventfield on the returned events is untyped for these, so the payload has to be validated by hand.Expected
Pipes connected-account events in the
Eventunion with their payload types, soEventNamepicks them up andlistEventsnarrows the result like it does foruser.*andorganization.*.Consistency note: webhook endpoint events and
listEventsevents currently disagree about which event names are valid.