add api to get session

This commit is contained in:
Dax Raad
2025-08-06 20:24:36 -04:00
parent fecae609d9
commit 1a561bb512
3 changed files with 59 additions and 0 deletions

View File

@@ -219,6 +219,34 @@ export namespace Server {
return c.json(sessions)
},
)
.get(
"/session/:sessionID",
describeRoute({
description: "Get session",
operationId: "session.get",
responses: {
200: {
description: "Get session",
content: {
"application/json": {
schema: resolver(Session.Info),
},
},
},
},
}),
zValidator(
"param",
z.object({
id: z.string(),
}),
),
async (c) => {
const sessionID = c.req.valid("param").id
const session = await Session.get(sessionID)
return c.json(session)
},
)
.post(
"/session",
describeRoute({