Summary
Running workos webhook list shows an empty URL column for webhook endpoints.
Also, when a webhook endpoint is subscribed to many events, the Events column joins all event names into a single cell. This can exceed the terminal width and make the table difficult to read.
Steps to reproduce
- Create a webhook endpoint that is subscribed to many events.
- Run
workos webhook list.
Actual behaviour
- The
URL column is empty.
- The
Events column becomes very long, which makes the terminal table difficult to read.
Notes from local code inspection
In src/commands/webhook.ts, the list output reads ep.url:
const rows = result.data.map((ep) => [ep.id, ep.url, ep.events.join(, ), ep.created_at]);
However, the webhook endpoint create request body in src/lib/workos-client.ts sends endpoint_url:
body: { endpoint_url: endpointUrl, events },
workosRequest appears to return the response JSON as-is, without normalising endpoint_url to url:
So if the real API list response contains endpoint_url, the human-readable table would read undefined from ep.url, which matches the empty URL column.
The current unit test mock uses url, so it may not catch this mismatch:
const mockWebhook = {
id: we_123,
url: https://example.com/hook,
events: ['dsync.user.created'],
created_at: '2024-01-01T00:00:00Z',
updated_at: '2024-01-01T00:00:00Z',
};
The emulator also appears to model webhook endpoints with url, so it may be hiding a difference from the real API response shape.
Summary
Running
workos webhook listshows an emptyURLcolumn for webhook endpoints.Also, when a webhook endpoint is subscribed to many events, the
Eventscolumn joins all event names into a single cell. This can exceed the terminal width and make the table difficult to read.Steps to reproduce
workos webhook list.Actual behaviour
URLcolumn is empty.Eventscolumn becomes very long, which makes the terminal table difficult to read.Notes from local code inspection
In
src/commands/webhook.ts, the list output readsep.url:However, the webhook endpoint create request body in
src/lib/workos-client.tssendsendpoint_url:workosRequestappears to return the response JSON as-is, without normalisingendpoint_urltourl:So if the real API list response contains
endpoint_url, the human-readable table would readundefinedfromep.url, which matches the emptyURLcolumn.The current unit test mock uses
url, so it may not catch this mismatch:The emulator also appears to model webhook endpoints with
url, so it may be hiding a difference from the real API response shape.