Skip to content

Add WebhookPayload type to aggregate all possible WebhookPayloadSchemas under one type union#4

Open
maxijonson wants to merge 4 commits intopaynow-gg:mainfrom
maxijonson:main
Open

Add WebhookPayload type to aggregate all possible WebhookPayloadSchemas under one type union#4
maxijonson wants to merge 4 commits intopaynow-gg:mainfrom
maxijonson:main

Conversation

@maxijonson
Copy link
Copy Markdown

This mapped type creates a union of all the WebhookPayloadSchemas definitions and does the following:

  • Maps the event_type to the correct string literal associated with each event (rather than being a union of all possible event types)
  • For event types that are listed in WebhookEventType but not in WebhookPayloadSchemas, the mapped type still acknoledges its existence but leaves the body as an unknown record.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant