support custom userdata
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user