Browse Source

refactor: generate the pb files using build.rs

appflowy 3 years ago
parent
commit
9135b92a39
73 changed files with 651 additions and 1179 deletions
  1. 13 1
      frontend/Makefile.toml
  2. 1 1
      frontend/app_flowy/lib/workspace/application/doc/doc_bloc.dart
  3. 4 4
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/trash.pbenum.dart
  4. 3 3
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/trash.pbjson.dart
  5. 146 4
      frontend/rust-lib/Cargo.lock
  6. 4 1
      frontend/rust-lib/dart-ffi/Cargo.toml
  7. 5 0
      frontend/rust-lib/dart-ffi/build.rs
  8. 4 11
      frontend/rust-lib/dart-ffi/src/protobuf/model/ffi_request.rs
  9. 3 18
      frontend/rust-lib/dart-ffi/src/protobuf/model/ffi_response.rs
  10. 4 1
      frontend/rust-lib/dart-notify/Cargo.toml
  11. 5 0
      frontend/rust-lib/dart-notify/build.rs
  12. 4 21
      frontend/rust-lib/dart-notify/src/protobuf/model/subject.rs
  13. 0 2
      frontend/rust-lib/flowy-document/Flowy.toml
  14. 0 2
      frontend/rust-lib/flowy-document/src/lib.rs
  15. 0 4
      frontend/rust-lib/flowy-document/src/protobuf/mod.rs
  16. 0 2
      frontend/rust-lib/flowy-document/src/protobuf/model/mod.rs
  17. 3 0
      frontend/rust-lib/flowy-error/Cargo.toml
  18. 5 0
      frontend/rust-lib/flowy-error/build.rs
  19. 3 11
      frontend/rust-lib/flowy-error/src/protobuf/model/errors.rs
  20. 4 1
      frontend/rust-lib/flowy-folder/Cargo.toml
  21. 5 0
      frontend/rust-lib/flowy-folder/build.rs
  22. 3 31
      frontend/rust-lib/flowy-folder/src/protobuf/model/dart_notification.rs
  23. 3 56
      frontend/rust-lib/flowy-folder/src/protobuf/model/event_map.rs
  24. 1 1
      frontend/rust-lib/flowy-folder/src/services/app/controller.rs
  25. 1 1
      frontend/rust-lib/flowy-folder/src/services/persistence/version_1/app_sql.rs
  26. 4 4
      frontend/rust-lib/flowy-folder/src/services/persistence/version_1/trash_sql.rs
  27. 1 1
      frontend/rust-lib/flowy-folder/src/services/persistence/version_1/view_sql.rs
  28. 1 1
      frontend/rust-lib/flowy-folder/src/services/view/controller.rs
  29. 2 2
      frontend/rust-lib/flowy-folder/tests/workspace/helper.rs
  30. 4 1
      frontend/rust-lib/flowy-net/Cargo.toml
  31. 5 0
      frontend/rust-lib/flowy-net/build.rs
  32. 3 7
      frontend/rust-lib/flowy-net/src/protobuf/model/event.rs
  33. 3 17
      frontend/rust-lib/flowy-net/src/protobuf/model/network_state.rs
  34. 4 1
      frontend/rust-lib/flowy-user/Cargo.toml
  35. 5 0
      frontend/rust-lib/flowy-user/build.rs
  36. 3 15
      frontend/rust-lib/flowy-user/src/protobuf/model/dart_notification.rs
  37. 3 23
      frontend/rust-lib/flowy-user/src/protobuf/model/event_map.rs
  38. 192 4
      shared-lib/Cargo.lock
  39. 4 1
      shared-lib/error-code/Cargo.toml
  40. 5 0
      shared-lib/error-code/build.rs
  41. 4 66
      shared-lib/error-code/src/protobuf/model/error_code.rs
  42. 3 0
      shared-lib/flowy-collaboration/Cargo.toml
  43. 5 0
      shared-lib/flowy-collaboration/build.rs
  44. 3 50
      shared-lib/flowy-collaboration/src/protobuf/model/document_info.rs
  45. 3 16
      shared-lib/flowy-collaboration/src/protobuf/model/folder_info.rs
  46. 4 50
      shared-lib/flowy-collaboration/src/protobuf/model/revision.rs
  47. 3 50
      shared-lib/flowy-collaboration/src/protobuf/model/ws_data.rs
  48. 41 41
      shared-lib/flowy-derive/src/derive_cache/derive_cache.rs
  49. 3 0
      shared-lib/flowy-folder-data-model/Cargo.toml
  50. 5 0
      shared-lib/flowy-folder-data-model/build.rs
  51. 5 5
      shared-lib/flowy-folder-data-model/src/entities/trash.rs
  52. 1 1
      shared-lib/flowy-folder-data-model/src/entities/view.rs
  53. 3 106
      shared-lib/flowy-folder-data-model/src/protobuf/model/app.rs
  54. 3 40
      shared-lib/flowy-folder-data-model/src/protobuf/model/errors.rs
  55. 3 24
      shared-lib/flowy-folder-data-model/src/protobuf/model/share.rs
  56. 10 51
      shared-lib/flowy-folder-data-model/src/protobuf/model/trash.rs
  57. 3 118
      shared-lib/flowy-folder-data-model/src/protobuf/model/view.rs
  58. 3 80
      shared-lib/flowy-folder-data-model/src/protobuf/model/workspace.rs
  59. 2 2
      shared-lib/flowy-folder-data-model/src/protobuf/proto/trash.proto
  60. 2 0
      shared-lib/flowy-user-data-model/Cargo.toml
  61. 5 0
      shared-lib/flowy-user-data-model/build.rs
  62. 3 67
      shared-lib/flowy-user-data-model/src/protobuf/model/auth.rs
  63. 0 11
      shared-lib/flowy-user-data-model/src/protobuf/model/document
  64. 3 37
      shared-lib/flowy-user-data-model/src/protobuf/model/errors.rs
  65. 3 52
      shared-lib/flowy-user-data-model/src/protobuf/model/user_profile.rs
  66. 3 26
      shared-lib/flowy-user-data-model/src/protobuf/model/user_setting.rs
  67. 7 0
      shared-lib/lib-infra/Cargo.toml
  68. 3 0
      shared-lib/lib-infra/src/lib.rs
  69. 38 0
      shared-lib/lib-infra/src/pb.rs
  70. 3 0
      shared-lib/lib-ws/Cargo.toml
  71. 5 0
      shared-lib/lib-ws/build.rs
  72. 3 18
      shared-lib/lib-ws/src/protobuf/model/errors.rs
  73. 3 15
      shared-lib/lib-ws/src/protobuf/model/msg.rs

+ 13 - 1
frontend/Makefile.toml

@@ -21,6 +21,7 @@ PRODUCT_NAME = "AppFlowy"
 CRATE_TYPE = "staticlib"
 CRATE_TYPE = "staticlib"
 SDK_EXT = "a"
 SDK_EXT = "a"
 APP_ENVIRONMENT = "local"
 APP_ENVIRONMENT = "local"
+FLUTTER_FLOWY_SDK_PATH="app_flowy/packages/flowy_sdk/lib/protobuf"
 
 
 [env.development-mac]
 [env.development-mac]
 RUST_LOG = "trace"
 RUST_LOG = "trace"
@@ -149,4 +150,15 @@ script = [
       assert ${result}
       assert ${result}
       """,
       """,
 ]
 ]
-script_runner = "@duckscript"
+script_runner = "@duckscript"
+
+
+[tasks.test-build]
+condition = { env_set = [ "FLUTTER_FLOWY_SDK_PATH"] }
+script = [
+    """
+      cd ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/dart-ffi
+      cargo build -vv
+      """,
+]
+script_runner = "@shell"

+ 1 - 1
frontend/app_flowy/lib/workspace/application/doc/doc_bloc.dart

@@ -39,7 +39,7 @@ class DocBloc extends Bloc<DocEvent, DocState> {
           emit(state.copyWith(isDeleted: false));
           emit(state.copyWith(isDeleted: false));
         },
         },
         deletePermanently: (DeletePermanently value) async {
         deletePermanently: (DeletePermanently value) async {
-          final result = await trashRepo.deleteViews([Tuple2(view.id, TrashType.View)]);
+          final result = await trashRepo.deleteViews([Tuple2(view.id, TrashType.TrashView)]);
           final newState = result.fold((l) => state.copyWith(forceClose: true), (r) => state);
           final newState = result.fold((l) => state.copyWith(forceClose: true), (r) => state);
           emit(newState);
           emit(newState);
         },
         },

+ 4 - 4
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/trash.pbenum.dart

@@ -11,13 +11,13 @@ import 'package:protobuf/protobuf.dart' as $pb;
 
 
 class TrashType extends $pb.ProtobufEnum {
 class TrashType extends $pb.ProtobufEnum {
   static const TrashType Unknown = TrashType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Unknown');
   static const TrashType Unknown = TrashType._(0, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'Unknown');
-  static const TrashType View = TrashType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'View');
-  static const TrashType App = TrashType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'App');
+  static const TrashType TrashView = TrashType._(1, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TrashView');
+  static const TrashType TrashApp = TrashType._(2, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'TrashApp');
 
 
   static const $core.List<TrashType> values = <TrashType> [
   static const $core.List<TrashType> values = <TrashType> [
     Unknown,
     Unknown,
-    View,
-    App,
+    TrashView,
+    TrashApp,
   ];
   ];
 
 
   static final $core.Map<$core.int, TrashType> _byValue = $pb.ProtobufEnum.initByValue(values);
   static final $core.Map<$core.int, TrashType> _byValue = $pb.ProtobufEnum.initByValue(values);

+ 3 - 3
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/trash.pbjson.dart

@@ -13,13 +13,13 @@ const TrashType$json = const {
   '1': 'TrashType',
   '1': 'TrashType',
   '2': const [
   '2': const [
     const {'1': 'Unknown', '2': 0},
     const {'1': 'Unknown', '2': 0},
-    const {'1': 'View', '2': 1},
-    const {'1': 'App', '2': 2},
+    const {'1': 'TrashView', '2': 1},
+    const {'1': 'TrashApp', '2': 2},
   ],
   ],
 };
 };
 
 
 /// Descriptor for `TrashType`. Decode as a `google.protobuf.EnumDescriptorProto`.
 /// Descriptor for `TrashType`. Decode as a `google.protobuf.EnumDescriptorProto`.
-final $typed_data.Uint8List trashTypeDescriptor = $convert.base64Decode('CglUcmFzaFR5cGUSCwoHVW5rbm93bhAAEggKBFZpZXcQARIHCgNBcHAQAg==');
+final $typed_data.Uint8List trashTypeDescriptor = $convert.base64Decode('CglUcmFzaFR5cGUSCwoHVW5rbm93bhAAEg0KCVRyYXNoVmlldxABEgwKCFRyYXNoQXBwEAI=');
 @$core.Deprecated('Use trashDescriptor instead')
 @$core.Deprecated('Use trashDescriptor instead')
 const Trash$json = const {
 const Trash$json = const {
   '1': 'Trash',
   '1': 'Trash',

+ 146 - 4
frontend/rust-lib/Cargo.lock

@@ -214,6 +214,17 @@ dependencies = [
  "serde",
  "serde",
 ]
 ]
 
 
+[[package]]
+name = "cargo_toml"
+version = "0.11.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e270ef0cd868745878982f7ce470aa898d0d4bb248af67f0cf66f54617913ef"
+dependencies = [
+ "serde",
+ "serde_derive",
+ "toml",
+]
+
 [[package]]
 [[package]]
 name = "cast"
 name = "cast"
 version = "0.2.7"
 version = "0.2.7"
@@ -277,6 +288,31 @@ dependencies = [
  "unicode-width",
  "unicode-width",
 ]
 ]
 
 
+[[package]]
+name = "cmd_lib"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ba0f413777386d37f85afa5242f277a7b461905254c1af3c339d4af06800f62"
+dependencies = [
+ "cmd_lib_macros",
+ "faccess",
+ "lazy_static",
+ "log",
+ "os_pipe",
+]
+
+[[package]]
+name = "cmd_lib_macros"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e66605092ff6c6e37e0246601ae6c3f62dc1880e0599359b5f303497c112dc0"
+dependencies = [
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
 [[package]]
 [[package]]
 name = "color-eyre"
 name = "color-eyre"
 version = "0.5.11"
 version = "0.5.11"
@@ -506,6 +542,7 @@ dependencies = [
  "flowy-derive",
  "flowy-derive",
  "flowy-sdk",
  "flowy-sdk",
  "lib-dispatch",
  "lib-dispatch",
+ "lib-infra",
  "log",
  "log",
  "once_cell",
  "once_cell",
  "protobuf",
  "protobuf",
@@ -523,6 +560,7 @@ dependencies = [
  "flowy-derive",
  "flowy-derive",
  "lazy_static",
  "lazy_static",
  "lib-dispatch",
  "lib-dispatch",
+ "lib-infra",
  "log",
  "log",
  "protobuf",
  "protobuf",
 ]
 ]
@@ -667,6 +705,7 @@ version = "0.1.0"
 dependencies = [
 dependencies = [
  "derive_more",
  "derive_more",
  "flowy-derive",
  "flowy-derive",
+ "lib-infra",
  "protobuf",
  "protobuf",
 ]
 ]
 
 
@@ -680,6 +719,17 @@ dependencies = [
  "once_cell",
  "once_cell",
 ]
 ]
 
 
+[[package]]
+name = "faccess"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e039175679baf763ddddf4f76900b92d4dae9411ee88cf42d2f11b976b09e07c"
+dependencies = [
+ "bitflags",
+ "libc",
+ "winapi",
+]
+
 [[package]]
 [[package]]
 name = "fake"
 name = "fake"
 version = "2.3.0"
 version = "2.3.0"
@@ -832,6 +882,7 @@ dependencies = [
  "flowy-derive",
  "flowy-derive",
  "http-flowy",
  "http-flowy",
  "lib-dispatch",
  "lib-dispatch",
+ "lib-infra",
  "lib-ot",
  "lib-ot",
  "lib-sqlite",
  "lib-sqlite",
  "protobuf",
  "protobuf",
@@ -890,6 +941,7 @@ dependencies = [
  "derive_more",
  "derive_more",
  "error-code",
  "error-code",
  "flowy-derive",
  "flowy-derive",
+ "lib-infra",
  "log",
  "log",
  "protobuf",
  "protobuf",
  "serde",
  "serde",
@@ -1070,6 +1122,7 @@ dependencies = [
  "fancy-regex",
  "fancy-regex",
  "flowy-derive",
  "flowy-derive",
  "lazy_static",
  "lazy_static",
+ "lib-infra",
  "log",
  "log",
  "protobuf",
  "protobuf",
  "serde",
  "serde",
@@ -1519,13 +1572,17 @@ name = "lib-infra"
 version = "0.1.0"
 version = "0.1.0"
 dependencies = [
 dependencies = [
  "bytes",
  "bytes",
+ "cargo_toml",
  "chrono",
  "chrono",
+ "cmd_lib",
  "futures-core",
  "futures-core",
  "log",
  "log",
  "pin-project",
  "pin-project",
+ "protoc-rust",
  "rand 0.8.4",
  "rand 0.8.4",
  "tokio",
  "tokio",
  "uuid",
  "uuid",
+ "walkdir",
 ]
 ]
 
 
 [[package]]
 [[package]]
@@ -1870,6 +1927,16 @@ dependencies = [
  "vcpkg",
  "vcpkg",
 ]
 ]
 
 
+[[package]]
+name = "os_pipe"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb233f06c2307e1f5ce2ecad9f8121cffbbee2c95428f44ea85222e460d0d213"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
 [[package]]
 [[package]]
 name = "owo-colors"
 name = "owo-colors"
 version = "1.3.0"
 version = "1.3.0"
@@ -1985,6 +2052,30 @@ version = "0.2.16"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
 checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
 
 
+[[package]]
+name = "proc-macro-error"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
+dependencies = [
+ "proc-macro-error-attr",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro-error-attr"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "version_check",
+]
+
 [[package]]
 [[package]]
 name = "proc-macro2"
 name = "proc-macro2"
 version = "1.0.36"
 version = "1.0.36"
@@ -2000,6 +2091,37 @@ version = "2.25.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "47c327e191621a2158159df97cdbc2e7074bb4e940275e35abf38eb3d2595754"
 checksum = "47c327e191621a2158159df97cdbc2e7074bb4e940275e35abf38eb3d2595754"
 
 
+[[package]]
+name = "protobuf-codegen"
+version = "2.25.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3df8c98c08bd4d6653c2dbae00bd68c1d1d82a360265a5b0bbc73d48c63cb853"
+dependencies = [
+ "protobuf",
+]
+
+[[package]]
+name = "protoc"
+version = "2.25.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ac70cfc8935f5db2a29c0929db697035d02284011a9b78a5ef5d48092ce9673"
+dependencies = [
+ "log",
+ "which",
+]
+
+[[package]]
+name = "protoc-rust"
+version = "2.25.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6bad71c8404e3e09024fccbab55aae36e3662662167dc4530a242c8cc8ef8d20"
+dependencies = [
+ "protobuf",
+ "protobuf-codegen",
+ "protoc",
+ "tempfile",
+]
+
 [[package]]
 [[package]]
 name = "quickcheck"
 name = "quickcheck"
 version = "0.9.2"
 version = "0.9.2"
@@ -2327,9 +2449,9 @@ checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012"
 
 
 [[package]]
 [[package]]
 name = "serde"
 name = "serde"
-version = "1.0.133"
+version = "1.0.136"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97565067517b60e2d1ea8b268e59ce036de907ac523ad83a0475da04e818989a"
+checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
 dependencies = [
 dependencies = [
  "serde_derive",
  "serde_derive",
 ]
 ]
@@ -2357,9 +2479,9 @@ dependencies = [
 
 
 [[package]]
 [[package]]
 name = "serde_derive"
 name = "serde_derive"
-version = "1.0.133"
+version = "1.0.136"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed201699328568d8d08208fdd080e3ff594e6c422e438b6705905da01005d537"
+checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
 dependencies = [
 dependencies = [
  "proc-macro2",
  "proc-macro2",
  "quote",
  "quote",
@@ -2714,6 +2836,15 @@ dependencies = [
  "tokio",
  "tokio",
 ]
 ]
 
 
+[[package]]
+name = "toml"
+version = "0.5.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa"
+dependencies = [
+ "serde",
+]
+
 [[package]]
 [[package]]
 name = "tower-service"
 name = "tower-service"
 version = "0.3.1"
 version = "0.3.1"
@@ -3069,6 +3200,17 @@ dependencies = [
  "wasm-bindgen",
  "wasm-bindgen",
 ]
 ]
 
 
+[[package]]
+name = "which"
+version = "4.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a5a7e487e921cf220206864a94a89b6c6905bfc19f1057fa26a4cb360e5c1d2"
+dependencies = [
+ "either",
+ "lazy_static",
+ "libc",
+]
+
 [[package]]
 [[package]]
 name = "winapi"
 name = "winapi"
 version = "0.3.9"
 version = "0.3.9"

+ 4 - 1
frontend/rust-lib/dart-ffi/Cargo.toml

@@ -32,4 +32,7 @@ flowy-derive = {path = "../../../shared-lib/flowy-derive" }
 flutter = ["dart-notify/dart"]
 flutter = ["dart-notify/dart"]
 http_server = ["flowy-sdk/http_server", "flowy-sdk/use_bunyan"]
 http_server = ["flowy-sdk/http_server", "flowy-sdk/use_bunyan"]
 #use_serde = ["bincode"]
 #use_serde = ["bincode"]
-#use_protobuf= ["protobuf"]
+#use_protobuf= ["protobuf"]
+
+[build-dependencies]
+lib-infra = { path = "../../../shared-lib/lib-infra", features = ["gen_pb"] }

+ 5 - 0
frontend/rust-lib/dart-ffi/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("dart-ffi", "./src/protobuf/proto");
+}

+ 4 - 11
frontend/rust-lib/dart-ffi/src/protobuf/model/ffi_request.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct FFIRequest {
 pub struct FFIRequest {
@@ -226,15 +226,8 @@ impl ::protobuf::reflect::ProtobufValue for FFIRequest {
 
 
 static file_descriptor_proto_data: &'static [u8] = b"\
 static file_descriptor_proto_data: &'static [u8] = b"\
     \n\x11ffi_request.proto\"<\n\nFFIRequest\x12\x14\n\x05event\x18\x01\x20\
     \n\x11ffi_request.proto\"<\n\nFFIRequest\x12\x14\n\x05event\x18\x01\x20\
-    \x01(\tR\x05event\x12\x18\n\x07payload\x18\x02\x20\x01(\x0cR\x07payloadJ\
-    \x98\x01\n\x06\x12\x04\0\0\x05\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\
-    \x02\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x12\
-    \n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x15\n\x0c\n\x05\x04\0\x02\0\x05\
-    \x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x10\n\x0c\
-    \n\x05\x04\0\x02\0\x03\x12\x03\x03\x13\x14\n\x0b\n\x04\x04\0\x02\x01\x12\
-    \x03\x04\x04\x16\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\t\n\x0c\n\
-    \x05\x04\0\x02\x01\x01\x12\x03\x04\n\x11\n\x0c\n\x05\x04\0\x02\x01\x03\
-    \x12\x03\x04\x14\x15b\x06proto3\
+    \x01(\tR\x05event\x12\x18\n\x07payload\x18\x02\x20\x01(\x0cR\x07payloadb\
+    \x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 18
frontend/rust-lib/dart-ffi/src/protobuf/model/ffi_response.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct FFIResponse {
 pub struct FFIResponse {
@@ -270,22 +270,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \n\x12ffi_response.proto\"K\n\x0bFFIResponse\x12\x18\n\x07payload\x18\
     \n\x12ffi_response.proto\"K\n\x0bFFIResponse\x12\x18\n\x07payload\x18\
     \x01\x20\x01(\x0cR\x07payload\x12\"\n\x04code\x18\x02\x20\x01(\x0e2\x0e.\
     \x01\x20\x01(\x0cR\x07payload\x12\"\n\x04code\x18\x02\x20\x01(\x0e2\x0e.\
     FFIStatusCodeR\x04code*.\n\rFFIStatusCode\x12\x06\n\x02Ok\x10\0\x12\x07\
     FFIStatusCodeR\x04code*.\n\rFFIStatusCode\x12\x06\n\x02Ok\x10\0\x12\x07\
-    \n\x03Err\x10\x01\x12\x0c\n\x08Internal\x10\x02J\xab\x02\n\x06\x12\x04\0\
-    \0\n\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\
-    \x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x13\n\x0b\n\x04\x04\0\x02\0\
-    \x12\x03\x03\x04\x16\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\t\n\x0c\
-    \n\x05\x04\0\x02\0\x01\x12\x03\x03\n\x11\n\x0c\n\x05\x04\0\x02\0\x03\x12\
-    \x03\x03\x14\x15\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x1b\n\x0c\n\
-    \x05\x04\0\x02\x01\x06\x12\x03\x04\x04\x11\n\x0c\n\x05\x04\0\x02\x01\x01\
-    \x12\x03\x04\x12\x16\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x19\x1a\n\
-    \n\n\x02\x05\0\x12\x04\x06\0\n\x01\n\n\n\x03\x05\0\x01\x12\x03\x06\x05\
-    \x12\n\x0b\n\x04\x05\0\x02\0\x12\x03\x07\x04\x0b\n\x0c\n\x05\x05\0\x02\0\
-    \x01\x12\x03\x07\x04\x06\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x07\t\n\n\
-    \x0b\n\x04\x05\0\x02\x01\x12\x03\x08\x04\x0c\n\x0c\n\x05\x05\0\x02\x01\
-    \x01\x12\x03\x08\x04\x07\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x08\n\x0b\
-    \n\x0b\n\x04\x05\0\x02\x02\x12\x03\t\x04\x11\n\x0c\n\x05\x05\0\x02\x02\
-    \x01\x12\x03\t\x04\x0c\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\t\x0f\x10b\
-    \x06proto3\
+    \n\x03Err\x10\x01\x12\x0c\n\x08Internal\x10\x02b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 4 - 1
frontend/rust-lib/dart-notify/Cargo.toml

@@ -16,4 +16,7 @@ flowy-derive = {path = "../../../shared-lib/flowy-derive" }
 lib-dispatch = {path = "../lib-dispatch" }
 lib-dispatch = {path = "../lib-dispatch" }
 
 
 [features]
 [features]
-dart = []
+dart = []
+
+[build-dependencies]
+lib-infra = { path = "../../../shared-lib/lib-infra", features = ["gen_pb"] }

+ 5 - 0
frontend/rust-lib/dart-notify/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("dart-notify", "./src/protobuf/proto");
+}

+ 4 - 21
frontend/rust-lib/dart-notify/src/protobuf/model/subject.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct SubscribeObject {
 pub struct SubscribeObject {
@@ -427,25 +427,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x01\x20\x01(\tR\x06source\x12\x0e\n\x02ty\x18\x02\x20\x01(\x05R\x02ty\
     \x01\x20\x01(\tR\x06source\x12\x0e\n\x02ty\x18\x02\x20\x01(\x05R\x02ty\
     \x12\x0e\n\x02id\x18\x03\x20\x01(\tR\x02id\x12\x1a\n\x07payload\x18\x04\
     \x12\x0e\n\x02id\x18\x03\x20\x01(\tR\x02id\x12\x1a\n\x07payload\x18\x04\
     \x20\x01(\x0cH\0R\x07payload\x12\x16\n\x05error\x18\x05\x20\x01(\x0cH\
     \x20\x01(\x0cH\0R\x07payload\x12\x16\n\x05error\x18\x05\x20\x01(\x0cH\
-    \x01R\x05errorB\x10\n\x0eone_of_payloadB\x0e\n\x0cone_of_errorJ\xf3\x02\
-    \n\x06\x12\x04\0\0\x08\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\
-    \0\x12\x04\x02\0\x08\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x17\n\x0b\n\
-    \x04\x04\0\x02\0\x12\x03\x03\x04\x16\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\
-    \x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x11\n\x0c\n\x05\
-    \x04\0\x02\0\x03\x12\x03\x03\x14\x15\n\x0b\n\x04\x04\0\x02\x01\x12\x03\
-    \x04\x04\x11\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\t\n\x0c\n\x05\
-    \x04\0\x02\x01\x01\x12\x03\x04\n\x0c\n\x0c\n\x05\x04\0\x02\x01\x03\x12\
-    \x03\x04\x0f\x10\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\x04\x12\n\x0c\n\
-    \x05\x04\0\x02\x02\x05\x12\x03\x05\x04\n\n\x0c\n\x05\x04\0\x02\x02\x01\
-    \x12\x03\x05\x0b\r\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05\x10\x11\n\
-    \x0b\n\x04\x04\0\x08\0\x12\x03\x06\x04/\n\x0c\n\x05\x04\0\x08\0\x01\x12\
-    \x03\x06\n\x18\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x06\x1b-\n\x0c\n\x05\
-    \x04\0\x02\x03\x05\x12\x03\x06\x1b\x20\n\x0c\n\x05\x04\0\x02\x03\x01\x12\
-    \x03\x06!(\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x06+,\n\x0b\n\x04\x04\0\
-    \x08\x01\x12\x03\x07\x04+\n\x0c\n\x05\x04\0\x08\x01\x01\x12\x03\x07\n\
-    \x16\n\x0b\n\x04\x04\0\x02\x04\x12\x03\x07\x19)\n\x0c\n\x05\x04\0\x02\
-    \x04\x05\x12\x03\x07\x19\x1e\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x07\
-    \x1f$\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03\x07'(b\x06proto3\
+    \x01R\x05errorB\x10\n\x0eone_of_payloadB\x0e\n\x0cone_of_errorb\x06proto\
+    3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 0 - 2
frontend/rust-lib/flowy-document/Flowy.toml

@@ -1,2 +0,0 @@
-proto_crates = []
-event_files = []

+ 0 - 2
frontend/rust-lib/flowy-document/src/lib.rs

@@ -1,7 +1,5 @@
 pub mod controller;
 pub mod controller;
 pub mod core;
 pub mod core;
-// mod notify;
-pub mod protobuf;
 pub use controller::*;
 pub use controller::*;
 pub mod errors {
 pub mod errors {
     pub use flowy_error::{internal_error, ErrorCode, FlowyError};
     pub use flowy_error::{internal_error, ErrorCode, FlowyError};

+ 0 - 4
frontend/rust-lib/flowy-document/src/protobuf/mod.rs

@@ -1,4 +0,0 @@
-#![cfg_attr(rustfmt, rustfmt::skip)]
-// Auto-generated, do not edit
-mod model;
-pub use model::*;

+ 0 - 2
frontend/rust-lib/flowy-document/src/protobuf/model/mod.rs

@@ -1,2 +0,0 @@
-#![cfg_attr(rustfmt, rustfmt::skip)]
-// Auto-generated, do not edit

+ 3 - 0
frontend/rust-lib/flowy-error/Cargo.toml

@@ -27,3 +27,6 @@ ot = ["lib-ot"]
 serde = ["serde_json"]
 serde = ["serde_json"]
 http_server = ["http-flowy"]
 http_server = ["http-flowy"]
 db = ["flowy-database", "lib-sqlite", "r2d2"]
 db = ["flowy-database", "lib-sqlite", "r2d2"]
+
+[build-dependencies]
+lib-infra = { path = "../../../shared-lib/lib-infra", features = ["gen_pb"] }

+ 5 - 0
frontend/rust-lib/flowy-error/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("flowy-error", "./src/protobuf/proto");
+}

+ 3 - 11
frontend/rust-lib/flowy-error/src/protobuf/model/errors.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct FlowyError {
 pub struct FlowyError {
@@ -219,15 +219,7 @@ impl ::protobuf::reflect::ProtobufValue for FlowyError {
 
 
 static file_descriptor_proto_data: &'static [u8] = b"\
 static file_descriptor_proto_data: &'static [u8] = b"\
     \n\x0cerrors.proto\"2\n\nFlowyError\x12\x12\n\x04code\x18\x01\x20\x01(\
     \n\x0cerrors.proto\"2\n\nFlowyError\x12\x12\n\x04code\x18\x01\x20\x01(\
-    \x05R\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msgJ\x98\x01\n\x06\
-    \x12\x04\0\0\x05\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\
-    \x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x12\n\x0b\n\x04\
-    \x04\0\x02\0\x12\x03\x03\x04\x13\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\
-    \x04\t\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\n\x0e\n\x0c\n\x05\x04\0\
-    \x02\0\x03\x12\x03\x03\x11\x12\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\
-    \x13\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\
-    \x02\x01\x01\x12\x03\x04\x0b\x0e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\
-    \x04\x11\x12b\x06proto3\
+    \x05R\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msgb\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 4 - 1
frontend/rust-lib/flowy-folder/Cargo.toml

@@ -52,4 +52,7 @@ flowy-test = { path = "../flowy-test" }
 [features]
 [features]
 default = []
 default = []
 http_server = []
 http_server = []
-flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-sync/flowy_unit_test"]
+flowy_unit_test = ["lib-ot/flowy_unit_test", "flowy-sync/flowy_unit_test"]
+
+[build-dependencies]
+lib-infra = { path = "../../../shared-lib/lib-infra", features = ["gen_pb"] }

+ 5 - 0
frontend/rust-lib/flowy-folder/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("flowy-folder", "./src/protobuf/proto");
+}

+ 3 - 31
frontend/rust-lib/flowy-folder/src/protobuf/model/dart_notification.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 pub enum FolderNotification {
 pub enum FolderNotification {
@@ -114,35 +114,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x0e\x12\x0e\n\nAppUpdated\x10\x15\x12\x13\n\x0fAppViewsChanged\x10\x18\
     \x0e\x12\x0e\n\nAppUpdated\x10\x15\x12\x13\n\x0fAppViewsChanged\x10\x18\
     \x12\x0f\n\x0bViewUpdated\x10\x1f\x12\x0f\n\x0bViewDeleted\x10\x20\x12\
     \x12\x0f\n\x0bViewUpdated\x10\x1f\x12\x0f\n\x0bViewDeleted\x10\x20\x12\
     \x10\n\x0cViewRestored\x10!\x12\x14\n\x10UserUnauthorized\x10d\x12\x11\n\
     \x10\n\x0cViewRestored\x10!\x12\x14\n\x10UserUnauthorized\x10d\x12\x11\n\
-    \x0cTrashUpdated\x10\xe8\x07J\xbf\x04\n\x06\x12\x04\0\0\x10\x01\n\x08\n\
-    \x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x05\0\x12\x04\x02\0\x10\x01\n\n\n\x03\
-    \x05\0\x01\x12\x03\x02\x05\x17\n\x0b\n\x04\x05\0\x02\0\x12\x03\x03\x04\
-    \x10\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x03\x04\x0b\n\x0c\n\x05\x05\0\
-    \x02\0\x02\x12\x03\x03\x0e\x0f\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x04\x04\
-    \x1d\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x04\x04\x17\n\x0c\n\x05\x05\0\
-    \x02\x01\x02\x12\x03\x04\x1a\x1c\n\x0b\n\x04\x05\0\x02\x02\x12\x03\x05\
-    \x04\x1d\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x05\x04\x17\n\x0c\n\x05\
-    \x05\0\x02\x02\x02\x12\x03\x05\x1a\x1c\n\x0b\n\x04\x05\0\x02\x03\x12\x03\
-    \x06\x04\x1a\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\x06\x04\x14\n\x0c\n\
-    \x05\x05\0\x02\x03\x02\x12\x03\x06\x17\x19\n\x0b\n\x04\x05\0\x02\x04\x12\
-    \x03\x07\x04\x1e\n\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x07\x04\x18\n\x0c\
-    \n\x05\x05\0\x02\x04\x02\x12\x03\x07\x1b\x1d\n\x0b\n\x04\x05\0\x02\x05\
-    \x12\x03\x08\x04\x1e\n\x0c\n\x05\x05\0\x02\x05\x01\x12\x03\x08\x04\x18\n\
-    \x0c\n\x05\x05\0\x02\x05\x02\x12\x03\x08\x1b\x1d\n\x0b\n\x04\x05\0\x02\
-    \x06\x12\x03\t\x04\x14\n\x0c\n\x05\x05\0\x02\x06\x01\x12\x03\t\x04\x0e\n\
-    \x0c\n\x05\x05\0\x02\x06\x02\x12\x03\t\x11\x13\n\x0b\n\x04\x05\0\x02\x07\
-    \x12\x03\n\x04\x19\n\x0c\n\x05\x05\0\x02\x07\x01\x12\x03\n\x04\x13\n\x0c\
-    \n\x05\x05\0\x02\x07\x02\x12\x03\n\x16\x18\n\x0b\n\x04\x05\0\x02\x08\x12\
-    \x03\x0b\x04\x15\n\x0c\n\x05\x05\0\x02\x08\x01\x12\x03\x0b\x04\x0f\n\x0c\
-    \n\x05\x05\0\x02\x08\x02\x12\x03\x0b\x12\x14\n\x0b\n\x04\x05\0\x02\t\x12\
-    \x03\x0c\x04\x15\n\x0c\n\x05\x05\0\x02\t\x01\x12\x03\x0c\x04\x0f\n\x0c\n\
-    \x05\x05\0\x02\t\x02\x12\x03\x0c\x12\x14\n\x0b\n\x04\x05\0\x02\n\x12\x03\
-    \r\x04\x16\n\x0c\n\x05\x05\0\x02\n\x01\x12\x03\r\x04\x10\n\x0c\n\x05\x05\
-    \0\x02\n\x02\x12\x03\r\x13\x15\n\x0b\n\x04\x05\0\x02\x0b\x12\x03\x0e\x04\
-    \x1b\n\x0c\n\x05\x05\0\x02\x0b\x01\x12\x03\x0e\x04\x14\n\x0c\n\x05\x05\0\
-    \x02\x0b\x02\x12\x03\x0e\x17\x1a\n\x0b\n\x04\x05\0\x02\x0c\x12\x03\x0f\
-    \x04\x18\n\x0c\n\x05\x05\0\x02\x0c\x01\x12\x03\x0f\x04\x10\n\x0c\n\x05\
-    \x05\0\x02\x0c\x02\x12\x03\x0f\x13\x17b\x06proto3\
+    \x0cTrashUpdated\x10\xe8\x07b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 56
frontend/rust-lib/flowy-folder/src/protobuf/model/event_map.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 pub enum FolderEvent {
 pub enum FolderEvent {
@@ -155,60 +155,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x0e\n\tReadTrash\x10\xac\x02\x12\x11\n\x0cPutbackTrash\x10\xad\x02\x12\
     \x0e\n\tReadTrash\x10\xac\x02\x12\x11\n\x0cPutbackTrash\x10\xad\x02\x12\
     \x10\n\x0bDeleteTrash\x10\xae\x02\x12\x14\n\x0fRestoreAllTrash\x10\xaf\
     \x10\n\x0bDeleteTrash\x10\xae\x02\x12\x14\n\x0fRestoreAllTrash\x10\xaf\
     \x02\x12\x13\n\x0eDeleteAllTrash\x10\xb0\x02\x12\x12\n\rApplyDocDelta\
     \x02\x12\x13\n\x0eDeleteAllTrash\x10\xb0\x02\x12\x12\n\rApplyDocDelta\
-    \x10\x90\x03\x12\x13\n\x0eExportDocument\x10\xf4\x03J\xab\x08\n\x06\x12\
-    \x04\0\0\x1c\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x05\0\x12\x04\
-    \x02\0\x1c\x01\n\n\n\x03\x05\0\x01\x12\x03\x02\x05\x10\n\x0b\n\x04\x05\0\
-    \x02\0\x12\x03\x03\x04\x18\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x03\x04\
-    \x13\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x03\x16\x17\n\x0b\n\x04\x05\0\
-    \x02\x01\x12\x03\x04\x04\x19\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x04\
-    \x04\x14\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x04\x17\x18\n\x0b\n\x04\
-    \x05\0\x02\x02\x12\x03\x05\x04\x17\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\
-    \x05\x04\x12\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x05\x15\x16\n\x0b\n\
-    \x04\x05\0\x02\x03\x12\x03\x06\x04\x18\n\x0c\n\x05\x05\0\x02\x03\x01\x12\
-    \x03\x06\x04\x13\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\x06\x16\x17\n\x0b\
-    \n\x04\x05\0\x02\x04\x12\x03\x07\x04\x16\n\x0c\n\x05\x05\0\x02\x04\x01\
-    \x12\x03\x07\x04\x11\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x07\x14\x15\n\
-    \x0b\n\x04\x05\0\x02\x05\x12\x03\x08\x04\x1a\n\x0c\n\x05\x05\0\x02\x05\
-    \x01\x12\x03\x08\x04\x15\n\x0c\n\x05\x05\0\x02\x05\x02\x12\x03\x08\x18\
-    \x19\n\x0b\n\x04\x05\0\x02\x06\x12\x03\t\x04\x14\n\x0c\n\x05\x05\0\x02\
-    \x06\x01\x12\x03\t\x04\r\n\x0c\n\x05\x05\0\x02\x06\x02\x12\x03\t\x10\x13\
-    \n\x0b\n\x04\x05\0\x02\x07\x12\x03\n\x04\x14\n\x0c\n\x05\x05\0\x02\x07\
-    \x01\x12\x03\n\x04\r\n\x0c\n\x05\x05\0\x02\x07\x02\x12\x03\n\x10\x13\n\
-    \x0b\n\x04\x05\0\x02\x08\x12\x03\x0b\x04\x12\n\x0c\n\x05\x05\0\x02\x08\
-    \x01\x12\x03\x0b\x04\x0b\n\x0c\n\x05\x05\0\x02\x08\x02\x12\x03\x0b\x0e\
-    \x11\n\x0b\n\x04\x05\0\x02\t\x12\x03\x0c\x04\x14\n\x0c\n\x05\x05\0\x02\t\
-    \x01\x12\x03\x0c\x04\r\n\x0c\n\x05\x05\0\x02\t\x02\x12\x03\x0c\x10\x13\n\
-    \x0b\n\x04\x05\0\x02\n\x12\x03\r\x04\x15\n\x0c\n\x05\x05\0\x02\n\x01\x12\
-    \x03\r\x04\x0e\n\x0c\n\x05\x05\0\x02\n\x02\x12\x03\r\x11\x14\n\x0b\n\x04\
-    \x05\0\x02\x0b\x12\x03\x0e\x04\x13\n\x0c\n\x05\x05\0\x02\x0b\x01\x12\x03\
-    \x0e\x04\x0c\n\x0c\n\x05\x05\0\x02\x0b\x02\x12\x03\x0e\x0f\x12\n\x0b\n\
-    \x04\x05\0\x02\x0c\x12\x03\x0f\x04\x15\n\x0c\n\x05\x05\0\x02\x0c\x01\x12\
-    \x03\x0f\x04\x0e\n\x0c\n\x05\x05\0\x02\x0c\x02\x12\x03\x0f\x11\x14\n\x0b\
-    \n\x04\x05\0\x02\r\x12\x03\x10\x04\x15\n\x0c\n\x05\x05\0\x02\r\x01\x12\
-    \x03\x10\x04\x0e\n\x0c\n\x05\x05\0\x02\r\x02\x12\x03\x10\x11\x14\n\x0b\n\
-    \x04\x05\0\x02\x0e\x12\x03\x11\x04\x18\n\x0c\n\x05\x05\0\x02\x0e\x01\x12\
-    \x03\x11\x04\x11\n\x0c\n\x05\x05\0\x02\x0e\x02\x12\x03\x11\x14\x17\n\x0b\
-    \n\x04\x05\0\x02\x0f\x12\x03\x12\x04\x13\n\x0c\n\x05\x05\0\x02\x0f\x01\
-    \x12\x03\x12\x04\x0c\n\x0c\n\x05\x05\0\x02\x0f\x02\x12\x03\x12\x0f\x12\n\
-    \x0b\n\x04\x05\0\x02\x10\x12\x03\x13\x04\x17\n\x0c\n\x05\x05\0\x02\x10\
-    \x01\x12\x03\x13\x04\x10\n\x0c\n\x05\x05\0\x02\x10\x02\x12\x03\x13\x13\
-    \x16\n\x0b\n\x04\x05\0\x02\x11\x12\x03\x14\x04\x14\n\x0c\n\x05\x05\0\x02\
-    \x11\x01\x12\x03\x14\x04\r\n\x0c\n\x05\x05\0\x02\x11\x02\x12\x03\x14\x10\
-    \x13\n\x0b\n\x04\x05\0\x02\x12\x12\x03\x15\x04\x14\n\x0c\n\x05\x05\0\x02\
-    \x12\x01\x12\x03\x15\x04\r\n\x0c\n\x05\x05\0\x02\x12\x02\x12\x03\x15\x10\
-    \x13\n\x0b\n\x04\x05\0\x02\x13\x12\x03\x16\x04\x17\n\x0c\n\x05\x05\0\x02\
-    \x13\x01\x12\x03\x16\x04\x10\n\x0c\n\x05\x05\0\x02\x13\x02\x12\x03\x16\
-    \x13\x16\n\x0b\n\x04\x05\0\x02\x14\x12\x03\x17\x04\x16\n\x0c\n\x05\x05\0\
-    \x02\x14\x01\x12\x03\x17\x04\x0f\n\x0c\n\x05\x05\0\x02\x14\x02\x12\x03\
-    \x17\x12\x15\n\x0b\n\x04\x05\0\x02\x15\x12\x03\x18\x04\x1a\n\x0c\n\x05\
-    \x05\0\x02\x15\x01\x12\x03\x18\x04\x13\n\x0c\n\x05\x05\0\x02\x15\x02\x12\
-    \x03\x18\x16\x19\n\x0b\n\x04\x05\0\x02\x16\x12\x03\x19\x04\x19\n\x0c\n\
-    \x05\x05\0\x02\x16\x01\x12\x03\x19\x04\x12\n\x0c\n\x05\x05\0\x02\x16\x02\
-    \x12\x03\x19\x15\x18\n\x0b\n\x04\x05\0\x02\x17\x12\x03\x1a\x04\x18\n\x0c\
-    \n\x05\x05\0\x02\x17\x01\x12\x03\x1a\x04\x11\n\x0c\n\x05\x05\0\x02\x17\
-    \x02\x12\x03\x1a\x14\x17\n\x0b\n\x04\x05\0\x02\x18\x12\x03\x1b\x04\x19\n\
-    \x0c\n\x05\x05\0\x02\x18\x01\x12\x03\x1b\x04\x12\n\x0c\n\x05\x05\0\x02\
-    \x18\x02\x12\x03\x1b\x15\x18b\x06proto3\
+    \x10\x90\x03\x12\x13\n\x0eExportDocument\x10\xf4\x03b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 1 - 1
frontend/rust-lib/flowy-folder/src/services/app/controller.rs

@@ -169,7 +169,7 @@ impl AppController {
             loop {
             loop {
                 let mut stream = Box::pin(rx.recv().into_stream().filter_map(|result| async move {
                 let mut stream = Box::pin(rx.recv().into_stream().filter_map(|result| async move {
                     match result {
                     match result {
-                        Ok(event) => event.select(TrashType::App),
+                        Ok(event) => event.select(TrashType::TrashApp),
                         Err(_e) => None,
                         Err(_e) => None,
                     }
                     }
                 }));
                 }));

+ 1 - 1
frontend/rust-lib/flowy-folder/src/services/persistence/version_1/app_sql.rs

@@ -118,7 +118,7 @@ impl std::convert::From<AppTable> for Trash {
             name: table.name,
             name: table.name,
             modified_time: table.modified_time,
             modified_time: table.modified_time,
             create_time: table.create_time,
             create_time: table.create_time,
-            ty: TrashType::App,
+            ty: TrashType::TrashApp,
         }
         }
     }
     }
 }
 }

+ 4 - 4
frontend/rust-lib/flowy-folder/src/services/persistence/version_1/trash_sql.rs

@@ -129,8 +129,8 @@ impl std::convert::From<SqlTrashType> for TrashType {
     fn from(ty: SqlTrashType) -> Self {
     fn from(ty: SqlTrashType) -> Self {
         match ty {
         match ty {
             SqlTrashType::Unknown => TrashType::Unknown,
             SqlTrashType::Unknown => TrashType::Unknown,
-            SqlTrashType::View => TrashType::View,
-            SqlTrashType::App => TrashType::App,
+            SqlTrashType::View => TrashType::TrashView,
+            SqlTrashType::App => TrashType::TrashApp,
         }
         }
     }
     }
 }
 }
@@ -139,8 +139,8 @@ impl std::convert::From<TrashType> for SqlTrashType {
     fn from(ty: TrashType) -> Self {
     fn from(ty: TrashType) -> Self {
         match ty {
         match ty {
             TrashType::Unknown => SqlTrashType::Unknown,
             TrashType::Unknown => SqlTrashType::Unknown,
-            TrashType::View => SqlTrashType::View,
-            TrashType::App => SqlTrashType::App,
+            TrashType::TrashView => SqlTrashType::View,
+            TrashType::TrashApp => SqlTrashType::App,
         }
         }
     }
     }
 }
 }

+ 1 - 1
frontend/rust-lib/flowy-folder/src/services/persistence/version_1/view_sql.rs

@@ -174,7 +174,7 @@ impl std::convert::From<ViewTable> for Trash {
             name: table.name,
             name: table.name,
             modified_time: table.modified_time,
             modified_time: table.modified_time,
             create_time: table.create_time,
             create_time: table.create_time,
-            ty: TrashType::View,
+            ty: TrashType::TrashView,
         }
         }
     }
     }
 }
 }

+ 1 - 1
frontend/rust-lib/flowy-folder/src/services/view/controller.rs

@@ -315,7 +315,7 @@ impl ViewController {
             loop {
             loop {
                 let mut stream = Box::pin(rx.recv().into_stream().filter_map(|result| async move {
                 let mut stream = Box::pin(rx.recv().into_stream().filter_map(|result| async move {
                     match result {
                     match result {
-                        Ok(event) => event.select(TrashType::View),
+                        Ok(event) => event.select(TrashType::TrashView),
                         Err(_e) => None,
                         Err(_e) => None,
                     }
                     }
                 }));
                 }));

+ 2 - 2
frontend/rust-lib/flowy-folder/tests/workspace/helper.rs

@@ -180,7 +180,7 @@ pub async fn read_trash(sdk: &FlowySDKTest) -> RepeatedTrash {
 pub async fn restore_app_from_trash(sdk: &FlowySDKTest, app_id: &str) {
 pub async fn restore_app_from_trash(sdk: &FlowySDKTest, app_id: &str) {
     let id = TrashId {
     let id = TrashId {
         id: app_id.to_owned(),
         id: app_id.to_owned(),
-        ty: TrashType::App,
+        ty: TrashType::TrashApp,
     };
     };
     FolderEventBuilder::new(sdk.clone())
     FolderEventBuilder::new(sdk.clone())
         .event(PutbackTrash)
         .event(PutbackTrash)
@@ -192,7 +192,7 @@ pub async fn restore_app_from_trash(sdk: &FlowySDKTest, app_id: &str) {
 pub async fn restore_view_from_trash(sdk: &FlowySDKTest, view_id: &str) {
 pub async fn restore_view_from_trash(sdk: &FlowySDKTest, view_id: &str) {
     let id = TrashId {
     let id = TrashId {
         id: view_id.to_owned(),
         id: view_id.to_owned(),
-        ty: TrashType::View,
+        ty: TrashType::TrashView,
     };
     };
     FolderEventBuilder::new(sdk.clone())
     FolderEventBuilder::new(sdk.clone())
         .event(PutbackTrash)
         .event(PutbackTrash)

+ 4 - 1
frontend/rust-lib/flowy-net/Cargo.toml

@@ -39,4 +39,7 @@ serde = { version = "1.0", features = ["derive"] }
 serde_json = "1.0"
 serde_json = "1.0"
 
 
 [features]
 [features]
-http_server = []
+http_server = []
+
+[build-dependencies]
+lib-infra = { path = "../../../shared-lib/lib-infra", features = ["gen_pb"] }

+ 5 - 0
frontend/rust-lib/flowy-net/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("flowy-net", "./src/protobuf/proto");
+}

+ 3 - 7
frontend/rust-lib/flowy-net/src/protobuf/model/event.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 pub enum NetworkEvent {
 pub enum NetworkEvent {
@@ -72,11 +72,7 @@ impl ::protobuf::reflect::ProtobufValue for NetworkEvent {
 
 
 static file_descriptor_proto_data: &'static [u8] = b"\
 static file_descriptor_proto_data: &'static [u8] = b"\
     \n\x0bevent.proto*%\n\x0cNetworkEvent\x12\x15\n\x11UpdateNetworkType\x10\
     \n\x0bevent.proto*%\n\x0cNetworkEvent\x12\x15\n\x11UpdateNetworkType\x10\
-    \0JS\n\x06\x12\x04\0\0\x04\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\
-    \x05\0\x12\x04\x02\0\x04\x01\n\n\n\x03\x05\0\x01\x12\x03\x02\x05\x11\n\
-    \x0b\n\x04\x05\0\x02\0\x12\x03\x03\x04\x1a\n\x0c\n\x05\x05\0\x02\0\x01\
-    \x12\x03\x03\x04\x15\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x03\x18\x19b\
-    \x06proto3\
+    \0b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 17
frontend/rust-lib/flowy-net/src/protobuf/model/network_state.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct NetworkState {
 pub struct NetworkState {
@@ -231,21 +231,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \n\x13network_state.proto\",\n\x0cNetworkState\x12\x1c\n\x02ty\x18\x01\
     \n\x13network_state.proto\",\n\x0cNetworkState\x12\x1c\n\x02ty\x18\x01\
     \x20\x01(\x0e2\x0c.NetworkTypeR\x02ty*G\n\x0bNetworkType\x12\x16\n\x12Un\
     \x20\x01(\x0e2\x0c.NetworkTypeR\x02ty*G\n\x0bNetworkType\x12\x16\n\x12Un\
     knownNetworkType\x10\0\x12\x08\n\x04Wifi\x10\x01\x12\x08\n\x04Cell\x10\
     knownNetworkType\x10\0\x12\x08\n\x04Wifi\x10\x01\x12\x08\n\x04Cell\x10\
-    \x02\x12\x0c\n\x08Ethernet\x10\x03J\x9d\x02\n\x06\x12\x04\0\0\n\x01\n\
-    \x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x04\x01\n\n\
-    \n\x03\x04\0\x01\x12\x03\x02\x08\x14\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\
-    \x04\x17\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x03\x04\x0f\n\x0c\n\x05\x04\
-    \0\x02\0\x01\x12\x03\x03\x10\x12\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\
-    \x15\x16\n\n\n\x02\x05\0\x12\x04\x05\0\n\x01\n\n\n\x03\x05\0\x01\x12\x03\
-    \x05\x05\x10\n\x0b\n\x04\x05\0\x02\0\x12\x03\x06\x04\x1b\n\x0c\n\x05\x05\
-    \0\x02\0\x01\x12\x03\x06\x04\x16\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x06\
-    \x19\x1a\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x07\x04\r\n\x0c\n\x05\x05\0\
-    \x02\x01\x01\x12\x03\x07\x04\x08\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\
-    \x07\x0b\x0c\n\x0b\n\x04\x05\0\x02\x02\x12\x03\x08\x04\r\n\x0c\n\x05\x05\
-    \0\x02\x02\x01\x12\x03\x08\x04\x08\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\
-    \x08\x0b\x0c\n\x0b\n\x04\x05\0\x02\x03\x12\x03\t\x04\x11\n\x0c\n\x05\x05\
-    \0\x02\x03\x01\x12\x03\t\x04\x0c\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\t\
-    \x0f\x10b\x06proto3\
+    \x02\x12\x0c\n\x08Ethernet\x10\x03b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 4 - 1
frontend/rust-lib/flowy-user/Cargo.toml

@@ -44,4 +44,7 @@ futures = "0.3.15"
 serial_test = "0.5.1"
 serial_test = "0.5.1"
 
 
 [features]
 [features]
-http_server = []
+http_server = []
+
+[build-dependencies]
+lib-infra = { path = "../../../shared-lib/lib-infra", features = ["gen_pb"] }

+ 5 - 0
frontend/rust-lib/flowy-user/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("flowy-user", "./src/protobuf/proto");
+}

+ 3 - 15
frontend/rust-lib/flowy-user/src/protobuf/model/dart_notification.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 pub enum UserNotification {
 pub enum UserNotification {
@@ -86,19 +86,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \n\x17dart_notification.proto*\x81\x01\n\x10UserNotification\x12\x0b\n\
     \n\x17dart_notification.proto*\x81\x01\n\x10UserNotification\x12\x0b\n\
     \x07Unknown\x10\0\x12\x13\n\x0fUserAuthChanged\x10\x01\x12\x16\n\x12User\
     \x07Unknown\x10\0\x12\x13\n\x0fUserAuthChanged\x10\x01\x12\x16\n\x12User\
     ProfileUpdated\x10\x02\x12\x14\n\x10UserUnauthorized\x10\x03\x12\x1d\n\
     ProfileUpdated\x10\x02\x12\x14\n\x10UserUnauthorized\x10\x03\x12\x1d\n\
-    \x19UserWsConnectStateChanged\x10\x04J\xf7\x01\n\x06\x12\x04\0\0\x08\x01\
-    \n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x05\0\x12\x04\x02\0\x08\x01\n\
-    \n\n\x03\x05\0\x01\x12\x03\x02\x05\x15\n\x0b\n\x04\x05\0\x02\0\x12\x03\
-    \x03\x04\x10\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x03\x04\x0b\n\x0c\n\x05\
-    \x05\0\x02\0\x02\x12\x03\x03\x0e\x0f\n\x0b\n\x04\x05\0\x02\x01\x12\x03\
-    \x04\x04\x18\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x04\x04\x13\n\x0c\n\
-    \x05\x05\0\x02\x01\x02\x12\x03\x04\x16\x17\n\x0b\n\x04\x05\0\x02\x02\x12\
-    \x03\x05\x04\x1b\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x05\x04\x16\n\x0c\
-    \n\x05\x05\0\x02\x02\x02\x12\x03\x05\x19\x1a\n\x0b\n\x04\x05\0\x02\x03\
-    \x12\x03\x06\x04\x19\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\x06\x04\x14\n\
-    \x0c\n\x05\x05\0\x02\x03\x02\x12\x03\x06\x17\x18\n\x0b\n\x04\x05\0\x02\
-    \x04\x12\x03\x07\x04\"\n\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x07\x04\x1d\
-    \n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x07\x20!b\x06proto3\
+    \x19UserWsConnectStateChanged\x10\x04b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 23
frontend/rust-lib/flowy-user/src/protobuf/model/event_map.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 pub enum UserEvent {
 pub enum UserEvent {
@@ -99,27 +99,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x12\n\n\x06SignIn\x10\x01\x12\n\n\x06SignUp\x10\x02\x12\x0b\n\x07SignOu\
     \x12\n\n\x06SignIn\x10\x01\x12\n\n\x06SignUp\x10\x02\x12\x0b\n\x07SignOu\
     t\x10\x03\x12\x0e\n\nUpdateUser\x10\x04\x12\x12\n\x0eGetUserProfile\x10\
     t\x10\x03\x12\x0e\n\nUpdateUser\x10\x04\x12\x12\n\x0eGetUserProfile\x10\
     \x05\x12\r\n\tCheckUser\x10\x06\x12\x18\n\x14SetAppearanceSetting\x10\
     \x05\x12\r\n\tCheckUser\x10\x06\x12\x18\n\x14SetAppearanceSetting\x10\
-    \x07\x12\x18\n\x14GetAppearanceSetting\x10\x08J\x9b\x03\n\x06\x12\x04\0\
-    \0\x0c\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x05\0\x12\x04\x02\0\
-    \x0c\x01\n\n\n\x03\x05\0\x01\x12\x03\x02\x05\x0e\n\x0b\n\x04\x05\0\x02\0\
-    \x12\x03\x03\x04\x11\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x03\x04\x0c\n\
-    \x0c\n\x05\x05\0\x02\0\x02\x12\x03\x03\x0f\x10\n\x0b\n\x04\x05\0\x02\x01\
-    \x12\x03\x04\x04\x0f\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x04\x04\n\n\
-    \x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x04\r\x0e\n\x0b\n\x04\x05\0\x02\x02\
-    \x12\x03\x05\x04\x0f\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\x05\x04\n\n\
-    \x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x05\r\x0e\n\x0b\n\x04\x05\0\x02\x03\
-    \x12\x03\x06\x04\x10\n\x0c\n\x05\x05\0\x02\x03\x01\x12\x03\x06\x04\x0b\n\
-    \x0c\n\x05\x05\0\x02\x03\x02\x12\x03\x06\x0e\x0f\n\x0b\n\x04\x05\0\x02\
-    \x04\x12\x03\x07\x04\x13\n\x0c\n\x05\x05\0\x02\x04\x01\x12\x03\x07\x04\
-    \x0e\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x07\x11\x12\n\x0b\n\x04\x05\0\
-    \x02\x05\x12\x03\x08\x04\x17\n\x0c\n\x05\x05\0\x02\x05\x01\x12\x03\x08\
-    \x04\x12\n\x0c\n\x05\x05\0\x02\x05\x02\x12\x03\x08\x15\x16\n\x0b\n\x04\
-    \x05\0\x02\x06\x12\x03\t\x04\x12\n\x0c\n\x05\x05\0\x02\x06\x01\x12\x03\t\
-    \x04\r\n\x0c\n\x05\x05\0\x02\x06\x02\x12\x03\t\x10\x11\n\x0b\n\x04\x05\0\
-    \x02\x07\x12\x03\n\x04\x1d\n\x0c\n\x05\x05\0\x02\x07\x01\x12\x03\n\x04\
-    \x18\n\x0c\n\x05\x05\0\x02\x07\x02\x12\x03\n\x1b\x1c\n\x0b\n\x04\x05\0\
-    \x02\x08\x12\x03\x0b\x04\x1d\n\x0c\n\x05\x05\0\x02\x08\x01\x12\x03\x0b\
-    \x04\x18\n\x0c\n\x05\x05\0\x02\x08\x02\x12\x03\x0b\x1b\x1cb\x06proto3\
+    \x07\x12\x18\n\x14GetAppearanceSetting\x10\x08b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 192 - 4
shared-lib/Cargo.lock

@@ -109,6 +109,17 @@ version = "1.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
 checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8"
 
 
+[[package]]
+name = "cargo_toml"
+version = "0.11.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4e270ef0cd868745878982f7ce470aa898d0d4bb248af67f0cf66f54617913ef"
+dependencies = [
+ "serde",
+ "serde_derive",
+ "toml",
+]
+
 [[package]]
 [[package]]
 name = "cfg-if"
 name = "cfg-if"
 version = "1.0.0"
 version = "1.0.0"
@@ -137,6 +148,31 @@ dependencies = [
  "autocfg",
  "autocfg",
 ]
 ]
 
 
+[[package]]
+name = "cmd_lib"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ba0f413777386d37f85afa5242f277a7b461905254c1af3c339d4af06800f62"
+dependencies = [
+ "cmd_lib_macros",
+ "faccess",
+ "lazy_static",
+ "log",
+ "os_pipe",
+]
+
+[[package]]
+name = "cmd_lib_macros"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9e66605092ff6c6e37e0246601ae6c3f62dc1880e0599359b5f303497c112dc0"
+dependencies = [
+ "proc-macro-error",
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
 [[package]]
 [[package]]
 name = "convert_case"
 name = "convert_case"
 version = "0.4.0"
 version = "0.4.0"
@@ -190,6 +226,12 @@ version = "1.0.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "31ad93652f40969dead8d4bf897a41e9462095152eb21c56e5830537e41179dd"
 checksum = "31ad93652f40969dead8d4bf897a41e9462095152eb21c56e5830537e41179dd"
 
 
+[[package]]
+name = "either"
+version = "1.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
+
 [[package]]
 [[package]]
 name = "env_logger"
 name = "env_logger"
 version = "0.7.1"
 version = "0.7.1"
@@ -219,9 +261,21 @@ version = "0.1.0"
 dependencies = [
 dependencies = [
  "derive_more",
  "derive_more",
  "flowy-derive",
  "flowy-derive",
+ "lib-infra",
  "protobuf",
  "protobuf",
 ]
 ]
 
 
+[[package]]
+name = "faccess"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e039175679baf763ddddf4f76900b92d4dae9411ee88cf42d2f11b976b09e07c"
+dependencies = [
+ "bitflags",
+ "libc",
+ "winapi",
+]
+
 [[package]]
 [[package]]
 name = "fake"
 name = "fake"
 version = "2.3.0"
 version = "2.3.0"
@@ -241,6 +295,15 @@ dependencies = [
  "regex",
  "regex",
 ]
 ]
 
 
+[[package]]
+name = "fastrand"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"
+dependencies = [
+ "instant",
+]
+
 [[package]]
 [[package]]
 name = "flowy-ast"
 name = "flowy-ast"
 version = "0.1.0"
 version = "0.1.0"
@@ -299,6 +362,7 @@ dependencies = [
  "derive_more",
  "derive_more",
  "error-code",
  "error-code",
  "flowy-derive",
  "flowy-derive",
+ "lib-infra",
  "log",
  "log",
  "protobuf",
  "protobuf",
  "serde",
  "serde",
@@ -322,6 +386,7 @@ dependencies = [
  "flowy-derive",
  "flowy-derive",
  "futures",
  "futures",
  "lazy_static",
  "lazy_static",
+ "lib-infra",
  "log",
  "log",
  "protobuf",
  "protobuf",
  "quickcheck",
  "quickcheck",
@@ -558,13 +623,17 @@ name = "lib-infra"
 version = "0.1.0"
 version = "0.1.0"
 dependencies = [
 dependencies = [
  "bytes",
  "bytes",
+ "cargo_toml",
  "chrono",
  "chrono",
+ "cmd_lib",
  "futures-core",
  "futures-core",
  "log",
  "log",
  "pin-project",
  "pin-project",
+ "protoc-rust",
  "rand 0.8.4",
  "rand 0.8.4",
  "tokio",
  "tokio",
  "uuid",
  "uuid",
+ "walkdir",
 ]
 ]
 
 
 [[package]]
 [[package]]
@@ -728,6 +797,16 @@ version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
 checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
 
 
+[[package]]
+name = "os_pipe"
+version = "0.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb233f06c2307e1f5ce2ecad9f8121cffbbee2c95428f44ea85222e460d0d213"
+dependencies = [
+ "libc",
+ "winapi",
+]
+
 [[package]]
 [[package]]
 name = "parking_lot"
 name = "parking_lot"
 version = "0.11.2"
 version = "0.11.2"
@@ -812,6 +891,30 @@ version = "0.2.15"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"
 checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba"
 
 
+[[package]]
+name = "proc-macro-error"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
+dependencies = [
+ "proc-macro-error-attr",
+ "proc-macro2",
+ "quote",
+ "syn",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro-error-attr"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "version_check",
+]
+
 [[package]]
 [[package]]
 name = "proc-macro-hack"
 name = "proc-macro-hack"
 version = "0.5.19"
 version = "0.5.19"
@@ -839,6 +942,37 @@ version = "2.25.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "47c327e191621a2158159df97cdbc2e7074bb4e940275e35abf38eb3d2595754"
 checksum = "47c327e191621a2158159df97cdbc2e7074bb4e940275e35abf38eb3d2595754"
 
 
+[[package]]
+name = "protobuf-codegen"
+version = "2.25.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3df8c98c08bd4d6653c2dbae00bd68c1d1d82a360265a5b0bbc73d48c63cb853"
+dependencies = [
+ "protobuf",
+]
+
+[[package]]
+name = "protoc"
+version = "2.25.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ac70cfc8935f5db2a29c0929db697035d02284011a9b78a5ef5d48092ce9673"
+dependencies = [
+ "log",
+ "which",
+]
+
+[[package]]
+name = "protoc-rust"
+version = "2.25.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6bad71c8404e3e09024fccbab55aae36e3662662167dc4530a242c8cc8ef8d20"
+dependencies = [
+ "protobuf",
+ "protobuf-codegen",
+ "protoc",
+ "tempfile",
+]
+
 [[package]]
 [[package]]
 name = "quickcheck"
 name = "quickcheck"
 version = "0.9.2"
 version = "0.9.2"
@@ -978,6 +1112,15 @@ version = "0.6.25"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
 checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
 
 
+[[package]]
+name = "remove_dir_all"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
+dependencies = [
+ "winapi",
+]
+
 [[package]]
 [[package]]
 name = "rustc_version"
 name = "rustc_version"
 version = "0.3.3"
 version = "0.3.3"
@@ -993,6 +1136,15 @@ version = "1.0.5"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
 checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
 
 
+[[package]]
+name = "same-file"
+version = "1.0.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
+dependencies = [
+ "winapi-util",
+]
+
 [[package]]
 [[package]]
 name = "scopeguard"
 name = "scopeguard"
 version = "1.1.0"
 version = "1.1.0"
@@ -1019,18 +1171,18 @@ dependencies = [
 
 
 [[package]]
 [[package]]
 name = "serde"
 name = "serde"
-version = "1.0.130"
+version = "1.0.136"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913"
+checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
 dependencies = [
 dependencies = [
  "serde_derive",
  "serde_derive",
 ]
 ]
 
 
 [[package]]
 [[package]]
 name = "serde_derive"
 name = "serde_derive"
-version = "1.0.130"
+version = "1.0.136"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b"
+checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
 dependencies = [
 dependencies = [
  "proc-macro2",
  "proc-macro2",
  "quote",
  "quote",
@@ -1133,6 +1285,20 @@ dependencies = [
  "unicode-xid",
  "unicode-xid",
 ]
 ]
 
 
+[[package]]
+name = "tempfile"
+version = "3.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
+dependencies = [
+ "cfg-if",
+ "fastrand",
+ "libc",
+ "redox_syscall",
+ "remove_dir_all",
+ "winapi",
+]
+
 [[package]]
 [[package]]
 name = "termcolor"
 name = "termcolor"
 version = "1.1.2"
 version = "1.1.2"
@@ -1402,6 +1568,17 @@ version = "0.9.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
 checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe"
 
 
+[[package]]
+name = "walkdir"
+version = "2.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
+dependencies = [
+ "same-file",
+ "winapi",
+ "winapi-util",
+]
+
 [[package]]
 [[package]]
 name = "wasi"
 name = "wasi"
 version = "0.9.0+wasi-snapshot-preview1"
 version = "0.9.0+wasi-snapshot-preview1"
@@ -1414,6 +1591,17 @@ version = "0.10.0+wasi-snapshot-preview1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
 checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f"
 
 
+[[package]]
+name = "which"
+version = "4.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2a5a7e487e921cf220206864a94a89b6c6905bfc19f1057fa26a4cb360e5c1d2"
+dependencies = [
+ "either",
+ "lazy_static",
+ "libc",
+]
+
 [[package]]
 [[package]]
 name = "winapi"
 name = "winapi"
 version = "0.3.9"
 version = "0.3.9"

+ 4 - 1
shared-lib/error-code/Cargo.toml

@@ -8,4 +8,7 @@ edition = "2018"
 [dependencies]
 [dependencies]
 flowy-derive = { path = "../flowy-derive" }
 flowy-derive = { path = "../flowy-derive" }
 protobuf = {version = "2.18.0"}
 protobuf = {version = "2.18.0"}
-derive_more = {version = "0.99", features = ["display"]}
+derive_more = {version = "0.99", features = ["display"]}
+
+[build-dependencies]
+lib-infra = { path = "../lib-infra", features = ["gen_pb"] }

+ 5 - 0
shared-lib/error-code/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("error-code", "./src/protobuf/proto");
+}

+ 4 - 66
shared-lib/error-code/src/protobuf/model/error_code.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 pub enum ErrorCode {
 pub enum ErrorCode {
@@ -174,70 +174,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     dFormatInvalid\x10\xb2\x02\x12\x15\n\x10PasswordNotMatch\x10\xb3\x02\x12\
     dFormatInvalid\x10\xb2\x02\x12\x15\n\x10PasswordNotMatch\x10\xb3\x02\x12\
     \x14\n\x0fUserNameTooLong\x10\xb4\x02\x12'\n\"UserNameContainForbiddenCh\
     \x14\n\x0fUserNameTooLong\x10\xb4\x02\x12'\n\"UserNameContainForbiddenCh\
     aracters\x10\xb5\x02\x12\x14\n\x0fUserNameIsEmpty\x10\xb6\x02\x12\x12\n\
     aracters\x10\xb5\x02\x12\x14\n\x0fUserNameIsEmpty\x10\xb6\x02\x12\x12\n\
-    \rUserIdInvalid\x10\xb7\x02\x12\x11\n\x0cUserNotExist\x10\xb8\x02J\xf8\t\
-    \n\x06\x12\x04\0\0!\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x05\0\
-    \x12\x04\x02\0!\x01\n\n\n\x03\x05\0\x01\x12\x03\x02\x05\x0e\n\x0b\n\x04\
-    \x05\0\x02\0\x12\x03\x03\x04\x11\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x03\
-    \x04\x0c\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x03\x0f\x10\n\x0b\n\x04\x05\
-    \0\x02\x01\x12\x03\x04\x04\x19\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x04\
-    \x04\x14\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x04\x17\x18\n\x0b\n\x04\
-    \x05\0\x02\x02\x12\x03\x05\x04\x17\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\
-    \x05\x04\x12\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x05\x15\x16\n\x0b\n\
-    \x04\x05\0\x02\x03\x12\x03\x06\x04\x1f\n\x0c\n\x05\x05\0\x02\x03\x01\x12\
-    \x03\x06\x04\x18\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\x06\x1b\x1e\n\x0b\
-    \n\x04\x05\0\x02\x04\x12\x03\x07\x04\x1d\n\x0c\n\x05\x05\0\x02\x04\x01\
-    \x12\x03\x07\x04\x16\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x07\x19\x1c\n\
-    \x0b\n\x04\x05\0\x02\x05\x12\x03\x08\x04\x1f\n\x0c\n\x05\x05\0\x02\x05\
-    \x01\x12\x03\x08\x04\x18\n\x0c\n\x05\x05\0\x02\x05\x02\x12\x03\x08\x1b\
-    \x1e\n\x0b\n\x04\x05\0\x02\x06\x12\x03\t\x04\x1f\n\x0c\n\x05\x05\0\x02\
-    \x06\x01\x12\x03\t\x04\x18\n\x0c\n\x05\x05\0\x02\x06\x02\x12\x03\t\x1b\
-    \x1e\n\x0b\n\x04\x05\0\x02\x07\x12\x03\n\x04\x1f\n\x0c\n\x05\x05\0\x02\
-    \x07\x01\x12\x03\n\x04\x18\n\x0c\n\x05\x05\0\x02\x07\x02\x12\x03\n\x1b\
-    \x1e\n\x0b\n\x04\x05\0\x02\x08\x12\x03\x0b\x04\x17\n\x0c\n\x05\x05\0\x02\
-    \x08\x01\x12\x03\x0b\x04\x10\n\x0c\n\x05\x05\0\x02\x08\x02\x12\x03\x0b\
-    \x13\x16\n\x0b\n\x04\x05\0\x02\t\x12\x03\x0c\x04\x19\n\x0c\n\x05\x05\0\
-    \x02\t\x01\x12\x03\x0c\x04\x12\n\x0c\n\x05\x05\0\x02\t\x02\x12\x03\x0c\
-    \x15\x18\n\x0b\n\x04\x05\0\x02\n\x12\x03\r\x04\x1a\n\x0c\n\x05\x05\0\x02\
-    \n\x01\x12\x03\r\x04\x13\n\x0c\n\x05\x05\0\x02\n\x02\x12\x03\r\x16\x19\n\
-    \x0b\n\x04\x05\0\x02\x0b\x12\x03\x0e\x04\x1f\n\x0c\n\x05\x05\0\x02\x0b\
-    \x01\x12\x03\x0e\x04\x18\n\x0c\n\x05\x05\0\x02\x0b\x02\x12\x03\x0e\x1b\
-    \x1e\n\x0b\n\x04\x05\0\x02\x0c\x12\x03\x0f\x04\x18\n\x0c\n\x05\x05\0\x02\
-    \x0c\x01\x12\x03\x0f\x04\x11\n\x0c\n\x05\x05\0\x02\x0c\x02\x12\x03\x0f\
-    \x14\x17\n\x0b\n\x04\x05\0\x02\r\x12\x03\x10\x04\x1a\n\x0c\n\x05\x05\0\
-    \x02\r\x01\x12\x03\x10\x04\x13\n\x0c\n\x05\x05\0\x02\r\x02\x12\x03\x10\
-    \x16\x19\n\x0b\n\x04\x05\0\x02\x0e\x12\x03\x11\x04\x1a\n\x0c\n\x05\x05\0\
-    \x02\x0e\x01\x12\x03\x11\x04\x13\n\x0c\n\x05\x05\0\x02\x0e\x02\x12\x03\
-    \x11\x16\x19\n\x0b\n\x04\x05\0\x02\x0f\x12\x03\x12\x04\x1a\n\x0c\n\x05\
-    \x05\0\x02\x0f\x01\x12\x03\x12\x04\x13\n\x0c\n\x05\x05\0\x02\x0f\x02\x12\
-    \x03\x12\x16\x19\n\x0b\n\x04\x05\0\x02\x10\x12\x03\x13\x04\x17\n\x0c\n\
-    \x05\x05\0\x02\x10\x01\x12\x03\x13\x04\x10\n\x0c\n\x05\x05\0\x02\x10\x02\
-    \x12\x03\x13\x13\x16\n\x0b\n\x04\x05\0\x02\x11\x12\x03\x14\x04\x17\n\x0c\
-    \n\x05\x05\0\x02\x11\x01\x12\x03\x14\x04\x10\n\x0c\n\x05\x05\0\x02\x11\
-    \x02\x12\x03\x14\x13\x16\n\x0b\n\x04\x05\0\x02\x12\x12\x03\x15\x04\x1d\n\
-    \x0c\n\x05\x05\0\x02\x12\x01\x12\x03\x15\x04\x16\n\x0c\n\x05\x05\0\x02\
-    \x12\x02\x12\x03\x15\x19\x1c\n\x0b\n\x04\x05\0\x02\x13\x12\x03\x16\x04\
-    \x1d\n\x0c\n\x05\x05\0\x02\x13\x01\x12\x03\x16\x04\x16\n\x0c\n\x05\x05\0\
-    \x02\x13\x02\x12\x03\x16\x19\x1c\n\x0b\n\x04\x05\0\x02\x14\x12\x03\x17\
-    \x04\x1a\n\x0c\n\x05\x05\0\x02\x14\x01\x12\x03\x17\x04\x13\n\x0c\n\x05\
-    \x05\0\x02\x14\x02\x12\x03\x17\x16\x19\n\x0b\n\x04\x05\0\x02\x15\x12\x03\
-    \x18\x04\x1a\n\x0c\n\x05\x05\0\x02\x15\x01\x12\x03\x18\x04\x13\n\x0c\n\
-    \x05\x05\0\x02\x15\x02\x12\x03\x18\x16\x19\n\x0b\n\x04\x05\0\x02\x16\x12\
-    \x03\x19\x04+\n\x0c\n\x05\x05\0\x02\x16\x01\x12\x03\x19\x04$\n\x0c\n\x05\
-    \x05\0\x02\x16\x02\x12\x03\x19'*\n\x0b\n\x04\x05\0\x02\x17\x12\x03\x1a\
-    \x04\x20\n\x0c\n\x05\x05\0\x02\x17\x01\x12\x03\x1a\x04\x19\n\x0c\n\x05\
-    \x05\0\x02\x17\x02\x12\x03\x1a\x1c\x1f\n\x0b\n\x04\x05\0\x02\x18\x12\x03\
-    \x1b\x04\x1b\n\x0c\n\x05\x05\0\x02\x18\x01\x12\x03\x1b\x04\x14\n\x0c\n\
-    \x05\x05\0\x02\x18\x02\x12\x03\x1b\x17\x1a\n\x0b\n\x04\x05\0\x02\x19\x12\
-    \x03\x1c\x04\x1a\n\x0c\n\x05\x05\0\x02\x19\x01\x12\x03\x1c\x04\x13\n\x0c\
-    \n\x05\x05\0\x02\x19\x02\x12\x03\x1c\x16\x19\n\x0b\n\x04\x05\0\x02\x1a\
-    \x12\x03\x1d\x04-\n\x0c\n\x05\x05\0\x02\x1a\x01\x12\x03\x1d\x04&\n\x0c\n\
-    \x05\x05\0\x02\x1a\x02\x12\x03\x1d),\n\x0b\n\x04\x05\0\x02\x1b\x12\x03\
-    \x1e\x04\x1a\n\x0c\n\x05\x05\0\x02\x1b\x01\x12\x03\x1e\x04\x13\n\x0c\n\
-    \x05\x05\0\x02\x1b\x02\x12\x03\x1e\x16\x19\n\x0b\n\x04\x05\0\x02\x1c\x12\
-    \x03\x1f\x04\x18\n\x0c\n\x05\x05\0\x02\x1c\x01\x12\x03\x1f\x04\x11\n\x0c\
-    \n\x05\x05\0\x02\x1c\x02\x12\x03\x1f\x14\x17\n\x0b\n\x04\x05\0\x02\x1d\
-    \x12\x03\x20\x04\x17\n\x0c\n\x05\x05\0\x02\x1d\x01\x12\x03\x20\x04\x10\n\
-    \x0c\n\x05\x05\0\x02\x1d\x02\x12\x03\x20\x13\x16b\x06proto3\
+    \rUserIdInvalid\x10\xb7\x02\x12\x11\n\x0cUserNotExist\x10\xb8\x02b\x06pr\
+    oto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 0
shared-lib/flowy-collaboration/Cargo.toml

@@ -27,3 +27,6 @@ parking_lot = "0.11"
 dashmap = "4.0"
 dashmap = "4.0"
 futures = "0.3.15"
 futures = "0.3.15"
 async-stream = "0.3.2"
 async-stream = "0.3.2"
+
+[build-dependencies]
+lib-infra = { path = "../lib-infra", features = ["gen_pb"] }

+ 5 - 0
shared-lib/flowy-collaboration/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("flowy-collaboration", "./src/protobuf/proto");
+}

+ 3 - 50
shared-lib/flowy-collaboration/src/protobuf/model/document_info.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct CreateDocParams {
 pub struct CreateDocParams {
@@ -1335,54 +1335,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     ta_json\x18\x02\x20\x01(\tR\tdeltaJson\"S\n\nNewDocUser\x12\x17\n\x07use\
     ta_json\x18\x02\x20\x01(\tR\tdeltaJson\"S\n\nNewDocUser\x12\x17\n\x07use\
     r_id\x18\x01\x20\x01(\tR\x06userId\x12\x15\n\x06rev_id\x18\x02\x20\x01(\
     r_id\x18\x01\x20\x01(\tR\x06userId\x12\x15\n\x06rev_id\x18\x02\x20\x01(\
     \x03R\x05revId\x12\x15\n\x06doc_id\x18\x03\x20\x01(\tR\x05docId\"#\n\nDo\
     \x03R\x05revId\x12\x15\n\x06doc_id\x18\x03\x20\x01(\tR\x05docId\"#\n\nDo\
-    cumentId\x12\x15\n\x06doc_id\x18\x01\x20\x01(\tR\x05docIdJ\xaf\x07\n\x06\
-    \x12\x04\0\0\x1c\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\t\n\x02\x03\0\x12\
-    \x03\x01\0\x18\n\n\n\x02\x04\0\x12\x04\x03\0\x06\x01\n\n\n\x03\x04\0\x01\
-    \x12\x03\x03\x08\x17\n\x0b\n\x04\x04\0\x02\0\x12\x03\x04\x04\x12\n\x0c\n\
-    \x05\x04\0\x02\0\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\
-    \x03\x04\x0b\r\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x04\x10\x11\n\x0b\n\
-    \x04\x04\0\x02\x01\x12\x03\x05\x04#\n\x0c\n\x05\x04\0\x02\x01\x06\x12\
-    \x03\x05\x04\x14\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x05\x15\x1e\n\x0c\
-    \n\x05\x04\0\x02\x01\x03\x12\x03\x05!\"\n\n\n\x02\x04\x01\x12\x04\x07\0\
-    \x0c\x01\n\n\n\x03\x04\x01\x01\x12\x03\x07\x08\x14\n\x0b\n\x04\x04\x01\
-    \x02\0\x12\x03\x08\x04\x16\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x08\x04\
-    \n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x08\x0b\x11\n\x0c\n\x05\x04\x01\
-    \x02\0\x03\x12\x03\x08\x14\x15\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\t\x04\
-    \x14\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\x03\t\x04\n\n\x0c\n\x05\x04\x01\
-    \x02\x01\x01\x12\x03\t\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\t\
-    \x12\x13\n\x0b\n\x04\x04\x01\x02\x02\x12\x03\n\x04\x15\n\x0c\n\x05\x04\
-    \x01\x02\x02\x05\x12\x03\n\x04\t\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\
-    \n\n\x10\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\n\x13\x14\n\x0b\n\x04\
-    \x04\x01\x02\x03\x12\x03\x0b\x04\x1a\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\
-    \x03\x0b\x04\t\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\x0b\n\x15\n\x0c\n\
-    \x05\x04\x01\x02\x03\x03\x12\x03\x0b\x18\x19\n\n\n\x02\x04\x02\x12\x04\r\
-    \0\x10\x01\n\n\n\x03\x04\x02\x01\x12\x03\r\x08\x1b\n\x0b\n\x04\x04\x02\
-    \x02\0\x12\x03\x0e\x04\x16\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x0e\x04\
-    \n\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x0e\x0b\x11\n\x0c\n\x05\x04\x02\
-    \x02\0\x03\x12\x03\x0e\x14\x15\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x0f\
-    \x04#\n\x0c\n\x05\x04\x02\x02\x01\x06\x12\x03\x0f\x04\x14\n\x0c\n\x05\
-    \x04\x02\x02\x01\x01\x12\x03\x0f\x15\x1e\n\x0c\n\x05\x04\x02\x02\x01\x03\
-    \x12\x03\x0f!\"\n\n\n\x02\x04\x03\x12\x04\x11\0\x14\x01\n\n\n\x03\x04\
-    \x03\x01\x12\x03\x11\x08\x15\n\x0b\n\x04\x04\x03\x02\0\x12\x03\x12\x04\
-    \x16\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03\x12\x04\n\n\x0c\n\x05\x04\x03\
-    \x02\0\x01\x12\x03\x12\x0b\x11\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\x12\
-    \x14\x15\n\x0b\n\x04\x04\x03\x02\x01\x12\x03\x13\x04\x1a\n\x0c\n\x05\x04\
-    \x03\x02\x01\x05\x12\x03\x13\x04\n\n\x0c\n\x05\x04\x03\x02\x01\x01\x12\
-    \x03\x13\x0b\x15\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\x03\x13\x18\x19\n\n\
-    \n\x02\x04\x04\x12\x04\x15\0\x19\x01\n\n\n\x03\x04\x04\x01\x12\x03\x15\
-    \x08\x12\n\x0b\n\x04\x04\x04\x02\0\x12\x03\x16\x04\x17\n\x0c\n\x05\x04\
-    \x04\x02\0\x05\x12\x03\x16\x04\n\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03\
-    \x16\x0b\x12\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03\x16\x15\x16\n\x0b\n\
-    \x04\x04\x04\x02\x01\x12\x03\x17\x04\x15\n\x0c\n\x05\x04\x04\x02\x01\x05\
-    \x12\x03\x17\x04\t\n\x0c\n\x05\x04\x04\x02\x01\x01\x12\x03\x17\n\x10\n\
-    \x0c\n\x05\x04\x04\x02\x01\x03\x12\x03\x17\x13\x14\n\x0b\n\x04\x04\x04\
-    \x02\x02\x12\x03\x18\x04\x16\n\x0c\n\x05\x04\x04\x02\x02\x05\x12\x03\x18\
-    \x04\n\n\x0c\n\x05\x04\x04\x02\x02\x01\x12\x03\x18\x0b\x11\n\x0c\n\x05\
-    \x04\x04\x02\x02\x03\x12\x03\x18\x14\x15\n\n\n\x02\x04\x05\x12\x04\x1a\0\
-    \x1c\x01\n\n\n\x03\x04\x05\x01\x12\x03\x1a\x08\x12\n\x0b\n\x04\x04\x05\
-    \x02\0\x12\x03\x1b\x04\x16\n\x0c\n\x05\x04\x05\x02\0\x05\x12\x03\x1b\x04\
-    \n\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03\x1b\x0b\x11\n\x0c\n\x05\x04\x05\
-    \x02\0\x03\x12\x03\x1b\x14\x15b\x06proto3\
+    cumentId\x12\x15\n\x06doc_id\x18\x01\x20\x01(\tR\x05docIdb\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 16
shared-lib/flowy-collaboration/src/protobuf/model/folder_info.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct FolderInfo {
 pub struct FolderInfo {
@@ -298,20 +298,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \n\x11folder_info.proto\"t\n\nFolderInfo\x12\x1b\n\tfolder_id\x18\x01\
     \n\x11folder_info.proto\"t\n\nFolderInfo\x12\x1b\n\tfolder_id\x18\x01\
     \x20\x01(\tR\x08folderId\x12\x12\n\x04text\x18\x02\x20\x01(\tR\x04text\
     \x20\x01(\tR\x08folderId\x12\x12\n\x04text\x18\x02\x20\x01(\tR\x04text\
     \x12\x15\n\x06rev_id\x18\x03\x20\x01(\x03R\x05revId\x12\x1e\n\x0bbase_re\
     \x12\x15\n\x06rev_id\x18\x03\x20\x01(\x03R\x05revId\x12\x1e\n\x0bbase_re\
-    v_id\x18\x04\x20\x01(\x03R\tbaseRevIdJ\x86\x02\n\x06\x12\x04\0\0\x07\x01\
-    \n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x07\x01\n\
-    \n\n\x03\x04\0\x01\x12\x03\x02\x08\x12\n\x0b\n\x04\x04\0\x02\0\x12\x03\
-    \x03\x04\x19\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\
-    \x04\0\x02\0\x01\x12\x03\x03\x0b\x14\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\
-    \x03\x17\x18\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x14\n\x0c\n\x05\
-    \x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\x12\
-    \x03\x04\x0b\x0f\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x12\x13\n\x0b\
-    \n\x04\x04\0\x02\x02\x12\x03\x05\x04\x15\n\x0c\n\x05\x04\0\x02\x02\x05\
-    \x12\x03\x05\x04\t\n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x05\n\x10\n\x0c\
-    \n\x05\x04\0\x02\x02\x03\x12\x03\x05\x13\x14\n\x0b\n\x04\x04\0\x02\x03\
-    \x12\x03\x06\x04\x1a\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\x06\x04\t\n\
-    \x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x06\n\x15\n\x0c\n\x05\x04\0\x02\x03\
-    \x03\x12\x03\x06\x18\x19b\x06proto3\
+    v_id\x18\x04\x20\x01(\x03R\tbaseRevIdb\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 4 - 50
shared-lib/flowy-collaboration/src/protobuf/model/revision.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct Revision {
 pub struct Revision {
@@ -1026,54 +1026,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     value\"7\n\rRevisionRange\x12\x14\n\x05start\x18\x01\x20\x01(\x03R\x05st\
     value\"7\n\rRevisionRange\x12\x14\n\x05start\x18\x01\x20\x01(\x03R\x05st\
     art\x12\x10\n\x03end\x18\x02\x20\x01(\x03R\x03end*\"\n\rRevisionState\
     art\x12\x10\n\x03end\x18\x02\x20\x01(\x03R\x03end*\"\n\rRevisionState\
     \x12\x08\n\x04Sync\x10\0\x12\x07\n\x03Ack\x10\x01*4\n\x07RevType\x12\x13\
     \x12\x08\n\x04Sync\x10\0\x12\x07\n\x03Ack\x10\x01*4\n\x07RevType\x12\x13\
-    \n\x0fDeprecatedLocal\x10\0\x12\x14\n\x10DeprecatedRemote\x10\x01J\xb1\
-    \x07\n\x06\x12\x04\0\0\x1c\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\
-    \x04\0\x12\x04\x02\0\n\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x10\n\x0b\
-    \n\x04\x04\0\x02\0\x12\x03\x03\x04\x1a\n\x0c\n\x05\x04\0\x02\0\x05\x12\
-    \x03\x03\x04\t\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\n\x15\n\x0c\n\x05\
-    \x04\0\x02\0\x03\x12\x03\x03\x18\x19\n\x0b\n\x04\x04\0\x02\x01\x12\x03\
-    \x04\x04\x15\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\t\n\x0c\n\x05\
-    \x04\0\x02\x01\x01\x12\x03\x04\n\x10\n\x0c\n\x05\x04\0\x02\x01\x03\x12\
-    \x03\x04\x13\x14\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\x04\x19\n\x0c\n\
-    \x05\x04\0\x02\x02\x05\x12\x03\x05\x04\t\n\x0c\n\x05\x04\0\x02\x02\x01\
-    \x12\x03\x05\n\x14\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05\x17\x18\n\
-    \x0b\n\x04\x04\0\x02\x03\x12\x03\x06\x04\x13\n\x0c\n\x05\x04\0\x02\x03\
-    \x05\x12\x03\x06\x04\n\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x06\x0b\x0e\
-    \n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x06\x11\x12\n\x0b\n\x04\x04\0\x02\
-    \x04\x12\x03\x07\x04\x19\n\x0c\n\x05\x04\0\x02\x04\x05\x12\x03\x07\x04\n\
-    \n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x07\x0b\x14\n\x0c\n\x05\x04\0\x02\
-    \x04\x03\x12\x03\x07\x17\x18\n\x0b\n\x04\x04\0\x02\x05\x12\x03\x08\x04\
-    \x13\n\x0c\n\x05\x04\0\x02\x05\x06\x12\x03\x08\x04\x0b\n\x0c\n\x05\x04\0\
-    \x02\x05\x01\x12\x03\x08\x0c\x0e\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\
-    \x08\x11\x12\n\x0b\n\x04\x04\0\x02\x06\x12\x03\t\x04\x17\n\x0c\n\x05\x04\
-    \0\x02\x06\x05\x12\x03\t\x04\n\n\x0c\n\x05\x04\0\x02\x06\x01\x12\x03\t\
-    \x0b\x12\n\x0c\n\x05\x04\0\x02\x06\x03\x12\x03\t\x15\x16\n\n\n\x02\x04\
-    \x01\x12\x04\x0b\0\r\x01\n\n\n\x03\x04\x01\x01\x12\x03\x0b\x08\x18\n\x0b\
-    \n\x04\x04\x01\x02\0\x12\x03\x0c\x04\x20\n\x0c\n\x05\x04\x01\x02\0\x04\
-    \x12\x03\x0c\x04\x0c\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x0c\r\x15\n\
-    \x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x0c\x16\x1b\n\x0c\n\x05\x04\x01\x02\
-    \0\x03\x12\x03\x0c\x1e\x1f\n\n\n\x02\x04\x02\x12\x04\x0e\0\x10\x01\n\n\n\
-    \x03\x04\x02\x01\x12\x03\x0e\x08\r\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x0f\
-    \x04\x14\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x0f\x04\t\n\x0c\n\x05\x04\
-    \x02\x02\0\x01\x12\x03\x0f\n\x0f\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\
-    \x0f\x12\x13\n\n\n\x02\x04\x03\x12\x04\x11\0\x14\x01\n\n\n\x03\x04\x03\
-    \x01\x12\x03\x11\x08\x15\n\x0b\n\x04\x04\x03\x02\0\x12\x03\x12\x04\x14\n\
-    \x0c\n\x05\x04\x03\x02\0\x05\x12\x03\x12\x04\t\n\x0c\n\x05\x04\x03\x02\0\
-    \x01\x12\x03\x12\n\x0f\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\x12\x12\x13\
-    \n\x0b\n\x04\x04\x03\x02\x01\x12\x03\x13\x04\x12\n\x0c\n\x05\x04\x03\x02\
-    \x01\x05\x12\x03\x13\x04\t\n\x0c\n\x05\x04\x03\x02\x01\x01\x12\x03\x13\n\
-    \r\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\x03\x13\x10\x11\n\n\n\x02\x05\0\
-    \x12\x04\x15\0\x18\x01\n\n\n\x03\x05\0\x01\x12\x03\x15\x05\x12\n\x0b\n\
-    \x04\x05\0\x02\0\x12\x03\x16\x04\r\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\
-    \x16\x04\x08\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x16\x0b\x0c\n\x0b\n\x04\
-    \x05\0\x02\x01\x12\x03\x17\x04\x0c\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\
-    \x17\x04\x07\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x17\n\x0b\n\n\n\x02\
-    \x05\x01\x12\x04\x19\0\x1c\x01\n\n\n\x03\x05\x01\x01\x12\x03\x19\x05\x0c\
-    \n\x0b\n\x04\x05\x01\x02\0\x12\x03\x1a\x04\x18\n\x0c\n\x05\x05\x01\x02\0\
-    \x01\x12\x03\x1a\x04\x13\n\x0c\n\x05\x05\x01\x02\0\x02\x12\x03\x1a\x16\
-    \x17\n\x0b\n\x04\x05\x01\x02\x01\x12\x03\x1b\x04\x19\n\x0c\n\x05\x05\x01\
-    \x02\x01\x01\x12\x03\x1b\x04\x14\n\x0c\n\x05\x05\x01\x02\x01\x02\x12\x03\
-    \x1b\x17\x18b\x06proto3\
+    \n\x0fDeprecatedLocal\x10\0\x12\x14\n\x10DeprecatedRemote\x10\x01b\x06pr\
+    oto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 50
shared-lib/flowy-collaboration/src/protobuf/model/ws_data.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct ClientRevisionWSData {
 pub struct ClientRevisionWSData {
@@ -907,54 +907,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \n\x18ClientRevisionWSDataType\x12\x11\n\rClientPushRev\x10\0\x12\x0e\n\
     \n\x18ClientRevisionWSDataType\x12\x11\n\rClientPushRev\x10\0\x12\x0e\n\
     \nClientPing\x10\x01*`\n\x18ServerRevisionWSDataType\x12\r\n\tServerAck\
     \nClientPing\x10\x01*`\n\x18ServerRevisionWSDataType\x12\r\n\tServerAck\
     \x10\0\x12\x11\n\rServerPushRev\x10\x01\x12\x11\n\rServerPullRev\x10\x02\
     \x10\0\x12\x11\n\rServerPushRev\x10\x01\x12\x11\n\rServerPullRev\x10\x02\
-    \x12\x0f\n\x0bUserConnect\x10\x03J\xb1\x07\n\x06\x12\x04\0\0\x1c\x01\n\
-    \x08\n\x01\x0c\x12\x03\0\0\x12\n\t\n\x02\x03\0\x12\x03\x01\0\x18\n\n\n\
-    \x02\x04\0\x12\x04\x03\0\x08\x01\n\n\n\x03\x04\0\x01\x12\x03\x03\x08\x1c\
-    \n\x0b\n\x04\x04\0\x02\0\x12\x03\x04\x04\x19\n\x0c\n\x05\x04\0\x02\0\x05\
-    \x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x04\x0b\x14\n\x0c\
-    \n\x05\x04\0\x02\0\x03\x12\x03\x04\x17\x18\n\x0b\n\x04\x04\0\x02\x01\x12\
-    \x03\x05\x04$\n\x0c\n\x05\x04\0\x02\x01\x06\x12\x03\x05\x04\x1c\n\x0c\n\
-    \x05\x04\0\x02\x01\x01\x12\x03\x05\x1d\x1f\n\x0c\n\x05\x04\0\x02\x01\x03\
-    \x12\x03\x05\"#\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x06\x04#\n\x0c\n\x05\
-    \x04\0\x02\x02\x06\x12\x03\x06\x04\x14\n\x0c\n\x05\x04\0\x02\x02\x01\x12\
-    \x03\x06\x15\x1e\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x06!\"\n\x0b\n\
-    \x04\x04\0\x02\x03\x12\x03\x07\x04\x17\n\x0c\n\x05\x04\0\x02\x03\x05\x12\
-    \x03\x07\x04\n\n\x0c\n\x05\x04\0\x02\x03\x01\x12\x03\x07\x0b\x12\n\x0c\n\
-    \x05\x04\0\x02\x03\x03\x12\x03\x07\x15\x16\n\n\n\x02\x04\x01\x12\x04\t\0\
-    \r\x01\n\n\n\x03\x04\x01\x01\x12\x03\t\x08\x1c\n\x0b\n\x04\x04\x01\x02\0\
-    \x12\x03\n\x04\x19\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\n\x04\n\n\x0c\n\
-    \x05\x04\x01\x02\0\x01\x12\x03\n\x0b\x14\n\x0c\n\x05\x04\x01\x02\0\x03\
-    \x12\x03\n\x17\x18\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x0b\x04$\n\x0c\n\
-    \x05\x04\x01\x02\x01\x06\x12\x03\x0b\x04\x1c\n\x0c\n\x05\x04\x01\x02\x01\
-    \x01\x12\x03\x0b\x1d\x1f\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x0b\"#\
-    \n\x0b\n\x04\x04\x01\x02\x02\x12\x03\x0c\x04\x13\n\x0c\n\x05\x04\x01\x02\
-    \x02\x05\x12\x03\x0c\x04\t\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\x0c\n\
-    \x0e\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\x0c\x11\x12\n\n\n\x02\x04\
-    \x02\x12\x04\x0e\0\x12\x01\n\n\n\x03\x04\x02\x01\x12\x03\x0e\x08\x17\n\
-    \x0b\n\x04\x04\x02\x02\0\x12\x03\x0f\x04\x17\n\x0c\n\x05\x04\x02\x02\0\
-    \x05\x12\x03\x0f\x04\n\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x0f\x0b\x12\
-    \n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x0f\x15\x16\n\x0b\n\x04\x04\x02\
-    \x02\x01\x12\x03\x10\x04\x16\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x10\
-    \x04\n\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x10\x0b\x11\n\x0c\n\x05\
-    \x04\x02\x02\x01\x03\x12\x03\x10\x14\x15\n\x0b\n\x04\x04\x02\x02\x02\x12\
-    \x03\x11\x04\x1c\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03\x11\x04\t\n\x0c\
-    \n\x05\x04\x02\x02\x02\x01\x12\x03\x11\n\x17\n\x0c\n\x05\x04\x02\x02\x02\
-    \x03\x12\x03\x11\x1a\x1b\n\n\n\x02\x05\0\x12\x04\x13\0\x16\x01\n\n\n\x03\
-    \x05\0\x01\x12\x03\x13\x05\x1d\n\x0b\n\x04\x05\0\x02\0\x12\x03\x14\x04\
-    \x16\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x14\x04\x11\n\x0c\n\x05\x05\0\
-    \x02\0\x02\x12\x03\x14\x14\x15\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x15\x04\
-    \x13\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x15\x04\x0e\n\x0c\n\x05\x05\0\
-    \x02\x01\x02\x12\x03\x15\x11\x12\n\n\n\x02\x05\x01\x12\x04\x17\0\x1c\x01\
-    \n\n\n\x03\x05\x01\x01\x12\x03\x17\x05\x1d\n\x0b\n\x04\x05\x01\x02\0\x12\
-    \x03\x18\x04\x12\n\x0c\n\x05\x05\x01\x02\0\x01\x12\x03\x18\x04\r\n\x0c\n\
-    \x05\x05\x01\x02\0\x02\x12\x03\x18\x10\x11\n\x0b\n\x04\x05\x01\x02\x01\
-    \x12\x03\x19\x04\x16\n\x0c\n\x05\x05\x01\x02\x01\x01\x12\x03\x19\x04\x11\
-    \n\x0c\n\x05\x05\x01\x02\x01\x02\x12\x03\x19\x14\x15\n\x0b\n\x04\x05\x01\
-    \x02\x02\x12\x03\x1a\x04\x16\n\x0c\n\x05\x05\x01\x02\x02\x01\x12\x03\x1a\
-    \x04\x11\n\x0c\n\x05\x05\x01\x02\x02\x02\x12\x03\x1a\x14\x15\n\x0b\n\x04\
-    \x05\x01\x02\x03\x12\x03\x1b\x04\x14\n\x0c\n\x05\x05\x01\x02\x03\x01\x12\
-    \x03\x1b\x04\x0f\n\x0c\n\x05\x05\x01\x02\x03\x02\x12\x03\x1b\x12\x13b\
-    \x06proto3\
+    \x12\x0f\n\x0bUserConnect\x10\x03b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 41 - 41
shared-lib/flowy-derive/src/derive_cache/derive_cache.rs

@@ -18,22 +18,49 @@ pub fn category_from_str(type_str: &str) -> TypeCategory {
         "String" => TypeCategory::Str,
         "String" => TypeCategory::Str,
         "FFIRequest"
         "FFIRequest"
         | "FFIResponse"
         | "FFIResponse"
-        | "SubscribeObject"
         | "FlowyError"
         | "FlowyError"
+        | "SubscribeObject"
         | "NetworkState"
         | "NetworkState"
-        | "UserToken"
-        | "UserProfile"
-        | "UpdateUserRequest"
-        | "UpdateUserParams"
         | "SignInRequest"
         | "SignInRequest"
         | "SignInParams"
         | "SignInParams"
         | "SignInResponse"
         | "SignInResponse"
         | "SignUpRequest"
         | "SignUpRequest"
         | "SignUpParams"
         | "SignUpParams"
         | "SignUpResponse"
         | "SignUpResponse"
+        | "UserToken"
+        | "UserProfile"
+        | "UpdateUserRequest"
+        | "UpdateUserParams"
         | "UserPreferences"
         | "UserPreferences"
         | "AppearanceSettings"
         | "AppearanceSettings"
         | "LocaleSettings"
         | "LocaleSettings"
+        | "ClientRevisionWSData"
+        | "ServerRevisionWSData"
+        | "NewDocumentUser"
+        | "FolderInfo"
+        | "Revision"
+        | "RepeatedRevision"
+        | "RevId"
+        | "RevisionRange"
+        | "CreateDocParams"
+        | "DocumentInfo"
+        | "ResetDocumentParams"
+        | "DocumentDelta"
+        | "NewDocUser"
+        | "DocumentId"
+        | "WSError"
+        | "WebSocketRawMessage"
+        | "Workspace"
+        | "RepeatedWorkspace"
+        | "CreateWorkspaceRequest"
+        | "CreateWorkspaceParams"
+        | "QueryWorkspaceRequest"
+        | "WorkspaceId"
+        | "CurrentWorkspaceSetting"
+        | "UpdateWorkspaceRequest"
+        | "UpdateWorkspaceParams"
+        | "ExportRequest"
+        | "ExportData"
         | "App"
         | "App"
         | "RepeatedApp"
         | "RepeatedApp"
         | "CreateAppRequest"
         | "CreateAppRequest"
@@ -43,8 +70,10 @@ pub fn category_from_str(type_str: &str) -> TypeCategory {
         | "AppId"
         | "AppId"
         | "UpdateAppRequest"
         | "UpdateAppRequest"
         | "UpdateAppParams"
         | "UpdateAppParams"
-        | "ExportRequest"
-        | "ExportData"
+        | "Trash"
+        | "RepeatedTrash"
+        | "RepeatedTrashId"
+        | "TrashId"
         | "View"
         | "View"
         | "RepeatedView"
         | "RepeatedView"
         | "CreateViewRequest"
         | "CreateViewRequest"
@@ -54,52 +83,23 @@ pub fn category_from_str(type_str: &str) -> TypeCategory {
         | "RepeatedViewId"
         | "RepeatedViewId"
         | "UpdateViewRequest"
         | "UpdateViewRequest"
         | "UpdateViewParams"
         | "UpdateViewParams"
-        | "Trash"
-        | "RepeatedTrash"
-        | "RepeatedTrashId"
-        | "TrashId"
-        | "Workspace"
-        | "RepeatedWorkspace"
-        | "CreateWorkspaceRequest"
-        | "CreateWorkspaceParams"
-        | "QueryWorkspaceRequest"
-        | "WorkspaceId"
-        | "CurrentWorkspaceSetting"
-        | "UpdateWorkspaceRequest"
-        | "UpdateWorkspaceParams"
-        | "ClientRevisionWSData"
-        | "ServerRevisionWSData"
-        | "NewDocumentUser"
-        | "CreateDocParams"
-        | "DocumentInfo"
-        | "ResetDocumentParams"
-        | "DocumentDelta"
-        | "NewDocUser"
-        | "DocumentId"
-        | "Revision"
-        | "RepeatedRevision"
-        | "RevId"
-        | "RevisionRange"
-        | "FolderInfo"
-        | "WSError"
-        | "WebSocketRawMessage"
         => TypeCategory::Protobuf,
         => TypeCategory::Protobuf,
         "FFIStatusCode"
         "FFIStatusCode"
         | "FolderEvent"
         | "FolderEvent"
         | "FolderNotification"
         | "FolderNotification"
-        | "UserEvent"
-        | "UserNotification"
         | "NetworkEvent"
         | "NetworkEvent"
         | "NetworkType"
         | "NetworkType"
-        | "ExportType"
-        | "ViewType"
-        | "TrashType"
+        | "UserEvent"
+        | "UserNotification"
         | "ClientRevisionWSDataType"
         | "ClientRevisionWSDataType"
         | "ServerRevisionWSDataType"
         | "ServerRevisionWSDataType"
         | "RevisionState"
         | "RevisionState"
         | "RevType"
         | "RevType"
         | "ErrorCode"
         | "ErrorCode"
         | "WSChannel"
         | "WSChannel"
+        | "ExportType"
+        | "TrashType"
+        | "ViewType"
         => TypeCategory::Enum,
         => TypeCategory::Enum,
 
 
         "Option" => TypeCategory::Opt,
         "Option" => TypeCategory::Opt,

+ 3 - 0
shared-lib/flowy-folder-data-model/Cargo.toml

@@ -20,6 +20,9 @@ error-code = { path = "../error-code" }
 serde = { version = "1.0", features = ["derive"] }
 serde = { version = "1.0", features = ["derive"] }
 serde_json = "1.0"
 serde_json = "1.0"
 
 
+[build-dependencies]
+lib-infra = { path = "../lib-infra", features = ["gen_pb"] }
+
 [features]
 [features]
 default = []
 default = []
 backend = []
 backend = []

+ 5 - 0
shared-lib/flowy-folder-data-model/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("flowy-folder-data-model", "./src/protobuf/proto");
+}

+ 5 - 5
shared-lib/flowy-folder-data-model/src/entities/trash.rs

@@ -36,7 +36,7 @@ impl std::convert::From<App> for Trash {
             name: app.name,
             name: app.name,
             modified_time: app.modified_time,
             modified_time: app.modified_time,
             create_time: app.create_time,
             create_time: app.create_time,
-            ty: TrashType::App,
+            ty: TrashType::TrashApp,
         }
         }
     }
     }
 }
 }
@@ -44,8 +44,8 @@ impl std::convert::From<App> for Trash {
 #[derive(Eq, PartialEq, Debug, ProtoBuf_Enum, Clone, Serialize, Deserialize)]
 #[derive(Eq, PartialEq, Debug, ProtoBuf_Enum, Clone, Serialize, Deserialize)]
 pub enum TrashType {
 pub enum TrashType {
     Unknown = 0,
     Unknown = 0,
-    View = 1,
-    App = 2,
+    TrashView = 1,
+    TrashApp = 2,
 }
 }
 
 
 impl std::convert::TryFrom<i32> for TrashType {
 impl std::convert::TryFrom<i32> for TrashType {
@@ -54,8 +54,8 @@ impl std::convert::TryFrom<i32> for TrashType {
     fn try_from(value: i32) -> Result<Self, Self::Error> {
     fn try_from(value: i32) -> Result<Self, Self::Error> {
         match value {
         match value {
             0 => Ok(TrashType::Unknown),
             0 => Ok(TrashType::Unknown),
-            1 => Ok(TrashType::View),
-            2 => Ok(TrashType::App),
+            1 => Ok(TrashType::TrashView),
+            2 => Ok(TrashType::TrashApp),
             _ => Err(format!("Invalid trash type: {}", value)),
             _ => Err(format!("Invalid trash type: {}", value)),
         }
         }
     }
     }

+ 1 - 1
shared-lib/flowy-folder-data-model/src/entities/view.rs

@@ -57,7 +57,7 @@ impl std::convert::From<View> for Trash {
             name: view.name,
             name: view.name,
             modified_time: view.modified_time,
             modified_time: view.modified_time,
             create_time: view.create_time,
             create_time: view.create_time,
-            ty: TrashType::View,
+            ty: TrashType::TrashView,
         }
         }
     }
     }
 }
 }

+ 3 - 106
shared-lib/flowy-folder-data-model/src/protobuf/model/app.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct App {
 pub struct App {
@@ -2678,110 +2678,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x20\x01(\tH\x01R\x04desc\x12.\n\x0bcolor_style\x18\x04\x20\x01(\x0b2\
     \x20\x01(\tH\x01R\x04desc\x12.\n\x0bcolor_style\x18\x04\x20\x01(\x0b2\
     \x0b.ColorStyleH\x02R\ncolorStyle\x12\x1b\n\x08is_trash\x18\x05\x20\x01(\
     \x0b.ColorStyleH\x02R\ncolorStyle\x12\x1b\n\x08is_trash\x18\x05\x20\x01(\
     \x08H\x03R\x07isTrashB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\x14\n\x12\
     \x08H\x03R\x07isTrashB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\x14\n\x12\
-    one_of_color_styleB\x11\n\x0fone_of_is_trashJ\xdb\x10\n\x06\x12\x04\0\02\
-    \x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\t\n\x02\x03\0\x12\x03\x01\0\x14\n\
-    \n\n\x02\x04\0\x12\x04\x03\0\x0c\x01\n\n\n\x03\x04\0\x01\x12\x03\x03\x08\
-    \x0b\n\x0b\n\x04\x04\0\x02\0\x12\x03\x04\x04\x12\n\x0c\n\x05\x04\0\x02\0\
-    \x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x04\x0b\r\n\
-    \x0c\n\x05\x04\0\x02\0\x03\x12\x03\x04\x10\x11\n\x0b\n\x04\x04\0\x02\x01\
-    \x12\x03\x05\x04\x1c\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x05\x04\n\n\
-    \x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x05\x0b\x17\n\x0c\n\x05\x04\0\x02\
-    \x01\x03\x12\x03\x05\x1a\x1b\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x06\x04\
-    \x14\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x06\x04\n\n\x0c\n\x05\x04\0\
-    \x02\x02\x01\x12\x03\x06\x0b\x0f\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\
-    \x06\x12\x13\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x07\x04\x14\n\x0c\n\x05\
-    \x04\0\x02\x03\x05\x12\x03\x07\x04\n\n\x0c\n\x05\x04\0\x02\x03\x01\x12\
-    \x03\x07\x0b\x0f\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x07\x12\x13\n\x0b\
-    \n\x04\x04\0\x02\x04\x12\x03\x08\x04\x20\n\x0c\n\x05\x04\0\x02\x04\x06\
-    \x12\x03\x08\x04\x10\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x08\x11\x1b\n\
-    \x0c\n\x05\x04\0\x02\x04\x03\x12\x03\x08\x1e\x1f\n\x0b\n\x04\x04\0\x02\
-    \x05\x12\x03\t\x04\x16\n\x0c\n\x05\x04\0\x02\x05\x05\x12\x03\t\x04\t\n\
-    \x0c\n\x05\x04\0\x02\x05\x01\x12\x03\t\n\x11\n\x0c\n\x05\x04\0\x02\x05\
-    \x03\x12\x03\t\x14\x15\n\x0b\n\x04\x04\0\x02\x06\x12\x03\n\x04\x1c\n\x0c\
-    \n\x05\x04\0\x02\x06\x05\x12\x03\n\x04\t\n\x0c\n\x05\x04\0\x02\x06\x01\
-    \x12\x03\n\n\x17\n\x0c\n\x05\x04\0\x02\x06\x03\x12\x03\n\x1a\x1b\n\x0b\n\
-    \x04\x04\0\x02\x07\x12\x03\x0b\x04\x1a\n\x0c\n\x05\x04\0\x02\x07\x05\x12\
-    \x03\x0b\x04\t\n\x0c\n\x05\x04\0\x02\x07\x01\x12\x03\x0b\n\x15\n\x0c\n\
-    \x05\x04\0\x02\x07\x03\x12\x03\x0b\x18\x19\n\n\n\x02\x04\x01\x12\x04\r\0\
-    \x0f\x01\n\n\n\x03\x04\x01\x01\x12\x03\r\x08\x13\n\x0b\n\x04\x04\x01\x02\
-    \0\x12\x03\x0e\x04\x1b\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\x0e\x04\x0c\
-    \n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x0e\r\x10\n\x0c\n\x05\x04\x01\x02\
-    \0\x01\x12\x03\x0e\x11\x16\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x0e\x19\
-    \x1a\n\n\n\x02\x04\x02\x12\x04\x10\0\x15\x01\n\n\n\x03\x04\x02\x01\x12\
-    \x03\x10\x08\x18\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x11\x04\x1c\n\x0c\n\
-    \x05\x04\x02\x02\0\x05\x12\x03\x11\x04\n\n\x0c\n\x05\x04\x02\x02\0\x01\
-    \x12\x03\x11\x0b\x17\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x11\x1a\x1b\n\
-    \x0b\n\x04\x04\x02\x02\x01\x12\x03\x12\x04\x14\n\x0c\n\x05\x04\x02\x02\
-    \x01\x05\x12\x03\x12\x04\n\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x12\
-    \x0b\x0f\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x12\x12\x13\n\x0b\n\x04\
-    \x04\x02\x02\x02\x12\x03\x13\x04\x14\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\
-    \x03\x13\x04\n\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03\x13\x0b\x0f\n\x0c\
-    \n\x05\x04\x02\x02\x02\x03\x12\x03\x13\x12\x13\n\x0b\n\x04\x04\x02\x02\
-    \x03\x12\x03\x14\x04\x1f\n\x0c\n\x05\x04\x02\x02\x03\x06\x12\x03\x14\x04\
-    \x0e\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03\x14\x0f\x1a\n\x0c\n\x05\x04\
-    \x02\x02\x03\x03\x12\x03\x14\x1d\x1e\n\n\n\x02\x04\x03\x12\x04\x16\0\x18\
-    \x01\n\n\n\x03\x04\x03\x01\x12\x03\x16\x08\x12\n\x0b\n\x04\x04\x03\x02\0\
-    \x12\x03\x17\x04\x1b\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03\x17\x04\n\n\
-    \x0c\n\x05\x04\x03\x02\0\x01\x12\x03\x17\x0b\x16\n\x0c\n\x05\x04\x03\x02\
-    \0\x03\x12\x03\x17\x19\x1a\n\n\n\x02\x04\x04\x12\x04\x19\0\x1e\x01\n\n\n\
-    \x03\x04\x04\x01\x12\x03\x19\x08\x17\n\x0b\n\x04\x04\x04\x02\0\x12\x03\
-    \x1a\x04\x1c\n\x0c\n\x05\x04\x04\x02\0\x05\x12\x03\x1a\x04\n\n\x0c\n\x05\
-    \x04\x04\x02\0\x01\x12\x03\x1a\x0b\x17\n\x0c\n\x05\x04\x04\x02\0\x03\x12\
-    \x03\x1a\x1a\x1b\n\x0b\n\x04\x04\x04\x02\x01\x12\x03\x1b\x04\x14\n\x0c\n\
-    \x05\x04\x04\x02\x01\x05\x12\x03\x1b\x04\n\n\x0c\n\x05\x04\x04\x02\x01\
-    \x01\x12\x03\x1b\x0b\x0f\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\x03\x1b\x12\
-    \x13\n\x0b\n\x04\x04\x04\x02\x02\x12\x03\x1c\x04\x14\n\x0c\n\x05\x04\x04\
-    \x02\x02\x05\x12\x03\x1c\x04\n\n\x0c\n\x05\x04\x04\x02\x02\x01\x12\x03\
-    \x1c\x0b\x0f\n\x0c\n\x05\x04\x04\x02\x02\x03\x12\x03\x1c\x12\x13\n\x0b\n\
-    \x04\x04\x04\x02\x03\x12\x03\x1d\x04\x1f\n\x0c\n\x05\x04\x04\x02\x03\x06\
-    \x12\x03\x1d\x04\x0e\n\x0c\n\x05\x04\x04\x02\x03\x01\x12\x03\x1d\x0f\x1a\
-    \n\x0c\n\x05\x04\x04\x02\x03\x03\x12\x03\x1d\x1d\x1e\n\n\n\x02\x04\x05\
-    \x12\x04\x1f\0!\x01\n\n\n\x03\x04\x05\x01\x12\x03\x1f\x08\x17\n\x0b\n\
-    \x04\x04\x05\x02\0\x12\x03\x20\x04\x20\n\x0c\n\x05\x04\x05\x02\0\x04\x12\
-    \x03\x20\x04\x0c\n\x0c\n\x05\x04\x05\x02\0\x05\x12\x03\x20\r\x13\n\x0c\n\
-    \x05\x04\x05\x02\0\x01\x12\x03\x20\x14\x1b\n\x0c\n\x05\x04\x05\x02\0\x03\
-    \x12\x03\x20\x1e\x1f\n\n\n\x02\x04\x06\x12\x04\"\0$\x01\n\n\n\x03\x04\
-    \x06\x01\x12\x03\"\x08\r\n\x0b\n\x04\x04\x06\x02\0\x12\x03#\x04\x16\n\
-    \x0c\n\x05\x04\x06\x02\0\x05\x12\x03#\x04\n\n\x0c\n\x05\x04\x06\x02\0\
-    \x01\x12\x03#\x0b\x11\n\x0c\n\x05\x04\x06\x02\0\x03\x12\x03#\x14\x15\n\n\
-    \n\x02\x04\x07\x12\x04%\0+\x01\n\n\n\x03\x04\x07\x01\x12\x03%\x08\x18\n\
-    \x0b\n\x04\x04\x07\x02\0\x12\x03&\x04\x16\n\x0c\n\x05\x04\x07\x02\0\x05\
-    \x12\x03&\x04\n\n\x0c\n\x05\x04\x07\x02\0\x01\x12\x03&\x0b\x11\n\x0c\n\
-    \x05\x04\x07\x02\0\x03\x12\x03&\x14\x15\n\x0b\n\x04\x04\x07\x08\0\x12\
-    \x03'\x04*\n\x0c\n\x05\x04\x07\x08\0\x01\x12\x03'\n\x15\n\x0b\n\x04\x04\
-    \x07\x02\x01\x12\x03'\x18(\n\x0c\n\x05\x04\x07\x02\x01\x05\x12\x03'\x18\
-    \x1e\n\x0c\n\x05\x04\x07\x02\x01\x01\x12\x03'\x1f#\n\x0c\n\x05\x04\x07\
-    \x02\x01\x03\x12\x03'&'\n\x0b\n\x04\x04\x07\x08\x01\x12\x03(\x04*\n\x0c\
-    \n\x05\x04\x07\x08\x01\x01\x12\x03(\n\x15\n\x0b\n\x04\x04\x07\x02\x02\
-    \x12\x03(\x18(\n\x0c\n\x05\x04\x07\x02\x02\x05\x12\x03(\x18\x1e\n\x0c\n\
-    \x05\x04\x07\x02\x02\x01\x12\x03(\x1f#\n\x0c\n\x05\x04\x07\x02\x02\x03\
-    \x12\x03(&'\n\x0b\n\x04\x04\x07\x08\x02\x12\x03)\x04<\n\x0c\n\x05\x04\
-    \x07\x08\x02\x01\x12\x03)\n\x1c\n\x0b\n\x04\x04\x07\x02\x03\x12\x03)\x1f\
-    :\n\x0c\n\x05\x04\x07\x02\x03\x06\x12\x03)\x1f)\n\x0c\n\x05\x04\x07\x02\
-    \x03\x01\x12\x03)*5\n\x0c\n\x05\x04\x07\x02\x03\x03\x12\x03)89\n\x0b\n\
-    \x04\x04\x07\x08\x03\x12\x03*\x040\n\x0c\n\x05\x04\x07\x08\x03\x01\x12\
-    \x03*\n\x19\n\x0b\n\x04\x04\x07\x02\x04\x12\x03*\x1c.\n\x0c\n\x05\x04\
-    \x07\x02\x04\x05\x12\x03*\x1c\x20\n\x0c\n\x05\x04\x07\x02\x04\x01\x12\
-    \x03*!)\n\x0c\n\x05\x04\x07\x02\x04\x03\x12\x03*,-\n\n\n\x02\x04\x08\x12\
-    \x04,\02\x01\n\n\n\x03\x04\x08\x01\x12\x03,\x08\x17\n\x0b\n\x04\x04\x08\
-    \x02\0\x12\x03-\x04\x16\n\x0c\n\x05\x04\x08\x02\0\x05\x12\x03-\x04\n\n\
-    \x0c\n\x05\x04\x08\x02\0\x01\x12\x03-\x0b\x11\n\x0c\n\x05\x04\x08\x02\0\
-    \x03\x12\x03-\x14\x15\n\x0b\n\x04\x04\x08\x08\0\x12\x03.\x04*\n\x0c\n\
-    \x05\x04\x08\x08\0\x01\x12\x03.\n\x15\n\x0b\n\x04\x04\x08\x02\x01\x12\
-    \x03.\x18(\n\x0c\n\x05\x04\x08\x02\x01\x05\x12\x03.\x18\x1e\n\x0c\n\x05\
-    \x04\x08\x02\x01\x01\x12\x03.\x1f#\n\x0c\n\x05\x04\x08\x02\x01\x03\x12\
-    \x03.&'\n\x0b\n\x04\x04\x08\x08\x01\x12\x03/\x04*\n\x0c\n\x05\x04\x08\
-    \x08\x01\x01\x12\x03/\n\x15\n\x0b\n\x04\x04\x08\x02\x02\x12\x03/\x18(\n\
-    \x0c\n\x05\x04\x08\x02\x02\x05\x12\x03/\x18\x1e\n\x0c\n\x05\x04\x08\x02\
-    \x02\x01\x12\x03/\x1f#\n\x0c\n\x05\x04\x08\x02\x02\x03\x12\x03/&'\n\x0b\
-    \n\x04\x04\x08\x08\x02\x12\x030\x04<\n\x0c\n\x05\x04\x08\x08\x02\x01\x12\
-    \x030\n\x1c\n\x0b\n\x04\x04\x08\x02\x03\x12\x030\x1f:\n\x0c\n\x05\x04\
-    \x08\x02\x03\x06\x12\x030\x1f)\n\x0c\n\x05\x04\x08\x02\x03\x01\x12\x030*\
-    5\n\x0c\n\x05\x04\x08\x02\x03\x03\x12\x03089\n\x0b\n\x04\x04\x08\x08\x03\
-    \x12\x031\x040\n\x0c\n\x05\x04\x08\x08\x03\x01\x12\x031\n\x19\n\x0b\n\
-    \x04\x04\x08\x02\x04\x12\x031\x1c.\n\x0c\n\x05\x04\x08\x02\x04\x05\x12\
-    \x031\x1c\x20\n\x0c\n\x05\x04\x08\x02\x04\x01\x12\x031!)\n\x0c\n\x05\x04\
-    \x08\x02\x04\x03\x12\x031,-b\x06proto3\
+    one_of_color_styleB\x11\n\x0fone_of_is_trashb\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 40
shared-lib/flowy-folder-data-model/src/protobuf/model/errors.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 pub enum ErrorCode {
 pub enum ErrorCode {
@@ -128,44 +128,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x12\x13\n\x0fViewDescTooLong\x10\x17\x12\x13\n\x0fViewDataInvalid\x10\
     \x12\x13\n\x0fViewDescTooLong\x10\x17\x12\x13\n\x0fViewDataInvalid\x10\
     \x18\x12\x13\n\x0fViewNameTooLong\x10\x19\x12\x14\n\x10UserUnauthorized\
     \x18\x12\x13\n\x0fViewNameTooLong\x10\x19\x12\x14\n\x10UserUnauthorized\
     \x10d\x12\x13\n\x0eWsConnectError\x10\xc8\x01\x12\x12\n\rInternalError\
     \x10d\x12\x13\n\x0eWsConnectError\x10\xc8\x01\x12\x12\n\rInternalError\
-    \x10\xe8\x07\x12\x13\n\x0eRecordNotFound\x10\xe9\x07J\xe3\x05\n\x06\x12\
-    \x04\0\0\x14\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x05\0\x12\x04\
-    \x02\0\x14\x01\n\n\n\x03\x05\0\x01\x12\x03\x02\x05\x0e\n\x0b\n\x04\x05\0\
-    \x02\0\x12\x03\x03\x04\x1d\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x03\x04\
-    \x18\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x03\x1b\x1c\n\x0b\n\x04\x05\0\
-    \x02\x01\x12\x03\x04\x04\x1b\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x04\
-    \x04\x16\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x04\x19\x1a\n\x0b\n\x04\
-    \x05\0\x02\x02\x12\x03\x05\x04\x1d\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\
-    \x05\x04\x18\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\x05\x1b\x1c\n\x0b\n\
-    \x04\x05\0\x02\x03\x12\x03\x06\x04\x1d\n\x0c\n\x05\x05\0\x02\x03\x01\x12\
-    \x03\x06\x04\x18\n\x0c\n\x05\x05\0\x02\x03\x02\x12\x03\x06\x1b\x1c\n\x0b\
-    \n\x04\x05\0\x02\x04\x12\x03\x07\x04\x1d\n\x0c\n\x05\x05\0\x02\x04\x01\
-    \x12\x03\x07\x04\x18\n\x0c\n\x05\x05\0\x02\x04\x02\x12\x03\x07\x1b\x1c\n\
-    \x0b\n\x04\x05\0\x02\x05\x12\x03\x08\x04\x16\n\x0c\n\x05\x05\0\x02\x05\
-    \x01\x12\x03\x08\x04\x10\n\x0c\n\x05\x05\0\x02\x05\x02\x12\x03\x08\x13\
-    \x15\n\x0b\n\x04\x05\0\x02\x06\x12\x03\t\x04\x18\n\x0c\n\x05\x05\0\x02\
-    \x06\x01\x12\x03\t\x04\x12\n\x0c\n\x05\x05\0\x02\x06\x02\x12\x03\t\x15\
-    \x17\n\x0b\n\x04\x05\0\x02\x07\x12\x03\n\x04\x19\n\x0c\n\x05\x05\0\x02\
-    \x07\x01\x12\x03\n\x04\x13\n\x0c\n\x05\x05\0\x02\x07\x02\x12\x03\n\x16\
-    \x18\n\x0b\n\x04\x05\0\x02\x08\x12\x03\x0b\x04\x1e\n\x0c\n\x05\x05\0\x02\
-    \x08\x01\x12\x03\x0b\x04\x18\n\x0c\n\x05\x05\0\x02\x08\x02\x12\x03\x0b\
-    \x1b\x1d\n\x0b\n\x04\x05\0\x02\t\x12\x03\x0c\x04\x17\n\x0c\n\x05\x05\0\
-    \x02\t\x01\x12\x03\x0c\x04\x11\n\x0c\n\x05\x05\0\x02\t\x02\x12\x03\x0c\
-    \x14\x16\n\x0b\n\x04\x05\0\x02\n\x12\x03\r\x04\x19\n\x0c\n\x05\x05\0\x02\
-    \n\x01\x12\x03\r\x04\x13\n\x0c\n\x05\x05\0\x02\n\x02\x12\x03\r\x16\x18\n\
-    \x0b\n\x04\x05\0\x02\x0b\x12\x03\x0e\x04\x19\n\x0c\n\x05\x05\0\x02\x0b\
-    \x01\x12\x03\x0e\x04\x13\n\x0c\n\x05\x05\0\x02\x0b\x02\x12\x03\x0e\x16\
-    \x18\n\x0b\n\x04\x05\0\x02\x0c\x12\x03\x0f\x04\x19\n\x0c\n\x05\x05\0\x02\
-    \x0c\x01\x12\x03\x0f\x04\x13\n\x0c\n\x05\x05\0\x02\x0c\x02\x12\x03\x0f\
-    \x16\x18\n\x0b\n\x04\x05\0\x02\r\x12\x03\x10\x04\x1b\n\x0c\n\x05\x05\0\
-    \x02\r\x01\x12\x03\x10\x04\x14\n\x0c\n\x05\x05\0\x02\r\x02\x12\x03\x10\
-    \x17\x1a\n\x0b\n\x04\x05\0\x02\x0e\x12\x03\x11\x04\x19\n\x0c\n\x05\x05\0\
-    \x02\x0e\x01\x12\x03\x11\x04\x12\n\x0c\n\x05\x05\0\x02\x0e\x02\x12\x03\
-    \x11\x15\x18\n\x0b\n\x04\x05\0\x02\x0f\x12\x03\x12\x04\x19\n\x0c\n\x05\
-    \x05\0\x02\x0f\x01\x12\x03\x12\x04\x11\n\x0c\n\x05\x05\0\x02\x0f\x02\x12\
-    \x03\x12\x14\x18\n\x0b\n\x04\x05\0\x02\x10\x12\x03\x13\x04\x1a\n\x0c\n\
-    \x05\x05\0\x02\x10\x01\x12\x03\x13\x04\x12\n\x0c\n\x05\x05\0\x02\x10\x02\
-    \x12\x03\x13\x15\x19b\x06proto3\
+    \x10\xe8\x07\x12\x13\n\x0eRecordNotFound\x10\xe9\x07b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 24
shared-lib/flowy-folder-data-model/src/protobuf/model/share.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct ExportRequest {
 pub struct ExportRequest {
@@ -462,28 +462,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     TypeR\nexportType\"N\n\nExportData\x12\x12\n\x04data\x18\x01\x20\x01(\tR\
     TypeR\nexportType\"N\n\nExportData\x12\x12\n\x04data\x18\x01\x20\x01(\tR\
     \x04data\x12,\n\x0bexport_type\x18\x02\x20\x01(\x0e2\x0b.ExportTypeR\nex\
     \x04data\x12,\n\x0bexport_type\x18\x02\x20\x01(\x0e2\x0b.ExportTypeR\nex\
     portType*.\n\nExportType\x12\x08\n\x04Text\x10\0\x12\x0c\n\x08Markdown\
     portType*.\n\nExportType\x12\x08\n\x04Text\x10\0\x12\x0c\n\x08Markdown\
-    \x10\x01\x12\x08\n\x04Link\x10\x02J\xb1\x03\n\x06\x12\x04\0\0\x0e\x01\n\
-    \x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x05\x01\n\n\
-    \n\x03\x04\0\x01\x12\x03\x02\x08\x15\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\
-    \x04\x16\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\
-    \x02\0\x01\x12\x03\x03\x0b\x11\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\
-    \x14\x15\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x1f\n\x0c\n\x05\x04\0\
-    \x02\x01\x06\x12\x03\x04\x04\x0e\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\
-    \x04\x0f\x1a\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x1d\x1e\n\n\n\x02\
-    \x04\x01\x12\x04\x06\0\t\x01\n\n\n\x03\x04\x01\x01\x12\x03\x06\x08\x12\n\
-    \x0b\n\x04\x04\x01\x02\0\x12\x03\x07\x04\x14\n\x0c\n\x05\x04\x01\x02\0\
-    \x05\x12\x03\x07\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x07\x0b\x0f\
-    \n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x07\x12\x13\n\x0b\n\x04\x04\x01\
-    \x02\x01\x12\x03\x08\x04\x1f\n\x0c\n\x05\x04\x01\x02\x01\x06\x12\x03\x08\
-    \x04\x0e\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x08\x0f\x1a\n\x0c\n\x05\
-    \x04\x01\x02\x01\x03\x12\x03\x08\x1d\x1e\n\n\n\x02\x05\0\x12\x04\n\0\x0e\
-    \x01\n\n\n\x03\x05\0\x01\x12\x03\n\x05\x0f\n\x0b\n\x04\x05\0\x02\0\x12\
-    \x03\x0b\x04\r\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x0b\x04\x08\n\x0c\n\
-    \x05\x05\0\x02\0\x02\x12\x03\x0b\x0b\x0c\n\x0b\n\x04\x05\0\x02\x01\x12\
-    \x03\x0c\x04\x11\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x0c\x04\x0c\n\x0c\
-    \n\x05\x05\0\x02\x01\x02\x12\x03\x0c\x0f\x10\n\x0b\n\x04\x05\0\x02\x02\
-    \x12\x03\r\x04\r\n\x0c\n\x05\x05\0\x02\x02\x01\x12\x03\r\x04\x08\n\x0c\n\
-    \x05\x05\0\x02\x02\x02\x12\x03\r\x0b\x0cb\x06proto3\
+    \x10\x01\x12\x08\n\x04Link\x10\x02b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 10 - 51
shared-lib/flowy-folder-data-model/src/protobuf/model/trash.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct Trash {
 pub struct Trash {
@@ -885,8 +885,8 @@ impl ::protobuf::reflect::ProtobufValue for TrashId {
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 pub enum TrashType {
 pub enum TrashType {
     Unknown = 0,
     Unknown = 0,
-    View = 1,
-    App = 2,
+    TrashView = 1,
+    TrashApp = 2,
 }
 }
 
 
 impl ::protobuf::ProtobufEnum for TrashType {
 impl ::protobuf::ProtobufEnum for TrashType {
@@ -897,8 +897,8 @@ impl ::protobuf::ProtobufEnum for TrashType {
     fn from_i32(value: i32) -> ::std::option::Option<TrashType> {
     fn from_i32(value: i32) -> ::std::option::Option<TrashType> {
         match value {
         match value {
             0 => ::std::option::Option::Some(TrashType::Unknown),
             0 => ::std::option::Option::Some(TrashType::Unknown),
-            1 => ::std::option::Option::Some(TrashType::View),
-            2 => ::std::option::Option::Some(TrashType::App),
+            1 => ::std::option::Option::Some(TrashType::TrashView),
+            2 => ::std::option::Option::Some(TrashType::TrashApp),
             _ => ::std::option::Option::None
             _ => ::std::option::Option::None
         }
         }
     }
     }
@@ -906,8 +906,8 @@ impl ::protobuf::ProtobufEnum for TrashType {
     fn values() -> &'static [Self] {
     fn values() -> &'static [Self] {
         static values: &'static [TrashType] = &[
         static values: &'static [TrashType] = &[
             TrashType::Unknown,
             TrashType::Unknown,
-            TrashType::View,
-            TrashType::App,
+            TrashType::TrashView,
+            TrashType::TrashApp,
         ];
         ];
         values
         values
     }
     }
@@ -945,49 +945,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x01\x20\x03(\x0b2\x08.TrashIdR\x05items\x12\x1d\n\ndelete_all\x18\x02\
     \x01\x20\x03(\x0b2\x08.TrashIdR\x05items\x12\x1d\n\ndelete_all\x18\x02\
     \x20\x01(\x08R\tdeleteAll\"5\n\x07TrashId\x12\x0e\n\x02id\x18\x01\x20\
     \x20\x01(\x08R\tdeleteAll\"5\n\x07TrashId\x12\x0e\n\x02id\x18\x01\x20\
     \x01(\tR\x02id\x12\x1a\n\x02ty\x18\x02\x20\x01(\x0e2\n.TrashTypeR\x02ty*\
     \x01(\tR\x02id\x12\x1a\n\x02ty\x18\x02\x20\x01(\x0e2\n.TrashTypeR\x02ty*\
-    +\n\tTrashType\x12\x0b\n\x07Unknown\x10\0\x12\x08\n\x04View\x10\x01\x12\
-    \x07\n\x03App\x10\x02J\xc7\x06\n\x06\x12\x04\0\0\x18\x01\n\x08\n\x01\x0c\
-    \x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x08\x01\n\n\n\x03\x04\0\
-    \x01\x12\x03\x02\x08\r\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x12\n\x0c\
-    \n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\
-    \x03\x03\x0b\r\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x10\x11\n\x0b\n\
-    \x04\x04\0\x02\x01\x12\x03\x04\x04\x14\n\x0c\n\x05\x04\0\x02\x01\x05\x12\
-    \x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x0b\x0f\n\x0c\n\
-    \x05\x04\0\x02\x01\x03\x12\x03\x04\x12\x13\n\x0b\n\x04\x04\0\x02\x02\x12\
-    \x03\x05\x04\x1c\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x05\x04\t\n\x0c\n\
-    \x05\x04\0\x02\x02\x01\x12\x03\x05\n\x17\n\x0c\n\x05\x04\0\x02\x02\x03\
-    \x12\x03\x05\x1a\x1b\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x06\x04\x1a\n\x0c\
-    \n\x05\x04\0\x02\x03\x05\x12\x03\x06\x04\t\n\x0c\n\x05\x04\0\x02\x03\x01\
-    \x12\x03\x06\n\x15\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x06\x18\x19\n\
-    \x0b\n\x04\x04\0\x02\x04\x12\x03\x07\x04\x15\n\x0c\n\x05\x04\0\x02\x04\
-    \x06\x12\x03\x07\x04\r\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\x07\x0e\x10\
-    \n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03\x07\x13\x14\n\n\n\x02\x04\x01\x12\
-    \x04\t\0\x0b\x01\n\n\n\x03\x04\x01\x01\x12\x03\t\x08\x15\n\x0b\n\x04\x04\
-    \x01\x02\0\x12\x03\n\x04\x1d\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\n\x04\
-    \x0c\n\x0c\n\x05\x04\x01\x02\0\x06\x12\x03\n\r\x12\n\x0c\n\x05\x04\x01\
-    \x02\0\x01\x12\x03\n\x13\x18\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\n\x1b\
-    \x1c\n\n\n\x02\x04\x02\x12\x04\x0c\0\x0f\x01\n\n\n\x03\x04\x02\x01\x12\
-    \x03\x0c\x08\x17\n\x0b\n\x04\x04\x02\x02\0\x12\x03\r\x04\x1f\n\x0c\n\x05\
-    \x04\x02\x02\0\x04\x12\x03\r\x04\x0c\n\x0c\n\x05\x04\x02\x02\0\x06\x12\
-    \x03\r\r\x14\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\r\x15\x1a\n\x0c\n\x05\
-    \x04\x02\x02\0\x03\x12\x03\r\x1d\x1e\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\
-    \x0e\x04\x18\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x0e\x04\x08\n\x0c\n\
-    \x05\x04\x02\x02\x01\x01\x12\x03\x0e\t\x13\n\x0c\n\x05\x04\x02\x02\x01\
-    \x03\x12\x03\x0e\x16\x17\n\n\n\x02\x04\x03\x12\x04\x10\0\x13\x01\n\n\n\
-    \x03\x04\x03\x01\x12\x03\x10\x08\x0f\n\x0b\n\x04\x04\x03\x02\0\x12\x03\
-    \x11\x04\x12\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03\x11\x04\n\n\x0c\n\x05\
-    \x04\x03\x02\0\x01\x12\x03\x11\x0b\r\n\x0c\n\x05\x04\x03\x02\0\x03\x12\
-    \x03\x11\x10\x11\n\x0b\n\x04\x04\x03\x02\x01\x12\x03\x12\x04\x15\n\x0c\n\
-    \x05\x04\x03\x02\x01\x06\x12\x03\x12\x04\r\n\x0c\n\x05\x04\x03\x02\x01\
-    \x01\x12\x03\x12\x0e\x10\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\x03\x12\x13\
-    \x14\n\n\n\x02\x05\0\x12\x04\x14\0\x18\x01\n\n\n\x03\x05\0\x01\x12\x03\
-    \x14\x05\x0e\n\x0b\n\x04\x05\0\x02\0\x12\x03\x15\x04\x10\n\x0c\n\x05\x05\
-    \0\x02\0\x01\x12\x03\x15\x04\x0b\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x15\
-    \x0e\x0f\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x16\x04\r\n\x0c\n\x05\x05\0\
-    \x02\x01\x01\x12\x03\x16\x04\x08\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\
-    \x16\x0b\x0c\n\x0b\n\x04\x05\0\x02\x02\x12\x03\x17\x04\x0c\n\x0c\n\x05\
-    \x05\0\x02\x02\x01\x12\x03\x17\x04\x07\n\x0c\n\x05\x05\0\x02\x02\x02\x12\
-    \x03\x17\n\x0bb\x06proto3\
+    5\n\tTrashType\x12\x0b\n\x07Unknown\x10\0\x12\r\n\tTrashView\x10\x01\x12\
+    \x0c\n\x08TrashApp\x10\x02b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 118
shared-lib/flowy-folder-data-model/src/protobuf/model/view.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct View {
 pub struct View {
@@ -2786,122 +2786,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\
     \x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\
     \x04\x20\x01(\tH\x02R\tthumbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_desc\
     \x04\x20\x01(\tH\x02R\tthumbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_desc\
     B\x12\n\x10one_of_thumbnail*\x1e\n\x08ViewType\x12\t\n\x05Blank\x10\0\
     B\x12\n\x10one_of_thumbnail*\x1e\n\x08ViewType\x12\t\n\x05Blank\x10\0\
-    \x12\x07\n\x03Doc\x10\x01J\xd2\x12\n\x06\x12\x04\0\08\x01\n\x08\n\x01\
-    \x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\x0c\x01\n\n\n\x03\x04\
-    \0\x01\x12\x03\x02\x08\x0c\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x12\n\
-    \x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\
-    \x12\x03\x03\x0b\r\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x10\x11\n\x0b\
-    \n\x04\x04\0\x02\x01\x12\x03\x04\x04\x1c\n\x0c\n\x05\x04\0\x02\x01\x05\
-    \x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\x0b\x17\n\
-    \x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x1a\x1b\n\x0b\n\x04\x04\0\x02\
-    \x02\x12\x03\x05\x04\x14\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x05\x04\n\
-    \n\x0c\n\x05\x04\0\x02\x02\x01\x12\x03\x05\x0b\x0f\n\x0c\n\x05\x04\0\x02\
-    \x02\x03\x12\x03\x05\x12\x13\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x06\x04\
-    \x14\n\x0c\n\x05\x04\0\x02\x03\x05\x12\x03\x06\x04\n\n\x0c\n\x05\x04\0\
-    \x02\x03\x01\x12\x03\x06\x0b\x0f\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\
-    \x06\x12\x13\n\x0b\n\x04\x04\0\x02\x04\x12\x03\x07\x04\x1b\n\x0c\n\x05\
-    \x04\0\x02\x04\x06\x12\x03\x07\x04\x0c\n\x0c\n\x05\x04\0\x02\x04\x01\x12\
-    \x03\x07\r\x16\n\x0c\n\x05\x04\0\x02\x04\x03\x12\x03\x07\x19\x1a\n\x0b\n\
-    \x04\x04\0\x02\x05\x12\x03\x08\x04\x16\n\x0c\n\x05\x04\0\x02\x05\x05\x12\
-    \x03\x08\x04\t\n\x0c\n\x05\x04\0\x02\x05\x01\x12\x03\x08\n\x11\n\x0c\n\
-    \x05\x04\0\x02\x05\x03\x12\x03\x08\x14\x15\n\x0b\n\x04\x04\0\x02\x06\x12\
-    \x03\t\x04\x20\n\x0c\n\x05\x04\0\x02\x06\x06\x12\x03\t\x04\x10\n\x0c\n\
-    \x05\x04\0\x02\x06\x01\x12\x03\t\x11\x1b\n\x0c\n\x05\x04\0\x02\x06\x03\
-    \x12\x03\t\x1e\x1f\n\x0b\n\x04\x04\0\x02\x07\x12\x03\n\x04\x1c\n\x0c\n\
-    \x05\x04\0\x02\x07\x05\x12\x03\n\x04\t\n\x0c\n\x05\x04\0\x02\x07\x01\x12\
-    \x03\n\n\x17\n\x0c\n\x05\x04\0\x02\x07\x03\x12\x03\n\x1a\x1b\n\x0b\n\x04\
-    \x04\0\x02\x08\x12\x03\x0b\x04\x1a\n\x0c\n\x05\x04\0\x02\x08\x05\x12\x03\
-    \x0b\x04\t\n\x0c\n\x05\x04\0\x02\x08\x01\x12\x03\x0b\n\x15\n\x0c\n\x05\
-    \x04\0\x02\x08\x03\x12\x03\x0b\x18\x19\n\n\n\x02\x04\x01\x12\x04\r\0\x0f\
-    \x01\n\n\n\x03\x04\x01\x01\x12\x03\r\x08\x14\n\x0b\n\x04\x04\x01\x02\0\
-    \x12\x03\x0e\x04\x1c\n\x0c\n\x05\x04\x01\x02\0\x04\x12\x03\x0e\x04\x0c\n\
-    \x0c\n\x05\x04\x01\x02\0\x06\x12\x03\x0e\r\x11\n\x0c\n\x05\x04\x01\x02\0\
-    \x01\x12\x03\x0e\x12\x17\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x0e\x1a\
-    \x1b\n\n\n\x02\x04\x02\x12\x04\x10\0\x16\x01\n\n\n\x03\x04\x02\x01\x12\
-    \x03\x10\x08\x19\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x11\x04\x1c\n\x0c\n\
-    \x05\x04\x02\x02\0\x05\x12\x03\x11\x04\n\n\x0c\n\x05\x04\x02\x02\0\x01\
-    \x12\x03\x11\x0b\x17\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x11\x1a\x1b\n\
-    \x0b\n\x04\x04\x02\x02\x01\x12\x03\x12\x04\x14\n\x0c\n\x05\x04\x02\x02\
-    \x01\x05\x12\x03\x12\x04\n\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\x12\
-    \x0b\x0f\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x12\x12\x13\n\x0b\n\x04\
-    \x04\x02\x02\x02\x12\x03\x13\x04\x14\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\
-    \x03\x13\x04\n\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03\x13\x0b\x0f\n\x0c\
-    \n\x05\x04\x02\x02\x02\x03\x12\x03\x13\x12\x13\n\x0b\n\x04\x04\x02\x08\0\
-    \x12\x03\x14\x044\n\x0c\n\x05\x04\x02\x08\0\x01\x12\x03\x14\n\x1a\n\x0b\
-    \n\x04\x04\x02\x02\x03\x12\x03\x14\x1d2\n\x0c\n\x05\x04\x02\x02\x03\x05\
-    \x12\x03\x14\x1d#\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03\x14$-\n\x0c\n\
-    \x05\x04\x02\x02\x03\x03\x12\x03\x1401\n\x0b\n\x04\x04\x02\x02\x04\x12\
-    \x03\x15\x04\x1b\n\x0c\n\x05\x04\x02\x02\x04\x06\x12\x03\x15\x04\x0c\n\
-    \x0c\n\x05\x04\x02\x02\x04\x01\x12\x03\x15\r\x16\n\x0c\n\x05\x04\x02\x02\
-    \x04\x03\x12\x03\x15\x19\x1a\n\n\n\x02\x04\x03\x12\x04\x17\0\x1f\x01\n\n\
-    \n\x03\x04\x03\x01\x12\x03\x17\x08\x18\n\x0b\n\x04\x04\x03\x02\0\x12\x03\
-    \x18\x04\x1c\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03\x18\x04\n\n\x0c\n\x05\
-    \x04\x03\x02\0\x01\x12\x03\x18\x0b\x17\n\x0c\n\x05\x04\x03\x02\0\x03\x12\
-    \x03\x18\x1a\x1b\n\x0b\n\x04\x04\x03\x02\x01\x12\x03\x19\x04\x14\n\x0c\n\
-    \x05\x04\x03\x02\x01\x05\x12\x03\x19\x04\n\n\x0c\n\x05\x04\x03\x02\x01\
-    \x01\x12\x03\x19\x0b\x0f\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\x03\x19\x12\
-    \x13\n\x0b\n\x04\x04\x03\x02\x02\x12\x03\x1a\x04\x14\n\x0c\n\x05\x04\x03\
-    \x02\x02\x05\x12\x03\x1a\x04\n\n\x0c\n\x05\x04\x03\x02\x02\x01\x12\x03\
-    \x1a\x0b\x0f\n\x0c\n\x05\x04\x03\x02\x02\x03\x12\x03\x1a\x12\x13\n\x0b\n\
-    \x04\x04\x03\x02\x03\x12\x03\x1b\x04\x19\n\x0c\n\x05\x04\x03\x02\x03\x05\
-    \x12\x03\x1b\x04\n\n\x0c\n\x05\x04\x03\x02\x03\x01\x12\x03\x1b\x0b\x14\n\
-    \x0c\n\x05\x04\x03\x02\x03\x03\x12\x03\x1b\x17\x18\n\x0b\n\x04\x04\x03\
-    \x02\x04\x12\x03\x1c\x04\x1b\n\x0c\n\x05\x04\x03\x02\x04\x06\x12\x03\x1c\
-    \x04\x0c\n\x0c\n\x05\x04\x03\x02\x04\x01\x12\x03\x1c\r\x16\n\x0c\n\x05\
-    \x04\x03\x02\x04\x03\x12\x03\x1c\x19\x1a\n\x0b\n\x04\x04\x03\x02\x05\x12\
-    \x03\x1d\x04\x19\n\x0c\n\x05\x04\x03\x02\x05\x05\x12\x03\x1d\x04\n\n\x0c\
-    \n\x05\x04\x03\x02\x05\x01\x12\x03\x1d\x0b\x14\n\x0c\n\x05\x04\x03\x02\
-    \x05\x03\x12\x03\x1d\x17\x18\n\x0b\n\x04\x04\x03\x02\x06\x12\x03\x1e\x04\
-    \x17\n\x0c\n\x05\x04\x03\x02\x06\x05\x12\x03\x1e\x04\n\n\x0c\n\x05\x04\
-    \x03\x02\x06\x01\x12\x03\x1e\x0b\x12\n\x0c\n\x05\x04\x03\x02\x06\x03\x12\
-    \x03\x1e\x15\x16\n\n\n\x02\x04\x04\x12\x04\x20\0\"\x01\n\n\n\x03\x04\x04\
-    \x01\x12\x03\x20\x08\x18\n\x0b\n\x04\x04\x04\x02\0\x12\x03!\x04!\n\x0c\n\
-    \x05\x04\x04\x02\0\x04\x12\x03!\x04\x0c\n\x0c\n\x05\x04\x04\x02\0\x05\
-    \x12\x03!\r\x13\n\x0c\n\x05\x04\x04\x02\0\x01\x12\x03!\x14\x1c\n\x0c\n\
-    \x05\x04\x04\x02\0\x03\x12\x03!\x1f\x20\n\n\n\x02\x04\x05\x12\x04#\0%\
-    \x01\n\n\n\x03\x04\x05\x01\x12\x03#\x08\x0e\n\x0b\n\x04\x04\x05\x02\0\
-    \x12\x03$\x04\x17\n\x0c\n\x05\x04\x05\x02\0\x05\x12\x03$\x04\n\n\x0c\n\
-    \x05\x04\x05\x02\0\x01\x12\x03$\x0b\x12\n\x0c\n\x05\x04\x05\x02\0\x03\
-    \x12\x03$\x15\x16\n\n\n\x02\x04\x06\x12\x04&\0(\x01\n\n\n\x03\x04\x06\
-    \x01\x12\x03&\x08\x16\n\x0b\n\x04\x04\x06\x02\0\x12\x03'\x04\x1e\n\x0c\n\
-    \x05\x04\x06\x02\0\x04\x12\x03'\x04\x0c\n\x0c\n\x05\x04\x06\x02\0\x05\
-    \x12\x03'\r\x13\n\x0c\n\x05\x04\x06\x02\0\x01\x12\x03'\x14\x19\n\x0c\n\
-    \x05\x04\x06\x02\0\x03\x12\x03'\x1c\x1d\n\n\n\x02\x04\x07\x12\x04)\0.\
-    \x01\n\n\n\x03\x04\x07\x01\x12\x03)\x08\x19\n\x0b\n\x04\x04\x07\x02\0\
-    \x12\x03*\x04\x17\n\x0c\n\x05\x04\x07\x02\0\x05\x12\x03*\x04\n\n\x0c\n\
-    \x05\x04\x07\x02\0\x01\x12\x03*\x0b\x12\n\x0c\n\x05\x04\x07\x02\0\x03\
-    \x12\x03*\x15\x16\n\x0b\n\x04\x04\x07\x08\0\x12\x03+\x04*\n\x0c\n\x05\
-    \x04\x07\x08\0\x01\x12\x03+\n\x15\n\x0b\n\x04\x04\x07\x02\x01\x12\x03+\
-    \x18(\n\x0c\n\x05\x04\x07\x02\x01\x05\x12\x03+\x18\x1e\n\x0c\n\x05\x04\
-    \x07\x02\x01\x01\x12\x03+\x1f#\n\x0c\n\x05\x04\x07\x02\x01\x03\x12\x03+&\
-    '\n\x0b\n\x04\x04\x07\x08\x01\x12\x03,\x04*\n\x0c\n\x05\x04\x07\x08\x01\
-    \x01\x12\x03,\n\x15\n\x0b\n\x04\x04\x07\x02\x02\x12\x03,\x18(\n\x0c\n\
-    \x05\x04\x07\x02\x02\x05\x12\x03,\x18\x1e\n\x0c\n\x05\x04\x07\x02\x02\
-    \x01\x12\x03,\x1f#\n\x0c\n\x05\x04\x07\x02\x02\x03\x12\x03,&'\n\x0b\n\
-    \x04\x04\x07\x08\x02\x12\x03-\x044\n\x0c\n\x05\x04\x07\x08\x02\x01\x12\
-    \x03-\n\x1a\n\x0b\n\x04\x04\x07\x02\x03\x12\x03-\x1d2\n\x0c\n\x05\x04\
-    \x07\x02\x03\x05\x12\x03-\x1d#\n\x0c\n\x05\x04\x07\x02\x03\x01\x12\x03-$\
-    -\n\x0c\n\x05\x04\x07\x02\x03\x03\x12\x03-01\n\n\n\x02\x04\x08\x12\x04/\
-    \04\x01\n\n\n\x03\x04\x08\x01\x12\x03/\x08\x18\n\x0b\n\x04\x04\x08\x02\0\
-    \x12\x030\x04\x17\n\x0c\n\x05\x04\x08\x02\0\x05\x12\x030\x04\n\n\x0c\n\
-    \x05\x04\x08\x02\0\x01\x12\x030\x0b\x12\n\x0c\n\x05\x04\x08\x02\0\x03\
-    \x12\x030\x15\x16\n\x0b\n\x04\x04\x08\x08\0\x12\x031\x04*\n\x0c\n\x05\
-    \x04\x08\x08\0\x01\x12\x031\n\x15\n\x0b\n\x04\x04\x08\x02\x01\x12\x031\
-    \x18(\n\x0c\n\x05\x04\x08\x02\x01\x05\x12\x031\x18\x1e\n\x0c\n\x05\x04\
-    \x08\x02\x01\x01\x12\x031\x1f#\n\x0c\n\x05\x04\x08\x02\x01\x03\x12\x031&\
-    '\n\x0b\n\x04\x04\x08\x08\x01\x12\x032\x04*\n\x0c\n\x05\x04\x08\x08\x01\
-    \x01\x12\x032\n\x15\n\x0b\n\x04\x04\x08\x02\x02\x12\x032\x18(\n\x0c\n\
-    \x05\x04\x08\x02\x02\x05\x12\x032\x18\x1e\n\x0c\n\x05\x04\x08\x02\x02\
-    \x01\x12\x032\x1f#\n\x0c\n\x05\x04\x08\x02\x02\x03\x12\x032&'\n\x0b\n\
-    \x04\x04\x08\x08\x02\x12\x033\x044\n\x0c\n\x05\x04\x08\x08\x02\x01\x12\
-    \x033\n\x1a\n\x0b\n\x04\x04\x08\x02\x03\x12\x033\x1d2\n\x0c\n\x05\x04\
-    \x08\x02\x03\x05\x12\x033\x1d#\n\x0c\n\x05\x04\x08\x02\x03\x01\x12\x033$\
-    -\n\x0c\n\x05\x04\x08\x02\x03\x03\x12\x03301\n\n\n\x02\x05\0\x12\x045\08\
-    \x01\n\n\n\x03\x05\0\x01\x12\x035\x05\r\n\x0b\n\x04\x05\0\x02\0\x12\x036\
-    \x04\x0e\n\x0c\n\x05\x05\0\x02\0\x01\x12\x036\x04\t\n\x0c\n\x05\x05\0\
-    \x02\0\x02\x12\x036\x0c\r\n\x0b\n\x04\x05\0\x02\x01\x12\x037\x04\x0c\n\
-    \x0c\n\x05\x05\0\x02\x01\x01\x12\x037\x04\x07\n\x0c\n\x05\x05\0\x02\x01\
-    \x02\x12\x037\n\x0bb\x06proto3\
+    \x12\x07\n\x03Doc\x10\x01b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 80
shared-lib/flowy-folder-data-model/src/protobuf/model/workspace.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct Workspace {
 pub struct Workspace {
@@ -2288,84 +2288,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x0bone_of_desc\"q\n\x15UpdateWorkspaceParams\x12\x0e\n\x02id\x18\x01\
     \x0bone_of_desc\"q\n\x15UpdateWorkspaceParams\x12\x0e\n\x02id\x18\x01\
     \x20\x01(\tR\x02id\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\
     \x20\x01(\tR\x02id\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\
     \x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04descB\r\n\x0bone_of_nameB\r\n\
     \x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04descB\r\n\x0bone_of_nameB\r\n\
-    \x0bone_of_descJ\xce\x0c\n\x06\x12\x04\0\0*\x01\n\x08\n\x01\x0c\x12\x03\
-    \0\0\x12\n\t\n\x02\x03\0\x12\x03\x01\0\x13\n\t\n\x02\x03\x01\x12\x03\x02\
-    \0\x14\n\n\n\x02\x04\0\x12\x04\x04\0\x0b\x01\n\n\n\x03\x04\0\x01\x12\x03\
-    \x04\x08\x11\n\x0b\n\x04\x04\0\x02\0\x12\x03\x05\x04\x12\n\x0c\n\x05\x04\
-    \0\x02\0\x05\x12\x03\x05\x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x05\
-    \x0b\r\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x05\x10\x11\n\x0b\n\x04\x04\0\
-    \x02\x01\x12\x03\x06\x04\x14\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x06\
-    \x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x06\x0b\x0f\n\x0c\n\x05\x04\
-    \0\x02\x01\x03\x12\x03\x06\x12\x13\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x07\
-    \x04\x14\n\x0c\n\x05\x04\0\x02\x02\x05\x12\x03\x07\x04\n\n\x0c\n\x05\x04\
-    \0\x02\x02\x01\x12\x03\x07\x0b\x0f\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\
-    \x07\x12\x13\n\x0b\n\x04\x04\0\x02\x03\x12\x03\x08\x04\x19\n\x0c\n\x05\
-    \x04\0\x02\x03\x06\x12\x03\x08\x04\x0f\n\x0c\n\x05\x04\0\x02\x03\x01\x12\
-    \x03\x08\x10\x14\n\x0c\n\x05\x04\0\x02\x03\x03\x12\x03\x08\x17\x18\n\x0b\
-    \n\x04\x04\0\x02\x04\x12\x03\t\x04\x1c\n\x0c\n\x05\x04\0\x02\x04\x05\x12\
-    \x03\t\x04\t\n\x0c\n\x05\x04\0\x02\x04\x01\x12\x03\t\n\x17\n\x0c\n\x05\
-    \x04\0\x02\x04\x03\x12\x03\t\x1a\x1b\n\x0b\n\x04\x04\0\x02\x05\x12\x03\n\
-    \x04\x1a\n\x0c\n\x05\x04\0\x02\x05\x05\x12\x03\n\x04\t\n\x0c\n\x05\x04\0\
-    \x02\x05\x01\x12\x03\n\n\x15\n\x0c\n\x05\x04\0\x02\x05\x03\x12\x03\n\x18\
-    \x19\n\n\n\x02\x04\x01\x12\x04\x0c\0\x0e\x01\n\n\n\x03\x04\x01\x01\x12\
-    \x03\x0c\x08\x19\n\x0b\n\x04\x04\x01\x02\0\x12\x03\r\x04!\n\x0c\n\x05\
-    \x04\x01\x02\0\x04\x12\x03\r\x04\x0c\n\x0c\n\x05\x04\x01\x02\0\x06\x12\
-    \x03\r\r\x16\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\r\x17\x1c\n\x0c\n\x05\
-    \x04\x01\x02\0\x03\x12\x03\r\x1f\x20\n\n\n\x02\x04\x02\x12\x04\x0f\0\x12\
-    \x01\n\n\n\x03\x04\x02\x01\x12\x03\x0f\x08\x1e\n\x0b\n\x04\x04\x02\x02\0\
-    \x12\x03\x10\x04\x14\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x10\x04\n\n\
-    \x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x10\x0b\x0f\n\x0c\n\x05\x04\x02\x02\
-    \0\x03\x12\x03\x10\x12\x13\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x11\x04\
-    \x14\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\x11\x04\n\n\x0c\n\x05\x04\
-    \x02\x02\x01\x01\x12\x03\x11\x0b\x0f\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\
-    \x03\x11\x12\x13\n\n\n\x02\x04\x03\x12\x04\x13\0\x16\x01\n\n\n\x03\x04\
-    \x03\x01\x12\x03\x13\x08\x1d\n\x0b\n\x04\x04\x03\x02\0\x12\x03\x14\x04\
-    \x14\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03\x14\x04\n\n\x0c\n\x05\x04\x03\
-    \x02\0\x01\x12\x03\x14\x0b\x0f\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\x14\
-    \x12\x13\n\x0b\n\x04\x04\x03\x02\x01\x12\x03\x15\x04\x14\n\x0c\n\x05\x04\
-    \x03\x02\x01\x05\x12\x03\x15\x04\n\n\x0c\n\x05\x04\x03\x02\x01\x01\x12\
-    \x03\x15\x0b\x0f\n\x0c\n\x05\x04\x03\x02\x01\x03\x12\x03\x15\x12\x13\n\n\
-    \n\x02\x04\x04\x12\x04\x17\0\x19\x01\n\n\n\x03\x04\x04\x01\x12\x03\x17\
-    \x08\x1d\n\x0b\n\x04\x04\x04\x08\0\x12\x03\x18\x04:\n\x0c\n\x05\x04\x04\
-    \x08\0\x01\x12\x03\x18\n\x1d\n\x0b\n\x04\x04\x04\x02\0\x12\x03\x18\x208\
-    \n\x0c\n\x05\x04\x04\x02\0\x05\x12\x03\x18\x20&\n\x0c\n\x05\x04\x04\x02\
-    \0\x01\x12\x03\x18'3\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03\x1867\n\n\n\
-    \x02\x04\x05\x12\x04\x1a\0\x1c\x01\n\n\n\x03\x04\x05\x01\x12\x03\x1a\x08\
-    \x13\n\x0b\n\x04\x04\x05\x08\0\x12\x03\x1b\x04:\n\x0c\n\x05\x04\x05\x08\
-    \0\x01\x12\x03\x1b\n\x1d\n\x0b\n\x04\x04\x05\x02\0\x12\x03\x1b\x208\n\
-    \x0c\n\x05\x04\x05\x02\0\x05\x12\x03\x1b\x20&\n\x0c\n\x05\x04\x05\x02\0\
-    \x01\x12\x03\x1b'3\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03\x1b67\n\n\n\x02\
-    \x04\x06\x12\x04\x1d\0\x20\x01\n\n\n\x03\x04\x06\x01\x12\x03\x1d\x08\x1f\
-    \n\x0b\n\x04\x04\x06\x02\0\x12\x03\x1e\x04\x1c\n\x0c\n\x05\x04\x06\x02\0\
-    \x06\x12\x03\x1e\x04\r\n\x0c\n\x05\x04\x06\x02\0\x01\x12\x03\x1e\x0e\x17\
-    \n\x0c\n\x05\x04\x06\x02\0\x03\x12\x03\x1e\x1a\x1b\n\x0b\n\x04\x04\x06\
-    \x08\0\x12\x03\x1f\x046\n\x0c\n\x05\x04\x06\x08\0\x01\x12\x03\x1f\n\x1c\
-    \n\x0b\n\x04\x04\x06\x02\x01\x12\x03\x1f\x1f4\n\x0c\n\x05\x04\x06\x02\
-    \x01\x06\x12\x03\x1f\x1f#\n\x0c\n\x05\x04\x06\x02\x01\x01\x12\x03\x1f$/\
-    \n\x0c\n\x05\x04\x06\x02\x01\x03\x12\x03\x1f23\n\n\n\x02\x04\x07\x12\x04\
-    !\0%\x01\n\n\n\x03\x04\x07\x01\x12\x03!\x08\x1e\n\x0b\n\x04\x04\x07\x02\
-    \0\x12\x03\"\x04\x12\n\x0c\n\x05\x04\x07\x02\0\x05\x12\x03\"\x04\n\n\x0c\
-    \n\x05\x04\x07\x02\0\x01\x12\x03\"\x0b\r\n\x0c\n\x05\x04\x07\x02\0\x03\
-    \x12\x03\"\x10\x11\n\x0b\n\x04\x04\x07\x08\0\x12\x03#\x04*\n\x0c\n\x05\
-    \x04\x07\x08\0\x01\x12\x03#\n\x15\n\x0b\n\x04\x04\x07\x02\x01\x12\x03#\
-    \x18(\n\x0c\n\x05\x04\x07\x02\x01\x05\x12\x03#\x18\x1e\n\x0c\n\x05\x04\
-    \x07\x02\x01\x01\x12\x03#\x1f#\n\x0c\n\x05\x04\x07\x02\x01\x03\x12\x03#&\
-    '\n\x0b\n\x04\x04\x07\x08\x01\x12\x03$\x04*\n\x0c\n\x05\x04\x07\x08\x01\
-    \x01\x12\x03$\n\x15\n\x0b\n\x04\x04\x07\x02\x02\x12\x03$\x18(\n\x0c\n\
-    \x05\x04\x07\x02\x02\x05\x12\x03$\x18\x1e\n\x0c\n\x05\x04\x07\x02\x02\
-    \x01\x12\x03$\x1f#\n\x0c\n\x05\x04\x07\x02\x02\x03\x12\x03$&'\n\n\n\x02\
-    \x04\x08\x12\x04&\0*\x01\n\n\n\x03\x04\x08\x01\x12\x03&\x08\x1d\n\x0b\n\
-    \x04\x04\x08\x02\0\x12\x03'\x04\x12\n\x0c\n\x05\x04\x08\x02\0\x05\x12\
-    \x03'\x04\n\n\x0c\n\x05\x04\x08\x02\0\x01\x12\x03'\x0b\r\n\x0c\n\x05\x04\
-    \x08\x02\0\x03\x12\x03'\x10\x11\n\x0b\n\x04\x04\x08\x08\0\x12\x03(\x04*\
-    \n\x0c\n\x05\x04\x08\x08\0\x01\x12\x03(\n\x15\n\x0b\n\x04\x04\x08\x02\
-    \x01\x12\x03(\x18(\n\x0c\n\x05\x04\x08\x02\x01\x05\x12\x03(\x18\x1e\n\
-    \x0c\n\x05\x04\x08\x02\x01\x01\x12\x03(\x1f#\n\x0c\n\x05\x04\x08\x02\x01\
-    \x03\x12\x03(&'\n\x0b\n\x04\x04\x08\x08\x01\x12\x03)\x04*\n\x0c\n\x05\
-    \x04\x08\x08\x01\x01\x12\x03)\n\x15\n\x0b\n\x04\x04\x08\x02\x02\x12\x03)\
-    \x18(\n\x0c\n\x05\x04\x08\x02\x02\x05\x12\x03)\x18\x1e\n\x0c\n\x05\x04\
-    \x08\x02\x02\x01\x12\x03)\x1f#\n\x0c\n\x05\x04\x08\x02\x02\x03\x12\x03)&\
-    'b\x06proto3\
+    \x0bone_of_descb\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 2 - 2
shared-lib/flowy-folder-data-model/src/protobuf/proto/trash.proto

@@ -20,6 +20,6 @@ message TrashId {
 }
 }
 enum TrashType {
 enum TrashType {
     Unknown = 0;
     Unknown = 0;
-    View = 1;
-    App = 2;
+    TrashView = 1;
+    TrashApp = 2;
 }
 }

+ 2 - 0
shared-lib/flowy-user-data-model/Cargo.toml

@@ -18,6 +18,8 @@ log = "0.4.14"
 fancy-regex = "0.5.0"
 fancy-regex = "0.5.0"
 lazy_static = "1.4"
 lazy_static = "1.4"
 
 
+[build-dependencies]
+lib-infra = { path = "../lib-infra", features = ["gen_pb"] }
 
 
 [dev-dependencies]
 [dev-dependencies]
 quickcheck = "0.9.2"
 quickcheck = "0.9.2"

+ 5 - 0
shared-lib/flowy-user-data-model/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("flowy-user-data-model", "./src/protobuf/proto");
+}

+ 3 - 67
shared-lib/flowy-user-data-model/src/protobuf/model/auth.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct SignInRequest {
 pub struct SignInRequest {
@@ -1581,71 +1581,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x12\x1a\n\x08password\x18\x03\x20\x01(\tR\x08password\"i\n\x0eSignUpRes\
     \x12\x1a\n\x08password\x18\x03\x20\x01(\tR\x08password\"i\n\x0eSignUpRes\
     ponse\x12\x17\n\x07user_id\x18\x01\x20\x01(\tR\x06userId\x12\x12\n\x04na\
     ponse\x12\x17\n\x07user_id\x18\x01\x20\x01(\tR\x06userId\x12\x12\n\x04na\
     me\x18\x02\x20\x01(\tR\x04name\x12\x14\n\x05email\x18\x03\x20\x01(\tR\
     me\x18\x02\x20\x01(\tR\x04name\x12\x14\n\x05email\x18\x03\x20\x01(\tR\
-    \x05email\x12\x14\n\x05token\x18\x04\x20\x01(\tR\x05tokenJ\xee\t\n\x06\
-    \x12\x04\0\0!\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\
-    \x04\x02\0\x06\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x15\n\x0b\n\x04\
-    \x04\0\x02\0\x12\x03\x03\x04\x15\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\
-    \x04\n\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x10\n\x0c\n\x05\x04\0\
-    \x02\0\x03\x12\x03\x03\x13\x14\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\
-    \x18\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\
-    \x02\x01\x01\x12\x03\x04\x0b\x13\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\
-    \x04\x16\x17\n\x0b\n\x04\x04\0\x02\x02\x12\x03\x05\x04\x14\n\x0c\n\x05\
-    \x04\0\x02\x02\x05\x12\x03\x05\x04\n\n\x0c\n\x05\x04\0\x02\x02\x01\x12\
-    \x03\x05\x0b\x0f\n\x0c\n\x05\x04\0\x02\x02\x03\x12\x03\x05\x12\x13\n\n\n\
-    \x02\x04\x01\x12\x04\x07\0\x0b\x01\n\n\n\x03\x04\x01\x01\x12\x03\x07\x08\
-    \x14\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x08\x04\x15\n\x0c\n\x05\x04\x01\
-    \x02\0\x05\x12\x03\x08\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x08\
-    \x0b\x10\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x08\x13\x14\n\x0b\n\x04\
-    \x04\x01\x02\x01\x12\x03\t\x04\x18\n\x0c\n\x05\x04\x01\x02\x01\x05\x12\
-    \x03\t\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\t\x0b\x13\n\x0c\n\
-    \x05\x04\x01\x02\x01\x03\x12\x03\t\x16\x17\n\x0b\n\x04\x04\x01\x02\x02\
-    \x12\x03\n\x04\x14\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\n\x04\n\n\x0c\
-    \n\x05\x04\x01\x02\x02\x01\x12\x03\n\x0b\x0f\n\x0c\n\x05\x04\x01\x02\x02\
-    \x03\x12\x03\n\x12\x13\n\n\n\x02\x04\x02\x12\x04\x0c\0\x11\x01\n\n\n\x03\
-    \x04\x02\x01\x12\x03\x0c\x08\x16\n\x0b\n\x04\x04\x02\x02\0\x12\x03\r\x04\
-    \x17\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\r\x04\n\n\x0c\n\x05\x04\x02\
-    \x02\0\x01\x12\x03\r\x0b\x12\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\r\x15\
-    \x16\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\x0e\x04\x14\n\x0c\n\x05\x04\x02\
-    \x02\x01\x05\x12\x03\x0e\x04\n\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\
-    \x0e\x0b\x0f\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\x0e\x12\x13\n\x0b\n\
-    \x04\x04\x02\x02\x02\x12\x03\x0f\x04\x15\n\x0c\n\x05\x04\x02\x02\x02\x05\
-    \x12\x03\x0f\x04\n\n\x0c\n\x05\x04\x02\x02\x02\x01\x12\x03\x0f\x0b\x10\n\
-    \x0c\n\x05\x04\x02\x02\x02\x03\x12\x03\x0f\x13\x14\n\x0b\n\x04\x04\x02\
-    \x02\x03\x12\x03\x10\x04\x15\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\x03\x10\
-    \x04\n\n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03\x10\x0b\x10\n\x0c\n\x05\
-    \x04\x02\x02\x03\x03\x12\x03\x10\x13\x14\n\n\n\x02\x04\x03\x12\x04\x12\0\
-    \x16\x01\n\n\n\x03\x04\x03\x01\x12\x03\x12\x08\x15\n\x0b\n\x04\x04\x03\
-    \x02\0\x12\x03\x13\x04\x15\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03\x13\x04\
-    \n\n\x0c\n\x05\x04\x03\x02\0\x01\x12\x03\x13\x0b\x10\n\x0c\n\x05\x04\x03\
-    \x02\0\x03\x12\x03\x13\x13\x14\n\x0b\n\x04\x04\x03\x02\x01\x12\x03\x14\
-    \x04\x14\n\x0c\n\x05\x04\x03\x02\x01\x05\x12\x03\x14\x04\n\n\x0c\n\x05\
-    \x04\x03\x02\x01\x01\x12\x03\x14\x0b\x0f\n\x0c\n\x05\x04\x03\x02\x01\x03\
-    \x12\x03\x14\x12\x13\n\x0b\n\x04\x04\x03\x02\x02\x12\x03\x15\x04\x18\n\
-    \x0c\n\x05\x04\x03\x02\x02\x05\x12\x03\x15\x04\n\n\x0c\n\x05\x04\x03\x02\
-    \x02\x01\x12\x03\x15\x0b\x13\n\x0c\n\x05\x04\x03\x02\x02\x03\x12\x03\x15\
-    \x16\x17\n\n\n\x02\x04\x04\x12\x04\x17\0\x1b\x01\n\n\n\x03\x04\x04\x01\
-    \x12\x03\x17\x08\x14\n\x0b\n\x04\x04\x04\x02\0\x12\x03\x18\x04\x15\n\x0c\
-    \n\x05\x04\x04\x02\0\x05\x12\x03\x18\x04\n\n\x0c\n\x05\x04\x04\x02\0\x01\
-    \x12\x03\x18\x0b\x10\n\x0c\n\x05\x04\x04\x02\0\x03\x12\x03\x18\x13\x14\n\
-    \x0b\n\x04\x04\x04\x02\x01\x12\x03\x19\x04\x14\n\x0c\n\x05\x04\x04\x02\
-    \x01\x05\x12\x03\x19\x04\n\n\x0c\n\x05\x04\x04\x02\x01\x01\x12\x03\x19\
-    \x0b\x0f\n\x0c\n\x05\x04\x04\x02\x01\x03\x12\x03\x19\x12\x13\n\x0b\n\x04\
-    \x04\x04\x02\x02\x12\x03\x1a\x04\x18\n\x0c\n\x05\x04\x04\x02\x02\x05\x12\
-    \x03\x1a\x04\n\n\x0c\n\x05\x04\x04\x02\x02\x01\x12\x03\x1a\x0b\x13\n\x0c\
-    \n\x05\x04\x04\x02\x02\x03\x12\x03\x1a\x16\x17\n\n\n\x02\x04\x05\x12\x04\
-    \x1c\0!\x01\n\n\n\x03\x04\x05\x01\x12\x03\x1c\x08\x16\n\x0b\n\x04\x04\
-    \x05\x02\0\x12\x03\x1d\x04\x17\n\x0c\n\x05\x04\x05\x02\0\x05\x12\x03\x1d\
-    \x04\n\n\x0c\n\x05\x04\x05\x02\0\x01\x12\x03\x1d\x0b\x12\n\x0c\n\x05\x04\
-    \x05\x02\0\x03\x12\x03\x1d\x15\x16\n\x0b\n\x04\x04\x05\x02\x01\x12\x03\
-    \x1e\x04\x14\n\x0c\n\x05\x04\x05\x02\x01\x05\x12\x03\x1e\x04\n\n\x0c\n\
-    \x05\x04\x05\x02\x01\x01\x12\x03\x1e\x0b\x0f\n\x0c\n\x05\x04\x05\x02\x01\
-    \x03\x12\x03\x1e\x12\x13\n\x0b\n\x04\x04\x05\x02\x02\x12\x03\x1f\x04\x15\
-    \n\x0c\n\x05\x04\x05\x02\x02\x05\x12\x03\x1f\x04\n\n\x0c\n\x05\x04\x05\
-    \x02\x02\x01\x12\x03\x1f\x0b\x10\n\x0c\n\x05\x04\x05\x02\x02\x03\x12\x03\
-    \x1f\x13\x14\n\x0b\n\x04\x04\x05\x02\x03\x12\x03\x20\x04\x15\n\x0c\n\x05\
-    \x04\x05\x02\x03\x05\x12\x03\x20\x04\n\n\x0c\n\x05\x04\x05\x02\x03\x01\
-    \x12\x03\x20\x0b\x10\n\x0c\n\x05\x04\x05\x02\x03\x03\x12\x03\x20\x13\x14\
-    b\x06proto3\
+    \x05email\x12\x14\n\x05token\x18\x04\x20\x01(\tR\x05tokenb\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 0 - 11
shared-lib/flowy-user-data-model/src/protobuf/model/document

@@ -1,11 +0,0 @@
-#![cfg_attr(rustfmt, rustfmt::skip)]
-// Auto-generated, do not edit
-
-mod errors;
-pub use errors::*;
-
-mod user_profile;
-pub use user_profile::*;
-
-mod auth;
-pub use auth::*;

+ 3 - 37
shared-lib/flowy-user-data-model/src/protobuf/model/errors.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 #[derive(Clone,PartialEq,Eq,Debug,Hash)]
 pub enum ErrorCode {
 pub enum ErrorCode {
@@ -125,41 +125,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     aracters\x10\x15\x12\x13\n\x0fUserNameIsEmpty\x10\x16\x12\x11\n\rUserIdI\
     aracters\x10\x15\x12\x13\n\x0fUserNameIsEmpty\x10\x16\x12\x11\n\rUserIdI\
     nvalid\x10\x17\x12\x14\n\x10UserUnauthorized\x10\x18\x12\x10\n\x0cUserNo\
     nvalid\x10\x17\x12\x14\n\x10UserUnauthorized\x10\x18\x12\x10\n\x0cUserNo\
     tExist\x10\x19\x12\x0f\n\x0bServerError\x10c\x12\x11\n\rInternalError\
     tExist\x10\x19\x12\x0f\n\x0bServerError\x10c\x12\x11\n\rInternalError\
-    \x10dJ\xba\x05\n\x06\x12\x04\0\0\x13\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\
-    \n\n\n\x02\x05\0\x12\x04\x02\0\x13\x01\n\n\n\x03\x05\0\x01\x12\x03\x02\
-    \x05\x0e\n\x0b\n\x04\x05\0\x02\0\x12\x03\x03\x04\x15\n\x0c\n\x05\x05\0\
-    \x02\0\x01\x12\x03\x03\x04\x10\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x03\
-    \x13\x14\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x04\x04\x1b\n\x0c\n\x05\x05\0\
-    \x02\x01\x01\x12\x03\x04\x04\x16\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\
-    \x04\x19\x1a\n\x0b\n\x04\x05\0\x02\x02\x12\x03\x05\x04\x1b\n\x0c\n\x05\
-    \x05\0\x02\x02\x01\x12\x03\x05\x04\x16\n\x0c\n\x05\x05\0\x02\x02\x02\x12\
-    \x03\x05\x19\x1a\n\x0b\n\x04\x05\0\x02\x03\x12\x03\x06\x04\x19\n\x0c\n\
-    \x05\x05\0\x02\x03\x01\x12\x03\x06\x04\x13\n\x0c\n\x05\x05\0\x02\x03\x02\
-    \x12\x03\x06\x16\x18\n\x0b\n\x04\x05\0\x02\x04\x12\x03\x07\x04\x19\n\x0c\
-    \n\x05\x05\0\x02\x04\x01\x12\x03\x07\x04\x13\n\x0c\n\x05\x05\0\x02\x04\
-    \x02\x12\x03\x07\x16\x18\n\x0b\n\x04\x05\0\x02\x05\x12\x03\x08\x04*\n\
-    \x0c\n\x05\x05\0\x02\x05\x01\x12\x03\x08\x04$\n\x0c\n\x05\x05\0\x02\x05\
-    \x02\x12\x03\x08')\n\x0b\n\x04\x05\0\x02\x06\x12\x03\t\x04\x1f\n\x0c\n\
-    \x05\x05\0\x02\x06\x01\x12\x03\t\x04\x19\n\x0c\n\x05\x05\0\x02\x06\x02\
-    \x12\x03\t\x1c\x1e\n\x0b\n\x04\x05\0\x02\x07\x12\x03\n\x04\x1a\n\x0c\n\
-    \x05\x05\0\x02\x07\x01\x12\x03\n\x04\x14\n\x0c\n\x05\x05\0\x02\x07\x02\
-    \x12\x03\n\x17\x19\n\x0b\n\x04\x05\0\x02\x08\x12\x03\x0b\x04\x19\n\x0c\n\
-    \x05\x05\0\x02\x08\x01\x12\x03\x0b\x04\x13\n\x0c\n\x05\x05\0\x02\x08\x02\
-    \x12\x03\x0b\x16\x18\n\x0b\n\x04\x05\0\x02\t\x12\x03\x0c\x04,\n\x0c\n\
-    \x05\x05\0\x02\t\x01\x12\x03\x0c\x04&\n\x0c\n\x05\x05\0\x02\t\x02\x12\
-    \x03\x0c)+\n\x0b\n\x04\x05\0\x02\n\x12\x03\r\x04\x19\n\x0c\n\x05\x05\0\
-    \x02\n\x01\x12\x03\r\x04\x13\n\x0c\n\x05\x05\0\x02\n\x02\x12\x03\r\x16\
-    \x18\n\x0b\n\x04\x05\0\x02\x0b\x12\x03\x0e\x04\x17\n\x0c\n\x05\x05\0\x02\
-    \x0b\x01\x12\x03\x0e\x04\x11\n\x0c\n\x05\x05\0\x02\x0b\x02\x12\x03\x0e\
-    \x14\x16\n\x0b\n\x04\x05\0\x02\x0c\x12\x03\x0f\x04\x1a\n\x0c\n\x05\x05\0\
-    \x02\x0c\x01\x12\x03\x0f\x04\x14\n\x0c\n\x05\x05\0\x02\x0c\x02\x12\x03\
-    \x0f\x17\x19\n\x0b\n\x04\x05\0\x02\r\x12\x03\x10\x04\x16\n\x0c\n\x05\x05\
-    \0\x02\r\x01\x12\x03\x10\x04\x10\n\x0c\n\x05\x05\0\x02\r\x02\x12\x03\x10\
-    \x13\x15\n\x0b\n\x04\x05\0\x02\x0e\x12\x03\x11\x04\x15\n\x0c\n\x05\x05\0\
-    \x02\x0e\x01\x12\x03\x11\x04\x0f\n\x0c\n\x05\x05\0\x02\x0e\x02\x12\x03\
-    \x11\x12\x14\n\x0b\n\x04\x05\0\x02\x0f\x12\x03\x12\x04\x18\n\x0c\n\x05\
-    \x05\0\x02\x0f\x01\x12\x03\x12\x04\x11\n\x0c\n\x05\x05\0\x02\x0f\x02\x12\
-    \x03\x12\x14\x17b\x06proto3\
+    \x10db\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 52
shared-lib/flowy-user-data-model/src/protobuf/model/user_profile.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct UserToken {
 pub struct UserToken {
@@ -1286,56 +1286,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     id\x18\x01\x20\x01(\tR\x02id\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\
     id\x18\x01\x20\x01(\tR\x02id\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\
     \x04name\x12\x16\n\x05email\x18\x03\x20\x01(\tH\x01R\x05email\x12\x1c\n\
     \x04name\x12\x16\n\x05email\x18\x03\x20\x01(\tH\x01R\x05email\x12\x1c\n\
     \x08password\x18\x04\x20\x01(\tH\x02R\x08passwordB\r\n\x0bone_of_nameB\
     \x08password\x18\x04\x20\x01(\tH\x02R\x08passwordB\r\n\x0bone_of_nameB\
-    \x0e\n\x0cone_of_emailB\x11\n\x0fone_of_passwordJ\xdf\x07\n\x06\x12\x04\
-    \0\0\x16\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\
-    \0\x04\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x11\n\x0b\n\x04\x04\0\x02\
-    \0\x12\x03\x03\x04\x15\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\
-    \x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x10\n\x0c\n\x05\x04\0\x02\0\
-    \x03\x12\x03\x03\x13\x14\n\n\n\x02\x04\x01\x12\x04\x05\0\n\x01\n\n\n\x03\
-    \x04\x01\x01\x12\x03\x05\x08\x13\n\x0b\n\x04\x04\x01\x02\0\x12\x03\x06\
-    \x04\x12\n\x0c\n\x05\x04\x01\x02\0\x05\x12\x03\x06\x04\n\n\x0c\n\x05\x04\
-    \x01\x02\0\x01\x12\x03\x06\x0b\r\n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\
-    \x06\x10\x11\n\x0b\n\x04\x04\x01\x02\x01\x12\x03\x07\x04\x15\n\x0c\n\x05\
-    \x04\x01\x02\x01\x05\x12\x03\x07\x04\n\n\x0c\n\x05\x04\x01\x02\x01\x01\
-    \x12\x03\x07\x0b\x10\n\x0c\n\x05\x04\x01\x02\x01\x03\x12\x03\x07\x13\x14\
-    \n\x0b\n\x04\x04\x01\x02\x02\x12\x03\x08\x04\x14\n\x0c\n\x05\x04\x01\x02\
-    \x02\x05\x12\x03\x08\x04\n\n\x0c\n\x05\x04\x01\x02\x02\x01\x12\x03\x08\
-    \x0b\x0f\n\x0c\n\x05\x04\x01\x02\x02\x03\x12\x03\x08\x12\x13\n\x0b\n\x04\
-    \x04\x01\x02\x03\x12\x03\t\x04\x15\n\x0c\n\x05\x04\x01\x02\x03\x05\x12\
-    \x03\t\x04\n\n\x0c\n\x05\x04\x01\x02\x03\x01\x12\x03\t\x0b\x10\n\x0c\n\
-    \x05\x04\x01\x02\x03\x03\x12\x03\t\x13\x14\n\n\n\x02\x04\x02\x12\x04\x0b\
-    \0\x10\x01\n\n\n\x03\x04\x02\x01\x12\x03\x0b\x08\x19\n\x0b\n\x04\x04\x02\
-    \x02\0\x12\x03\x0c\x04\x12\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x0c\x04\
-    \n\n\x0c\n\x05\x04\x02\x02\0\x01\x12\x03\x0c\x0b\r\n\x0c\n\x05\x04\x02\
-    \x02\0\x03\x12\x03\x0c\x10\x11\n\x0b\n\x04\x04\x02\x08\0\x12\x03\r\x04*\
-    \n\x0c\n\x05\x04\x02\x08\0\x01\x12\x03\r\n\x15\n\x0b\n\x04\x04\x02\x02\
-    \x01\x12\x03\r\x18(\n\x0c\n\x05\x04\x02\x02\x01\x05\x12\x03\r\x18\x1e\n\
-    \x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\r\x1f#\n\x0c\n\x05\x04\x02\x02\
-    \x01\x03\x12\x03\r&'\n\x0b\n\x04\x04\x02\x08\x01\x12\x03\x0e\x04,\n\x0c\
-    \n\x05\x04\x02\x08\x01\x01\x12\x03\x0e\n\x16\n\x0b\n\x04\x04\x02\x02\x02\
-    \x12\x03\x0e\x19*\n\x0c\n\x05\x04\x02\x02\x02\x05\x12\x03\x0e\x19\x1f\n\
-    \x0c\n\x05\x04\x02\x02\x02\x01\x12\x03\x0e\x20%\n\x0c\n\x05\x04\x02\x02\
-    \x02\x03\x12\x03\x0e()\n\x0b\n\x04\x04\x02\x08\x02\x12\x03\x0f\x042\n\
-    \x0c\n\x05\x04\x02\x08\x02\x01\x12\x03\x0f\n\x19\n\x0b\n\x04\x04\x02\x02\
-    \x03\x12\x03\x0f\x1c0\n\x0c\n\x05\x04\x02\x02\x03\x05\x12\x03\x0f\x1c\"\
-    \n\x0c\n\x05\x04\x02\x02\x03\x01\x12\x03\x0f#+\n\x0c\n\x05\x04\x02\x02\
-    \x03\x03\x12\x03\x0f./\n\n\n\x02\x04\x03\x12\x04\x11\0\x16\x01\n\n\n\x03\
-    \x04\x03\x01\x12\x03\x11\x08\x18\n\x0b\n\x04\x04\x03\x02\0\x12\x03\x12\
-    \x04\x12\n\x0c\n\x05\x04\x03\x02\0\x05\x12\x03\x12\x04\n\n\x0c\n\x05\x04\
-    \x03\x02\0\x01\x12\x03\x12\x0b\r\n\x0c\n\x05\x04\x03\x02\0\x03\x12\x03\
-    \x12\x10\x11\n\x0b\n\x04\x04\x03\x08\0\x12\x03\x13\x04*\n\x0c\n\x05\x04\
-    \x03\x08\0\x01\x12\x03\x13\n\x15\n\x0b\n\x04\x04\x03\x02\x01\x12\x03\x13\
-    \x18(\n\x0c\n\x05\x04\x03\x02\x01\x05\x12\x03\x13\x18\x1e\n\x0c\n\x05\
-    \x04\x03\x02\x01\x01\x12\x03\x13\x1f#\n\x0c\n\x05\x04\x03\x02\x01\x03\
-    \x12\x03\x13&'\n\x0b\n\x04\x04\x03\x08\x01\x12\x03\x14\x04,\n\x0c\n\x05\
-    \x04\x03\x08\x01\x01\x12\x03\x14\n\x16\n\x0b\n\x04\x04\x03\x02\x02\x12\
-    \x03\x14\x19*\n\x0c\n\x05\x04\x03\x02\x02\x05\x12\x03\x14\x19\x1f\n\x0c\
-    \n\x05\x04\x03\x02\x02\x01\x12\x03\x14\x20%\n\x0c\n\x05\x04\x03\x02\x02\
-    \x03\x12\x03\x14()\n\x0b\n\x04\x04\x03\x08\x02\x12\x03\x15\x042\n\x0c\n\
-    \x05\x04\x03\x08\x02\x01\x12\x03\x15\n\x19\n\x0b\n\x04\x04\x03\x02\x03\
-    \x12\x03\x15\x1c0\n\x0c\n\x05\x04\x03\x02\x03\x05\x12\x03\x15\x1c\"\n\
-    \x0c\n\x05\x04\x03\x02\x03\x01\x12\x03\x15#+\n\x0c\n\x05\x04\x03\x02\x03\
-    \x03\x12\x03\x15./b\x06proto3\
+    \x0e\n\x0cone_of_emailB\x11\n\x0fone_of_passwordb\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 26
shared-lib/flowy-user-data-model/src/protobuf/model/user_setting.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct UserPreferences {
 pub struct UserPreferences {
@@ -699,30 +699,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     ale\x18\x02\x20\x01(\x0b2\x0f.LocaleSettingsR\x06locale\x12(\n\x10reset_\
     ale\x18\x02\x20\x01(\x0b2\x0f.LocaleSettingsR\x06locale\x12(\n\x10reset_\
     as_default\x18\x03\x20\x01(\x08R\x0eresetAsDefault\"X\n\x0eLocaleSetting\
     as_default\x18\x03\x20\x01(\x08R\x0eresetAsDefault\"X\n\x0eLocaleSetting\
     s\x12#\n\rlanguage_code\x18\x01\x20\x01(\tR\x0clanguageCode\x12!\n\x0cco\
     s\x12#\n\rlanguage_code\x18\x01\x20\x01(\tR\x0clanguageCode\x12!\n\x0cco\
-    untry_code\x18\x02\x20\x01(\tR\x0bcountryCodeJ\xdb\x03\n\x06\x12\x04\0\0\
-    \x0e\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\
-    \x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x17\n\x0b\n\x04\x04\0\x02\0\
-    \x12\x03\x03\x04\x17\n\x0c\n\x05\x04\0\x02\0\x05\x12\x03\x03\x04\n\n\x0c\
-    \n\x05\x04\0\x02\0\x01\x12\x03\x03\x0b\x12\n\x0c\n\x05\x04\0\x02\0\x03\
-    \x12\x03\x03\x15\x16\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04.\n\x0c\n\
-    \x05\x04\0\x02\x01\x06\x12\x03\x04\x04\x16\n\x0c\n\x05\x04\0\x02\x01\x01\
-    \x12\x03\x04\x17)\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04,-\n\n\n\x02\
-    \x04\x01\x12\x04\x06\0\n\x01\n\n\n\x03\x04\x01\x01\x12\x03\x06\x08\x1a\n\
-    \x0b\n\x04\x04\x01\x02\0\x12\x03\x07\x04\x15\n\x0c\n\x05\x04\x01\x02\0\
-    \x05\x12\x03\x07\x04\n\n\x0c\n\x05\x04\x01\x02\0\x01\x12\x03\x07\x0b\x10\
-    \n\x0c\n\x05\x04\x01\x02\0\x03\x12\x03\x07\x13\x14\n\x0b\n\x04\x04\x01\
-    \x02\x01\x12\x03\x08\x04\x1e\n\x0c\n\x05\x04\x01\x02\x01\x06\x12\x03\x08\
-    \x04\x12\n\x0c\n\x05\x04\x01\x02\x01\x01\x12\x03\x08\x13\x19\n\x0c\n\x05\
-    \x04\x01\x02\x01\x03\x12\x03\x08\x1c\x1d\n\x0b\n\x04\x04\x01\x02\x02\x12\
-    \x03\t\x04\x1e\n\x0c\n\x05\x04\x01\x02\x02\x05\x12\x03\t\x04\x08\n\x0c\n\
-    \x05\x04\x01\x02\x02\x01\x12\x03\t\t\x19\n\x0c\n\x05\x04\x01\x02\x02\x03\
-    \x12\x03\t\x1c\x1d\n\n\n\x02\x04\x02\x12\x04\x0b\0\x0e\x01\n\n\n\x03\x04\
-    \x02\x01\x12\x03\x0b\x08\x16\n\x0b\n\x04\x04\x02\x02\0\x12\x03\x0c\x04\
-    \x1d\n\x0c\n\x05\x04\x02\x02\0\x05\x12\x03\x0c\x04\n\n\x0c\n\x05\x04\x02\
-    \x02\0\x01\x12\x03\x0c\x0b\x18\n\x0c\n\x05\x04\x02\x02\0\x03\x12\x03\x0c\
-    \x1b\x1c\n\x0b\n\x04\x04\x02\x02\x01\x12\x03\r\x04\x1c\n\x0c\n\x05\x04\
-    \x02\x02\x01\x05\x12\x03\r\x04\n\n\x0c\n\x05\x04\x02\x02\x01\x01\x12\x03\
-    \r\x0b\x17\n\x0c\n\x05\x04\x02\x02\x01\x03\x12\x03\r\x1a\x1bb\x06proto3\
+    untry_code\x18\x02\x20\x01(\tR\x0bcountryCodeb\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 7 - 0
shared-lib/lib-infra/Cargo.toml

@@ -15,3 +15,10 @@ futures-core = { version = "0.3", default-features = false }
 tokio = { version = "1.0", features = ["time", "rt"] }
 tokio = { version = "1.0", features = ["time", "rt"] }
 rand = "0.8.3"
 rand = "0.8.3"
 
 
+cmd_lib = { version = "1", optional = true }
+cargo_toml = { version = "0.11", optional = true }
+protoc-rust = { version = "2", optional = true }
+walkdir = { version = "2", optional = true }
+
+[features]
+gen_pb = ["cmd_lib","cargo_toml", "protoc-rust", "walkdir"]

+ 3 - 0
shared-lib/lib-infra/src/lib.rs

@@ -1,6 +1,9 @@
 pub mod future;
 pub mod future;
 pub mod retry;
 pub mod retry;
 
 
+#[cfg(feature = "gen_pb")]
+pub mod pb;
+
 #[allow(dead_code)]
 #[allow(dead_code)]
 pub fn uuid_string() -> String {
 pub fn uuid_string() -> String {
     uuid::Uuid::new_v4().to_string()
     uuid::Uuid::new_v4().to_string()

+ 38 - 0
shared-lib/lib-infra/src/pb.rs

@@ -0,0 +1,38 @@
+use walkdir::WalkDir;
+
+pub fn gen(name: &str, root: &str) {
+    let mut paths = vec![];
+    for path in WalkDir::new(root)
+        .into_iter()
+        .filter_map(|e| e.ok())
+        .map(|e| e.path().to_str().unwrap().to_string())
+    {
+        if path.ends_with(".proto") {
+            // https://stackoverflow.com/questions/49077147/how-can-i-force-build-rs-to-run-again-without-cleaning-my-whole-project
+            println!("cargo:rerun-if-changed={}", path);
+            paths.push(path);
+        }
+    }
+    let flutter_pb_path = format!(
+        "{}/{}/{}",
+        env!("CARGO_MAKE_WORKING_DIRECTORY"),
+        env!("FLUTTER_FLOWY_SDK_PATH"),
+        name
+    );
+    paths.iter().for_each(|path| {
+        if cmd_lib::run_cmd! {
+            protoc --dart_out=${flutter_pb_path} --proto_path=${root} ${path}
+        }
+        .is_err()
+        {
+            panic!("Run flutter protoc fail")
+        };
+    });
+
+    protoc_rust::Codegen::new()
+        .out_dir("./src/protobuf/model")
+        .inputs(&paths)
+        .include(root)
+        .run()
+        .expect("Running protoc failed.");
+}

+ 3 - 0
shared-lib/lib-ws/Cargo.toml

@@ -27,6 +27,9 @@ strum_macros = "0.21"
 parking_lot = "0.11"
 parking_lot = "0.11"
 dashmap = "4.0"
 dashmap = "4.0"
 
 
+[build-dependencies]
+lib-infra = { path = "../lib-infra", features = ["gen_pb"] }
+
 [dev-dependencies]
 [dev-dependencies]
 tokio = {version = "1", features = ["full"]}
 tokio = {version = "1", features = ["full"]}
 env_logger = "0.8.2"
 env_logger = "0.8.2"

+ 5 - 0
shared-lib/lib-ws/build.rs

@@ -0,0 +1,5 @@
+use lib_infra::pb;
+
+fn main() {
+    pb::gen("lib-ws", "./src/protobuf/proto");
+}

+ 3 - 18
shared-lib/lib-ws/src/protobuf/model/errors.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct WSError {
 pub struct WSError {
@@ -270,22 +270,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \n\x0cerrors.proto\";\n\x07WSError\x12\x1e\n\x04code\x18\x01\x20\x01(\
     \n\x0cerrors.proto\";\n\x07WSError\x12\x1e\n\x04code\x18\x01\x20\x01(\
     \x0e2\n.ErrorCodeR\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msg*H\
     \x0e2\n.ErrorCodeR\x04code\x12\x10\n\x03msg\x18\x02\x20\x01(\tR\x03msg*H\
     \n\tErrorCode\x12\x11\n\rInternalError\x10\0\x12\x16\n\x12UnsupportedMes\
     \n\tErrorCode\x12\x11\n\rInternalError\x10\0\x12\x16\n\x12UnsupportedMes\
-    sage\x10\x01\x12\x10\n\x0cUnauthorized\x10\x02J\xab\x02\n\x06\x12\x04\0\
-    \0\n\x01\n\x08\n\x01\x0c\x12\x03\0\0\x12\n\n\n\x02\x04\0\x12\x04\x02\0\
-    \x05\x01\n\n\n\x03\x04\0\x01\x12\x03\x02\x08\x0f\n\x0b\n\x04\x04\0\x02\0\
-    \x12\x03\x03\x04\x17\n\x0c\n\x05\x04\0\x02\0\x06\x12\x03\x03\x04\r\n\x0c\
-    \n\x05\x04\0\x02\0\x01\x12\x03\x03\x0e\x12\n\x0c\n\x05\x04\0\x02\0\x03\
-    \x12\x03\x03\x15\x16\n\x0b\n\x04\x04\0\x02\x01\x12\x03\x04\x04\x13\n\x0c\
-    \n\x05\x04\0\x02\x01\x05\x12\x03\x04\x04\n\n\x0c\n\x05\x04\0\x02\x01\x01\
-    \x12\x03\x04\x0b\x0e\n\x0c\n\x05\x04\0\x02\x01\x03\x12\x03\x04\x11\x12\n\
-    \n\n\x02\x05\0\x12\x04\x06\0\n\x01\n\n\n\x03\x05\0\x01\x12\x03\x06\x05\
-    \x0e\n\x0b\n\x04\x05\0\x02\0\x12\x03\x07\x04\x16\n\x0c\n\x05\x05\0\x02\0\
-    \x01\x12\x03\x07\x04\x11\n\x0c\n\x05\x05\0\x02\0\x02\x12\x03\x07\x14\x15\
-    \n\x0b\n\x04\x05\0\x02\x01\x12\x03\x08\x04\x1b\n\x0c\n\x05\x05\0\x02\x01\
-    \x01\x12\x03\x08\x04\x16\n\x0c\n\x05\x05\0\x02\x01\x02\x12\x03\x08\x19\
-    \x1a\n\x0b\n\x04\x05\0\x02\x02\x12\x03\t\x04\x15\n\x0c\n\x05\x05\0\x02\
-    \x02\x01\x12\x03\t\x04\x10\n\x0c\n\x05\x05\0\x02\x02\x02\x12\x03\t\x13\
-    \x14b\x06proto3\
+    sage\x10\x01\x12\x10\n\x0cUnauthorized\x10\x02b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 15
shared-lib/lib-ws/src/protobuf/model/msg.rs

@@ -1,4 +1,4 @@
-// This file is generated by rust-protobuf 2.22.1. Do not edit
+// This file is generated by rust-protobuf 2.25.2. Do not edit
 // @generated
 // @generated
 
 
 // https://github.com/rust-lang/rust-clippy/issues/702
 // https://github.com/rust-lang/rust-clippy/issues/702
@@ -21,7 +21,7 @@
 
 
 /// Generated files are compatible only with the same version
 /// Generated files are compatible only with the same version
 /// of protobuf runtime.
 /// of protobuf runtime.
-// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_22_1;
+// const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 
 #[derive(PartialEq,Clone,Default)]
 #[derive(PartialEq,Clone,Default)]
 pub struct WebSocketRawMessage {
 pub struct WebSocketRawMessage {
@@ -267,19 +267,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \n\tmsg.proto\"O\n\x13WebSocketRawMessage\x12$\n\x07channel\x18\x01\x20\
     \n\tmsg.proto\"O\n\x13WebSocketRawMessage\x12$\n\x07channel\x18\x01\x20\
     \x01(\x0e2\n.WSChannelR\x07channel\x12\x12\n\x04data\x18\x02\x20\x01(\
     \x01(\x0e2\n.WSChannelR\x07channel\x12\x12\n\x04data\x18\x02\x20\x01(\
     \x0cR\x04data*%\n\tWSChannel\x12\x0c\n\x08Document\x10\0\x12\n\n\x06Fold\
     \x0cR\x04data*%\n\tWSChannel\x12\x0c\n\x08Document\x10\0\x12\n\n\x06Fold\
-    er\x10\x01J\x82\x02\n\x06\x12\x04\0\0\t\x01\n\x08\n\x01\x0c\x12\x03\0\0\
-    \x12\n\n\n\x02\x04\0\x12\x04\x02\0\x05\x01\n\n\n\x03\x04\0\x01\x12\x03\
-    \x02\x08\x1b\n\x0b\n\x04\x04\0\x02\0\x12\x03\x03\x04\x1a\n\x0c\n\x05\x04\
-    \0\x02\0\x06\x12\x03\x03\x04\r\n\x0c\n\x05\x04\0\x02\0\x01\x12\x03\x03\
-    \x0e\x15\n\x0c\n\x05\x04\0\x02\0\x03\x12\x03\x03\x18\x19\n\x0b\n\x04\x04\
-    \0\x02\x01\x12\x03\x04\x04\x13\n\x0c\n\x05\x04\0\x02\x01\x05\x12\x03\x04\
-    \x04\t\n\x0c\n\x05\x04\0\x02\x01\x01\x12\x03\x04\n\x0e\n\x0c\n\x05\x04\0\
-    \x02\x01\x03\x12\x03\x04\x11\x12\n\n\n\x02\x05\0\x12\x04\x06\0\t\x01\n\n\
-    \n\x03\x05\0\x01\x12\x03\x06\x05\x0e\n\x0b\n\x04\x05\0\x02\0\x12\x03\x07\
-    \x04\x11\n\x0c\n\x05\x05\0\x02\0\x01\x12\x03\x07\x04\x0c\n\x0c\n\x05\x05\
-    \0\x02\0\x02\x12\x03\x07\x0f\x10\n\x0b\n\x04\x05\0\x02\x01\x12\x03\x08\
-    \x04\x0f\n\x0c\n\x05\x05\0\x02\x01\x01\x12\x03\x08\x04\n\n\x0c\n\x05\x05\
-    \0\x02\x01\x02\x12\x03\x08\r\x0eb\x06proto3\
+    er\x10\x01b\x06proto3\
 ";
 ";
 
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;