| 374 | }, |
| 375 | |
| 376 | source(request, signal) { |
| 377 | const params = new URLSearchParams({ |
| 378 | file: request.file, |
| 379 | from: String(request.from), |
| 380 | }); |
| 381 | // Absent `to` means "to the end of the file"; sending 0 for that would be |
| 382 | // out of range, not a synonym. |
| 383 | if (request.to !== undefined && request.to > 0) params.set('to', String(request.to)); |
| 384 | if (request.ondrift) params.set('ondrift', request.ondrift); |
| 385 | return getJson<WireSource>(`api/source${query(params)}`, signal); |
| 386 | }, |
| 387 | |
| 388 | file: (path, signal) => getJson<WireFilePayload>(`api/file/${encodePath(path)}`, signal), |
| 389 | |