Skip to content

Commit 64d28ea

Browse files
committed
fix sdk types
1 parent 2520780 commit 64d28ea

3 files changed

Lines changed: 23 additions & 13 deletions

File tree

packages/opencode/src/server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ export namespace Server {
122122
"/global/event",
123123
describeRoute({
124124
description: "Get events",
125-
operationId: "global.event.subscribe",
125+
operationId: "global.event",
126126
responses: {
127127
200: {
128128
description: "Event stream",

packages/sdk/js/src/gen/sdk.gen.ts

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js"
44
import type {
5-
GlobalEventSubscribeData,
6-
GlobalEventSubscribeResponses,
5+
GlobalEventData,
6+
GlobalEventResponses,
77
ProjectListData,
88
ProjectListResponses,
99
ProjectCurrentData,
@@ -145,6 +145,8 @@ import type {
145145
AuthSetData,
146146
AuthSetResponses,
147147
AuthSetErrors,
148+
EventSubscribeData,
149+
EventSubscribeResponses,
148150
} from "./types.gen.js"
149151
import { client as _heyApiClient } from "./client.gen.js"
150152

@@ -175,22 +177,18 @@ class _HeyApiClient {
175177
}
176178
}
177179

178-
class Event extends _HeyApiClient {
180+
class Global extends _HeyApiClient {
179181
/**
180182
* Get events
181183
*/
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>({
184186
url: "/global/event",
185187
...options,
186188
})
187189
}
188190
}
189191

190-
class Global extends _HeyApiClient {
191-
event = new Event({ client: this._client })
192-
}
193-
194192
class Project extends _HeyApiClient {
195193
/**
196194
* List all projects
@@ -844,6 +842,18 @@ class Auth extends _HeyApiClient {
844842
}
845843
}
846844

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+
847857
export class OpencodeClient extends _HeyApiClient {
848858
/**
849859
* Respond to a permission request

packages/sdk/js/src/gen/types.gen.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,21 +1378,21 @@ export type WellKnownAuth = {
13781378

13791379
export type Auth = OAuth | ApiAuth | WellKnownAuth
13801380

1381-
export type GlobalEventSubscribeData = {
1381+
export type GlobalEventData = {
13821382
body?: never
13831383
path?: never
13841384
query?: never
13851385
url: "/global/event"
13861386
}
13871387

1388-
export type GlobalEventSubscribeResponses = {
1388+
export type GlobalEventResponses = {
13891389
/**
13901390
* Event stream
13911391
*/
13921392
200: GlobalEvent
13931393
}
13941394

1395-
export type GlobalEventSubscribeResponse = GlobalEventSubscribeResponses[keyof GlobalEventSubscribeResponses]
1395+
export type GlobalEventResponse = GlobalEventResponses[keyof GlobalEventResponses]
13961396

13971397
export type ProjectListData = {
13981398
body?: never

0 commit comments

Comments
 (0)