doc and few design adjustments

master
Niko PLP 2 weeks ago
parent ea4b203b16
commit fe4a41b3c2
  1. 6
      ng-net/src/types.rs
  2. 1
      ng-repo/src/store.rs
  3. 3
      ng-repo/src/types.rs
  4. 2
      ng-verifier/src/commits/mod.rs
  5. 2
      ng-verifier/src/site.rs
  6. 29
      ng-verifier/src/types.rs
  7. 2
      ng-verifier/src/user_storage/mod.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

@ -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,

@ -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

@ -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::*;

@ -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;

@ -160,9 +160,12 @@ pub type CancelFn = Box<dyn FnOnce()>;
#[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<String>,
remove: Vec<String>,
}
#[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<ObjectId>,
graph: Option<GraphUpdate>,
discrete: Option<DiscreteUpdate>,
}
#[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<String>,
pub removes: Vec<String>,
}

@ -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::*;

Loading…
Cancel
Save