use serde::{Serialize, Deserialize};
use serde_json::Value as JsonValue;
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DatabaseWithObjectStores {
pub name: String,
pub version: f64,
pub objectStores: Vec<ObjectStore>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ObjectStore {
pub name: String,
pub keyPath: KeyPath,
pub autoIncrement: bool,
pub indexes: Vec<ObjectStoreIndex>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ObjectStoreIndex {
pub name: String,
pub keyPath: KeyPath,
pub unique: bool,
pub multiEntry: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct Key {
#[serde(rename = "type")]
pub type_: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub number: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub string: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub date: Option<f64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub array: Option<Vec<Key>>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct KeyRange {
#[serde(skip_serializing_if = "Option::is_none")]
pub lower: Option<Key>,
#[serde(skip_serializing_if = "Option::is_none")]
pub upper: Option<Key>,
pub lowerOpen: bool,
pub upperOpen: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DataEntry {
pub key: crate::runtime::RemoteObject,
pub primaryKey: crate::runtime::RemoteObject,
pub value: crate::runtime::RemoteObject,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct KeyPath {
#[serde(rename = "type")]
pub type_: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub string: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub array: Option<Vec<String>>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct ClearObjectStoreParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub securityOrigin: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageKey: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageBucket: Option<crate::storage::StorageBucket>,
pub databaseName: String,
pub objectStoreName: String,
}
impl ClearObjectStoreParams { pub const METHOD: &'static str = "IndexedDB.clearObjectStore"; }
impl crate::CdpCommand for ClearObjectStoreParams {
const METHOD: &'static str = "IndexedDB.clearObjectStore";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeleteDatabaseParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub securityOrigin: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageKey: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageBucket: Option<crate::storage::StorageBucket>,
pub databaseName: String,
}
impl DeleteDatabaseParams { pub const METHOD: &'static str = "IndexedDB.deleteDatabase"; }
impl crate::CdpCommand for DeleteDatabaseParams {
const METHOD: &'static str = "IndexedDB.deleteDatabase";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeleteObjectStoreEntriesParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub securityOrigin: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageKey: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageBucket: Option<crate::storage::StorageBucket>,
pub databaseName: String,
pub objectStoreName: String,
pub keyRange: KeyRange,
}
impl DeleteObjectStoreEntriesParams { pub const METHOD: &'static str = "IndexedDB.deleteObjectStoreEntries"; }
impl crate::CdpCommand for DeleteObjectStoreEntriesParams {
const METHOD: &'static str = "IndexedDB.deleteObjectStoreEntries";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct DisableParams {}
impl DisableParams { pub const METHOD: &'static str = "IndexedDB.disable"; }
impl crate::CdpCommand for DisableParams {
const METHOD: &'static str = "IndexedDB.disable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct EnableParams {}
impl EnableParams { pub const METHOD: &'static str = "IndexedDB.enable"; }
impl crate::CdpCommand for EnableParams {
const METHOD: &'static str = "IndexedDB.enable";
type Response = crate::EmptyReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestDataParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub securityOrigin: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageKey: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageBucket: Option<crate::storage::StorageBucket>,
pub databaseName: String,
pub objectStoreName: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub indexName: Option<String>,
pub skipCount: u64,
pub pageSize: u64,
#[serde(skip_serializing_if = "Option::is_none")]
pub keyRange: Option<KeyRange>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestDataReturns {
pub objectStoreDataEntries: Vec<DataEntry>,
pub hasMore: bool,
}
impl RequestDataParams { pub const METHOD: &'static str = "IndexedDB.requestData"; }
impl crate::CdpCommand for RequestDataParams {
const METHOD: &'static str = "IndexedDB.requestData";
type Response = RequestDataReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetMetadataParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub securityOrigin: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageKey: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageBucket: Option<crate::storage::StorageBucket>,
pub databaseName: String,
pub objectStoreName: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetMetadataReturns {
pub entriesCount: f64,
pub keyGeneratorValue: f64,
}
impl GetMetadataParams { pub const METHOD: &'static str = "IndexedDB.getMetadata"; }
impl crate::CdpCommand for GetMetadataParams {
const METHOD: &'static str = "IndexedDB.getMetadata";
type Response = GetMetadataReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestDatabaseParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub securityOrigin: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageKey: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageBucket: Option<crate::storage::StorageBucket>,
pub databaseName: String,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestDatabaseReturns {
pub databaseWithObjectStores: DatabaseWithObjectStores,
}
impl RequestDatabaseParams { pub const METHOD: &'static str = "IndexedDB.requestDatabase"; }
impl crate::CdpCommand for RequestDatabaseParams {
const METHOD: &'static str = "IndexedDB.requestDatabase";
type Response = RequestDatabaseReturns;
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestDatabaseNamesParams {
#[serde(skip_serializing_if = "Option::is_none")]
pub securityOrigin: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageKey: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub storageBucket: Option<crate::storage::StorageBucket>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
#[serde(rename_all = "camelCase")]
pub struct RequestDatabaseNamesReturns {
pub databaseNames: Vec<String>,
}
impl RequestDatabaseNamesParams { pub const METHOD: &'static str = "IndexedDB.requestDatabaseNames"; }
impl crate::CdpCommand for RequestDatabaseNamesParams {
const METHOD: &'static str = "IndexedDB.requestDatabaseNames";
type Response = RequestDatabaseNamesReturns;
}