Describe the bug
When PORTAL_ENABLE_WEBHOOK_CUSTOM_HEADERS is set to true, a new config field keyed custom_headers is added to the webhook destination type in the response to GET /api/v1/destination-types:
[{"type":"text","label":"Webhook URL","description":"The URL to send webhook events to via HTTP POST","key":"url","required":true,"pattern":"^https?:\\\\/\\\\/[^\\\\s]+$"},{"type":"key_value_map","label":"Custom Headers","description":"Additional HTTP headers to include with every webhook request","key":"custom_headers","required":false}]
This is causing a zod validation in the TypeScript SDK as it doesn't seem to recognise the key_value_map type:
[{"received":"key_value_map","code":"invalid_enum_value","options":["text","checkbox"],"path":[0,"config_fields",1,"type"],"message":"Invalid enum value. Expected 'text' | 'checkbox', received 'key_value_map'"}]
To Reproduce
Steps to reproduce the behavior:
- Set the
PORTAL_ENABLE_WEBHOOK_CUSTOM_HEADERS environment variable to true
- Install typescript SDK package and run
new Outpost({ ... })..schemas.listDestinationTypes()
- Zod validation error occurs
Expected behavior
The TypeScript SDK should recognise this enum value