Merge pull request #589 from AppFlowy-IO/refactor/user_data_model

This commit is contained in:
Nathan.fooo 2022-07-04 18:31:28 +08:00 committed by GitHub
commit a6c001941e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
56 changed files with 73 additions and 248 deletions

View File

@ -15,7 +15,7 @@ import 'package:app_flowy/workspace/presentation/home/home_stack.dart';
import 'package:app_flowy/workspace/presentation/home/menu/menu.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/app.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/view.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:fluttertoast/fluttertoast.dart';
import 'package:get_it/get_it.dart';

View File

@ -1,6 +1,6 @@
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show SignInPayload, SignUpPayload, UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show SignInPayload, SignUpPayload, UserProfile;
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
class AuthService {

View File

@ -2,7 +2,7 @@ import 'package:app_flowy/user/application/auth_service.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/protobuf/flowy-error-code/code.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

View File

@ -2,7 +2,7 @@ import 'package:app_flowy/user/application/auth_service.dart';
import 'package:dartz/dartz.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flowy_sdk/protobuf/flowy-error-code/code.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

View File

@ -9,7 +9,7 @@ import 'dart:typed_data';
import 'package:flowy_infra/notifier.dart';
import 'package:flowy_sdk/protobuf/dart-notify/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/dart_notification.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/dart_notification.pb.dart' as user;
import 'package:flowy_sdk/rust_stream.dart';

View File

@ -4,7 +4,7 @@ import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/workspace.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
class UserService {
final String userId;

View File

@ -2,7 +2,7 @@ import 'package:dartz/dartz.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/flowy_sdk.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/user_setting.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_setting.pb.dart';
class UserSettingsService {
Future<AppearanceSettings> getAppearanceSettings() async {

View File

@ -1,4 +1,4 @@
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
part 'auth_state.freezed.dart';

View File

@ -7,7 +7,7 @@ import 'package:app_flowy/user/presentation/welcome_screen.dart';
import 'package:app_flowy/workspace/presentation/home/home_screen.dart';
import 'package:flowy_infra/time/duration.dart';
import 'package:flowy_infra_ui/widget/route/animation.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-folder/protobuf.dart';
import 'package:flutter/material.dart';

View File

@ -10,7 +10,7 @@ import 'package:flowy_infra_ui/widget/rounded_input_field.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_infra_ui/style_widget/snap_bar.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:dartz/dartz.dart';

View File

@ -8,7 +8,7 @@ import 'package:flowy_infra_ui/widget/rounded_button.dart';
import 'package:flowy_infra_ui/widget/rounded_input_field.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:flowy_infra_ui/style_widget/snap_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

View File

@ -11,7 +11,7 @@ import 'package:flowy_sdk/log.dart';
import 'package:flowy_sdk/dispatch/dispatch.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:url_launcher/url_launcher.dart';

View File

@ -6,7 +6,7 @@ import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/style_widget/button.dart';
import 'package:flowy_infra_ui/widget/error_page.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/workspace.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:app_flowy/generated/locale_keys.g.dart';

View File

@ -4,7 +4,7 @@ import 'package:app_flowy/user/application/user_settings_service.dart';
import 'package:equatable/equatable.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_sdk/log.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/user_setting.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_setting.pb.dart';
import 'package:flutter/material.dart';
import 'package:easy_localization/easy_localization.dart';

View File

@ -4,7 +4,7 @@ import 'package:flowy_sdk/log.dart';
import 'package:flowy_sdk/protobuf/flowy-error-code/code.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/workspace.pb.dart' show CurrentWorkspaceSetting;
import 'package:flowy_sdk/protobuf/flowy-user-data-model/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:dartz/dartz.dart';

View File

@ -3,7 +3,7 @@ import 'package:app_flowy/user/application/user_service.dart';
import 'package:flowy_sdk/log.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/workspace.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/user_profile.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/user_profile.pb.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:dartz/dartz.dart';

View File

@ -3,7 +3,7 @@ import 'dart:typed_data';
import 'package:app_flowy/core/folder_notification.dart';
import 'package:dartz/dartz.dart';
import 'package:flowy_infra/notifier.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-folder/app.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/workspace.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';

View File

@ -5,7 +5,7 @@ import 'package:app_flowy/workspace/presentation/widgets/float_bubble/question_b
import 'package:app_flowy/startup/startup.dart';
import 'package:flowy_sdk/log.dart';
import 'package:flowy_infra_ui/style_widget/container.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-folder/protobuf.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';

View File

@ -10,7 +10,7 @@ import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/style_widget/scrolling/styled_list.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-folder/view.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/workspace.pb.dart';
import 'package:flutter/material.dart';

View File

@ -6,7 +6,7 @@ import 'package:flowy_infra/size.dart';
import 'package:flowy_infra/theme.dart';
import 'package:flowy_infra_ui/style_widget/text.dart';
import 'package:flowy_infra_ui/widget/spacing.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show UserProfile;
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart' show UserProfile;
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:app_flowy/generated/locale_keys.g.dart';

View File

@ -5,7 +5,6 @@ import 'package:flowy_sdk/log.dart';
import 'package:flowy_sdk/protobuf/dart-ffi/ffi_response.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-net/network_state.pb.dart';
import 'package:flowy_sdk/protobuf/flowy-user/event_map.pb.dart';
import 'package:isolates/isolates.dart';
import 'package:isolates/ports.dart';
import 'package:ffi/ffi.dart';
@ -14,7 +13,7 @@ import 'package:flutter/services.dart';
import 'dart:async';
import 'dart:typed_data';
import 'package:flowy_sdk/ffi.dart' as ffi;
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
import 'package:flowy_sdk/protobuf/dart-ffi/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-folder/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-text-block/protobuf.dart';

View File

@ -1,7 +1,7 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/user/application/auth_service.dart';
import 'package:flowy_infra/uuid.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

View File

@ -1,6 +1,6 @@
import 'package:app_flowy/startup/startup.dart';
import 'package:app_flowy/workspace/application/workspace/welcome_bloc.dart';
import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart';
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:bloc_test/bloc_test.dart';

View File

@ -765,11 +765,11 @@ dependencies = [
[[package]]
name = "fake"
version = "2.3.0"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6479fa2c7e83ddf8be7d435421e093b072ca891b99a49bc84eba098f4044f818"
checksum = "4d68f517805463f3a896a9d29c1d6ff09d3579ded64a7201b4069f8f9c0d52fd"
dependencies = [
"rand 0.7.3",
"rand 0.8.5",
]
[[package]]
@ -999,7 +999,6 @@ dependencies = [
"flowy-sync",
"flowy-text-block",
"flowy-user",
"flowy-user-data-model",
"futures-util",
"http-flowy",
"hyper",
@ -1179,14 +1178,16 @@ name = "flowy-user"
version = "0.1.0"
dependencies = [
"bytes",
"claim 0.4.0",
"dart-notify",
"diesel",
"diesel_derives",
"fake",
"fancy-regex",
"flowy-database",
"flowy-derive",
"flowy-error",
"flowy-test",
"flowy-user-data-model",
"futures",
"lazy_static",
"lib-dispatch",
@ -1196,28 +1197,17 @@ dependencies = [
"once_cell",
"parking_lot 0.11.2",
"protobuf",
"quickcheck",
"quickcheck_macros",
"rand 0.8.5",
"rand_core 0.6.3",
"serde",
"serde_json",
"serial_test",
"strum",
"strum_macros",
"tokio",
"tracing",
]
[[package]]
name = "flowy-user-data-model"
version = "0.1.0"
dependencies = [
"bytes",
"derive_more",
"fancy-regex",
"flowy-derive",
"flowy-error-code",
"lazy_static",
"lib-infra",
"log",
"protobuf",
"serde",
"unicode-segmentation",
"validator",
]
@ -3613,9 +3603,9 @@ dependencies = [
[[package]]
name = "validator"
version = "0.12.0"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d6937c33ec6039d8071bcf72933146b5bbe378d645d8fa59bdadabfc2a249"
checksum = "f07b0a1390e01c0fc35ebb26b28ced33c9a3808f7f9fbe94d3cc01e233bfeed5"
dependencies = [
"idna",
"lazy_static",
@ -3624,15 +3614,8 @@ dependencies = [
"serde_derive",
"serde_json",
"url",
"validator_types",
]
[[package]]
name = "validator_types"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad9680608df133af2c1ddd5eaf1ddce91d60d61b6bc51494ef326458365a470a"
[[package]]
name = "vcpkg"
version = "0.2.15"

View File

@ -33,8 +33,8 @@ lazy_static = "1.4.0"
serde = { version = "1.0", features = ["derive"] }
tracing = { version = "0.1", features = ["log"] }
bytes = { version = "1.0" }
unicode-segmentation = "1.8"
[dev-dependencies]
serde_json = "1.0"
flowy-folder = { path = "../flowy-folder", features = ["flowy_unit_test"]}

View File

@ -11,7 +11,6 @@ flowy-error = { path = "../flowy-error", features = ["collaboration", "http_serv
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
flowy-sync = { path = "../../../shared-lib/flowy-sync"}
flowy-folder-data-model = { path = "../../../shared-lib/flowy-folder-data-model"}
flowy-user-data-model = { path = "../../../shared-lib/flowy-user-data-model"}
flowy-folder = { path = "../flowy-folder" }
flowy-user = { path = "../flowy-user" }
flowy-text-block = { path = "../flowy-text-block" }
@ -46,7 +45,6 @@ dart = [
"flowy-user/dart",
"flowy-sync/dart",
"flowy-error/dart",
"flowy-user-data-model/dart",
"flowy-folder-data-model/dart"
]

View File

@ -1,9 +1,9 @@
use crate::{configuration::*, request::HttpRequestBuilder};
use flowy_error::FlowyError;
use flowy_user::event_map::UserCloudService;
use flowy_user_data_model::entities::{
use flowy_user::entities::{
SignInParams, SignInResponse, SignUpParams, SignUpResponse, UpdateUserProfileParams, UserProfile,
};
use flowy_user::event_map::UserCloudService;
use http_flowy::errors::ServerError;
use lib_infra::future::FutureResult;

View File

@ -262,10 +262,10 @@ use flowy_folder_data_model::revision::{
gen_app_id, gen_workspace_id, AppRevision, TrashRevision, ViewRevision, WorkspaceRevision,
};
use flowy_text_block::BlockCloudService;
use flowy_user::event_map::UserCloudService;
use flowy_user_data_model::entities::{
use flowy_user::entities::{
SignInParams, SignInResponse, SignUpParams, SignUpResponse, UpdateUserProfileParams, UserProfile,
};
use flowy_user::event_map::UserCloudService;
use lib_infra::{future::FutureResult, util::timestamp};
impl FolderCouldServiceV1 for LocalServer {

View File

@ -31,7 +31,7 @@ nanoid = "0.4.0"
[dev-dependencies]
quickcheck = "1.0.3"
quickcheck_macros = "0.9.1"
fake = "~2.3.0"
fake = "2.4.3"
claim = "0.4.0"
futures = "0.3.15"
serial_test = "0.5.1"

View File

@ -6,7 +6,6 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
flowy-user-data-model = { path = "../../../shared-lib/flowy-user-data-model" }
flowy-derive = { path = "../../../shared-lib/flowy-derive" }
flowy-database = { path = "../flowy-database" }
flowy-error = { path = "../flowy-error", features = ["db", "http_server"] }
@ -29,12 +28,21 @@ parking_lot = "0.11"
strum = "0.21"
strum_macros = "0.21"
tokio = { version = "1", features = ["rt"] }
unicode-segmentation = "1.8"
validator = "0.15"
fancy-regex = "0.10.0"
[dev-dependencies]
flowy-test = { path = "../flowy-test" }
futures = "0.3.15"
nanoid = "0.4.0"
quickcheck = "1.0.3"
quickcheck_macros = "0.9.1"
fake = "2.4.3"
claim = "0.4.0"
futures = "0.3.15"
serial_test = "0.5.1"
rand_core = "0.6.3"
rand = "0.8.5"
[features]
dart = ["lib-infra/dart"]

View File

@ -1,3 +1,3 @@
# Check out the FlowyConfig (located in flowy_toml.rs) for more details.
proto_input = ["src/event_map.rs", "src/dart_notification.rs"]
proto_input = ["src/entities", "src/event_map.rs", "src/dart_notification.rs"]
event_files = ["src/event_map.rs"]

View File

@ -1,8 +1,7 @@
use std::convert::TryInto;
use crate::entities::parser::{UserEmail, UserName, UserPassword};
use crate::errors::ErrorCode;
use flowy_derive::ProtoBuf;
use crate::{errors::*, parser::*};
use std::convert::TryInto;
#[derive(ProtoBuf, Default)]
pub struct SignInPayload {

View File

@ -3,5 +3,6 @@ pub use user_profile::*;
pub use user_setting::*;
pub mod auth;
pub mod parser;
mod user_profile;
mod user_setting;

View File

@ -2,8 +2,8 @@ use flowy_derive::ProtoBuf;
use std::convert::TryInto;
use crate::{
entities::parser::{UserEmail, UserId, UserName, UserPassword},
errors::ErrorCode,
parser::{UserEmail, UserId, UserName, UserPassword},
};
#[derive(Default, ProtoBuf)]

View File

@ -1,7 +1,7 @@
use crate::{errors::FlowyError, handlers::*, services::UserSession};
use flowy_user_data_model::entities::{
use crate::entities::{
SignInParams, SignInResponse, SignUpParams, SignUpResponse, UpdateUserProfileParams, UserProfile,
};
use crate::{errors::FlowyError, handlers::*, services::UserSession};
use lib_dispatch::prelude::*;
use lib_infra::future::FutureResult;
use std::sync::Arc;

View File

@ -1,6 +1,6 @@
use crate::entities::*;
use crate::services::UserSession;
use flowy_error::FlowyError;
use flowy_user_data_model::entities::*;
use lib_dispatch::prelude::*;
use std::{convert::TryInto, sync::Arc};

View File

@ -1,8 +1,8 @@
use crate::{errors::FlowyError, services::UserSession};
use flowy_database::kv::KV;
use flowy_user_data_model::entities::{
use crate::entities::{
AppearanceSettings, UpdateUserProfileParams, UpdateUserProfilePayload, UserProfile, APPEARANCE_DEFAULT_THEME,
};
use crate::{errors::FlowyError, services::UserSession};
use flowy_database::kv::KV;
use lib_dispatch::prelude::*;
use std::{convert::TryInto, sync::Arc};

View File

@ -1,4 +1,5 @@
mod dart_notification;
pub mod entities;
pub mod event_map;
mod handlers;
pub mod protobuf;
@ -11,7 +12,3 @@ extern crate flowy_database;
pub mod errors {
pub use flowy_error::*;
}
pub mod entities {
pub use flowy_user_data_model::entities::*;
}

View File

@ -1,7 +1,7 @@
use crate::entities::{SignInResponse, SignUpResponse, UpdateUserProfileParams, UserProfile};
use flowy_database::ConnectionPool;
use flowy_database::{schema::user_table, DBConnection, Database};
use flowy_error::{ErrorCode, FlowyError};
use flowy_user_data_model::entities::{SignInResponse, SignUpResponse, UpdateUserProfileParams, UserProfile};
use lazy_static::lazy_static;
use parking_lot::RwLock;
use std::{collections::HashMap, sync::Arc, time::Duration};

View File

@ -1,4 +1,4 @@
use flowy_user_data_model::entities::UserProfile;
use crate::entities::UserProfile;
use tokio::sync::{broadcast, mpsc};
#[derive(Clone)]

View File

@ -1,3 +1,6 @@
use crate::entities::{
SignInParams, SignInResponse, SignUpParams, SignUpResponse, UpdateUserProfileParams, UserProfile,
};
use crate::{
dart_notification::*,
errors::{ErrorCode, FlowyError},
@ -14,9 +17,6 @@ use flowy_database::{
schema::{user_table, user_table::dsl},
DBConnection, ExpressionMethods, UserDatabaseConnection,
};
use flowy_user_data_model::entities::{
SignInParams, SignInResponse, SignUpParams, SignUpResponse, UpdateUserProfileParams, UserProfile,
};
use parking_lot::RwLock;
use serde::{Deserialize, Serialize};
use std::sync::Arc;

View File

@ -1,7 +1,7 @@
use crate::helper::*;
use flowy_test::{event_builder::UserModuleEventBuilder, FlowySDKTest};
use flowy_user::entities::{SignInPayload, SignUpPayload, UserProfile};
use flowy_user::{errors::ErrorCode, event_map::UserEvent::*};
use flowy_user_data_model::entities::{SignInPayload, SignUpPayload, UserProfile};
#[tokio::test]
async fn sign_up_with_invalid_email() {

View File

@ -1,7 +1,7 @@
use crate::helper::*;
use flowy_test::{event_builder::UserModuleEventBuilder, FlowySDKTest};
use flowy_user::entities::{UpdateUserProfilePayload, UserProfile};
use flowy_user::{errors::ErrorCode, event_map::UserEvent::*};
use flowy_user_data_model::entities::{UpdateUserProfilePayload, UserProfile};
use nanoid::nanoid;
// use serial_test::*;

110
shared-lib/Cargo.lock generated
View File

@ -186,15 +186,6 @@ dependencies = [
"phf_codegen",
]
[[package]]
name = "claim"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68ad37958d55b29a7088909368968d2fe876a24c203f8441195130f3b15194b9"
dependencies = [
"autocfg",
]
[[package]]
name = "cmd_lib"
version = "1.3.0"
@ -350,15 +341,6 @@ dependencies = [
"winapi",
]
[[package]]
name = "fake"
version = "2.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21a8531dd3a64fd1cfbe92fad4160bc2060489c6195fe847e045e5788f710bae"
dependencies = [
"rand 0.8.5",
]
[[package]]
name = "fake-simd"
version = "0.1.2"
@ -484,32 +466,6 @@ dependencies = [
"url",
]
[[package]]
name = "flowy-user-data-model"
version = "0.1.0"
dependencies = [
"bytes",
"claim",
"derive_more",
"fake",
"fancy-regex",
"flowy-derive",
"flowy-error-code",
"futures",
"lazy_static",
"lib-infra",
"log",
"protobuf",
"quickcheck",
"quickcheck_macros",
"rand 0.8.5",
"rand_core 0.6.3",
"serde",
"serial_test",
"unicode-segmentation",
"validator",
]
[[package]]
name = "fnv"
version = "1.0.7"
@ -1400,28 +1356,6 @@ dependencies = [
"tempfile",
]
[[package]]
name = "quickcheck"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "588f6378e4dd99458b60ec275b4477add41ce4fa9f64dcba6f15adccb19b50d6"
dependencies = [
"env_logger",
"log",
"rand 0.8.5",
]
[[package]]
name = "quickcheck_macros"
version = "0.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "608c156fd8e97febc07dc9c2e2c80bf74cfc6ef26893eae3daf8bc2bc94a4b7f"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "quote"
version = "1.0.10"
@ -1637,28 +1571,6 @@ dependencies = [
"syn",
]
[[package]]
name = "serial_test"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0bccbcf40c8938196944a3da0e133e031a33f4d6b72db3bda3cc556e361905d"
dependencies = [
"lazy_static",
"parking_lot 0.11.2",
"serial_test_derive",
]
[[package]]
name = "serial_test_derive"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "sha-1"
version = "0.8.2"
@ -2106,28 +2018,6 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
[[package]]
name = "validator"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "841d6937c33ec6039d8071bcf72933146b5bbe378d645d8fa59bdadabfc2a249"
dependencies = [
"idna",
"lazy_static",
"regex",
"serde",
"serde_derive",
"serde_json",
"url",
"validator_types",
]
[[package]]
name = "validator_types"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ad9680608df133af2c1ddd5eaf1ddce91d60d61b6bc51494ef326458365a470a"
[[package]]
name = "version_check"
version = "0.9.3"

View File

@ -1,6 +1,5 @@
[workspace]
members = [
"flowy-user-data-model",
"flowy-folder-data-model",
"flowy-sync",
"lib-ot",

View File

@ -1,35 +0,0 @@
[package]
name = "flowy-user-data-model"
version = "0.1.0"
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
flowy-derive = { path = "../flowy-derive" }
flowy-error-code = { path = "../flowy-error-code" }
protobuf = {version = "2.18.0"}
bytes = "1.0"
unicode-segmentation = "1.8"
derive_more = {version = "0.99", features = ["display"]}
serde = { version = "1.0", features = ["derive"] }
validator = "0.12.0"
log = "0.4.14"
fancy-regex = "0.10.0"
lazy_static = "1.4"
[build-dependencies]
lib-infra = { path = "../lib-infra", features = ["protobuf_file_gen"] }
[dev-dependencies]
quickcheck = "1.0.3"
quickcheck_macros = "0.9.1"
fake = "2.4.3"
claim = "0.4.0"
futures = "0.3.15"
serial_test = "0.5.1"
rand_core = "0.6.3"
rand = "0.8.5"
[features]
dart = ["lib-infra/dart", "flowy-error-code/dart"]

View File

@ -1,2 +0,0 @@
# Check out the FlowyConfig (located in flowy_toml.rs) for more details.
proto_input = ["src/entities", "src/errors.rs"]

View File

@ -1,5 +0,0 @@
use lib_infra::code_gen;
fn main() {
code_gen::protobuf_file::gen(env!("CARGO_PKG_NAME"));
}

View File

@ -1,7 +0,0 @@
pub mod entities;
pub mod parser;
pub mod protobuf;
pub mod errors {
pub use flowy_error_code::ErrorCode;
}