(runId: string, id: string, task: CompleteTaskBodyV2Input)
| 166 | } |
| 167 | |
| 168 | async completeTask(runId: string, id: string, task: CompleteTaskBodyV2Input) { |
| 169 | const apiKey = await this.#apiKey(); |
| 170 | |
| 171 | this.#logger.debug("Complete Task", { |
| 172 | task, |
| 173 | }); |
| 174 | |
| 175 | return await zodfetch( |
| 176 | ServerTaskSchema, |
| 177 | `${this.#apiUrl}/api/v1/runs/${runId}/tasks/${id}/complete`, |
| 178 | { |
| 179 | method: "POST", |
| 180 | headers: { |
| 181 | "Content-Type": "application/json", |
| 182 | Authorization: `Bearer ${apiKey}`, |
| 183 | "Trigger-Version": API_VERSIONS.SERIALIZED_TASK_OUTPUT, |
| 184 | }, |
| 185 | body: JSON.stringify(task), |
| 186 | } |
| 187 | ); |
| 188 | } |
| 189 | |
| 190 | async failTask(runId: string, id: string, body: FailTaskBodyInput) { |
| 191 | const apiKey = await this.#apiKey(); |
no test coverage detected