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

@@ -15,6 +15,8 @@ import type {
SessionCreateData,
SessionCreateResponses,
SessionCreateErrors,
SessionGetData,
SessionGetResponses,
SessionDeleteData,
SessionDeleteResponses,
SessionInitData,
@@ -202,6 +204,16 @@ class Session extends _HeyApiClient {
})
}
/**
* Get session
*/
public get<ThrowOnError extends boolean = false>(options: Options<SessionGetData, ThrowOnError>) {
return (options.client ?? this._client).get<SessionGetResponses, unknown, ThrowOnError>({
url: "/session/{sessionID}",
...options,
})
}
/**
* Delete a session and all its data
*/

View File

@@ -537,6 +537,7 @@ export type Config = {
theme?: string
keybinds?: KeybindsConfig
plugin?: Array<string>
snapshot?: boolean
/**
* Control sharing behavior:'manual' allows manual sharing via commands, 'auto' enables automatic sharing, 'disabled' disables all sharing
*/
@@ -1102,6 +1103,24 @@ export type SessionCreateResponses = {
export type SessionCreateResponse = SessionCreateResponses[keyof SessionCreateResponses]
export type SessionGetData = {
body?: never
path: {
sessionID: string
}
query?: never
url: "/session/{sessionID}"
}
export type SessionGetResponses = {
/**
* Get session
*/
200: Session
}
export type SessionGetResponse = SessionGetResponses[keyof SessionGetResponses]
export type SessionDeleteData = {
body?: never
path: {