Add local document JSON state commands
This commit is contained in:
parent
b102e07204
commit
e039a4f81f
11 changed files with 153 additions and 10 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use geth_auth::{AuthExplanation, AuthOp};
|
||||
use geth_db::DbResource;
|
||||
use geth_document::DocumentResource;
|
||||
use geth_document::{DocumentResource, DocumentState};
|
||||
use geth_keychain::KeychainOp;
|
||||
use geth_kv::{KvEntry, KvResource};
|
||||
use geth_pubsub::PubsubMessage;
|
||||
|
|
@ -138,6 +138,13 @@ pub enum ControlRequest {
|
|||
DocumentStatus {
|
||||
name: String,
|
||||
},
|
||||
DocumentSet {
|
||||
name: String,
|
||||
state_json: String,
|
||||
},
|
||||
DocumentGet {
|
||||
name: String,
|
||||
},
|
||||
PubsubPub {
|
||||
topic: String,
|
||||
message: String,
|
||||
|
|
@ -263,6 +270,12 @@ pub enum ControlResponse {
|
|||
DocumentStatus {
|
||||
document: DocumentResource,
|
||||
},
|
||||
DocumentSet {
|
||||
state: DocumentState,
|
||||
},
|
||||
DocumentGet {
|
||||
state: DocumentState,
|
||||
},
|
||||
PubsubPublished {
|
||||
message: PubsubMessage,
|
||||
},
|
||||
|
|
@ -384,5 +397,14 @@ mod tests {
|
|||
decode_response(&encode_response(&response).expect("encode")).expect("decode"),
|
||||
response
|
||||
);
|
||||
|
||||
let request = ControlRequest::DocumentSet {
|
||||
name: "notes".to_owned(),
|
||||
state_json: r#"{"title":"notes"}"#.to_owned(),
|
||||
};
|
||||
assert_eq!(
|
||||
decode_request(&encode_request(&request).expect("encode")).expect("decode"),
|
||||
request
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue