Refactor: delete unused crates (#2543)

* refactor: delete user model

* refactor: delete user model crate

* refactor: rm flowy-server-sync crate

* refactor: rm flowy-database and flowy-folder

* refactor: rm folder-model

* refactor: rm database model

* refactor: rm flowy-sync

* refactor: rm document-model

* refactor: rm flowy-document

* refactor: rm flowy-client-sync

* refactor: rm ws-model

* refactor: rm flowy-revisoin

* refactor: rm revision-model

* refactor: rm flowy-folder

* refactor: rm flowy-client-ws

* refactor: move crates

* chore: move configuration file

* ci: fix tauri build'

* ci: fix flutter build

* ci: rust test script

* ci: tauri pnpm version conflict

* ci: tauri build
This commit is contained in:
Nathan.fooo
2023-05-17 09:49:39 +08:00
committed by GitHub
parent 2202326278
commit bc66f43f47
514 changed files with 2274 additions and 55304 deletions

View File

@ -1,7 +1,8 @@
use flowy_derive::ProtoBuf_Enum;
use serde_repr::*;
use thiserror::Error;
use flowy_derive::ProtoBuf_Enum;
#[derive(Debug, Clone, PartialEq, Eq, Error, Serialize_repr, Deserialize_repr, ProtoBuf_Enum)]
#[repr(u8)]
pub enum ErrorCode {

View File

@ -1,8 +1,5 @@
#[cfg(feature = "adaptor_sync")]
pub mod sync;
#[cfg(feature = "adaptor_ot")]
pub mod ot;
// #[cfg(feature = "adaptor_ot")]
// pub mod ot;
#[cfg(feature = "adaptor_serde")]
pub mod serde;
@ -16,12 +13,6 @@ pub mod reqwest;
#[cfg(feature = "adaptor_database")]
pub mod database;
#[cfg(feature = "adaptor_ws")]
pub mod ws;
#[cfg(feature = "adaptor_user")]
pub mod user;
#[cfg(feature = "adaptor_server_error")]
pub mod http_server;

View File

@ -1,7 +0,0 @@
use crate::FlowyError;
impl std::convert::From<lib_ot::errors::OTError> for FlowyError {
fn from(error: lib_ot::errors::OTError) -> Self {
FlowyError::internal().context(error.msg)
}
}

View File

@ -1,12 +0,0 @@
use crate::FlowyError;
use flowy_client_sync::errors::ErrorCode;
impl std::convert::From<flowy_client_sync::errors::SyncError> for FlowyError {
fn from(error: flowy_client_sync::errors::SyncError) -> Self {
match error.code {
ErrorCode::RecordNotFound => FlowyError::record_not_found().context(error.msg),
_ => FlowyError::internal().context(error.msg),
}
}
}

View File

@ -1,27 +0,0 @@
use crate::code::ErrorCode;
use user_model::errors::UserErrorCode;
impl std::convert::From<UserErrorCode> for ErrorCode {
fn from(code: UserErrorCode) -> Self {
match code {
UserErrorCode::Internal => ErrorCode::Internal,
UserErrorCode::WorkspaceIdInvalid => ErrorCode::WorkspaceIdInvalid,
UserErrorCode::EmailIsEmpty => ErrorCode::EmailIsEmpty,
UserErrorCode::EmailFormatInvalid => ErrorCode::EmailFormatInvalid,
UserErrorCode::UserIdInvalid => ErrorCode::UserIdInvalid,
UserErrorCode::UserNameContainForbiddenCharacters => {
ErrorCode::UserNameContainForbiddenCharacters
},
UserErrorCode::UserNameIsEmpty => ErrorCode::UserNameIsEmpty,
UserErrorCode::UserNotExist => ErrorCode::UserNotExist,
UserErrorCode::PasswordIsEmpty => ErrorCode::PasswordIsEmpty,
UserErrorCode::PasswordTooLong => ErrorCode::PasswordTooLong,
UserErrorCode::PasswordContainsForbidCharacters => {
ErrorCode::PasswordContainsForbidCharacters
},
UserErrorCode::PasswordFormatInvalid => ErrorCode::PasswordFormatInvalid,
UserErrorCode::PasswordNotMatch => ErrorCode::PasswordNotMatch,
UserErrorCode::UserNameTooLong => ErrorCode::UserNameTooLong,
}
}
}

View File

@ -1,10 +0,0 @@
use crate::FlowyError;
use flowy_client_ws::WSErrorCode;
impl std::convert::From<WSErrorCode> for FlowyError {
fn from(code: WSErrorCode) -> Self {
match code {
WSErrorCode::Internal => FlowyError::internal().context(code),
}
}
}