oxen-server 0.53.0

Oxen server is a fast data version control backend, supporting local disk and S3. Self host your repositories on your own storage, or use the hosted platform on Oxen.ai. Stores, syncs, and serves versioned datasets, model checkpoints, game assets, studio media, and any large data. Use the oxen CLI to push and pull from the oxen server.
use crate::{errors::OxenHttpError, params::path_param};
use actix_web::{HttpRequest, HttpResponse};
use liboxen::view::http::STATUS_SUCCESS;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize)]
struct ActionResponse {
    action: String,
    status: String,
    state: String,
}

pub async fn completed(req: HttpRequest) -> actix_web::Result<HttpResponse, OxenHttpError> {
    let action = path_param(&req, "action")?.to_string();
    log::debug!("{action} action completed");
    let resp = ActionResponse {
        action: action.to_string(),
        state: "completed".to_string(),
        status: STATUS_SUCCESS.to_string(),
    };
    Ok(HttpResponse::Ok().json(resp))
}

pub async fn started(req: HttpRequest) -> actix_web::Result<HttpResponse, OxenHttpError> {
    let action = path_param(&req, "action")?.to_string();
    let resp = ActionResponse {
        action: action.to_string(),
        status: STATUS_SUCCESS.to_string(),
        state: "started".to_string(),
    };
    Ok(HttpResponse::Ok().json(resp))
}