feat(nbstore): add blob sync storage (#10752)

This commit is contained in:
EYHN
2025-03-14 18:05:54 +08:00
committed by GitHub
parent a2eb3fe1b2
commit 05200ad7b7
56 changed files with 1441 additions and 404 deletions
+34 -1
View File
@@ -1,9 +1,10 @@
pub mod blob;
pub mod blob_sync;
pub mod doc;
pub mod doc_sync;
pub mod error;
pub mod pool;
pub mod storage;
pub mod sync;
use chrono::NaiveDateTime;
use napi::bindgen_prelude::*;
@@ -402,6 +403,38 @@ impl DocStoragePool {
self.get(universal_id).await?.clear_clocks().await?;
Ok(())
}
#[napi]
pub async fn set_blob_uploaded_at(
&self,
universal_id: String,
peer: String,
blob_id: String,
uploaded_at: Option<NaiveDateTime>,
) -> Result<()> {
self
.get(universal_id)
.await?
.set_blob_uploaded_at(peer, blob_id, uploaded_at)
.await?;
Ok(())
}
#[napi]
pub async fn get_blob_uploaded_at(
&self,
universal_id: String,
peer: String,
blob_id: String,
) -> Result<Option<NaiveDateTime>> {
let result = self
.get(universal_id)
.await?
.get_blob_uploaded_at(peer, blob_id)
.await?;
Ok(result)
}
}
#[napi]