[moderation] stub voice endpoint

This commit is contained in:
Devin Zuczek
2026-08-20 18:39:32 -04:00
parent 879d8e95ab
commit 3e59ebeaa8
4 changed files with 50 additions and 1 deletions
+12
View File
@@ -23,4 +23,16 @@ const app = new Hono<App>()
return c.text('hello, world!')
})
// Voice-moderation vendor credentials. The client fetches these while setting up voice
// so it can talk to the moderation vendor DIRECTLY — the audio never passes through this
// service, which is why the credentials are handed out rather than used server-side.
//
// Both are deliberately EMPTY: no vendor account is wired up here, and the client treats
// blank credentials as "voice moderation is off" instead of failing voice setup. The keys
// must still be present and strings — a missing key or a null trips the client's parser.
// Note `AccountId` is a STRING even though it reads as a number.
.get('/voice/config', (c) => {
return c.json({ AccountId: '', ApiKey: '' })
})
export default app
@@ -6,3 +6,9 @@ it('response with hello world', async () => {
expect(res.status).toBe(200)
expect(await res.text()).toMatchInlineSnapshot(`"hello, world!"`)
})
it('serves empty voice moderation credentials', async () => {
const res = await SELF.fetch('https://example.com/voice/config')
expect(res.status).toBe(200)
expect(await res.json()).toEqual({ AccountId: '', ApiKey: '' })
})