sync
This commit is contained in:
@@ -2,12 +2,10 @@
|
||||
|
||||
import type { Options as ClientOptions, TDataShape, Client } from "./client/index.js"
|
||||
import type {
|
||||
ProjectListData,
|
||||
ProjectListResponses,
|
||||
EventSubscribeData,
|
||||
EventSubscribeResponses,
|
||||
AppGetData,
|
||||
AppGetResponses,
|
||||
AppInitData,
|
||||
AppInitResponses,
|
||||
ConfigGetData,
|
||||
ConfigGetResponses,
|
||||
SessionListData,
|
||||
@@ -120,6 +118,18 @@ class _HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
class Project extends _HeyApiClient {
|
||||
/**
|
||||
* List all projects
|
||||
*/
|
||||
public list<ThrowOnError extends boolean = false>(options?: Options<ProjectListData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<ProjectListResponses, unknown, ThrowOnError>({
|
||||
url: "/project",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Event extends _HeyApiClient {
|
||||
/**
|
||||
* Get events
|
||||
@@ -132,52 +142,6 @@ class Event extends _HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
class App extends _HeyApiClient {
|
||||
/**
|
||||
* Get app info
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<AppGetData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<AppGetResponses, unknown, ThrowOnError>({
|
||||
url: "/app",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the app
|
||||
*/
|
||||
public init<ThrowOnError extends boolean = false>(options?: Options<AppInitData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<AppInitResponses, unknown, ThrowOnError>({
|
||||
url: "/app/init",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Write a log entry to the server logs
|
||||
*/
|
||||
public log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<AppLogResponses, unknown, ThrowOnError>({
|
||||
url: "/log",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List all agents
|
||||
*/
|
||||
public agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<AppAgentsResponses, unknown, ThrowOnError>({
|
||||
url: "/agent",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Config extends _HeyApiClient {
|
||||
/**
|
||||
* Get config info
|
||||
@@ -490,6 +454,32 @@ class File extends _HeyApiClient {
|
||||
}
|
||||
}
|
||||
|
||||
class App extends _HeyApiClient {
|
||||
/**
|
||||
* Write a log entry to the server logs
|
||||
*/
|
||||
public log<ThrowOnError extends boolean = false>(options?: Options<AppLogData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).post<AppLogResponses, unknown, ThrowOnError>({
|
||||
url: "/log",
|
||||
...options,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* List all agents
|
||||
*/
|
||||
public agents<ThrowOnError extends boolean = false>(options?: Options<AppAgentsData, ThrowOnError>) {
|
||||
return (options?.client ?? this._client).get<AppAgentsResponses, unknown, ThrowOnError>({
|
||||
url: "/agent",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
class Tui extends _HeyApiClient {
|
||||
/**
|
||||
* Append prompt to the TUI
|
||||
@@ -630,13 +620,14 @@ export class OpencodeClient extends _HeyApiClient {
|
||||
},
|
||||
})
|
||||
}
|
||||
project = new Project({ client: this._client })
|
||||
event = new Event({ client: this._client })
|
||||
app = new App({ client: this._client })
|
||||
config = new Config({ client: this._client })
|
||||
session = new Session({ client: this._client })
|
||||
command = new Command({ client: this._client })
|
||||
find = new Find({ client: this._client })
|
||||
file = new File({ client: this._client })
|
||||
app = new App({ client: this._client })
|
||||
tui = new Tui({ client: this._client })
|
||||
auth = new Auth({ client: this._client })
|
||||
}
|
||||
|
||||
@@ -1,12 +1,19 @@
|
||||
// This file is auto-generated by @hey-api/openapi-ts
|
||||
|
||||
export type Project = {
|
||||
id: string
|
||||
worktree: string
|
||||
vcs?: "git"
|
||||
time: {
|
||||
created: number
|
||||
initialized?: number
|
||||
}
|
||||
}
|
||||
|
||||
export type Event =
|
||||
| ({
|
||||
type: "installation.updated"
|
||||
} & EventInstallationUpdated)
|
||||
| ({
|
||||
type: "storage.write"
|
||||
} & EventStorageWrite)
|
||||
| ({
|
||||
type: "lsp.client.diagnostics"
|
||||
} & EventLspClientDiagnostics)
|
||||
@@ -46,12 +53,6 @@ export type Event =
|
||||
| ({
|
||||
type: "server.connected"
|
||||
} & EventServerConnected)
|
||||
| ({
|
||||
type: "file.watcher.updated"
|
||||
} & EventFileWatcherUpdated)
|
||||
| ({
|
||||
type: "ide.installed"
|
||||
} & EventIdeInstalled)
|
||||
|
||||
export type EventInstallationUpdated = {
|
||||
type: "installation.updated"
|
||||
@@ -60,14 +61,6 @@ export type EventInstallationUpdated = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventStorageWrite = {
|
||||
type: "storage.write"
|
||||
properties: {
|
||||
key: Array<string>
|
||||
content?: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type EventLspClientDiagnostics = {
|
||||
type: "lsp.client.diagnostics"
|
||||
properties: {
|
||||
@@ -535,37 +528,6 @@ export type EventServerConnected = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventFileWatcherUpdated = {
|
||||
type: "file.watcher.updated"
|
||||
properties: {
|
||||
file: string
|
||||
event: "rename" | "change"
|
||||
}
|
||||
}
|
||||
|
||||
export type EventIdeInstalled = {
|
||||
type: "ide.installed"
|
||||
properties: {
|
||||
ide: string
|
||||
}
|
||||
}
|
||||
|
||||
export type App = {
|
||||
hostname: string
|
||||
git: boolean
|
||||
path: {
|
||||
home: string
|
||||
config: string
|
||||
data: string
|
||||
root: string
|
||||
cwd: string
|
||||
state: string
|
||||
}
|
||||
time: {
|
||||
initialized?: number
|
||||
}
|
||||
}
|
||||
|
||||
export type Config = {
|
||||
/**
|
||||
* JSON schema reference for configuration validation
|
||||
@@ -1211,6 +1173,22 @@ export type WellKnownAuth = {
|
||||
token: string
|
||||
}
|
||||
|
||||
export type ProjectListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/project"
|
||||
}
|
||||
|
||||
export type ProjectListResponses = {
|
||||
/**
|
||||
* List of projects
|
||||
*/
|
||||
200: Array<Project>
|
||||
}
|
||||
|
||||
export type ProjectListResponse = ProjectListResponses[keyof ProjectListResponses]
|
||||
|
||||
export type EventSubscribeData = {
|
||||
body?: never
|
||||
path?: never
|
||||
@@ -1227,38 +1205,6 @@ export type EventSubscribeResponses = {
|
||||
|
||||
export type EventSubscribeResponse = EventSubscribeResponses[keyof EventSubscribeResponses]
|
||||
|
||||
export type AppGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/app"
|
||||
}
|
||||
|
||||
export type AppGetResponses = {
|
||||
/**
|
||||
* 200
|
||||
*/
|
||||
200: App
|
||||
}
|
||||
|
||||
export type AppGetResponse = AppGetResponses[keyof AppGetResponses]
|
||||
|
||||
export type AppInitData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/app/init"
|
||||
}
|
||||
|
||||
export type AppInitResponses = {
|
||||
/**
|
||||
* Initialize the app
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type AppInitResponse = AppInitResponses[keyof AppInitResponses]
|
||||
|
||||
export type ConfigGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
||||
Reference in New Issue
Block a user