Add AI travel day summaries via OpenRouter for skippers.

Skipper-only proxy with per-entry rate limiting, encrypted payload storage, CSV export, and Plausible tracking.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-03 11:26:19 +02:00
parent 85e641ed39
commit 3ac4201734
19 changed files with 752 additions and 7 deletions
+14
View File
@@ -45,4 +45,18 @@ describe('API smoke', () => {
expect(res.status).toBe(400)
expect(res.body.error).toMatch(/Token/i)
})
it('POST /api/ai/summary requires session', async () => {
const res = await request(app)
.post('/api/ai/summary')
.send({ logbookId: 'x', entryId: 'y', context: {} })
expect(res.status).toBe(401)
expect(res.body.error).toMatch(/Unauthorized/i)
})
it('GET /api/ai/usage requires session', async () => {
const res = await request(app).get('/api/ai/usage')
expect(res.status).toBe(401)
expect(res.body.error).toMatch(/Unauthorized/i)
})
})