|
|
|
@ -1,9 +1,10 @@
|
|
|
|
|
use crate::client_api::error::ApiResult;
|
|
|
|
|
use crate::client_api::IPCApi;
|
|
|
|
|
use crate::types::repo::FrontendState;
|
|
|
|
|
use bromine::prelude::*;
|
|
|
|
|
use tokio::time::Duration;
|
|
|
|
|
|
|
|
|
|
use crate::client_api::error::ApiResult;
|
|
|
|
|
use crate::client_api::IPCApi;
|
|
|
|
|
use crate::types::repo::{FrontendState, RepositoryMetadata};
|
|
|
|
|
|
|
|
|
|
#[derive(Clone)]
|
|
|
|
|
pub struct RepoApi {
|
|
|
|
|
ctx: PooledContext,
|
|
|
|
@ -24,6 +25,14 @@ impl RepoApi {
|
|
|
|
|
Self { ctx }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Returns metadata about the repository
|
|
|
|
|
#[tracing::instrument(level = "debug", skip(self))]
|
|
|
|
|
pub async fn get_repo_metadata(&self) -> ApiResult<RepositoryMetadata> {
|
|
|
|
|
let metadata = self.emit_and_get("repository_metadata", (), Some(Duration::from_secs(2))).await?;
|
|
|
|
|
|
|
|
|
|
Ok(metadata)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Returns the state of the frontend that is stored in the repo
|
|
|
|
|
#[tracing::instrument(level = "debug", skip(self))]
|
|
|
|
|
pub async fn get_frontend_state(&self) -> ApiResult<FrontendState> {
|
|
|
|
|