|
2 | 2 |
|
3 | 3 | import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js" |
4 | 4 | import type { |
5 | | - GlobalEventSubscribeData, |
6 | | - GlobalEventSubscribeResponses, |
| 5 | + GlobalEventData, |
| 6 | + GlobalEventResponses, |
7 | 7 | ProjectListData, |
8 | 8 | ProjectListResponses, |
9 | 9 | ProjectCurrentData, |
@@ -145,6 +145,8 @@ import type { |
145 | 145 | AuthSetData, |
146 | 146 | AuthSetResponses, |
147 | 147 | AuthSetErrors, |
| 148 | + EventSubscribeData, |
| 149 | + EventSubscribeResponses, |
148 | 150 | } from "./types.gen.js" |
149 | 151 | import { client as _heyApiClient } from "./client.gen.js" |
150 | 152 |
|
@@ -175,22 +177,18 @@ class _HeyApiClient { |
175 | 177 | } |
176 | 178 | } |
177 | 179 |
|
178 | | -class Event extends _HeyApiClient { |
| 180 | +class Global extends _HeyApiClient { |
179 | 181 | /** |
180 | 182 | * Get events |
181 | 183 | */ |
182 | | - public subscribe<ThrowOnError extends boolean = false>(options?: Options<GlobalEventSubscribeData, ThrowOnError>) { |
183 | | - return (options?.client ?? this._client).get.sse<GlobalEventSubscribeResponses, unknown, ThrowOnError>({ |
| 184 | + public event<ThrowOnError extends boolean = false>(options?: Options<GlobalEventData, ThrowOnError>) { |
| 185 | + return (options?.client ?? this._client).get.sse<GlobalEventResponses, unknown, ThrowOnError>({ |
184 | 186 | url: "/global/event", |
185 | 187 | ...options, |
186 | 188 | }) |
187 | 189 | } |
188 | 190 | } |
189 | 191 |
|
190 | | -class Global extends _HeyApiClient { |
191 | | - event = new Event({ client: this._client }) |
192 | | -} |
193 | | - |
194 | 192 | class Project extends _HeyApiClient { |
195 | 193 | /** |
196 | 194 | * List all projects |
@@ -844,6 +842,18 @@ class Auth extends _HeyApiClient { |
844 | 842 | } |
845 | 843 | } |
846 | 844 |
|
| 845 | +class Event extends _HeyApiClient { |
| 846 | + /** |
| 847 | + * Get events |
| 848 | + */ |
| 849 | + public subscribe<ThrowOnError extends boolean = false>(options?: Options<EventSubscribeData, ThrowOnError>) { |
| 850 | + return (options?.client ?? this._client).get.sse<EventSubscribeResponses, unknown, ThrowOnError>({ |
| 851 | + url: "/event", |
| 852 | + ...options, |
| 853 | + }) |
| 854 | + } |
| 855 | +} |
| 856 | + |
847 | 857 | export class OpencodeClient extends _HeyApiClient { |
848 | 858 | /** |
849 | 859 | * Respond to a permission request |
|
0 commit comments