mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-19 16:54:22 +01:00
fix sdk types
This commit is contained in:
@@ -122,7 +122,7 @@ export namespace Server {
|
|||||||
"/global/event",
|
"/global/event",
|
||||||
describeRoute({
|
describeRoute({
|
||||||
description: "Get events",
|
description: "Get events",
|
||||||
operationId: "global.event.subscribe",
|
operationId: "global.event",
|
||||||
responses: {
|
responses: {
|
||||||
200: {
|
200: {
|
||||||
description: "Event stream",
|
description: "Event stream",
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js"
|
import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js"
|
||||||
import type {
|
import type {
|
||||||
GlobalEventSubscribeData,
|
GlobalEventData,
|
||||||
GlobalEventSubscribeResponses,
|
GlobalEventResponses,
|
||||||
ProjectListData,
|
ProjectListData,
|
||||||
ProjectListResponses,
|
ProjectListResponses,
|
||||||
ProjectCurrentData,
|
ProjectCurrentData,
|
||||||
@@ -145,6 +145,8 @@ import type {
|
|||||||
AuthSetData,
|
AuthSetData,
|
||||||
AuthSetResponses,
|
AuthSetResponses,
|
||||||
AuthSetErrors,
|
AuthSetErrors,
|
||||||
|
EventSubscribeData,
|
||||||
|
EventSubscribeResponses,
|
||||||
} from "./types.gen.js"
|
} from "./types.gen.js"
|
||||||
import { client as _heyApiClient } from "./client.gen.js"
|
import { client as _heyApiClient } from "./client.gen.js"
|
||||||
|
|
||||||
@@ -175,22 +177,18 @@ class _HeyApiClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Event extends _HeyApiClient {
|
class Global extends _HeyApiClient {
|
||||||
/**
|
/**
|
||||||
* Get events
|
* Get events
|
||||||
*/
|
*/
|
||||||
public subscribe<ThrowOnError extends boolean = false>(options?: Options<GlobalEventSubscribeData, ThrowOnError>) {
|
public event<ThrowOnError extends boolean = false>(options?: Options<GlobalEventData, ThrowOnError>) {
|
||||||
return (options?.client ?? this._client).get.sse<GlobalEventSubscribeResponses, unknown, ThrowOnError>({
|
return (options?.client ?? this._client).get.sse<GlobalEventResponses, unknown, ThrowOnError>({
|
||||||
url: "/global/event",
|
url: "/global/event",
|
||||||
...options,
|
...options,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class Global extends _HeyApiClient {
|
|
||||||
event = new Event({ client: this._client })
|
|
||||||
}
|
|
||||||
|
|
||||||
class Project extends _HeyApiClient {
|
class Project extends _HeyApiClient {
|
||||||
/**
|
/**
|
||||||
* List all projects
|
* List all projects
|
||||||
@@ -844,6 +842,18 @@ 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 {
|
export class OpencodeClient extends _HeyApiClient {
|
||||||
/**
|
/**
|
||||||
* Respond to a permission request
|
* Respond to a permission request
|
||||||
|
|||||||
@@ -1378,21 +1378,21 @@ export type WellKnownAuth = {
|
|||||||
|
|
||||||
export type Auth = OAuth | ApiAuth | WellKnownAuth
|
export type Auth = OAuth | ApiAuth | WellKnownAuth
|
||||||
|
|
||||||
export type GlobalEventSubscribeData = {
|
export type GlobalEventData = {
|
||||||
body?: never
|
body?: never
|
||||||
path?: never
|
path?: never
|
||||||
query?: never
|
query?: never
|
||||||
url: "/global/event"
|
url: "/global/event"
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GlobalEventSubscribeResponses = {
|
export type GlobalEventResponses = {
|
||||||
/**
|
/**
|
||||||
* Event stream
|
* Event stream
|
||||||
*/
|
*/
|
||||||
200: GlobalEvent
|
200: GlobalEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
export type GlobalEventSubscribeResponse = GlobalEventSubscribeResponses[keyof GlobalEventSubscribeResponses]
|
export type GlobalEventResponse = GlobalEventResponses[keyof GlobalEventResponses]
|
||||||
|
|
||||||
export type ProjectListData = {
|
export type ProjectListData = {
|
||||||
body?: never
|
body?: never
|
||||||
|
|||||||
Reference in New Issue
Block a user