(sessionId: string)
| 323 | }, |
| 324 | |
| 325 | async archiveSession(sessionId: string): Promise<void> { |
| 326 | validateBridgeId(sessionId, 'sessionId') |
| 327 | |
| 328 | debug(`[bridge:api] POST /v1/sessions/${sessionId}/archive`) |
| 329 | |
| 330 | const response = await withOAuthRetry( |
| 331 | (token: string) => |
| 332 | axios.post( |
| 333 | `${deps.baseUrl}/v1/sessions/${sessionId}/archive`, |
| 334 | {}, |
| 335 | { |
| 336 | headers: getHeaders(token), |
| 337 | timeout: 10_000, |
| 338 | validateStatus: s => s < 500, |
| 339 | }, |
| 340 | ), |
| 341 | 'ArchiveSession', |
| 342 | ) |
| 343 | |
| 344 | // 409 = already archived (idempotent, not an error) |
| 345 | if (response.status === 409) { |
| 346 | debug( |
| 347 | `[bridge:api] POST /v1/sessions/${sessionId}/archive -> 409 (already archived)`, |
| 348 | ) |
| 349 | return |
| 350 | } |
| 351 | |
| 352 | handleErrorStatus(response.status, response.data, 'ArchiveSession') |
| 353 | debug( |
| 354 | `[bridge:api] POST /v1/sessions/${sessionId}/archive -> ${response.status}`, |
| 355 | ) |
| 356 | }, |
| 357 | |
| 358 | async reconnectSession( |
| 359 | environmentId: string, |
no test coverage detected