change history to clean

This commit is contained in:
Julian Freeman
2026-04-17 13:44:41 -04:00
parent b9f24e07cf
commit 6d2b117200
11 changed files with 696 additions and 351 deletions

View File

@@ -20,7 +20,6 @@ pub struct BrowserView {
pub extensions: Vec<ExtensionSummary>,
pub bookmarks: Vec<BookmarkSummary>,
pub password_sites: Vec<PasswordSiteSummary>,
pub history_domains: Vec<HistoryDomainSummary>,
pub stats: BrowserStats,
}
@@ -31,7 +30,7 @@ pub struct BrowserStats {
pub extension_count: usize,
pub bookmark_count: usize,
pub password_site_count: usize,
pub history_domain_count: usize,
pub history_cleanup_profile_count: usize,
}
#[derive(Serialize)]
@@ -46,6 +45,7 @@ pub struct ProfileSummary {
pub default_avatar_stroke_color: Option<i64>,
pub avatar_label: String,
pub path: String,
pub history_cleanup: HistoryCleanupSummary,
}
#[derive(Serialize)]
@@ -77,13 +77,41 @@ pub struct PasswordSiteSummary {
pub profiles: Vec<AssociatedProfileSummary>,
}
#[derive(Serialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct HistoryCleanupSummary {
pub history: CleanupFileStatus,
pub top_sites: CleanupFileStatus,
pub visited_links: CleanupFileStatus,
}
#[derive(Serialize, Deserialize, Clone, Copy, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub enum CleanupFileStatus {
Found,
Missing,
}
#[derive(Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CleanupHistoryInput {
pub browser_id: String,
pub profile_ids: Vec<String>,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct HistoryDomainSummary {
pub domain: String,
pub visit_count: i64,
pub profile_ids: Vec<String>,
pub profiles: Vec<AssociatedProfileSummary>,
pub struct CleanupHistoryResponse {
pub results: Vec<CleanupHistoryResult>,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct CleanupHistoryResult {
pub profile_id: String,
pub deleted_files: Vec<String>,
pub skipped_files: Vec<String>,
pub error: Option<String>,
}
#[derive(Serialize, Clone)]
@@ -194,10 +222,3 @@ pub struct TempPasswordSite {
pub profile_ids: BTreeSet<String>,
pub profiles: BTreeMap<String, AssociatedProfileSummary>,
}
pub struct TempHistoryDomain {
pub domain: String,
pub visit_count: i64,
pub profile_ids: BTreeSet<String>,
pub profiles: BTreeMap<String, AssociatedProfileSummary>,
}