use crate::sdk::pm2;
use std::collections::HashMap;
use std::path::PathBuf;
pub async fn pm2_list(debug: bool) -> Result<(), String> {
pm2::list(debug).await
}
pub async fn pm2_logs(project: Option<String>, debug: bool) -> Result<(), String> {
pm2::logs(project, debug).await
}
pub async fn pm2_stop(name: &str, debug: bool) -> Result<(), String> {
pm2::stop(name, debug).await
}
pub async fn pm2_delete(name: &str, debug: bool) -> Result<(), String> {
pm2::delete(name, debug).await
}
pub async fn pm2_start(
name: &str,
command: &str,
log_dir: Option<&PathBuf>,
envs: Option<&HashMap<String, String>>,
debug: bool,
) -> Result<(), String> {
pm2::start(name, command, log_dir, envs, debug).await
}
pub async fn pm2_cleanup(debug: bool) -> Result<(), String> {
pm2::cleanup(debug).await
}
pub async fn pm2_save(debug: bool) -> Result<(), String> {
pm2::save(debug).await
}
pub async fn pm2_snapshot(debug: bool) -> Result<std::path::PathBuf, String> {
pm2::snapshot(debug).await
}
pub async fn pm2_resurrect(debug: bool) -> Result<(), String> {
pm2::resurrect(debug).await
}
pub async fn pm2_flush(target: Option<&str>, debug: bool) -> Result<(), String> {
pm2::flush(target, debug).await
}
pub async fn pm2_monitor(debug: bool) -> Result<(), String> {
pm2::monitor(debug).await
}
pub async fn pm2_env(target: &str, debug: bool) -> Result<(), String> {
pm2::env(target, debug).await
}