(key: IntegrationTaskKey, { baseId }: { baseId: string })
| 128 | } |
| 129 | |
| 130 | list(key: IntegrationTaskKey, { baseId }: { baseId: string }): Promise<WebhookListData> { |
| 131 | return this.runTask( |
| 132 | key, |
| 133 | async (client, task, io) => { |
| 134 | const response = await fetch(`${apiUrl}/${baseId}/webhooks`, { |
| 135 | headers: { |
| 136 | Authorization: `Bearer ${client._apiKey}`, |
| 137 | }, |
| 138 | redirect: "follow", |
| 139 | }); |
| 140 | |
| 141 | if (!response.ok) { |
| 142 | await handleWebhookError(response, "WEBHOOK_LIST"); |
| 143 | } |
| 144 | |
| 145 | const webhook = await response.json(); |
| 146 | const parsed = WebhookListDataSchema.parse(webhook); |
| 147 | return parsed; |
| 148 | }, |
| 149 | { |
| 150 | name: "List webhooks", |
| 151 | params: { |
| 152 | baseId, |
| 153 | }, |
| 154 | } |
| 155 | ); |
| 156 | } |
| 157 | |
| 158 | delete(key: IntegrationTaskKey, { baseId, webhookId }: { baseId: string; webhookId: string }) { |
| 159 | return this.runTask( |
no test coverage detected