mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-01 12:34:06 +01:00
Proxy GUI pass (#793)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
96ab0a8a60
commit
e82ffc53ad
73 files changed
+6003
-1257
No files matched your search
@@ -7,6 +7,7 @@ use crate::convert::{self, DroppedHeader};
|
||||
use crate::models::Flow;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::path::{Path, PathBuf};
|
||||
use ts_rs::TS;
|
||||
use yaak_models::models::HttpRequest;
|
||||
use yaak_models::query_manager::QueryManager;
|
||||
use yaak_models::util::UpdateSource;
|
||||
@@ -17,16 +18,18 @@ pub fn client_data_dir() -> PathBuf {
|
||||
yaak_common::data_dir::resolve_data_dir(app_id)
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_rpc.ts")]
|
||||
pub struct WorkspaceSummary {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
pub folders: Vec<FolderSummary>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export, export_to = "gen_rpc.ts")]
|
||||
pub struct FolderSummary {
|
||||
pub id: String,
|
||||
pub name: String,
|
||||
@@ -39,7 +42,7 @@ pub struct FolderSummary {
|
||||
pub struct SaveFlowRequest {
|
||||
pub workspace_id: String,
|
||||
pub folder_id: Option<String>,
|
||||
/// Defaults to the URL's path.
|
||||
/// None or blank leaves the request unnamed, and Yaak shows its URL.
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
||||
@@ -56,11 +59,16 @@ pub struct ClientDb {
|
||||
}
|
||||
|
||||
impl ClientDb {
|
||||
/// Yaak has run on this machine, so there is a database to save into.
|
||||
pub fn exists(data_dir: &Path) -> bool {
|
||||
data_dir.join("db.sqlite").exists()
|
||||
}
|
||||
|
||||
/// Opens `db.sqlite` in Yaak's data directory `data_dir`. Fails when there is none, rather
|
||||
/// than creating a database for a Yaak that has never run.
|
||||
pub fn open(data_dir: &Path) -> Result<Self, String> {
|
||||
let db_path = data_dir.join("db.sqlite");
|
||||
if !db_path.exists() {
|
||||
if !Self::exists(data_dir) {
|
||||
return Err(format!(
|
||||
"Yaak's database was not found at {}. Install Yaak and open it once.",
|
||||
db_path.display()
|
||||
|
||||
Reference in new issue
Block a user