wip(app): settings
This commit is contained in:
@@ -32,6 +32,9 @@ import type {
|
||||
FindSymbolsResponses,
|
||||
FindTextResponses,
|
||||
FormatterStatusResponses,
|
||||
GlobalConfigGetResponses,
|
||||
GlobalConfigUpdateErrors,
|
||||
GlobalConfigUpdateResponses,
|
||||
GlobalDisposeResponses,
|
||||
GlobalEventResponses,
|
||||
GlobalHealthResponses,
|
||||
@@ -249,6 +252,42 @@ export class Global extends HeyApiClient {
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get global configuration
|
||||
*
|
||||
* Retrieve the global OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public configGet<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<GlobalConfigGetResponses, unknown, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update global configuration
|
||||
*
|
||||
* Update global OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public configUpdate<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
config?: Config2
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }])
|
||||
return (options?.client ?? this.client).patch<GlobalConfigUpdateResponses, GlobalConfigUpdateErrors, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Project extends HeyApiClient {
|
||||
|
||||
@@ -2189,6 +2189,47 @@ export type GlobalDisposeResponses = {
|
||||
|
||||
export type GlobalDisposeResponse = GlobalDisposeResponses[keyof GlobalDisposeResponses]
|
||||
|
||||
export type GlobalConfigGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/global/config"
|
||||
}
|
||||
|
||||
export type GlobalConfigGetResponses = {
|
||||
/**
|
||||
* Global config
|
||||
*/
|
||||
200: Config
|
||||
}
|
||||
|
||||
export type GlobalConfigGetResponse = GlobalConfigGetResponses[keyof GlobalConfigGetResponses]
|
||||
|
||||
export type GlobalConfigUpdateData = {
|
||||
body?: Config
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/global/config"
|
||||
}
|
||||
|
||||
export type GlobalConfigUpdateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type GlobalConfigUpdateError = GlobalConfigUpdateErrors[keyof GlobalConfigUpdateErrors]
|
||||
|
||||
export type GlobalConfigUpdateResponses = {
|
||||
/**
|
||||
* Successfully updated global config
|
||||
*/
|
||||
200: Config
|
||||
}
|
||||
|
||||
export type GlobalConfigUpdateResponse = GlobalConfigUpdateResponses[keyof GlobalConfigUpdateResponses]
|
||||
|
||||
export type ProjectListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
||||
Reference in New Issue
Block a user