From fe4a41b3c26b8b3c78b28e83e6d4d55a9bd6c949 Mon Sep 17 00:00:00 2001 From: Niko PLP Date: Mon, 6 May 2024 00:55:36 +0300 Subject: [PATCH] doc and few design adjustments --- ng-net/src/types.rs | 6 ++++-- ng-repo/src/store.rs | 1 + ng-repo/src/types.rs | 3 +-- ng-verifier/src/commits/mod.rs | 2 ++ ng-verifier/src/site.rs | 2 +- ng-verifier/src/types.rs | 29 +++++++++++++++++------------ ng-verifier/src/user_storage/mod.rs | 2 ++ 7 files changed, 28 insertions(+), 17 deletions(-) diff --git a/ng-net/src/types.rs b/ng-net/src/types.rs index 6420e4b..b50c776 100644 --- a/ng-net/src/types.rs +++ b/ng-net/src/types.rs @@ -1303,9 +1303,11 @@ pub struct InnerOverlayLink { /// Details of the overlay of an NgLink #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Hash)] pub enum OverlayLink { - Outer(StoreOverlay), - Inner(InnerOverlayLink), + Outer(Digest), + InnerLink(InnerOverlayLink), + Inner(Digest), Inherit, + Public(PubKey), } /// Overlay session ID diff --git a/ng-repo/src/store.rs b/ng-repo/src/store.rs index 7107add..2dd2129 100644 --- a/ng-repo/src/store.rs +++ b/ng-repo/src/store.rs @@ -29,6 +29,7 @@ use threshold_crypto::{SecretKeySet, SecretKeyShare}; pub struct Store { store_repo: StoreRepo, + //TODO: store_readcap and store_overlay_branch_readcap could be empty, if we have only an outer access to the store. should be Options store_readcap: ReadCap, store_overlay_branch_readcap: ReadCap, pub overlay_id: OverlayId, diff --git a/ng-repo/src/types.rs b/ng-repo/src/types.rs index 83b0090..0399b38 100644 --- a/ng-repo/src/types.rs +++ b/ng-repo/src/types.rs @@ -1579,7 +1579,6 @@ impl RemovePermission { pub enum RepoNamedItemV0 { Branch(BranchId), Commit(ObjectId), - File(ObjectId), } #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] @@ -1587,7 +1586,7 @@ pub enum RepoNamedItem { V0(RepoNamedItemV0), } -/// Add a new name in the repo that can point to a branch, a commit or a file +/// Add a new name in the repo that can point to a branch or a commit /// /// Or change the value of a name /// DEPS: if it is a change of value: all the previous AddName commits seen for this name diff --git a/ng-verifier/src/commits/mod.rs b/ng-verifier/src/commits/mod.rs index b03ddeb..bfa4023 100644 --- a/ng-verifier/src/commits/mod.rs +++ b/ng-verifier/src/commits/mod.rs @@ -7,6 +7,8 @@ // notice may not be copied, modified, or distributed except // according to those terms. +//! Verifiers for each Commit type + use crate::verifier::Verifier; use ng_repo::errors::VerifierError; use ng_repo::log::*; diff --git a/ng-verifier/src/site.rs b/ng-verifier/src/site.rs index e90ecc4..0d0dedb 100644 --- a/ng-verifier/src/site.rs +++ b/ng-verifier/src/site.rs @@ -9,7 +9,7 @@ * according to those terms. */ -//! Site (Public, Protected, Private) of Individual and Org +//! A Site of an Individual or Org (with 3P stores: Public, Protected, Private) use crate::types::*; use crate::verifier::Verifier; diff --git a/ng-verifier/src/types.rs b/ng-verifier/src/types.rs index 1be5daa..5a5bf90 100644 --- a/ng-verifier/src/types.rs +++ b/ng-verifier/src/types.rs @@ -160,9 +160,12 @@ pub type CancelFn = Box; #[derive(Clone, Debug, Serialize, Deserialize)] pub enum AppFetchContentV0 { - Get, // more to be detailed - ReadQuery, // more to be detailed + Get, // more to be detailed + Subscribe, + Update, + ReadQuery, // more to be detailed WriteQuery, // more to be detailed + //Invoke, } #[derive(Clone, Debug, Serialize, Deserialize)] @@ -203,13 +206,14 @@ pub enum AppRequest { } #[derive(Clone, Debug, Serialize, Deserialize)] -pub enum AppQuery { +pub enum DocQuery { V0(String), // Sparql } #[derive(Clone, Debug, Serialize, Deserialize)] pub struct GraphUpdate { - sparql_update: String, + add: Vec, + remove: Vec, } #[derive(Clone, Debug, Serialize, Deserialize)] @@ -227,30 +231,31 @@ pub enum DiscreteUpdate { } #[derive(Clone, Debug, Serialize, Deserialize)] -pub struct AppUpdate { +pub struct DocUpdate { heads: Vec, graph: Option, discrete: Option, } #[derive(Clone, Debug, Serialize, Deserialize)] -pub struct AppCreate { +pub struct DocCreate { store: StoreRepo, content_type: BranchContentType, } #[derive(Clone, Debug, Serialize, Deserialize)] -pub struct AppDelete { +pub struct DocDelete { /// Nuri of doc to delete nuri: String, } #[derive(Clone, Debug, Serialize, Deserialize)] pub enum AppRequestPayloadV0 { - Create(AppCreate), - Query(AppQuery), - Update(AppUpdate), - Delete(AppDelete), + Create(DocCreate), + Query(DocQuery), + Update(DocUpdate), + Delete(DocDelete), + //Invoke(InvokeArguments), SmallFilePut(SmallFile), RandomAccessFilePut(String), // content_type RandomAccessFilePutChunk((ObjectId, serde_bytes::ByteBuf)), // end the upload with an empty vec @@ -277,7 +282,7 @@ pub enum DiscretePatch { #[derive(Clone, Debug, Serialize, Deserialize)] pub struct GraphPatch { - /// oxigraph::model::GroundQuad serialized in turtle with oxrdfio + /// oxigraph::model::GroundQuad serialized to n-quads with oxrdfio pub adds: Vec, pub removes: Vec, } diff --git a/ng-verifier/src/user_storage/mod.rs b/ng-verifier/src/user_storage/mod.rs index f39d0ef..1f37032 100644 --- a/ng-verifier/src/user_storage/mod.rs +++ b/ng-verifier/src/user_storage/mod.rs @@ -7,6 +7,8 @@ // notice may not be copied, modified, or distributed except // according to those terms. +//! Storage of user application data (RDF, rich-text, JSON, etc) and helper objects for mapping to KCV + pub mod storage; pub use storage::*;