support custom userdata

This commit is contained in:
Julian Freeman
2026-04-16 14:50:38 -04:00
parent 436797abfa
commit a8ad89074f
9 changed files with 748 additions and 76 deletions

View File

@@ -1,6 +1,6 @@
use std::collections::BTreeSet;
use serde::Serialize;
use serde::{Deserialize, Serialize};
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
@@ -12,6 +12,7 @@ pub struct ScanResponse {
#[serde(rename_all = "camelCase")]
pub struct BrowserView {
pub browser_id: String,
pub browser_family_id: Option<String>,
pub browser_name: String,
pub data_root: String,
pub profiles: Vec<ProfileSummary>,
@@ -57,6 +58,54 @@ pub struct BookmarkSummary {
pub profile_ids: Vec<String>,
}
#[derive(Serialize)]
#[serde(rename_all = "camelCase")]
pub struct BrowserConfigListResponse {
pub configs: Vec<BrowserConfigEntry>,
}
#[derive(Serialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct BrowserConfigEntry {
pub id: String,
pub source: BrowserConfigSource,
pub browser_family_id: Option<String>,
pub name: String,
pub executable_path: String,
pub user_data_path: String,
pub deletable: bool,
}
#[derive(Serialize, Clone)]
#[serde(rename_all = "camelCase")]
pub enum BrowserConfigSource {
Default,
Custom,
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CreateCustomBrowserConfigInput {
pub name: String,
pub executable_path: String,
pub user_data_path: String,
}
#[derive(Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct StoredBrowserConfigs {
pub custom_configs: Vec<CustomBrowserConfigRecord>,
}
#[derive(Serialize, Deserialize, Clone)]
#[serde(rename_all = "camelCase")]
pub struct CustomBrowserConfigRecord {
pub id: String,
pub name: String,
pub executable_path: String,
pub user_data_path: String,
}
pub struct BrowserDefinition {
pub id: &'static str,
pub name: &'static str,