#[allow(clippy::wildcard_imports)]
use super::*;
pub(super) fn export_issues(config: &Config, store: &Store, args: &Value) -> ToolOutcome {
let target = req_string(args, "target")?;
let dry_run = opt_bool(args, "dry_run")?.unwrap_or(false);
let project = opt_string(args, "project")?;
match export::run_core(config, store, Some(&target), dry_run, project.as_deref()) {
Ok(report) => Ok(success_result(report.clone(), json!({ "report": report }))),
Err(e) => Ok(error_result(crate::error::render_error(&e))),
}
}
pub(super) fn import_issues(config: &Config, store: &Store, args: &Value) -> ToolOutcome {
let target = req_string(args, "target")?;
match import::run_core(config, store, Some(&target)) {
Ok(report) => Ok(success_result(report.clone(), json!({ "report": report }))),
Err(e) => Ok(error_result(crate::error::render_error(&e))),
}
}
pub(super) fn dispatch(
config: &Config,
store: &Store,
name: &str,
arguments: &Value,
) -> Option<ToolOutcome> {
match name {
"export_issues" => Some(export_issues(config, store, arguments)),
"import_issues" => Some(import_issues(config, store, arguments)),
_ => None,
}
}