Move ruma re-export from matrix-sdk-common to matrix-sdk

master
Jonas Platte 2021-06-07 17:33:08 +02:00
parent 54063513a3
commit 1168c39c20
No known key found for this signature in database
GPG Key ID: 7D261D771D915378
5 changed files with 32 additions and 46 deletions

View File

@ -26,7 +26,7 @@ rustls-tls = ["reqwest/rustls-tls"]
socks = ["reqwest/socks"] socks = ["reqwest/socks"]
sso_login = ["warp", "rand", "tokio-stream"] sso_login = ["warp", "rand", "tokio-stream"]
require_auth_for_profile_requests = [] require_auth_for_profile_requests = []
appservice = ["matrix-sdk-common/appservice", "ruma/appservice-api-s", "ruma/appservice-api-helper", "ruma/rand"] appservice = ["ruma/appservice-api-s", "ruma/appservice-api-helper", "ruma/rand"]
docs = ["encryption", "sled_cryptostore", "sled_state_store", "sso_login"] docs = ["encryption", "sled_cryptostore", "sled_state_store", "sso_login"]
@ -56,7 +56,7 @@ default_features = false
[dependencies.ruma] [dependencies.ruma]
version = "0.1.2" version = "0.1.2"
features = ["client-api-c", "unstable-pre-spec"] features = ["client-api-c", "compat", "unstable-pre-spec"]
[dependencies.tokio-stream] [dependencies.tokio-stream]
version = "0.1.4" version = "0.1.4"

View File

@ -85,6 +85,23 @@ pub use matrix_sdk_base::{
}; };
pub use matrix_sdk_common::*; pub use matrix_sdk_common::*;
pub use reqwest; pub use reqwest;
#[cfg(feature = "appservice")]
pub use ruma::{
api::{appservice as api_appservice, IncomingRequest, OutgoingRequestAppserviceExt},
serde::{exports::serde::de::value::Error as SerdeError, urlencoded},
};
pub use ruma::{
api::{
client as api,
error::{
FromHttpRequestError, FromHttpResponseError, IntoHttpError, MatrixError, ServerError,
},
AuthScheme, EndpointError, IncomingResponse, OutgoingRequest, SendAccessToken,
},
assign, directory, encryption, events, identifiers, int, presence, push, receipt,
serde::{CanonicalJsonValue, Raw},
thirdparty, uint, Int, MilliSecondsSinceUnixEpoch, Outgoing, SecondsSinceUnixEpoch, UInt,
};
mod client; mod client;
mod error; mod error;

View File

@ -10,18 +10,11 @@ readme = "README.md"
repository = "https://github.com/matrix-org/matrix-rust-sdk" repository = "https://github.com/matrix-org/matrix-rust-sdk"
version = "0.2.0" version = "0.2.0"
[features]
markdown = ["ruma/markdown"]
appservice = ["ruma/appservice-api", "ruma/appservice-api-helper", "ruma/rand"]
[dependencies] [dependencies]
instant = { version = "0.1.9", features = ["wasm-bindgen", "now"] }
serde = "1.0.122"
async-trait = "0.1.42" async-trait = "0.1.42"
instant = { version = "0.1.9", features = ["wasm-bindgen", "now"] }
[dependencies.ruma] ruma = { version = "0.1.2", features = ["client-api-c"] }
version = "0.1.0" serde = "1.0.122"
features = ["client-api-c", "compat", "unstable-pre-spec"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
uuid = { version = "0.8.2", default-features = false, features = ["v4", "serde"] } uuid = { version = "0.8.2", default-features = false, features = ["v4", "serde"] }
@ -29,7 +22,7 @@ uuid = { version = "0.8.2", default-features = false, features = ["v4", "serde"]
[target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio] [target.'cfg(not(target_arch = "wasm32"))'.dependencies.tokio]
version = "1.1.0" version = "1.1.0"
default-features = false default-features = false
features = ["sync"] features = ["rt", "sync"]
[target.'cfg(target_arch = "wasm32")'.dependencies] [target.'cfg(target_arch = "wasm32")'.dependencies]
futures = "0.3.12" futures = "0.3.12"

View File

@ -1,20 +1,11 @@
use std::{collections::BTreeMap, convert::TryFrom}; use std::{collections::BTreeMap, convert::TryFrom};
use ruma::{ use ruma::{
api::client::r0::sync::sync_events::{ api::client::r0::{
Ephemeral, InvitedRoom, Presence, RoomAccountData, State, ToDevice,
},
serde::Raw,
DeviceIdBox,
};
use serde::{Deserialize, Serialize};
use super::{
api::r0::{
push::get_notifications::Notification, push::get_notifications::Notification,
sync::sync_events::{ sync::sync_events::{
DeviceLists, GlobalAccountData, DeviceLists, Ephemeral, GlobalAccountData, InvitedRoom, Presence, RoomAccountData,
UnreadNotificationsCount as RumaUnreadNotificationsCount, State, ToDevice, UnreadNotificationsCount as RumaUnreadNotificationsCount,
}, },
}, },
events::{ events::{
@ -22,8 +13,10 @@ use super::{
SyncStateEvent, Unsigned, SyncStateEvent, Unsigned,
}, },
identifiers::{DeviceKeyAlgorithm, EventId, RoomId, UserId}, identifiers::{DeviceKeyAlgorithm, EventId, RoomId, UserId},
MilliSecondsSinceUnixEpoch, serde::Raw,
DeviceIdBox, MilliSecondsSinceUnixEpoch,
}; };
use serde::{Deserialize, Serialize};
/// A change in ambiguity of room members that an `m.room.member` event /// A change in ambiguity of room members that an `m.room.member` event
/// triggers. /// triggers.
@ -258,7 +251,7 @@ pub struct MemberEvent {
} }
impl TryFrom<SyncStateEvent<MemberEventContent>> for MemberEvent { impl TryFrom<SyncStateEvent<MemberEventContent>> for MemberEvent {
type Error = super::identifiers::Error; type Error = ruma::identifiers::Error;
fn try_from(event: SyncStateEvent<MemberEventContent>) -> Result<Self, Self::Error> { fn try_from(event: SyncStateEvent<MemberEventContent>) -> Result<Self, Self::Error> {
Ok(MemberEvent { Ok(MemberEvent {
@ -274,7 +267,7 @@ impl TryFrom<SyncStateEvent<MemberEventContent>> for MemberEvent {
} }
impl TryFrom<StateEvent<MemberEventContent>> for MemberEvent { impl TryFrom<StateEvent<MemberEventContent>> for MemberEvent {
type Error = super::identifiers::Error; type Error = ruma::identifiers::Error;
fn try_from(event: StateEvent<MemberEventContent>) -> Result<Self, Self::Error> { fn try_from(event: StateEvent<MemberEventContent>) -> Result<Self, Self::Error> {
Ok(MemberEvent { Ok(MemberEvent {
@ -315,7 +308,7 @@ pub struct StrippedMemberEvent {
} }
impl TryFrom<StrippedStateEvent<MemberEventContent>> for StrippedMemberEvent { impl TryFrom<StrippedStateEvent<MemberEventContent>> for StrippedMemberEvent {
type Error = super::identifiers::Error; type Error = ruma::identifiers::Error;
fn try_from(event: StrippedStateEvent<MemberEventContent>) -> Result<Self, Self::Error> { fn try_from(event: StrippedStateEvent<MemberEventContent>) -> Result<Self, Self::Error> {
Ok(StrippedMemberEvent { Ok(StrippedMemberEvent {

View File

@ -1,22 +1,5 @@
pub use async_trait::async_trait; pub use async_trait::async_trait;
pub use instant; pub use instant;
#[cfg(feature = "appservice")]
pub use ruma::{
api::{appservice as api_appservice, IncomingRequest, OutgoingRequestAppserviceExt},
serde::{exports::serde::de::value::Error as SerdeError, urlencoded},
};
pub use ruma::{
api::{
client as api,
error::{
FromHttpRequestError, FromHttpResponseError, IntoHttpError, MatrixError, ServerError,
},
AuthScheme, EndpointError, IncomingResponse, OutgoingRequest, SendAccessToken,
},
assign, directory, encryption, events, identifiers, int, presence, push, receipt,
serde::{CanonicalJsonValue, Raw},
thirdparty, uint, Int, MilliSecondsSinceUnixEpoch, Outgoing, SecondsSinceUnixEpoch, UInt,
};
pub use uuid; pub use uuid;
pub mod deserialized_responses; pub mod deserialized_responses;