@@ -73,6 +73,22 @@ export async function getAppInfo(): Promise<GetAppInfoResponse['result']> {
7373 return await request ( { name : "getAppInfo" , args : void 0 } ) ;
7474}
7575
76+ /**
77+ * Get the version of Beekeeper Studio
78+ * @since Beekeeper Studio 5.3.0
79+ **/
80+ export async function getAppVersion ( ) : Promise < "5.3" | ( string & { __brand ?: never } ) > {
81+ try {
82+ const appInfo = await getAppInfo ( ) ;
83+ return appInfo . version ;
84+ } catch ( e ) {
85+ if ( e instanceof Error && e . message . includes ( "Unknown request" ) ) {
86+ return "5.3" ;
87+ }
88+ throw e ;
89+ }
90+ }
91+
7692/**
7793 * Check if plugin's update is available.
7894 *
@@ -159,11 +175,11 @@ export async function getData<T>(key: string = "default"): Promise<GetDataRespon
159175
160176/**
161177 * Store data that can be retrieved later.
162- *
178+ *
163179 * @example
164180 * // Store with custom key
165181 * await setData("myKey", { name: "John" });
166- *
182+ *
167183 * // Store with default key (equivalent to setData("default", value))
168184 * await setData({ name: "John" });
169185 *
@@ -186,11 +202,11 @@ export async function getEncryptedData<T>(key: string): Promise<GetEncryptedData
186202
187203/**
188204 * Store encrypted data that can be retrieved later.
189- *
205+ *
190206 * @example
191207 * // Store with custom key
192208 * await setEncryptedData("secretKey", { token: "abc123" });
193- *
209+ *
194210 * // Store with default key (equivalent to setEncryptedData("default", value))
195211 * await setEncryptedData({ token: "abc123" });
196212 *
0 commit comments