Merge pull request #970 from mendableai/nsc/webhooks-custom-metadata

Metadata for webhooks
This commit is contained in:
Nicolas 2024-12-12 13:36:18 -03:00 committed by GitHub
commit 4c9e9836aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -251,6 +251,7 @@ export const webhookSchema = z.preprocess(
.object({
url: z.string().url(),
headers: z.record(z.string(), z.string()).default({}),
metadata: z.record(z.string(), z.string()).default({}),
})
.strict(strictMessage),
);

View File

@ -99,6 +99,7 @@ export const callWebhook = async (
: eventType === "crawl.page"
? data?.error || undefined
: undefined,
metadata: webhookUrl.metadata || undefined,
},
{
headers: {
@ -131,6 +132,7 @@ export const callWebhook = async (
: eventType === "crawl.page"
? data?.error || undefined
: undefined,
metadata: webhookUrl.metadata || undefined,
},
{
headers: {