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 {
|
||||
|
||||
Reference in New Issue
Block a user