mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-25 04:44:12 +02:00
Implement response deletes in the browser host instead of declining them (#574)
This commit is contained in:
@@ -678,22 +678,22 @@ export function __wbg_versions_215a3ab1c9d5745a(arg0) {
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
||||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1104, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 1102, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
||||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hf84d53817e0238b4);
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__hf84d53817e0238b4);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
||||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 202, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("Event")], shim_idx: 200, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h7e06bb925b918fbb);
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h7e06bb925b918fbb);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
||||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 180, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [NamedExternref("IDBVersionChangeEvent")], shim_idx: 70, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
||||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h7e53e249a4dc4aa9);
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h7e53e249a4dc4aa9);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
export function __wbindgen_cast_0000000000000004(arg0, arg1) {
|
||||||
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 200, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [], shim_idx: 198, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
||||||
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h87640adb2bbfa2fc);
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h87640adb2bbfa2fc);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -312,6 +312,28 @@ fn dispatch(
|
|||||||
to_json(db.get_or_create_workspace_meta(&workspace.id).map_err(js_error)?)
|
to_json(db.get_or_create_workspace_meta(&workspace.id).map_err(js_error)?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
"cmd_delete_all_http_responses" => {
|
||||||
|
let req: RequestIdReq = from_js(payload)?;
|
||||||
|
host.queries
|
||||||
|
.connect()
|
||||||
|
.delete_all_http_responses_for_request(&req.request_id, source)
|
||||||
|
.map_err(js_error)?;
|
||||||
|
to_json(())
|
||||||
|
}
|
||||||
|
|
||||||
|
"cmd_delete_send_history" => {
|
||||||
|
let req: WorkspaceIdReq = from_js(payload)?;
|
||||||
|
host.queries
|
||||||
|
.with_tx(|tx| {
|
||||||
|
tx.delete_all_http_responses_for_workspace(&req.workspace_id, source)?;
|
||||||
|
tx.delete_all_grpc_connections_for_workspace(&req.workspace_id, source)?;
|
||||||
|
tx.delete_all_websocket_connections_for_workspace(&req.workspace_id, source)?;
|
||||||
|
Ok::<(), yaak_models::error::Error>(())
|
||||||
|
})
|
||||||
|
.map_err(js_error)?;
|
||||||
|
to_json(())
|
||||||
|
}
|
||||||
|
|
||||||
other => Err(js_error(format!("yaak-web: `{other}` is not a command this host answers"))),
|
other => Err(js_error(format!("yaak-web: `{other}` is not a command this host answers"))),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,8 @@ const HANDLERS: Partial<Record<AppCmd, Handler>> = {
|
|||||||
models_grpc_events: (payload, db) => db.rpc("models_grpc_events", payload),
|
models_grpc_events: (payload, db) => db.rpc("models_grpc_events", payload),
|
||||||
models_websocket_events: (payload, db) => db.rpc("models_websocket_events", payload),
|
models_websocket_events: (payload, db) => db.rpc("models_websocket_events", payload),
|
||||||
cmd_get_workspace_meta: (payload, db) => db.rpc("cmd_get_workspace_meta", payload),
|
cmd_get_workspace_meta: (payload, db) => db.rpc("cmd_get_workspace_meta", payload),
|
||||||
|
cmd_delete_all_http_responses: (payload, db) => db.rpc("cmd_delete_all_http_responses", payload),
|
||||||
|
cmd_delete_send_history: (payload, db) => db.rpc("cmd_delete_send_history", payload),
|
||||||
|
|
||||||
/* -------------------------------- app ---------------------------------- */
|
/* -------------------------------- app ---------------------------------- */
|
||||||
|
|
||||||
@@ -298,10 +300,6 @@ const DECLINED: Partial<Record<AppCmd, [reason: string, capability: CapabilityNa
|
|||||||
cmd_call_folder_action: ["Plugins aren't available in the browser yet", "plugins"],
|
cmd_call_folder_action: ["Plugins aren't available in the browser yet", "plugins"],
|
||||||
cmd_call_http_authentication_action: ["Plugins aren't available in the browser yet", "plugins"],
|
cmd_call_http_authentication_action: ["Plugins aren't available in the browser yet", "plugins"],
|
||||||
|
|
||||||
// Sending history and its bookkeeping belong to the send slice.
|
|
||||||
cmd_delete_send_history: ["Sending isn't available in the browser yet", null],
|
|
||||||
cmd_delete_all_http_responses: ["Sending isn't available in the browser yet", null],
|
|
||||||
|
|
||||||
cmd_send_feedback: ["Feedback goes through the desktop app for now", null],
|
cmd_send_feedback: ["Feedback goes through the desktop app for now", null],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user