diff --git a/crates-tauri/yaak-app/src/commands.rs b/crates-tauri/yaak-app/src/commands.rs index 2ee290bd..85c20a23 100644 --- a/crates-tauri/yaak-app/src/commands.rs +++ b/crates-tauri/yaak-app/src/commands.rs @@ -2,7 +2,6 @@ use crate::PluginContextExt; use crate::error::Result; use std::sync::Arc; use tauri::{AppHandle, Manager, Runtime, State, WebviewWindow, command}; -use tauri_plugin_dialog::{DialogExt, MessageDialogKind}; use yaak_crypto::manager::EncryptionManager; use yaak_models::models::HttpRequestHeader; use yaak_models::queries::workspaces::default_headers; @@ -23,20 +22,6 @@ impl<'a, R: Runtime, M: Manager> EncryptionManagerExt<'a, R> for M { } } -#[command] -pub(crate) async fn cmd_show_workspace_key( - window: WebviewWindow, - workspace_id: &str, -) -> Result<()> { - let key = window.crypto().reveal_workspace_key(workspace_id)?; - window - .dialog() - .message(format!("Your workspace key is \n\n{}", key)) - .kind(MessageDialogKind::Info) - .show(|_v| {}); - Ok(()) -} - #[command] pub(crate) async fn cmd_decrypt_template( window: WebviewWindow, diff --git a/crates-tauri/yaak-app/src/lib.rs b/crates-tauri/yaak-app/src/lib.rs index 54ca9e3c..dae651f1 100644 --- a/crates-tauri/yaak-app/src/lib.rs +++ b/crates-tauri/yaak-app/src/lib.rs @@ -37,7 +37,7 @@ use yaak_grpc::{Code, ServiceDefinition, serialize_message}; use yaak_mac_window::AppHandleMacWindowExt; use yaak_models::models::{ AnyModel, CookieJar, Environment, GrpcConnection, GrpcConnectionState, GrpcEvent, - GrpcEventType, GrpcRequest, HttpRequest, HttpResponse, HttpResponseEvent, HttpResponseState, + GrpcEventType, HttpRequest, HttpResponse, HttpResponseEvent, HttpResponseState, Plugin, Workspace, WorkspaceMeta, }; use yaak_models::util::{BatchUpsertResult, UpdateSource, get_workspace_export_resources}; @@ -1271,35 +1271,6 @@ async fn cmd_save_response( Ok(()) } -#[tauri::command] -async fn cmd_send_folder( - app_handle: AppHandle, - window: WebviewWindow, - environment_id: Option, - cookie_jar_id: Option, - folder_id: &str, -) -> YaakResult<()> { - let requests = app_handle.db().list_http_requests_for_folder_recursive(folder_id)?; - for request in requests { - let app_handle = app_handle.clone(); - let window = window.clone(); - let environment_id = environment_id.clone(); - let cookie_jar_id = cookie_jar_id.clone(); - tokio::spawn(async move { - let _ = cmd_send_http_request( - app_handle, - window, - environment_id.as_deref(), - cookie_jar_id.as_deref(), - request, - ) - .await; - }); - } - - Ok(()) -} - #[tauri::command] async fn cmd_send_http_request( app_handle: AppHandle, @@ -1396,27 +1367,6 @@ async fn cmd_install_plugin( Ok(plugin) } -#[tauri::command] -async fn cmd_create_grpc_request( - workspace_id: &str, - name: &str, - sort_priority: f64, - folder_id: Option<&str>, - app_handle: AppHandle, - window: WebviewWindow, -) -> YaakResult { - Ok(app_handle.db().upsert_grpc_request( - &GrpcRequest { - workspace_id: workspace_id.to_string(), - name: name.to_string(), - folder_id: folder_id.map(|s| s.to_string()), - sort_priority, - ..Default::default() - }, - &UpdateSource::from_window_label(window.label()), - )?) -} - #[tauri::command] async fn cmd_reload_plugins( app_handle: AppHandle, @@ -1679,7 +1629,6 @@ pub fn run() { cmd_call_folder_action, cmd_call_grpc_request_action, cmd_check_for_updates, - cmd_create_grpc_request, cmd_curl_to_request, cmd_delete_all_grpc_connections, cmd_delete_all_http_responses, @@ -1713,7 +1662,6 @@ pub fn run() { cmd_save_response, cmd_send_ephemeral_request, cmd_send_http_request, - cmd_send_folder, cmd_template_function_config, cmd_template_function_summaries, cmd_template_tokens_to_string, @@ -1728,7 +1676,6 @@ pub fn run() { crate::commands::cmd_reveal_workspace_key, crate::commands::cmd_secure_template, crate::commands::cmd_set_workspace_key, - crate::commands::cmd_show_workspace_key, // // Models commands models_ext::models_delete, diff --git a/src-web/lib/tauri.ts b/src-web/lib/tauri.ts index e394f2c0..b714d61f 100644 --- a/src-web/lib/tauri.ts +++ b/src-web/lib/tauri.ts @@ -9,7 +9,6 @@ type TauriCmd = | 'cmd_call_workspace_action' | 'cmd_call_folder_action' | 'cmd_check_for_updates' - | 'cmd_create_grpc_request' | 'cmd_curl_to_request' | 'cmd_decrypt_template' | 'cmd_default_headers' @@ -48,9 +47,7 @@ type TauriCmd = | 'cmd_save_response' | 'cmd_secure_template' | 'cmd_send_ephemeral_request' - | 'cmd_send_folder' | 'cmd_send_http_request' - | 'cmd_show_workspace_key' | 'cmd_template_function_summaries' | 'cmd_template_function_config' | 'cmd_template_tokens_to_string';