summaryrefslogtreecommitdiffhomepage
path: root/packages/sdk/js
diff options
context:
space:
mode:
authoradamdotdevin <[email protected]>2025-08-15 08:39:58 -0500
committeradamdotdevin <[email protected]>2025-08-15 08:39:58 -0500
commit9609c1803e68ecd753572972cb2cd531b48f1438 (patch)
tree89de4df40402bf1021b47fc52b6a4b00d6315c1b /packages/sdk/js
parent6e0e87fb2ad5cc440cc5455c4e43cafc9d07aff0 (diff)
downloadopencode-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.ts16
-rw-r--r--packages/sdk/js/src/gen/types.gen.ts20
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: {