feat(api): get session and session children routes

This commit is contained in:
adamdotdevin
2025-08-15 08:49:19 -05:00
parent 9609c1803e
commit 1ae38c90a3
8 changed files with 134 additions and 4 deletions

View File

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