use serde::{Deserialize, Serialize};
#[derive(Debug, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PingRequest {
pub value: Option<String>,
}
#[derive(Debug, Clone, Default, Deserialize, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct PingResponse {
pub value: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GenerateModelsRequest {
pub project_path: String,
pub output_path: Option<String>,
pub validation_library: Option<String>,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GenerateModelsResponse {
pub generated_files: Vec<String>,
pub commands_found: i32,
pub types_generated: i32,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AnalyzeCommandsRequest {
pub project_path: String,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AnalyzeCommandsResponse {
pub commands: Vec<CommandInfo>,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct CommandInfo {
pub name: String,
pub file_path: String,
pub line_number: usize,
pub parameters: Vec<ParameterInfo>,
pub return_type: String,
pub is_async: bool,
}
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ParameterInfo {
pub name: String,
pub rust_type: String,
pub typescript_type: String,
pub is_optional: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct StructInfo {
pub name: String,
pub fields: Vec<FieldInfo>,
pub file_path: String,
pub is_enum: bool,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct FieldInfo {
pub name: String,
pub rust_type: String,
pub typescript_type: String,
pub is_optional: bool,
pub is_public: bool,
pub validator_attributes: Option<ValidatorAttributes>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct ValidatorAttributes {
pub length: Option<LengthConstraint>,
pub range: Option<RangeConstraint>,
pub email: bool,
pub url: bool,
pub custom_message: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LengthConstraint {
pub min: Option<u64>,
pub max: Option<u64>,
pub message: Option<String>,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RangeConstraint {
pub min: Option<f64>,
pub max: Option<f64>,
pub message: Option<String>,
}