#![allow(dead_code, unused_imports)]
pub mod browser;
pub mod communication;
pub mod hooks;
pub mod productivity;
pub mod registry;
pub mod smart_home;
pub mod system;
pub use hooks::{Hook, HookAction, HookConfig, HookResult, HookTrigger};
pub use registry::{Integration, IntegrationCategory, IntegrationRegistry, IntegrationStatus};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Capability {
pub id: String,
pub name: String,
pub description: String,
pub permissions: Vec<String>,
pub parameters: Vec<Parameter>,
pub requires_confirmation: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Parameter {
pub name: String,
pub description: String,
pub param_type: ParameterType,
pub required: bool,
pub default: Option<serde_json::Value>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ParameterType {
String,
Number,
Boolean,
Date,
DateTime,
Duration,
Email,
Url,
FilePath,
Json,
Array(Box<ParameterType>),
Object(HashMap<String, ParameterType>),
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct IntegrationResult {
pub success: bool,
pub data: Option<serde_json::Value>,
pub error: Option<String>,
pub metadata: HashMap<String, serde_json::Value>,
}
impl IntegrationResult {
pub fn ok(data: serde_json::Value) -> Self {
Self {
success: true,
data: Some(data),
error: None,
metadata: HashMap::new(),
}
}
pub fn err(error: impl Into<String>) -> Self {
Self {
success: false,
data: None,
error: Some(error.into()),
metadata: HashMap::new(),
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct OAuthConfig {
pub client_id: String,
pub client_secret: Option<String>,
pub auth_url: String,
pub token_url: String,
pub scopes: Vec<String>,
pub redirect_uri: String,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ApiKeyConfig {
pub key: String,
pub header_name: Option<String>,
pub prefix: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(tag = "type", rename_all = "snake_case")]
pub enum AuthMethod {
None,
ApiKey(ApiKeyConfig),
OAuth2(OAuthConfig),
Bearer { token: String },
Basic { username: String, password: String },
Custom { headers: HashMap<String, String> },
}