(runId: string, id: string, body: FailTaskBodyInput)
| 188 | } |
| 189 | |
| 190 | async failTask(runId: string, id: string, body: FailTaskBodyInput) { |
| 191 | const apiKey = await this.#apiKey(); |
| 192 | |
| 193 | this.#logger.debug("Fail Task", { |
| 194 | id, |
| 195 | runId, |
| 196 | body, |
| 197 | }); |
| 198 | |
| 199 | return await zodfetch( |
| 200 | ServerTaskSchema, |
| 201 | `${this.#apiUrl}/api/v1/runs/${runId}/tasks/${id}/fail`, |
| 202 | { |
| 203 | method: "POST", |
| 204 | headers: { |
| 205 | "Content-Type": "application/json", |
| 206 | Authorization: `Bearer ${apiKey}`, |
| 207 | }, |
| 208 | body: JSON.stringify(body), |
| 209 | } |
| 210 | ); |
| 211 | } |
| 212 | |
| 213 | async sendEvent(event: SendEvent, options: SendEventOptions = {}) { |
| 214 | const apiKey = await this.#apiKey(); |
no test coverage detected