add global.event.subscribe() to sdk

This commit is contained in:
Dax Raad
2025-11-14 12:32:43 -05:00
parent c1cf9cda6a
commit 5fc26c958a
5 changed files with 717 additions and 623 deletions

View File

@@ -2,6 +2,8 @@
import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js"
import type {
GlobalEventButtData,
GlobalEventButtResponses,
ProjectListData,
ProjectListResponses,
ProjectCurrentData,
@@ -175,6 +177,32 @@ class _HeyApiClient {
}
}
class Event extends _HeyApiClient {
/**
* Get events
*/
public butt<ThrowOnError extends boolean = false>(options?: Options<GlobalEventButtData, ThrowOnError>) {
return (options?.client ?? this._client).get.sse<GlobalEventButtResponses, unknown, ThrowOnError>({
url: "/global/event",
...options,
})
}
/**
* Get events
*/
public subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>) {
return (options?.client ?? this._client).get.sse<EventSubscribeResponses, unknown, ThrowOnError>({
url: "/event",
...options,
})
}
}
class Global extends _HeyApiClient {
event = new Event({ client: this._client })
}
class Project extends _HeyApiClient {
/**
* List all projects
@@ -828,18 +856,6 @@ class Auth extends _HeyApiClient {
}
}
class Event extends _HeyApiClient {
/**
* Get events
*/
public subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>) {
return (options?.client ?? this._client).get.sse<EventSubscribeResponses, unknown, ThrowOnError>({
url: "/event",
...options,
})
}
}
export class OpencodeClient extends _HeyApiClient {
/**
* Respond to a permission request
@@ -860,6 +876,7 @@ export class OpencodeClient extends _HeyApiClient {
},
})
}
global = new Global({ client: this._client })
project = new Project({ client: this._client })
config = new Config({ client: this._client })
tool = new Tool({ client: this._client })

File diff suppressed because it is too large Load Diff