add json api to cffi and expose it in dc node

This commit is contained in:
Simon Laux
2022-06-12 20:33:48 +02:00
parent 0213bb372f
commit 638d2ff932
12 changed files with 399 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "deltachat-jsonrpc"
version = "0.1.0"
version = "1.86.0"
authors = ["Delta Chat Developers (ML) <delta@codespeak.net>"]
edition = "2021"
default-run = "webserver"

View File

@@ -39,6 +39,10 @@ impl CommandApi {
}
}
pub fn new_from_cffi(accounts: Arc<RwLock<Accounts>>) -> Self {
CommandApi { accounts }
}
async fn get_context(&self, id: u32) -> Result<deltachat::context::Context> {
let sc = self
.accounts

View File

@@ -1,6 +1,8 @@
pub mod api;
pub use api::events;
pub use yerpc;
#[cfg(test)]
mod tests {
use super::api::{Accounts, CommandApi};