diff options
| author | adamdotdevin <[email protected]> | 2025-08-15 08:39:58 -0500 |
|---|---|---|
| committer | adamdotdevin <[email protected]> | 2025-08-15 08:39:58 -0500 |
| commit | 9609c1803e68ecd753572972cb2cd531b48f1438 (patch) | |
| tree | 89de4df40402bf1021b47fc52b6a4b00d6315c1b /packages/sdk/js | |
| parent | 6e0e87fb2ad5cc440cc5455c4e43cafc9d07aff0 (diff) | |
| download | opencode-9609c1803e68ecd753572972cb2cd531b48f1438.tar.gz opencode-9609c1803e68ecd753572972cb2cd531b48f1438.zip | |
feat: /tui/show-toast api
Diffstat (limited to 'packages/sdk/js')
| -rw-r--r-- | packages/sdk/js/src/gen/sdk.gen.ts | 16 | ||||
| -rw-r--r-- | packages/sdk/js/src/gen/types.gen.ts | 20 |
2 files changed, 36 insertions, 0 deletions
diff --git a/packages/sdk/js/src/gen/sdk.gen.ts b/packages/sdk/js/src/gen/sdk.gen.ts index d29862387..1e0e1ae58 100644 --- a/packages/sdk/js/src/gen/sdk.gen.ts +++ b/packages/sdk/js/src/gen/sdk.gen.ts @@ -77,6 +77,8 @@ import type { TuiClearPromptResponses, TuiExecuteCommandData, TuiExecuteCommandResponses, + TuiShowToastData, + TuiShowToastResponses, AuthSetData, AuthSetResponses, AuthSetErrors, @@ -518,6 +520,20 @@ class Tui extends _HeyApiClient { }, }) } + + /** + * Show a toast notification in the TUI + */ + public showToast<ThrowOnError extends boolean = false>(options?: Options<TuiShowToastData, ThrowOnError>) { + return (options?.client ?? this._client).post<TuiShowToastResponses, unknown, ThrowOnError>({ + url: "/tui/show-toast", + ...options, + headers: { + "Content-Type": "application/json", + ...options?.headers, + }, + }) + } } class Auth extends _HeyApiClient { diff --git a/packages/sdk/js/src/gen/types.gen.ts b/packages/sdk/js/src/gen/types.gen.ts index 54087908c..81faf7bf8 100644 --- a/packages/sdk/js/src/gen/types.gen.ts +++ b/packages/sdk/js/src/gen/types.gen.ts @@ -1911,6 +1911,26 @@ export type TuiExecuteCommandResponses = { export type TuiExecuteCommandResponse = TuiExecuteCommandResponses[keyof TuiExecuteCommandResponses] +export type TuiShowToastData = { + body?: { + title?: string + message: string + variant: "info" | "success" | "warning" | "error" + } + path?: never + query?: never + url: "/tui/show-toast" +} + +export type TuiShowToastResponses = { + /** + * Toast notification shown successfully + */ + 200: boolean +} + +export type TuiShowToastResponse = TuiShowToastResponses[keyof TuiShowToastResponses] + export type AuthSetData = { body?: Auth path: { |
