diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 45622458a5..3d7e98dffd 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -456,13 +456,13 @@ dependencies = [ "dashmap", "derive_more", "flowy-collaboration", - "flowy-core-infra", + "flowy-core-data-model", "flowy-document", "flowy-net", "flowy-sdk", "flowy-test", "flowy-user", - "flowy-user-infra", + "flowy-user-data-model", "futures", "futures-core", "futures-util", @@ -508,8 +508,8 @@ dependencies = [ "config", "derive_more", "flowy-collaboration", - "flowy-core-infra", - "flowy-user-infra", + "flowy-core-data-model", + "flowy-user-data-model", "hyper", "lazy_static", "log", @@ -1246,7 +1246,7 @@ dependencies = [ "diesel", "diesel_derives", "flowy-collaboration", - "flowy-core-infra", + "flowy-core-data-model", "flowy-database", "flowy-derive", "flowy-document", @@ -1271,7 +1271,7 @@ dependencies = [ ] [[package]] -name = "flowy-core-infra" +name = "flowy-core-data-model" version = "0.1.0" dependencies = [ "bytes", @@ -1453,7 +1453,7 @@ dependencies = [ "flowy-derive", "flowy-error", "flowy-net", - "flowy-user-infra", + "flowy-user-data-model", "futures-core", "lazy_static", "lib-dispatch", @@ -1476,7 +1476,7 @@ dependencies = [ ] [[package]] -name = "flowy-user-infra" +name = "flowy-user-data-model" version = "0.1.0" dependencies = [ "bytes", diff --git a/backend/Cargo.toml b/backend/Cargo.toml index defc585ff0..95662e4223 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -59,8 +59,8 @@ pin-project = "1.0.0" byteorder = {version = "1.3.4"} async-stream = "0.3.2" -flowy-user-infra = { path = "../shared-lib/flowy-user-infra" } -flowy-core-infra = { path = "../shared-lib/flowy-core-infra" } +flowy-user-data-model = { path = "../shared-lib/flowy-user-data-model" } +flowy-core-data-model = { path = "../shared-lib/flowy-core-data-model" } flowy-collaboration = { path = "../shared-lib/flowy-collaboration" } lib-ws = { path = "../shared-lib/lib-ws" } lib-ot = { path = "../shared-lib/lib-ot" } diff --git a/backend/src/entities/workspace.rs b/backend/src/entities/workspace.rs index 689ab68271..605d61c89f 100644 --- a/backend/src/entities/workspace.rs +++ b/backend/src/entities/workspace.rs @@ -1,5 +1,5 @@ use chrono::Utc; -use flowy_core_infra::protobuf::{App, RepeatedView, Trash, TrashType, View, ViewType, Workspace}; +use flowy_core_data_model::protobuf::{App, RepeatedView, Trash, TrashType, View, ViewType, Workspace}; use protobuf::ProtobufEnum; pub(crate) const WORKSPACE_TABLE: &str = "workspace_table"; diff --git a/backend/src/services/app/app.rs b/backend/src/services/app/app.rs index 2f3f41e762..10a74cc33a 100644 --- a/backend/src/services/app/app.rs +++ b/backend/src/services/app/app.rs @@ -7,7 +7,7 @@ use crate::{ use crate::services::trash::read_trash_ids; use backend_service::errors::{invalid_params, ServerError}; use chrono::Utc; -use flowy_core_infra::{ +use flowy_core_data_model::{ parser::{ app::{AppDesc, AppName}, workspace::WorkspaceId, diff --git a/backend/src/services/app/router.rs b/backend/src/services/app/router.rs index aa9820d06b..572ab49255 100644 --- a/backend/src/services/app/router.rs +++ b/backend/src/services/app/router.rs @@ -3,7 +3,7 @@ use actix_web::{ HttpResponse, }; use backend_service::errors::{invalid_params, ServerError}; -use flowy_core_infra::protobuf::{AppIdentifier, CreateAppParams, UpdateAppParams}; +use flowy_core_data_model::protobuf::{AppIdentifier, CreateAppParams, UpdateAppParams}; use protobuf::Message; use sqlx::PgPool; @@ -17,7 +17,7 @@ use crate::services::{ }; use anyhow::Context; use backend_service::response::FlowyResponse; -use flowy_core_infra::parser::app::{AppDesc, AppName}; +use flowy_core_data_model::parser::app::{AppDesc, AppName}; pub async fn create_handler( payload: Payload, diff --git a/backend/src/services/app/sql_builder.rs b/backend/src/services/app/sql_builder.rs index 7fb6b2bcad..97d17d469b 100644 --- a/backend/src/services/app/sql_builder.rs +++ b/backend/src/services/app/sql_builder.rs @@ -4,7 +4,7 @@ use crate::{ }; use backend_service::errors::{invalid_params, ServerError}; use chrono::{DateTime, NaiveDateTime, Utc}; -use flowy_core_infra::{ +use flowy_core_data_model::{ parser::app::AppId, protobuf::{App, ColorStyle}, }; diff --git a/backend/src/services/trash/router.rs b/backend/src/services/trash/router.rs index 6233e33fec..3d19a24bbf 100644 --- a/backend/src/services/trash/router.rs +++ b/backend/src/services/trash/router.rs @@ -13,7 +13,7 @@ use backend_service::{ errors::{invalid_params, ServerError}, response::FlowyResponse, }; -use flowy_core_infra::{parser::trash::TrashId, protobuf::TrashIdentifiers}; +use flowy_core_data_model::{parser::trash::TrashId, protobuf::TrashIdentifiers}; use sqlx::PgPool; use uuid::Uuid; diff --git a/backend/src/services/trash/trash.rs b/backend/src/services/trash/trash.rs index ddecb66d61..d71913ef99 100644 --- a/backend/src/services/trash/trash.rs +++ b/backend/src/services/trash/trash.rs @@ -9,7 +9,7 @@ use crate::{ }; use ::protobuf::ProtobufEnum; use backend_service::errors::ServerError; -use flowy_core_infra::protobuf::{RepeatedTrash, Trash, TrashType}; +use flowy_core_data_model::protobuf::{RepeatedTrash, Trash, TrashType}; use sqlx::{postgres::PgArguments, Postgres, Row}; use uuid::Uuid; diff --git a/backend/src/services/user/auth.rs b/backend/src/services/user/auth.rs index 16e8367940..ed69a95826 100644 --- a/backend/src/services/user/auth.rs +++ b/backend/src/services/user/auth.rs @@ -9,7 +9,7 @@ use backend_service::{ response::FlowyResponse, }; use chrono::Utc; -use flowy_user_infra::{ +use flowy_user_data_model::{ parser::{UserEmail, UserName, UserPassword}, protobuf::{SignInParams, SignInResponse, SignUpParams, SignUpResponse, UpdateUserParams, UserProfile}, }; diff --git a/backend/src/services/user/router.rs b/backend/src/services/user/router.rs index b13d4c5e95..c4f6c18c59 100644 --- a/backend/src/services/user/router.rs +++ b/backend/src/services/user/router.rs @@ -7,7 +7,7 @@ use actix_web::{ use sqlx::PgPool; use backend_service::{errors::ServerError, response::FlowyResponse}; -use flowy_user_infra::protobuf::{SignInParams, SignUpParams, UpdateUserParams}; +use flowy_user_data_model::protobuf::{SignInParams, SignUpParams, UpdateUserParams}; use crate::{ entities::token::Token, diff --git a/backend/src/services/user/user_default.rs b/backend/src/services/user/user_default.rs index 477cc600fb..79fa24f86e 100644 --- a/backend/src/services/user/user_default.rs +++ b/backend/src/services/user/user_default.rs @@ -10,7 +10,7 @@ use crate::services::view::{create_view_with_args, sql_builder::NewViewSqlBuilde use backend_service::errors::ServerError; use chrono::Utc; use flowy_collaboration::core::document::default::initial_string; -use flowy_core_infra::protobuf::Workspace; +use flowy_core_data_model::protobuf::Workspace; use std::convert::TryInto; #[allow(dead_code)] @@ -19,7 +19,7 @@ pub async fn create_default_workspace( user_id: &str, ) -> Result { let time = Utc::now(); - let workspace: Workspace = flowy_core_infra::user_default::create_default_workspace(time) + let workspace: Workspace = flowy_core_data_model::user_default::create_default_workspace(time) .try_into() .unwrap(); diff --git a/backend/src/services/view/router.rs b/backend/src/services/view/router.rs index 0cbd7f44ac..d165d3635b 100644 --- a/backend/src/services/view/router.rs +++ b/backend/src/services/view/router.rs @@ -13,7 +13,7 @@ use backend_service::{ errors::{invalid_params, ServerError}, response::FlowyResponse, }; -use flowy_core_infra::{ +use flowy_core_data_model::{ parser::view::{ViewDesc, ViewName, ViewThumbnail}, protobuf::{CreateViewParams, QueryViewRequest, UpdateViewParams, ViewIdentifier}, }; diff --git a/backend/src/services/view/sql_builder.rs b/backend/src/services/view/sql_builder.rs index 6fc935d5cb..77e9501bd2 100644 --- a/backend/src/services/view/sql_builder.rs +++ b/backend/src/services/view/sql_builder.rs @@ -4,7 +4,7 @@ use crate::{ }; use backend_service::errors::{invalid_params, ServerError}; use chrono::{DateTime, NaiveDateTime, Utc}; -use flowy_core_infra::{ +use flowy_core_data_model::{ parser::view::ViewId, protobuf::{View, ViewType}, }; diff --git a/backend/src/services/view/view.rs b/backend/src/services/view/view.rs index 5dd1055d0e..9f7c6b161a 100644 --- a/backend/src/services/view/view.rs +++ b/backend/src/services/view/view.rs @@ -11,7 +11,7 @@ use crate::{ use backend_service::errors::{invalid_params, ServerError}; use chrono::Utc; use flowy_collaboration::protobuf::CreateDocParams; -use flowy_core_infra::{ +use flowy_core_data_model::{ parser::{ app::AppId, view::{ViewDesc, ViewName, ViewThumbnail}, diff --git a/backend/src/services/workspace/router.rs b/backend/src/services/workspace/router.rs index 984a713bcb..9e8050db4e 100644 --- a/backend/src/services/workspace/router.rs +++ b/backend/src/services/workspace/router.rs @@ -18,7 +18,7 @@ use backend_service::{ errors::{invalid_params, ServerError}, response::FlowyResponse, }; -use flowy_core_infra::{ +use flowy_core_data_model::{ parser::workspace::{WorkspaceDesc, WorkspaceName}, protobuf::{CreateWorkspaceParams, UpdateWorkspaceParams, WorkspaceIdentifier}, }; diff --git a/backend/src/services/workspace/sql_builder.rs b/backend/src/services/workspace/sql_builder.rs index 9f198d6234..e8e55bb6a8 100644 --- a/backend/src/services/workspace/sql_builder.rs +++ b/backend/src/services/workspace/sql_builder.rs @@ -4,7 +4,7 @@ use crate::{ }; use backend_service::errors::{invalid_params, ServerError}; use chrono::{DateTime, NaiveDateTime, Utc}; -use flowy_core_infra::{parser::workspace::WorkspaceId, protobuf::Workspace}; +use flowy_core_data_model::{parser::workspace::WorkspaceId, protobuf::Workspace}; use sqlx::postgres::PgArguments; use uuid::Uuid; diff --git a/backend/src/services/workspace/workspace.rs b/backend/src/services/workspace/workspace.rs index 39a419c6fb..81bc051a11 100644 --- a/backend/src/services/workspace/workspace.rs +++ b/backend/src/services/workspace/workspace.rs @@ -6,7 +6,7 @@ use crate::{ }; use anyhow::Context; use backend_service::errors::{invalid_params, ServerError}; -use flowy_core_infra::{ +use flowy_core_data_model::{ parser::workspace::WorkspaceId, protobuf::{RepeatedApp, RepeatedWorkspace, Workspace}, }; diff --git a/backend/tests/api/auth.rs b/backend/tests/api/auth.rs index a2772fff3d..3b98a8a947 100644 --- a/backend/tests/api/auth.rs +++ b/backend/tests/api/auth.rs @@ -1,6 +1,6 @@ use crate::util::helper::{spawn_user_server, TestUserServer}; use backend_service::errors::ErrorCode; -use flowy_user_infra::entities::{SignInParams, SignUpParams, SignUpResponse, UpdateUserParams}; +use flowy_user_data_model::entities::{SignInParams, SignUpParams, SignUpResponse, UpdateUserParams}; #[actix_rt::test] async fn user_register() { diff --git a/backend/tests/api/doc.rs b/backend/tests/api/doc.rs index 83b5d71285..ce7b753442 100644 --- a/backend/tests/api/doc.rs +++ b/backend/tests/api/doc.rs @@ -1,6 +1,6 @@ use crate::util::helper::ViewTest; use flowy_collaboration::entities::doc::DocIdentifier; -use flowy_core_infra::entities::view::ViewIdentifiers; +use flowy_core_data_model::entities::view::ViewIdentifiers; #[actix_rt::test] async fn doc_read() { diff --git a/backend/tests/api/workspace.rs b/backend/tests/api/workspace.rs index abfb6294c0..741d1da2fd 100644 --- a/backend/tests/api/workspace.rs +++ b/backend/tests/api/workspace.rs @@ -1,6 +1,6 @@ #![allow(clippy::all)] use crate::util::helper::*; -use flowy_core_infra::entities::{ +use flowy_core_data_model::entities::{ app::{AppIdentifier, UpdateAppParams}, trash::{TrashIdentifier, TrashIdentifiers, TrashType}, view::{UpdateViewParams, ViewIdentifier}, diff --git a/backend/tests/util/helper.rs b/backend/tests/util/helper.rs index 42438bbb41..39fe680a7e 100644 --- a/backend/tests/util/helper.rs +++ b/backend/tests/util/helper.rs @@ -10,9 +10,9 @@ use backend_service::{ workspace_request::*, }; use flowy_collaboration::entities::doc::{Doc, DocIdentifier}; -use flowy_core_infra::entities::prelude::*; +use flowy_core_data_model::entities::prelude::*; use flowy_document::services::server::read_doc_request; -use flowy_user_infra::entities::*; +use flowy_user_data_model::entities::*; use sqlx::{Connection, Executor, PgConnection, PgPool}; use uuid::Uuid; diff --git a/frontend/app_flowy/ios/Runner.xcodeproj/project.pbxproj b/frontend/app_flowy/ios/Runner.xcodeproj/project.pbxproj index 48c4dd313d..c5e6758eb6 100644 --- a/frontend/app_flowy/ios/Runner.xcodeproj/project.pbxproj +++ b/frontend/app_flowy/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ @@ -156,7 +156,7 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1020; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 97C146ED1CF9000F007C117D = { diff --git a/frontend/app_flowy/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/frontend/app_flowy/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index a28140cfdb..3db53b6e1f 100644 --- a/frontend/app_flowy/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/frontend/app_flowy/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ HttpRequestBuilder { HttpRequestBuilder::new().middleware(crate::middleware::BACKEND_API_MIDDLEWARE.clone()) diff --git a/shared-lib/backend-service/src/workspace_request.rs b/shared-lib/backend-service/src/workspace_request.rs index 8aa1ad640a..02c4cfdc11 100644 --- a/shared-lib/backend-service/src/workspace_request.rs +++ b/shared-lib/backend-service/src/workspace_request.rs @@ -1,5 +1,5 @@ use crate::{configuration::HEADER_TOKEN, errors::ServerError, request::HttpRequestBuilder}; -use flowy_core_infra::entities::prelude::*; +use flowy_core_data_model::entities::prelude::*; pub(crate) fn request_builder() -> HttpRequestBuilder { HttpRequestBuilder::new().middleware(crate::middleware::BACKEND_API_MIDDLEWARE.clone()) diff --git a/shared-lib/flowy-core-infra/Cargo.toml b/shared-lib/flowy-core-data-model/Cargo.toml similarity index 93% rename from shared-lib/flowy-core-infra/Cargo.toml rename to shared-lib/flowy-core-data-model/Cargo.toml index e3420abe0a..3b0b97b052 100644 --- a/shared-lib/flowy-core-infra/Cargo.toml +++ b/shared-lib/flowy-core-data-model/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "flowy-core-infra" +name = "flowy-core-data-model" version = "0.1.0" edition = "2018" diff --git a/shared-lib/flowy-core-infra/Flowy.toml b/shared-lib/flowy-core-data-model/Flowy.toml similarity index 100% rename from shared-lib/flowy-core-infra/Flowy.toml rename to shared-lib/flowy-core-data-model/Flowy.toml diff --git a/shared-lib/flowy-core-infra/src/entities/app/app_create.rs b/shared-lib/flowy-core-data-model/src/entities/app/app_create.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/app/app_create.rs rename to shared-lib/flowy-core-data-model/src/entities/app/app_create.rs diff --git a/shared-lib/flowy-core-infra/src/entities/app/app_query.rs b/shared-lib/flowy-core-data-model/src/entities/app/app_query.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/app/app_query.rs rename to shared-lib/flowy-core-data-model/src/entities/app/app_query.rs diff --git a/shared-lib/flowy-core-infra/src/entities/app/app_update.rs b/shared-lib/flowy-core-data-model/src/entities/app/app_update.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/app/app_update.rs rename to shared-lib/flowy-core-data-model/src/entities/app/app_update.rs diff --git a/shared-lib/flowy-core-infra/src/entities/app/mod.rs b/shared-lib/flowy-core-data-model/src/entities/app/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/app/mod.rs rename to shared-lib/flowy-core-data-model/src/entities/app/mod.rs diff --git a/shared-lib/flowy-core-infra/src/entities/mod.rs b/shared-lib/flowy-core-data-model/src/entities/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/mod.rs rename to shared-lib/flowy-core-data-model/src/entities/mod.rs diff --git a/shared-lib/flowy-core-infra/src/entities/share/export.rs b/shared-lib/flowy-core-data-model/src/entities/share/export.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/share/export.rs rename to shared-lib/flowy-core-data-model/src/entities/share/export.rs diff --git a/shared-lib/flowy-core-infra/src/entities/share/mod.rs b/shared-lib/flowy-core-data-model/src/entities/share/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/share/mod.rs rename to shared-lib/flowy-core-data-model/src/entities/share/mod.rs diff --git a/shared-lib/flowy-core-infra/src/entities/trash/mod.rs b/shared-lib/flowy-core-data-model/src/entities/trash/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/trash/mod.rs rename to shared-lib/flowy-core-data-model/src/entities/trash/mod.rs diff --git a/shared-lib/flowy-core-infra/src/entities/trash/trash_create.rs b/shared-lib/flowy-core-data-model/src/entities/trash/trash_create.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/trash/trash_create.rs rename to shared-lib/flowy-core-data-model/src/entities/trash/trash_create.rs diff --git a/shared-lib/flowy-core-infra/src/entities/view/mod.rs b/shared-lib/flowy-core-data-model/src/entities/view/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/view/mod.rs rename to shared-lib/flowy-core-data-model/src/entities/view/mod.rs diff --git a/shared-lib/flowy-core-infra/src/entities/view/view_create.rs b/shared-lib/flowy-core-data-model/src/entities/view/view_create.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/view/view_create.rs rename to shared-lib/flowy-core-data-model/src/entities/view/view_create.rs diff --git a/shared-lib/flowy-core-infra/src/entities/view/view_query.rs b/shared-lib/flowy-core-data-model/src/entities/view/view_query.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/view/view_query.rs rename to shared-lib/flowy-core-data-model/src/entities/view/view_query.rs diff --git a/shared-lib/flowy-core-infra/src/entities/view/view_update.rs b/shared-lib/flowy-core-data-model/src/entities/view/view_update.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/view/view_update.rs rename to shared-lib/flowy-core-data-model/src/entities/view/view_update.rs diff --git a/shared-lib/flowy-core-infra/src/entities/workspace/mod.rs b/shared-lib/flowy-core-data-model/src/entities/workspace/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/workspace/mod.rs rename to shared-lib/flowy-core-data-model/src/entities/workspace/mod.rs diff --git a/shared-lib/flowy-core-infra/src/entities/workspace/workspace_create.rs b/shared-lib/flowy-core-data-model/src/entities/workspace/workspace_create.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/workspace/workspace_create.rs rename to shared-lib/flowy-core-data-model/src/entities/workspace/workspace_create.rs diff --git a/shared-lib/flowy-core-infra/src/entities/workspace/workspace_query.rs b/shared-lib/flowy-core-data-model/src/entities/workspace/workspace_query.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/workspace/workspace_query.rs rename to shared-lib/flowy-core-data-model/src/entities/workspace/workspace_query.rs diff --git a/shared-lib/flowy-core-infra/src/entities/workspace/workspace_setting.rs b/shared-lib/flowy-core-data-model/src/entities/workspace/workspace_setting.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/workspace/workspace_setting.rs rename to shared-lib/flowy-core-data-model/src/entities/workspace/workspace_setting.rs diff --git a/shared-lib/flowy-core-infra/src/entities/workspace/workspace_update.rs b/shared-lib/flowy-core-data-model/src/entities/workspace/workspace_update.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/entities/workspace/workspace_update.rs rename to shared-lib/flowy-core-data-model/src/entities/workspace/workspace_update.rs diff --git a/shared-lib/flowy-core-infra/src/lib.rs b/shared-lib/flowy-core-data-model/src/lib.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/lib.rs rename to shared-lib/flowy-core-data-model/src/lib.rs diff --git a/shared-lib/flowy-core-infra/src/macros.rs b/shared-lib/flowy-core-data-model/src/macros.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/macros.rs rename to shared-lib/flowy-core-data-model/src/macros.rs diff --git a/shared-lib/flowy-core-infra/src/parser/app/app_color_style.rs b/shared-lib/flowy-core-data-model/src/parser/app/app_color_style.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/app/app_color_style.rs rename to shared-lib/flowy-core-data-model/src/parser/app/app_color_style.rs diff --git a/shared-lib/flowy-core-infra/src/parser/app/app_desc.rs b/shared-lib/flowy-core-data-model/src/parser/app/app_desc.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/app/app_desc.rs rename to shared-lib/flowy-core-data-model/src/parser/app/app_desc.rs diff --git a/shared-lib/flowy-core-infra/src/parser/app/app_id.rs b/shared-lib/flowy-core-data-model/src/parser/app/app_id.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/app/app_id.rs rename to shared-lib/flowy-core-data-model/src/parser/app/app_id.rs diff --git a/shared-lib/flowy-core-infra/src/parser/app/app_name.rs b/shared-lib/flowy-core-data-model/src/parser/app/app_name.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/app/app_name.rs rename to shared-lib/flowy-core-data-model/src/parser/app/app_name.rs diff --git a/shared-lib/flowy-core-infra/src/parser/app/mod.rs b/shared-lib/flowy-core-data-model/src/parser/app/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/app/mod.rs rename to shared-lib/flowy-core-data-model/src/parser/app/mod.rs diff --git a/shared-lib/flowy-core-infra/src/parser/mod.rs b/shared-lib/flowy-core-data-model/src/parser/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/mod.rs rename to shared-lib/flowy-core-data-model/src/parser/mod.rs diff --git a/shared-lib/flowy-core-infra/src/parser/trash/mod.rs b/shared-lib/flowy-core-data-model/src/parser/trash/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/trash/mod.rs rename to shared-lib/flowy-core-data-model/src/parser/trash/mod.rs diff --git a/shared-lib/flowy-core-infra/src/parser/trash/trash_id.rs b/shared-lib/flowy-core-data-model/src/parser/trash/trash_id.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/trash/trash_id.rs rename to shared-lib/flowy-core-data-model/src/parser/trash/trash_id.rs diff --git a/shared-lib/flowy-core-infra/src/parser/view/delta_data.rs b/shared-lib/flowy-core-data-model/src/parser/view/delta_data.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/view/delta_data.rs rename to shared-lib/flowy-core-data-model/src/parser/view/delta_data.rs diff --git a/shared-lib/flowy-core-infra/src/parser/view/mod.rs b/shared-lib/flowy-core-data-model/src/parser/view/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/view/mod.rs rename to shared-lib/flowy-core-data-model/src/parser/view/mod.rs diff --git a/shared-lib/flowy-core-infra/src/parser/view/view_desc.rs b/shared-lib/flowy-core-data-model/src/parser/view/view_desc.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/view/view_desc.rs rename to shared-lib/flowy-core-data-model/src/parser/view/view_desc.rs diff --git a/shared-lib/flowy-core-infra/src/parser/view/view_id.rs b/shared-lib/flowy-core-data-model/src/parser/view/view_id.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/view/view_id.rs rename to shared-lib/flowy-core-data-model/src/parser/view/view_id.rs diff --git a/shared-lib/flowy-core-infra/src/parser/view/view_name.rs b/shared-lib/flowy-core-data-model/src/parser/view/view_name.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/view/view_name.rs rename to shared-lib/flowy-core-data-model/src/parser/view/view_name.rs diff --git a/shared-lib/flowy-core-infra/src/parser/view/view_thumbnail.rs b/shared-lib/flowy-core-data-model/src/parser/view/view_thumbnail.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/view/view_thumbnail.rs rename to shared-lib/flowy-core-data-model/src/parser/view/view_thumbnail.rs diff --git a/shared-lib/flowy-core-infra/src/parser/workspace/mod.rs b/shared-lib/flowy-core-data-model/src/parser/workspace/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/workspace/mod.rs rename to shared-lib/flowy-core-data-model/src/parser/workspace/mod.rs diff --git a/shared-lib/flowy-core-infra/src/parser/workspace/workspace_desc.rs b/shared-lib/flowy-core-data-model/src/parser/workspace/workspace_desc.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/workspace/workspace_desc.rs rename to shared-lib/flowy-core-data-model/src/parser/workspace/workspace_desc.rs diff --git a/shared-lib/flowy-core-infra/src/parser/workspace/workspace_id.rs b/shared-lib/flowy-core-data-model/src/parser/workspace/workspace_id.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/workspace/workspace_id.rs rename to shared-lib/flowy-core-data-model/src/parser/workspace/workspace_id.rs diff --git a/shared-lib/flowy-core-infra/src/parser/workspace/workspace_name.rs b/shared-lib/flowy-core-data-model/src/parser/workspace/workspace_name.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/parser/workspace/workspace_name.rs rename to shared-lib/flowy-core-data-model/src/parser/workspace/workspace_name.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/mod.rs b/shared-lib/flowy-core-data-model/src/protobuf/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/mod.rs rename to shared-lib/flowy-core-data-model/src/protobuf/mod.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/app_create.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/app_create.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/app_create.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/app_create.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/app_query.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/app_query.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/app_query.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/app_query.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/app_update.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/app_update.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/app_update.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/app_update.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/errors.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/errors.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/errors.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/errors.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/export.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/export.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/export.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/export.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/mod.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/mod.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/mod.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/mod.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/trash_create.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/trash_create.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/trash_create.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/trash_create.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/view_create.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/view_create.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/view_create.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/view_create.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/view_query.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/view_query.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/view_query.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/view_query.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/view_update.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/view_update.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/view_update.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/view_update.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/workspace_create.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/workspace_create.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/workspace_create.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/workspace_create.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/workspace_query.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/workspace_query.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/workspace_query.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/workspace_query.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/workspace_setting.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/workspace_setting.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/workspace_setting.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/workspace_setting.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/model/workspace_update.rs b/shared-lib/flowy-core-data-model/src/protobuf/model/workspace_update.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/model/workspace_update.rs rename to shared-lib/flowy-core-data-model/src/protobuf/model/workspace_update.rs diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/app_create.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/app_create.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/app_create.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/app_create.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/app_query.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/app_query.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/app_query.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/app_query.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/app_update.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/app_update.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/app_update.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/app_update.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/errors.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/errors.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/errors.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/errors.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/export.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/export.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/export.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/export.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/trash_create.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/trash_create.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/trash_create.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/trash_create.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/view_create.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/view_create.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/view_create.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/view_create.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/view_query.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/view_query.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/view_query.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/view_query.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/view_update.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/view_update.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/view_update.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/view_update.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/workspace_create.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/workspace_create.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/workspace_create.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/workspace_create.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/workspace_query.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/workspace_query.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/workspace_query.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/workspace_query.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/workspace_setting.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/workspace_setting.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/workspace_setting.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/workspace_setting.proto diff --git a/shared-lib/flowy-core-infra/src/protobuf/proto/workspace_update.proto b/shared-lib/flowy-core-data-model/src/protobuf/proto/workspace_update.proto similarity index 100% rename from shared-lib/flowy-core-infra/src/protobuf/proto/workspace_update.proto rename to shared-lib/flowy-core-data-model/src/protobuf/proto/workspace_update.proto diff --git a/shared-lib/flowy-core-infra/src/user_default.rs b/shared-lib/flowy-core-data-model/src/user_default.rs similarity index 100% rename from shared-lib/flowy-core-infra/src/user_default.rs rename to shared-lib/flowy-core-data-model/src/user_default.rs diff --git a/shared-lib/flowy-derive/src/derive_cache/derive_cache.rs b/shared-lib/flowy-derive/src/derive_cache/derive_cache.rs index f37c5353c4..5f7896e8b9 100644 --- a/shared-lib/flowy-derive/src/derive_cache/derive_cache.rs +++ b/shared-lib/flowy-derive/src/derive_cache/derive_cache.rs @@ -21,6 +21,24 @@ pub fn category_from_str(type_str: &str) -> TypeCategory { | "FlowyError" | "SubscribeObject" | "NetworkState" + | "SignInRequest" + | "SignInParams" + | "SignInResponse" + | "SignUpRequest" + | "SignUpParams" + | "SignUpResponse" + | "UserToken" + | "UserProfile" + | "UpdateUserRequest" + | "UpdateUserParams" + | "CreateDocParams" + | "Doc" + | "UpdateDocParams" + | "DocDelta" + | "NewDocUser" + | "DocIdentifier" + | "DocumentWSData" + | "NewDocumentUser" | "QueryAppRequest" | "AppIdentifier" | "CreateAppRequest" @@ -54,29 +72,11 @@ pub fn category_from_str(type_str: &str) -> TypeCategory { | "RepeatedView" | "ExportRequest" | "ExportData" - | "CreateDocParams" - | "Doc" - | "UpdateDocParams" - | "DocDelta" - | "NewDocUser" - | "DocIdentifier" - | "DocumentWSData" - | "NewDocumentUser" | "WSError" | "WSMessage" | "Revision" | "RevId" | "RevisionRange" - | "SignInRequest" - | "SignInParams" - | "SignInResponse" - | "SignUpRequest" - | "SignUpParams" - | "SignUpResponse" - | "UserToken" - | "UserProfile" - | "UpdateUserRequest" - | "UpdateUserParams" => TypeCategory::Protobuf, "WorkspaceEvent" | "WorkspaceNotification" @@ -86,10 +86,10 @@ pub fn category_from_str(type_str: &str) -> TypeCategory { | "NetworkType" | "UserEvent" | "UserNotification" + | "DocumentWSDataType" | "TrashType" | "ViewType" | "ExportType" - | "DocumentWSDataType" | "ErrorCode" | "WSModule" | "RevType" diff --git a/shared-lib/flowy-user-infra/Cargo.toml b/shared-lib/flowy-user-data-model/Cargo.toml similarity index 91% rename from shared-lib/flowy-user-infra/Cargo.toml rename to shared-lib/flowy-user-data-model/Cargo.toml index 5e0afba7c9..1765d05d11 100644 --- a/shared-lib/flowy-user-infra/Cargo.toml +++ b/shared-lib/flowy-user-data-model/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "flowy-user-infra" +name = "flowy-user-data-model" version = "0.1.0" edition = "2018" diff --git a/shared-lib/flowy-user-infra/Flowy.toml b/shared-lib/flowy-user-data-model/Flowy.toml similarity index 100% rename from shared-lib/flowy-user-infra/Flowy.toml rename to shared-lib/flowy-user-data-model/Flowy.toml diff --git a/shared-lib/flowy-user-infra/src/entities/auth.rs b/shared-lib/flowy-user-data-model/src/entities/auth.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/entities/auth.rs rename to shared-lib/flowy-user-data-model/src/entities/auth.rs diff --git a/shared-lib/flowy-user-infra/src/entities/mod.rs b/shared-lib/flowy-user-data-model/src/entities/mod.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/entities/mod.rs rename to shared-lib/flowy-user-data-model/src/entities/mod.rs diff --git a/shared-lib/flowy-user-infra/src/entities/user_profile.rs b/shared-lib/flowy-user-data-model/src/entities/user_profile.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/entities/user_profile.rs rename to shared-lib/flowy-user-data-model/src/entities/user_profile.rs diff --git a/shared-lib/flowy-user-infra/src/lib.rs b/shared-lib/flowy-user-data-model/src/lib.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/lib.rs rename to shared-lib/flowy-user-data-model/src/lib.rs diff --git a/shared-lib/flowy-user-infra/src/parser/mod.rs b/shared-lib/flowy-user-data-model/src/parser/mod.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/parser/mod.rs rename to shared-lib/flowy-user-data-model/src/parser/mod.rs diff --git a/shared-lib/flowy-user-infra/src/parser/user_email.rs b/shared-lib/flowy-user-data-model/src/parser/user_email.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/parser/user_email.rs rename to shared-lib/flowy-user-data-model/src/parser/user_email.rs diff --git a/shared-lib/flowy-user-infra/src/parser/user_id.rs b/shared-lib/flowy-user-data-model/src/parser/user_id.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/parser/user_id.rs rename to shared-lib/flowy-user-data-model/src/parser/user_id.rs diff --git a/shared-lib/flowy-user-infra/src/parser/user_name.rs b/shared-lib/flowy-user-data-model/src/parser/user_name.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/parser/user_name.rs rename to shared-lib/flowy-user-data-model/src/parser/user_name.rs diff --git a/shared-lib/flowy-user-infra/src/parser/user_password.rs b/shared-lib/flowy-user-data-model/src/parser/user_password.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/parser/user_password.rs rename to shared-lib/flowy-user-data-model/src/parser/user_password.rs diff --git a/shared-lib/flowy-user-infra/src/parser/user_workspace.rs b/shared-lib/flowy-user-data-model/src/parser/user_workspace.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/parser/user_workspace.rs rename to shared-lib/flowy-user-data-model/src/parser/user_workspace.rs diff --git a/shared-lib/flowy-user-infra/src/protobuf/mod.rs b/shared-lib/flowy-user-data-model/src/protobuf/mod.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/protobuf/mod.rs rename to shared-lib/flowy-user-data-model/src/protobuf/mod.rs diff --git a/shared-lib/flowy-user-infra/src/protobuf/model/auth.rs b/shared-lib/flowy-user-data-model/src/protobuf/model/auth.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/protobuf/model/auth.rs rename to shared-lib/flowy-user-data-model/src/protobuf/model/auth.rs diff --git a/shared-lib/flowy-user-infra/src/protobuf/model/errors.rs b/shared-lib/flowy-user-data-model/src/protobuf/model/errors.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/protobuf/model/errors.rs rename to shared-lib/flowy-user-data-model/src/protobuf/model/errors.rs diff --git a/shared-lib/flowy-user-infra/src/protobuf/model/mod.rs b/shared-lib/flowy-user-data-model/src/protobuf/model/mod.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/protobuf/model/mod.rs rename to shared-lib/flowy-user-data-model/src/protobuf/model/mod.rs diff --git a/shared-lib/flowy-user-infra/src/protobuf/model/user_profile.rs b/shared-lib/flowy-user-data-model/src/protobuf/model/user_profile.rs similarity index 100% rename from shared-lib/flowy-user-infra/src/protobuf/model/user_profile.rs rename to shared-lib/flowy-user-data-model/src/protobuf/model/user_profile.rs diff --git a/shared-lib/flowy-user-infra/src/protobuf/proto/auth.proto b/shared-lib/flowy-user-data-model/src/protobuf/proto/auth.proto similarity index 100% rename from shared-lib/flowy-user-infra/src/protobuf/proto/auth.proto rename to shared-lib/flowy-user-data-model/src/protobuf/proto/auth.proto diff --git a/shared-lib/flowy-user-infra/src/protobuf/proto/errors.proto b/shared-lib/flowy-user-data-model/src/protobuf/proto/errors.proto similarity index 100% rename from shared-lib/flowy-user-infra/src/protobuf/proto/errors.proto rename to shared-lib/flowy-user-data-model/src/protobuf/proto/errors.proto diff --git a/shared-lib/flowy-user-infra/src/protobuf/proto/user_profile.proto b/shared-lib/flowy-user-data-model/src/protobuf/proto/user_profile.proto similarity index 100% rename from shared-lib/flowy-user-infra/src/protobuf/proto/user_profile.proto rename to shared-lib/flowy-user-data-model/src/protobuf/proto/user_profile.proto