| 330 | } |
| 331 | |
| 332 | async updateWebhook(key: string, webhookData: UpdateWebhookBody): Promise<TriggerSource> { |
| 333 | const apiKey = await this.#apiKey(); |
| 334 | |
| 335 | this.#logger.debug("activating webhook", { |
| 336 | webhookData, |
| 337 | }); |
| 338 | |
| 339 | const response = await zodfetch(TriggerSourceSchema, `${this.#apiUrl}/api/v1/webhooks/${key}`, { |
| 340 | method: "PUT", |
| 341 | headers: { |
| 342 | "Content-Type": "application/json", |
| 343 | Authorization: `Bearer ${apiKey}`, |
| 344 | }, |
| 345 | body: JSON.stringify(webhookData), |
| 346 | }); |
| 347 | |
| 348 | return response; |
| 349 | } |
| 350 | |
| 351 | async registerTrigger( |
| 352 | client: string, |