( endpoint: string, sessionId: string )
| 44 | * Get an existing session with its annotations. |
| 45 | */ |
| 46 | export async function getSession( |
| 47 | endpoint: string, |
| 48 | sessionId: string |
| 49 | ): Promise<SessionWithAnnotations> { |
| 50 | const response = await fetch(`${endpoint}/sessions/${sessionId}`); |
| 51 | |
| 52 | if (!response.ok) { |
| 53 | throw new Error(`Failed to get session: ${response.status}`); |
| 54 | } |
| 55 | |
| 56 | return response.json(); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Sync a new annotation to the server. |
no outgoing calls
no test coverage detected
searching dependent graphs…