mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-07-13 08:13:00 +02:00
Clean up unused functions
This commit is contained in:
@@ -1777,14 +1777,8 @@ pub fn run() {
|
|||||||
plugins_ext::cmd_plugins_update_all,
|
plugins_ext::cmd_plugins_update_all,
|
||||||
//
|
//
|
||||||
// WebSocket commands
|
// WebSocket commands
|
||||||
ws_ext::cmd_ws_upsert_request,
|
|
||||||
ws_ext::cmd_ws_duplicate_request,
|
|
||||||
ws_ext::cmd_ws_delete_request,
|
|
||||||
ws_ext::cmd_ws_delete_connection,
|
ws_ext::cmd_ws_delete_connection,
|
||||||
ws_ext::cmd_ws_delete_connections,
|
ws_ext::cmd_ws_delete_connections,
|
||||||
ws_ext::cmd_ws_list_events,
|
|
||||||
ws_ext::cmd_ws_list_requests,
|
|
||||||
ws_ext::cmd_ws_list_connections,
|
|
||||||
ws_ext::cmd_ws_send,
|
ws_ext::cmd_ws_send,
|
||||||
ws_ext::cmd_ws_close,
|
ws_ext::cmd_ws_close,
|
||||||
ws_ext::cmd_ws_connect,
|
ws_ext::cmd_ws_connect,
|
||||||
|
|||||||
@@ -28,40 +28,6 @@ use yaak_templates::{RenderErrorBehavior, RenderOptions};
|
|||||||
use yaak_tls::find_client_certificate;
|
use yaak_tls::find_client_certificate;
|
||||||
use yaak_ws::{WebsocketManager, render_websocket_request};
|
use yaak_ws::{WebsocketManager, render_websocket_request};
|
||||||
|
|
||||||
#[command]
|
|
||||||
pub async fn cmd_ws_upsert_request<R: Runtime>(
|
|
||||||
request: WebsocketRequest,
|
|
||||||
app_handle: AppHandle<R>,
|
|
||||||
window: WebviewWindow<R>,
|
|
||||||
) -> Result<WebsocketRequest> {
|
|
||||||
Ok(app_handle
|
|
||||||
.db()
|
|
||||||
.upsert_websocket_request(&request, &UpdateSource::from_window_label(window.label()))?)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[command]
|
|
||||||
pub async fn cmd_ws_duplicate_request<R: Runtime>(
|
|
||||||
request_id: &str,
|
|
||||||
app_handle: AppHandle<R>,
|
|
||||||
window: WebviewWindow<R>,
|
|
||||||
) -> Result<WebsocketRequest> {
|
|
||||||
let db = app_handle.db();
|
|
||||||
let request = db.get_websocket_request(request_id)?;
|
|
||||||
Ok(db.duplicate_websocket_request(&request, &UpdateSource::from_window_label(window.label()))?)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[command]
|
|
||||||
pub async fn cmd_ws_delete_request<R: Runtime>(
|
|
||||||
request_id: &str,
|
|
||||||
app_handle: AppHandle<R>,
|
|
||||||
window: WebviewWindow<R>,
|
|
||||||
) -> Result<WebsocketRequest> {
|
|
||||||
Ok(app_handle.db().delete_websocket_request_by_id(
|
|
||||||
request_id,
|
|
||||||
&UpdateSource::from_window_label(window.label()),
|
|
||||||
)?)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
pub async fn cmd_ws_delete_connection<R: Runtime>(
|
pub async fn cmd_ws_delete_connection<R: Runtime>(
|
||||||
connection_id: &str,
|
connection_id: &str,
|
||||||
@@ -86,30 +52,6 @@ pub async fn cmd_ws_delete_connections<R: Runtime>(
|
|||||||
)?)
|
)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[command]
|
|
||||||
pub async fn cmd_ws_list_events<R: Runtime>(
|
|
||||||
connection_id: &str,
|
|
||||||
app_handle: AppHandle<R>,
|
|
||||||
) -> Result<Vec<WebsocketEvent>> {
|
|
||||||
Ok(app_handle.db().list_websocket_events(connection_id)?)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[command]
|
|
||||||
pub async fn cmd_ws_list_requests<R: Runtime>(
|
|
||||||
workspace_id: &str,
|
|
||||||
app_handle: AppHandle<R>,
|
|
||||||
) -> Result<Vec<WebsocketRequest>> {
|
|
||||||
Ok(app_handle.db().list_websocket_requests(workspace_id)?)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[command]
|
|
||||||
pub async fn cmd_ws_list_connections<R: Runtime>(
|
|
||||||
workspace_id: &str,
|
|
||||||
app_handle: AppHandle<R>,
|
|
||||||
) -> Result<Vec<WebsocketConnection>> {
|
|
||||||
Ok(app_handle.db().list_websocket_connections(workspace_id)?)
|
|
||||||
}
|
|
||||||
|
|
||||||
#[command]
|
#[command]
|
||||||
pub async fn cmd_ws_send<R: Runtime>(
|
pub async fn cmd_ws_send<R: Runtime>(
|
||||||
connection_id: &str,
|
connection_id: &str,
|
||||||
|
|||||||
+1
-35
@@ -1,25 +1,5 @@
|
|||||||
import { invoke } from '@tauri-apps/api/core';
|
import { invoke } from '@tauri-apps/api/core';
|
||||||
import { WebsocketConnection, WebsocketEvent, WebsocketRequest } from '@yaakapp-internal/models';
|
import { WebsocketConnection } from '@yaakapp-internal/models';
|
||||||
|
|
||||||
export function upsertWebsocketRequest(
|
|
||||||
request: WebsocketRequest | Partial<Omit<WebsocketRequest, 'id'>>,
|
|
||||||
) {
|
|
||||||
return invoke('cmd_ws_upsert_request', {
|
|
||||||
request,
|
|
||||||
}) as Promise<WebsocketRequest>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function duplicateWebsocketRequest(requestId: string) {
|
|
||||||
return invoke('cmd_ws_duplicate_request', {
|
|
||||||
requestId,
|
|
||||||
}) as Promise<WebsocketRequest>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function deleteWebsocketRequest(requestId: string) {
|
|
||||||
return invoke('cmd_ws_delete_request', {
|
|
||||||
requestId,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
export function deleteWebsocketConnection(connectionId: string) {
|
export function deleteWebsocketConnection(connectionId: string) {
|
||||||
return invoke('cmd_ws_delete_connection', {
|
return invoke('cmd_ws_delete_connection', {
|
||||||
@@ -33,20 +13,6 @@ export function deleteWebsocketConnections(requestId: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function listWebsocketRequests({ workspaceId }: { workspaceId: string }) {
|
|
||||||
return invoke('cmd_ws_list_requests', { workspaceId }) as Promise<WebsocketRequest[]>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function listWebsocketEvents({ connectionId }: { connectionId: string }) {
|
|
||||||
return invoke('cmd_ws_list_events', { connectionId }) as Promise<WebsocketEvent[]>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function listWebsocketConnections({ workspaceId }: { workspaceId: string }) {
|
|
||||||
return invoke('cmd_ws_list_connections', { workspaceId }) as Promise<
|
|
||||||
WebsocketConnection[]
|
|
||||||
>;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function connectWebsocket({
|
export function connectWebsocket({
|
||||||
requestId,
|
requestId,
|
||||||
environmentId,
|
environmentId,
|
||||||
|
|||||||
Reference in New Issue
Block a user