(r: RunningServer)
| 117 | } |
| 118 | |
| 119 | async function createSession(r: RunningServer): Promise<string> { |
| 120 | const res = await appOf(r).inject({ |
| 121 | method: 'POST', |
| 122 | url: '/api/v1/sessions', |
| 123 | payload: { metadata: { cwd: join(tmpDir, 'workspace') } }, |
| 124 | }); |
| 125 | const env = envelopeOf<{ id: string }>(res.json()); |
| 126 | if (env.code !== 0 || env.data === null) { |
| 127 | throw new Error(`create session failed: ${JSON.stringify(env)}`); |
| 128 | } |
| 129 | return env.data.id; |
| 130 | } |
| 131 | |
| 132 | /* -------------------------------------------------------------------- */ |
| 133 | /* GET /v1/auth — readiness snapshot */ |
no test coverage detected