mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-20 01:04:22 +01:00
feat(api): get session and session children routes
This commit is contained in:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user