| 303 | } |
| 304 | |
| 305 | async updateSource( |
| 306 | client: string, |
| 307 | key: string, |
| 308 | source: UpdateTriggerSourceBodyV2 |
| 309 | ): Promise<TriggerSource> { |
| 310 | const apiKey = await this.#apiKey(); |
| 311 | |
| 312 | this.#logger.debug("activating http source", { |
| 313 | source, |
| 314 | }); |
| 315 | |
| 316 | const response = await zodfetch( |
| 317 | TriggerSourceSchema, |
| 318 | `${this.#apiUrl}/api/v2/${client}/sources/${key}`, |
| 319 | { |
| 320 | method: "PUT", |
| 321 | headers: { |
| 322 | "Content-Type": "application/json", |
| 323 | Authorization: `Bearer ${apiKey}`, |
| 324 | }, |
| 325 | body: JSON.stringify(source), |
| 326 | } |
| 327 | ); |
| 328 | |
| 329 | return response; |
| 330 | } |
| 331 | |
| 332 | async updateWebhook(key: string, webhookData: UpdateWebhookBody): Promise<TriggerSource> { |
| 333 | const apiKey = await this.#apiKey(); |