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

@@ -21,6 +21,8 @@ import type {
SessionGetResponses,
SessionUpdateData,
SessionUpdateResponses,
SessionChildrenData,
SessionChildrenResponses,
SessionInitData,
SessionInitResponses,
SessionAbortData,
@@ -247,6 +249,16 @@ class Session extends _HeyApiClient {
})
}
/**
* Get a session's children
*/
public children<ThrowOnError extends boolean = false>(options: Options<SessionChildrenData, ThrowOnError>) {
return (options.client ?? this._client).get<SessionChildrenResponses, unknown, ThrowOnError>({
url: "/session/{id}/children",
...options,
})
}
/**
* Analyze the app and create an AGENTS.md file
*/

View File

@@ -1319,6 +1319,24 @@ export type SessionUpdateResponses = {
export type SessionUpdateResponse = SessionUpdateResponses[keyof SessionUpdateResponses]
export type SessionChildrenData = {
body?: never
path: {
id: string
}
query?: never
url: "/session/{id}/children"
}
export type SessionChildrenResponses = {
/**
* List of children
*/
200: Array<Session>
}
export type SessionChildrenResponse = SessionChildrenResponses[keyof SessionChildrenResponses]
export type SessionInitData = {
body?: {
messageID: string