The result of parseWebhookEvent: a discriminated union keyed by event.
Narrow on event (e.g. via switch or ===) to get a correctly typed payload.
This union only models the event keys in WebhookEventPayloadMap. If a
future Bitbucket version adds a new event, parseWebhookEvent still returns it
as-is at runtime (event holds the raw string, payload the raw body) — use
isWebhookEventKey to defensively check event before trusting the
narrowed payload type if you need to guard against that.
The result of parseWebhookEvent: a discriminated union keyed by
event. Narrow onevent(e.g. viaswitchor===) to get a correctly typedpayload.This union only models the event keys in WebhookEventPayloadMap. If a future Bitbucket version adds a new event,
parseWebhookEventstill returns it as-is at runtime (eventholds the raw string,payloadthe raw body) — use isWebhookEventKey to defensively checkeventbefore trusting the narrowedpayloadtype if you need to guard against that.