Browse Source

Merge pull request #379 from AppFlowy-IO/refactor_document

Refactor folder crate structs
Nathan.fooo 3 năm trước cách đây
mục cha
commit
441627783b
84 tập tin đã thay đổi với 6534 bổ sung1878 xóa
  1. 3 3
      frontend/app_flowy/lib/user/infrastructure/repos/auth_repo.dart
  2. 32 30
      frontend/app_flowy/lib/workspace/application/doc/doc_bloc.dart
  3. 1225 0
      frontend/app_flowy/lib/workspace/application/doc/doc_bloc.freezed.dart
  4. 1049 0
      frontend/app_flowy/lib/workspace/application/menu/menu_bloc.freezed.dart
  5. 1129 0
      frontend/app_flowy/lib/workspace/application/trash/trash_bloc.freezed.dart
  6. 1155 0
      frontend/app_flowy/lib/workspace/application/view/view_bloc.freezed.dart
  7. 890 0
      frontend/app_flowy/lib/workspace/application/workspace/welcome_bloc.freezed.dart
  8. 4 4
      frontend/app_flowy/lib/workspace/infrastructure/deps_resolver.dart
  9. 5 5
      frontend/app_flowy/lib/workspace/infrastructure/repos/app_repo.dart
  10. 7 7
      frontend/app_flowy/lib/workspace/infrastructure/repos/document_repo.dart
  11. 1 1
      frontend/app_flowy/lib/workspace/infrastructure/repos/share_repo.dart
  12. 3 3
      frontend/app_flowy/lib/workspace/infrastructure/repos/user_repo.dart
  13. 4 4
      frontend/app_flowy/lib/workspace/infrastructure/repos/view_repo.dart
  14. 3 3
      frontend/app_flowy/lib/workspace/infrastructure/repos/workspace_repo.dart
  15. 2 2
      frontend/app_flowy/lib/workspace/presentation/stack_page/doc/doc_stack_page.dart
  16. 16 16
      frontend/app_flowy/lib/workspace/presentation/stack_page/doc/document_page.dart
  17. 2 2
      frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart
  18. 20 20
      frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-folder/dart_event.dart
  19. 3 3
      frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-user/dart_event.dart
  20. 8 8
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pb.dart
  21. 2 2
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbjson.dart
  22. 54 95
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/app.pb.dart
  23. 12 22
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/app.pbjson.dart
  24. 13 13
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/share.pb.dart
  25. 5 5
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/share.pbjson.dart
  26. 54 95
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/view.pb.dart
  27. 12 22
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/view.pbjson.dart
  28. 28 88
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/workspace.pb.dart
  29. 8 21
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/workspace.pbjson.dart
  30. 2 2
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder/event_map.pbenum.dart
  31. 2 2
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder/event_map.pbjson.dart
  32. 26 26
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-user-data-model/auth.pb.dart
  33. 10 10
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-user-data-model/auth.pbjson.dart
  34. 28 28
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-user-data-model/user_profile.pb.dart
  35. 5 5
      frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-user-data-model/user_profile.pbjson.dart
  36. 3 2
      frontend/app_flowy/packages/flowy_sdk/pubspec.yaml
  37. 7 7
      frontend/app_flowy/pubspec.lock
  38. 1 1
      frontend/app_flowy/pubspec.yaml
  39. 2 4
      frontend/rust-lib/flowy-document/src/manager.rs
  40. 19 19
      frontend/rust-lib/flowy-folder/src/event_map.rs
  41. 10 10
      frontend/rust-lib/flowy-folder/src/protobuf/model/event_map.rs
  42. 1 1
      frontend/rust-lib/flowy-folder/src/protobuf/proto/event_map.proto
  43. 1 1
      frontend/rust-lib/flowy-folder/src/services/app/controller.rs
  44. 9 9
      frontend/rust-lib/flowy-folder/src/services/app/event_handler.rs
  45. 7 7
      frontend/rust-lib/flowy-folder/src/services/view/controller.rs
  46. 20 21
      frontend/rust-lib/flowy-folder/src/services/view/event_handler.rs
  47. 2 2
      frontend/rust-lib/flowy-folder/src/services/workspace/controller.rs
  48. 8 8
      frontend/rust-lib/flowy-folder/src/services/workspace/event_handler.rs
  49. 3 3
      frontend/rust-lib/flowy-folder/tests/workspace/folder_test.rs
  50. 33 33
      frontend/rust-lib/flowy-folder/tests/workspace/helper.rs
  51. 1 1
      frontend/rust-lib/flowy-folder/tests/workspace/script.rs
  52. 1 1
      frontend/rust-lib/flowy-net/src/local_server/server.rs
  53. 1 1
      frontend/rust-lib/flowy-test/src/event_builder.rs
  54. 15 14
      frontend/rust-lib/flowy-test/src/helper.rs
  55. 3 3
      frontend/rust-lib/flowy-user/src/event_map.rs
  56. 2 2
      frontend/rust-lib/flowy-user/src/handlers/auth_handler.rs
  57. 2 2
      frontend/rust-lib/flowy-user/src/handlers/user_handler.rs
  58. 11 11
      frontend/rust-lib/flowy-user/tests/event/auth_test.rs
  59. 13 13
      frontend/rust-lib/flowy-user/tests/event/user_profile_test.rs
  60. 1 7
      frontend/rust-lib/lib-dispatch/src/byte_trait.rs
  61. 3 3
      shared-lib/flowy-collaboration/src/entities/document_info.rs
  62. 23 23
      shared-lib/flowy-collaboration/src/protobuf/model/document_info.rs
  63. 1 1
      shared-lib/flowy-collaboration/src/protobuf/proto/document_info.proto
  64. 1 1
      shared-lib/flowy-collaboration/src/synchronizer.rs
  65. 6 8
      shared-lib/flowy-collaboration/src/util.rs
  66. 9 9
      shared-lib/flowy-derive/src/proto_buf/deserialize.rs
  67. 6 28
      shared-lib/flowy-folder-data-model/src/entities/app.rs
  68. 2 2
      shared-lib/flowy-folder-data-model/src/entities/share.rs
  69. 9 44
      shared-lib/flowy-folder-data-model/src/entities/view.rs
  70. 4 30
      shared-lib/flowy-folder-data-model/src/entities/workspace.rs
  71. 121 280
      shared-lib/flowy-folder-data-model/src/protobuf/model/app.rs
  72. 22 22
      shared-lib/flowy-folder-data-model/src/protobuf/model/share.rs
  73. 135 294
      shared-lib/flowy-folder-data-model/src/protobuf/model/view.rs
  74. 65 265
      shared-lib/flowy-folder-data-model/src/protobuf/model/workspace.rs
  75. 3 6
      shared-lib/flowy-folder-data-model/src/protobuf/proto/app.proto
  76. 1 1
      shared-lib/flowy-folder-data-model/src/protobuf/proto/share.proto
  77. 3 6
      shared-lib/flowy-folder-data-model/src/protobuf/proto/view.proto
  78. 2 5
      shared-lib/flowy-folder-data-model/src/protobuf/proto/workspace.proto
  79. 4 4
      shared-lib/flowy-user-data-model/src/entities/auth.rs
  80. 3 3
      shared-lib/flowy-user-data-model/src/entities/user_profile.rs
  81. 48 48
      shared-lib/flowy-user-data-model/src/protobuf/model/auth.rs
  82. 62 62
      shared-lib/flowy-user-data-model/src/protobuf/model/user_profile.rs
  83. 2 2
      shared-lib/flowy-user-data-model/src/protobuf/proto/auth.proto
  84. 1 1
      shared-lib/flowy-user-data-model/src/protobuf/proto/user_profile.proto

+ 3 - 3
frontend/app_flowy/lib/user/infrastructure/repos/auth_repo.dart

@@ -1,12 +1,12 @@
 import 'package:dartz/dartz.dart';
 import 'package:flowy_sdk/dispatch/dispatch.dart';
-import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show SignInRequest, SignUpRequest, UserProfile;
+import 'package:flowy_sdk/protobuf/flowy-user-data-model/protobuf.dart' show SignInPayload, SignUpPayload, UserProfile;
 import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
 
 class AuthRepository {
   Future<Either<UserProfile, FlowyError>> signIn({required String? email, required String? password}) {
     //
-    final request = SignInRequest.create()
+    final request = SignInPayload.create()
       ..email = email ?? ''
       ..password = password ?? '';
 
@@ -15,7 +15,7 @@ class AuthRepository {
 
   Future<Either<UserProfile, FlowyError>> signUp(
       {required String? name, required String? password, required String? email}) {
-    final request = SignUpRequest.create()
+    final request = SignUpPayload.create()
       ..email = email ?? ''
       ..name = name ?? ''
       ..password = password ?? '';

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

@@ -1,11 +1,11 @@
 import 'dart:convert';
-import 'package:app_flowy/workspace/infrastructure/repos/doc_repo.dart';
+import 'package:app_flowy/workspace/infrastructure/repos/document_repo.dart';
 import 'package:app_flowy/workspace/infrastructure/repos/trash_repo.dart';
 import 'package:app_flowy/workspace/infrastructure/repos/view_repo.dart';
 import 'package:flowy_sdk/protobuf/flowy-folder-data-model/trash.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
-import 'package:flutter_quill/flutter_quill.dart';
+import 'package:flutter_quill/flutter_quill.dart' show Document, Delta;
 import 'package:flowy_sdk/log.dart';
 import 'package:flutter_bloc/flutter_bloc.dart';
 import 'package:freezed_annotation/freezed_annotation.dart';
@@ -13,21 +13,23 @@ import 'package:dartz/dartz.dart';
 import 'dart:async';
 part 'doc_bloc.freezed.dart';
 
-class DocBloc extends Bloc<DocEvent, DocState> {
+typedef FlutterQuillDocument = Document;
+
+class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
   final View view;
-  final DocRepository repo;
+  final DocumentRepository repo;
   final ViewListener listener;
   final TrashRepo trashRepo;
-  late Document document;
+  late FlutterQuillDocument document;
   StreamSubscription? _subscription;
 
-  DocBloc({
+  DocumentBloc({
     required this.view,
     required this.repo,
     required this.listener,
     required this.trashRepo,
-  }) : super(DocState.initial()) {
-    on<DocEvent>((event, emit) async {
+  }) : super(DocumentState.initial()) {
+    on<DocumentEvent>((event, emit) async {
       await event.map(
         initial: (Initial value) async {
           await _initial(value, emit);
@@ -60,27 +62,27 @@ class DocBloc extends Bloc<DocEvent, DocState> {
       await _subscription?.cancel();
     }
 
-    repo.closeDoc();
+    repo.closeDocument();
     return super.close();
   }
 
-  Future<void> _initial(Initial value, Emitter<DocState> emit) async {
+  Future<void> _initial(Initial value, Emitter<DocumentState> emit) async {
     listener.deletedNotifier.addPublishListener((result) {
       result.fold(
-        (view) => add(const DocEvent.deleted()),
+        (view) => add(const DocumentEvent.deleted()),
         (error) {},
       );
     });
 
     listener.restoredNotifier.addPublishListener((result) {
       result.fold(
-        (view) => add(const DocEvent.restore()),
+        (view) => add(const DocumentEvent.restore()),
         (error) {},
       );
     });
 
     listener.start();
-    final result = await repo.readDoc();
+    final result = await repo.openDocument();
     result.fold(
       (doc) {
         document = _decodeJsonToDocument(doc.deltaJson);
@@ -89,10 +91,10 @@ class DocBloc extends Bloc<DocEvent, DocState> {
           final documentDelta = document.toDelta();
           _composeDelta(delta, documentDelta);
         });
-        emit(state.copyWith(loadState: DocLoadState.finish(left(unit))));
+        emit(state.copyWith(loadingState: DocumentLoadingState.finish(left(unit))));
       },
       (err) {
-        emit(state.copyWith(loadState: DocLoadState.finish(right(err))));
+        emit(state.copyWith(loadingState: DocumentLoadingState.finish(right(err))));
       },
     );
   }
@@ -126,31 +128,31 @@ class DocBloc extends Bloc<DocEvent, DocState> {
 }
 
 @freezed
-class DocEvent with _$DocEvent {
-  const factory DocEvent.initial() = Initial;
-  const factory DocEvent.deleted() = Deleted;
-  const factory DocEvent.restore() = Restore;
-  const factory DocEvent.restorePage() = RestorePage;
-  const factory DocEvent.deletePermanently() = DeletePermanently;
+class DocumentEvent with _$DocumentEvent {
+  const factory DocumentEvent.initial() = Initial;
+  const factory DocumentEvent.deleted() = Deleted;
+  const factory DocumentEvent.restore() = Restore;
+  const factory DocumentEvent.restorePage() = RestorePage;
+  const factory DocumentEvent.deletePermanently() = DeletePermanently;
 }
 
 @freezed
-class DocState with _$DocState {
-  const factory DocState({
-    required DocLoadState loadState,
+class DocumentState with _$DocumentState {
+  const factory DocumentState({
+    required DocumentLoadingState loadingState,
     required bool isDeleted,
     required bool forceClose,
-  }) = _DocState;
+  }) = _DocumentState;
 
-  factory DocState.initial() => const DocState(
-        loadState: _Loading(),
+  factory DocumentState.initial() => const DocumentState(
+        loadingState: _Loading(),
         isDeleted: false,
         forceClose: false,
       );
 }
 
 @freezed
-class DocLoadState with _$DocLoadState {
-  const factory DocLoadState.loading() = _Loading;
-  const factory DocLoadState.finish(Either<Unit, FlowyError> successOrFail) = _Finish;
+class DocumentLoadingState with _$DocumentLoadingState {
+  const factory DocumentLoadingState.loading() = _Loading;
+  const factory DocumentLoadingState.finish(Either<Unit, FlowyError> successOrFail) = _Finish;
 }

+ 1225 - 0
frontend/app_flowy/lib/workspace/application/doc/doc_bloc.freezed.dart

@@ -0,0 +1,1225 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
+
+part of 'doc_bloc.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity<T>(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
+
+/// @nodoc
+class _$DocumentEventTearOff {
+  const _$DocumentEventTearOff();
+
+  Initial initial() {
+    return const Initial();
+  }
+
+  Deleted deleted() {
+    return const Deleted();
+  }
+
+  Restore restore() {
+    return const Restore();
+  }
+
+  RestorePage restorePage() {
+    return const RestorePage();
+  }
+
+  DeletePermanently deletePermanently() {
+    return const DeletePermanently();
+  }
+}
+
+/// @nodoc
+const $DocumentEvent = _$DocumentEventTearOff();
+
+/// @nodoc
+mixin _$DocumentEvent {
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() deleted,
+    required TResult Function() restore,
+    required TResult Function() restorePage,
+    required TResult Function() deletePermanently,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(Deleted value) deleted,
+    required TResult Function(Restore value) restore,
+    required TResult Function(RestorePage value) restorePage,
+    required TResult Function(DeletePermanently value) deletePermanently,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $DocumentEventCopyWith<$Res> {
+  factory $DocumentEventCopyWith(
+          DocumentEvent value, $Res Function(DocumentEvent) then) =
+      _$DocumentEventCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$DocumentEventCopyWithImpl<$Res>
+    implements $DocumentEventCopyWith<$Res> {
+  _$DocumentEventCopyWithImpl(this._value, this._then);
+
+  final DocumentEvent _value;
+  // ignore: unused_field
+  final $Res Function(DocumentEvent) _then;
+}
+
+/// @nodoc
+abstract class $InitialCopyWith<$Res> {
+  factory $InitialCopyWith(Initial value, $Res Function(Initial) then) =
+      _$InitialCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$InitialCopyWithImpl<$Res> extends _$DocumentEventCopyWithImpl<$Res>
+    implements $InitialCopyWith<$Res> {
+  _$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then)
+      : super(_value, (v) => _then(v as Initial));
+
+  @override
+  Initial get _value => super._value as Initial;
+}
+
+/// @nodoc
+
+class _$Initial implements Initial {
+  const _$Initial();
+
+  @override
+  String toString() {
+    return 'DocumentEvent.initial()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is Initial);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() deleted,
+    required TResult Function() restore,
+    required TResult Function() restorePage,
+    required TResult Function() deletePermanently,
+  }) {
+    return initial();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+  }) {
+    return initial?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(Deleted value) deleted,
+    required TResult Function(Restore value) restore,
+    required TResult Function(RestorePage value) restorePage,
+    required TResult Function(DeletePermanently value) deletePermanently,
+  }) {
+    return initial(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+  }) {
+    return initial?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Initial implements DocumentEvent {
+  const factory Initial() = _$Initial;
+}
+
+/// @nodoc
+abstract class $DeletedCopyWith<$Res> {
+  factory $DeletedCopyWith(Deleted value, $Res Function(Deleted) then) =
+      _$DeletedCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$DeletedCopyWithImpl<$Res> extends _$DocumentEventCopyWithImpl<$Res>
+    implements $DeletedCopyWith<$Res> {
+  _$DeletedCopyWithImpl(Deleted _value, $Res Function(Deleted) _then)
+      : super(_value, (v) => _then(v as Deleted));
+
+  @override
+  Deleted get _value => super._value as Deleted;
+}
+
+/// @nodoc
+
+class _$Deleted implements Deleted {
+  const _$Deleted();
+
+  @override
+  String toString() {
+    return 'DocumentEvent.deleted()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is Deleted);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() deleted,
+    required TResult Function() restore,
+    required TResult Function() restorePage,
+    required TResult Function() deletePermanently,
+  }) {
+    return deleted();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+  }) {
+    return deleted?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (deleted != null) {
+      return deleted();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(Deleted value) deleted,
+    required TResult Function(Restore value) restore,
+    required TResult Function(RestorePage value) restorePage,
+    required TResult Function(DeletePermanently value) deletePermanently,
+  }) {
+    return deleted(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+  }) {
+    return deleted?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (deleted != null) {
+      return deleted(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Deleted implements DocumentEvent {
+  const factory Deleted() = _$Deleted;
+}
+
+/// @nodoc
+abstract class $RestoreCopyWith<$Res> {
+  factory $RestoreCopyWith(Restore value, $Res Function(Restore) then) =
+      _$RestoreCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$RestoreCopyWithImpl<$Res> extends _$DocumentEventCopyWithImpl<$Res>
+    implements $RestoreCopyWith<$Res> {
+  _$RestoreCopyWithImpl(Restore _value, $Res Function(Restore) _then)
+      : super(_value, (v) => _then(v as Restore));
+
+  @override
+  Restore get _value => super._value as Restore;
+}
+
+/// @nodoc
+
+class _$Restore implements Restore {
+  const _$Restore();
+
+  @override
+  String toString() {
+    return 'DocumentEvent.restore()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is Restore);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() deleted,
+    required TResult Function() restore,
+    required TResult Function() restorePage,
+    required TResult Function() deletePermanently,
+  }) {
+    return restore();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+  }) {
+    return restore?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (restore != null) {
+      return restore();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(Deleted value) deleted,
+    required TResult Function(Restore value) restore,
+    required TResult Function(RestorePage value) restorePage,
+    required TResult Function(DeletePermanently value) deletePermanently,
+  }) {
+    return restore(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+  }) {
+    return restore?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (restore != null) {
+      return restore(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Restore implements DocumentEvent {
+  const factory Restore() = _$Restore;
+}
+
+/// @nodoc
+abstract class $RestorePageCopyWith<$Res> {
+  factory $RestorePageCopyWith(
+          RestorePage value, $Res Function(RestorePage) then) =
+      _$RestorePageCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$RestorePageCopyWithImpl<$Res> extends _$DocumentEventCopyWithImpl<$Res>
+    implements $RestorePageCopyWith<$Res> {
+  _$RestorePageCopyWithImpl(
+      RestorePage _value, $Res Function(RestorePage) _then)
+      : super(_value, (v) => _then(v as RestorePage));
+
+  @override
+  RestorePage get _value => super._value as RestorePage;
+}
+
+/// @nodoc
+
+class _$RestorePage implements RestorePage {
+  const _$RestorePage();
+
+  @override
+  String toString() {
+    return 'DocumentEvent.restorePage()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is RestorePage);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() deleted,
+    required TResult Function() restore,
+    required TResult Function() restorePage,
+    required TResult Function() deletePermanently,
+  }) {
+    return restorePage();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+  }) {
+    return restorePage?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (restorePage != null) {
+      return restorePage();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(Deleted value) deleted,
+    required TResult Function(Restore value) restore,
+    required TResult Function(RestorePage value) restorePage,
+    required TResult Function(DeletePermanently value) deletePermanently,
+  }) {
+    return restorePage(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+  }) {
+    return restorePage?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (restorePage != null) {
+      return restorePage(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class RestorePage implements DocumentEvent {
+  const factory RestorePage() = _$RestorePage;
+}
+
+/// @nodoc
+abstract class $DeletePermanentlyCopyWith<$Res> {
+  factory $DeletePermanentlyCopyWith(
+          DeletePermanently value, $Res Function(DeletePermanently) then) =
+      _$DeletePermanentlyCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$DeletePermanentlyCopyWithImpl<$Res>
+    extends _$DocumentEventCopyWithImpl<$Res>
+    implements $DeletePermanentlyCopyWith<$Res> {
+  _$DeletePermanentlyCopyWithImpl(
+      DeletePermanently _value, $Res Function(DeletePermanently) _then)
+      : super(_value, (v) => _then(v as DeletePermanently));
+
+  @override
+  DeletePermanently get _value => super._value as DeletePermanently;
+}
+
+/// @nodoc
+
+class _$DeletePermanently implements DeletePermanently {
+  const _$DeletePermanently();
+
+  @override
+  String toString() {
+    return 'DocumentEvent.deletePermanently()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is DeletePermanently);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() deleted,
+    required TResult Function() restore,
+    required TResult Function() restorePage,
+    required TResult Function() deletePermanently,
+  }) {
+    return deletePermanently();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+  }) {
+    return deletePermanently?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? deleted,
+    TResult Function()? restore,
+    TResult Function()? restorePage,
+    TResult Function()? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (deletePermanently != null) {
+      return deletePermanently();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(Deleted value) deleted,
+    required TResult Function(Restore value) restore,
+    required TResult Function(RestorePage value) restorePage,
+    required TResult Function(DeletePermanently value) deletePermanently,
+  }) {
+    return deletePermanently(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+  }) {
+    return deletePermanently?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(Deleted value)? deleted,
+    TResult Function(Restore value)? restore,
+    TResult Function(RestorePage value)? restorePage,
+    TResult Function(DeletePermanently value)? deletePermanently,
+    required TResult orElse(),
+  }) {
+    if (deletePermanently != null) {
+      return deletePermanently(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class DeletePermanently implements DocumentEvent {
+  const factory DeletePermanently() = _$DeletePermanently;
+}
+
+/// @nodoc
+class _$DocumentStateTearOff {
+  const _$DocumentStateTearOff();
+
+  _DocumentState call(
+      {required DocumentLoadingState loadingState,
+      required bool isDeleted,
+      required bool forceClose}) {
+    return _DocumentState(
+      loadingState: loadingState,
+      isDeleted: isDeleted,
+      forceClose: forceClose,
+    );
+  }
+}
+
+/// @nodoc
+const $DocumentState = _$DocumentStateTearOff();
+
+/// @nodoc
+mixin _$DocumentState {
+  DocumentLoadingState get loadingState => throw _privateConstructorUsedError;
+  bool get isDeleted => throw _privateConstructorUsedError;
+  bool get forceClose => throw _privateConstructorUsedError;
+
+  @JsonKey(ignore: true)
+  $DocumentStateCopyWith<DocumentState> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $DocumentStateCopyWith<$Res> {
+  factory $DocumentStateCopyWith(
+          DocumentState value, $Res Function(DocumentState) then) =
+      _$DocumentStateCopyWithImpl<$Res>;
+  $Res call(
+      {DocumentLoadingState loadingState, bool isDeleted, bool forceClose});
+
+  $DocumentLoadingStateCopyWith<$Res> get loadingState;
+}
+
+/// @nodoc
+class _$DocumentStateCopyWithImpl<$Res>
+    implements $DocumentStateCopyWith<$Res> {
+  _$DocumentStateCopyWithImpl(this._value, this._then);
+
+  final DocumentState _value;
+  // ignore: unused_field
+  final $Res Function(DocumentState) _then;
+
+  @override
+  $Res call({
+    Object? loadingState = freezed,
+    Object? isDeleted = freezed,
+    Object? forceClose = freezed,
+  }) {
+    return _then(_value.copyWith(
+      loadingState: loadingState == freezed
+          ? _value.loadingState
+          : loadingState // ignore: cast_nullable_to_non_nullable
+              as DocumentLoadingState,
+      isDeleted: isDeleted == freezed
+          ? _value.isDeleted
+          : isDeleted // ignore: cast_nullable_to_non_nullable
+              as bool,
+      forceClose: forceClose == freezed
+          ? _value.forceClose
+          : forceClose // ignore: cast_nullable_to_non_nullable
+              as bool,
+    ));
+  }
+
+  @override
+  $DocumentLoadingStateCopyWith<$Res> get loadingState {
+    return $DocumentLoadingStateCopyWith<$Res>(_value.loadingState, (value) {
+      return _then(_value.copyWith(loadingState: value));
+    });
+  }
+}
+
+/// @nodoc
+abstract class _$DocumentStateCopyWith<$Res>
+    implements $DocumentStateCopyWith<$Res> {
+  factory _$DocumentStateCopyWith(
+          _DocumentState value, $Res Function(_DocumentState) then) =
+      __$DocumentStateCopyWithImpl<$Res>;
+  @override
+  $Res call(
+      {DocumentLoadingState loadingState, bool isDeleted, bool forceClose});
+
+  @override
+  $DocumentLoadingStateCopyWith<$Res> get loadingState;
+}
+
+/// @nodoc
+class __$DocumentStateCopyWithImpl<$Res>
+    extends _$DocumentStateCopyWithImpl<$Res>
+    implements _$DocumentStateCopyWith<$Res> {
+  __$DocumentStateCopyWithImpl(
+      _DocumentState _value, $Res Function(_DocumentState) _then)
+      : super(_value, (v) => _then(v as _DocumentState));
+
+  @override
+  _DocumentState get _value => super._value as _DocumentState;
+
+  @override
+  $Res call({
+    Object? loadingState = freezed,
+    Object? isDeleted = freezed,
+    Object? forceClose = freezed,
+  }) {
+    return _then(_DocumentState(
+      loadingState: loadingState == freezed
+          ? _value.loadingState
+          : loadingState // ignore: cast_nullable_to_non_nullable
+              as DocumentLoadingState,
+      isDeleted: isDeleted == freezed
+          ? _value.isDeleted
+          : isDeleted // ignore: cast_nullable_to_non_nullable
+              as bool,
+      forceClose: forceClose == freezed
+          ? _value.forceClose
+          : forceClose // ignore: cast_nullable_to_non_nullable
+              as bool,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$_DocumentState implements _DocumentState {
+  const _$_DocumentState(
+      {required this.loadingState,
+      required this.isDeleted,
+      required this.forceClose});
+
+  @override
+  final DocumentLoadingState loadingState;
+  @override
+  final bool isDeleted;
+  @override
+  final bool forceClose;
+
+  @override
+  String toString() {
+    return 'DocumentState(loadingState: $loadingState, isDeleted: $isDeleted, forceClose: $forceClose)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is _DocumentState &&
+            (identical(other.loadingState, loadingState) ||
+                const DeepCollectionEquality()
+                    .equals(other.loadingState, loadingState)) &&
+            (identical(other.isDeleted, isDeleted) ||
+                const DeepCollectionEquality()
+                    .equals(other.isDeleted, isDeleted)) &&
+            (identical(other.forceClose, forceClose) ||
+                const DeepCollectionEquality()
+                    .equals(other.forceClose, forceClose)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^
+      const DeepCollectionEquality().hash(loadingState) ^
+      const DeepCollectionEquality().hash(isDeleted) ^
+      const DeepCollectionEquality().hash(forceClose);
+
+  @JsonKey(ignore: true)
+  @override
+  _$DocumentStateCopyWith<_DocumentState> get copyWith =>
+      __$DocumentStateCopyWithImpl<_DocumentState>(this, _$identity);
+}
+
+abstract class _DocumentState implements DocumentState {
+  const factory _DocumentState(
+      {required DocumentLoadingState loadingState,
+      required bool isDeleted,
+      required bool forceClose}) = _$_DocumentState;
+
+  @override
+  DocumentLoadingState get loadingState => throw _privateConstructorUsedError;
+  @override
+  bool get isDeleted => throw _privateConstructorUsedError;
+  @override
+  bool get forceClose => throw _privateConstructorUsedError;
+  @override
+  @JsonKey(ignore: true)
+  _$DocumentStateCopyWith<_DocumentState> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+class _$DocumentLoadingStateTearOff {
+  const _$DocumentLoadingStateTearOff();
+
+  _Loading loading() {
+    return const _Loading();
+  }
+
+  _Finish finish(Either<Unit, FlowyError> successOrFail) {
+    return _Finish(
+      successOrFail,
+    );
+  }
+}
+
+/// @nodoc
+const $DocumentLoadingState = _$DocumentLoadingStateTearOff();
+
+/// @nodoc
+mixin _$DocumentLoadingState {
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() loading,
+    required TResult Function(Either<Unit, FlowyError> successOrFail) finish,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? loading,
+    TResult Function(Either<Unit, FlowyError> successOrFail)? finish,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? loading,
+    TResult Function(Either<Unit, FlowyError> successOrFail)? finish,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(_Loading value) loading,
+    required TResult Function(_Finish value) finish,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(_Loading value)? loading,
+    TResult Function(_Finish value)? finish,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(_Loading value)? loading,
+    TResult Function(_Finish value)? finish,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $DocumentLoadingStateCopyWith<$Res> {
+  factory $DocumentLoadingStateCopyWith(DocumentLoadingState value,
+          $Res Function(DocumentLoadingState) then) =
+      _$DocumentLoadingStateCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$DocumentLoadingStateCopyWithImpl<$Res>
+    implements $DocumentLoadingStateCopyWith<$Res> {
+  _$DocumentLoadingStateCopyWithImpl(this._value, this._then);
+
+  final DocumentLoadingState _value;
+  // ignore: unused_field
+  final $Res Function(DocumentLoadingState) _then;
+}
+
+/// @nodoc
+abstract class _$LoadingCopyWith<$Res> {
+  factory _$LoadingCopyWith(_Loading value, $Res Function(_Loading) then) =
+      __$LoadingCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class __$LoadingCopyWithImpl<$Res>
+    extends _$DocumentLoadingStateCopyWithImpl<$Res>
+    implements _$LoadingCopyWith<$Res> {
+  __$LoadingCopyWithImpl(_Loading _value, $Res Function(_Loading) _then)
+      : super(_value, (v) => _then(v as _Loading));
+
+  @override
+  _Loading get _value => super._value as _Loading;
+}
+
+/// @nodoc
+
+class _$_Loading implements _Loading {
+  const _$_Loading();
+
+  @override
+  String toString() {
+    return 'DocumentLoadingState.loading()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is _Loading);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() loading,
+    required TResult Function(Either<Unit, FlowyError> successOrFail) finish,
+  }) {
+    return loading();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? loading,
+    TResult Function(Either<Unit, FlowyError> successOrFail)? finish,
+  }) {
+    return loading?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? loading,
+    TResult Function(Either<Unit, FlowyError> successOrFail)? finish,
+    required TResult orElse(),
+  }) {
+    if (loading != null) {
+      return loading();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(_Loading value) loading,
+    required TResult Function(_Finish value) finish,
+  }) {
+    return loading(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(_Loading value)? loading,
+    TResult Function(_Finish value)? finish,
+  }) {
+    return loading?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(_Loading value)? loading,
+    TResult Function(_Finish value)? finish,
+    required TResult orElse(),
+  }) {
+    if (loading != null) {
+      return loading(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class _Loading implements DocumentLoadingState {
+  const factory _Loading() = _$_Loading;
+}
+
+/// @nodoc
+abstract class _$FinishCopyWith<$Res> {
+  factory _$FinishCopyWith(_Finish value, $Res Function(_Finish) then) =
+      __$FinishCopyWithImpl<$Res>;
+  $Res call({Either<Unit, FlowyError> successOrFail});
+}
+
+/// @nodoc
+class __$FinishCopyWithImpl<$Res>
+    extends _$DocumentLoadingStateCopyWithImpl<$Res>
+    implements _$FinishCopyWith<$Res> {
+  __$FinishCopyWithImpl(_Finish _value, $Res Function(_Finish) _then)
+      : super(_value, (v) => _then(v as _Finish));
+
+  @override
+  _Finish get _value => super._value as _Finish;
+
+  @override
+  $Res call({
+    Object? successOrFail = freezed,
+  }) {
+    return _then(_Finish(
+      successOrFail == freezed
+          ? _value.successOrFail
+          : successOrFail // ignore: cast_nullable_to_non_nullable
+              as Either<Unit, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$_Finish implements _Finish {
+  const _$_Finish(this.successOrFail);
+
+  @override
+  final Either<Unit, FlowyError> successOrFail;
+
+  @override
+  String toString() {
+    return 'DocumentLoadingState.finish(successOrFail: $successOrFail)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is _Finish &&
+            (identical(other.successOrFail, successOrFail) ||
+                const DeepCollectionEquality()
+                    .equals(other.successOrFail, successOrFail)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(successOrFail);
+
+  @JsonKey(ignore: true)
+  @override
+  _$FinishCopyWith<_Finish> get copyWith =>
+      __$FinishCopyWithImpl<_Finish>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() loading,
+    required TResult Function(Either<Unit, FlowyError> successOrFail) finish,
+  }) {
+    return finish(successOrFail);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? loading,
+    TResult Function(Either<Unit, FlowyError> successOrFail)? finish,
+  }) {
+    return finish?.call(successOrFail);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? loading,
+    TResult Function(Either<Unit, FlowyError> successOrFail)? finish,
+    required TResult orElse(),
+  }) {
+    if (finish != null) {
+      return finish(successOrFail);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(_Loading value) loading,
+    required TResult Function(_Finish value) finish,
+  }) {
+    return finish(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(_Loading value)? loading,
+    TResult Function(_Finish value)? finish,
+  }) {
+    return finish?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(_Loading value)? loading,
+    TResult Function(_Finish value)? finish,
+    required TResult orElse(),
+  }) {
+    if (finish != null) {
+      return finish(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class _Finish implements DocumentLoadingState {
+  const factory _Finish(Either<Unit, FlowyError> successOrFail) = _$_Finish;
+
+  Either<Unit, FlowyError> get successOrFail =>
+      throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  _$FinishCopyWith<_Finish> get copyWith => throw _privateConstructorUsedError;
+}

+ 1049 - 0
frontend/app_flowy/lib/workspace/application/menu/menu_bloc.freezed.dart

@@ -0,0 +1,1049 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
+
+part of 'menu_bloc.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity<T>(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
+
+/// @nodoc
+class _$MenuEventTearOff {
+  const _$MenuEventTearOff();
+
+  _Initial initial() {
+    return const _Initial();
+  }
+
+  Collapse collapse() {
+    return const Collapse();
+  }
+
+  OpenPage openPage(HomeStackContext<dynamic, dynamic> context) {
+    return OpenPage(
+      context,
+    );
+  }
+
+  CreateApp createApp(String name, {String? desc}) {
+    return CreateApp(
+      name,
+      desc: desc,
+    );
+  }
+
+  ReceiveApps didReceiveApps(Either<List<App>, FlowyError> appsOrFail) {
+    return ReceiveApps(
+      appsOrFail,
+    );
+  }
+}
+
+/// @nodoc
+const $MenuEvent = _$MenuEventTearOff();
+
+/// @nodoc
+mixin _$MenuEvent {
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() collapse,
+    required TResult Function(HomeStackContext<dynamic, dynamic> context)
+        openPage,
+    required TResult Function(String name, String? desc) createApp,
+    required TResult Function(Either<List<App>, FlowyError> appsOrFail)
+        didReceiveApps,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(_Initial value) initial,
+    required TResult Function(Collapse value) collapse,
+    required TResult Function(OpenPage value) openPage,
+    required TResult Function(CreateApp value) createApp,
+    required TResult Function(ReceiveApps value) didReceiveApps,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $MenuEventCopyWith<$Res> {
+  factory $MenuEventCopyWith(MenuEvent value, $Res Function(MenuEvent) then) =
+      _$MenuEventCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$MenuEventCopyWithImpl<$Res> implements $MenuEventCopyWith<$Res> {
+  _$MenuEventCopyWithImpl(this._value, this._then);
+
+  final MenuEvent _value;
+  // ignore: unused_field
+  final $Res Function(MenuEvent) _then;
+}
+
+/// @nodoc
+abstract class _$InitialCopyWith<$Res> {
+  factory _$InitialCopyWith(_Initial value, $Res Function(_Initial) then) =
+      __$InitialCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class __$InitialCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res>
+    implements _$InitialCopyWith<$Res> {
+  __$InitialCopyWithImpl(_Initial _value, $Res Function(_Initial) _then)
+      : super(_value, (v) => _then(v as _Initial));
+
+  @override
+  _Initial get _value => super._value as _Initial;
+}
+
+/// @nodoc
+
+class _$_Initial implements _Initial {
+  const _$_Initial();
+
+  @override
+  String toString() {
+    return 'MenuEvent.initial()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is _Initial);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() collapse,
+    required TResult Function(HomeStackContext<dynamic, dynamic> context)
+        openPage,
+    required TResult Function(String name, String? desc) createApp,
+    required TResult Function(Either<List<App>, FlowyError> appsOrFail)
+        didReceiveApps,
+  }) {
+    return initial();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+  }) {
+    return initial?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(_Initial value) initial,
+    required TResult Function(Collapse value) collapse,
+    required TResult Function(OpenPage value) openPage,
+    required TResult Function(CreateApp value) createApp,
+    required TResult Function(ReceiveApps value) didReceiveApps,
+  }) {
+    return initial(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+  }) {
+    return initial?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class _Initial implements MenuEvent {
+  const factory _Initial() = _$_Initial;
+}
+
+/// @nodoc
+abstract class $CollapseCopyWith<$Res> {
+  factory $CollapseCopyWith(Collapse value, $Res Function(Collapse) then) =
+      _$CollapseCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$CollapseCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res>
+    implements $CollapseCopyWith<$Res> {
+  _$CollapseCopyWithImpl(Collapse _value, $Res Function(Collapse) _then)
+      : super(_value, (v) => _then(v as Collapse));
+
+  @override
+  Collapse get _value => super._value as Collapse;
+}
+
+/// @nodoc
+
+class _$Collapse implements Collapse {
+  const _$Collapse();
+
+  @override
+  String toString() {
+    return 'MenuEvent.collapse()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is Collapse);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() collapse,
+    required TResult Function(HomeStackContext<dynamic, dynamic> context)
+        openPage,
+    required TResult Function(String name, String? desc) createApp,
+    required TResult Function(Either<List<App>, FlowyError> appsOrFail)
+        didReceiveApps,
+  }) {
+    return collapse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+  }) {
+    return collapse?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (collapse != null) {
+      return collapse();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(_Initial value) initial,
+    required TResult Function(Collapse value) collapse,
+    required TResult Function(OpenPage value) openPage,
+    required TResult Function(CreateApp value) createApp,
+    required TResult Function(ReceiveApps value) didReceiveApps,
+  }) {
+    return collapse(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+  }) {
+    return collapse?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (collapse != null) {
+      return collapse(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Collapse implements MenuEvent {
+  const factory Collapse() = _$Collapse;
+}
+
+/// @nodoc
+abstract class $OpenPageCopyWith<$Res> {
+  factory $OpenPageCopyWith(OpenPage value, $Res Function(OpenPage) then) =
+      _$OpenPageCopyWithImpl<$Res>;
+  $Res call({HomeStackContext<dynamic, dynamic> context});
+}
+
+/// @nodoc
+class _$OpenPageCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res>
+    implements $OpenPageCopyWith<$Res> {
+  _$OpenPageCopyWithImpl(OpenPage _value, $Res Function(OpenPage) _then)
+      : super(_value, (v) => _then(v as OpenPage));
+
+  @override
+  OpenPage get _value => super._value as OpenPage;
+
+  @override
+  $Res call({
+    Object? context = freezed,
+  }) {
+    return _then(OpenPage(
+      context == freezed
+          ? _value.context
+          : context // ignore: cast_nullable_to_non_nullable
+              as HomeStackContext<dynamic, dynamic>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$OpenPage implements OpenPage {
+  const _$OpenPage(this.context);
+
+  @override
+  final HomeStackContext<dynamic, dynamic> context;
+
+  @override
+  String toString() {
+    return 'MenuEvent.openPage(context: $context)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is OpenPage &&
+            (identical(other.context, context) ||
+                const DeepCollectionEquality().equals(other.context, context)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(context);
+
+  @JsonKey(ignore: true)
+  @override
+  $OpenPageCopyWith<OpenPage> get copyWith =>
+      _$OpenPageCopyWithImpl<OpenPage>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() collapse,
+    required TResult Function(HomeStackContext<dynamic, dynamic> context)
+        openPage,
+    required TResult Function(String name, String? desc) createApp,
+    required TResult Function(Either<List<App>, FlowyError> appsOrFail)
+        didReceiveApps,
+  }) {
+    return openPage(context);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+  }) {
+    return openPage?.call(context);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (openPage != null) {
+      return openPage(context);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(_Initial value) initial,
+    required TResult Function(Collapse value) collapse,
+    required TResult Function(OpenPage value) openPage,
+    required TResult Function(CreateApp value) createApp,
+    required TResult Function(ReceiveApps value) didReceiveApps,
+  }) {
+    return openPage(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+  }) {
+    return openPage?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (openPage != null) {
+      return openPage(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class OpenPage implements MenuEvent {
+  const factory OpenPage(HomeStackContext<dynamic, dynamic> context) =
+      _$OpenPage;
+
+  HomeStackContext<dynamic, dynamic> get context =>
+      throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $OpenPageCopyWith<OpenPage> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $CreateAppCopyWith<$Res> {
+  factory $CreateAppCopyWith(CreateApp value, $Res Function(CreateApp) then) =
+      _$CreateAppCopyWithImpl<$Res>;
+  $Res call({String name, String? desc});
+}
+
+/// @nodoc
+class _$CreateAppCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res>
+    implements $CreateAppCopyWith<$Res> {
+  _$CreateAppCopyWithImpl(CreateApp _value, $Res Function(CreateApp) _then)
+      : super(_value, (v) => _then(v as CreateApp));
+
+  @override
+  CreateApp get _value => super._value as CreateApp;
+
+  @override
+  $Res call({
+    Object? name = freezed,
+    Object? desc = freezed,
+  }) {
+    return _then(CreateApp(
+      name == freezed
+          ? _value.name
+          : name // ignore: cast_nullable_to_non_nullable
+              as String,
+      desc: desc == freezed
+          ? _value.desc
+          : desc // ignore: cast_nullable_to_non_nullable
+              as String?,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$CreateApp implements CreateApp {
+  const _$CreateApp(this.name, {this.desc});
+
+  @override
+  final String name;
+  @override
+  final String? desc;
+
+  @override
+  String toString() {
+    return 'MenuEvent.createApp(name: $name, desc: $desc)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is CreateApp &&
+            (identical(other.name, name) ||
+                const DeepCollectionEquality().equals(other.name, name)) &&
+            (identical(other.desc, desc) ||
+                const DeepCollectionEquality().equals(other.desc, desc)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^
+      const DeepCollectionEquality().hash(name) ^
+      const DeepCollectionEquality().hash(desc);
+
+  @JsonKey(ignore: true)
+  @override
+  $CreateAppCopyWith<CreateApp> get copyWith =>
+      _$CreateAppCopyWithImpl<CreateApp>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() collapse,
+    required TResult Function(HomeStackContext<dynamic, dynamic> context)
+        openPage,
+    required TResult Function(String name, String? desc) createApp,
+    required TResult Function(Either<List<App>, FlowyError> appsOrFail)
+        didReceiveApps,
+  }) {
+    return createApp(name, desc);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+  }) {
+    return createApp?.call(name, desc);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (createApp != null) {
+      return createApp(name, desc);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(_Initial value) initial,
+    required TResult Function(Collapse value) collapse,
+    required TResult Function(OpenPage value) openPage,
+    required TResult Function(CreateApp value) createApp,
+    required TResult Function(ReceiveApps value) didReceiveApps,
+  }) {
+    return createApp(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+  }) {
+    return createApp?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (createApp != null) {
+      return createApp(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class CreateApp implements MenuEvent {
+  const factory CreateApp(String name, {String? desc}) = _$CreateApp;
+
+  String get name => throw _privateConstructorUsedError;
+  String? get desc => throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $CreateAppCopyWith<CreateApp> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $ReceiveAppsCopyWith<$Res> {
+  factory $ReceiveAppsCopyWith(
+          ReceiveApps value, $Res Function(ReceiveApps) then) =
+      _$ReceiveAppsCopyWithImpl<$Res>;
+  $Res call({Either<List<App>, FlowyError> appsOrFail});
+}
+
+/// @nodoc
+class _$ReceiveAppsCopyWithImpl<$Res> extends _$MenuEventCopyWithImpl<$Res>
+    implements $ReceiveAppsCopyWith<$Res> {
+  _$ReceiveAppsCopyWithImpl(
+      ReceiveApps _value, $Res Function(ReceiveApps) _then)
+      : super(_value, (v) => _then(v as ReceiveApps));
+
+  @override
+  ReceiveApps get _value => super._value as ReceiveApps;
+
+  @override
+  $Res call({
+    Object? appsOrFail = freezed,
+  }) {
+    return _then(ReceiveApps(
+      appsOrFail == freezed
+          ? _value.appsOrFail
+          : appsOrFail // ignore: cast_nullable_to_non_nullable
+              as Either<List<App>, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$ReceiveApps implements ReceiveApps {
+  const _$ReceiveApps(this.appsOrFail);
+
+  @override
+  final Either<List<App>, FlowyError> appsOrFail;
+
+  @override
+  String toString() {
+    return 'MenuEvent.didReceiveApps(appsOrFail: $appsOrFail)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is ReceiveApps &&
+            (identical(other.appsOrFail, appsOrFail) ||
+                const DeepCollectionEquality()
+                    .equals(other.appsOrFail, appsOrFail)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(appsOrFail);
+
+  @JsonKey(ignore: true)
+  @override
+  $ReceiveAppsCopyWith<ReceiveApps> get copyWith =>
+      _$ReceiveAppsCopyWithImpl<ReceiveApps>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function() collapse,
+    required TResult Function(HomeStackContext<dynamic, dynamic> context)
+        openPage,
+    required TResult Function(String name, String? desc) createApp,
+    required TResult Function(Either<List<App>, FlowyError> appsOrFail)
+        didReceiveApps,
+  }) {
+    return didReceiveApps(appsOrFail);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+  }) {
+    return didReceiveApps?.call(appsOrFail);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function()? collapse,
+    TResult Function(HomeStackContext<dynamic, dynamic> context)? openPage,
+    TResult Function(String name, String? desc)? createApp,
+    TResult Function(Either<List<App>, FlowyError> appsOrFail)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (didReceiveApps != null) {
+      return didReceiveApps(appsOrFail);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(_Initial value) initial,
+    required TResult Function(Collapse value) collapse,
+    required TResult Function(OpenPage value) openPage,
+    required TResult Function(CreateApp value) createApp,
+    required TResult Function(ReceiveApps value) didReceiveApps,
+  }) {
+    return didReceiveApps(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+  }) {
+    return didReceiveApps?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(_Initial value)? initial,
+    TResult Function(Collapse value)? collapse,
+    TResult Function(OpenPage value)? openPage,
+    TResult Function(CreateApp value)? createApp,
+    TResult Function(ReceiveApps value)? didReceiveApps,
+    required TResult orElse(),
+  }) {
+    if (didReceiveApps != null) {
+      return didReceiveApps(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class ReceiveApps implements MenuEvent {
+  const factory ReceiveApps(Either<List<App>, FlowyError> appsOrFail) =
+      _$ReceiveApps;
+
+  Either<List<App>, FlowyError> get appsOrFail =>
+      throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $ReceiveAppsCopyWith<ReceiveApps> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+class _$MenuStateTearOff {
+  const _$MenuStateTearOff();
+
+  _MenuState call(
+      {required bool isCollapse,
+      required Option<List<App>> apps,
+      required Either<Unit, FlowyError> successOrFailure,
+      required HomeStackContext<dynamic, dynamic> stackContext}) {
+    return _MenuState(
+      isCollapse: isCollapse,
+      apps: apps,
+      successOrFailure: successOrFailure,
+      stackContext: stackContext,
+    );
+  }
+}
+
+/// @nodoc
+const $MenuState = _$MenuStateTearOff();
+
+/// @nodoc
+mixin _$MenuState {
+  bool get isCollapse => throw _privateConstructorUsedError;
+  Option<List<App>> get apps => throw _privateConstructorUsedError;
+  Either<Unit, FlowyError> get successOrFailure =>
+      throw _privateConstructorUsedError;
+  HomeStackContext<dynamic, dynamic> get stackContext =>
+      throw _privateConstructorUsedError;
+
+  @JsonKey(ignore: true)
+  $MenuStateCopyWith<MenuState> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $MenuStateCopyWith<$Res> {
+  factory $MenuStateCopyWith(MenuState value, $Res Function(MenuState) then) =
+      _$MenuStateCopyWithImpl<$Res>;
+  $Res call(
+      {bool isCollapse,
+      Option<List<App>> apps,
+      Either<Unit, FlowyError> successOrFailure,
+      HomeStackContext<dynamic, dynamic> stackContext});
+}
+
+/// @nodoc
+class _$MenuStateCopyWithImpl<$Res> implements $MenuStateCopyWith<$Res> {
+  _$MenuStateCopyWithImpl(this._value, this._then);
+
+  final MenuState _value;
+  // ignore: unused_field
+  final $Res Function(MenuState) _then;
+
+  @override
+  $Res call({
+    Object? isCollapse = freezed,
+    Object? apps = freezed,
+    Object? successOrFailure = freezed,
+    Object? stackContext = freezed,
+  }) {
+    return _then(_value.copyWith(
+      isCollapse: isCollapse == freezed
+          ? _value.isCollapse
+          : isCollapse // ignore: cast_nullable_to_non_nullable
+              as bool,
+      apps: apps == freezed
+          ? _value.apps
+          : apps // ignore: cast_nullable_to_non_nullable
+              as Option<List<App>>,
+      successOrFailure: successOrFailure == freezed
+          ? _value.successOrFailure
+          : successOrFailure // ignore: cast_nullable_to_non_nullable
+              as Either<Unit, FlowyError>,
+      stackContext: stackContext == freezed
+          ? _value.stackContext
+          : stackContext // ignore: cast_nullable_to_non_nullable
+              as HomeStackContext<dynamic, dynamic>,
+    ));
+  }
+}
+
+/// @nodoc
+abstract class _$MenuStateCopyWith<$Res> implements $MenuStateCopyWith<$Res> {
+  factory _$MenuStateCopyWith(
+          _MenuState value, $Res Function(_MenuState) then) =
+      __$MenuStateCopyWithImpl<$Res>;
+  @override
+  $Res call(
+      {bool isCollapse,
+      Option<List<App>> apps,
+      Either<Unit, FlowyError> successOrFailure,
+      HomeStackContext<dynamic, dynamic> stackContext});
+}
+
+/// @nodoc
+class __$MenuStateCopyWithImpl<$Res> extends _$MenuStateCopyWithImpl<$Res>
+    implements _$MenuStateCopyWith<$Res> {
+  __$MenuStateCopyWithImpl(_MenuState _value, $Res Function(_MenuState) _then)
+      : super(_value, (v) => _then(v as _MenuState));
+
+  @override
+  _MenuState get _value => super._value as _MenuState;
+
+  @override
+  $Res call({
+    Object? isCollapse = freezed,
+    Object? apps = freezed,
+    Object? successOrFailure = freezed,
+    Object? stackContext = freezed,
+  }) {
+    return _then(_MenuState(
+      isCollapse: isCollapse == freezed
+          ? _value.isCollapse
+          : isCollapse // ignore: cast_nullable_to_non_nullable
+              as bool,
+      apps: apps == freezed
+          ? _value.apps
+          : apps // ignore: cast_nullable_to_non_nullable
+              as Option<List<App>>,
+      successOrFailure: successOrFailure == freezed
+          ? _value.successOrFailure
+          : successOrFailure // ignore: cast_nullable_to_non_nullable
+              as Either<Unit, FlowyError>,
+      stackContext: stackContext == freezed
+          ? _value.stackContext
+          : stackContext // ignore: cast_nullable_to_non_nullable
+              as HomeStackContext<dynamic, dynamic>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$_MenuState implements _MenuState {
+  const _$_MenuState(
+      {required this.isCollapse,
+      required this.apps,
+      required this.successOrFailure,
+      required this.stackContext});
+
+  @override
+  final bool isCollapse;
+  @override
+  final Option<List<App>> apps;
+  @override
+  final Either<Unit, FlowyError> successOrFailure;
+  @override
+  final HomeStackContext<dynamic, dynamic> stackContext;
+
+  @override
+  String toString() {
+    return 'MenuState(isCollapse: $isCollapse, apps: $apps, successOrFailure: $successOrFailure, stackContext: $stackContext)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is _MenuState &&
+            (identical(other.isCollapse, isCollapse) ||
+                const DeepCollectionEquality()
+                    .equals(other.isCollapse, isCollapse)) &&
+            (identical(other.apps, apps) ||
+                const DeepCollectionEquality().equals(other.apps, apps)) &&
+            (identical(other.successOrFailure, successOrFailure) ||
+                const DeepCollectionEquality()
+                    .equals(other.successOrFailure, successOrFailure)) &&
+            (identical(other.stackContext, stackContext) ||
+                const DeepCollectionEquality()
+                    .equals(other.stackContext, stackContext)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^
+      const DeepCollectionEquality().hash(isCollapse) ^
+      const DeepCollectionEquality().hash(apps) ^
+      const DeepCollectionEquality().hash(successOrFailure) ^
+      const DeepCollectionEquality().hash(stackContext);
+
+  @JsonKey(ignore: true)
+  @override
+  _$MenuStateCopyWith<_MenuState> get copyWith =>
+      __$MenuStateCopyWithImpl<_MenuState>(this, _$identity);
+}
+
+abstract class _MenuState implements MenuState {
+  const factory _MenuState(
+      {required bool isCollapse,
+      required Option<List<App>> apps,
+      required Either<Unit, FlowyError> successOrFailure,
+      required HomeStackContext<dynamic, dynamic> stackContext}) = _$_MenuState;
+
+  @override
+  bool get isCollapse => throw _privateConstructorUsedError;
+  @override
+  Option<List<App>> get apps => throw _privateConstructorUsedError;
+  @override
+  Either<Unit, FlowyError> get successOrFailure =>
+      throw _privateConstructorUsedError;
+  @override
+  HomeStackContext<dynamic, dynamic> get stackContext =>
+      throw _privateConstructorUsedError;
+  @override
+  @JsonKey(ignore: true)
+  _$MenuStateCopyWith<_MenuState> get copyWith =>
+      throw _privateConstructorUsedError;
+}

+ 1129 - 0
frontend/app_flowy/lib/workspace/application/trash/trash_bloc.freezed.dart

@@ -0,0 +1,1129 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
+
+part of 'trash_bloc.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity<T>(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
+
+/// @nodoc
+class _$TrashEventTearOff {
+  const _$TrashEventTearOff();
+
+  Initial initial() {
+    return const Initial();
+  }
+
+  ReceiveTrash didReceiveTrash(List<Trash> trash) {
+    return ReceiveTrash(
+      trash,
+    );
+  }
+
+  Putback putback(String trashId) {
+    return Putback(
+      trashId,
+    );
+  }
+
+  Delete delete(Trash trash) {
+    return Delete(
+      trash,
+    );
+  }
+
+  RestoreAll restoreAll() {
+    return const RestoreAll();
+  }
+
+  DeleteAll deleteAll() {
+    return const DeleteAll();
+  }
+}
+
+/// @nodoc
+const $TrashEvent = _$TrashEventTearOff();
+
+/// @nodoc
+mixin _$TrashEvent {
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(List<Trash> trash) didReceiveTrash,
+    required TResult Function(String trashId) putback,
+    required TResult Function(Trash trash) delete,
+    required TResult Function() restoreAll,
+    required TResult Function() deleteAll,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(ReceiveTrash value) didReceiveTrash,
+    required TResult Function(Putback value) putback,
+    required TResult Function(Delete value) delete,
+    required TResult Function(RestoreAll value) restoreAll,
+    required TResult Function(DeleteAll value) deleteAll,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $TrashEventCopyWith<$Res> {
+  factory $TrashEventCopyWith(
+          TrashEvent value, $Res Function(TrashEvent) then) =
+      _$TrashEventCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$TrashEventCopyWithImpl<$Res> implements $TrashEventCopyWith<$Res> {
+  _$TrashEventCopyWithImpl(this._value, this._then);
+
+  final TrashEvent _value;
+  // ignore: unused_field
+  final $Res Function(TrashEvent) _then;
+}
+
+/// @nodoc
+abstract class $InitialCopyWith<$Res> {
+  factory $InitialCopyWith(Initial value, $Res Function(Initial) then) =
+      _$InitialCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$InitialCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res>
+    implements $InitialCopyWith<$Res> {
+  _$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then)
+      : super(_value, (v) => _then(v as Initial));
+
+  @override
+  Initial get _value => super._value as Initial;
+}
+
+/// @nodoc
+
+class _$Initial implements Initial {
+  const _$Initial();
+
+  @override
+  String toString() {
+    return 'TrashEvent.initial()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is Initial);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(List<Trash> trash) didReceiveTrash,
+    required TResult Function(String trashId) putback,
+    required TResult Function(Trash trash) delete,
+    required TResult Function() restoreAll,
+    required TResult Function() deleteAll,
+  }) {
+    return initial();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+  }) {
+    return initial?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(ReceiveTrash value) didReceiveTrash,
+    required TResult Function(Putback value) putback,
+    required TResult Function(Delete value) delete,
+    required TResult Function(RestoreAll value) restoreAll,
+    required TResult Function(DeleteAll value) deleteAll,
+  }) {
+    return initial(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+  }) {
+    return initial?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Initial implements TrashEvent {
+  const factory Initial() = _$Initial;
+}
+
+/// @nodoc
+abstract class $ReceiveTrashCopyWith<$Res> {
+  factory $ReceiveTrashCopyWith(
+          ReceiveTrash value, $Res Function(ReceiveTrash) then) =
+      _$ReceiveTrashCopyWithImpl<$Res>;
+  $Res call({List<Trash> trash});
+}
+
+/// @nodoc
+class _$ReceiveTrashCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res>
+    implements $ReceiveTrashCopyWith<$Res> {
+  _$ReceiveTrashCopyWithImpl(
+      ReceiveTrash _value, $Res Function(ReceiveTrash) _then)
+      : super(_value, (v) => _then(v as ReceiveTrash));
+
+  @override
+  ReceiveTrash get _value => super._value as ReceiveTrash;
+
+  @override
+  $Res call({
+    Object? trash = freezed,
+  }) {
+    return _then(ReceiveTrash(
+      trash == freezed
+          ? _value.trash
+          : trash // ignore: cast_nullable_to_non_nullable
+              as List<Trash>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$ReceiveTrash implements ReceiveTrash {
+  const _$ReceiveTrash(this.trash);
+
+  @override
+  final List<Trash> trash;
+
+  @override
+  String toString() {
+    return 'TrashEvent.didReceiveTrash(trash: $trash)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is ReceiveTrash &&
+            (identical(other.trash, trash) ||
+                const DeepCollectionEquality().equals(other.trash, trash)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(trash);
+
+  @JsonKey(ignore: true)
+  @override
+  $ReceiveTrashCopyWith<ReceiveTrash> get copyWith =>
+      _$ReceiveTrashCopyWithImpl<ReceiveTrash>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(List<Trash> trash) didReceiveTrash,
+    required TResult Function(String trashId) putback,
+    required TResult Function(Trash trash) delete,
+    required TResult Function() restoreAll,
+    required TResult Function() deleteAll,
+  }) {
+    return didReceiveTrash(trash);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+  }) {
+    return didReceiveTrash?.call(trash);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (didReceiveTrash != null) {
+      return didReceiveTrash(trash);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(ReceiveTrash value) didReceiveTrash,
+    required TResult Function(Putback value) putback,
+    required TResult Function(Delete value) delete,
+    required TResult Function(RestoreAll value) restoreAll,
+    required TResult Function(DeleteAll value) deleteAll,
+  }) {
+    return didReceiveTrash(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+  }) {
+    return didReceiveTrash?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (didReceiveTrash != null) {
+      return didReceiveTrash(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class ReceiveTrash implements TrashEvent {
+  const factory ReceiveTrash(List<Trash> trash) = _$ReceiveTrash;
+
+  List<Trash> get trash => throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $ReceiveTrashCopyWith<ReceiveTrash> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $PutbackCopyWith<$Res> {
+  factory $PutbackCopyWith(Putback value, $Res Function(Putback) then) =
+      _$PutbackCopyWithImpl<$Res>;
+  $Res call({String trashId});
+}
+
+/// @nodoc
+class _$PutbackCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res>
+    implements $PutbackCopyWith<$Res> {
+  _$PutbackCopyWithImpl(Putback _value, $Res Function(Putback) _then)
+      : super(_value, (v) => _then(v as Putback));
+
+  @override
+  Putback get _value => super._value as Putback;
+
+  @override
+  $Res call({
+    Object? trashId = freezed,
+  }) {
+    return _then(Putback(
+      trashId == freezed
+          ? _value.trashId
+          : trashId // ignore: cast_nullable_to_non_nullable
+              as String,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$Putback implements Putback {
+  const _$Putback(this.trashId);
+
+  @override
+  final String trashId;
+
+  @override
+  String toString() {
+    return 'TrashEvent.putback(trashId: $trashId)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is Putback &&
+            (identical(other.trashId, trashId) ||
+                const DeepCollectionEquality().equals(other.trashId, trashId)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(trashId);
+
+  @JsonKey(ignore: true)
+  @override
+  $PutbackCopyWith<Putback> get copyWith =>
+      _$PutbackCopyWithImpl<Putback>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(List<Trash> trash) didReceiveTrash,
+    required TResult Function(String trashId) putback,
+    required TResult Function(Trash trash) delete,
+    required TResult Function() restoreAll,
+    required TResult Function() deleteAll,
+  }) {
+    return putback(trashId);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+  }) {
+    return putback?.call(trashId);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (putback != null) {
+      return putback(trashId);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(ReceiveTrash value) didReceiveTrash,
+    required TResult Function(Putback value) putback,
+    required TResult Function(Delete value) delete,
+    required TResult Function(RestoreAll value) restoreAll,
+    required TResult Function(DeleteAll value) deleteAll,
+  }) {
+    return putback(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+  }) {
+    return putback?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (putback != null) {
+      return putback(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Putback implements TrashEvent {
+  const factory Putback(String trashId) = _$Putback;
+
+  String get trashId => throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $PutbackCopyWith<Putback> get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $DeleteCopyWith<$Res> {
+  factory $DeleteCopyWith(Delete value, $Res Function(Delete) then) =
+      _$DeleteCopyWithImpl<$Res>;
+  $Res call({Trash trash});
+}
+
+/// @nodoc
+class _$DeleteCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res>
+    implements $DeleteCopyWith<$Res> {
+  _$DeleteCopyWithImpl(Delete _value, $Res Function(Delete) _then)
+      : super(_value, (v) => _then(v as Delete));
+
+  @override
+  Delete get _value => super._value as Delete;
+
+  @override
+  $Res call({
+    Object? trash = freezed,
+  }) {
+    return _then(Delete(
+      trash == freezed
+          ? _value.trash
+          : trash // ignore: cast_nullable_to_non_nullable
+              as Trash,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$Delete implements Delete {
+  const _$Delete(this.trash);
+
+  @override
+  final Trash trash;
+
+  @override
+  String toString() {
+    return 'TrashEvent.delete(trash: $trash)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is Delete &&
+            (identical(other.trash, trash) ||
+                const DeepCollectionEquality().equals(other.trash, trash)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(trash);
+
+  @JsonKey(ignore: true)
+  @override
+  $DeleteCopyWith<Delete> get copyWith =>
+      _$DeleteCopyWithImpl<Delete>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(List<Trash> trash) didReceiveTrash,
+    required TResult Function(String trashId) putback,
+    required TResult Function(Trash trash) delete,
+    required TResult Function() restoreAll,
+    required TResult Function() deleteAll,
+  }) {
+    return delete(trash);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+  }) {
+    return delete?.call(trash);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (delete != null) {
+      return delete(trash);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(ReceiveTrash value) didReceiveTrash,
+    required TResult Function(Putback value) putback,
+    required TResult Function(Delete value) delete,
+    required TResult Function(RestoreAll value) restoreAll,
+    required TResult Function(DeleteAll value) deleteAll,
+  }) {
+    return delete(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+  }) {
+    return delete?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (delete != null) {
+      return delete(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Delete implements TrashEvent {
+  const factory Delete(Trash trash) = _$Delete;
+
+  Trash get trash => throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $DeleteCopyWith<Delete> get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $RestoreAllCopyWith<$Res> {
+  factory $RestoreAllCopyWith(
+          RestoreAll value, $Res Function(RestoreAll) then) =
+      _$RestoreAllCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$RestoreAllCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res>
+    implements $RestoreAllCopyWith<$Res> {
+  _$RestoreAllCopyWithImpl(RestoreAll _value, $Res Function(RestoreAll) _then)
+      : super(_value, (v) => _then(v as RestoreAll));
+
+  @override
+  RestoreAll get _value => super._value as RestoreAll;
+}
+
+/// @nodoc
+
+class _$RestoreAll implements RestoreAll {
+  const _$RestoreAll();
+
+  @override
+  String toString() {
+    return 'TrashEvent.restoreAll()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is RestoreAll);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(List<Trash> trash) didReceiveTrash,
+    required TResult Function(String trashId) putback,
+    required TResult Function(Trash trash) delete,
+    required TResult Function() restoreAll,
+    required TResult Function() deleteAll,
+  }) {
+    return restoreAll();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+  }) {
+    return restoreAll?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (restoreAll != null) {
+      return restoreAll();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(ReceiveTrash value) didReceiveTrash,
+    required TResult Function(Putback value) putback,
+    required TResult Function(Delete value) delete,
+    required TResult Function(RestoreAll value) restoreAll,
+    required TResult Function(DeleteAll value) deleteAll,
+  }) {
+    return restoreAll(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+  }) {
+    return restoreAll?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (restoreAll != null) {
+      return restoreAll(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class RestoreAll implements TrashEvent {
+  const factory RestoreAll() = _$RestoreAll;
+}
+
+/// @nodoc
+abstract class $DeleteAllCopyWith<$Res> {
+  factory $DeleteAllCopyWith(DeleteAll value, $Res Function(DeleteAll) then) =
+      _$DeleteAllCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$DeleteAllCopyWithImpl<$Res> extends _$TrashEventCopyWithImpl<$Res>
+    implements $DeleteAllCopyWith<$Res> {
+  _$DeleteAllCopyWithImpl(DeleteAll _value, $Res Function(DeleteAll) _then)
+      : super(_value, (v) => _then(v as DeleteAll));
+
+  @override
+  DeleteAll get _value => super._value as DeleteAll;
+}
+
+/// @nodoc
+
+class _$DeleteAll implements DeleteAll {
+  const _$DeleteAll();
+
+  @override
+  String toString() {
+    return 'TrashEvent.deleteAll()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is DeleteAll);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(List<Trash> trash) didReceiveTrash,
+    required TResult Function(String trashId) putback,
+    required TResult Function(Trash trash) delete,
+    required TResult Function() restoreAll,
+    required TResult Function() deleteAll,
+  }) {
+    return deleteAll();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+  }) {
+    return deleteAll?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(List<Trash> trash)? didReceiveTrash,
+    TResult Function(String trashId)? putback,
+    TResult Function(Trash trash)? delete,
+    TResult Function()? restoreAll,
+    TResult Function()? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (deleteAll != null) {
+      return deleteAll();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(ReceiveTrash value) didReceiveTrash,
+    required TResult Function(Putback value) putback,
+    required TResult Function(Delete value) delete,
+    required TResult Function(RestoreAll value) restoreAll,
+    required TResult Function(DeleteAll value) deleteAll,
+  }) {
+    return deleteAll(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+  }) {
+    return deleteAll?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(ReceiveTrash value)? didReceiveTrash,
+    TResult Function(Putback value)? putback,
+    TResult Function(Delete value)? delete,
+    TResult Function(RestoreAll value)? restoreAll,
+    TResult Function(DeleteAll value)? deleteAll,
+    required TResult orElse(),
+  }) {
+    if (deleteAll != null) {
+      return deleteAll(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class DeleteAll implements TrashEvent {
+  const factory DeleteAll() = _$DeleteAll;
+}
+
+/// @nodoc
+class _$TrashStateTearOff {
+  const _$TrashStateTearOff();
+
+  _TrashState call(
+      {required List<Trash> objects,
+      required Either<Unit, FlowyError> successOrFailure}) {
+    return _TrashState(
+      objects: objects,
+      successOrFailure: successOrFailure,
+    );
+  }
+}
+
+/// @nodoc
+const $TrashState = _$TrashStateTearOff();
+
+/// @nodoc
+mixin _$TrashState {
+  List<Trash> get objects => throw _privateConstructorUsedError;
+  Either<Unit, FlowyError> get successOrFailure =>
+      throw _privateConstructorUsedError;
+
+  @JsonKey(ignore: true)
+  $TrashStateCopyWith<TrashState> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $TrashStateCopyWith<$Res> {
+  factory $TrashStateCopyWith(
+          TrashState value, $Res Function(TrashState) then) =
+      _$TrashStateCopyWithImpl<$Res>;
+  $Res call({List<Trash> objects, Either<Unit, FlowyError> successOrFailure});
+}
+
+/// @nodoc
+class _$TrashStateCopyWithImpl<$Res> implements $TrashStateCopyWith<$Res> {
+  _$TrashStateCopyWithImpl(this._value, this._then);
+
+  final TrashState _value;
+  // ignore: unused_field
+  final $Res Function(TrashState) _then;
+
+  @override
+  $Res call({
+    Object? objects = freezed,
+    Object? successOrFailure = freezed,
+  }) {
+    return _then(_value.copyWith(
+      objects: objects == freezed
+          ? _value.objects
+          : objects // ignore: cast_nullable_to_non_nullable
+              as List<Trash>,
+      successOrFailure: successOrFailure == freezed
+          ? _value.successOrFailure
+          : successOrFailure // ignore: cast_nullable_to_non_nullable
+              as Either<Unit, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+abstract class _$TrashStateCopyWith<$Res> implements $TrashStateCopyWith<$Res> {
+  factory _$TrashStateCopyWith(
+          _TrashState value, $Res Function(_TrashState) then) =
+      __$TrashStateCopyWithImpl<$Res>;
+  @override
+  $Res call({List<Trash> objects, Either<Unit, FlowyError> successOrFailure});
+}
+
+/// @nodoc
+class __$TrashStateCopyWithImpl<$Res> extends _$TrashStateCopyWithImpl<$Res>
+    implements _$TrashStateCopyWith<$Res> {
+  __$TrashStateCopyWithImpl(
+      _TrashState _value, $Res Function(_TrashState) _then)
+      : super(_value, (v) => _then(v as _TrashState));
+
+  @override
+  _TrashState get _value => super._value as _TrashState;
+
+  @override
+  $Res call({
+    Object? objects = freezed,
+    Object? successOrFailure = freezed,
+  }) {
+    return _then(_TrashState(
+      objects: objects == freezed
+          ? _value.objects
+          : objects // ignore: cast_nullable_to_non_nullable
+              as List<Trash>,
+      successOrFailure: successOrFailure == freezed
+          ? _value.successOrFailure
+          : successOrFailure // ignore: cast_nullable_to_non_nullable
+              as Either<Unit, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$_TrashState implements _TrashState {
+  const _$_TrashState({required this.objects, required this.successOrFailure});
+
+  @override
+  final List<Trash> objects;
+  @override
+  final Either<Unit, FlowyError> successOrFailure;
+
+  @override
+  String toString() {
+    return 'TrashState(objects: $objects, successOrFailure: $successOrFailure)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is _TrashState &&
+            (identical(other.objects, objects) ||
+                const DeepCollectionEquality()
+                    .equals(other.objects, objects)) &&
+            (identical(other.successOrFailure, successOrFailure) ||
+                const DeepCollectionEquality()
+                    .equals(other.successOrFailure, successOrFailure)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^
+      const DeepCollectionEquality().hash(objects) ^
+      const DeepCollectionEquality().hash(successOrFailure);
+
+  @JsonKey(ignore: true)
+  @override
+  _$TrashStateCopyWith<_TrashState> get copyWith =>
+      __$TrashStateCopyWithImpl<_TrashState>(this, _$identity);
+}
+
+abstract class _TrashState implements TrashState {
+  const factory _TrashState(
+      {required List<Trash> objects,
+      required Either<Unit, FlowyError> successOrFailure}) = _$_TrashState;
+
+  @override
+  List<Trash> get objects => throw _privateConstructorUsedError;
+  @override
+  Either<Unit, FlowyError> get successOrFailure =>
+      throw _privateConstructorUsedError;
+  @override
+  @JsonKey(ignore: true)
+  _$TrashStateCopyWith<_TrashState> get copyWith =>
+      throw _privateConstructorUsedError;
+}

+ 1155 - 0
frontend/app_flowy/lib/workspace/application/view/view_bloc.freezed.dart

@@ -0,0 +1,1155 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
+
+part of 'view_bloc.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity<T>(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
+
+/// @nodoc
+class _$ViewEventTearOff {
+  const _$ViewEventTearOff();
+
+  Initial initial() {
+    return const Initial();
+  }
+
+  SetEditing setIsEditing(bool isEditing) {
+    return SetEditing(
+      isEditing,
+    );
+  }
+
+  Rename rename(String newName) {
+    return Rename(
+      newName,
+    );
+  }
+
+  Delete delete() {
+    return const Delete();
+  }
+
+  Duplicate duplicate() {
+    return const Duplicate();
+  }
+
+  ViewDidUpdate viewDidUpdate(Either<View, FlowyError> result) {
+    return ViewDidUpdate(
+      result,
+    );
+  }
+}
+
+/// @nodoc
+const $ViewEvent = _$ViewEventTearOff();
+
+/// @nodoc
+mixin _$ViewEvent {
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(bool isEditing) setIsEditing,
+    required TResult Function(String newName) rename,
+    required TResult Function() delete,
+    required TResult Function() duplicate,
+    required TResult Function(Either<View, FlowyError> result) viewDidUpdate,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(SetEditing value) setIsEditing,
+    required TResult Function(Rename value) rename,
+    required TResult Function(Delete value) delete,
+    required TResult Function(Duplicate value) duplicate,
+    required TResult Function(ViewDidUpdate value) viewDidUpdate,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $ViewEventCopyWith<$Res> {
+  factory $ViewEventCopyWith(ViewEvent value, $Res Function(ViewEvent) then) =
+      _$ViewEventCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$ViewEventCopyWithImpl<$Res> implements $ViewEventCopyWith<$Res> {
+  _$ViewEventCopyWithImpl(this._value, this._then);
+
+  final ViewEvent _value;
+  // ignore: unused_field
+  final $Res Function(ViewEvent) _then;
+}
+
+/// @nodoc
+abstract class $InitialCopyWith<$Res> {
+  factory $InitialCopyWith(Initial value, $Res Function(Initial) then) =
+      _$InitialCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$InitialCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res>
+    implements $InitialCopyWith<$Res> {
+  _$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then)
+      : super(_value, (v) => _then(v as Initial));
+
+  @override
+  Initial get _value => super._value as Initial;
+}
+
+/// @nodoc
+
+class _$Initial implements Initial {
+  const _$Initial();
+
+  @override
+  String toString() {
+    return 'ViewEvent.initial()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is Initial);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(bool isEditing) setIsEditing,
+    required TResult Function(String newName) rename,
+    required TResult Function() delete,
+    required TResult Function() duplicate,
+    required TResult Function(Either<View, FlowyError> result) viewDidUpdate,
+  }) {
+    return initial();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+  }) {
+    return initial?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(SetEditing value) setIsEditing,
+    required TResult Function(Rename value) rename,
+    required TResult Function(Delete value) delete,
+    required TResult Function(Duplicate value) duplicate,
+    required TResult Function(ViewDidUpdate value) viewDidUpdate,
+  }) {
+    return initial(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+  }) {
+    return initial?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Initial implements ViewEvent {
+  const factory Initial() = _$Initial;
+}
+
+/// @nodoc
+abstract class $SetEditingCopyWith<$Res> {
+  factory $SetEditingCopyWith(
+          SetEditing value, $Res Function(SetEditing) then) =
+      _$SetEditingCopyWithImpl<$Res>;
+  $Res call({bool isEditing});
+}
+
+/// @nodoc
+class _$SetEditingCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res>
+    implements $SetEditingCopyWith<$Res> {
+  _$SetEditingCopyWithImpl(SetEditing _value, $Res Function(SetEditing) _then)
+      : super(_value, (v) => _then(v as SetEditing));
+
+  @override
+  SetEditing get _value => super._value as SetEditing;
+
+  @override
+  $Res call({
+    Object? isEditing = freezed,
+  }) {
+    return _then(SetEditing(
+      isEditing == freezed
+          ? _value.isEditing
+          : isEditing // ignore: cast_nullable_to_non_nullable
+              as bool,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$SetEditing implements SetEditing {
+  const _$SetEditing(this.isEditing);
+
+  @override
+  final bool isEditing;
+
+  @override
+  String toString() {
+    return 'ViewEvent.setIsEditing(isEditing: $isEditing)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is SetEditing &&
+            (identical(other.isEditing, isEditing) ||
+                const DeepCollectionEquality()
+                    .equals(other.isEditing, isEditing)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(isEditing);
+
+  @JsonKey(ignore: true)
+  @override
+  $SetEditingCopyWith<SetEditing> get copyWith =>
+      _$SetEditingCopyWithImpl<SetEditing>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(bool isEditing) setIsEditing,
+    required TResult Function(String newName) rename,
+    required TResult Function() delete,
+    required TResult Function() duplicate,
+    required TResult Function(Either<View, FlowyError> result) viewDidUpdate,
+  }) {
+    return setIsEditing(isEditing);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+  }) {
+    return setIsEditing?.call(isEditing);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (setIsEditing != null) {
+      return setIsEditing(isEditing);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(SetEditing value) setIsEditing,
+    required TResult Function(Rename value) rename,
+    required TResult Function(Delete value) delete,
+    required TResult Function(Duplicate value) duplicate,
+    required TResult Function(ViewDidUpdate value) viewDidUpdate,
+  }) {
+    return setIsEditing(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+  }) {
+    return setIsEditing?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (setIsEditing != null) {
+      return setIsEditing(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class SetEditing implements ViewEvent {
+  const factory SetEditing(bool isEditing) = _$SetEditing;
+
+  bool get isEditing => throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $SetEditingCopyWith<SetEditing> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $RenameCopyWith<$Res> {
+  factory $RenameCopyWith(Rename value, $Res Function(Rename) then) =
+      _$RenameCopyWithImpl<$Res>;
+  $Res call({String newName});
+}
+
+/// @nodoc
+class _$RenameCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res>
+    implements $RenameCopyWith<$Res> {
+  _$RenameCopyWithImpl(Rename _value, $Res Function(Rename) _then)
+      : super(_value, (v) => _then(v as Rename));
+
+  @override
+  Rename get _value => super._value as Rename;
+
+  @override
+  $Res call({
+    Object? newName = freezed,
+  }) {
+    return _then(Rename(
+      newName == freezed
+          ? _value.newName
+          : newName // ignore: cast_nullable_to_non_nullable
+              as String,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$Rename implements Rename {
+  const _$Rename(this.newName);
+
+  @override
+  final String newName;
+
+  @override
+  String toString() {
+    return 'ViewEvent.rename(newName: $newName)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is Rename &&
+            (identical(other.newName, newName) ||
+                const DeepCollectionEquality().equals(other.newName, newName)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(newName);
+
+  @JsonKey(ignore: true)
+  @override
+  $RenameCopyWith<Rename> get copyWith =>
+      _$RenameCopyWithImpl<Rename>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(bool isEditing) setIsEditing,
+    required TResult Function(String newName) rename,
+    required TResult Function() delete,
+    required TResult Function() duplicate,
+    required TResult Function(Either<View, FlowyError> result) viewDidUpdate,
+  }) {
+    return rename(newName);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+  }) {
+    return rename?.call(newName);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (rename != null) {
+      return rename(newName);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(SetEditing value) setIsEditing,
+    required TResult Function(Rename value) rename,
+    required TResult Function(Delete value) delete,
+    required TResult Function(Duplicate value) duplicate,
+    required TResult Function(ViewDidUpdate value) viewDidUpdate,
+  }) {
+    return rename(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+  }) {
+    return rename?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (rename != null) {
+      return rename(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Rename implements ViewEvent {
+  const factory Rename(String newName) = _$Rename;
+
+  String get newName => throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $RenameCopyWith<Rename> get copyWith => throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $DeleteCopyWith<$Res> {
+  factory $DeleteCopyWith(Delete value, $Res Function(Delete) then) =
+      _$DeleteCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$DeleteCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res>
+    implements $DeleteCopyWith<$Res> {
+  _$DeleteCopyWithImpl(Delete _value, $Res Function(Delete) _then)
+      : super(_value, (v) => _then(v as Delete));
+
+  @override
+  Delete get _value => super._value as Delete;
+}
+
+/// @nodoc
+
+class _$Delete implements Delete {
+  const _$Delete();
+
+  @override
+  String toString() {
+    return 'ViewEvent.delete()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is Delete);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(bool isEditing) setIsEditing,
+    required TResult Function(String newName) rename,
+    required TResult Function() delete,
+    required TResult Function() duplicate,
+    required TResult Function(Either<View, FlowyError> result) viewDidUpdate,
+  }) {
+    return delete();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+  }) {
+    return delete?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (delete != null) {
+      return delete();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(SetEditing value) setIsEditing,
+    required TResult Function(Rename value) rename,
+    required TResult Function(Delete value) delete,
+    required TResult Function(Duplicate value) duplicate,
+    required TResult Function(ViewDidUpdate value) viewDidUpdate,
+  }) {
+    return delete(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+  }) {
+    return delete?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (delete != null) {
+      return delete(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Delete implements ViewEvent {
+  const factory Delete() = _$Delete;
+}
+
+/// @nodoc
+abstract class $DuplicateCopyWith<$Res> {
+  factory $DuplicateCopyWith(Duplicate value, $Res Function(Duplicate) then) =
+      _$DuplicateCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$DuplicateCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res>
+    implements $DuplicateCopyWith<$Res> {
+  _$DuplicateCopyWithImpl(Duplicate _value, $Res Function(Duplicate) _then)
+      : super(_value, (v) => _then(v as Duplicate));
+
+  @override
+  Duplicate get _value => super._value as Duplicate;
+}
+
+/// @nodoc
+
+class _$Duplicate implements Duplicate {
+  const _$Duplicate();
+
+  @override
+  String toString() {
+    return 'ViewEvent.duplicate()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is Duplicate);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(bool isEditing) setIsEditing,
+    required TResult Function(String newName) rename,
+    required TResult Function() delete,
+    required TResult Function() duplicate,
+    required TResult Function(Either<View, FlowyError> result) viewDidUpdate,
+  }) {
+    return duplicate();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+  }) {
+    return duplicate?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (duplicate != null) {
+      return duplicate();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(SetEditing value) setIsEditing,
+    required TResult Function(Rename value) rename,
+    required TResult Function(Delete value) delete,
+    required TResult Function(Duplicate value) duplicate,
+    required TResult Function(ViewDidUpdate value) viewDidUpdate,
+  }) {
+    return duplicate(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+  }) {
+    return duplicate?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (duplicate != null) {
+      return duplicate(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Duplicate implements ViewEvent {
+  const factory Duplicate() = _$Duplicate;
+}
+
+/// @nodoc
+abstract class $ViewDidUpdateCopyWith<$Res> {
+  factory $ViewDidUpdateCopyWith(
+          ViewDidUpdate value, $Res Function(ViewDidUpdate) then) =
+      _$ViewDidUpdateCopyWithImpl<$Res>;
+  $Res call({Either<View, FlowyError> result});
+}
+
+/// @nodoc
+class _$ViewDidUpdateCopyWithImpl<$Res> extends _$ViewEventCopyWithImpl<$Res>
+    implements $ViewDidUpdateCopyWith<$Res> {
+  _$ViewDidUpdateCopyWithImpl(
+      ViewDidUpdate _value, $Res Function(ViewDidUpdate) _then)
+      : super(_value, (v) => _then(v as ViewDidUpdate));
+
+  @override
+  ViewDidUpdate get _value => super._value as ViewDidUpdate;
+
+  @override
+  $Res call({
+    Object? result = freezed,
+  }) {
+    return _then(ViewDidUpdate(
+      result == freezed
+          ? _value.result
+          : result // ignore: cast_nullable_to_non_nullable
+              as Either<View, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$ViewDidUpdate implements ViewDidUpdate {
+  const _$ViewDidUpdate(this.result);
+
+  @override
+  final Either<View, FlowyError> result;
+
+  @override
+  String toString() {
+    return 'ViewEvent.viewDidUpdate(result: $result)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is ViewDidUpdate &&
+            (identical(other.result, result) ||
+                const DeepCollectionEquality().equals(other.result, result)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(result);
+
+  @JsonKey(ignore: true)
+  @override
+  $ViewDidUpdateCopyWith<ViewDidUpdate> get copyWith =>
+      _$ViewDidUpdateCopyWithImpl<ViewDidUpdate>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(bool isEditing) setIsEditing,
+    required TResult Function(String newName) rename,
+    required TResult Function() delete,
+    required TResult Function() duplicate,
+    required TResult Function(Either<View, FlowyError> result) viewDidUpdate,
+  }) {
+    return viewDidUpdate(result);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+  }) {
+    return viewDidUpdate?.call(result);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(bool isEditing)? setIsEditing,
+    TResult Function(String newName)? rename,
+    TResult Function()? delete,
+    TResult Function()? duplicate,
+    TResult Function(Either<View, FlowyError> result)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (viewDidUpdate != null) {
+      return viewDidUpdate(result);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(SetEditing value) setIsEditing,
+    required TResult Function(Rename value) rename,
+    required TResult Function(Delete value) delete,
+    required TResult Function(Duplicate value) duplicate,
+    required TResult Function(ViewDidUpdate value) viewDidUpdate,
+  }) {
+    return viewDidUpdate(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+  }) {
+    return viewDidUpdate?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(SetEditing value)? setIsEditing,
+    TResult Function(Rename value)? rename,
+    TResult Function(Delete value)? delete,
+    TResult Function(Duplicate value)? duplicate,
+    TResult Function(ViewDidUpdate value)? viewDidUpdate,
+    required TResult orElse(),
+  }) {
+    if (viewDidUpdate != null) {
+      return viewDidUpdate(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class ViewDidUpdate implements ViewEvent {
+  const factory ViewDidUpdate(Either<View, FlowyError> result) =
+      _$ViewDidUpdate;
+
+  Either<View, FlowyError> get result => throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $ViewDidUpdateCopyWith<ViewDidUpdate> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+class _$ViewStateTearOff {
+  const _$ViewStateTearOff();
+
+  _ViewState call(
+      {required View view,
+      required bool isEditing,
+      required Either<Unit, FlowyError> successOrFailure}) {
+    return _ViewState(
+      view: view,
+      isEditing: isEditing,
+      successOrFailure: successOrFailure,
+    );
+  }
+}
+
+/// @nodoc
+const $ViewState = _$ViewStateTearOff();
+
+/// @nodoc
+mixin _$ViewState {
+  View get view => throw _privateConstructorUsedError;
+  bool get isEditing => throw _privateConstructorUsedError;
+  Either<Unit, FlowyError> get successOrFailure =>
+      throw _privateConstructorUsedError;
+
+  @JsonKey(ignore: true)
+  $ViewStateCopyWith<ViewState> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $ViewStateCopyWith<$Res> {
+  factory $ViewStateCopyWith(ViewState value, $Res Function(ViewState) then) =
+      _$ViewStateCopyWithImpl<$Res>;
+  $Res call(
+      {View view, bool isEditing, Either<Unit, FlowyError> successOrFailure});
+}
+
+/// @nodoc
+class _$ViewStateCopyWithImpl<$Res> implements $ViewStateCopyWith<$Res> {
+  _$ViewStateCopyWithImpl(this._value, this._then);
+
+  final ViewState _value;
+  // ignore: unused_field
+  final $Res Function(ViewState) _then;
+
+  @override
+  $Res call({
+    Object? view = freezed,
+    Object? isEditing = freezed,
+    Object? successOrFailure = freezed,
+  }) {
+    return _then(_value.copyWith(
+      view: view == freezed
+          ? _value.view
+          : view // ignore: cast_nullable_to_non_nullable
+              as View,
+      isEditing: isEditing == freezed
+          ? _value.isEditing
+          : isEditing // ignore: cast_nullable_to_non_nullable
+              as bool,
+      successOrFailure: successOrFailure == freezed
+          ? _value.successOrFailure
+          : successOrFailure // ignore: cast_nullable_to_non_nullable
+              as Either<Unit, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+abstract class _$ViewStateCopyWith<$Res> implements $ViewStateCopyWith<$Res> {
+  factory _$ViewStateCopyWith(
+          _ViewState value, $Res Function(_ViewState) then) =
+      __$ViewStateCopyWithImpl<$Res>;
+  @override
+  $Res call(
+      {View view, bool isEditing, Either<Unit, FlowyError> successOrFailure});
+}
+
+/// @nodoc
+class __$ViewStateCopyWithImpl<$Res> extends _$ViewStateCopyWithImpl<$Res>
+    implements _$ViewStateCopyWith<$Res> {
+  __$ViewStateCopyWithImpl(_ViewState _value, $Res Function(_ViewState) _then)
+      : super(_value, (v) => _then(v as _ViewState));
+
+  @override
+  _ViewState get _value => super._value as _ViewState;
+
+  @override
+  $Res call({
+    Object? view = freezed,
+    Object? isEditing = freezed,
+    Object? successOrFailure = freezed,
+  }) {
+    return _then(_ViewState(
+      view: view == freezed
+          ? _value.view
+          : view // ignore: cast_nullable_to_non_nullable
+              as View,
+      isEditing: isEditing == freezed
+          ? _value.isEditing
+          : isEditing // ignore: cast_nullable_to_non_nullable
+              as bool,
+      successOrFailure: successOrFailure == freezed
+          ? _value.successOrFailure
+          : successOrFailure // ignore: cast_nullable_to_non_nullable
+              as Either<Unit, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$_ViewState implements _ViewState {
+  const _$_ViewState(
+      {required this.view,
+      required this.isEditing,
+      required this.successOrFailure});
+
+  @override
+  final View view;
+  @override
+  final bool isEditing;
+  @override
+  final Either<Unit, FlowyError> successOrFailure;
+
+  @override
+  String toString() {
+    return 'ViewState(view: $view, isEditing: $isEditing, successOrFailure: $successOrFailure)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is _ViewState &&
+            (identical(other.view, view) ||
+                const DeepCollectionEquality().equals(other.view, view)) &&
+            (identical(other.isEditing, isEditing) ||
+                const DeepCollectionEquality()
+                    .equals(other.isEditing, isEditing)) &&
+            (identical(other.successOrFailure, successOrFailure) ||
+                const DeepCollectionEquality()
+                    .equals(other.successOrFailure, successOrFailure)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^
+      const DeepCollectionEquality().hash(view) ^
+      const DeepCollectionEquality().hash(isEditing) ^
+      const DeepCollectionEquality().hash(successOrFailure);
+
+  @JsonKey(ignore: true)
+  @override
+  _$ViewStateCopyWith<_ViewState> get copyWith =>
+      __$ViewStateCopyWithImpl<_ViewState>(this, _$identity);
+}
+
+abstract class _ViewState implements ViewState {
+  const factory _ViewState(
+      {required View view,
+      required bool isEditing,
+      required Either<Unit, FlowyError> successOrFailure}) = _$_ViewState;
+
+  @override
+  View get view => throw _privateConstructorUsedError;
+  @override
+  bool get isEditing => throw _privateConstructorUsedError;
+  @override
+  Either<Unit, FlowyError> get successOrFailure =>
+      throw _privateConstructorUsedError;
+  @override
+  @JsonKey(ignore: true)
+  _$ViewStateCopyWith<_ViewState> get copyWith =>
+      throw _privateConstructorUsedError;
+}

+ 890 - 0
frontend/app_flowy/lib/workspace/application/workspace/welcome_bloc.freezed.dart

@@ -0,0 +1,890 @@
+// coverage:ignore-file
+// GENERATED CODE - DO NOT MODIFY BY HAND
+// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target
+
+part of 'welcome_bloc.dart';
+
+// **************************************************************************
+// FreezedGenerator
+// **************************************************************************
+
+T _$identity<T>(T value) => value;
+
+final _privateConstructorUsedError = UnsupportedError(
+    'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more informations: https://github.com/rrousselGit/freezed#custom-getters-and-methods');
+
+/// @nodoc
+class _$WelcomeEventTearOff {
+  const _$WelcomeEventTearOff();
+
+  Initial initial() {
+    return const Initial();
+  }
+
+  CreateWorkspace createWorkspace(String name, String desc) {
+    return CreateWorkspace(
+      name,
+      desc,
+    );
+  }
+
+  OpenWorkspace openWorkspace(Workspace workspace) {
+    return OpenWorkspace(
+      workspace,
+    );
+  }
+
+  WorkspacesReceived workspacesReveived(
+      Either<List<Workspace>, FlowyError> workspacesOrFail) {
+    return WorkspacesReceived(
+      workspacesOrFail,
+    );
+  }
+}
+
+/// @nodoc
+const $WelcomeEvent = _$WelcomeEventTearOff();
+
+/// @nodoc
+mixin _$WelcomeEvent {
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(String name, String desc) createWorkspace,
+    required TResult Function(Workspace workspace) openWorkspace,
+    required TResult Function(
+            Either<List<Workspace>, FlowyError> workspacesOrFail)
+        workspacesReveived,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(CreateWorkspace value) createWorkspace,
+    required TResult Function(OpenWorkspace value) openWorkspace,
+    required TResult Function(WorkspacesReceived value) workspacesReveived,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+  }) =>
+      throw _privateConstructorUsedError;
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+    required TResult orElse(),
+  }) =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $WelcomeEventCopyWith<$Res> {
+  factory $WelcomeEventCopyWith(
+          WelcomeEvent value, $Res Function(WelcomeEvent) then) =
+      _$WelcomeEventCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$WelcomeEventCopyWithImpl<$Res> implements $WelcomeEventCopyWith<$Res> {
+  _$WelcomeEventCopyWithImpl(this._value, this._then);
+
+  final WelcomeEvent _value;
+  // ignore: unused_field
+  final $Res Function(WelcomeEvent) _then;
+}
+
+/// @nodoc
+abstract class $InitialCopyWith<$Res> {
+  factory $InitialCopyWith(Initial value, $Res Function(Initial) then) =
+      _$InitialCopyWithImpl<$Res>;
+}
+
+/// @nodoc
+class _$InitialCopyWithImpl<$Res> extends _$WelcomeEventCopyWithImpl<$Res>
+    implements $InitialCopyWith<$Res> {
+  _$InitialCopyWithImpl(Initial _value, $Res Function(Initial) _then)
+      : super(_value, (v) => _then(v as Initial));
+
+  @override
+  Initial get _value => super._value as Initial;
+}
+
+/// @nodoc
+
+class _$Initial implements Initial {
+  const _$Initial();
+
+  @override
+  String toString() {
+    return 'WelcomeEvent.initial()';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) || (other is Initial);
+  }
+
+  @override
+  int get hashCode => runtimeType.hashCode;
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(String name, String desc) createWorkspace,
+    required TResult Function(Workspace workspace) openWorkspace,
+    required TResult Function(
+            Either<List<Workspace>, FlowyError> workspacesOrFail)
+        workspacesReveived,
+  }) {
+    return initial();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+  }) {
+    return initial?.call();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial();
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(CreateWorkspace value) createWorkspace,
+    required TResult Function(OpenWorkspace value) openWorkspace,
+    required TResult Function(WorkspacesReceived value) workspacesReveived,
+  }) {
+    return initial(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+  }) {
+    return initial?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+    required TResult orElse(),
+  }) {
+    if (initial != null) {
+      return initial(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class Initial implements WelcomeEvent {
+  const factory Initial() = _$Initial;
+}
+
+/// @nodoc
+abstract class $CreateWorkspaceCopyWith<$Res> {
+  factory $CreateWorkspaceCopyWith(
+          CreateWorkspace value, $Res Function(CreateWorkspace) then) =
+      _$CreateWorkspaceCopyWithImpl<$Res>;
+  $Res call({String name, String desc});
+}
+
+/// @nodoc
+class _$CreateWorkspaceCopyWithImpl<$Res>
+    extends _$WelcomeEventCopyWithImpl<$Res>
+    implements $CreateWorkspaceCopyWith<$Res> {
+  _$CreateWorkspaceCopyWithImpl(
+      CreateWorkspace _value, $Res Function(CreateWorkspace) _then)
+      : super(_value, (v) => _then(v as CreateWorkspace));
+
+  @override
+  CreateWorkspace get _value => super._value as CreateWorkspace;
+
+  @override
+  $Res call({
+    Object? name = freezed,
+    Object? desc = freezed,
+  }) {
+    return _then(CreateWorkspace(
+      name == freezed
+          ? _value.name
+          : name // ignore: cast_nullable_to_non_nullable
+              as String,
+      desc == freezed
+          ? _value.desc
+          : desc // ignore: cast_nullable_to_non_nullable
+              as String,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$CreateWorkspace implements CreateWorkspace {
+  const _$CreateWorkspace(this.name, this.desc);
+
+  @override
+  final String name;
+  @override
+  final String desc;
+
+  @override
+  String toString() {
+    return 'WelcomeEvent.createWorkspace(name: $name, desc: $desc)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is CreateWorkspace &&
+            (identical(other.name, name) ||
+                const DeepCollectionEquality().equals(other.name, name)) &&
+            (identical(other.desc, desc) ||
+                const DeepCollectionEquality().equals(other.desc, desc)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^
+      const DeepCollectionEquality().hash(name) ^
+      const DeepCollectionEquality().hash(desc);
+
+  @JsonKey(ignore: true)
+  @override
+  $CreateWorkspaceCopyWith<CreateWorkspace> get copyWith =>
+      _$CreateWorkspaceCopyWithImpl<CreateWorkspace>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(String name, String desc) createWorkspace,
+    required TResult Function(Workspace workspace) openWorkspace,
+    required TResult Function(
+            Either<List<Workspace>, FlowyError> workspacesOrFail)
+        workspacesReveived,
+  }) {
+    return createWorkspace(name, desc);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+  }) {
+    return createWorkspace?.call(name, desc);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+    required TResult orElse(),
+  }) {
+    if (createWorkspace != null) {
+      return createWorkspace(name, desc);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(CreateWorkspace value) createWorkspace,
+    required TResult Function(OpenWorkspace value) openWorkspace,
+    required TResult Function(WorkspacesReceived value) workspacesReveived,
+  }) {
+    return createWorkspace(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+  }) {
+    return createWorkspace?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+    required TResult orElse(),
+  }) {
+    if (createWorkspace != null) {
+      return createWorkspace(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class CreateWorkspace implements WelcomeEvent {
+  const factory CreateWorkspace(String name, String desc) = _$CreateWorkspace;
+
+  String get name => throw _privateConstructorUsedError;
+  String get desc => throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $CreateWorkspaceCopyWith<CreateWorkspace> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $OpenWorkspaceCopyWith<$Res> {
+  factory $OpenWorkspaceCopyWith(
+          OpenWorkspace value, $Res Function(OpenWorkspace) then) =
+      _$OpenWorkspaceCopyWithImpl<$Res>;
+  $Res call({Workspace workspace});
+}
+
+/// @nodoc
+class _$OpenWorkspaceCopyWithImpl<$Res> extends _$WelcomeEventCopyWithImpl<$Res>
+    implements $OpenWorkspaceCopyWith<$Res> {
+  _$OpenWorkspaceCopyWithImpl(
+      OpenWorkspace _value, $Res Function(OpenWorkspace) _then)
+      : super(_value, (v) => _then(v as OpenWorkspace));
+
+  @override
+  OpenWorkspace get _value => super._value as OpenWorkspace;
+
+  @override
+  $Res call({
+    Object? workspace = freezed,
+  }) {
+    return _then(OpenWorkspace(
+      workspace == freezed
+          ? _value.workspace
+          : workspace // ignore: cast_nullable_to_non_nullable
+              as Workspace,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$OpenWorkspace implements OpenWorkspace {
+  const _$OpenWorkspace(this.workspace);
+
+  @override
+  final Workspace workspace;
+
+  @override
+  String toString() {
+    return 'WelcomeEvent.openWorkspace(workspace: $workspace)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is OpenWorkspace &&
+            (identical(other.workspace, workspace) ||
+                const DeepCollectionEquality()
+                    .equals(other.workspace, workspace)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^ const DeepCollectionEquality().hash(workspace);
+
+  @JsonKey(ignore: true)
+  @override
+  $OpenWorkspaceCopyWith<OpenWorkspace> get copyWith =>
+      _$OpenWorkspaceCopyWithImpl<OpenWorkspace>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(String name, String desc) createWorkspace,
+    required TResult Function(Workspace workspace) openWorkspace,
+    required TResult Function(
+            Either<List<Workspace>, FlowyError> workspacesOrFail)
+        workspacesReveived,
+  }) {
+    return openWorkspace(workspace);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+  }) {
+    return openWorkspace?.call(workspace);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+    required TResult orElse(),
+  }) {
+    if (openWorkspace != null) {
+      return openWorkspace(workspace);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(CreateWorkspace value) createWorkspace,
+    required TResult Function(OpenWorkspace value) openWorkspace,
+    required TResult Function(WorkspacesReceived value) workspacesReveived,
+  }) {
+    return openWorkspace(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+  }) {
+    return openWorkspace?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+    required TResult orElse(),
+  }) {
+    if (openWorkspace != null) {
+      return openWorkspace(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class OpenWorkspace implements WelcomeEvent {
+  const factory OpenWorkspace(Workspace workspace) = _$OpenWorkspace;
+
+  Workspace get workspace => throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $OpenWorkspaceCopyWith<OpenWorkspace> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $WorkspacesReceivedCopyWith<$Res> {
+  factory $WorkspacesReceivedCopyWith(
+          WorkspacesReceived value, $Res Function(WorkspacesReceived) then) =
+      _$WorkspacesReceivedCopyWithImpl<$Res>;
+  $Res call({Either<List<Workspace>, FlowyError> workspacesOrFail});
+}
+
+/// @nodoc
+class _$WorkspacesReceivedCopyWithImpl<$Res>
+    extends _$WelcomeEventCopyWithImpl<$Res>
+    implements $WorkspacesReceivedCopyWith<$Res> {
+  _$WorkspacesReceivedCopyWithImpl(
+      WorkspacesReceived _value, $Res Function(WorkspacesReceived) _then)
+      : super(_value, (v) => _then(v as WorkspacesReceived));
+
+  @override
+  WorkspacesReceived get _value => super._value as WorkspacesReceived;
+
+  @override
+  $Res call({
+    Object? workspacesOrFail = freezed,
+  }) {
+    return _then(WorkspacesReceived(
+      workspacesOrFail == freezed
+          ? _value.workspacesOrFail
+          : workspacesOrFail // ignore: cast_nullable_to_non_nullable
+              as Either<List<Workspace>, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$WorkspacesReceived implements WorkspacesReceived {
+  const _$WorkspacesReceived(this.workspacesOrFail);
+
+  @override
+  final Either<List<Workspace>, FlowyError> workspacesOrFail;
+
+  @override
+  String toString() {
+    return 'WelcomeEvent.workspacesReveived(workspacesOrFail: $workspacesOrFail)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is WorkspacesReceived &&
+            (identical(other.workspacesOrFail, workspacesOrFail) ||
+                const DeepCollectionEquality()
+                    .equals(other.workspacesOrFail, workspacesOrFail)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^
+      const DeepCollectionEquality().hash(workspacesOrFail);
+
+  @JsonKey(ignore: true)
+  @override
+  $WorkspacesReceivedCopyWith<WorkspacesReceived> get copyWith =>
+      _$WorkspacesReceivedCopyWithImpl<WorkspacesReceived>(this, _$identity);
+
+  @override
+  @optionalTypeArgs
+  TResult when<TResult extends Object?>({
+    required TResult Function() initial,
+    required TResult Function(String name, String desc) createWorkspace,
+    required TResult Function(Workspace workspace) openWorkspace,
+    required TResult Function(
+            Either<List<Workspace>, FlowyError> workspacesOrFail)
+        workspacesReveived,
+  }) {
+    return workspacesReveived(workspacesOrFail);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? whenOrNull<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+  }) {
+    return workspacesReveived?.call(workspacesOrFail);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeWhen<TResult extends Object?>({
+    TResult Function()? initial,
+    TResult Function(String name, String desc)? createWorkspace,
+    TResult Function(Workspace workspace)? openWorkspace,
+    TResult Function(Either<List<Workspace>, FlowyError> workspacesOrFail)?
+        workspacesReveived,
+    required TResult orElse(),
+  }) {
+    if (workspacesReveived != null) {
+      return workspacesReveived(workspacesOrFail);
+    }
+    return orElse();
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult map<TResult extends Object?>({
+    required TResult Function(Initial value) initial,
+    required TResult Function(CreateWorkspace value) createWorkspace,
+    required TResult Function(OpenWorkspace value) openWorkspace,
+    required TResult Function(WorkspacesReceived value) workspacesReveived,
+  }) {
+    return workspacesReveived(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult? mapOrNull<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+  }) {
+    return workspacesReveived?.call(this);
+  }
+
+  @override
+  @optionalTypeArgs
+  TResult maybeMap<TResult extends Object?>({
+    TResult Function(Initial value)? initial,
+    TResult Function(CreateWorkspace value)? createWorkspace,
+    TResult Function(OpenWorkspace value)? openWorkspace,
+    TResult Function(WorkspacesReceived value)? workspacesReveived,
+    required TResult orElse(),
+  }) {
+    if (workspacesReveived != null) {
+      return workspacesReveived(this);
+    }
+    return orElse();
+  }
+}
+
+abstract class WorkspacesReceived implements WelcomeEvent {
+  const factory WorkspacesReceived(
+          Either<List<Workspace>, FlowyError> workspacesOrFail) =
+      _$WorkspacesReceived;
+
+  Either<List<Workspace>, FlowyError> get workspacesOrFail =>
+      throw _privateConstructorUsedError;
+  @JsonKey(ignore: true)
+  $WorkspacesReceivedCopyWith<WorkspacesReceived> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+class _$WelcomeStateTearOff {
+  const _$WelcomeStateTearOff();
+
+  _WelcomeState call(
+      {required bool isLoading,
+      required List<Workspace> workspaces,
+      required Either<Unit, FlowyError> successOrFailure}) {
+    return _WelcomeState(
+      isLoading: isLoading,
+      workspaces: workspaces,
+      successOrFailure: successOrFailure,
+    );
+  }
+}
+
+/// @nodoc
+const $WelcomeState = _$WelcomeStateTearOff();
+
+/// @nodoc
+mixin _$WelcomeState {
+  bool get isLoading => throw _privateConstructorUsedError;
+  List<Workspace> get workspaces => throw _privateConstructorUsedError;
+  Either<Unit, FlowyError> get successOrFailure =>
+      throw _privateConstructorUsedError;
+
+  @JsonKey(ignore: true)
+  $WelcomeStateCopyWith<WelcomeState> get copyWith =>
+      throw _privateConstructorUsedError;
+}
+
+/// @nodoc
+abstract class $WelcomeStateCopyWith<$Res> {
+  factory $WelcomeStateCopyWith(
+          WelcomeState value, $Res Function(WelcomeState) then) =
+      _$WelcomeStateCopyWithImpl<$Res>;
+  $Res call(
+      {bool isLoading,
+      List<Workspace> workspaces,
+      Either<Unit, FlowyError> successOrFailure});
+}
+
+/// @nodoc
+class _$WelcomeStateCopyWithImpl<$Res> implements $WelcomeStateCopyWith<$Res> {
+  _$WelcomeStateCopyWithImpl(this._value, this._then);
+
+  final WelcomeState _value;
+  // ignore: unused_field
+  final $Res Function(WelcomeState) _then;
+
+  @override
+  $Res call({
+    Object? isLoading = freezed,
+    Object? workspaces = freezed,
+    Object? successOrFailure = freezed,
+  }) {
+    return _then(_value.copyWith(
+      isLoading: isLoading == freezed
+          ? _value.isLoading
+          : isLoading // ignore: cast_nullable_to_non_nullable
+              as bool,
+      workspaces: workspaces == freezed
+          ? _value.workspaces
+          : workspaces // ignore: cast_nullable_to_non_nullable
+              as List<Workspace>,
+      successOrFailure: successOrFailure == freezed
+          ? _value.successOrFailure
+          : successOrFailure // ignore: cast_nullable_to_non_nullable
+              as Either<Unit, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+abstract class _$WelcomeStateCopyWith<$Res>
+    implements $WelcomeStateCopyWith<$Res> {
+  factory _$WelcomeStateCopyWith(
+          _WelcomeState value, $Res Function(_WelcomeState) then) =
+      __$WelcomeStateCopyWithImpl<$Res>;
+  @override
+  $Res call(
+      {bool isLoading,
+      List<Workspace> workspaces,
+      Either<Unit, FlowyError> successOrFailure});
+}
+
+/// @nodoc
+class __$WelcomeStateCopyWithImpl<$Res> extends _$WelcomeStateCopyWithImpl<$Res>
+    implements _$WelcomeStateCopyWith<$Res> {
+  __$WelcomeStateCopyWithImpl(
+      _WelcomeState _value, $Res Function(_WelcomeState) _then)
+      : super(_value, (v) => _then(v as _WelcomeState));
+
+  @override
+  _WelcomeState get _value => super._value as _WelcomeState;
+
+  @override
+  $Res call({
+    Object? isLoading = freezed,
+    Object? workspaces = freezed,
+    Object? successOrFailure = freezed,
+  }) {
+    return _then(_WelcomeState(
+      isLoading: isLoading == freezed
+          ? _value.isLoading
+          : isLoading // ignore: cast_nullable_to_non_nullable
+              as bool,
+      workspaces: workspaces == freezed
+          ? _value.workspaces
+          : workspaces // ignore: cast_nullable_to_non_nullable
+              as List<Workspace>,
+      successOrFailure: successOrFailure == freezed
+          ? _value.successOrFailure
+          : successOrFailure // ignore: cast_nullable_to_non_nullable
+              as Either<Unit, FlowyError>,
+    ));
+  }
+}
+
+/// @nodoc
+
+class _$_WelcomeState implements _WelcomeState {
+  const _$_WelcomeState(
+      {required this.isLoading,
+      required this.workspaces,
+      required this.successOrFailure});
+
+  @override
+  final bool isLoading;
+  @override
+  final List<Workspace> workspaces;
+  @override
+  final Either<Unit, FlowyError> successOrFailure;
+
+  @override
+  String toString() {
+    return 'WelcomeState(isLoading: $isLoading, workspaces: $workspaces, successOrFailure: $successOrFailure)';
+  }
+
+  @override
+  bool operator ==(dynamic other) {
+    return identical(this, other) ||
+        (other is _WelcomeState &&
+            (identical(other.isLoading, isLoading) ||
+                const DeepCollectionEquality()
+                    .equals(other.isLoading, isLoading)) &&
+            (identical(other.workspaces, workspaces) ||
+                const DeepCollectionEquality()
+                    .equals(other.workspaces, workspaces)) &&
+            (identical(other.successOrFailure, successOrFailure) ||
+                const DeepCollectionEquality()
+                    .equals(other.successOrFailure, successOrFailure)));
+  }
+
+  @override
+  int get hashCode =>
+      runtimeType.hashCode ^
+      const DeepCollectionEquality().hash(isLoading) ^
+      const DeepCollectionEquality().hash(workspaces) ^
+      const DeepCollectionEquality().hash(successOrFailure);
+
+  @JsonKey(ignore: true)
+  @override
+  _$WelcomeStateCopyWith<_WelcomeState> get copyWith =>
+      __$WelcomeStateCopyWithImpl<_WelcomeState>(this, _$identity);
+}
+
+abstract class _WelcomeState implements WelcomeState {
+  const factory _WelcomeState(
+      {required bool isLoading,
+      required List<Workspace> workspaces,
+      required Either<Unit, FlowyError> successOrFailure}) = _$_WelcomeState;
+
+  @override
+  bool get isLoading => throw _privateConstructorUsedError;
+  @override
+  List<Workspace> get workspaces => throw _privateConstructorUsedError;
+  @override
+  Either<Unit, FlowyError> get successOrFailure =>
+      throw _privateConstructorUsedError;
+  @override
+  @JsonKey(ignore: true)
+  _$WelcomeStateCopyWith<_WelcomeState> get copyWith =>
+      throw _privateConstructorUsedError;
+}

+ 4 - 4
frontend/app_flowy/lib/workspace/infrastructure/deps_resolver.dart

@@ -9,7 +9,7 @@ import 'package:app_flowy/workspace/application/view/view_bloc.dart';
 import 'package:app_flowy/workspace/application/workspace/welcome_bloc.dart';
 import 'package:app_flowy/workspace/domain/page_stack/page_stack.dart';
 import 'package:app_flowy/workspace/infrastructure/repos/app_repo.dart';
-import 'package:app_flowy/workspace/infrastructure/repos/doc_repo.dart';
+import 'package:app_flowy/workspace/infrastructure/repos/document_repo.dart';
 import 'package:app_flowy/workspace/infrastructure/repos/trash_repo.dart';
 import 'package:app_flowy/workspace/infrastructure/repos/user_repo.dart';
 import 'package:app_flowy/workspace/infrastructure/repos/view_repo.dart';
@@ -80,10 +80,10 @@ class HomeDepsResolver {
     );
 
     // Doc
-    getIt.registerFactoryParam<DocBloc, View, void>(
-      (view, _) => DocBloc(
+    getIt.registerFactoryParam<DocumentBloc, View, void>(
+      (view, _) => DocumentBloc(
         view: view,
-        repo: DocRepository(docId: view.id),
+        repo: DocumentRepository(docId: view.id),
         listener: getIt<ViewListener>(param1: view),
         trashRepo: getIt<TrashRepo>(),
       ),

+ 5 - 5
frontend/app_flowy/lib/workspace/infrastructure/repos/app_repo.dart

@@ -18,7 +18,7 @@ class AppRepository {
   });
 
   Future<Either<App, FlowyError>> getAppDesc() {
-    final request = QueryAppRequest.create()..appIds.add(appId);
+    final request = AppId.create()..value = appId;
 
     return FolderEventReadApp(request).send();
   }
@@ -28,7 +28,7 @@ class AppRepository {
     required String desc,
     required ViewType viewType,
   }) {
-    final request = CreateViewRequest.create()
+    final request = CreateViewPayload.create()
       ..belongToId = appId
       ..name = name
       ..desc = desc
@@ -38,7 +38,7 @@ class AppRepository {
   }
 
   Future<Either<List<View>, FlowyError>> getViews() {
-    final request = QueryAppRequest.create()..appIds.add(appId);
+    final request = AppId.create()..value = appId;
 
     return FolderEventReadApp(request).send().then((result) {
       return result.fold(
@@ -49,12 +49,12 @@ class AppRepository {
   }
 
   Future<Either<Unit, FlowyError>> delete() {
-    final request = QueryAppRequest.create()..appIds.add(appId);
+    final request = AppId.create()..value = appId;
     return FolderEventDeleteApp(request).send();
   }
 
   Future<Either<Unit, FlowyError>> updateApp({String? name}) {
-    UpdateAppRequest request = UpdateAppRequest.create()..appId = appId;
+    UpdateAppPayload request = UpdateAppPayload.create()..appId = appId;
 
     if (name != null) {
       request.name = name;

+ 7 - 7
frontend/app_flowy/lib/workspace/infrastructure/repos/doc_repo.dart → frontend/app_flowy/lib/workspace/infrastructure/repos/document_repo.dart

@@ -4,15 +4,15 @@ import 'package:flowy_sdk/protobuf/flowy-collaboration/document_info.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-folder-data-model/view.pb.dart';
 import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
 
-class DocRepository {
+class DocumentRepository {
   final String docId;
-  DocRepository({
+  DocumentRepository({
     required this.docId,
   });
 
-  Future<Either<DocumentDelta, FlowyError>> readDoc() {
-    final request = QueryViewRequest(viewIds: [docId]);
-    return FolderEventOpenDocument(request).send();
+  Future<Either<DocumentDelta, FlowyError>> openDocument() {
+    final request = ViewId(value: docId);
+    return FolderEventOpenView(request).send();
   }
 
   Future<Either<DocumentDelta, FlowyError>> composeDelta({required String data}) {
@@ -22,8 +22,8 @@ class DocRepository {
     return FolderEventApplyDocDelta(request).send();
   }
 
-  Future<Either<Unit, FlowyError>> closeDoc() {
-    final request = QueryViewRequest(viewIds: [docId]);
+  Future<Either<Unit, FlowyError>> closeDocument() {
+    final request = ViewId(value: docId);
     return FolderEventCloseView(request).send();
   }
 }

+ 1 - 1
frontend/app_flowy/lib/workspace/infrastructure/repos/share_repo.dart

@@ -6,7 +6,7 @@ import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
 
 class ShareRepo {
   Future<Either<ExportData, FlowyError>> export(String docId, ExportType type) {
-    final request = ExportRequest.create()
+    final request = ExportPayload.create()
       ..docId = docId
       ..exportType = type;
 

+ 3 - 3
frontend/app_flowy/lib/workspace/infrastructure/repos/user_repo.dart

@@ -37,7 +37,7 @@ class UserRepo {
   }
 
   Future<Either<List<Workspace>, FlowyError>> getWorkspaces() {
-    final request = QueryWorkspaceRequest.create();
+    final request = WorkspaceId.create();
 
     return FolderEventReadWorkspaces(request).send().then((result) {
       return result.fold(
@@ -48,7 +48,7 @@ class UserRepo {
   }
 
   Future<Either<Workspace, FlowyError>> openWorkspace(String workspaceId) {
-    final request = QueryWorkspaceRequest.create()..workspaceId = workspaceId;
+    final request = WorkspaceId.create()..value = workspaceId;
     return FolderEventOpenWorkspace(request).send().then((result) {
       return result.fold(
         (workspace) => left(workspace),
@@ -58,7 +58,7 @@ class UserRepo {
   }
 
   Future<Either<Workspace, FlowyError>> createWorkspace(String name, String desc) {
-    final request = CreateWorkspaceRequest.create()
+    final request = CreateWorkspacePayload.create()
       ..name = name
       ..desc = desc;
     return FolderEventCreateWorkspace(request).send().then((result) {

+ 4 - 4
frontend/app_flowy/lib/workspace/infrastructure/repos/view_repo.dart

@@ -18,12 +18,12 @@ class ViewRepository {
   });
 
   Future<Either<View, FlowyError>> readView() {
-    final request = QueryViewRequest(viewIds: [view.id]);
+    final request = ViewId(value: view.id);
     return FolderEventReadView(request).send();
   }
 
   Future<Either<View, FlowyError>> updateView({String? name, String? desc}) {
-    final request = UpdateViewRequest.create()..viewId = view.id;
+    final request = UpdateViewPayload.create()..viewId = view.id;
 
     if (name != null) {
       request.name = name;
@@ -37,12 +37,12 @@ class ViewRepository {
   }
 
   Future<Either<Unit, FlowyError>> delete() {
-    final request = QueryViewRequest.create()..viewIds.add(view.id);
+    final request = RepeatedViewId.create()..items.add(view.id);
     return FolderEventDeleteView(request).send();
   }
 
   Future<Either<Unit, FlowyError>> duplicate() {
-    final request = QueryViewRequest.create()..viewIds.add(view.id);
+    final request = ViewId(value: view.id);
     return FolderEventDuplicateView(request).send();
   }
 }

+ 3 - 3
frontend/app_flowy/lib/workspace/infrastructure/repos/workspace_repo.dart

@@ -25,7 +25,7 @@ class WorkspaceRepo {
   });
 
   Future<Either<App, FlowyError>> createApp(String name, String desc) {
-    final request = CreateAppRequest.create()
+    final request = CreateAppPayload.create()
       ..name = name
       ..workspaceId = workspaceId
       ..desc = desc;
@@ -33,7 +33,7 @@ class WorkspaceRepo {
   }
 
   Future<Either<Workspace, FlowyError>> getWorkspace() {
-    final request = QueryWorkspaceRequest.create()..workspaceId = workspaceId;
+    final request = WorkspaceId.create()..value = workspaceId;
     return FolderEventReadWorkspaces(request).send().then((result) {
       return result.fold(
         (workspaces) {
@@ -51,7 +51,7 @@ class WorkspaceRepo {
   }
 
   Future<Either<List<App>, FlowyError>> getApps() {
-    final request = QueryWorkspaceRequest.create()..workspaceId = workspaceId;
+    final request = WorkspaceId.create()..value = workspaceId;
     return FolderEventReadWorkspaceApps(request).send().then((result) {
       return result.fold(
         (apps) => left(apps.items),

+ 2 - 2
frontend/app_flowy/lib/workspace/presentation/stack_page/doc/doc_stack_page.dart

@@ -22,7 +22,7 @@ import 'package:clipboard/clipboard.dart';
 import 'package:app_flowy/generated/locale_keys.g.dart';
 import 'package:provider/provider.dart';
 
-import 'doc_page.dart';
+import 'document_page.dart';
 
 class DocStackContext extends HomeStackContext<int, ShareActionWrapper> {
   View _view;
@@ -56,7 +56,7 @@ class DocStackContext extends HomeStackContext<int, ShareActionWrapper> {
   HomeStackType get type => _view.stackType();
 
   @override
-  Widget buildWidget() => DocPage(view: _view, key: ValueKey(_view.id));
+  Widget buildWidget() => DocumentPage(view: _view, key: ValueKey(_view.id));
 
   @override
   List<NavigationItem> get navigationItems => _makeNavigationItems();

+ 16 - 16
frontend/app_flowy/lib/workspace/presentation/stack_page/doc/doc_page.dart → frontend/app_flowy/lib/workspace/presentation/stack_page/doc/document_page.dart

@@ -14,23 +14,23 @@ import 'styles.dart';
 import 'widget/banner.dart';
 import 'widget/toolbar/tool_bar.dart';
 
-class DocPage extends StatefulWidget {
+class DocumentPage extends StatefulWidget {
   final View view;
 
-  DocPage({Key? key, required this.view}) : super(key: ValueKey(view.id));
+  DocumentPage({Key? key, required this.view}) : super(key: ValueKey(view.id));
 
   @override
-  State<DocPage> createState() => _DocPageState();
+  State<DocumentPage> createState() => _DocumentPageState();
 }
 
-class _DocPageState extends State<DocPage> {
-  late DocBloc docBloc;
+class _DocumentPageState extends State<DocumentPage> {
+  late DocumentBloc documentBloc;
   final scrollController = ScrollController();
   final FocusNode _focusNode = FocusNode();
 
   @override
   void initState() {
-    docBloc = getIt<DocBloc>(param1: super.widget.view)..add(const DocEvent.initial());
+    documentBloc = getIt<DocumentBloc>(param1: super.widget.view)..add(const DocumentEvent.initial());
     super.initState();
   }
 
@@ -38,10 +38,10 @@ class _DocPageState extends State<DocPage> {
   Widget build(BuildContext context) {
     return MultiBlocProvider(
       providers: [
-        BlocProvider<DocBloc>.value(value: docBloc),
+        BlocProvider<DocumentBloc>.value(value: documentBloc),
       ],
-      child: BlocBuilder<DocBloc, DocState>(builder: (context, state) {
-        return state.loadState.map(
+      child: BlocBuilder<DocumentBloc, DocumentState>(builder: (context, state) {
+        return state.loadingState.map(
           // loading: (_) => const FlowyProgressIndicator(),
           loading: (_) => SizedBox.expand(child: Container(color: Colors.transparent)),
           finish: (result) => result.successOrFail.fold(
@@ -49,7 +49,7 @@ class _DocPageState extends State<DocPage> {
               if (state.forceClose) {
                 return _renderAppPage();
               } else {
-                return _renderDoc(context, state);
+                return _renderDocument(context, state);
               }
             },
             (err) => FlowyErrorPage(err.toString()),
@@ -61,13 +61,13 @@ class _DocPageState extends State<DocPage> {
 
   @override
   Future<void> dispose() async {
-    docBloc.close();
+    documentBloc.close();
     super.dispose();
   }
 
-  Widget _renderDoc(BuildContext context, DocState state) {
+  Widget _renderDocument(BuildContext context, DocumentState state) {
     quill.QuillController controller = quill.QuillController(
-      document: context.read<DocBloc>().document,
+      document: context.read<DocumentBloc>().document,
       selection: const TextSelection.collapsed(offset: 0),
     );
     return Column(
@@ -89,9 +89,9 @@ class _DocPageState extends State<DocPage> {
   }
 
   Widget _renderBanner(BuildContext context) {
-    return DocBanner(
-      onRestore: () => context.read<DocBloc>().add(const DocEvent.restorePage()),
-      onDelete: () => context.read<DocBloc>().add(const DocEvent.deletePermanently()),
+    return DocumentBanner(
+      onRestore: () => context.read<DocumentBloc>().add(const DocumentEvent.restorePage()),
+      onDelete: () => context.read<DocumentBloc>().add(const DocumentEvent.deletePermanently()),
     );
   }
 

+ 2 - 2
frontend/app_flowy/lib/workspace/presentation/stack_page/doc/widget/banner.dart

@@ -8,10 +8,10 @@ import 'package:flutter/material.dart';
 import 'package:provider/provider.dart';
 import 'package:app_flowy/generated/locale_keys.g.dart';
 
-class DocBanner extends StatelessWidget {
+class DocumentBanner extends StatelessWidget {
   final void Function() onRestore;
   final void Function() onDelete;
-  const DocBanner({required this.onRestore, required this.onDelete, Key? key}) : super(key: key);
+  const DocumentBanner({required this.onRestore, required this.onDelete, Key? key}) : super(key: key);
 
   @override
   Widget build(BuildContext context) {

+ 20 - 20
frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-folder/dart_event.dart

@@ -2,7 +2,7 @@
 /// Auto generate. Do not edit
 part of '../../dispatch.dart';
 class FolderEventCreateWorkspace {
-     CreateWorkspaceRequest request;
+     CreateWorkspacePayload request;
      FolderEventCreateWorkspace(this.request);
 
     Future<Either<Workspace, FlowyError>> send() {
@@ -33,7 +33,7 @@ class FolderEventReadCurWorkspace {
 }
 
 class FolderEventReadWorkspaces {
-     QueryWorkspaceRequest request;
+     WorkspaceId request;
      FolderEventReadWorkspaces(this.request);
 
     Future<Either<RepeatedWorkspace, FlowyError>> send() {
@@ -50,7 +50,7 @@ class FolderEventReadWorkspaces {
 }
 
 class FolderEventDeleteWorkspace {
-     QueryWorkspaceRequest request;
+     WorkspaceId request;
      FolderEventDeleteWorkspace(this.request);
 
     Future<Either<Unit, FlowyError>> send() {
@@ -67,7 +67,7 @@ class FolderEventDeleteWorkspace {
 }
 
 class FolderEventOpenWorkspace {
-     QueryWorkspaceRequest request;
+     WorkspaceId request;
      FolderEventOpenWorkspace(this.request);
 
     Future<Either<Workspace, FlowyError>> send() {
@@ -84,7 +84,7 @@ class FolderEventOpenWorkspace {
 }
 
 class FolderEventReadWorkspaceApps {
-     QueryWorkspaceRequest request;
+     WorkspaceId request;
      FolderEventReadWorkspaceApps(this.request);
 
     Future<Either<RepeatedApp, FlowyError>> send() {
@@ -101,7 +101,7 @@ class FolderEventReadWorkspaceApps {
 }
 
 class FolderEventCreateApp {
-     CreateAppRequest request;
+     CreateAppPayload request;
      FolderEventCreateApp(this.request);
 
     Future<Either<App, FlowyError>> send() {
@@ -118,7 +118,7 @@ class FolderEventCreateApp {
 }
 
 class FolderEventDeleteApp {
-     QueryAppRequest request;
+     AppId request;
      FolderEventDeleteApp(this.request);
 
     Future<Either<Unit, FlowyError>> send() {
@@ -135,7 +135,7 @@ class FolderEventDeleteApp {
 }
 
 class FolderEventReadApp {
-     QueryAppRequest request;
+     AppId request;
      FolderEventReadApp(this.request);
 
     Future<Either<App, FlowyError>> send() {
@@ -152,7 +152,7 @@ class FolderEventReadApp {
 }
 
 class FolderEventUpdateApp {
-     UpdateAppRequest request;
+     UpdateAppPayload request;
      FolderEventUpdateApp(this.request);
 
     Future<Either<Unit, FlowyError>> send() {
@@ -169,7 +169,7 @@ class FolderEventUpdateApp {
 }
 
 class FolderEventCreateView {
-     CreateViewRequest request;
+     CreateViewPayload request;
      FolderEventCreateView(this.request);
 
     Future<Either<View, FlowyError>> send() {
@@ -186,7 +186,7 @@ class FolderEventCreateView {
 }
 
 class FolderEventReadView {
-     QueryViewRequest request;
+     ViewId request;
      FolderEventReadView(this.request);
 
     Future<Either<View, FlowyError>> send() {
@@ -203,7 +203,7 @@ class FolderEventReadView {
 }
 
 class FolderEventUpdateView {
-     UpdateViewRequest request;
+     UpdateViewPayload request;
      FolderEventUpdateView(this.request);
 
     Future<Either<View, FlowyError>> send() {
@@ -220,7 +220,7 @@ class FolderEventUpdateView {
 }
 
 class FolderEventDeleteView {
-     QueryViewRequest request;
+     RepeatedViewId request;
      FolderEventDeleteView(this.request);
 
     Future<Either<Unit, FlowyError>> send() {
@@ -237,7 +237,7 @@ class FolderEventDeleteView {
 }
 
 class FolderEventDuplicateView {
-     QueryViewRequest request;
+     ViewId request;
      FolderEventDuplicateView(this.request);
 
     Future<Either<Unit, FlowyError>> send() {
@@ -267,13 +267,13 @@ class FolderEventCopyLink {
     }
 }
 
-class FolderEventOpenDocument {
-     QueryViewRequest request;
-     FolderEventOpenDocument(this.request);
+class FolderEventOpenView {
+     ViewId request;
+     FolderEventOpenView(this.request);
 
     Future<Either<DocumentDelta, FlowyError>> send() {
     final request = FFIRequest.create()
-          ..event = FolderEvent.OpenDocument.toString()
+          ..event = FolderEvent.OpenView.toString()
           ..payload = requestToBytes(this.request);
 
     return Dispatch.asyncRequest(request)
@@ -285,7 +285,7 @@ class FolderEventOpenDocument {
 }
 
 class FolderEventCloseView {
-     QueryViewRequest request;
+     ViewId request;
      FolderEventCloseView(this.request);
 
     Future<Either<Unit, FlowyError>> send() {
@@ -395,7 +395,7 @@ class FolderEventApplyDocDelta {
 }
 
 class FolderEventExportDocument {
-     ExportRequest request;
+     ExportPayload request;
      FolderEventExportDocument(this.request);
 
     Future<Either<ExportData, FlowyError>> send() {

+ 3 - 3
frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-user/dart_event.dart

@@ -16,7 +16,7 @@ class UserEventInitUser {
 }
 
 class UserEventSignIn {
-     SignInRequest request;
+     SignInPayload request;
      UserEventSignIn(this.request);
 
     Future<Either<UserProfile, FlowyError>> send() {
@@ -33,7 +33,7 @@ class UserEventSignIn {
 }
 
 class UserEventSignUp {
-     SignUpRequest request;
+     SignUpPayload request;
      UserEventSignUp(this.request);
 
     Future<Either<UserProfile, FlowyError>> send() {
@@ -64,7 +64,7 @@ class UserEventSignOut {
 }
 
 class UserEventUpdateUser {
-     UpdateUserRequest request;
+     UpdateUserPayload request;
      UserEventUpdateUser(this.request);
 
     Future<Either<Unit, FlowyError>> send() {

+ 8 - 8
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pb.dart

@@ -365,17 +365,17 @@ class NewDocUser extends $pb.GeneratedMessage {
 
 class DocumentId extends $pb.GeneratedMessage {
   static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'DocumentId', createEmptyInstance: create)
-    ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId')
+    ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value')
     ..hasRequiredFields = false
   ;
 
   DocumentId._() : super();
   factory DocumentId({
-    $core.String? docId,
+    $core.String? value,
   }) {
     final _result = create();
-    if (docId != null) {
-      _result.docId = docId;
+    if (value != null) {
+      _result.value = value;
     }
     return _result;
   }
@@ -401,12 +401,12 @@ class DocumentId extends $pb.GeneratedMessage {
   static DocumentId? _defaultInstance;
 
   @$pb.TagNumber(1)
-  $core.String get docId => $_getSZ(0);
+  $core.String get value => $_getSZ(0);
   @$pb.TagNumber(1)
-  set docId($core.String v) { $_setString(0, v); }
+  set value($core.String v) { $_setString(0, v); }
   @$pb.TagNumber(1)
-  $core.bool hasDocId() => $_has(0);
+  $core.bool hasValue() => $_has(0);
   @$pb.TagNumber(1)
-  void clearDocId() => clearField(1);
+  void clearValue() => clearField(1);
 }
 

+ 2 - 2
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-collaboration/document_info.pbjson.dart

@@ -70,9 +70,9 @@ final $typed_data.Uint8List newDocUserDescriptor = $convert.base64Decode('CgpOZX
 const DocumentId$json = const {
   '1': 'DocumentId',
   '2': const [
-    const {'1': 'doc_id', '3': 1, '4': 1, '5': 9, '10': 'docId'},
+    const {'1': 'value', '3': 1, '4': 1, '5': 9, '10': 'value'},
   ],
 };
 
 /// Descriptor for `DocumentId`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List documentIdDescriptor = $convert.base64Decode('CgpEb2N1bWVudElkEhUKBmRvY19pZBgBIAEoCVIFZG9jSWQ=');
+final $typed_data.Uint8List documentIdDescriptor = $convert.base64Decode('CgpEb2N1bWVudElkEhQKBXZhbHVlGAEgASgJUgV2YWx1ZQ==');

+ 54 - 95
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/app.pb.dart

@@ -200,8 +200,8 @@ class RepeatedApp extends $pb.GeneratedMessage {
   $core.List<App> get items => $_getList(0);
 }
 
-class CreateAppRequest extends $pb.GeneratedMessage {
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateAppRequest', createEmptyInstance: create)
+class CreateAppPayload extends $pb.GeneratedMessage {
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateAppPayload', createEmptyInstance: create)
     ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'workspaceId')
     ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
     ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc')
@@ -209,8 +209,8 @@ class CreateAppRequest extends $pb.GeneratedMessage {
     ..hasRequiredFields = false
   ;
 
-  CreateAppRequest._() : super();
-  factory CreateAppRequest({
+  CreateAppPayload._() : super();
+  factory CreateAppPayload({
     $core.String? workspaceId,
     $core.String? name,
     $core.String? desc,
@@ -231,26 +231,26 @@ class CreateAppRequest extends $pb.GeneratedMessage {
     }
     return _result;
   }
-  factory CreateAppRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory CreateAppRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+  factory CreateAppPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+  factory CreateAppPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
   'Will be removed in next major version')
-  CreateAppRequest clone() => CreateAppRequest()..mergeFromMessage(this);
+  CreateAppPayload clone() => CreateAppPayload()..mergeFromMessage(this);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
   'Will be removed in next major version')
-  CreateAppRequest copyWith(void Function(CreateAppRequest) updates) => super.copyWith((message) => updates(message as CreateAppRequest)) as CreateAppRequest; // ignore: deprecated_member_use
+  CreateAppPayload copyWith(void Function(CreateAppPayload) updates) => super.copyWith((message) => updates(message as CreateAppPayload)) as CreateAppPayload; // ignore: deprecated_member_use
   $pb.BuilderInfo get info_ => _i;
   @$core.pragma('dart2js:noInline')
-  static CreateAppRequest create() => CreateAppRequest._();
-  CreateAppRequest createEmptyInstance() => create();
-  static $pb.PbList<CreateAppRequest> createRepeated() => $pb.PbList<CreateAppRequest>();
+  static CreateAppPayload create() => CreateAppPayload._();
+  CreateAppPayload createEmptyInstance() => create();
+  static $pb.PbList<CreateAppPayload> createRepeated() => $pb.PbList<CreateAppPayload>();
   @$core.pragma('dart2js:noInline')
-  static CreateAppRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateAppRequest>(create);
-  static CreateAppRequest? _defaultInstance;
+  static CreateAppPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateAppPayload>(create);
+  static CreateAppPayload? _defaultInstance;
 
   @$pb.TagNumber(1)
   $core.String get workspaceId => $_getSZ(0);
@@ -429,60 +429,19 @@ class CreateAppParams extends $pb.GeneratedMessage {
   ColorStyle ensureColorStyle() => $_ensure(3);
 }
 
-class QueryAppRequest extends $pb.GeneratedMessage {
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'QueryAppRequest', createEmptyInstance: create)
-    ..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'appIds')
-    ..hasRequiredFields = false
-  ;
-
-  QueryAppRequest._() : super();
-  factory QueryAppRequest({
-    $core.Iterable<$core.String>? appIds,
-  }) {
-    final _result = create();
-    if (appIds != null) {
-      _result.appIds.addAll(appIds);
-    }
-    return _result;
-  }
-  factory QueryAppRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory QueryAppRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
-  @$core.Deprecated(
-  'Using this can add significant overhead to your binary. '
-  'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
-  'Will be removed in next major version')
-  QueryAppRequest clone() => QueryAppRequest()..mergeFromMessage(this);
-  @$core.Deprecated(
-  'Using this can add significant overhead to your binary. '
-  'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
-  'Will be removed in next major version')
-  QueryAppRequest copyWith(void Function(QueryAppRequest) updates) => super.copyWith((message) => updates(message as QueryAppRequest)) as QueryAppRequest; // ignore: deprecated_member_use
-  $pb.BuilderInfo get info_ => _i;
-  @$core.pragma('dart2js:noInline')
-  static QueryAppRequest create() => QueryAppRequest._();
-  QueryAppRequest createEmptyInstance() => create();
-  static $pb.PbList<QueryAppRequest> createRepeated() => $pb.PbList<QueryAppRequest>();
-  @$core.pragma('dart2js:noInline')
-  static QueryAppRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<QueryAppRequest>(create);
-  static QueryAppRequest? _defaultInstance;
-
-  @$pb.TagNumber(1)
-  $core.List<$core.String> get appIds => $_getList(0);
-}
-
 class AppId extends $pb.GeneratedMessage {
   static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'AppId', createEmptyInstance: create)
-    ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'appId')
+    ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value')
     ..hasRequiredFields = false
   ;
 
   AppId._() : super();
   factory AppId({
-    $core.String? appId,
+    $core.String? value,
   }) {
     final _result = create();
-    if (appId != null) {
-      _result.appId = appId;
+    if (value != null) {
+      _result.value = value;
     }
     return _result;
   }
@@ -508,53 +467,53 @@ class AppId extends $pb.GeneratedMessage {
   static AppId? _defaultInstance;
 
   @$pb.TagNumber(1)
-  $core.String get appId => $_getSZ(0);
+  $core.String get value => $_getSZ(0);
   @$pb.TagNumber(1)
-  set appId($core.String v) { $_setString(0, v); }
+  set value($core.String v) { $_setString(0, v); }
   @$pb.TagNumber(1)
-  $core.bool hasAppId() => $_has(0);
+  $core.bool hasValue() => $_has(0);
   @$pb.TagNumber(1)
-  void clearAppId() => clearField(1);
+  void clearValue() => clearField(1);
 }
 
-enum UpdateAppRequest_OneOfName {
+enum UpdateAppPayload_OneOfName {
   name, 
   notSet
 }
 
-enum UpdateAppRequest_OneOfDesc {
+enum UpdateAppPayload_OneOfDesc {
   desc, 
   notSet
 }
 
-enum UpdateAppRequest_OneOfColorStyle {
+enum UpdateAppPayload_OneOfColorStyle {
   colorStyle, 
   notSet
 }
 
-enum UpdateAppRequest_OneOfIsTrash {
+enum UpdateAppPayload_OneOfIsTrash {
   isTrash, 
   notSet
 }
 
-class UpdateAppRequest extends $pb.GeneratedMessage {
-  static const $core.Map<$core.int, UpdateAppRequest_OneOfName> _UpdateAppRequest_OneOfNameByTag = {
-    2 : UpdateAppRequest_OneOfName.name,
-    0 : UpdateAppRequest_OneOfName.notSet
+class UpdateAppPayload extends $pb.GeneratedMessage {
+  static const $core.Map<$core.int, UpdateAppPayload_OneOfName> _UpdateAppPayload_OneOfNameByTag = {
+    2 : UpdateAppPayload_OneOfName.name,
+    0 : UpdateAppPayload_OneOfName.notSet
   };
-  static const $core.Map<$core.int, UpdateAppRequest_OneOfDesc> _UpdateAppRequest_OneOfDescByTag = {
-    3 : UpdateAppRequest_OneOfDesc.desc,
-    0 : UpdateAppRequest_OneOfDesc.notSet
+  static const $core.Map<$core.int, UpdateAppPayload_OneOfDesc> _UpdateAppPayload_OneOfDescByTag = {
+    3 : UpdateAppPayload_OneOfDesc.desc,
+    0 : UpdateAppPayload_OneOfDesc.notSet
   };
-  static const $core.Map<$core.int, UpdateAppRequest_OneOfColorStyle> _UpdateAppRequest_OneOfColorStyleByTag = {
-    4 : UpdateAppRequest_OneOfColorStyle.colorStyle,
-    0 : UpdateAppRequest_OneOfColorStyle.notSet
+  static const $core.Map<$core.int, UpdateAppPayload_OneOfColorStyle> _UpdateAppPayload_OneOfColorStyleByTag = {
+    4 : UpdateAppPayload_OneOfColorStyle.colorStyle,
+    0 : UpdateAppPayload_OneOfColorStyle.notSet
   };
-  static const $core.Map<$core.int, UpdateAppRequest_OneOfIsTrash> _UpdateAppRequest_OneOfIsTrashByTag = {
-    5 : UpdateAppRequest_OneOfIsTrash.isTrash,
-    0 : UpdateAppRequest_OneOfIsTrash.notSet
+  static const $core.Map<$core.int, UpdateAppPayload_OneOfIsTrash> _UpdateAppPayload_OneOfIsTrashByTag = {
+    5 : UpdateAppPayload_OneOfIsTrash.isTrash,
+    0 : UpdateAppPayload_OneOfIsTrash.notSet
   };
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateAppRequest', createEmptyInstance: create)
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateAppPayload', createEmptyInstance: create)
     ..oo(0, [2])
     ..oo(1, [3])
     ..oo(2, [4])
@@ -567,8 +526,8 @@ class UpdateAppRequest extends $pb.GeneratedMessage {
     ..hasRequiredFields = false
   ;
 
-  UpdateAppRequest._() : super();
-  factory UpdateAppRequest({
+  UpdateAppPayload._() : super();
+  factory UpdateAppPayload({
     $core.String? appId,
     $core.String? name,
     $core.String? desc,
@@ -593,37 +552,37 @@ class UpdateAppRequest extends $pb.GeneratedMessage {
     }
     return _result;
   }
-  factory UpdateAppRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory UpdateAppRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+  factory UpdateAppPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+  factory UpdateAppPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
   'Will be removed in next major version')
-  UpdateAppRequest clone() => UpdateAppRequest()..mergeFromMessage(this);
+  UpdateAppPayload clone() => UpdateAppPayload()..mergeFromMessage(this);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
   'Will be removed in next major version')
-  UpdateAppRequest copyWith(void Function(UpdateAppRequest) updates) => super.copyWith((message) => updates(message as UpdateAppRequest)) as UpdateAppRequest; // ignore: deprecated_member_use
+  UpdateAppPayload copyWith(void Function(UpdateAppPayload) updates) => super.copyWith((message) => updates(message as UpdateAppPayload)) as UpdateAppPayload; // ignore: deprecated_member_use
   $pb.BuilderInfo get info_ => _i;
   @$core.pragma('dart2js:noInline')
-  static UpdateAppRequest create() => UpdateAppRequest._();
-  UpdateAppRequest createEmptyInstance() => create();
-  static $pb.PbList<UpdateAppRequest> createRepeated() => $pb.PbList<UpdateAppRequest>();
+  static UpdateAppPayload create() => UpdateAppPayload._();
+  UpdateAppPayload createEmptyInstance() => create();
+  static $pb.PbList<UpdateAppPayload> createRepeated() => $pb.PbList<UpdateAppPayload>();
   @$core.pragma('dart2js:noInline')
-  static UpdateAppRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateAppRequest>(create);
-  static UpdateAppRequest? _defaultInstance;
+  static UpdateAppPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateAppPayload>(create);
+  static UpdateAppPayload? _defaultInstance;
 
-  UpdateAppRequest_OneOfName whichOneOfName() => _UpdateAppRequest_OneOfNameByTag[$_whichOneof(0)]!;
+  UpdateAppPayload_OneOfName whichOneOfName() => _UpdateAppPayload_OneOfNameByTag[$_whichOneof(0)]!;
   void clearOneOfName() => clearField($_whichOneof(0));
 
-  UpdateAppRequest_OneOfDesc whichOneOfDesc() => _UpdateAppRequest_OneOfDescByTag[$_whichOneof(1)]!;
+  UpdateAppPayload_OneOfDesc whichOneOfDesc() => _UpdateAppPayload_OneOfDescByTag[$_whichOneof(1)]!;
   void clearOneOfDesc() => clearField($_whichOneof(1));
 
-  UpdateAppRequest_OneOfColorStyle whichOneOfColorStyle() => _UpdateAppRequest_OneOfColorStyleByTag[$_whichOneof(2)]!;
+  UpdateAppPayload_OneOfColorStyle whichOneOfColorStyle() => _UpdateAppPayload_OneOfColorStyleByTag[$_whichOneof(2)]!;
   void clearOneOfColorStyle() => clearField($_whichOneof(2));
 
-  UpdateAppRequest_OneOfIsTrash whichOneOfIsTrash() => _UpdateAppRequest_OneOfIsTrashByTag[$_whichOneof(3)]!;
+  UpdateAppPayload_OneOfIsTrash whichOneOfIsTrash() => _UpdateAppPayload_OneOfIsTrashByTag[$_whichOneof(3)]!;
   void clearOneOfIsTrash() => clearField($_whichOneof(3));
 
   @$pb.TagNumber(1)

+ 12 - 22
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/app.pbjson.dart

@@ -35,9 +35,9 @@ const RepeatedApp$json = const {
 
 /// Descriptor for `RepeatedApp`. Decode as a `google.protobuf.DescriptorProto`.
 final $typed_data.Uint8List repeatedAppDescriptor = $convert.base64Decode('CgtSZXBlYXRlZEFwcBIaCgVpdGVtcxgBIAMoCzIELkFwcFIFaXRlbXM=');
-@$core.Deprecated('Use createAppRequestDescriptor instead')
-const CreateAppRequest$json = const {
-  '1': 'CreateAppRequest',
+@$core.Deprecated('Use createAppPayloadDescriptor instead')
+const CreateAppPayload$json = const {
+  '1': 'CreateAppPayload',
   '2': const [
     const {'1': 'workspace_id', '3': 1, '4': 1, '5': 9, '10': 'workspaceId'},
     const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
@@ -46,8 +46,8 @@ const CreateAppRequest$json = const {
   ],
 };
 
-/// Descriptor for `CreateAppRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List createAppRequestDescriptor = $convert.base64Decode('ChBDcmVhdGVBcHBSZXF1ZXN0EiEKDHdvcmtzcGFjZV9pZBgBIAEoCVILd29ya3NwYWNlSWQSEgoEbmFtZRgCIAEoCVIEbmFtZRISCgRkZXNjGAMgASgJUgRkZXNjEiwKC2NvbG9yX3N0eWxlGAQgASgLMgsuQ29sb3JTdHlsZVIKY29sb3JTdHlsZQ==');
+/// Descriptor for `CreateAppPayload`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List createAppPayloadDescriptor = $convert.base64Decode('ChBDcmVhdGVBcHBQYXlsb2FkEiEKDHdvcmtzcGFjZV9pZBgBIAEoCVILd29ya3NwYWNlSWQSEgoEbmFtZRgCIAEoCVIEbmFtZRISCgRkZXNjGAMgASgJUgRkZXNjEiwKC2NvbG9yX3N0eWxlGAQgASgLMgsuQ29sb3JTdHlsZVIKY29sb3JTdHlsZQ==');
 @$core.Deprecated('Use colorStyleDescriptor instead')
 const ColorStyle$json = const {
   '1': 'ColorStyle',
@@ -71,29 +71,19 @@ const CreateAppParams$json = const {
 
 /// Descriptor for `CreateAppParams`. Decode as a `google.protobuf.DescriptorProto`.
 final $typed_data.Uint8List createAppParamsDescriptor = $convert.base64Decode('Cg9DcmVhdGVBcHBQYXJhbXMSIQoMd29ya3NwYWNlX2lkGAEgASgJUgt3b3Jrc3BhY2VJZBISCgRuYW1lGAIgASgJUgRuYW1lEhIKBGRlc2MYAyABKAlSBGRlc2MSLAoLY29sb3Jfc3R5bGUYBCABKAsyCy5Db2xvclN0eWxlUgpjb2xvclN0eWxl');
-@$core.Deprecated('Use queryAppRequestDescriptor instead')
-const QueryAppRequest$json = const {
-  '1': 'QueryAppRequest',
-  '2': const [
-    const {'1': 'app_ids', '3': 1, '4': 3, '5': 9, '10': 'appIds'},
-  ],
-};
-
-/// Descriptor for `QueryAppRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List queryAppRequestDescriptor = $convert.base64Decode('Cg9RdWVyeUFwcFJlcXVlc3QSFwoHYXBwX2lkcxgBIAMoCVIGYXBwSWRz');
 @$core.Deprecated('Use appIdDescriptor instead')
 const AppId$json = const {
   '1': 'AppId',
   '2': const [
-    const {'1': 'app_id', '3': 1, '4': 1, '5': 9, '10': 'appId'},
+    const {'1': 'value', '3': 1, '4': 1, '5': 9, '10': 'value'},
   ],
 };
 
 /// Descriptor for `AppId`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List appIdDescriptor = $convert.base64Decode('CgVBcHBJZBIVCgZhcHBfaWQYASABKAlSBWFwcElk');
-@$core.Deprecated('Use updateAppRequestDescriptor instead')
-const UpdateAppRequest$json = const {
-  '1': 'UpdateAppRequest',
+final $typed_data.Uint8List appIdDescriptor = $convert.base64Decode('CgVBcHBJZBIUCgV2YWx1ZRgBIAEoCVIFdmFsdWU=');
+@$core.Deprecated('Use updateAppPayloadDescriptor instead')
+const UpdateAppPayload$json = const {
+  '1': 'UpdateAppPayload',
   '2': const [
     const {'1': 'app_id', '3': 1, '4': 1, '5': 9, '10': 'appId'},
     const {'1': 'name', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'name'},
@@ -109,8 +99,8 @@ const UpdateAppRequest$json = const {
   ],
 };
 
-/// Descriptor for `UpdateAppRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List updateAppRequestDescriptor = $convert.base64Decode('ChBVcGRhdGVBcHBSZXF1ZXN0EhUKBmFwcF9pZBgBIAEoCVIFYXBwSWQSFAoEbmFtZRgCIAEoCUgAUgRuYW1lEhQKBGRlc2MYAyABKAlIAVIEZGVzYxIuCgtjb2xvcl9zdHlsZRgEIAEoCzILLkNvbG9yU3R5bGVIAlIKY29sb3JTdHlsZRIbCghpc190cmFzaBgFIAEoCEgDUgdpc1RyYXNoQg0KC29uZV9vZl9uYW1lQg0KC29uZV9vZl9kZXNjQhQKEm9uZV9vZl9jb2xvcl9zdHlsZUIRCg9vbmVfb2ZfaXNfdHJhc2g=');
+/// Descriptor for `UpdateAppPayload`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List updateAppPayloadDescriptor = $convert.base64Decode('ChBVcGRhdGVBcHBQYXlsb2FkEhUKBmFwcF9pZBgBIAEoCVIFYXBwSWQSFAoEbmFtZRgCIAEoCUgAUgRuYW1lEhQKBGRlc2MYAyABKAlIAVIEZGVzYxIuCgtjb2xvcl9zdHlsZRgEIAEoCzILLkNvbG9yU3R5bGVIAlIKY29sb3JTdHlsZRIbCghpc190cmFzaBgFIAEoCEgDUgdpc1RyYXNoQg0KC29uZV9vZl9uYW1lQg0KC29uZV9vZl9kZXNjQhQKEm9uZV9vZl9jb2xvcl9zdHlsZUIRCg9vbmVfb2ZfaXNfdHJhc2g=');
 @$core.Deprecated('Use updateAppParamsDescriptor instead')
 const UpdateAppParams$json = const {
   '1': 'UpdateAppParams',

+ 13 - 13
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/share.pb.dart

@@ -13,15 +13,15 @@ import 'share.pbenum.dart';
 
 export 'share.pbenum.dart';
 
-class ExportRequest extends $pb.GeneratedMessage {
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ExportRequest', createEmptyInstance: create)
+class ExportPayload extends $pb.GeneratedMessage {
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ExportPayload', createEmptyInstance: create)
     ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'docId')
     ..e<ExportType>(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'exportType', $pb.PbFieldType.OE, defaultOrMaker: ExportType.Text, valueOf: ExportType.valueOf, enumValues: ExportType.values)
     ..hasRequiredFields = false
   ;
 
-  ExportRequest._() : super();
-  factory ExportRequest({
+  ExportPayload._() : super();
+  factory ExportPayload({
     $core.String? docId,
     ExportType? exportType,
   }) {
@@ -34,26 +34,26 @@ class ExportRequest extends $pb.GeneratedMessage {
     }
     return _result;
   }
-  factory ExportRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory ExportRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+  factory ExportPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+  factory ExportPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
   'Will be removed in next major version')
-  ExportRequest clone() => ExportRequest()..mergeFromMessage(this);
+  ExportPayload clone() => ExportPayload()..mergeFromMessage(this);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
   'Will be removed in next major version')
-  ExportRequest copyWith(void Function(ExportRequest) updates) => super.copyWith((message) => updates(message as ExportRequest)) as ExportRequest; // ignore: deprecated_member_use
+  ExportPayload copyWith(void Function(ExportPayload) updates) => super.copyWith((message) => updates(message as ExportPayload)) as ExportPayload; // ignore: deprecated_member_use
   $pb.BuilderInfo get info_ => _i;
   @$core.pragma('dart2js:noInline')
-  static ExportRequest create() => ExportRequest._();
-  ExportRequest createEmptyInstance() => create();
-  static $pb.PbList<ExportRequest> createRepeated() => $pb.PbList<ExportRequest>();
+  static ExportPayload create() => ExportPayload._();
+  ExportPayload createEmptyInstance() => create();
+  static $pb.PbList<ExportPayload> createRepeated() => $pb.PbList<ExportPayload>();
   @$core.pragma('dart2js:noInline')
-  static ExportRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ExportRequest>(create);
-  static ExportRequest? _defaultInstance;
+  static ExportPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<ExportPayload>(create);
+  static ExportPayload? _defaultInstance;
 
   @$pb.TagNumber(1)
   $core.String get docId => $_getSZ(0);

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

@@ -20,17 +20,17 @@ const ExportType$json = const {
 
 /// Descriptor for `ExportType`. Decode as a `google.protobuf.EnumDescriptorProto`.
 final $typed_data.Uint8List exportTypeDescriptor = $convert.base64Decode('CgpFeHBvcnRUeXBlEggKBFRleHQQABIMCghNYXJrZG93bhABEggKBExpbmsQAg==');
-@$core.Deprecated('Use exportRequestDescriptor instead')
-const ExportRequest$json = const {
-  '1': 'ExportRequest',
+@$core.Deprecated('Use exportPayloadDescriptor instead')
+const ExportPayload$json = const {
+  '1': 'ExportPayload',
   '2': const [
     const {'1': 'doc_id', '3': 1, '4': 1, '5': 9, '10': 'docId'},
     const {'1': 'export_type', '3': 2, '4': 1, '5': 14, '6': '.ExportType', '10': 'exportType'},
   ],
 };
 
-/// Descriptor for `ExportRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List exportRequestDescriptor = $convert.base64Decode('Cg1FeHBvcnRSZXF1ZXN0EhUKBmRvY19pZBgBIAEoCVIFZG9jSWQSLAoLZXhwb3J0X3R5cGUYAiABKA4yCy5FeHBvcnRUeXBlUgpleHBvcnRUeXBl');
+/// Descriptor for `ExportPayload`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List exportPayloadDescriptor = $convert.base64Decode('Cg1FeHBvcnRQYXlsb2FkEhUKBmRvY19pZBgBIAEoCVIFZG9jSWQSLAoLZXhwb3J0X3R5cGUYAiABKA4yCy5FeHBvcnRUeXBlUgpleHBvcnRUeXBl');
 @$core.Deprecated('Use exportDataDescriptor instead')
 const ExportData$json = const {
   '1': 'ExportData',

+ 54 - 95
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/view.pb.dart

@@ -216,17 +216,17 @@ class RepeatedView extends $pb.GeneratedMessage {
   $core.List<View> get items => $_getList(0);
 }
 
-enum CreateViewRequest_OneOfThumbnail {
+enum CreateViewPayload_OneOfThumbnail {
   thumbnail, 
   notSet
 }
 
-class CreateViewRequest extends $pb.GeneratedMessage {
-  static const $core.Map<$core.int, CreateViewRequest_OneOfThumbnail> _CreateViewRequest_OneOfThumbnailByTag = {
-    4 : CreateViewRequest_OneOfThumbnail.thumbnail,
-    0 : CreateViewRequest_OneOfThumbnail.notSet
+class CreateViewPayload extends $pb.GeneratedMessage {
+  static const $core.Map<$core.int, CreateViewPayload_OneOfThumbnail> _CreateViewPayload_OneOfThumbnailByTag = {
+    4 : CreateViewPayload_OneOfThumbnail.thumbnail,
+    0 : CreateViewPayload_OneOfThumbnail.notSet
   };
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateViewRequest', createEmptyInstance: create)
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateViewPayload', createEmptyInstance: create)
     ..oo(0, [4])
     ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'belongToId')
     ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
@@ -236,8 +236,8 @@ class CreateViewRequest extends $pb.GeneratedMessage {
     ..hasRequiredFields = false
   ;
 
-  CreateViewRequest._() : super();
-  factory CreateViewRequest({
+  CreateViewPayload._() : super();
+  factory CreateViewPayload({
     $core.String? belongToId,
     $core.String? name,
     $core.String? desc,
@@ -262,28 +262,28 @@ class CreateViewRequest extends $pb.GeneratedMessage {
     }
     return _result;
   }
-  factory CreateViewRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory CreateViewRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+  factory CreateViewPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+  factory CreateViewPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
   'Will be removed in next major version')
-  CreateViewRequest clone() => CreateViewRequest()..mergeFromMessage(this);
+  CreateViewPayload clone() => CreateViewPayload()..mergeFromMessage(this);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
   'Will be removed in next major version')
-  CreateViewRequest copyWith(void Function(CreateViewRequest) updates) => super.copyWith((message) => updates(message as CreateViewRequest)) as CreateViewRequest; // ignore: deprecated_member_use
+  CreateViewPayload copyWith(void Function(CreateViewPayload) updates) => super.copyWith((message) => updates(message as CreateViewPayload)) as CreateViewPayload; // ignore: deprecated_member_use
   $pb.BuilderInfo get info_ => _i;
   @$core.pragma('dart2js:noInline')
-  static CreateViewRequest create() => CreateViewRequest._();
-  CreateViewRequest createEmptyInstance() => create();
-  static $pb.PbList<CreateViewRequest> createRepeated() => $pb.PbList<CreateViewRequest>();
+  static CreateViewPayload create() => CreateViewPayload._();
+  CreateViewPayload createEmptyInstance() => create();
+  static $pb.PbList<CreateViewPayload> createRepeated() => $pb.PbList<CreateViewPayload>();
   @$core.pragma('dart2js:noInline')
-  static CreateViewRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateViewRequest>(create);
-  static CreateViewRequest? _defaultInstance;
+  static CreateViewPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateViewPayload>(create);
+  static CreateViewPayload? _defaultInstance;
 
-  CreateViewRequest_OneOfThumbnail whichOneOfThumbnail() => _CreateViewRequest_OneOfThumbnailByTag[$_whichOneof(0)]!;
+  CreateViewPayload_OneOfThumbnail whichOneOfThumbnail() => _CreateViewPayload_OneOfThumbnailByTag[$_whichOneof(0)]!;
   void clearOneOfThumbnail() => clearField($_whichOneof(0));
 
   @$pb.TagNumber(1)
@@ -463,60 +463,19 @@ class CreateViewParams extends $pb.GeneratedMessage {
   void clearViewId() => clearField(7);
 }
 
-class QueryViewRequest extends $pb.GeneratedMessage {
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'QueryViewRequest', createEmptyInstance: create)
-    ..pPS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewIds')
-    ..hasRequiredFields = false
-  ;
-
-  QueryViewRequest._() : super();
-  factory QueryViewRequest({
-    $core.Iterable<$core.String>? viewIds,
-  }) {
-    final _result = create();
-    if (viewIds != null) {
-      _result.viewIds.addAll(viewIds);
-    }
-    return _result;
-  }
-  factory QueryViewRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory QueryViewRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
-  @$core.Deprecated(
-  'Using this can add significant overhead to your binary. '
-  'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
-  'Will be removed in next major version')
-  QueryViewRequest clone() => QueryViewRequest()..mergeFromMessage(this);
-  @$core.Deprecated(
-  'Using this can add significant overhead to your binary. '
-  'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
-  'Will be removed in next major version')
-  QueryViewRequest copyWith(void Function(QueryViewRequest) updates) => super.copyWith((message) => updates(message as QueryViewRequest)) as QueryViewRequest; // ignore: deprecated_member_use
-  $pb.BuilderInfo get info_ => _i;
-  @$core.pragma('dart2js:noInline')
-  static QueryViewRequest create() => QueryViewRequest._();
-  QueryViewRequest createEmptyInstance() => create();
-  static $pb.PbList<QueryViewRequest> createRepeated() => $pb.PbList<QueryViewRequest>();
-  @$core.pragma('dart2js:noInline')
-  static QueryViewRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<QueryViewRequest>(create);
-  static QueryViewRequest? _defaultInstance;
-
-  @$pb.TagNumber(1)
-  $core.List<$core.String> get viewIds => $_getList(0);
-}
-
 class ViewId extends $pb.GeneratedMessage {
   static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'ViewId', createEmptyInstance: create)
-    ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'viewId')
+    ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value')
     ..hasRequiredFields = false
   ;
 
   ViewId._() : super();
   factory ViewId({
-    $core.String? viewId,
+    $core.String? value,
   }) {
     final _result = create();
-    if (viewId != null) {
-      _result.viewId = viewId;
+    if (value != null) {
+      _result.value = value;
     }
     return _result;
   }
@@ -542,13 +501,13 @@ class ViewId extends $pb.GeneratedMessage {
   static ViewId? _defaultInstance;
 
   @$pb.TagNumber(1)
-  $core.String get viewId => $_getSZ(0);
+  $core.String get value => $_getSZ(0);
   @$pb.TagNumber(1)
-  set viewId($core.String v) { $_setString(0, v); }
+  set value($core.String v) { $_setString(0, v); }
   @$pb.TagNumber(1)
-  $core.bool hasViewId() => $_has(0);
+  $core.bool hasValue() => $_has(0);
   @$pb.TagNumber(1)
-  void clearViewId() => clearField(1);
+  void clearValue() => clearField(1);
 }
 
 class RepeatedViewId extends $pb.GeneratedMessage {
@@ -592,35 +551,35 @@ class RepeatedViewId extends $pb.GeneratedMessage {
   $core.List<$core.String> get items => $_getList(0);
 }
 
-enum UpdateViewRequest_OneOfName {
+enum UpdateViewPayload_OneOfName {
   name, 
   notSet
 }
 
-enum UpdateViewRequest_OneOfDesc {
+enum UpdateViewPayload_OneOfDesc {
   desc, 
   notSet
 }
 
-enum UpdateViewRequest_OneOfThumbnail {
+enum UpdateViewPayload_OneOfThumbnail {
   thumbnail, 
   notSet
 }
 
-class UpdateViewRequest extends $pb.GeneratedMessage {
-  static const $core.Map<$core.int, UpdateViewRequest_OneOfName> _UpdateViewRequest_OneOfNameByTag = {
-    2 : UpdateViewRequest_OneOfName.name,
-    0 : UpdateViewRequest_OneOfName.notSet
+class UpdateViewPayload extends $pb.GeneratedMessage {
+  static const $core.Map<$core.int, UpdateViewPayload_OneOfName> _UpdateViewPayload_OneOfNameByTag = {
+    2 : UpdateViewPayload_OneOfName.name,
+    0 : UpdateViewPayload_OneOfName.notSet
   };
-  static const $core.Map<$core.int, UpdateViewRequest_OneOfDesc> _UpdateViewRequest_OneOfDescByTag = {
-    3 : UpdateViewRequest_OneOfDesc.desc,
-    0 : UpdateViewRequest_OneOfDesc.notSet
+  static const $core.Map<$core.int, UpdateViewPayload_OneOfDesc> _UpdateViewPayload_OneOfDescByTag = {
+    3 : UpdateViewPayload_OneOfDesc.desc,
+    0 : UpdateViewPayload_OneOfDesc.notSet
   };
-  static const $core.Map<$core.int, UpdateViewRequest_OneOfThumbnail> _UpdateViewRequest_OneOfThumbnailByTag = {
-    4 : UpdateViewRequest_OneOfThumbnail.thumbnail,
-    0 : UpdateViewRequest_OneOfThumbnail.notSet
+  static const $core.Map<$core.int, UpdateViewPayload_OneOfThumbnail> _UpdateViewPayload_OneOfThumbnailByTag = {
+    4 : UpdateViewPayload_OneOfThumbnail.thumbnail,
+    0 : UpdateViewPayload_OneOfThumbnail.notSet
   };
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateViewRequest', createEmptyInstance: create)
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateViewPayload', createEmptyInstance: create)
     ..oo(0, [2])
     ..oo(1, [3])
     ..oo(2, [4])
@@ -631,8 +590,8 @@ class UpdateViewRequest extends $pb.GeneratedMessage {
     ..hasRequiredFields = false
   ;
 
-  UpdateViewRequest._() : super();
-  factory UpdateViewRequest({
+  UpdateViewPayload._() : super();
+  factory UpdateViewPayload({
     $core.String? viewId,
     $core.String? name,
     $core.String? desc,
@@ -653,34 +612,34 @@ class UpdateViewRequest extends $pb.GeneratedMessage {
     }
     return _result;
   }
-  factory UpdateViewRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory UpdateViewRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+  factory UpdateViewPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+  factory UpdateViewPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
   'Will be removed in next major version')
-  UpdateViewRequest clone() => UpdateViewRequest()..mergeFromMessage(this);
+  UpdateViewPayload clone() => UpdateViewPayload()..mergeFromMessage(this);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
   'Will be removed in next major version')
-  UpdateViewRequest copyWith(void Function(UpdateViewRequest) updates) => super.copyWith((message) => updates(message as UpdateViewRequest)) as UpdateViewRequest; // ignore: deprecated_member_use
+  UpdateViewPayload copyWith(void Function(UpdateViewPayload) updates) => super.copyWith((message) => updates(message as UpdateViewPayload)) as UpdateViewPayload; // ignore: deprecated_member_use
   $pb.BuilderInfo get info_ => _i;
   @$core.pragma('dart2js:noInline')
-  static UpdateViewRequest create() => UpdateViewRequest._();
-  UpdateViewRequest createEmptyInstance() => create();
-  static $pb.PbList<UpdateViewRequest> createRepeated() => $pb.PbList<UpdateViewRequest>();
+  static UpdateViewPayload create() => UpdateViewPayload._();
+  UpdateViewPayload createEmptyInstance() => create();
+  static $pb.PbList<UpdateViewPayload> createRepeated() => $pb.PbList<UpdateViewPayload>();
   @$core.pragma('dart2js:noInline')
-  static UpdateViewRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateViewRequest>(create);
-  static UpdateViewRequest? _defaultInstance;
+  static UpdateViewPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateViewPayload>(create);
+  static UpdateViewPayload? _defaultInstance;
 
-  UpdateViewRequest_OneOfName whichOneOfName() => _UpdateViewRequest_OneOfNameByTag[$_whichOneof(0)]!;
+  UpdateViewPayload_OneOfName whichOneOfName() => _UpdateViewPayload_OneOfNameByTag[$_whichOneof(0)]!;
   void clearOneOfName() => clearField($_whichOneof(0));
 
-  UpdateViewRequest_OneOfDesc whichOneOfDesc() => _UpdateViewRequest_OneOfDescByTag[$_whichOneof(1)]!;
+  UpdateViewPayload_OneOfDesc whichOneOfDesc() => _UpdateViewPayload_OneOfDescByTag[$_whichOneof(1)]!;
   void clearOneOfDesc() => clearField($_whichOneof(1));
 
-  UpdateViewRequest_OneOfThumbnail whichOneOfThumbnail() => _UpdateViewRequest_OneOfThumbnailByTag[$_whichOneof(2)]!;
+  UpdateViewPayload_OneOfThumbnail whichOneOfThumbnail() => _UpdateViewPayload_OneOfThumbnailByTag[$_whichOneof(2)]!;
   void clearOneOfThumbnail() => clearField($_whichOneof(2));
 
   @$pb.TagNumber(1)

+ 12 - 22
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/view.pbjson.dart

@@ -47,9 +47,9 @@ const RepeatedView$json = const {
 
 /// Descriptor for `RepeatedView`. Decode as a `google.protobuf.DescriptorProto`.
 final $typed_data.Uint8List repeatedViewDescriptor = $convert.base64Decode('CgxSZXBlYXRlZFZpZXcSGwoFaXRlbXMYASADKAsyBS5WaWV3UgVpdGVtcw==');
-@$core.Deprecated('Use createViewRequestDescriptor instead')
-const CreateViewRequest$json = const {
-  '1': 'CreateViewRequest',
+@$core.Deprecated('Use createViewPayloadDescriptor instead')
+const CreateViewPayload$json = const {
+  '1': 'CreateViewPayload',
   '2': const [
     const {'1': 'belong_to_id', '3': 1, '4': 1, '5': 9, '10': 'belongToId'},
     const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
@@ -62,8 +62,8 @@ const CreateViewRequest$json = const {
   ],
 };
 
-/// Descriptor for `CreateViewRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List createViewRequestDescriptor = $convert.base64Decode('ChFDcmVhdGVWaWV3UmVxdWVzdBIgCgxiZWxvbmdfdG9faWQYASABKAlSCmJlbG9uZ1RvSWQSEgoEbmFtZRgCIAEoCVIEbmFtZRISCgRkZXNjGAMgASgJUgRkZXNjEh4KCXRodW1ibmFpbBgEIAEoCUgAUgl0aHVtYm5haWwSJgoJdmlld190eXBlGAUgASgOMgkuVmlld1R5cGVSCHZpZXdUeXBlQhIKEG9uZV9vZl90aHVtYm5haWw=');
+/// Descriptor for `CreateViewPayload`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List createViewPayloadDescriptor = $convert.base64Decode('ChFDcmVhdGVWaWV3UGF5bG9hZBIgCgxiZWxvbmdfdG9faWQYASABKAlSCmJlbG9uZ1RvSWQSEgoEbmFtZRgCIAEoCVIEbmFtZRISCgRkZXNjGAMgASgJUgRkZXNjEh4KCXRodW1ibmFpbBgEIAEoCUgAUgl0aHVtYm5haWwSJgoJdmlld190eXBlGAUgASgOMgkuVmlld1R5cGVSCHZpZXdUeXBlQhIKEG9uZV9vZl90aHVtYm5haWw=');
 @$core.Deprecated('Use createViewParamsDescriptor instead')
 const CreateViewParams$json = const {
   '1': 'CreateViewParams',
@@ -80,26 +80,16 @@ const CreateViewParams$json = const {
 
 /// Descriptor for `CreateViewParams`. Decode as a `google.protobuf.DescriptorProto`.
 final $typed_data.Uint8List createViewParamsDescriptor = $convert.base64Decode('ChBDcmVhdGVWaWV3UGFyYW1zEiAKDGJlbG9uZ190b19pZBgBIAEoCVIKYmVsb25nVG9JZBISCgRuYW1lGAIgASgJUgRuYW1lEhIKBGRlc2MYAyABKAlSBGRlc2MSHAoJdGh1bWJuYWlsGAQgASgJUgl0aHVtYm5haWwSJgoJdmlld190eXBlGAUgASgOMgkuVmlld1R5cGVSCHZpZXdUeXBlEhsKCXZpZXdfZGF0YRgGIAEoCVIIdmlld0RhdGESFwoHdmlld19pZBgHIAEoCVIGdmlld0lk');
-@$core.Deprecated('Use queryViewRequestDescriptor instead')
-const QueryViewRequest$json = const {
-  '1': 'QueryViewRequest',
-  '2': const [
-    const {'1': 'view_ids', '3': 1, '4': 3, '5': 9, '10': 'viewIds'},
-  ],
-};
-
-/// Descriptor for `QueryViewRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List queryViewRequestDescriptor = $convert.base64Decode('ChBRdWVyeVZpZXdSZXF1ZXN0EhkKCHZpZXdfaWRzGAEgAygJUgd2aWV3SWRz');
 @$core.Deprecated('Use viewIdDescriptor instead')
 const ViewId$json = const {
   '1': 'ViewId',
   '2': const [
-    const {'1': 'view_id', '3': 1, '4': 1, '5': 9, '10': 'viewId'},
+    const {'1': 'value', '3': 1, '4': 1, '5': 9, '10': 'value'},
   ],
 };
 
 /// Descriptor for `ViewId`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List viewIdDescriptor = $convert.base64Decode('CgZWaWV3SWQSFwoHdmlld19pZBgBIAEoCVIGdmlld0lk');
+final $typed_data.Uint8List viewIdDescriptor = $convert.base64Decode('CgZWaWV3SWQSFAoFdmFsdWUYASABKAlSBXZhbHVl');
 @$core.Deprecated('Use repeatedViewIdDescriptor instead')
 const RepeatedViewId$json = const {
   '1': 'RepeatedViewId',
@@ -110,9 +100,9 @@ const RepeatedViewId$json = const {
 
 /// Descriptor for `RepeatedViewId`. Decode as a `google.protobuf.DescriptorProto`.
 final $typed_data.Uint8List repeatedViewIdDescriptor = $convert.base64Decode('Cg5SZXBlYXRlZFZpZXdJZBIUCgVpdGVtcxgBIAMoCVIFaXRlbXM=');
-@$core.Deprecated('Use updateViewRequestDescriptor instead')
-const UpdateViewRequest$json = const {
-  '1': 'UpdateViewRequest',
+@$core.Deprecated('Use updateViewPayloadDescriptor instead')
+const UpdateViewPayload$json = const {
+  '1': 'UpdateViewPayload',
   '2': const [
     const {'1': 'view_id', '3': 1, '4': 1, '5': 9, '10': 'viewId'},
     const {'1': 'name', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'name'},
@@ -126,8 +116,8 @@ const UpdateViewRequest$json = const {
   ],
 };
 
-/// Descriptor for `UpdateViewRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List updateViewRequestDescriptor = $convert.base64Decode('ChFVcGRhdGVWaWV3UmVxdWVzdBIXCgd2aWV3X2lkGAEgASgJUgZ2aWV3SWQSFAoEbmFtZRgCIAEoCUgAUgRuYW1lEhQKBGRlc2MYAyABKAlIAVIEZGVzYxIeCgl0aHVtYm5haWwYBCABKAlIAlIJdGh1bWJuYWlsQg0KC29uZV9vZl9uYW1lQg0KC29uZV9vZl9kZXNjQhIKEG9uZV9vZl90aHVtYm5haWw=');
+/// Descriptor for `UpdateViewPayload`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List updateViewPayloadDescriptor = $convert.base64Decode('ChFVcGRhdGVWaWV3UGF5bG9hZBIXCgd2aWV3X2lkGAEgASgJUgZ2aWV3SWQSFAoEbmFtZRgCIAEoCUgAUgRuYW1lEhQKBGRlc2MYAyABKAlIAVIEZGVzYxIeCgl0aHVtYm5haWwYBCABKAlIAlIJdGh1bWJuYWlsQg0KC29uZV9vZl9uYW1lQg0KC29uZV9vZl9kZXNjQhIKEG9uZV9vZl90aHVtYm5haWw=');
 @$core.Deprecated('Use updateViewParamsDescriptor instead')
 const UpdateViewParams$json = const {
   '1': 'UpdateViewParams',

+ 28 - 88
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/workspace.pb.dart

@@ -173,15 +173,15 @@ class RepeatedWorkspace extends $pb.GeneratedMessage {
   $core.List<Workspace> get items => $_getList(0);
 }
 
-class CreateWorkspaceRequest extends $pb.GeneratedMessage {
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateWorkspaceRequest', createEmptyInstance: create)
+class CreateWorkspacePayload extends $pb.GeneratedMessage {
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'CreateWorkspacePayload', createEmptyInstance: create)
     ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
     ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'desc')
     ..hasRequiredFields = false
   ;
 
-  CreateWorkspaceRequest._() : super();
-  factory CreateWorkspaceRequest({
+  CreateWorkspacePayload._() : super();
+  factory CreateWorkspacePayload({
     $core.String? name,
     $core.String? desc,
   }) {
@@ -194,26 +194,26 @@ class CreateWorkspaceRequest extends $pb.GeneratedMessage {
     }
     return _result;
   }
-  factory CreateWorkspaceRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory CreateWorkspaceRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+  factory CreateWorkspacePayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+  factory CreateWorkspacePayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
   'Will be removed in next major version')
-  CreateWorkspaceRequest clone() => CreateWorkspaceRequest()..mergeFromMessage(this);
+  CreateWorkspacePayload clone() => CreateWorkspacePayload()..mergeFromMessage(this);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
   'Will be removed in next major version')
-  CreateWorkspaceRequest copyWith(void Function(CreateWorkspaceRequest) updates) => super.copyWith((message) => updates(message as CreateWorkspaceRequest)) as CreateWorkspaceRequest; // ignore: deprecated_member_use
+  CreateWorkspacePayload copyWith(void Function(CreateWorkspacePayload) updates) => super.copyWith((message) => updates(message as CreateWorkspacePayload)) as CreateWorkspacePayload; // ignore: deprecated_member_use
   $pb.BuilderInfo get info_ => _i;
   @$core.pragma('dart2js:noInline')
-  static CreateWorkspaceRequest create() => CreateWorkspaceRequest._();
-  CreateWorkspaceRequest createEmptyInstance() => create();
-  static $pb.PbList<CreateWorkspaceRequest> createRepeated() => $pb.PbList<CreateWorkspaceRequest>();
+  static CreateWorkspacePayload create() => CreateWorkspacePayload._();
+  CreateWorkspacePayload createEmptyInstance() => create();
+  static $pb.PbList<CreateWorkspacePayload> createRepeated() => $pb.PbList<CreateWorkspacePayload>();
   @$core.pragma('dart2js:noInline')
-  static CreateWorkspaceRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateWorkspaceRequest>(create);
-  static CreateWorkspaceRequest? _defaultInstance;
+  static CreateWorkspacePayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<CreateWorkspacePayload>(create);
+  static CreateWorkspacePayload? _defaultInstance;
 
   @$pb.TagNumber(1)
   $core.String get name => $_getSZ(0);
@@ -295,89 +295,29 @@ class CreateWorkspaceParams extends $pb.GeneratedMessage {
   void clearDesc() => clearField(2);
 }
 
-enum QueryWorkspaceRequest_OneOfWorkspaceId {
-  workspaceId, 
-  notSet
-}
-
-class QueryWorkspaceRequest extends $pb.GeneratedMessage {
-  static const $core.Map<$core.int, QueryWorkspaceRequest_OneOfWorkspaceId> _QueryWorkspaceRequest_OneOfWorkspaceIdByTag = {
-    1 : QueryWorkspaceRequest_OneOfWorkspaceId.workspaceId,
-    0 : QueryWorkspaceRequest_OneOfWorkspaceId.notSet
-  };
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'QueryWorkspaceRequest', createEmptyInstance: create)
-    ..oo(0, [1])
-    ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'workspaceId')
-    ..hasRequiredFields = false
-  ;
-
-  QueryWorkspaceRequest._() : super();
-  factory QueryWorkspaceRequest({
-    $core.String? workspaceId,
-  }) {
-    final _result = create();
-    if (workspaceId != null) {
-      _result.workspaceId = workspaceId;
-    }
-    return _result;
-  }
-  factory QueryWorkspaceRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory QueryWorkspaceRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
-  @$core.Deprecated(
-  'Using this can add significant overhead to your binary. '
-  'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
-  'Will be removed in next major version')
-  QueryWorkspaceRequest clone() => QueryWorkspaceRequest()..mergeFromMessage(this);
-  @$core.Deprecated(
-  'Using this can add significant overhead to your binary. '
-  'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
-  'Will be removed in next major version')
-  QueryWorkspaceRequest copyWith(void Function(QueryWorkspaceRequest) updates) => super.copyWith((message) => updates(message as QueryWorkspaceRequest)) as QueryWorkspaceRequest; // ignore: deprecated_member_use
-  $pb.BuilderInfo get info_ => _i;
-  @$core.pragma('dart2js:noInline')
-  static QueryWorkspaceRequest create() => QueryWorkspaceRequest._();
-  QueryWorkspaceRequest createEmptyInstance() => create();
-  static $pb.PbList<QueryWorkspaceRequest> createRepeated() => $pb.PbList<QueryWorkspaceRequest>();
-  @$core.pragma('dart2js:noInline')
-  static QueryWorkspaceRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<QueryWorkspaceRequest>(create);
-  static QueryWorkspaceRequest? _defaultInstance;
-
-  QueryWorkspaceRequest_OneOfWorkspaceId whichOneOfWorkspaceId() => _QueryWorkspaceRequest_OneOfWorkspaceIdByTag[$_whichOneof(0)]!;
-  void clearOneOfWorkspaceId() => clearField($_whichOneof(0));
-
-  @$pb.TagNumber(1)
-  $core.String get workspaceId => $_getSZ(0);
-  @$pb.TagNumber(1)
-  set workspaceId($core.String v) { $_setString(0, v); }
-  @$pb.TagNumber(1)
-  $core.bool hasWorkspaceId() => $_has(0);
-  @$pb.TagNumber(1)
-  void clearWorkspaceId() => clearField(1);
-}
-
-enum WorkspaceId_OneOfWorkspaceId {
-  workspaceId, 
+enum WorkspaceId_OneOfValue {
+  value, 
   notSet
 }
 
 class WorkspaceId extends $pb.GeneratedMessage {
-  static const $core.Map<$core.int, WorkspaceId_OneOfWorkspaceId> _WorkspaceId_OneOfWorkspaceIdByTag = {
-    1 : WorkspaceId_OneOfWorkspaceId.workspaceId,
-    0 : WorkspaceId_OneOfWorkspaceId.notSet
+  static const $core.Map<$core.int, WorkspaceId_OneOfValue> _WorkspaceId_OneOfValueByTag = {
+    1 : WorkspaceId_OneOfValue.value,
+    0 : WorkspaceId_OneOfValue.notSet
   };
   static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'WorkspaceId', createEmptyInstance: create)
     ..oo(0, [1])
-    ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'workspaceId')
+    ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'value')
     ..hasRequiredFields = false
   ;
 
   WorkspaceId._() : super();
   factory WorkspaceId({
-    $core.String? workspaceId,
+    $core.String? value,
   }) {
     final _result = create();
-    if (workspaceId != null) {
-      _result.workspaceId = workspaceId;
+    if (value != null) {
+      _result.value = value;
     }
     return _result;
   }
@@ -402,17 +342,17 @@ class WorkspaceId extends $pb.GeneratedMessage {
   static WorkspaceId getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<WorkspaceId>(create);
   static WorkspaceId? _defaultInstance;
 
-  WorkspaceId_OneOfWorkspaceId whichOneOfWorkspaceId() => _WorkspaceId_OneOfWorkspaceIdByTag[$_whichOneof(0)]!;
-  void clearOneOfWorkspaceId() => clearField($_whichOneof(0));
+  WorkspaceId_OneOfValue whichOneOfValue() => _WorkspaceId_OneOfValueByTag[$_whichOneof(0)]!;
+  void clearOneOfValue() => clearField($_whichOneof(0));
 
   @$pb.TagNumber(1)
-  $core.String get workspaceId => $_getSZ(0);
+  $core.String get value => $_getSZ(0);
   @$pb.TagNumber(1)
-  set workspaceId($core.String v) { $_setString(0, v); }
+  set value($core.String v) { $_setString(0, v); }
   @$pb.TagNumber(1)
-  $core.bool hasWorkspaceId() => $_has(0);
+  $core.bool hasValue() => $_has(0);
   @$pb.TagNumber(1)
-  void clearWorkspaceId() => clearField(1);
+  void clearValue() => clearField(1);
 }
 
 enum CurrentWorkspaceSetting_OneOfLatestView {

+ 8 - 21
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder-data-model/workspace.pbjson.dart

@@ -33,17 +33,17 @@ const RepeatedWorkspace$json = const {
 
 /// Descriptor for `RepeatedWorkspace`. Decode as a `google.protobuf.DescriptorProto`.
 final $typed_data.Uint8List repeatedWorkspaceDescriptor = $convert.base64Decode('ChFSZXBlYXRlZFdvcmtzcGFjZRIgCgVpdGVtcxgBIAMoCzIKLldvcmtzcGFjZVIFaXRlbXM=');
-@$core.Deprecated('Use createWorkspaceRequestDescriptor instead')
-const CreateWorkspaceRequest$json = const {
-  '1': 'CreateWorkspaceRequest',
+@$core.Deprecated('Use createWorkspacePayloadDescriptor instead')
+const CreateWorkspacePayload$json = const {
+  '1': 'CreateWorkspacePayload',
   '2': const [
     const {'1': 'name', '3': 1, '4': 1, '5': 9, '10': 'name'},
     const {'1': 'desc', '3': 2, '4': 1, '5': 9, '10': 'desc'},
   ],
 };
 
-/// Descriptor for `CreateWorkspaceRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List createWorkspaceRequestDescriptor = $convert.base64Decode('ChZDcmVhdGVXb3Jrc3BhY2VSZXF1ZXN0EhIKBG5hbWUYASABKAlSBG5hbWUSEgoEZGVzYxgCIAEoCVIEZGVzYw==');
+/// Descriptor for `CreateWorkspacePayload`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List createWorkspacePayloadDescriptor = $convert.base64Decode('ChZDcmVhdGVXb3Jrc3BhY2VQYXlsb2FkEhIKBG5hbWUYASABKAlSBG5hbWUSEgoEZGVzYxgCIAEoCVIEZGVzYw==');
 @$core.Deprecated('Use createWorkspaceParamsDescriptor instead')
 const CreateWorkspaceParams$json = const {
   '1': 'CreateWorkspaceParams',
@@ -55,32 +55,19 @@ const CreateWorkspaceParams$json = const {
 
 /// Descriptor for `CreateWorkspaceParams`. Decode as a `google.protobuf.DescriptorProto`.
 final $typed_data.Uint8List createWorkspaceParamsDescriptor = $convert.base64Decode('ChVDcmVhdGVXb3Jrc3BhY2VQYXJhbXMSEgoEbmFtZRgBIAEoCVIEbmFtZRISCgRkZXNjGAIgASgJUgRkZXNj');
-@$core.Deprecated('Use queryWorkspaceRequestDescriptor instead')
-const QueryWorkspaceRequest$json = const {
-  '1': 'QueryWorkspaceRequest',
-  '2': const [
-    const {'1': 'workspace_id', '3': 1, '4': 1, '5': 9, '9': 0, '10': 'workspaceId'},
-  ],
-  '8': const [
-    const {'1': 'one_of_workspace_id'},
-  ],
-};
-
-/// Descriptor for `QueryWorkspaceRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List queryWorkspaceRequestDescriptor = $convert.base64Decode('ChVRdWVyeVdvcmtzcGFjZVJlcXVlc3QSIwoMd29ya3NwYWNlX2lkGAEgASgJSABSC3dvcmtzcGFjZUlkQhUKE29uZV9vZl93b3Jrc3BhY2VfaWQ=');
 @$core.Deprecated('Use workspaceIdDescriptor instead')
 const WorkspaceId$json = const {
   '1': 'WorkspaceId',
   '2': const [
-    const {'1': 'workspace_id', '3': 1, '4': 1, '5': 9, '9': 0, '10': 'workspaceId'},
+    const {'1': 'value', '3': 1, '4': 1, '5': 9, '9': 0, '10': 'value'},
   ],
   '8': const [
-    const {'1': 'one_of_workspace_id'},
+    const {'1': 'one_of_value'},
   ],
 };
 
 /// Descriptor for `WorkspaceId`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List workspaceIdDescriptor = $convert.base64Decode('CgtXb3Jrc3BhY2VJZBIjCgx3b3Jrc3BhY2VfaWQYASABKAlIAFILd29ya3NwYWNlSWRCFQoTb25lX29mX3dvcmtzcGFjZV9pZA==');
+final $typed_data.Uint8List workspaceIdDescriptor = $convert.base64Decode('CgtXb3Jrc3BhY2VJZBIWCgV2YWx1ZRgBIAEoCUgAUgV2YWx1ZUIOCgxvbmVfb2ZfdmFsdWU=');
 @$core.Deprecated('Use currentWorkspaceSettingDescriptor instead')
 const CurrentWorkspaceSetting$json = const {
   '1': 'CurrentWorkspaceSetting',

+ 2 - 2
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder/event_map.pbenum.dart

@@ -26,7 +26,7 @@ class FolderEvent extends $pb.ProtobufEnum {
   static const FolderEvent DeleteView = FolderEvent._(204, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DeleteView');
   static const FolderEvent DuplicateView = FolderEvent._(205, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'DuplicateView');
   static const FolderEvent CopyLink = FolderEvent._(206, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CopyLink');
-  static const FolderEvent OpenDocument = FolderEvent._(207, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OpenDocument');
+  static const FolderEvent OpenView = FolderEvent._(207, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'OpenView');
   static const FolderEvent CloseView = FolderEvent._(208, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'CloseView');
   static const FolderEvent ReadTrash = FolderEvent._(300, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'ReadTrash');
   static const FolderEvent PutbackTrash = FolderEvent._(301, const $core.bool.fromEnvironment('protobuf.omit_enum_names') ? '' : 'PutbackTrash');
@@ -53,7 +53,7 @@ class FolderEvent extends $pb.ProtobufEnum {
     DeleteView,
     DuplicateView,
     CopyLink,
-    OpenDocument,
+    OpenView,
     CloseView,
     ReadTrash,
     PutbackTrash,

+ 2 - 2
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-folder/event_map.pbjson.dart

@@ -28,7 +28,7 @@ const FolderEvent$json = const {
     const {'1': 'DeleteView', '2': 204},
     const {'1': 'DuplicateView', '2': 205},
     const {'1': 'CopyLink', '2': 206},
-    const {'1': 'OpenDocument', '2': 207},
+    const {'1': 'OpenView', '2': 207},
     const {'1': 'CloseView', '2': 208},
     const {'1': 'ReadTrash', '2': 300},
     const {'1': 'PutbackTrash', '2': 301},
@@ -41,4 +41,4 @@ const FolderEvent$json = const {
 };
 
 /// Descriptor for `FolderEvent`. Decode as a `google.protobuf.EnumDescriptorProto`.
-final $typed_data.Uint8List folderEventDescriptor = $convert.base64Decode('CgtGb2xkZXJFdmVudBITCg9DcmVhdGVXb3Jrc3BhY2UQABIUChBSZWFkQ3VyV29ya3NwYWNlEAESEgoOUmVhZFdvcmtzcGFjZXMQAhITCg9EZWxldGVXb3Jrc3BhY2UQAxIRCg1PcGVuV29ya3NwYWNlEAQSFQoRUmVhZFdvcmtzcGFjZUFwcHMQBRINCglDcmVhdGVBcHAQZRINCglEZWxldGVBcHAQZhILCgdSZWFkQXBwEGcSDQoJVXBkYXRlQXBwEGgSDwoKQ3JlYXRlVmlldxDJARINCghSZWFkVmlldxDKARIPCgpVcGRhdGVWaWV3EMsBEg8KCkRlbGV0ZVZpZXcQzAESEgoNRHVwbGljYXRlVmlldxDNARINCghDb3B5TGluaxDOARIRCgxPcGVuRG9jdW1lbnQQzwESDgoJQ2xvc2VWaWV3ENABEg4KCVJlYWRUcmFzaBCsAhIRCgxQdXRiYWNrVHJhc2gQrQISEAoLRGVsZXRlVHJhc2gQrgISFAoPUmVzdG9yZUFsbFRyYXNoEK8CEhMKDkRlbGV0ZUFsbFRyYXNoELACEhIKDUFwcGx5RG9jRGVsdGEQkAMSEwoORXhwb3J0RG9jdW1lbnQQ9AM=');
+final $typed_data.Uint8List folderEventDescriptor = $convert.base64Decode('CgtGb2xkZXJFdmVudBITCg9DcmVhdGVXb3Jrc3BhY2UQABIUChBSZWFkQ3VyV29ya3NwYWNlEAESEgoOUmVhZFdvcmtzcGFjZXMQAhITCg9EZWxldGVXb3Jrc3BhY2UQAxIRCg1PcGVuV29ya3NwYWNlEAQSFQoRUmVhZFdvcmtzcGFjZUFwcHMQBRINCglDcmVhdGVBcHAQZRINCglEZWxldGVBcHAQZhILCgdSZWFkQXBwEGcSDQoJVXBkYXRlQXBwEGgSDwoKQ3JlYXRlVmlldxDJARINCghSZWFkVmlldxDKARIPCgpVcGRhdGVWaWV3EMsBEg8KCkRlbGV0ZVZpZXcQzAESEgoNRHVwbGljYXRlVmlldxDNARINCghDb3B5TGluaxDOARINCghPcGVuVmlldxDPARIOCglDbG9zZVZpZXcQ0AESDgoJUmVhZFRyYXNoEKwCEhEKDFB1dGJhY2tUcmFzaBCtAhIQCgtEZWxldGVUcmFzaBCuAhIUCg9SZXN0b3JlQWxsVHJhc2gQrwISEwoORGVsZXRlQWxsVHJhc2gQsAISEgoNQXBwbHlEb2NEZWx0YRCQAxITCg5FeHBvcnREb2N1bWVudBD0Aw==');

+ 26 - 26
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-user-data-model/auth.pb.dart

@@ -9,16 +9,16 @@ import 'dart:core' as $core;
 
 import 'package:protobuf/protobuf.dart' as $pb;
 
-class SignInRequest extends $pb.GeneratedMessage {
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignInRequest', createEmptyInstance: create)
+class SignInPayload extends $pb.GeneratedMessage {
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignInPayload', createEmptyInstance: create)
     ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
     ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
     ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
     ..hasRequiredFields = false
   ;
 
-  SignInRequest._() : super();
-  factory SignInRequest({
+  SignInPayload._() : super();
+  factory SignInPayload({
     $core.String? email,
     $core.String? password,
     $core.String? name,
@@ -35,26 +35,26 @@ class SignInRequest extends $pb.GeneratedMessage {
     }
     return _result;
   }
-  factory SignInRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory SignInRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+  factory SignInPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+  factory SignInPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
   'Will be removed in next major version')
-  SignInRequest clone() => SignInRequest()..mergeFromMessage(this);
+  SignInPayload clone() => SignInPayload()..mergeFromMessage(this);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
   'Will be removed in next major version')
-  SignInRequest copyWith(void Function(SignInRequest) updates) => super.copyWith((message) => updates(message as SignInRequest)) as SignInRequest; // ignore: deprecated_member_use
+  SignInPayload copyWith(void Function(SignInPayload) updates) => super.copyWith((message) => updates(message as SignInPayload)) as SignInPayload; // ignore: deprecated_member_use
   $pb.BuilderInfo get info_ => _i;
   @$core.pragma('dart2js:noInline')
-  static SignInRequest create() => SignInRequest._();
-  SignInRequest createEmptyInstance() => create();
-  static $pb.PbList<SignInRequest> createRepeated() => $pb.PbList<SignInRequest>();
+  static SignInPayload create() => SignInPayload._();
+  SignInPayload createEmptyInstance() => create();
+  static $pb.PbList<SignInPayload> createRepeated() => $pb.PbList<SignInPayload>();
   @$core.pragma('dart2js:noInline')
-  static SignInRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignInRequest>(create);
-  static SignInRequest? _defaultInstance;
+  static SignInPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignInPayload>(create);
+  static SignInPayload? _defaultInstance;
 
   @$pb.TagNumber(1)
   $core.String get email => $_getSZ(0);
@@ -248,16 +248,16 @@ class SignInResponse extends $pb.GeneratedMessage {
   void clearToken() => clearField(4);
 }
 
-class SignUpRequest extends $pb.GeneratedMessage {
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignUpRequest', createEmptyInstance: create)
+class SignUpPayload extends $pb.GeneratedMessage {
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'SignUpPayload', createEmptyInstance: create)
     ..aOS(1, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'email')
     ..aOS(2, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'name')
     ..aOS(3, const $core.bool.fromEnvironment('protobuf.omit_field_names') ? '' : 'password')
     ..hasRequiredFields = false
   ;
 
-  SignUpRequest._() : super();
-  factory SignUpRequest({
+  SignUpPayload._() : super();
+  factory SignUpPayload({
     $core.String? email,
     $core.String? name,
     $core.String? password,
@@ -274,26 +274,26 @@ class SignUpRequest extends $pb.GeneratedMessage {
     }
     return _result;
   }
-  factory SignUpRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory SignUpRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+  factory SignUpPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+  factory SignUpPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
   'Will be removed in next major version')
-  SignUpRequest clone() => SignUpRequest()..mergeFromMessage(this);
+  SignUpPayload clone() => SignUpPayload()..mergeFromMessage(this);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
   'Will be removed in next major version')
-  SignUpRequest copyWith(void Function(SignUpRequest) updates) => super.copyWith((message) => updates(message as SignUpRequest)) as SignUpRequest; // ignore: deprecated_member_use
+  SignUpPayload copyWith(void Function(SignUpPayload) updates) => super.copyWith((message) => updates(message as SignUpPayload)) as SignUpPayload; // ignore: deprecated_member_use
   $pb.BuilderInfo get info_ => _i;
   @$core.pragma('dart2js:noInline')
-  static SignUpRequest create() => SignUpRequest._();
-  SignUpRequest createEmptyInstance() => create();
-  static $pb.PbList<SignUpRequest> createRepeated() => $pb.PbList<SignUpRequest>();
+  static SignUpPayload create() => SignUpPayload._();
+  SignUpPayload createEmptyInstance() => create();
+  static $pb.PbList<SignUpPayload> createRepeated() => $pb.PbList<SignUpPayload>();
   @$core.pragma('dart2js:noInline')
-  static SignUpRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignUpRequest>(create);
-  static SignUpRequest? _defaultInstance;
+  static SignUpPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<SignUpPayload>(create);
+  static SignUpPayload? _defaultInstance;
 
   @$pb.TagNumber(1)
   $core.String get email => $_getSZ(0);

+ 10 - 10
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-user-data-model/auth.pbjson.dart

@@ -8,9 +8,9 @@
 import 'dart:core' as $core;
 import 'dart:convert' as $convert;
 import 'dart:typed_data' as $typed_data;
-@$core.Deprecated('Use signInRequestDescriptor instead')
-const SignInRequest$json = const {
-  '1': 'SignInRequest',
+@$core.Deprecated('Use signInPayloadDescriptor instead')
+const SignInPayload$json = const {
+  '1': 'SignInPayload',
   '2': const [
     const {'1': 'email', '3': 1, '4': 1, '5': 9, '10': 'email'},
     const {'1': 'password', '3': 2, '4': 1, '5': 9, '10': 'password'},
@@ -18,8 +18,8 @@ const SignInRequest$json = const {
   ],
 };
 
-/// Descriptor for `SignInRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List signInRequestDescriptor = $convert.base64Decode('Cg1TaWduSW5SZXF1ZXN0EhQKBWVtYWlsGAEgASgJUgVlbWFpbBIaCghwYXNzd29yZBgCIAEoCVIIcGFzc3dvcmQSEgoEbmFtZRgDIAEoCVIEbmFtZQ==');
+/// Descriptor for `SignInPayload`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List signInPayloadDescriptor = $convert.base64Decode('Cg1TaWduSW5QYXlsb2FkEhQKBWVtYWlsGAEgASgJUgVlbWFpbBIaCghwYXNzd29yZBgCIAEoCVIIcGFzc3dvcmQSEgoEbmFtZRgDIAEoCVIEbmFtZQ==');
 @$core.Deprecated('Use signInParamsDescriptor instead')
 const SignInParams$json = const {
   '1': 'SignInParams',
@@ -45,9 +45,9 @@ const SignInResponse$json = const {
 
 /// Descriptor for `SignInResponse`. Decode as a `google.protobuf.DescriptorProto`.
 final $typed_data.Uint8List signInResponseDescriptor = $convert.base64Decode('Cg5TaWduSW5SZXNwb25zZRIXCgd1c2VyX2lkGAEgASgJUgZ1c2VySWQSEgoEbmFtZRgCIAEoCVIEbmFtZRIUCgVlbWFpbBgDIAEoCVIFZW1haWwSFAoFdG9rZW4YBCABKAlSBXRva2Vu');
-@$core.Deprecated('Use signUpRequestDescriptor instead')
-const SignUpRequest$json = const {
-  '1': 'SignUpRequest',
+@$core.Deprecated('Use signUpPayloadDescriptor instead')
+const SignUpPayload$json = const {
+  '1': 'SignUpPayload',
   '2': const [
     const {'1': 'email', '3': 1, '4': 1, '5': 9, '10': 'email'},
     const {'1': 'name', '3': 2, '4': 1, '5': 9, '10': 'name'},
@@ -55,8 +55,8 @@ const SignUpRequest$json = const {
   ],
 };
 
-/// Descriptor for `SignUpRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List signUpRequestDescriptor = $convert.base64Decode('Cg1TaWduVXBSZXF1ZXN0EhQKBWVtYWlsGAEgASgJUgVlbWFpbBISCgRuYW1lGAIgASgJUgRuYW1lEhoKCHBhc3N3b3JkGAMgASgJUghwYXNzd29yZA==');
+/// Descriptor for `SignUpPayload`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List signUpPayloadDescriptor = $convert.base64Decode('Cg1TaWduVXBQYXlsb2FkEhQKBWVtYWlsGAEgASgJUgVlbWFpbBISCgRuYW1lGAIgASgJUgRuYW1lEhoKCHBhc3N3b3JkGAMgASgJUghwYXNzd29yZA==');
 @$core.Deprecated('Use signUpParamsDescriptor instead')
 const SignUpParams$json = const {
   '1': 'SignUpParams',

+ 28 - 28
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-user-data-model/user_profile.pb.dart

@@ -145,35 +145,35 @@ class UserProfile extends $pb.GeneratedMessage {
   void clearToken() => clearField(4);
 }
 
-enum UpdateUserRequest_OneOfName {
+enum UpdateUserPayload_OneOfName {
   name, 
   notSet
 }
 
-enum UpdateUserRequest_OneOfEmail {
+enum UpdateUserPayload_OneOfEmail {
   email, 
   notSet
 }
 
-enum UpdateUserRequest_OneOfPassword {
+enum UpdateUserPayload_OneOfPassword {
   password, 
   notSet
 }
 
-class UpdateUserRequest extends $pb.GeneratedMessage {
-  static const $core.Map<$core.int, UpdateUserRequest_OneOfName> _UpdateUserRequest_OneOfNameByTag = {
-    2 : UpdateUserRequest_OneOfName.name,
-    0 : UpdateUserRequest_OneOfName.notSet
+class UpdateUserPayload extends $pb.GeneratedMessage {
+  static const $core.Map<$core.int, UpdateUserPayload_OneOfName> _UpdateUserPayload_OneOfNameByTag = {
+    2 : UpdateUserPayload_OneOfName.name,
+    0 : UpdateUserPayload_OneOfName.notSet
   };
-  static const $core.Map<$core.int, UpdateUserRequest_OneOfEmail> _UpdateUserRequest_OneOfEmailByTag = {
-    3 : UpdateUserRequest_OneOfEmail.email,
-    0 : UpdateUserRequest_OneOfEmail.notSet
+  static const $core.Map<$core.int, UpdateUserPayload_OneOfEmail> _UpdateUserPayload_OneOfEmailByTag = {
+    3 : UpdateUserPayload_OneOfEmail.email,
+    0 : UpdateUserPayload_OneOfEmail.notSet
   };
-  static const $core.Map<$core.int, UpdateUserRequest_OneOfPassword> _UpdateUserRequest_OneOfPasswordByTag = {
-    4 : UpdateUserRequest_OneOfPassword.password,
-    0 : UpdateUserRequest_OneOfPassword.notSet
+  static const $core.Map<$core.int, UpdateUserPayload_OneOfPassword> _UpdateUserPayload_OneOfPasswordByTag = {
+    4 : UpdateUserPayload_OneOfPassword.password,
+    0 : UpdateUserPayload_OneOfPassword.notSet
   };
-  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateUserRequest', createEmptyInstance: create)
+  static final $pb.BuilderInfo _i = $pb.BuilderInfo(const $core.bool.fromEnvironment('protobuf.omit_message_names') ? '' : 'UpdateUserPayload', createEmptyInstance: create)
     ..oo(0, [2])
     ..oo(1, [3])
     ..oo(2, [4])
@@ -184,8 +184,8 @@ class UpdateUserRequest extends $pb.GeneratedMessage {
     ..hasRequiredFields = false
   ;
 
-  UpdateUserRequest._() : super();
-  factory UpdateUserRequest({
+  UpdateUserPayload._() : super();
+  factory UpdateUserPayload({
     $core.String? id,
     $core.String? name,
     $core.String? email,
@@ -206,34 +206,34 @@ class UpdateUserRequest extends $pb.GeneratedMessage {
     }
     return _result;
   }
-  factory UpdateUserRequest.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
-  factory UpdateUserRequest.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
+  factory UpdateUserPayload.fromBuffer($core.List<$core.int> i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromBuffer(i, r);
+  factory UpdateUserPayload.fromJson($core.String i, [$pb.ExtensionRegistry r = $pb.ExtensionRegistry.EMPTY]) => create()..mergeFromJson(i, r);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.deepCopy] instead. '
   'Will be removed in next major version')
-  UpdateUserRequest clone() => UpdateUserRequest()..mergeFromMessage(this);
+  UpdateUserPayload clone() => UpdateUserPayload()..mergeFromMessage(this);
   @$core.Deprecated(
   'Using this can add significant overhead to your binary. '
   'Use [GeneratedMessageGenericExtensions.rebuild] instead. '
   'Will be removed in next major version')
-  UpdateUserRequest copyWith(void Function(UpdateUserRequest) updates) => super.copyWith((message) => updates(message as UpdateUserRequest)) as UpdateUserRequest; // ignore: deprecated_member_use
+  UpdateUserPayload copyWith(void Function(UpdateUserPayload) updates) => super.copyWith((message) => updates(message as UpdateUserPayload)) as UpdateUserPayload; // ignore: deprecated_member_use
   $pb.BuilderInfo get info_ => _i;
   @$core.pragma('dart2js:noInline')
-  static UpdateUserRequest create() => UpdateUserRequest._();
-  UpdateUserRequest createEmptyInstance() => create();
-  static $pb.PbList<UpdateUserRequest> createRepeated() => $pb.PbList<UpdateUserRequest>();
+  static UpdateUserPayload create() => UpdateUserPayload._();
+  UpdateUserPayload createEmptyInstance() => create();
+  static $pb.PbList<UpdateUserPayload> createRepeated() => $pb.PbList<UpdateUserPayload>();
   @$core.pragma('dart2js:noInline')
-  static UpdateUserRequest getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateUserRequest>(create);
-  static UpdateUserRequest? _defaultInstance;
+  static UpdateUserPayload getDefault() => _defaultInstance ??= $pb.GeneratedMessage.$_defaultFor<UpdateUserPayload>(create);
+  static UpdateUserPayload? _defaultInstance;
 
-  UpdateUserRequest_OneOfName whichOneOfName() => _UpdateUserRequest_OneOfNameByTag[$_whichOneof(0)]!;
+  UpdateUserPayload_OneOfName whichOneOfName() => _UpdateUserPayload_OneOfNameByTag[$_whichOneof(0)]!;
   void clearOneOfName() => clearField($_whichOneof(0));
 
-  UpdateUserRequest_OneOfEmail whichOneOfEmail() => _UpdateUserRequest_OneOfEmailByTag[$_whichOneof(1)]!;
+  UpdateUserPayload_OneOfEmail whichOneOfEmail() => _UpdateUserPayload_OneOfEmailByTag[$_whichOneof(1)]!;
   void clearOneOfEmail() => clearField($_whichOneof(1));
 
-  UpdateUserRequest_OneOfPassword whichOneOfPassword() => _UpdateUserRequest_OneOfPasswordByTag[$_whichOneof(2)]!;
+  UpdateUserPayload_OneOfPassword whichOneOfPassword() => _UpdateUserPayload_OneOfPasswordByTag[$_whichOneof(2)]!;
   void clearOneOfPassword() => clearField($_whichOneof(2));
 
   @$pb.TagNumber(1)

+ 5 - 5
frontend/app_flowy/packages/flowy_sdk/lib/protobuf/flowy-user-data-model/user_profile.pbjson.dart

@@ -31,9 +31,9 @@ const UserProfile$json = const {
 
 /// Descriptor for `UserProfile`. Decode as a `google.protobuf.DescriptorProto`.
 final $typed_data.Uint8List userProfileDescriptor = $convert.base64Decode('CgtVc2VyUHJvZmlsZRIOCgJpZBgBIAEoCVICaWQSFAoFZW1haWwYAiABKAlSBWVtYWlsEhIKBG5hbWUYAyABKAlSBG5hbWUSFAoFdG9rZW4YBCABKAlSBXRva2Vu');
-@$core.Deprecated('Use updateUserRequestDescriptor instead')
-const UpdateUserRequest$json = const {
-  '1': 'UpdateUserRequest',
+@$core.Deprecated('Use updateUserPayloadDescriptor instead')
+const UpdateUserPayload$json = const {
+  '1': 'UpdateUserPayload',
   '2': const [
     const {'1': 'id', '3': 1, '4': 1, '5': 9, '10': 'id'},
     const {'1': 'name', '3': 2, '4': 1, '5': 9, '9': 0, '10': 'name'},
@@ -47,8 +47,8 @@ const UpdateUserRequest$json = const {
   ],
 };
 
-/// Descriptor for `UpdateUserRequest`. Decode as a `google.protobuf.DescriptorProto`.
-final $typed_data.Uint8List updateUserRequestDescriptor = $convert.base64Decode('ChFVcGRhdGVVc2VyUmVxdWVzdBIOCgJpZBgBIAEoCVICaWQSFAoEbmFtZRgCIAEoCUgAUgRuYW1lEhYKBWVtYWlsGAMgASgJSAFSBWVtYWlsEhwKCHBhc3N3b3JkGAQgASgJSAJSCHBhc3N3b3JkQg0KC29uZV9vZl9uYW1lQg4KDG9uZV9vZl9lbWFpbEIRCg9vbmVfb2ZfcGFzc3dvcmQ=');
+/// Descriptor for `UpdateUserPayload`. Decode as a `google.protobuf.DescriptorProto`.
+final $typed_data.Uint8List updateUserPayloadDescriptor = $convert.base64Decode('ChFVcGRhdGVVc2VyUGF5bG9hZBIOCgJpZBgBIAEoCVICaWQSFAoEbmFtZRgCIAEoCUgAUgRuYW1lEhYKBWVtYWlsGAMgASgJSAFSBWVtYWlsEhwKCHBhc3N3b3JkGAQgASgJSAJSCHBhc3N3b3JkQg0KC29uZV9vZl9uYW1lQg4KDG9uZV9vZl9lbWFpbEIRCg9vbmVfb2ZfcGFzc3dvcmQ=');
 @$core.Deprecated('Use updateUserParamsDescriptor instead')
 const UpdateUserParams$json = const {
   '1': 'UpdateUserParams',

+ 3 - 2
frontend/app_flowy/packages/flowy_sdk/pubspec.yaml

@@ -15,13 +15,14 @@ dependencies:
   isolates: ^3.0.3+8
   protobuf: "2.0.0"
   dartz: "0.10.0-nullsafety.2"
-  freezed_annotation: ^0.14.1
+  freezed_annotation:
   logger: ^1.0.0
 
 dev_dependencies:
   flutter_test:
     sdk: flutter
-  build_runner: "1.12.2"
+  build_runner:
+  freezed:
   flutter_lints: ^1.0.0
 
 # For information on the generic Dart part of this file, see the

+ 7 - 7
frontend/app_flowy/pubspec.lock

@@ -329,7 +329,7 @@ packages:
       name: easy_localization
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "3.0.0"
+    version: "3.0.1-dev"
   easy_logger:
     dependency: transitive
     description:
@@ -645,7 +645,7 @@ packages:
       name: js
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.6.3"
+    version: "0.6.4"
   json_annotation:
     dependency: transitive
     description:
@@ -799,7 +799,7 @@ packages:
       name: path
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.8.0"
+    version: "1.8.1"
   path_drawing:
     dependency: transitive
     description:
@@ -1133,21 +1133,21 @@ packages:
       name: test
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "1.19.5"
+    version: "1.20.1"
   test_api:
     dependency: transitive
     description:
       name: test_api
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.4.8"
+    version: "0.4.9"
   test_core:
     dependency: transitive
     description:
       name: test_core
       url: "https://pub.dartlang.org"
     source: hosted
-    version: "0.4.9"
+    version: "0.4.11"
   textstyle_extensions:
     dependency: transitive
     description:
@@ -1354,5 +1354,5 @@ packages:
     source: hosted
     version: "8.0.0"
 sdks:
-  dart: ">=2.15.0-116.0.dev <3.0.0"
+  dart: ">=2.16.0-100.0.dev <3.0.0"
   flutter: ">=2.5.0"

+ 1 - 1
frontend/app_flowy/pubspec.yaml

@@ -79,7 +79,7 @@ dev_dependencies:
   flutter_test:
     sdk: flutter
   build_runner:
-  freezed: "^0.14.2"
+  freezed:
   bloc_test: ^9.0.2
 
   # The "flutter_lints" package below contains a set of recommended lints to

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

@@ -164,10 +164,8 @@ struct DocumentRevisionCloudServiceImpl {
 
 impl RevisionCloudService for DocumentRevisionCloudServiceImpl {
     #[tracing::instrument(level = "trace", skip(self))]
-    fn fetch_object(&self, user_id: &str, doc_id: &str) -> FutureResult<Vec<Revision>, FlowyError> {
-        let params = DocumentId {
-            doc_id: doc_id.to_string(),
-        };
+    fn fetch_object(&self, user_id: &str, object_id: &str) -> FutureResult<Vec<Revision>, FlowyError> {
+        let params: DocumentId = object_id.to_string().into();
         let server = self.server.clone();
         let token = self.token.clone();
         let user_id = user_id.to_string();

+ 19 - 19
frontend/rust-lib/flowy-folder/src/event_map.rs

@@ -63,7 +63,7 @@ pub fn create(folder: Arc<FolderManager>) -> Module {
         .event(FolderEvent::UpdateView, update_view_handler)
         .event(FolderEvent::DeleteView, delete_view_handler)
         .event(FolderEvent::DuplicateView, duplicate_view_handler)
-        .event(FolderEvent::OpenDocument, open_document_handler)
+        .event(FolderEvent::OpenView, open_document_handler)
         .event(FolderEvent::CloseView, close_view_handler)
         .event(FolderEvent::ApplyDocDelta, document_delta_handler);
 
@@ -82,58 +82,58 @@ pub fn create(folder: Arc<FolderManager>) -> Module {
 #[derive(Clone, Copy, PartialEq, Eq, Debug, Display, Hash, ProtoBuf_Enum, Flowy_Event)]
 #[event_err = "FlowyError"]
 pub enum FolderEvent {
-    #[event(input = "CreateWorkspaceRequest", output = "Workspace")]
+    #[event(input = "CreateWorkspacePayload", output = "Workspace")]
     CreateWorkspace = 0,
 
     #[event(output = "CurrentWorkspaceSetting")]
     ReadCurWorkspace = 1,
 
-    #[event(input = "QueryWorkspaceRequest", output = "RepeatedWorkspace")]
+    #[event(input = "WorkspaceId", output = "RepeatedWorkspace")]
     ReadWorkspaces = 2,
 
-    #[event(input = "QueryWorkspaceRequest")]
+    #[event(input = "WorkspaceId")]
     DeleteWorkspace = 3,
 
-    #[event(input = "QueryWorkspaceRequest", output = "Workspace")]
+    #[event(input = "WorkspaceId", output = "Workspace")]
     OpenWorkspace = 4,
 
-    #[event(input = "QueryWorkspaceRequest", output = "RepeatedApp")]
+    #[event(input = "WorkspaceId", output = "RepeatedApp")]
     ReadWorkspaceApps = 5,
 
-    #[event(input = "CreateAppRequest", output = "App")]
+    #[event(input = "CreateAppPayload", output = "App")]
     CreateApp = 101,
 
-    #[event(input = "QueryAppRequest")]
+    #[event(input = "AppId")]
     DeleteApp = 102,
 
-    #[event(input = "QueryAppRequest", output = "App")]
+    #[event(input = "AppId", output = "App")]
     ReadApp = 103,
 
-    #[event(input = "UpdateAppRequest")]
+    #[event(input = "UpdateAppPayload")]
     UpdateApp = 104,
 
-    #[event(input = "CreateViewRequest", output = "View")]
+    #[event(input = "CreateViewPayload", output = "View")]
     CreateView = 201,
 
-    #[event(input = "QueryViewRequest", output = "View")]
+    #[event(input = "ViewId", output = "View")]
     ReadView = 202,
 
-    #[event(input = "UpdateViewRequest", output = "View")]
+    #[event(input = "UpdateViewPayload", output = "View")]
     UpdateView = 203,
 
-    #[event(input = "QueryViewRequest")]
+    #[event(input = "RepeatedViewId")]
     DeleteView = 204,
 
-    #[event(input = "QueryViewRequest")]
+    #[event(input = "ViewId")]
     DuplicateView = 205,
 
     #[event()]
     CopyLink = 206,
 
-    #[event(input = "QueryViewRequest", output = "DocumentDelta")]
-    OpenDocument = 207,
+    #[event(input = "ViewId", output = "DocumentDelta")]
+    OpenView = 207,
 
-    #[event(input = "QueryViewRequest")]
+    #[event(input = "ViewId")]
     CloseView = 208,
 
     #[event(output = "RepeatedTrash")]
@@ -154,7 +154,7 @@ pub enum FolderEvent {
     #[event(input = "DocumentDelta", output = "DocumentDelta")]
     ApplyDocDelta = 400,
 
-    #[event(input = "ExportRequest", output = "ExportData")]
+    #[event(input = "ExportPayload", output = "ExportData")]
     ExportDocument = 500,
 }
 

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

@@ -41,7 +41,7 @@ pub enum FolderEvent {
     DeleteView = 204,
     DuplicateView = 205,
     CopyLink = 206,
-    OpenDocument = 207,
+    OpenView = 207,
     CloseView = 208,
     ReadTrash = 300,
     PutbackTrash = 301,
@@ -75,7 +75,7 @@ impl ::protobuf::ProtobufEnum for FolderEvent {
             204 => ::std::option::Option::Some(FolderEvent::DeleteView),
             205 => ::std::option::Option::Some(FolderEvent::DuplicateView),
             206 => ::std::option::Option::Some(FolderEvent::CopyLink),
-            207 => ::std::option::Option::Some(FolderEvent::OpenDocument),
+            207 => ::std::option::Option::Some(FolderEvent::OpenView),
             208 => ::std::option::Option::Some(FolderEvent::CloseView),
             300 => ::std::option::Option::Some(FolderEvent::ReadTrash),
             301 => ::std::option::Option::Some(FolderEvent::PutbackTrash),
@@ -106,7 +106,7 @@ impl ::protobuf::ProtobufEnum for FolderEvent {
             FolderEvent::DeleteView,
             FolderEvent::DuplicateView,
             FolderEvent::CopyLink,
-            FolderEvent::OpenDocument,
+            FolderEvent::OpenView,
             FolderEvent::CloseView,
             FolderEvent::ReadTrash,
             FolderEvent::PutbackTrash,
@@ -143,19 +143,19 @@ impl ::protobuf::reflect::ProtobufValue for FolderEvent {
 }
 
 static file_descriptor_proto_data: &'static [u8] = b"\
-    \n\x0fevent_map.proto*\xd6\x03\n\x0bFolderEvent\x12\x13\n\x0fCreateWorks\
+    \n\x0fevent_map.proto*\xd2\x03\n\x0bFolderEvent\x12\x13\n\x0fCreateWorks\
     pace\x10\0\x12\x14\n\x10ReadCurWorkspace\x10\x01\x12\x12\n\x0eReadWorksp\
     aces\x10\x02\x12\x13\n\x0fDeleteWorkspace\x10\x03\x12\x11\n\rOpenWorkspa\
     ce\x10\x04\x12\x15\n\x11ReadWorkspaceApps\x10\x05\x12\r\n\tCreateApp\x10\
     e\x12\r\n\tDeleteApp\x10f\x12\x0b\n\x07ReadApp\x10g\x12\r\n\tUpdateApp\
     \x10h\x12\x0f\n\nCreateView\x10\xc9\x01\x12\r\n\x08ReadView\x10\xca\x01\
     \x12\x0f\n\nUpdateView\x10\xcb\x01\x12\x0f\n\nDeleteView\x10\xcc\x01\x12\
-    \x12\n\rDuplicateView\x10\xcd\x01\x12\r\n\x08CopyLink\x10\xce\x01\x12\
-    \x11\n\x0cOpenDocument\x10\xcf\x01\x12\x0e\n\tCloseView\x10\xd0\x01\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\
-    \x02\x12\x13\n\x0eDeleteAllTrash\x10\xb0\x02\x12\x12\n\rApplyDocDelta\
-    \x10\x90\x03\x12\x13\n\x0eExportDocument\x10\xf4\x03b\x06proto3\
+    \x12\n\rDuplicateView\x10\xcd\x01\x12\r\n\x08CopyLink\x10\xce\x01\x12\r\
+    \n\x08OpenView\x10\xcf\x01\x12\x0e\n\tCloseView\x10\xd0\x01\x12\x0e\n\tR\
+    eadTrash\x10\xac\x02\x12\x11\n\x0cPutbackTrash\x10\xad\x02\x12\x10\n\x0b\
+    DeleteTrash\x10\xae\x02\x12\x14\n\x0fRestoreAllTrash\x10\xaf\x02\x12\x13\
+    \n\x0eDeleteAllTrash\x10\xb0\x02\x12\x12\n\rApplyDocDelta\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;

+ 1 - 1
frontend/rust-lib/flowy-folder/src/protobuf/proto/event_map.proto

@@ -17,7 +17,7 @@ enum FolderEvent {
     DeleteView = 204;
     DuplicateView = 205;
     CopyLink = 206;
-    OpenDocument = 207;
+    OpenView = 207;
     CloseView = 208;
     ReadTrash = 300;
     PutbackTrash = 301;

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

@@ -64,7 +64,7 @@ impl AppController {
         let app = self
             .persistence
             .begin_transaction(|transaction| {
-                let app = transaction.read_app(&params.app_id)?;
+                let app = transaction.read_app(&params.value)?;
                 let trash_ids = self.trash_controller.read_trash_ids(&transaction)?;
                 if trash_ids.contains(&app.id) {
                     return Err(FlowyError::record_not_found());

+ 9 - 9
frontend/rust-lib/flowy-folder/src/services/app/event_handler.rs

@@ -1,6 +1,6 @@
 use crate::{
     entities::{
-        app::{App, AppId, CreateAppParams, CreateAppRequest, QueryAppRequest, UpdateAppParams, UpdateAppRequest},
+        app::{App, AppId, CreateAppParams, CreateAppPayload, UpdateAppParams, UpdateAppPayload},
         trash::Trash,
     },
     errors::FlowyError,
@@ -10,7 +10,7 @@ use lib_dispatch::prelude::{data_result, Data, DataResult, Unit};
 use std::{convert::TryInto, sync::Arc};
 
 pub(crate) async fn create_app_handler(
-    data: Data<CreateAppRequest>,
+    data: Data<CreateAppPayload>,
     controller: Unit<Arc<AppController>>,
 ) -> DataResult<App, FlowyError> {
     let params: CreateAppParams = data.into_inner().try_into()?;
@@ -20,13 +20,13 @@ pub(crate) async fn create_app_handler(
 }
 
 pub(crate) async fn delete_app_handler(
-    data: Data<QueryAppRequest>,
+    data: Data<AppId>,
     app_controller: Unit<Arc<AppController>>,
     trash_controller: Unit<Arc<TrashController>>,
 ) -> Result<(), FlowyError> {
-    let params: AppId = data.into_inner().try_into()?;
+    let params: AppId = data.into_inner();
     let trash = app_controller
-        .read_local_apps(vec![params.app_id])
+        .read_local_apps(vec![params.value])
         .await?
         .into_iter()
         .map(|app| app.into())
@@ -38,7 +38,7 @@ pub(crate) async fn delete_app_handler(
 
 #[tracing::instrument(skip(data, controller))]
 pub(crate) async fn update_app_handler(
-    data: Data<UpdateAppRequest>,
+    data: Data<UpdateAppPayload>,
     controller: Unit<Arc<AppController>>,
 ) -> Result<(), FlowyError> {
     let params: UpdateAppParams = data.into_inner().try_into()?;
@@ -48,13 +48,13 @@ pub(crate) async fn update_app_handler(
 
 #[tracing::instrument(skip(data, app_controller, view_controller))]
 pub(crate) async fn read_app_handler(
-    data: Data<QueryAppRequest>,
+    data: Data<AppId>,
     app_controller: Unit<Arc<AppController>>,
     view_controller: Unit<Arc<ViewController>>,
 ) -> DataResult<App, FlowyError> {
-    let params: AppId = data.into_inner().try_into()?;
+    let params: AppId = data.into_inner();
     let mut app = app_controller.read_app(params.clone()).await?;
-    app.belongings = view_controller.read_views_belong_to(&params.app_id).await?;
+    app.belongings = view_controller.read_views_belong_to(&params.value).await?;
 
     data_result(app)
 }

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

@@ -113,12 +113,12 @@ impl ViewController {
             .await
     }
 
-    #[tracing::instrument(skip(self, params), fields(view_id = %params.view_id), err)]
-    pub(crate) async fn read_view(&self, params: ViewId) -> Result<View, FlowyError> {
+    #[tracing::instrument(skip(self, view_id), fields(view_id = %view_id.value), err)]
+    pub(crate) async fn read_view(&self, view_id: ViewId) -> Result<View, FlowyError> {
         let view = self
             .persistence
             .begin_transaction(|transaction| {
-                let view = transaction.read_view(&params.view_id)?;
+                let view = transaction.read_view(&view_id.value)?;
                 let trash_ids = self.trash_controller.read_trash_ids(&transaction)?;
                 if trash_ids.contains(&view.id) {
                     return Err(FlowyError::record_not_found());
@@ -126,7 +126,7 @@ impl ViewController {
                 Ok(view)
             })
             .await?;
-        let _ = self.read_view_on_server(params);
+        let _ = self.read_view_on_server(view_id);
         Ok(view)
     }
 
@@ -159,14 +159,14 @@ impl ViewController {
         Ok(())
     }
 
-    #[tracing::instrument(level = "debug", skip(self,params), fields(doc_id = %params.doc_id), err)]
+    #[tracing::instrument(level = "debug", skip(self,params), fields(doc_id = %params.value), err)]
     pub(crate) async fn delete_view(&self, params: DocumentId) -> Result<(), FlowyError> {
         if let Some(view_id) = KV::get_str(LATEST_VIEW_ID) {
-            if view_id == params.doc_id {
+            if view_id == params.value {
                 let _ = KV::remove(LATEST_VIEW_ID);
             }
         }
-        let _ = self.document_manager.close_document(&params.doc_id)?;
+        let _ = self.document_manager.close_document(&params.value)?;
         Ok(())
     }
 

+ 20 - 21
frontend/rust-lib/flowy-folder/src/services/view/event_handler.rs

@@ -2,20 +2,19 @@ use crate::{
     entities::{
         trash::Trash,
         view::{
-            CreateViewParams, CreateViewRequest, QueryViewRequest, RepeatedViewId, UpdateViewParams, UpdateViewRequest,
-            View, ViewId,
+            CreateViewParams, CreateViewPayload, RepeatedViewId, UpdateViewParams, UpdateViewPayload, View, ViewId,
         },
     },
     errors::FlowyError,
     services::{TrashController, ViewController},
 };
 use flowy_collaboration::entities::document_info::DocumentDelta;
-use flowy_folder_data_model::entities::share::{ExportData, ExportParams, ExportRequest};
+use flowy_folder_data_model::entities::share::{ExportData, ExportParams, ExportPayload};
 use lib_dispatch::prelude::{data_result, Data, DataResult, Unit};
 use std::{convert::TryInto, sync::Arc};
 
 pub(crate) async fn create_view_handler(
-    data: Data<CreateViewRequest>,
+    data: Data<CreateViewPayload>,
     controller: Unit<Arc<ViewController>>,
 ) -> DataResult<View, FlowyError> {
     let params: CreateViewParams = data.into_inner().try_into()?;
@@ -24,21 +23,21 @@ pub(crate) async fn create_view_handler(
 }
 
 pub(crate) async fn read_view_handler(
-    data: Data<QueryViewRequest>,
+    data: Data<ViewId>,
     controller: Unit<Arc<ViewController>>,
 ) -> DataResult<View, FlowyError> {
-    let params: ViewId = data.into_inner().try_into()?;
-    let mut view = controller.read_view(params.clone()).await?;
+    let view_id: ViewId = data.into_inner();
+    let mut view = controller.read_view(view_id.clone()).await?;
     // For the moment, app and view can contains lots of views. Reading the view
     // belongings using the view_id.
-    view.belongings = controller.read_views_belong_to(&params.view_id).await?;
+    view.belongings = controller.read_views_belong_to(&view_id.value).await?;
 
     data_result(view)
 }
 
 #[tracing::instrument(skip(data, controller), err)]
 pub(crate) async fn update_view_handler(
-    data: Data<UpdateViewRequest>,
+    data: Data<UpdateViewPayload>,
     controller: Unit<Arc<ViewController>>,
 ) -> Result<(), FlowyError> {
     let params: UpdateViewParams = data.into_inner().try_into()?;
@@ -56,11 +55,11 @@ pub(crate) async fn document_delta_handler(
 }
 
 pub(crate) async fn delete_view_handler(
-    data: Data<QueryViewRequest>,
+    data: Data<RepeatedViewId>,
     view_controller: Unit<Arc<ViewController>>,
     trash_controller: Unit<Arc<TrashController>>,
 ) -> Result<(), FlowyError> {
-    let params: RepeatedViewId = data.into_inner().try_into()?;
+    let params: RepeatedViewId = data.into_inner();
     for view_id in &params.items {
         let _ = view_controller.delete_view(view_id.into()).await;
     }
@@ -77,36 +76,36 @@ pub(crate) async fn delete_view_handler(
 }
 
 pub(crate) async fn open_document_handler(
-    data: Data<QueryViewRequest>,
+    data: Data<ViewId>,
     controller: Unit<Arc<ViewController>>,
 ) -> DataResult<DocumentDelta, FlowyError> {
-    let params: ViewId = data.into_inner().try_into()?;
-    let doc = controller.open_document(&params.view_id).await?;
+    let view_id: ViewId = data.into_inner();
+    let doc = controller.open_document(&view_id.value).await?;
     data_result(doc)
 }
 
 pub(crate) async fn close_view_handler(
-    data: Data<QueryViewRequest>,
+    data: Data<ViewId>,
     controller: Unit<Arc<ViewController>>,
 ) -> Result<(), FlowyError> {
-    let params: ViewId = data.into_inner().try_into()?;
-    let _ = controller.close_view(&params.view_id).await?;
+    let view_id: ViewId = data.into_inner();
+    let _ = controller.close_view(&view_id.value).await?;
     Ok(())
 }
 
 #[tracing::instrument(skip(data, controller), err)]
 pub(crate) async fn duplicate_view_handler(
-    data: Data<QueryViewRequest>,
+    data: Data<ViewId>,
     controller: Unit<Arc<ViewController>>,
 ) -> Result<(), FlowyError> {
-    let params: ViewId = data.into_inner().try_into()?;
-    let _ = controller.duplicate_view(&params.view_id).await?;
+    let view_id: ViewId = data.into_inner();
+    let _ = controller.duplicate_view(&view_id.value).await?;
     Ok(())
 }
 
 #[tracing::instrument(skip(data, controller), err)]
 pub(crate) async fn export_handler(
-    data: Data<ExportRequest>,
+    data: Data<ExportPayload>,
     controller: Unit<Arc<ViewController>>,
 ) -> DataResult<ExportData, FlowyError> {
     let params: ExportParams = data.into_inner().try_into()?;

+ 2 - 2
frontend/rust-lib/flowy-folder/src/services/workspace/controller.rs

@@ -96,7 +96,7 @@ impl WorkspaceController {
 
     pub(crate) async fn open_workspace(&self, params: WorkspaceId) -> Result<Workspace, FlowyError> {
         let user_id = self.user.user_id()?;
-        if let Some(workspace_id) = params.workspace_id {
+        if let Some(workspace_id) = params.value {
             let workspace = self
                 .persistence
                 .begin_transaction(|transaction| self.read_local_workspace(workspace_id, &user_id, &transaction))
@@ -174,7 +174,7 @@ impl WorkspaceController {
     #[tracing::instrument(level = "trace", skip(self), err)]
     fn delete_workspace_on_server(&self, workspace_id: &str) -> Result<(), FlowyError> {
         let params = WorkspaceId {
-            workspace_id: Some(workspace_id.to_string()),
+            value: Some(workspace_id.to_string()),
         };
         let (token, server) = (self.user.token()?, self.cloud_service.clone());
         tokio::spawn(async move {

+ 8 - 8
frontend/rust-lib/flowy-folder/src/services/workspace/event_handler.rs

@@ -7,7 +7,7 @@ use crate::{
 use flowy_folder_data_model::entities::{
     app::RepeatedApp,
     view::View,
-    workspace::{CurrentWorkspaceSetting, QueryWorkspaceRequest, RepeatedWorkspace, WorkspaceId, *},
+    workspace::{CurrentWorkspaceSetting, RepeatedWorkspace, WorkspaceId, *},
 };
 
 use lib_dispatch::prelude::{data_result, Data, DataResult, Unit};
@@ -15,7 +15,7 @@ use std::{convert::TryInto, sync::Arc};
 
 #[tracing::instrument(skip(data, controller), err)]
 pub(crate) async fn create_workspace_handler(
-    data: Data<CreateWorkspaceRequest>,
+    data: Data<CreateWorkspacePayload>,
     controller: Unit<Arc<WorkspaceController>>,
 ) -> DataResult<Workspace, FlowyError> {
     let controller = controller.get_ref().clone();
@@ -34,20 +34,20 @@ pub(crate) async fn read_workspace_apps_handler(
 
 #[tracing::instrument(skip(data, controller), err)]
 pub(crate) async fn open_workspace_handler(
-    data: Data<QueryWorkspaceRequest>,
+    data: Data<WorkspaceId>,
     controller: Unit<Arc<WorkspaceController>>,
 ) -> DataResult<Workspace, FlowyError> {
-    let params: WorkspaceId = data.into_inner().try_into()?;
+    let params: WorkspaceId = data.into_inner();
     let workspaces = controller.open_workspace(params).await?;
     data_result(workspaces)
 }
 
 #[tracing::instrument(skip(data, folder), err)]
 pub(crate) async fn read_workspaces_handler(
-    data: Data<QueryWorkspaceRequest>,
+    data: Data<WorkspaceId>,
     folder: Unit<Arc<FolderManager>>,
 ) -> DataResult<RepeatedWorkspace, FlowyError> {
-    let params: WorkspaceId = data.into_inner().try_into()?;
+    let params: WorkspaceId = data.into_inner();
     let user_id = folder.user.user_id()?;
     let workspace_controller = folder.workspace_controller.clone();
 
@@ -56,7 +56,7 @@ pub(crate) async fn read_workspaces_handler(
         .persistence
         .begin_transaction(|transaction| {
             let mut workspaces =
-                workspace_controller.read_local_workspaces(params.workspace_id.clone(), &user_id, &transaction)?;
+                workspace_controller.read_local_workspaces(params.value.clone(), &user_id, &transaction)?;
             for workspace in workspaces.iter_mut() {
                 let apps =
                     read_local_workspace_apps(&workspace.id, trash_controller.clone(), &transaction)?.into_inner();
@@ -76,7 +76,7 @@ pub async fn read_cur_workspace_handler(
     let workspace_id = get_current_workspace()?;
     let user_id = folder.user.user_id()?;
     let params = WorkspaceId {
-        workspace_id: Some(workspace_id.clone()),
+        value: Some(workspace_id.clone()),
     };
 
     let workspace = folder

+ 3 - 3
frontend/rust-lib/flowy-folder/tests/workspace/folder_test.rs

@@ -1,6 +1,6 @@
 use crate::script::{invalid_workspace_name_test_case, FolderScript::*, FolderTest};
 use flowy_collaboration::{client_document::default::initial_delta_string, entities::revision::RevisionState};
-use flowy_folder::entities::workspace::CreateWorkspaceRequest;
+use flowy_folder::entities::workspace::CreateWorkspacePayload;
 use flowy_test::{event_builder::*, FlowySDKTest};
 
 #[tokio::test]
@@ -64,14 +64,14 @@ async fn workspace_create_with_apps() {
 async fn workspace_create_with_invalid_name() {
     for (name, code) in invalid_workspace_name_test_case() {
         let sdk = FlowySDKTest::default();
-        let request = CreateWorkspaceRequest {
+        let request = CreateWorkspacePayload {
             name,
             desc: "".to_owned(),
         };
         assert_eq!(
             FolderEventBuilder::new(sdk)
                 .event(flowy_folder::event_map::FolderEvent::CreateWorkspace)
-                .request(request)
+                .payload(request)
                 .async_send()
                 .await
                 .error()

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

@@ -1,22 +1,24 @@
 use flowy_collaboration::entities::document_info::DocumentInfo;
 use flowy_folder::event_map::FolderEvent::*;
+use flowy_folder_data_model::entities::view::{RepeatedViewId, ViewId};
+use flowy_folder_data_model::entities::workspace::WorkspaceId;
 use flowy_folder_data_model::entities::{
-    app::{App, AppId, CreateAppRequest, QueryAppRequest, UpdateAppRequest},
+    app::{App, AppId, CreateAppPayload, UpdateAppPayload},
     trash::{RepeatedTrash, TrashId, TrashType},
-    view::{CreateViewRequest, QueryViewRequest, UpdateViewRequest, View, ViewType},
-    workspace::{CreateWorkspaceRequest, QueryWorkspaceRequest, RepeatedWorkspace, Workspace},
+    view::{CreateViewPayload, UpdateViewPayload, View, ViewType},
+    workspace::{CreateWorkspacePayload, RepeatedWorkspace, Workspace},
 };
 use flowy_test::{event_builder::*, FlowySDKTest};
 
 pub async fn create_workspace(sdk: &FlowySDKTest, name: &str, desc: &str) -> Workspace {
-    let request = CreateWorkspaceRequest {
+    let request = CreateWorkspacePayload {
         name: name.to_owned(),
         desc: desc.to_owned(),
     };
 
     let workspace = FolderEventBuilder::new(sdk.clone())
         .event(CreateWorkspace)
-        .request(request)
+        .payload(request)
         .async_send()
         .await
         .parse::<Workspace>();
@@ -24,16 +26,16 @@ pub async fn create_workspace(sdk: &FlowySDKTest, name: &str, desc: &str) -> Wor
 }
 
 pub async fn read_workspace(sdk: &FlowySDKTest, workspace_id: Option<String>) -> Vec<Workspace> {
-    let request = QueryWorkspaceRequest { workspace_id };
+    let request = WorkspaceId { value: workspace_id };
     let repeated_workspace = FolderEventBuilder::new(sdk.clone())
         .event(ReadWorkspaces)
-        .request(request.clone())
+        .payload(request.clone())
         .async_send()
         .await
         .parse::<RepeatedWorkspace>();
 
     let workspaces;
-    if let Some(workspace_id) = &request.workspace_id {
+    if let Some(workspace_id) = &request.value {
         workspaces = repeated_workspace
             .into_inner()
             .into_iter()
@@ -48,7 +50,7 @@ pub async fn read_workspace(sdk: &FlowySDKTest, workspace_id: Option<String>) ->
 }
 
 pub async fn create_app(sdk: &FlowySDKTest, workspace_id: &str, name: &str, desc: &str) -> App {
-    let create_app_request = CreateAppRequest {
+    let create_app_request = CreateAppPayload {
         workspace_id: workspace_id.to_owned(),
         name: name.to_string(),
         desc: desc.to_string(),
@@ -57,7 +59,7 @@ pub async fn create_app(sdk: &FlowySDKTest, workspace_id: &str, name: &str, desc
 
     let app = FolderEventBuilder::new(sdk.clone())
         .event(CreateApp)
-        .request(create_app_request)
+        .payload(create_app_request)
         .async_send()
         .await
         .parse::<App>();
@@ -65,13 +67,13 @@ pub async fn create_app(sdk: &FlowySDKTest, workspace_id: &str, name: &str, desc
 }
 
 pub async fn read_app(sdk: &FlowySDKTest, app_id: &str) -> App {
-    let request = QueryAppRequest {
-        app_ids: vec![app_id.to_owned()],
+    let request = AppId {
+        value: app_id.to_owned(),
     };
 
     let app = FolderEventBuilder::new(sdk.clone())
         .event(ReadApp)
-        .request(request)
+        .payload(request)
         .async_send()
         .await
         .parse::<App>();
@@ -80,7 +82,7 @@ pub async fn read_app(sdk: &FlowySDKTest, app_id: &str) -> App {
 }
 
 pub async fn update_app(sdk: &FlowySDKTest, app_id: &str, name: Option<String>, desc: Option<String>) {
-    let request = UpdateAppRequest {
+    let request = UpdateAppPayload {
         app_id: app_id.to_string(),
         name,
         desc,
@@ -90,25 +92,25 @@ pub async fn update_app(sdk: &FlowySDKTest, app_id: &str, name: Option<String>,
 
     FolderEventBuilder::new(sdk.clone())
         .event(UpdateApp)
-        .request(request)
+        .payload(request)
         .async_send()
         .await;
 }
 
 pub async fn delete_app(sdk: &FlowySDKTest, app_id: &str) {
     let request = AppId {
-        app_id: app_id.to_string(),
+        value: app_id.to_string(),
     };
 
     FolderEventBuilder::new(sdk.clone())
         .event(DeleteApp)
-        .request(request)
+        .payload(request)
         .async_send()
         .await;
 }
 
 pub async fn create_view(sdk: &FlowySDKTest, app_id: &str, name: &str, desc: &str, view_type: ViewType) -> View {
-    let request = CreateViewRequest {
+    let request = CreateViewPayload {
         belong_to_id: app_id.to_string(),
         name: name.to_string(),
         desc: desc.to_string(),
@@ -117,25 +119,25 @@ pub async fn create_view(sdk: &FlowySDKTest, app_id: &str, name: &str, desc: &st
     };
     let view = FolderEventBuilder::new(sdk.clone())
         .event(CreateView)
-        .request(request)
+        .payload(request)
         .async_send()
         .await
         .parse::<View>();
     view
 }
 
-pub async fn read_view(sdk: &FlowySDKTest, view_ids: Vec<String>) -> View {
-    let request = QueryViewRequest { view_ids };
+pub async fn read_view(sdk: &FlowySDKTest, view_id: &str) -> View {
+    let view_id: ViewId = view_id.into();
     FolderEventBuilder::new(sdk.clone())
         .event(ReadView)
-        .request(request)
+        .payload(view_id)
         .async_send()
         .await
         .parse::<View>()
 }
 
 pub async fn update_view(sdk: &FlowySDKTest, view_id: &str, name: Option<String>, desc: Option<String>) {
-    let request = UpdateViewRequest {
+    let request = UpdateViewPayload {
         view_id: view_id.to_string(),
         name,
         desc,
@@ -143,27 +145,25 @@ pub async fn update_view(sdk: &FlowySDKTest, view_id: &str, name: Option<String>
     };
     FolderEventBuilder::new(sdk.clone())
         .event(UpdateView)
-        .request(request)
+        .payload(request)
         .async_send()
         .await;
 }
 
 pub async fn delete_view(sdk: &FlowySDKTest, view_ids: Vec<String>) {
-    let request = QueryViewRequest { view_ids };
+    let request = RepeatedViewId { items: view_ids };
     FolderEventBuilder::new(sdk.clone())
         .event(DeleteView)
-        .request(request)
+        .payload(request)
         .async_send()
         .await;
 }
 
 pub async fn open_document(sdk: &FlowySDKTest, view_id: &str) -> DocumentInfo {
-    let request = QueryViewRequest {
-        view_ids: vec![view_id.to_owned()],
-    };
+    let view_id: ViewId = view_id.into();
     FolderEventBuilder::new(sdk.clone())
-        .event(OpenDocument)
-        .request(request)
+        .event(OpenView)
+        .payload(view_id)
         .async_send()
         .await
         .parse::<DocumentInfo>()
@@ -184,7 +184,7 @@ pub async fn restore_app_from_trash(sdk: &FlowySDKTest, app_id: &str) {
     };
     FolderEventBuilder::new(sdk.clone())
         .event(PutbackTrash)
-        .request(id)
+        .payload(id)
         .async_send()
         .await;
 }
@@ -196,7 +196,7 @@ pub async fn restore_view_from_trash(sdk: &FlowySDKTest, view_id: &str) {
     };
     FolderEventBuilder::new(sdk.clone())
         .event(PutbackTrash)
-        .request(id)
+        .payload(id)
         .async_send()
         .await;
 }

+ 1 - 1
frontend/rust-lib/flowy-folder/tests/workspace/script.rs

@@ -153,7 +153,7 @@ impl FolderTest {
                 assert_eq!(self.view, view);
             }
             FolderScript::ReadView(view_id) => {
-                let view = read_view(sdk, vec![view_id]).await;
+                let view = read_view(sdk, &view_id).await;
                 self.view = view;
             }
             FolderScript::UpdateView { name, desc } => {

+ 1 - 1
frontend/rust-lib/flowy-net/src/local_server/server.rs

@@ -413,7 +413,7 @@ impl DocumentCloudService for LocalServer {
 
     fn read_document(&self, _token: &str, params: DocumentId) -> FutureResult<Option<DocumentInfo>, FlowyError> {
         let doc = DocumentInfo {
-            doc_id: params.doc_id,
+            doc_id: params.value,
             text: initial_delta_string(),
             rev_id: 0,
             base_rev_id: 0,

+ 1 - 1
frontend/rust-lib/flowy-test/src/event_builder.rs

@@ -40,7 +40,7 @@ where
         }
     }
 
-    pub fn request<P>(mut self, payload: P) -> Self
+    pub fn payload<P>(mut self, payload: P) -> Self
     where
         P: ToBytes,
     {

+ 15 - 14
frontend/rust-lib/flowy-test/src/helper.rs

@@ -1,14 +1,15 @@
 use crate::prelude::*;
+use flowy_folder::prelude::WorkspaceId;
 use flowy_folder::{
     entities::{
         app::*,
         view::*,
-        workspace::{CreateWorkspaceRequest, QueryWorkspaceRequest, Workspace},
+        workspace::{CreateWorkspacePayload, Workspace},
     },
     event_map::FolderEvent::{CreateWorkspace, OpenWorkspace, *},
 };
 use flowy_user::{
-    entities::{SignInRequest, SignUpRequest, UserProfile},
+    entities::{SignInPayload, SignUpPayload, UserProfile},
     errors::FlowyError,
     event_map::UserEvent::{InitUser, SignIn, SignOut, SignUp},
 };
@@ -39,14 +40,14 @@ impl ViewTest {
 }
 
 async fn create_workspace(sdk: &FlowySDKTest, name: &str, desc: &str) -> Workspace {
-    let request = CreateWorkspaceRequest {
+    let request = CreateWorkspacePayload {
         name: name.to_owned(),
         desc: desc.to_owned(),
     };
 
     let workspace = FolderEventBuilder::new(sdk.clone())
         .event(CreateWorkspace)
-        .request(request)
+        .payload(request)
         .async_send()
         .await
         .parse::<Workspace>();
@@ -54,18 +55,18 @@ async fn create_workspace(sdk: &FlowySDKTest, name: &str, desc: &str) -> Workspa
 }
 
 async fn open_workspace(sdk: &FlowySDKTest, workspace_id: &str) {
-    let request = QueryWorkspaceRequest {
-        workspace_id: Some(workspace_id.to_owned()),
+    let payload = WorkspaceId {
+        value: Some(workspace_id.to_owned()),
     };
     let _ = FolderEventBuilder::new(sdk.clone())
         .event(OpenWorkspace)
-        .request(request)
+        .payload(payload)
         .async_send()
         .await;
 }
 
 async fn create_app(sdk: &FlowySDKTest, name: &str, desc: &str, workspace_id: &str) -> App {
-    let create_app_request = CreateAppRequest {
+    let create_app_request = CreateAppPayload {
         workspace_id: workspace_id.to_owned(),
         name: name.to_string(),
         desc: desc.to_string(),
@@ -74,7 +75,7 @@ async fn create_app(sdk: &FlowySDKTest, name: &str, desc: &str, workspace_id: &s
 
     let app = FolderEventBuilder::new(sdk.clone())
         .event(CreateApp)
-        .request(create_app_request)
+        .payload(create_app_request)
         .async_send()
         .await
         .parse::<App>();
@@ -82,7 +83,7 @@ async fn create_app(sdk: &FlowySDKTest, name: &str, desc: &str, workspace_id: &s
 }
 
 async fn create_view(sdk: &FlowySDKTest, app_id: &str) -> View {
-    let request = CreateViewRequest {
+    let request = CreateViewPayload {
         belong_to_id: app_id.to_string(),
         name: "View A".to_string(),
         desc: "".to_string(),
@@ -92,7 +93,7 @@ async fn create_view(sdk: &FlowySDKTest, app_id: &str) -> View {
 
     let view = FolderEventBuilder::new(sdk.clone())
         .event(CreateView)
-        .request(request)
+        .payload(request)
         .async_send()
         .await
         .parse::<View>();
@@ -133,7 +134,7 @@ pub struct SignUpContext {
 
 pub fn sign_up(dispatch: Arc<EventDispatcher>) -> SignUpContext {
     let password = login_password();
-    let payload = SignUpRequest {
+    let payload = SignUpPayload {
         email: random_email(),
         name: "app flowy".to_string(),
         password: password.clone(),
@@ -152,7 +153,7 @@ pub fn sign_up(dispatch: Arc<EventDispatcher>) -> SignUpContext {
 
 pub async fn async_sign_up(dispatch: Arc<EventDispatcher>) -> SignUpContext {
     let password = login_password();
-    let payload = SignUpRequest {
+    let payload = SignUpPayload {
         email: random_email(),
         name: "app flowy".to_string(),
         password: password.clone(),
@@ -178,7 +179,7 @@ pub async fn init_user_setting(dispatch: Arc<EventDispatcher>) {
 
 #[allow(dead_code)]
 fn sign_in(dispatch: Arc<EventDispatcher>) -> UserProfile {
-    let payload = SignInRequest {
+    let payload = SignInPayload {
         email: login_email(),
         password: login_password(),
         name: "rust".to_owned(),

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

@@ -39,16 +39,16 @@ pub enum UserEvent {
     #[event()]
     InitUser = 0,
 
-    #[event(input = "SignInRequest", output = "UserProfile")]
+    #[event(input = "SignInPayload", output = "UserProfile")]
     SignIn = 1,
 
-    #[event(input = "SignUpRequest", output = "UserProfile")]
+    #[event(input = "SignUpPayload", output = "UserProfile")]
     SignUp = 2,
 
     #[event(passthrough)]
     SignOut = 3,
 
-    #[event(input = "UpdateUserRequest")]
+    #[event(input = "UpdateUserPayload")]
     UpdateUser = 4,
 
     #[event(output = "UserProfile")]

+ 2 - 2
frontend/rust-lib/flowy-user/src/handlers/auth_handler.rs

@@ -7,7 +7,7 @@ use std::{convert::TryInto, sync::Arc};
 // tracing instrument 👉🏻 https://docs.rs/tracing/0.1.26/tracing/attr.instrument.html
 #[tracing::instrument(name = "sign_in", skip(data, session), fields(email = %data.email), err)]
 pub async fn sign_in(
-    data: Data<SignInRequest>,
+    data: Data<SignInPayload>,
     session: Unit<Arc<UserSession>>,
 ) -> DataResult<UserProfile, FlowyError> {
     let params: SignInParams = data.into_inner().try_into()?;
@@ -25,7 +25,7 @@ pub async fn sign_in(
     err
 )]
 pub async fn sign_up(
-    data: Data<SignUpRequest>,
+    data: Data<SignUpPayload>,
     session: Unit<Arc<UserSession>>,
 ) -> DataResult<UserProfile, FlowyError> {
     let params: SignUpParams = data.into_inner().try_into()?;

+ 2 - 2
frontend/rust-lib/flowy-user/src/handlers/user_handler.rs

@@ -1,7 +1,7 @@
 use crate::{errors::FlowyError, services::UserSession};
 use flowy_database::kv::KV;
 use flowy_user_data_model::entities::{
-    AppearanceSettings, UpdateUserParams, UpdateUserRequest, UserProfile, APPEARANCE_DEFAULT_THEME,
+    AppearanceSettings, UpdateUserParams, UpdateUserPayload, UserProfile, APPEARANCE_DEFAULT_THEME,
 };
 use lib_dispatch::prelude::*;
 use std::{convert::TryInto, sync::Arc};
@@ -32,7 +32,7 @@ pub async fn sign_out(session: Unit<Arc<UserSession>>) -> Result<(), FlowyError>
 
 #[tracing::instrument(name = "update_user", skip(data, session))]
 pub async fn update_user_handler(
-    data: Data<UpdateUserRequest>,
+    data: Data<UpdateUserPayload>,
     session: Unit<Arc<UserSession>>,
 ) -> Result<(), FlowyError> {
     let params: UpdateUserParams = data.into_inner().try_into()?;

+ 11 - 11
frontend/rust-lib/flowy-user/tests/event/auth_test.rs

@@ -1,13 +1,13 @@
 use crate::helper::*;
 use flowy_test::{event_builder::UserModuleEventBuilder, FlowySDKTest};
 use flowy_user::{errors::ErrorCode, event_map::UserEvent::*};
-use flowy_user_data_model::entities::{SignInRequest, SignUpRequest, UserProfile};
+use flowy_user_data_model::entities::{SignInPayload, SignUpPayload, UserProfile};
 
 #[tokio::test]
 async fn sign_up_with_invalid_email() {
     for email in invalid_email_test_case() {
         let sdk = FlowySDKTest::default();
-        let request = SignUpRequest {
+        let request = SignUpPayload {
             email: email.to_string(),
             name: valid_name(),
             password: login_password(),
@@ -16,7 +16,7 @@ async fn sign_up_with_invalid_email() {
         assert_eq!(
             UserModuleEventBuilder::new(sdk)
                 .event(SignUp)
-                .request(request)
+                .payload(request)
                 .async_send()
                 .await
                 .error()
@@ -29,7 +29,7 @@ async fn sign_up_with_invalid_email() {
 async fn sign_up_with_invalid_password() {
     for password in invalid_password_test_case() {
         let sdk = FlowySDKTest::default();
-        let request = SignUpRequest {
+        let request = SignUpPayload {
             email: random_email(),
             name: valid_name(),
             password,
@@ -37,7 +37,7 @@ async fn sign_up_with_invalid_password() {
 
         UserModuleEventBuilder::new(sdk)
             .event(SignUp)
-            .request(request)
+            .payload(request)
             .async_send()
             .await
             .assert_error();
@@ -50,7 +50,7 @@ async fn sign_in_success() {
     let _ = UserModuleEventBuilder::new(test.clone()).event(SignOut).sync_send();
     let sign_up_context = test.sign_up().await;
 
-    let request = SignInRequest {
+    let request = SignInPayload {
         email: sign_up_context.user_profile.email.clone(),
         password: sign_up_context.password.clone(),
         name: "".to_string(),
@@ -58,7 +58,7 @@ async fn sign_in_success() {
 
     let response = UserModuleEventBuilder::new(test.clone())
         .event(SignIn)
-        .request(request)
+        .payload(request)
         .async_send()
         .await
         .parse::<UserProfile>();
@@ -69,7 +69,7 @@ async fn sign_in_success() {
 async fn sign_in_with_invalid_email() {
     for email in invalid_email_test_case() {
         let sdk = FlowySDKTest::default();
-        let request = SignInRequest {
+        let request = SignInPayload {
             email: email.to_string(),
             password: login_password(),
             name: "".to_string(),
@@ -78,7 +78,7 @@ async fn sign_in_with_invalid_email() {
         assert_eq!(
             UserModuleEventBuilder::new(sdk)
                 .event(SignIn)
-                .request(request)
+                .payload(request)
                 .async_send()
                 .await
                 .error()
@@ -93,7 +93,7 @@ async fn sign_in_with_invalid_password() {
     for password in invalid_password_test_case() {
         let sdk = FlowySDKTest::default();
 
-        let request = SignInRequest {
+        let request = SignInPayload {
             email: random_email(),
             password,
             name: "".to_string(),
@@ -101,7 +101,7 @@ async fn sign_in_with_invalid_password() {
 
         UserModuleEventBuilder::new(sdk)
             .event(SignIn)
-            .request(request)
+            .payload(request)
             .async_send()
             .await
             .assert_error();

+ 13 - 13
frontend/rust-lib/flowy-user/tests/event/user_profile_test.rs

@@ -1,7 +1,7 @@
 use crate::helper::*;
 use flowy_test::{event_builder::UserModuleEventBuilder, FlowySDKTest};
 use flowy_user::{errors::ErrorCode, event_map::UserEvent::*};
-use flowy_user_data_model::entities::{UpdateUserRequest, UserProfile};
+use flowy_user_data_model::entities::{UpdateUserPayload, UserProfile};
 use lib_infra::uuid_string;
 use serial_test::*;
 
@@ -34,10 +34,10 @@ async fn user_update_with_name() {
     let sdk = FlowySDKTest::default();
     let user = sdk.init_user().await;
     let new_name = "hello_world".to_owned();
-    let request = UpdateUserRequest::new(&user.id).name(&new_name);
+    let request = UpdateUserPayload::new(&user.id).name(&new_name);
     let _ = UserModuleEventBuilder::new(sdk.clone())
         .event(UpdateUser)
-        .request(request)
+        .payload(request)
         .sync_send();
 
     let user_profile = UserModuleEventBuilder::new(sdk.clone())
@@ -55,10 +55,10 @@ async fn user_update_with_email() {
     let sdk = FlowySDKTest::default();
     let user = sdk.init_user().await;
     let new_email = format!("{}@gmail.com", uuid_string());
-    let request = UpdateUserRequest::new(&user.id).email(&new_email);
+    let request = UpdateUserPayload::new(&user.id).email(&new_email);
     let _ = UserModuleEventBuilder::new(sdk.clone())
         .event(UpdateUser)
-        .request(request)
+        .payload(request)
         .sync_send();
     let user_profile = UserModuleEventBuilder::new(sdk.clone())
         .event(GetUserProfile)
@@ -75,11 +75,11 @@ async fn user_update_with_password() {
     let sdk = FlowySDKTest::default();
     let user = sdk.init_user().await;
     let new_password = "H123world!".to_owned();
-    let request = UpdateUserRequest::new(&user.id).password(&new_password);
+    let request = UpdateUserPayload::new(&user.id).password(&new_password);
 
     let _ = UserModuleEventBuilder::new(sdk.clone())
         .event(UpdateUser)
-        .request(request)
+        .payload(request)
         .sync_send()
         .assert_success();
 }
@@ -90,11 +90,11 @@ async fn user_update_with_invalid_email() {
     let test = FlowySDKTest::default();
     let user = test.init_user().await;
     for email in invalid_email_test_case() {
-        let request = UpdateUserRequest::new(&user.id).email(&email);
+        let request = UpdateUserPayload::new(&user.id).email(&email);
         assert_eq!(
             UserModuleEventBuilder::new(test.clone())
                 .event(UpdateUser)
-                .request(request)
+                .payload(request)
                 .sync_send()
                 .error()
                 .code,
@@ -109,11 +109,11 @@ async fn user_update_with_invalid_password() {
     let test = FlowySDKTest::default();
     let user = test.init_user().await;
     for password in invalid_password_test_case() {
-        let request = UpdateUserRequest::new(&user.id).password(&password);
+        let request = UpdateUserPayload::new(&user.id).password(&password);
 
         UserModuleEventBuilder::new(test.clone())
             .event(UpdateUser)
-            .request(request)
+            .payload(request)
             .sync_send()
             .assert_error();
     }
@@ -124,10 +124,10 @@ async fn user_update_with_invalid_password() {
 async fn user_update_with_invalid_name() {
     let test = FlowySDKTest::default();
     let user = test.init_user().await;
-    let request = UpdateUserRequest::new(&user.id).name("");
+    let request = UpdateUserPayload::new(&user.id).name("");
     UserModuleEventBuilder::new(test.clone())
         .event(UpdateUser)
-        .request(request)
+        .payload(request)
         .sync_send()
         .assert_error();
 }

+ 1 - 7
frontend/rust-lib/lib-dispatch/src/byte_trait.rs

@@ -14,13 +14,7 @@ where
     fn into_bytes(self) -> Result<Bytes, DispatchError> {
         match self.try_into() {
             Ok(data) => Ok(data),
-            Err(e) => {
-                // let system_err: DispatchError = InternalError::new(format!("{:?}",
-                // e)).into(); system_err.into()
-                // Err(format!("{:?}", e))
-
-                Err(InternalError::ProtobufError(format!("{:?}", e)).into())
-            }
+            Err(e) => Err(InternalError::ProtobufError(format!("{:?}", e)).into()),
         }
     }
 }

+ 3 - 3
shared-lib/flowy-collaboration/src/entities/document_info.rs

@@ -90,19 +90,19 @@ pub struct NewDocUser {
 #[derive(ProtoBuf, Default, Debug, Clone)]
 pub struct DocumentId {
     #[pb(index = 1)]
-    pub doc_id: String,
+    pub value: String,
 }
 
 impl std::convert::From<String> for DocumentId {
     fn from(doc_id: String) -> Self {
-        DocumentId { doc_id }
+        DocumentId { value: doc_id }
     }
 }
 
 impl std::convert::From<&String> for DocumentId {
     fn from(doc_id: &String) -> Self {
         DocumentId {
-            doc_id: doc_id.to_owned(),
+            value: doc_id.to_owned(),
         }
     }
 }

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

@@ -1166,7 +1166,7 @@ impl ::protobuf::reflect::ProtobufValue for NewDocUser {
 #[derive(PartialEq,Clone,Default)]
 pub struct DocumentId {
     // message fields
-    pub doc_id: ::std::string::String,
+    pub value: ::std::string::String,
     // special fields
     pub unknown_fields: ::protobuf::UnknownFields,
     pub cached_size: ::protobuf::CachedSize,
@@ -1183,30 +1183,30 @@ impl DocumentId {
         ::std::default::Default::default()
     }
 
-    // string doc_id = 1;
+    // string value = 1;
 
 
-    pub fn get_doc_id(&self) -> &str {
-        &self.doc_id
+    pub fn get_value(&self) -> &str {
+        &self.value
     }
-    pub fn clear_doc_id(&mut self) {
-        self.doc_id.clear();
+    pub fn clear_value(&mut self) {
+        self.value.clear();
     }
 
     // Param is passed by value, moved
-    pub fn set_doc_id(&mut self, v: ::std::string::String) {
-        self.doc_id = v;
+    pub fn set_value(&mut self, v: ::std::string::String) {
+        self.value = v;
     }
 
     // Mutable pointer to the field.
     // If field is not initialized, it is initialized with default value first.
-    pub fn mut_doc_id(&mut self) -> &mut ::std::string::String {
-        &mut self.doc_id
+    pub fn mut_value(&mut self) -> &mut ::std::string::String {
+        &mut self.value
     }
 
     // Take field
-    pub fn take_doc_id(&mut self) -> ::std::string::String {
-        ::std::mem::replace(&mut self.doc_id, ::std::string::String::new())
+    pub fn take_value(&mut self) -> ::std::string::String {
+        ::std::mem::replace(&mut self.value, ::std::string::String::new())
     }
 }
 
@@ -1220,7 +1220,7 @@ impl ::protobuf::Message for DocumentId {
             let (field_number, wire_type) = is.read_tag_unpack()?;
             match field_number {
                 1 => {
-                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.doc_id)?;
+                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?;
                 },
                 _ => {
                     ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
@@ -1234,8 +1234,8 @@ impl ::protobuf::Message for DocumentId {
     #[allow(unused_variables)]
     fn compute_size(&self) -> u32 {
         let mut my_size = 0;
-        if !self.doc_id.is_empty() {
-            my_size += ::protobuf::rt::string_size(1, &self.doc_id);
+        if !self.value.is_empty() {
+            my_size += ::protobuf::rt::string_size(1, &self.value);
         }
         my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
         self.cached_size.set(my_size);
@@ -1243,8 +1243,8 @@ impl ::protobuf::Message for DocumentId {
     }
 
     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        if !self.doc_id.is_empty() {
-            os.write_string(1, &self.doc_id)?;
+        if !self.value.is_empty() {
+            os.write_string(1, &self.value)?;
         }
         os.write_unknown_fields(self.get_unknown_fields())?;
         ::std::result::Result::Ok(())
@@ -1285,9 +1285,9 @@ impl ::protobuf::Message for DocumentId {
         descriptor.get(|| {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
-                "doc_id",
-                |m: &DocumentId| { &m.doc_id },
-                |m: &mut DocumentId| { &mut m.doc_id },
+                "value",
+                |m: &DocumentId| { &m.value },
+                |m: &mut DocumentId| { &mut m.value },
             ));
             ::protobuf::reflect::MessageDescriptor::new_pb_name::<DocumentId>(
                 "DocumentId",
@@ -1305,7 +1305,7 @@ impl ::protobuf::Message for DocumentId {
 
 impl ::protobuf::Clear for DocumentId {
     fn clear(&mut self) {
-        self.doc_id.clear();
+        self.value.clear();
         self.unknown_fields.clear();
     }
 }
@@ -1334,8 +1334,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     entDelta\x12\x15\n\x06doc_id\x18\x01\x20\x01(\tR\x05docId\x12\x1d\n\ndel\
     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(\
-    \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\x05docIdb\x06proto3\
+    \x03R\x05revId\x12\x15\n\x06doc_id\x18\x03\x20\x01(\tR\x05docId\"\"\n\nD\
+    ocumentId\x12\x14\n\x05value\x18\x01\x20\x01(\tR\x05valueb\x06proto3\
 ";
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 1 - 1
shared-lib/flowy-collaboration/src/protobuf/proto/document_info.proto

@@ -25,5 +25,5 @@ message NewDocUser {
     string doc_id = 3;
 }
 message DocumentId {
-    string doc_id = 1;
+    string value = 1;
 }

+ 1 - 1
shared-lib/flowy-collaboration/src/synchronizer.rs

@@ -149,7 +149,7 @@ where
 
         match server_rev_id.cmp(&client_rev_id) {
             Ordering::Less => {
-                tracing::error!("Client should not send ping and the server should pull the revisions from the client")
+                tracing::warn!("Client should not send ping and the server should pull the revisions from the client")
             }
             Ordering::Equal => tracing::trace!("{} is up to date.", object_id),
             Ordering::Greater => {

+ 6 - 8
shared-lib/flowy-collaboration/src/util.rs

@@ -112,9 +112,9 @@ pub fn repeated_revision_pb_from_revisions(revisions: Vec<RevisionPB>) -> Repeat
 }
 
 pub fn repeated_revision_from_repeated_revision_pb(
-    mut repeated_revision: RepeatedRevisionPB,
+    repeated_revision: RepeatedRevisionPB,
 ) -> CollaborateResult<RepeatedRevision> {
-    (&mut repeated_revision)
+    repeated_revision
         .try_into()
         .map_err(|e| CollaborateError::internal().context(format!("Cast repeated revision failed: {:?}", e)))
 }
@@ -156,10 +156,8 @@ pub fn make_folder_from_revisions_pb(
 ) -> Result<Option<FolderInfo>, CollaborateError> {
     match make_folder_pb_from_revisions_pb(folder_id, revisions)? {
         None => Ok(None),
-        Some(mut pb) => {
-            let folder_info: FolderInfo = (&mut pb)
-                .try_into()
-                .map_err(|e| CollaborateError::internal().context(e))?;
+        Some(pb) => {
+            let folder_info: FolderInfo = pb.try_into().map_err(|e| CollaborateError::internal().context(e))?;
             Ok(Some(folder_info))
         }
     }
@@ -204,8 +202,8 @@ pub fn make_document_info_from_revisions_pb(
 ) -> Result<Option<DocumentInfo>, CollaborateError> {
     match make_document_info_pb_from_revisions_pb(doc_id, revisions)? {
         None => Ok(None),
-        Some(mut pb) => {
-            let document_info: DocumentInfo = (&mut pb).try_into().map_err(|e| {
+        Some(pb) => {
+            let document_info: DocumentInfo = pb.try_into().map_err(|e| {
                 CollaborateError::internal().context(format!("Deserialize document info from pb failed: {}", e))
             })?;
             Ok(Some(document_info))

+ 9 - 9
shared-lib/flowy-derive/src/proto_buf/deserialize.rs

@@ -25,14 +25,14 @@ pub fn make_de_token_steam(ctxt: &Ctxt, ast: &ASTContainer) -> Option<TokenStrea
         impl std::convert::TryFrom<bytes::Bytes> for #struct_ident {
             type Error = ::protobuf::ProtobufError;
             fn try_from(bytes: bytes::Bytes) -> Result<Self, Self::Error> {
-                let mut pb: crate::protobuf::#pb_ty = ::protobuf::Message::parse_from_bytes(&bytes)?;
-                #struct_ident::try_from(&mut pb)
+                let pb: crate::protobuf::#pb_ty = ::protobuf::Message::parse_from_bytes(&bytes)?;
+                #struct_ident::try_from(pb)
             }
         }
 
-        impl std::convert::TryFrom<&mut crate::protobuf::#pb_ty> for #struct_ident {
+        impl std::convert::TryFrom<crate::protobuf::#pb_ty> for #struct_ident {
             type Error = ::protobuf::ProtobufError;
-            fn try_from(pb: &mut crate::protobuf::#pb_ty) -> Result<Self, Self::Error> {
+            fn try_from(mut pb: crate::protobuf::#pb_ty) -> Result<Self, Self::Error> {
                 let mut o = Self::default();
                 #(#build_take_fields)*
                 Ok(o)
@@ -99,7 +99,7 @@ fn token_stream_for_one_of(ctxt: &Ctxt, field: &ASTField) -> Option<TokenStream>
             let ty = bracketed_ty_info.unwrap().ty;
             Some(quote! {
                 if pb.#has_func() {
-                    let val = #ty::try_from(&mut pb.#take_func()).unwrap();
+                    let val = #ty::try_from(pb.#take_func()).unwrap();
                     o.#member=Some(val);
                 }
             })
@@ -133,7 +133,7 @@ fn token_stream_for_field(ctxt: &Ctxt, member: &syn::Member, ty: &syn::Type, is_
             Some(quote! {
                 let some_value = pb.#member.#take();
                 if some_value.is_some() {
-                    let struct_de_from_pb = #ty::try_from(&mut some_value.unwrap()).unwrap();
+                    let struct_de_from_pb = #ty::try_from(some_value.unwrap()).unwrap();
                     o.#member = struct_de_from_pb;
                 }
             })
@@ -187,7 +187,7 @@ fn token_stream_for_vec(ctxt: &Ctxt, member: &syn::Member, bracketed_type: &TyIn
             Some(quote! {
                 o.#member = pb.#take_ident()
                 .into_iter()
-                .map(|mut m| #ty::try_from(&mut m).unwrap())
+                .map(|m| #ty::try_from(m).unwrap())
                 .collect();
             })
         }
@@ -216,8 +216,8 @@ fn token_stream_for_map(ctxt: &Ctxt, member: &syn::Member, bracketed_type: &TyIn
     match ident_category(bracketed_type.ident) {
         TypeCategory::Protobuf => Some(quote! {
              let mut m: std::collections::HashMap<String, #ty> = std::collections::HashMap::new();
-              pb.#take_ident().into_iter().for_each(|(k,mut v)| {
-                    m.insert(k.clone(), #ty::try_from(&mut v).unwrap());
+              pb.#take_ident().into_iter().for_each(|(k,v)| {
+                    m.insert(k.clone(), #ty::try_from(v).unwrap());
               });
              o.#member = m;
         }),

+ 6 - 28
shared-lib/flowy-folder-data-model/src/entities/app.rs

@@ -48,7 +48,7 @@ pub struct RepeatedApp {
 impl_def_and_def_mut!(RepeatedApp, App);
 
 #[derive(ProtoBuf, Default)]
-pub struct CreateAppRequest {
+pub struct CreateAppPayload {
     #[pb(index = 1)]
     pub workspace_id: String,
 
@@ -83,7 +83,7 @@ pub struct CreateAppParams {
     pub color_style: ColorStyle,
 }
 
-impl TryInto<CreateAppParams> for CreateAppRequest {
+impl TryInto<CreateAppParams> for CreateAppPayload {
     type Error = ErrorCode;
 
     fn try_into(self) -> Result<CreateAppParams, Self::Error> {
@@ -108,44 +108,22 @@ impl std::convert::From<AppColorStyle> for ColorStyle {
     }
 }
 
-#[derive(Default, ProtoBuf, Clone)]
-pub struct QueryAppRequest {
-    #[pb(index = 1)]
-    pub app_ids: Vec<String>,
-}
-
 #[derive(ProtoBuf, Default, Clone, Debug)]
 pub struct AppId {
     #[pb(index = 1)]
-    pub app_id: String,
+    pub value: String,
 }
 
 impl AppId {
     pub fn new(app_id: &str) -> Self {
         Self {
-            app_id: app_id.to_string(),
-        }
-    }
-}
-
-impl TryInto<AppId> for QueryAppRequest {
-    type Error = ErrorCode;
-
-    fn try_into(self) -> Result<AppId, Self::Error> {
-        debug_assert!(self.app_ids.len() == 1);
-        if self.app_ids.len() != 1 {
-            log::error!("The len of app_ids should be equal to 1");
-            return Err(ErrorCode::AppIdInvalid);
+            value: app_id.to_string(),
         }
-
-        let app_id = self.app_ids.first().unwrap().clone();
-        let app_id = AppIdentify::parse(app_id)?.0;
-        Ok(AppId { app_id })
     }
 }
 
 #[derive(ProtoBuf, Default)]
-pub struct UpdateAppRequest {
+pub struct UpdateAppPayload {
     #[pb(index = 1)]
     pub app_id: String,
 
@@ -204,7 +182,7 @@ impl UpdateAppParams {
     }
 }
 
-impl TryInto<UpdateAppParams> for UpdateAppRequest {
+impl TryInto<UpdateAppParams> for UpdateAppPayload {
     type Error = ErrorCode;
 
     fn try_into(self) -> Result<UpdateAppParams, Self::Error> {

+ 2 - 2
shared-lib/flowy-folder-data-model/src/entities/share.rs

@@ -30,7 +30,7 @@ impl std::convert::From<i32> for ExportType {
 }
 
 #[derive(Default, ProtoBuf)]
-pub struct ExportRequest {
+pub struct ExportPayload {
     #[pb(index = 1)]
     pub doc_id: String,
 
@@ -44,7 +44,7 @@ pub struct ExportParams {
     pub export_type: ExportType,
 }
 
-impl TryInto<ExportParams> for ExportRequest {
+impl TryInto<ExportParams> for ExportPayload {
     type Error = ErrorCode;
     fn try_into(self) -> Result<ExportParams, Self::Error> {
         Ok(ExportParams {

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

@@ -88,7 +88,7 @@ impl std::convert::From<i32> for ViewType {
 }
 
 #[derive(Default, ProtoBuf)]
-pub struct CreateViewRequest {
+pub struct CreateViewPayload {
     #[pb(index = 1)]
     pub belong_to_id: String,
 
@@ -152,7 +152,7 @@ impl CreateViewParams {
     }
 }
 
-impl TryInto<CreateViewParams> for CreateViewRequest {
+impl TryInto<CreateViewParams> for CreateViewPayload {
     type Error = ErrorCode;
 
     fn try_into(self) -> Result<CreateViewParams, Self::Error> {
@@ -177,37 +177,17 @@ impl TryInto<CreateViewParams> for CreateViewRequest {
     }
 }
 
-#[derive(Default, ProtoBuf)]
-pub struct QueryViewRequest {
-    #[pb(index = 1)]
-    pub view_ids: Vec<String>,
-}
-
 #[derive(Default, ProtoBuf, Clone, Debug)]
 pub struct ViewId {
     #[pb(index = 1)]
-    pub view_id: String,
+    pub value: String,
 }
 
-impl std::convert::From<String> for ViewId {
-    fn from(view_id: String) -> Self {
-        ViewId { view_id }
-    }
-}
-
-impl TryInto<ViewId> for QueryViewRequest {
-    type Error = ErrorCode;
-    fn try_into(self) -> Result<ViewId, Self::Error> {
-        debug_assert!(self.view_ids.len() == 1);
-        if self.view_ids.len() != 1 {
-            log::error!("The len of view_ids should be equal to 1");
-            return Err(ErrorCode::ViewIdInvalid);
+impl std::convert::From<&str> for ViewId {
+    fn from(value: &str) -> Self {
+        ViewId {
+            value: value.to_string(),
         }
-
-        let view_id = self.view_ids.first().unwrap().clone();
-        let view_id = ViewIdentify::parse(view_id)?.0;
-
-        Ok(ViewId { view_id })
     }
 }
 
@@ -217,23 +197,8 @@ pub struct RepeatedViewId {
     pub items: Vec<String>,
 }
 
-impl TryInto<RepeatedViewId> for QueryViewRequest {
-    type Error = ErrorCode;
-
-    fn try_into(self) -> Result<RepeatedViewId, Self::Error> {
-        let mut view_ids = vec![];
-        for view_id in self.view_ids {
-            let view_id = ViewIdentify::parse(view_id)?.0;
-
-            view_ids.push(view_id);
-        }
-
-        Ok(RepeatedViewId { items: view_ids })
-    }
-}
-
 #[derive(Default, ProtoBuf)]
-pub struct UpdateViewRequest {
+pub struct UpdateViewPayload {
     #[pb(index = 1)]
     pub view_id: String,
 
@@ -281,7 +246,7 @@ impl UpdateViewParams {
     }
 }
 
-impl TryInto<UpdateViewParams> for UpdateViewRequest {
+impl TryInto<UpdateViewParams> for UpdateViewPayload {
     type Error = ErrorCode;
 
     fn try_into(self) -> Result<UpdateViewParams, Self::Error> {

+ 4 - 30
shared-lib/flowy-folder-data-model/src/entities/workspace.rs

@@ -38,7 +38,7 @@ pub struct RepeatedWorkspace {
 impl_def_and_def_mut!(RepeatedWorkspace, Workspace);
 
 #[derive(ProtoBuf, Default)]
-pub struct CreateWorkspaceRequest {
+pub struct CreateWorkspacePayload {
     #[pb(index = 1)]
     pub name: String,
 
@@ -55,7 +55,7 @@ pub struct CreateWorkspaceParams {
     pub desc: String,
 }
 
-impl TryInto<CreateWorkspaceParams> for CreateWorkspaceRequest {
+impl TryInto<CreateWorkspaceParams> for CreateWorkspacePayload {
     type Error = ErrorCode;
 
     fn try_into(self) -> Result<CreateWorkspaceParams, Self::Error> {
@@ -69,42 +69,16 @@ impl TryInto<CreateWorkspaceParams> for CreateWorkspaceRequest {
     }
 }
 
-#[derive(Default, ProtoBuf, Clone)]
-pub struct QueryWorkspaceRequest {
-    // return all workspace if workspace_id is None
-    #[pb(index = 1, one_of)]
-    pub workspace_id: Option<String>,
-}
-
-impl QueryWorkspaceRequest {
-    pub fn new(workspace_id: Option<String>) -> Self {
-        Self { workspace_id }
-    }
-}
-
 // Read all workspaces if the workspace_id is None
 #[derive(Clone, ProtoBuf, Default, Debug)]
 pub struct WorkspaceId {
     #[pb(index = 1, one_of)]
-    pub workspace_id: Option<String>,
+    pub value: Option<String>,
 }
 
 impl WorkspaceId {
     pub fn new(workspace_id: Option<String>) -> Self {
-        Self { workspace_id }
-    }
-}
-
-impl TryInto<WorkspaceId> for QueryWorkspaceRequest {
-    type Error = ErrorCode;
-
-    fn try_into(self) -> Result<WorkspaceId, Self::Error> {
-        let workspace_id = match self.workspace_id {
-            None => None,
-            Some(workspace_id) => Some(WorkspaceIdentify::parse(workspace_id)?.0),
-        };
-
-        Ok(WorkspaceId { workspace_id })
+        Self { value: workspace_id }
     }
 }
 

+ 121 - 280
shared-lib/flowy-folder-data-model/src/protobuf/model/app.rs

@@ -637,7 +637,7 @@ impl ::protobuf::reflect::ProtobufValue for RepeatedApp {
 }
 
 #[derive(PartialEq,Clone,Default)]
-pub struct CreateAppRequest {
+pub struct CreateAppPayload {
     // message fields
     pub workspace_id: ::std::string::String,
     pub name: ::std::string::String,
@@ -648,14 +648,14 @@ pub struct CreateAppRequest {
     pub cached_size: ::protobuf::CachedSize,
 }
 
-impl<'a> ::std::default::Default for &'a CreateAppRequest {
-    fn default() -> &'a CreateAppRequest {
-        <CreateAppRequest as ::protobuf::Message>::default_instance()
+impl<'a> ::std::default::Default for &'a CreateAppPayload {
+    fn default() -> &'a CreateAppPayload {
+        <CreateAppPayload as ::protobuf::Message>::default_instance()
     }
 }
 
-impl CreateAppRequest {
-    pub fn new() -> CreateAppRequest {
+impl CreateAppPayload {
+    pub fn new() -> CreateAppPayload {
         ::std::default::Default::default()
     }
 
@@ -771,7 +771,7 @@ impl CreateAppRequest {
     }
 }
 
-impl ::protobuf::Message for CreateAppRequest {
+impl ::protobuf::Message for CreateAppPayload {
     fn is_initialized(&self) -> bool {
         for v in &self.color_style {
             if !v.is_initialized() {
@@ -872,8 +872,8 @@ impl ::protobuf::Message for CreateAppRequest {
         Self::descriptor_static()
     }
 
-    fn new() -> CreateAppRequest {
-        CreateAppRequest::new()
+    fn new() -> CreateAppPayload {
+        CreateAppPayload::new()
     }
 
     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
@@ -882,39 +882,39 @@ impl ::protobuf::Message for CreateAppRequest {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "workspace_id",
-                |m: &CreateAppRequest| { &m.workspace_id },
-                |m: &mut CreateAppRequest| { &mut m.workspace_id },
+                |m: &CreateAppPayload| { &m.workspace_id },
+                |m: &mut CreateAppPayload| { &mut m.workspace_id },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "name",
-                |m: &CreateAppRequest| { &m.name },
-                |m: &mut CreateAppRequest| { &mut m.name },
+                |m: &CreateAppPayload| { &m.name },
+                |m: &mut CreateAppPayload| { &mut m.name },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "desc",
-                |m: &CreateAppRequest| { &m.desc },
-                |m: &mut CreateAppRequest| { &mut m.desc },
+                |m: &CreateAppPayload| { &m.desc },
+                |m: &mut CreateAppPayload| { &mut m.desc },
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_ptr_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<ColorStyle>>(
                 "color_style",
-                |m: &CreateAppRequest| { &m.color_style },
-                |m: &mut CreateAppRequest| { &mut m.color_style },
+                |m: &CreateAppPayload| { &m.color_style },
+                |m: &mut CreateAppPayload| { &mut m.color_style },
             ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateAppRequest>(
-                "CreateAppRequest",
+            ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateAppPayload>(
+                "CreateAppPayload",
                 fields,
                 file_descriptor_proto()
             )
         })
     }
 
-    fn default_instance() -> &'static CreateAppRequest {
-        static instance: ::protobuf::rt::LazyV2<CreateAppRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(CreateAppRequest::new)
+    fn default_instance() -> &'static CreateAppPayload {
+        static instance: ::protobuf::rt::LazyV2<CreateAppPayload> = ::protobuf::rt::LazyV2::INIT;
+        instance.get(CreateAppPayload::new)
     }
 }
 
-impl ::protobuf::Clear for CreateAppRequest {
+impl ::protobuf::Clear for CreateAppPayload {
     fn clear(&mut self) {
         self.workspace_id.clear();
         self.name.clear();
@@ -924,13 +924,13 @@ impl ::protobuf::Clear for CreateAppRequest {
     }
 }
 
-impl ::std::fmt::Debug for CreateAppRequest {
+impl ::std::fmt::Debug for CreateAppPayload {
     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         ::protobuf::text_format::fmt(self, f)
     }
 }
 
-impl ::protobuf::reflect::ProtobufValue for CreateAppRequest {
+impl ::protobuf::reflect::ProtobufValue for CreateAppPayload {
     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
         ::protobuf::reflect::ReflectValueRef::Message(self)
     }
@@ -1395,168 +1395,10 @@ impl ::protobuf::reflect::ProtobufValue for CreateAppParams {
     }
 }
 
-#[derive(PartialEq,Clone,Default)]
-pub struct QueryAppRequest {
-    // message fields
-    pub app_ids: ::protobuf::RepeatedField<::std::string::String>,
-    // special fields
-    pub unknown_fields: ::protobuf::UnknownFields,
-    pub cached_size: ::protobuf::CachedSize,
-}
-
-impl<'a> ::std::default::Default for &'a QueryAppRequest {
-    fn default() -> &'a QueryAppRequest {
-        <QueryAppRequest as ::protobuf::Message>::default_instance()
-    }
-}
-
-impl QueryAppRequest {
-    pub fn new() -> QueryAppRequest {
-        ::std::default::Default::default()
-    }
-
-    // repeated string app_ids = 1;
-
-
-    pub fn get_app_ids(&self) -> &[::std::string::String] {
-        &self.app_ids
-    }
-    pub fn clear_app_ids(&mut self) {
-        self.app_ids.clear();
-    }
-
-    // Param is passed by value, moved
-    pub fn set_app_ids(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
-        self.app_ids = v;
-    }
-
-    // Mutable pointer to the field.
-    pub fn mut_app_ids(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
-        &mut self.app_ids
-    }
-
-    // Take field
-    pub fn take_app_ids(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
-        ::std::mem::replace(&mut self.app_ids, ::protobuf::RepeatedField::new())
-    }
-}
-
-impl ::protobuf::Message for QueryAppRequest {
-    fn is_initialized(&self) -> bool {
-        true
-    }
-
-    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        while !is.eof()? {
-            let (field_number, wire_type) = is.read_tag_unpack()?;
-            match field_number {
-                1 => {
-                    ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.app_ids)?;
-                },
-                _ => {
-                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
-                },
-            };
-        }
-        ::std::result::Result::Ok(())
-    }
-
-    // Compute sizes of nested messages
-    #[allow(unused_variables)]
-    fn compute_size(&self) -> u32 {
-        let mut my_size = 0;
-        for value in &self.app_ids {
-            my_size += ::protobuf::rt::string_size(1, &value);
-        };
-        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
-        self.cached_size.set(my_size);
-        my_size
-    }
-
-    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        for v in &self.app_ids {
-            os.write_string(1, &v)?;
-        };
-        os.write_unknown_fields(self.get_unknown_fields())?;
-        ::std::result::Result::Ok(())
-    }
-
-    fn get_cached_size(&self) -> u32 {
-        self.cached_size.get()
-    }
-
-    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
-        &self.unknown_fields
-    }
-
-    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
-        &mut self.unknown_fields
-    }
-
-    fn as_any(&self) -> &dyn (::std::any::Any) {
-        self as &dyn (::std::any::Any)
-    }
-    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
-        self as &mut dyn (::std::any::Any)
-    }
-    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
-        self
-    }
-
-    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
-        Self::descriptor_static()
-    }
-
-    fn new() -> QueryAppRequest {
-        QueryAppRequest::new()
-    }
-
-    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
-        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
-        descriptor.get(|| {
-            let mut fields = ::std::vec::Vec::new();
-            fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
-                "app_ids",
-                |m: &QueryAppRequest| { &m.app_ids },
-                |m: &mut QueryAppRequest| { &mut m.app_ids },
-            ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryAppRequest>(
-                "QueryAppRequest",
-                fields,
-                file_descriptor_proto()
-            )
-        })
-    }
-
-    fn default_instance() -> &'static QueryAppRequest {
-        static instance: ::protobuf::rt::LazyV2<QueryAppRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(QueryAppRequest::new)
-    }
-}
-
-impl ::protobuf::Clear for QueryAppRequest {
-    fn clear(&mut self) {
-        self.app_ids.clear();
-        self.unknown_fields.clear();
-    }
-}
-
-impl ::std::fmt::Debug for QueryAppRequest {
-    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        ::protobuf::text_format::fmt(self, f)
-    }
-}
-
-impl ::protobuf::reflect::ProtobufValue for QueryAppRequest {
-    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
-        ::protobuf::reflect::ReflectValueRef::Message(self)
-    }
-}
-
 #[derive(PartialEq,Clone,Default)]
 pub struct AppId {
     // message fields
-    pub app_id: ::std::string::String,
+    pub value: ::std::string::String,
     // special fields
     pub unknown_fields: ::protobuf::UnknownFields,
     pub cached_size: ::protobuf::CachedSize,
@@ -1573,30 +1415,30 @@ impl AppId {
         ::std::default::Default::default()
     }
 
-    // string app_id = 1;
+    // string value = 1;
 
 
-    pub fn get_app_id(&self) -> &str {
-        &self.app_id
+    pub fn get_value(&self) -> &str {
+        &self.value
     }
-    pub fn clear_app_id(&mut self) {
-        self.app_id.clear();
+    pub fn clear_value(&mut self) {
+        self.value.clear();
     }
 
     // Param is passed by value, moved
-    pub fn set_app_id(&mut self, v: ::std::string::String) {
-        self.app_id = v;
+    pub fn set_value(&mut self, v: ::std::string::String) {
+        self.value = v;
     }
 
     // Mutable pointer to the field.
     // If field is not initialized, it is initialized with default value first.
-    pub fn mut_app_id(&mut self) -> &mut ::std::string::String {
-        &mut self.app_id
+    pub fn mut_value(&mut self) -> &mut ::std::string::String {
+        &mut self.value
     }
 
     // Take field
-    pub fn take_app_id(&mut self) -> ::std::string::String {
-        ::std::mem::replace(&mut self.app_id, ::std::string::String::new())
+    pub fn take_value(&mut self) -> ::std::string::String {
+        ::std::mem::replace(&mut self.value, ::std::string::String::new())
     }
 }
 
@@ -1610,7 +1452,7 @@ impl ::protobuf::Message for AppId {
             let (field_number, wire_type) = is.read_tag_unpack()?;
             match field_number {
                 1 => {
-                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.app_id)?;
+                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?;
                 },
                 _ => {
                     ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
@@ -1624,8 +1466,8 @@ impl ::protobuf::Message for AppId {
     #[allow(unused_variables)]
     fn compute_size(&self) -> u32 {
         let mut my_size = 0;
-        if !self.app_id.is_empty() {
-            my_size += ::protobuf::rt::string_size(1, &self.app_id);
+        if !self.value.is_empty() {
+            my_size += ::protobuf::rt::string_size(1, &self.value);
         }
         my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
         self.cached_size.set(my_size);
@@ -1633,8 +1475,8 @@ impl ::protobuf::Message for AppId {
     }
 
     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        if !self.app_id.is_empty() {
-            os.write_string(1, &self.app_id)?;
+        if !self.value.is_empty() {
+            os.write_string(1, &self.value)?;
         }
         os.write_unknown_fields(self.get_unknown_fields())?;
         ::std::result::Result::Ok(())
@@ -1675,9 +1517,9 @@ impl ::protobuf::Message for AppId {
         descriptor.get(|| {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
-                "app_id",
-                |m: &AppId| { &m.app_id },
-                |m: &mut AppId| { &mut m.app_id },
+                "value",
+                |m: &AppId| { &m.value },
+                |m: &mut AppId| { &mut m.value },
             ));
             ::protobuf::reflect::MessageDescriptor::new_pb_name::<AppId>(
                 "AppId",
@@ -1695,7 +1537,7 @@ impl ::protobuf::Message for AppId {
 
 impl ::protobuf::Clear for AppId {
     fn clear(&mut self) {
-        self.app_id.clear();
+        self.value.clear();
         self.unknown_fields.clear();
     }
 }
@@ -1713,47 +1555,47 @@ impl ::protobuf::reflect::ProtobufValue for AppId {
 }
 
 #[derive(PartialEq,Clone,Default)]
-pub struct UpdateAppRequest {
+pub struct UpdateAppPayload {
     // message fields
     pub app_id: ::std::string::String,
     // message oneof groups
-    pub one_of_name: ::std::option::Option<UpdateAppRequest_oneof_one_of_name>,
-    pub one_of_desc: ::std::option::Option<UpdateAppRequest_oneof_one_of_desc>,
-    pub one_of_color_style: ::std::option::Option<UpdateAppRequest_oneof_one_of_color_style>,
-    pub one_of_is_trash: ::std::option::Option<UpdateAppRequest_oneof_one_of_is_trash>,
+    pub one_of_name: ::std::option::Option<UpdateAppPayload_oneof_one_of_name>,
+    pub one_of_desc: ::std::option::Option<UpdateAppPayload_oneof_one_of_desc>,
+    pub one_of_color_style: ::std::option::Option<UpdateAppPayload_oneof_one_of_color_style>,
+    pub one_of_is_trash: ::std::option::Option<UpdateAppPayload_oneof_one_of_is_trash>,
     // special fields
     pub unknown_fields: ::protobuf::UnknownFields,
     pub cached_size: ::protobuf::CachedSize,
 }
 
-impl<'a> ::std::default::Default for &'a UpdateAppRequest {
-    fn default() -> &'a UpdateAppRequest {
-        <UpdateAppRequest as ::protobuf::Message>::default_instance()
+impl<'a> ::std::default::Default for &'a UpdateAppPayload {
+    fn default() -> &'a UpdateAppPayload {
+        <UpdateAppPayload as ::protobuf::Message>::default_instance()
     }
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateAppRequest_oneof_one_of_name {
+pub enum UpdateAppPayload_oneof_one_of_name {
     name(::std::string::String),
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateAppRequest_oneof_one_of_desc {
+pub enum UpdateAppPayload_oneof_one_of_desc {
     desc(::std::string::String),
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateAppRequest_oneof_one_of_color_style {
+pub enum UpdateAppPayload_oneof_one_of_color_style {
     color_style(ColorStyle),
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateAppRequest_oneof_one_of_is_trash {
+pub enum UpdateAppPayload_oneof_one_of_is_trash {
     is_trash(bool),
 }
 
-impl UpdateAppRequest {
-    pub fn new() -> UpdateAppRequest {
+impl UpdateAppPayload {
+    pub fn new() -> UpdateAppPayload {
         ::std::default::Default::default()
     }
 
@@ -1788,7 +1630,7 @@ impl UpdateAppRequest {
 
     pub fn get_name(&self) -> &str {
         match self.one_of_name {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_name::name(ref v)) => v,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_name::name(ref v)) => v,
             _ => "",
         }
     }
@@ -1798,24 +1640,24 @@ impl UpdateAppRequest {
 
     pub fn has_name(&self) -> bool {
         match self.one_of_name {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_name::name(..)) => true,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_name::name(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_name(&mut self, v: ::std::string::String) {
-        self.one_of_name = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_name::name(v))
+        self.one_of_name = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_name::name(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_name(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_name::name(_)) = self.one_of_name {
+        if let ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_name::name(_)) = self.one_of_name {
         } else {
-            self.one_of_name = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_name::name(::std::string::String::new()));
+            self.one_of_name = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_name::name(::std::string::String::new()));
         }
         match self.one_of_name {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_name::name(ref mut v)) => v,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_name::name(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -1824,7 +1666,7 @@ impl UpdateAppRequest {
     pub fn take_name(&mut self) -> ::std::string::String {
         if self.has_name() {
             match self.one_of_name.take() {
-                ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_name::name(v)) => v,
+                ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_name::name(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -1837,7 +1679,7 @@ impl UpdateAppRequest {
 
     pub fn get_desc(&self) -> &str {
         match self.one_of_desc {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_desc::desc(ref v)) => v,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_desc::desc(ref v)) => v,
             _ => "",
         }
     }
@@ -1847,24 +1689,24 @@ impl UpdateAppRequest {
 
     pub fn has_desc(&self) -> bool {
         match self.one_of_desc {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_desc::desc(..)) => true,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_desc::desc(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_desc(&mut self, v: ::std::string::String) {
-        self.one_of_desc = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_desc::desc(v))
+        self.one_of_desc = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_desc::desc(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_desc(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_desc::desc(_)) = self.one_of_desc {
+        if let ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_desc::desc(_)) = self.one_of_desc {
         } else {
-            self.one_of_desc = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_desc::desc(::std::string::String::new()));
+            self.one_of_desc = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_desc::desc(::std::string::String::new()));
         }
         match self.one_of_desc {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_desc::desc(ref mut v)) => v,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_desc::desc(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -1873,7 +1715,7 @@ impl UpdateAppRequest {
     pub fn take_desc(&mut self) -> ::std::string::String {
         if self.has_desc() {
             match self.one_of_desc.take() {
-                ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_desc::desc(v)) => v,
+                ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_desc::desc(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -1886,7 +1728,7 @@ impl UpdateAppRequest {
 
     pub fn get_color_style(&self) -> &ColorStyle {
         match self.one_of_color_style {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_color_style::color_style(ref v)) => v,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_color_style::color_style(ref v)) => v,
             _ => <ColorStyle as ::protobuf::Message>::default_instance(),
         }
     }
@@ -1896,24 +1738,24 @@ impl UpdateAppRequest {
 
     pub fn has_color_style(&self) -> bool {
         match self.one_of_color_style {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_color_style::color_style(..)) => true,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_color_style::color_style(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_color_style(&mut self, v: ColorStyle) {
-        self.one_of_color_style = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_color_style::color_style(v))
+        self.one_of_color_style = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_color_style::color_style(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_color_style(&mut self) -> &mut ColorStyle {
-        if let ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_color_style::color_style(_)) = self.one_of_color_style {
+        if let ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_color_style::color_style(_)) = self.one_of_color_style {
         } else {
-            self.one_of_color_style = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_color_style::color_style(ColorStyle::new()));
+            self.one_of_color_style = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_color_style::color_style(ColorStyle::new()));
         }
         match self.one_of_color_style {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_color_style::color_style(ref mut v)) => v,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_color_style::color_style(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -1922,7 +1764,7 @@ impl UpdateAppRequest {
     pub fn take_color_style(&mut self) -> ColorStyle {
         if self.has_color_style() {
             match self.one_of_color_style.take() {
-                ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_color_style::color_style(v)) => v,
+                ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_color_style::color_style(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -1935,7 +1777,7 @@ impl UpdateAppRequest {
 
     pub fn get_is_trash(&self) -> bool {
         match self.one_of_is_trash {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_is_trash::is_trash(v)) => v,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_is_trash::is_trash(v)) => v,
             _ => false,
         }
     }
@@ -1945,20 +1787,20 @@ impl UpdateAppRequest {
 
     pub fn has_is_trash(&self) -> bool {
         match self.one_of_is_trash {
-            ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_is_trash::is_trash(..)) => true,
+            ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_is_trash::is_trash(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_is_trash(&mut self, v: bool) {
-        self.one_of_is_trash = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_is_trash::is_trash(v))
+        self.one_of_is_trash = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_is_trash::is_trash(v))
     }
 }
 
-impl ::protobuf::Message for UpdateAppRequest {
+impl ::protobuf::Message for UpdateAppPayload {
     fn is_initialized(&self) -> bool {
-        if let Some(UpdateAppRequest_oneof_one_of_color_style::color_style(ref v)) = self.one_of_color_style {
+        if let Some(UpdateAppPayload_oneof_one_of_color_style::color_style(ref v)) = self.one_of_color_style {
             if !v.is_initialized() {
                 return false;
             }
@@ -1977,25 +1819,25 @@ impl ::protobuf::Message for UpdateAppRequest {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_name = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_name::name(is.read_string()?));
+                    self.one_of_name = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_name::name(is.read_string()?));
                 },
                 3 => {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_desc = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_desc::desc(is.read_string()?));
+                    self.one_of_desc = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_desc::desc(is.read_string()?));
                 },
                 4 => {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_color_style = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_color_style::color_style(is.read_message()?));
+                    self.one_of_color_style = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_color_style::color_style(is.read_message()?));
                 },
                 5 => {
                     if wire_type != ::protobuf::wire_format::WireTypeVarint {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_is_trash = ::std::option::Option::Some(UpdateAppRequest_oneof_one_of_is_trash::is_trash(is.read_bool()?));
+                    self.one_of_is_trash = ::std::option::Option::Some(UpdateAppPayload_oneof_one_of_is_trash::is_trash(is.read_bool()?));
                 },
                 _ => {
                     ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
@@ -2014,21 +1856,21 @@ impl ::protobuf::Message for UpdateAppRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_name {
             match v {
-                &UpdateAppRequest_oneof_one_of_name::name(ref v) => {
+                &UpdateAppPayload_oneof_one_of_name::name(ref v) => {
                     my_size += ::protobuf::rt::string_size(2, &v);
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_desc {
             match v {
-                &UpdateAppRequest_oneof_one_of_desc::desc(ref v) => {
+                &UpdateAppPayload_oneof_one_of_desc::desc(ref v) => {
                     my_size += ::protobuf::rt::string_size(3, &v);
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_color_style {
             match v {
-                &UpdateAppRequest_oneof_one_of_color_style::color_style(ref v) => {
+                &UpdateAppPayload_oneof_one_of_color_style::color_style(ref v) => {
                     let len = v.compute_size();
                     my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len;
                 },
@@ -2036,7 +1878,7 @@ impl ::protobuf::Message for UpdateAppRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_is_trash {
             match v {
-                &UpdateAppRequest_oneof_one_of_is_trash::is_trash(v) => {
+                &UpdateAppPayload_oneof_one_of_is_trash::is_trash(v) => {
                     my_size += 2;
                 },
             };
@@ -2052,21 +1894,21 @@ impl ::protobuf::Message for UpdateAppRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_name {
             match v {
-                &UpdateAppRequest_oneof_one_of_name::name(ref v) => {
+                &UpdateAppPayload_oneof_one_of_name::name(ref v) => {
                     os.write_string(2, v)?;
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_desc {
             match v {
-                &UpdateAppRequest_oneof_one_of_desc::desc(ref v) => {
+                &UpdateAppPayload_oneof_one_of_desc::desc(ref v) => {
                     os.write_string(3, v)?;
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_color_style {
             match v {
-                &UpdateAppRequest_oneof_one_of_color_style::color_style(ref v) => {
+                &UpdateAppPayload_oneof_one_of_color_style::color_style(ref v) => {
                     os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?;
                     os.write_raw_varint32(v.get_cached_size())?;
                     v.write_to_with_cached_sizes(os)?;
@@ -2075,7 +1917,7 @@ impl ::protobuf::Message for UpdateAppRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_is_trash {
             match v {
-                &UpdateAppRequest_oneof_one_of_is_trash::is_trash(v) => {
+                &UpdateAppPayload_oneof_one_of_is_trash::is_trash(v) => {
                     os.write_bool(5, v)?;
                 },
             };
@@ -2110,8 +1952,8 @@ impl ::protobuf::Message for UpdateAppRequest {
         Self::descriptor_static()
     }
 
-    fn new() -> UpdateAppRequest {
-        UpdateAppRequest::new()
+    fn new() -> UpdateAppPayload {
+        UpdateAppPayload::new()
     }
 
     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
@@ -2120,44 +1962,44 @@ impl ::protobuf::Message for UpdateAppRequest {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "app_id",
-                |m: &UpdateAppRequest| { &m.app_id },
-                |m: &mut UpdateAppRequest| { &mut m.app_id },
+                |m: &UpdateAppPayload| { &m.app_id },
+                |m: &mut UpdateAppPayload| { &mut m.app_id },
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
                 "name",
-                UpdateAppRequest::has_name,
-                UpdateAppRequest::get_name,
+                UpdateAppPayload::has_name,
+                UpdateAppPayload::get_name,
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
                 "desc",
-                UpdateAppRequest::has_desc,
-                UpdateAppRequest::get_desc,
+                UpdateAppPayload::has_desc,
+                UpdateAppPayload::get_desc,
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_message_accessor::<_, ColorStyle>(
                 "color_style",
-                UpdateAppRequest::has_color_style,
-                UpdateAppRequest::get_color_style,
+                UpdateAppPayload::has_color_style,
+                UpdateAppPayload::get_color_style,
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_bool_accessor::<_>(
                 "is_trash",
-                UpdateAppRequest::has_is_trash,
-                UpdateAppRequest::get_is_trash,
+                UpdateAppPayload::has_is_trash,
+                UpdateAppPayload::get_is_trash,
             ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateAppRequest>(
-                "UpdateAppRequest",
+            ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateAppPayload>(
+                "UpdateAppPayload",
                 fields,
                 file_descriptor_proto()
             )
         })
     }
 
-    fn default_instance() -> &'static UpdateAppRequest {
-        static instance: ::protobuf::rt::LazyV2<UpdateAppRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(UpdateAppRequest::new)
+    fn default_instance() -> &'static UpdateAppPayload {
+        static instance: ::protobuf::rt::LazyV2<UpdateAppPayload> = ::protobuf::rt::LazyV2::INIT;
+        instance.get(UpdateAppPayload::new)
     }
 }
 
-impl ::protobuf::Clear for UpdateAppRequest {
+impl ::protobuf::Clear for UpdateAppPayload {
     fn clear(&mut self) {
         self.app_id.clear();
         self.one_of_name = ::std::option::Option::None;
@@ -2168,13 +2010,13 @@ impl ::protobuf::Clear for UpdateAppRequest {
     }
 }
 
-impl ::std::fmt::Debug for UpdateAppRequest {
+impl ::std::fmt::Debug for UpdateAppPayload {
     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         ::protobuf::text_format::fmt(self, f)
     }
 }
 
-impl ::protobuf::reflect::ProtobufValue for UpdateAppRequest {
+impl ::protobuf::reflect::ProtobufValue for UpdateAppPayload {
     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
         ::protobuf::reflect::ReflectValueRef::Message(self)
     }
@@ -2657,7 +2499,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     ion\x12#\n\rmodified_time\x18\x07\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\
     \n\x0bcreate_time\x18\x08\x20\x01(\x03R\ncreateTime\")\n\x0bRepeatedApp\
     \x12\x1a\n\x05items\x18\x01\x20\x03(\x0b2\x04.AppR\x05items\"\x8b\x01\n\
-    \x10CreateAppRequest\x12!\n\x0cworkspace_id\x18\x01\x20\x01(\tR\x0bworks\
+    \x10CreateAppPayload\x12!\n\x0cworkspace_id\x18\x01\x20\x01(\tR\x0bworks\
     paceId\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\
     \x18\x03\x20\x01(\tR\x04desc\x12,\n\x0bcolor_style\x18\x04\x20\x01(\x0b2\
     \x0b.ColorStyleR\ncolorStyle\"-\n\nColorStyle\x12\x1f\n\x0btheme_color\
@@ -2665,9 +2507,8 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x0cworkspace_id\x18\x01\x20\x01(\tR\x0bworkspaceId\x12\x12\n\x04name\
     \x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\x04de\
     sc\x12,\n\x0bcolor_style\x18\x04\x20\x01(\x0b2\x0b.ColorStyleR\ncolorSty\
-    le\"*\n\x0fQueryAppRequest\x12\x17\n\x07app_ids\x18\x01\x20\x03(\tR\x06a\
-    ppIds\"\x1e\n\x05AppId\x12\x15\n\x06app_id\x18\x01\x20\x01(\tR\x05appId\
-    \"\xe9\x01\n\x10UpdateAppRequest\x12\x15\n\x06app_id\x18\x01\x20\x01(\tR\
+    le\"\x1d\n\x05AppId\x12\x14\n\x05value\x18\x01\x20\x01(\tR\x05value\"\
+    \xe9\x01\n\x10UpdateAppPayload\x12\x15\n\x06app_id\x18\x01\x20\x01(\tR\
     \x05appId\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x14\n\x04\
     desc\x18\x03\x20\x01(\tH\x01R\x04desc\x12.\n\x0bcolor_style\x18\x04\x20\
     \x01(\x0b2\x0b.ColorStyleH\x02R\ncolorStyle\x12\x1b\n\x08is_trash\x18\

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

@@ -24,7 +24,7 @@
 // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 #[derive(PartialEq,Clone,Default)]
-pub struct ExportRequest {
+pub struct ExportPayload {
     // message fields
     pub doc_id: ::std::string::String,
     pub export_type: ExportType,
@@ -33,14 +33,14 @@ pub struct ExportRequest {
     pub cached_size: ::protobuf::CachedSize,
 }
 
-impl<'a> ::std::default::Default for &'a ExportRequest {
-    fn default() -> &'a ExportRequest {
-        <ExportRequest as ::protobuf::Message>::default_instance()
+impl<'a> ::std::default::Default for &'a ExportPayload {
+    fn default() -> &'a ExportPayload {
+        <ExportPayload as ::protobuf::Message>::default_instance()
     }
 }
 
-impl ExportRequest {
-    pub fn new() -> ExportRequest {
+impl ExportPayload {
+    pub fn new() -> ExportPayload {
         ::std::default::Default::default()
     }
 
@@ -86,7 +86,7 @@ impl ExportRequest {
     }
 }
 
-impl ::protobuf::Message for ExportRequest {
+impl ::protobuf::Message for ExportPayload {
     fn is_initialized(&self) -> bool {
         true
     }
@@ -161,8 +161,8 @@ impl ::protobuf::Message for ExportRequest {
         Self::descriptor_static()
     }
 
-    fn new() -> ExportRequest {
-        ExportRequest::new()
+    fn new() -> ExportPayload {
+        ExportPayload::new()
     }
 
     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
@@ -171,29 +171,29 @@ impl ::protobuf::Message for ExportRequest {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "doc_id",
-                |m: &ExportRequest| { &m.doc_id },
-                |m: &mut ExportRequest| { &mut m.doc_id },
+                |m: &ExportPayload| { &m.doc_id },
+                |m: &mut ExportPayload| { &mut m.doc_id },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ExportType>>(
                 "export_type",
-                |m: &ExportRequest| { &m.export_type },
-                |m: &mut ExportRequest| { &mut m.export_type },
+                |m: &ExportPayload| { &m.export_type },
+                |m: &mut ExportPayload| { &mut m.export_type },
             ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<ExportRequest>(
-                "ExportRequest",
+            ::protobuf::reflect::MessageDescriptor::new_pb_name::<ExportPayload>(
+                "ExportPayload",
                 fields,
                 file_descriptor_proto()
             )
         })
     }
 
-    fn default_instance() -> &'static ExportRequest {
-        static instance: ::protobuf::rt::LazyV2<ExportRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(ExportRequest::new)
+    fn default_instance() -> &'static ExportPayload {
+        static instance: ::protobuf::rt::LazyV2<ExportPayload> = ::protobuf::rt::LazyV2::INIT;
+        instance.get(ExportPayload::new)
     }
 }
 
-impl ::protobuf::Clear for ExportRequest {
+impl ::protobuf::Clear for ExportPayload {
     fn clear(&mut self) {
         self.doc_id.clear();
         self.export_type = ExportType::Text;
@@ -201,13 +201,13 @@ impl ::protobuf::Clear for ExportRequest {
     }
 }
 
-impl ::std::fmt::Debug for ExportRequest {
+impl ::std::fmt::Debug for ExportPayload {
     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         ::protobuf::text_format::fmt(self, f)
     }
 }
 
-impl ::protobuf::reflect::ProtobufValue for ExportRequest {
+impl ::protobuf::reflect::ProtobufValue for ExportPayload {
     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
         ::protobuf::reflect::ReflectValueRef::Message(self)
     }
@@ -457,7 +457,7 @@ impl ::protobuf::reflect::ProtobufValue for ExportType {
 }
 
 static file_descriptor_proto_data: &'static [u8] = b"\
-    \n\x0bshare.proto\"T\n\rExportRequest\x12\x15\n\x06doc_id\x18\x01\x20\
+    \n\x0bshare.proto\"T\n\rExportPayload\x12\x15\n\x06doc_id\x18\x01\x20\
     \x01(\tR\x05docId\x12,\n\x0bexport_type\x18\x02\x20\x01(\x0e2\x0b.Export\
     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\

+ 135 - 294
shared-lib/flowy-folder-data-model/src/protobuf/model/view.rs

@@ -668,32 +668,32 @@ impl ::protobuf::reflect::ProtobufValue for RepeatedView {
 }
 
 #[derive(PartialEq,Clone,Default)]
-pub struct CreateViewRequest {
+pub struct CreateViewPayload {
     // message fields
     pub belong_to_id: ::std::string::String,
     pub name: ::std::string::String,
     pub desc: ::std::string::String,
     pub view_type: ViewType,
     // message oneof groups
-    pub one_of_thumbnail: ::std::option::Option<CreateViewRequest_oneof_one_of_thumbnail>,
+    pub one_of_thumbnail: ::std::option::Option<CreateViewPayload_oneof_one_of_thumbnail>,
     // special fields
     pub unknown_fields: ::protobuf::UnknownFields,
     pub cached_size: ::protobuf::CachedSize,
 }
 
-impl<'a> ::std::default::Default for &'a CreateViewRequest {
-    fn default() -> &'a CreateViewRequest {
-        <CreateViewRequest as ::protobuf::Message>::default_instance()
+impl<'a> ::std::default::Default for &'a CreateViewPayload {
+    fn default() -> &'a CreateViewPayload {
+        <CreateViewPayload as ::protobuf::Message>::default_instance()
     }
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum CreateViewRequest_oneof_one_of_thumbnail {
+pub enum CreateViewPayload_oneof_one_of_thumbnail {
     thumbnail(::std::string::String),
 }
 
-impl CreateViewRequest {
-    pub fn new() -> CreateViewRequest {
+impl CreateViewPayload {
+    pub fn new() -> CreateViewPayload {
         ::std::default::Default::default()
     }
 
@@ -780,7 +780,7 @@ impl CreateViewRequest {
 
     pub fn get_thumbnail(&self) -> &str {
         match self.one_of_thumbnail {
-            ::std::option::Option::Some(CreateViewRequest_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
+            ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
             _ => "",
         }
     }
@@ -790,24 +790,24 @@ impl CreateViewRequest {
 
     pub fn has_thumbnail(&self) -> bool {
         match self.one_of_thumbnail {
-            ::std::option::Option::Some(CreateViewRequest_oneof_one_of_thumbnail::thumbnail(..)) => true,
+            ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_thumbnail(&mut self, v: ::std::string::String) {
-        self.one_of_thumbnail = ::std::option::Option::Some(CreateViewRequest_oneof_one_of_thumbnail::thumbnail(v))
+        self.one_of_thumbnail = ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(CreateViewRequest_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
+        if let ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
         } else {
-            self.one_of_thumbnail = ::std::option::Option::Some(CreateViewRequest_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
+            self.one_of_thumbnail = ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
         }
         match self.one_of_thumbnail {
-            ::std::option::Option::Some(CreateViewRequest_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
+            ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -816,7 +816,7 @@ impl CreateViewRequest {
     pub fn take_thumbnail(&mut self) -> ::std::string::String {
         if self.has_thumbnail() {
             match self.one_of_thumbnail.take() {
-                ::std::option::Option::Some(CreateViewRequest_oneof_one_of_thumbnail::thumbnail(v)) => v,
+                ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -840,7 +840,7 @@ impl CreateViewRequest {
     }
 }
 
-impl ::protobuf::Message for CreateViewRequest {
+impl ::protobuf::Message for CreateViewPayload {
     fn is_initialized(&self) -> bool {
         true
     }
@@ -862,7 +862,7 @@ impl ::protobuf::Message for CreateViewRequest {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_thumbnail = ::std::option::Option::Some(CreateViewRequest_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
+                    self.one_of_thumbnail = ::std::option::Option::Some(CreateViewPayload_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
                 },
                 5 => {
                     ::protobuf::rt::read_proto3_enum_with_unknown_fields_into(wire_type, is, &mut self.view_type, 5, &mut self.unknown_fields)?
@@ -893,7 +893,7 @@ impl ::protobuf::Message for CreateViewRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
             match v {
-                &CreateViewRequest_oneof_one_of_thumbnail::thumbnail(ref v) => {
+                &CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
                     my_size += ::protobuf::rt::string_size(4, &v);
                 },
             };
@@ -918,7 +918,7 @@ impl ::protobuf::Message for CreateViewRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
             match v {
-                &CreateViewRequest_oneof_one_of_thumbnail::thumbnail(ref v) => {
+                &CreateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
                     os.write_string(4, v)?;
                 },
             };
@@ -953,8 +953,8 @@ impl ::protobuf::Message for CreateViewRequest {
         Self::descriptor_static()
     }
 
-    fn new() -> CreateViewRequest {
-        CreateViewRequest::new()
+    fn new() -> CreateViewPayload {
+        CreateViewPayload::new()
     }
 
     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
@@ -963,44 +963,44 @@ impl ::protobuf::Message for CreateViewRequest {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "belong_to_id",
-                |m: &CreateViewRequest| { &m.belong_to_id },
-                |m: &mut CreateViewRequest| { &mut m.belong_to_id },
+                |m: &CreateViewPayload| { &m.belong_to_id },
+                |m: &mut CreateViewPayload| { &mut m.belong_to_id },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "name",
-                |m: &CreateViewRequest| { &m.name },
-                |m: &mut CreateViewRequest| { &mut m.name },
+                |m: &CreateViewPayload| { &m.name },
+                |m: &mut CreateViewPayload| { &mut m.name },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "desc",
-                |m: &CreateViewRequest| { &m.desc },
-                |m: &mut CreateViewRequest| { &mut m.desc },
+                |m: &CreateViewPayload| { &m.desc },
+                |m: &mut CreateViewPayload| { &mut m.desc },
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
                 "thumbnail",
-                CreateViewRequest::has_thumbnail,
-                CreateViewRequest::get_thumbnail,
+                CreateViewPayload::has_thumbnail,
+                CreateViewPayload::get_thumbnail,
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeEnum<ViewType>>(
                 "view_type",
-                |m: &CreateViewRequest| { &m.view_type },
-                |m: &mut CreateViewRequest| { &mut m.view_type },
+                |m: &CreateViewPayload| { &m.view_type },
+                |m: &mut CreateViewPayload| { &mut m.view_type },
             ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewRequest>(
-                "CreateViewRequest",
+            ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateViewPayload>(
+                "CreateViewPayload",
                 fields,
                 file_descriptor_proto()
             )
         })
     }
 
-    fn default_instance() -> &'static CreateViewRequest {
-        static instance: ::protobuf::rt::LazyV2<CreateViewRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(CreateViewRequest::new)
+    fn default_instance() -> &'static CreateViewPayload {
+        static instance: ::protobuf::rt::LazyV2<CreateViewPayload> = ::protobuf::rt::LazyV2::INIT;
+        instance.get(CreateViewPayload::new)
     }
 }
 
-impl ::protobuf::Clear for CreateViewRequest {
+impl ::protobuf::Clear for CreateViewPayload {
     fn clear(&mut self) {
         self.belong_to_id.clear();
         self.name.clear();
@@ -1011,13 +1011,13 @@ impl ::protobuf::Clear for CreateViewRequest {
     }
 }
 
-impl ::std::fmt::Debug for CreateViewRequest {
+impl ::std::fmt::Debug for CreateViewPayload {
     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         ::protobuf::text_format::fmt(self, f)
     }
 }
 
-impl ::protobuf::reflect::ProtobufValue for CreateViewRequest {
+impl ::protobuf::reflect::ProtobufValue for CreateViewPayload {
     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
         ::protobuf::reflect::ReflectValueRef::Message(self)
     }
@@ -1423,168 +1423,10 @@ impl ::protobuf::reflect::ProtobufValue for CreateViewParams {
     }
 }
 
-#[derive(PartialEq,Clone,Default)]
-pub struct QueryViewRequest {
-    // message fields
-    pub view_ids: ::protobuf::RepeatedField<::std::string::String>,
-    // special fields
-    pub unknown_fields: ::protobuf::UnknownFields,
-    pub cached_size: ::protobuf::CachedSize,
-}
-
-impl<'a> ::std::default::Default for &'a QueryViewRequest {
-    fn default() -> &'a QueryViewRequest {
-        <QueryViewRequest as ::protobuf::Message>::default_instance()
-    }
-}
-
-impl QueryViewRequest {
-    pub fn new() -> QueryViewRequest {
-        ::std::default::Default::default()
-    }
-
-    // repeated string view_ids = 1;
-
-
-    pub fn get_view_ids(&self) -> &[::std::string::String] {
-        &self.view_ids
-    }
-    pub fn clear_view_ids(&mut self) {
-        self.view_ids.clear();
-    }
-
-    // Param is passed by value, moved
-    pub fn set_view_ids(&mut self, v: ::protobuf::RepeatedField<::std::string::String>) {
-        self.view_ids = v;
-    }
-
-    // Mutable pointer to the field.
-    pub fn mut_view_ids(&mut self) -> &mut ::protobuf::RepeatedField<::std::string::String> {
-        &mut self.view_ids
-    }
-
-    // Take field
-    pub fn take_view_ids(&mut self) -> ::protobuf::RepeatedField<::std::string::String> {
-        ::std::mem::replace(&mut self.view_ids, ::protobuf::RepeatedField::new())
-    }
-}
-
-impl ::protobuf::Message for QueryViewRequest {
-    fn is_initialized(&self) -> bool {
-        true
-    }
-
-    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        while !is.eof()? {
-            let (field_number, wire_type) = is.read_tag_unpack()?;
-            match field_number {
-                1 => {
-                    ::protobuf::rt::read_repeated_string_into(wire_type, is, &mut self.view_ids)?;
-                },
-                _ => {
-                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
-                },
-            };
-        }
-        ::std::result::Result::Ok(())
-    }
-
-    // Compute sizes of nested messages
-    #[allow(unused_variables)]
-    fn compute_size(&self) -> u32 {
-        let mut my_size = 0;
-        for value in &self.view_ids {
-            my_size += ::protobuf::rt::string_size(1, &value);
-        };
-        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
-        self.cached_size.set(my_size);
-        my_size
-    }
-
-    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        for v in &self.view_ids {
-            os.write_string(1, &v)?;
-        };
-        os.write_unknown_fields(self.get_unknown_fields())?;
-        ::std::result::Result::Ok(())
-    }
-
-    fn get_cached_size(&self) -> u32 {
-        self.cached_size.get()
-    }
-
-    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
-        &self.unknown_fields
-    }
-
-    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
-        &mut self.unknown_fields
-    }
-
-    fn as_any(&self) -> &dyn (::std::any::Any) {
-        self as &dyn (::std::any::Any)
-    }
-    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
-        self as &mut dyn (::std::any::Any)
-    }
-    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
-        self
-    }
-
-    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
-        Self::descriptor_static()
-    }
-
-    fn new() -> QueryViewRequest {
-        QueryViewRequest::new()
-    }
-
-    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
-        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
-        descriptor.get(|| {
-            let mut fields = ::std::vec::Vec::new();
-            fields.push(::protobuf::reflect::accessor::make_repeated_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
-                "view_ids",
-                |m: &QueryViewRequest| { &m.view_ids },
-                |m: &mut QueryViewRequest| { &mut m.view_ids },
-            ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryViewRequest>(
-                "QueryViewRequest",
-                fields,
-                file_descriptor_proto()
-            )
-        })
-    }
-
-    fn default_instance() -> &'static QueryViewRequest {
-        static instance: ::protobuf::rt::LazyV2<QueryViewRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(QueryViewRequest::new)
-    }
-}
-
-impl ::protobuf::Clear for QueryViewRequest {
-    fn clear(&mut self) {
-        self.view_ids.clear();
-        self.unknown_fields.clear();
-    }
-}
-
-impl ::std::fmt::Debug for QueryViewRequest {
-    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        ::protobuf::text_format::fmt(self, f)
-    }
-}
-
-impl ::protobuf::reflect::ProtobufValue for QueryViewRequest {
-    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
-        ::protobuf::reflect::ReflectValueRef::Message(self)
-    }
-}
-
 #[derive(PartialEq,Clone,Default)]
 pub struct ViewId {
     // message fields
-    pub view_id: ::std::string::String,
+    pub value: ::std::string::String,
     // special fields
     pub unknown_fields: ::protobuf::UnknownFields,
     pub cached_size: ::protobuf::CachedSize,
@@ -1601,30 +1443,30 @@ impl ViewId {
         ::std::default::Default::default()
     }
 
-    // string view_id = 1;
+    // string value = 1;
 
 
-    pub fn get_view_id(&self) -> &str {
-        &self.view_id
+    pub fn get_value(&self) -> &str {
+        &self.value
     }
-    pub fn clear_view_id(&mut self) {
-        self.view_id.clear();
+    pub fn clear_value(&mut self) {
+        self.value.clear();
     }
 
     // Param is passed by value, moved
-    pub fn set_view_id(&mut self, v: ::std::string::String) {
-        self.view_id = v;
+    pub fn set_value(&mut self, v: ::std::string::String) {
+        self.value = v;
     }
 
     // Mutable pointer to the field.
     // If field is not initialized, it is initialized with default value first.
-    pub fn mut_view_id(&mut self) -> &mut ::std::string::String {
-        &mut self.view_id
+    pub fn mut_value(&mut self) -> &mut ::std::string::String {
+        &mut self.value
     }
 
     // Take field
-    pub fn take_view_id(&mut self) -> ::std::string::String {
-        ::std::mem::replace(&mut self.view_id, ::std::string::String::new())
+    pub fn take_value(&mut self) -> ::std::string::String {
+        ::std::mem::replace(&mut self.value, ::std::string::String::new())
     }
 }
 
@@ -1638,7 +1480,7 @@ impl ::protobuf::Message for ViewId {
             let (field_number, wire_type) = is.read_tag_unpack()?;
             match field_number {
                 1 => {
-                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.view_id)?;
+                    ::protobuf::rt::read_singular_proto3_string_into(wire_type, is, &mut self.value)?;
                 },
                 _ => {
                     ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
@@ -1652,8 +1494,8 @@ impl ::protobuf::Message for ViewId {
     #[allow(unused_variables)]
     fn compute_size(&self) -> u32 {
         let mut my_size = 0;
-        if !self.view_id.is_empty() {
-            my_size += ::protobuf::rt::string_size(1, &self.view_id);
+        if !self.value.is_empty() {
+            my_size += ::protobuf::rt::string_size(1, &self.value);
         }
         my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
         self.cached_size.set(my_size);
@@ -1661,8 +1503,8 @@ impl ::protobuf::Message for ViewId {
     }
 
     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        if !self.view_id.is_empty() {
-            os.write_string(1, &self.view_id)?;
+        if !self.value.is_empty() {
+            os.write_string(1, &self.value)?;
         }
         os.write_unknown_fields(self.get_unknown_fields())?;
         ::std::result::Result::Ok(())
@@ -1703,9 +1545,9 @@ impl ::protobuf::Message for ViewId {
         descriptor.get(|| {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
-                "view_id",
-                |m: &ViewId| { &m.view_id },
-                |m: &mut ViewId| { &mut m.view_id },
+                "value",
+                |m: &ViewId| { &m.value },
+                |m: &mut ViewId| { &mut m.value },
             ));
             ::protobuf::reflect::MessageDescriptor::new_pb_name::<ViewId>(
                 "ViewId",
@@ -1723,7 +1565,7 @@ impl ::protobuf::Message for ViewId {
 
 impl ::protobuf::Clear for ViewId {
     fn clear(&mut self) {
-        self.view_id.clear();
+        self.value.clear();
         self.unknown_fields.clear();
     }
 }
@@ -1899,41 +1741,41 @@ impl ::protobuf::reflect::ProtobufValue for RepeatedViewId {
 }
 
 #[derive(PartialEq,Clone,Default)]
-pub struct UpdateViewRequest {
+pub struct UpdateViewPayload {
     // message fields
     pub view_id: ::std::string::String,
     // message oneof groups
-    pub one_of_name: ::std::option::Option<UpdateViewRequest_oneof_one_of_name>,
-    pub one_of_desc: ::std::option::Option<UpdateViewRequest_oneof_one_of_desc>,
-    pub one_of_thumbnail: ::std::option::Option<UpdateViewRequest_oneof_one_of_thumbnail>,
+    pub one_of_name: ::std::option::Option<UpdateViewPayload_oneof_one_of_name>,
+    pub one_of_desc: ::std::option::Option<UpdateViewPayload_oneof_one_of_desc>,
+    pub one_of_thumbnail: ::std::option::Option<UpdateViewPayload_oneof_one_of_thumbnail>,
     // special fields
     pub unknown_fields: ::protobuf::UnknownFields,
     pub cached_size: ::protobuf::CachedSize,
 }
 
-impl<'a> ::std::default::Default for &'a UpdateViewRequest {
-    fn default() -> &'a UpdateViewRequest {
-        <UpdateViewRequest as ::protobuf::Message>::default_instance()
+impl<'a> ::std::default::Default for &'a UpdateViewPayload {
+    fn default() -> &'a UpdateViewPayload {
+        <UpdateViewPayload as ::protobuf::Message>::default_instance()
     }
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateViewRequest_oneof_one_of_name {
+pub enum UpdateViewPayload_oneof_one_of_name {
     name(::std::string::String),
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateViewRequest_oneof_one_of_desc {
+pub enum UpdateViewPayload_oneof_one_of_desc {
     desc(::std::string::String),
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateViewRequest_oneof_one_of_thumbnail {
+pub enum UpdateViewPayload_oneof_one_of_thumbnail {
     thumbnail(::std::string::String),
 }
 
-impl UpdateViewRequest {
-    pub fn new() -> UpdateViewRequest {
+impl UpdateViewPayload {
+    pub fn new() -> UpdateViewPayload {
         ::std::default::Default::default()
     }
 
@@ -1968,7 +1810,7 @@ impl UpdateViewRequest {
 
     pub fn get_name(&self) -> &str {
         match self.one_of_name {
-            ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_name::name(ref v)) => v,
+            ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(ref v)) => v,
             _ => "",
         }
     }
@@ -1978,24 +1820,24 @@ impl UpdateViewRequest {
 
     pub fn has_name(&self) -> bool {
         match self.one_of_name {
-            ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_name::name(..)) => true,
+            ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_name(&mut self, v: ::std::string::String) {
-        self.one_of_name = ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_name::name(v))
+        self.one_of_name = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_name(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_name::name(_)) = self.one_of_name {
+        if let ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(_)) = self.one_of_name {
         } else {
-            self.one_of_name = ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_name::name(::std::string::String::new()));
+            self.one_of_name = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(::std::string::String::new()));
         }
         match self.one_of_name {
-            ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_name::name(ref mut v)) => v,
+            ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -2004,7 +1846,7 @@ impl UpdateViewRequest {
     pub fn take_name(&mut self) -> ::std::string::String {
         if self.has_name() {
             match self.one_of_name.take() {
-                ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_name::name(v)) => v,
+                ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -2017,7 +1859,7 @@ impl UpdateViewRequest {
 
     pub fn get_desc(&self) -> &str {
         match self.one_of_desc {
-            ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_desc::desc(ref v)) => v,
+            ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(ref v)) => v,
             _ => "",
         }
     }
@@ -2027,24 +1869,24 @@ impl UpdateViewRequest {
 
     pub fn has_desc(&self) -> bool {
         match self.one_of_desc {
-            ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_desc::desc(..)) => true,
+            ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_desc(&mut self, v: ::std::string::String) {
-        self.one_of_desc = ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_desc::desc(v))
+        self.one_of_desc = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_desc(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_desc::desc(_)) = self.one_of_desc {
+        if let ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(_)) = self.one_of_desc {
         } else {
-            self.one_of_desc = ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_desc::desc(::std::string::String::new()));
+            self.one_of_desc = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(::std::string::String::new()));
         }
         match self.one_of_desc {
-            ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_desc::desc(ref mut v)) => v,
+            ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -2053,7 +1895,7 @@ impl UpdateViewRequest {
     pub fn take_desc(&mut self) -> ::std::string::String {
         if self.has_desc() {
             match self.one_of_desc.take() {
-                ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_desc::desc(v)) => v,
+                ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -2066,7 +1908,7 @@ impl UpdateViewRequest {
 
     pub fn get_thumbnail(&self) -> &str {
         match self.one_of_thumbnail {
-            ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
+            ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v)) => v,
             _ => "",
         }
     }
@@ -2076,24 +1918,24 @@ impl UpdateViewRequest {
 
     pub fn has_thumbnail(&self) -> bool {
         match self.one_of_thumbnail {
-            ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(..)) => true,
+            ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_thumbnail(&mut self, v: ::std::string::String) {
-        self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(v))
+        self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_thumbnail(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
+        if let ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(_)) = self.one_of_thumbnail {
         } else {
-            self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
+            self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(::std::string::String::new()));
         }
         match self.one_of_thumbnail {
-            ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
+            ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -2102,7 +1944,7 @@ impl UpdateViewRequest {
     pub fn take_thumbnail(&mut self) -> ::std::string::String {
         if self.has_thumbnail() {
             match self.one_of_thumbnail.take() {
-                ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(v)) => v,
+                ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -2111,7 +1953,7 @@ impl UpdateViewRequest {
     }
 }
 
-impl ::protobuf::Message for UpdateViewRequest {
+impl ::protobuf::Message for UpdateViewPayload {
     fn is_initialized(&self) -> bool {
         true
     }
@@ -2127,19 +1969,19 @@ impl ::protobuf::Message for UpdateViewRequest {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_name = ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_name::name(is.read_string()?));
+                    self.one_of_name = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_name::name(is.read_string()?));
                 },
                 3 => {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_desc = ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_desc::desc(is.read_string()?));
+                    self.one_of_desc = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_desc::desc(is.read_string()?));
                 },
                 4 => {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
+                    self.one_of_thumbnail = ::std::option::Option::Some(UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(is.read_string()?));
                 },
                 _ => {
                     ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
@@ -2158,21 +2000,21 @@ impl ::protobuf::Message for UpdateViewRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_name {
             match v {
-                &UpdateViewRequest_oneof_one_of_name::name(ref v) => {
+                &UpdateViewPayload_oneof_one_of_name::name(ref v) => {
                     my_size += ::protobuf::rt::string_size(2, &v);
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_desc {
             match v {
-                &UpdateViewRequest_oneof_one_of_desc::desc(ref v) => {
+                &UpdateViewPayload_oneof_one_of_desc::desc(ref v) => {
                     my_size += ::protobuf::rt::string_size(3, &v);
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
             match v {
-                &UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(ref v) => {
+                &UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
                     my_size += ::protobuf::rt::string_size(4, &v);
                 },
             };
@@ -2188,21 +2030,21 @@ impl ::protobuf::Message for UpdateViewRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_name {
             match v {
-                &UpdateViewRequest_oneof_one_of_name::name(ref v) => {
+                &UpdateViewPayload_oneof_one_of_name::name(ref v) => {
                     os.write_string(2, v)?;
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_desc {
             match v {
-                &UpdateViewRequest_oneof_one_of_desc::desc(ref v) => {
+                &UpdateViewPayload_oneof_one_of_desc::desc(ref v) => {
                     os.write_string(3, v)?;
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_thumbnail {
             match v {
-                &UpdateViewRequest_oneof_one_of_thumbnail::thumbnail(ref v) => {
+                &UpdateViewPayload_oneof_one_of_thumbnail::thumbnail(ref v) => {
                     os.write_string(4, v)?;
                 },
             };
@@ -2237,8 +2079,8 @@ impl ::protobuf::Message for UpdateViewRequest {
         Self::descriptor_static()
     }
 
-    fn new() -> UpdateViewRequest {
-        UpdateViewRequest::new()
+    fn new() -> UpdateViewPayload {
+        UpdateViewPayload::new()
     }
 
     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
@@ -2247,39 +2089,39 @@ impl ::protobuf::Message for UpdateViewRequest {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "view_id",
-                |m: &UpdateViewRequest| { &m.view_id },
-                |m: &mut UpdateViewRequest| { &mut m.view_id },
+                |m: &UpdateViewPayload| { &m.view_id },
+                |m: &mut UpdateViewPayload| { &mut m.view_id },
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
                 "name",
-                UpdateViewRequest::has_name,
-                UpdateViewRequest::get_name,
+                UpdateViewPayload::has_name,
+                UpdateViewPayload::get_name,
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
                 "desc",
-                UpdateViewRequest::has_desc,
-                UpdateViewRequest::get_desc,
+                UpdateViewPayload::has_desc,
+                UpdateViewPayload::get_desc,
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
                 "thumbnail",
-                UpdateViewRequest::has_thumbnail,
-                UpdateViewRequest::get_thumbnail,
+                UpdateViewPayload::has_thumbnail,
+                UpdateViewPayload::get_thumbnail,
             ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateViewRequest>(
-                "UpdateViewRequest",
+            ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateViewPayload>(
+                "UpdateViewPayload",
                 fields,
                 file_descriptor_proto()
             )
         })
     }
 
-    fn default_instance() -> &'static UpdateViewRequest {
-        static instance: ::protobuf::rt::LazyV2<UpdateViewRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(UpdateViewRequest::new)
+    fn default_instance() -> &'static UpdateViewPayload {
+        static instance: ::protobuf::rt::LazyV2<UpdateViewPayload> = ::protobuf::rt::LazyV2::INIT;
+        instance.get(UpdateViewPayload::new)
     }
 }
 
-impl ::protobuf::Clear for UpdateViewRequest {
+impl ::protobuf::Clear for UpdateViewPayload {
     fn clear(&mut self) {
         self.view_id.clear();
         self.one_of_name = ::std::option::Option::None;
@@ -2289,13 +2131,13 @@ impl ::protobuf::Clear for UpdateViewRequest {
     }
 }
 
-impl ::std::fmt::Debug for UpdateViewRequest {
+impl ::std::fmt::Debug for UpdateViewPayload {
     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         ::protobuf::text_format::fmt(self, f)
     }
 }
 
-impl ::protobuf::reflect::ProtobufValue for UpdateViewRequest {
+impl ::protobuf::reflect::ProtobufValue for UpdateViewPayload {
     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
         ::protobuf::reflect::ReflectValueRef::Message(self)
     }
@@ -2763,7 +2605,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     gings\x18\x07\x20\x01(\x0b2\r.RepeatedViewR\nbelongings\x12#\n\rmodified\
     _time\x18\x08\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_time\x18\
     \t\x20\x01(\x03R\ncreateTime\"+\n\x0cRepeatedView\x12\x1b\n\x05items\x18\
-    \x01\x20\x03(\x0b2\x05.ViewR\x05items\"\xb9\x01\n\x11CreateViewRequest\
+    \x01\x20\x03(\x0b2\x05.ViewR\x05items\"\xb9\x01\n\x11CreateViewPayload\
     \x12\x20\n\x0cbelong_to_id\x18\x01\x20\x01(\tR\nbelongToId\x12\x12\n\x04\
     name\x18\x02\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\
     \x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\0R\tthumbnail\x12&\n\t\
@@ -2773,20 +2615,19 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     me\x12\x12\n\x04desc\x18\x03\x20\x01(\tR\x04desc\x12\x1c\n\tthumbnail\
     \x18\x04\x20\x01(\tR\tthumbnail\x12&\n\tview_type\x18\x05\x20\x01(\x0e2\
     \t.ViewTypeR\x08viewType\x12\x1b\n\tview_data\x18\x06\x20\x01(\tR\x08vie\
-    wData\x12\x17\n\x07view_id\x18\x07\x20\x01(\tR\x06viewId\"-\n\x10QueryVi\
-    ewRequest\x12\x19\n\x08view_ids\x18\x01\x20\x03(\tR\x07viewIds\"!\n\x06V\
-    iewId\x12\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewId\"&\n\x0eRepeate\
-    dViewId\x12\x14\n\x05items\x18\x01\x20\x03(\tR\x05items\"\xaa\x01\n\x11U\
-    pdateViewRequest\x12\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewId\x12\
-    \x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\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_descB\x12\n\x10one_of_thu\
-    mbnail\"\xa9\x01\n\x10UpdateViewParams\x12\x17\n\x07view_id\x18\x01\x20\
-    \x01(\tR\x06viewId\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\
-    \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\
-    B\x12\n\x10one_of_thumbnail*\x1e\n\x08ViewType\x12\t\n\x05Blank\x10\0\
-    \x12\x07\n\x03Doc\x10\x01b\x06proto3\
+    wData\x12\x17\n\x07view_id\x18\x07\x20\x01(\tR\x06viewId\"\x1e\n\x06View\
+    Id\x12\x14\n\x05value\x18\x01\x20\x01(\tR\x05value\"&\n\x0eRepeatedViewI\
+    d\x12\x14\n\x05items\x18\x01\x20\x03(\tR\x05items\"\xaa\x01\n\x11UpdateV\
+    iewPayload\x12\x17\n\x07view_id\x18\x01\x20\x01(\tR\x06viewId\x12\x14\n\
+    \x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x14\n\x04desc\x18\x03\x20\
+    \x01(\tH\x01R\x04desc\x12\x1e\n\tthumbnail\x18\x04\x20\x01(\tH\x02R\tthu\
+    mbnailB\r\n\x0bone_of_nameB\r\n\x0bone_of_descB\x12\n\x10one_of_thumbnai\
+    l\"\xa9\x01\n\x10UpdateViewParams\x12\x17\n\x07view_id\x18\x01\x20\x01(\
+    \tR\x06viewId\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\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_descB\
+    \x12\n\x10one_of_thumbnail*\x1e\n\x08ViewType\x12\t\n\x05Blank\x10\0\x12\
+    \x07\n\x03Doc\x10\x01b\x06proto3\
 ";
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 65 - 265
shared-lib/flowy-folder-data-model/src/protobuf/model/workspace.rs

@@ -560,7 +560,7 @@ impl ::protobuf::reflect::ProtobufValue for RepeatedWorkspace {
 }
 
 #[derive(PartialEq,Clone,Default)]
-pub struct CreateWorkspaceRequest {
+pub struct CreateWorkspacePayload {
     // message fields
     pub name: ::std::string::String,
     pub desc: ::std::string::String,
@@ -569,14 +569,14 @@ pub struct CreateWorkspaceRequest {
     pub cached_size: ::protobuf::CachedSize,
 }
 
-impl<'a> ::std::default::Default for &'a CreateWorkspaceRequest {
-    fn default() -> &'a CreateWorkspaceRequest {
-        <CreateWorkspaceRequest as ::protobuf::Message>::default_instance()
+impl<'a> ::std::default::Default for &'a CreateWorkspacePayload {
+    fn default() -> &'a CreateWorkspacePayload {
+        <CreateWorkspacePayload as ::protobuf::Message>::default_instance()
     }
 }
 
-impl CreateWorkspaceRequest {
-    pub fn new() -> CreateWorkspaceRequest {
+impl CreateWorkspacePayload {
+    pub fn new() -> CreateWorkspacePayload {
         ::std::default::Default::default()
     }
 
@@ -633,7 +633,7 @@ impl CreateWorkspaceRequest {
     }
 }
 
-impl ::protobuf::Message for CreateWorkspaceRequest {
+impl ::protobuf::Message for CreateWorkspacePayload {
     fn is_initialized(&self) -> bool {
         true
     }
@@ -708,8 +708,8 @@ impl ::protobuf::Message for CreateWorkspaceRequest {
         Self::descriptor_static()
     }
 
-    fn new() -> CreateWorkspaceRequest {
-        CreateWorkspaceRequest::new()
+    fn new() -> CreateWorkspacePayload {
+        CreateWorkspacePayload::new()
     }
 
     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
@@ -718,29 +718,29 @@ impl ::protobuf::Message for CreateWorkspaceRequest {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "name",
-                |m: &CreateWorkspaceRequest| { &m.name },
-                |m: &mut CreateWorkspaceRequest| { &mut m.name },
+                |m: &CreateWorkspacePayload| { &m.name },
+                |m: &mut CreateWorkspacePayload| { &mut m.name },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "desc",
-                |m: &CreateWorkspaceRequest| { &m.desc },
-                |m: &mut CreateWorkspaceRequest| { &mut m.desc },
+                |m: &CreateWorkspacePayload| { &m.desc },
+                |m: &mut CreateWorkspacePayload| { &mut m.desc },
             ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateWorkspaceRequest>(
-                "CreateWorkspaceRequest",
+            ::protobuf::reflect::MessageDescriptor::new_pb_name::<CreateWorkspacePayload>(
+                "CreateWorkspacePayload",
                 fields,
                 file_descriptor_proto()
             )
         })
     }
 
-    fn default_instance() -> &'static CreateWorkspaceRequest {
-        static instance: ::protobuf::rt::LazyV2<CreateWorkspaceRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(CreateWorkspaceRequest::new)
+    fn default_instance() -> &'static CreateWorkspacePayload {
+        static instance: ::protobuf::rt::LazyV2<CreateWorkspacePayload> = ::protobuf::rt::LazyV2::INIT;
+        instance.get(CreateWorkspacePayload::new)
     }
 }
 
-impl ::protobuf::Clear for CreateWorkspaceRequest {
+impl ::protobuf::Clear for CreateWorkspacePayload {
     fn clear(&mut self) {
         self.name.clear();
         self.desc.clear();
@@ -748,13 +748,13 @@ impl ::protobuf::Clear for CreateWorkspaceRequest {
     }
 }
 
-impl ::std::fmt::Debug for CreateWorkspaceRequest {
+impl ::std::fmt::Debug for CreateWorkspacePayload {
     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         ::protobuf::text_format::fmt(self, f)
     }
 }
 
-impl ::protobuf::reflect::ProtobufValue for CreateWorkspaceRequest {
+impl ::protobuf::reflect::ProtobufValue for CreateWorkspacePayload {
     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
         ::protobuf::reflect::ReflectValueRef::Message(self)
     }
@@ -961,208 +961,10 @@ impl ::protobuf::reflect::ProtobufValue for CreateWorkspaceParams {
     }
 }
 
-#[derive(PartialEq,Clone,Default)]
-pub struct QueryWorkspaceRequest {
-    // message oneof groups
-    pub one_of_workspace_id: ::std::option::Option<QueryWorkspaceRequest_oneof_one_of_workspace_id>,
-    // special fields
-    pub unknown_fields: ::protobuf::UnknownFields,
-    pub cached_size: ::protobuf::CachedSize,
-}
-
-impl<'a> ::std::default::Default for &'a QueryWorkspaceRequest {
-    fn default() -> &'a QueryWorkspaceRequest {
-        <QueryWorkspaceRequest as ::protobuf::Message>::default_instance()
-    }
-}
-
-#[derive(Clone,PartialEq,Debug)]
-pub enum QueryWorkspaceRequest_oneof_one_of_workspace_id {
-    workspace_id(::std::string::String),
-}
-
-impl QueryWorkspaceRequest {
-    pub fn new() -> QueryWorkspaceRequest {
-        ::std::default::Default::default()
-    }
-
-    // string workspace_id = 1;
-
-
-    pub fn get_workspace_id(&self) -> &str {
-        match self.one_of_workspace_id {
-            ::std::option::Option::Some(QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(ref v)) => v,
-            _ => "",
-        }
-    }
-    pub fn clear_workspace_id(&mut self) {
-        self.one_of_workspace_id = ::std::option::Option::None;
-    }
-
-    pub fn has_workspace_id(&self) -> bool {
-        match self.one_of_workspace_id {
-            ::std::option::Option::Some(QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(..)) => true,
-            _ => false,
-        }
-    }
-
-    // Param is passed by value, moved
-    pub fn set_workspace_id(&mut self, v: ::std::string::String) {
-        self.one_of_workspace_id = ::std::option::Option::Some(QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(v))
-    }
-
-    // Mutable pointer to the field.
-    pub fn mut_workspace_id(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(_)) = self.one_of_workspace_id {
-        } else {
-            self.one_of_workspace_id = ::std::option::Option::Some(QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(::std::string::String::new()));
-        }
-        match self.one_of_workspace_id {
-            ::std::option::Option::Some(QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(ref mut v)) => v,
-            _ => panic!(),
-        }
-    }
-
-    // Take field
-    pub fn take_workspace_id(&mut self) -> ::std::string::String {
-        if self.has_workspace_id() {
-            match self.one_of_workspace_id.take() {
-                ::std::option::Option::Some(QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(v)) => v,
-                _ => panic!(),
-            }
-        } else {
-            ::std::string::String::new()
-        }
-    }
-}
-
-impl ::protobuf::Message for QueryWorkspaceRequest {
-    fn is_initialized(&self) -> bool {
-        true
-    }
-
-    fn merge_from(&mut self, is: &mut ::protobuf::CodedInputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        while !is.eof()? {
-            let (field_number, wire_type) = is.read_tag_unpack()?;
-            match field_number {
-                1 => {
-                    if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
-                        return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
-                    }
-                    self.one_of_workspace_id = ::std::option::Option::Some(QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(is.read_string()?));
-                },
-                _ => {
-                    ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
-                },
-            };
-        }
-        ::std::result::Result::Ok(())
-    }
-
-    // Compute sizes of nested messages
-    #[allow(unused_variables)]
-    fn compute_size(&self) -> u32 {
-        let mut my_size = 0;
-        if let ::std::option::Option::Some(ref v) = self.one_of_workspace_id {
-            match v {
-                &QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(ref v) => {
-                    my_size += ::protobuf::rt::string_size(1, &v);
-                },
-            };
-        }
-        my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
-        self.cached_size.set(my_size);
-        my_size
-    }
-
-    fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        if let ::std::option::Option::Some(ref v) = self.one_of_workspace_id {
-            match v {
-                &QueryWorkspaceRequest_oneof_one_of_workspace_id::workspace_id(ref v) => {
-                    os.write_string(1, v)?;
-                },
-            };
-        }
-        os.write_unknown_fields(self.get_unknown_fields())?;
-        ::std::result::Result::Ok(())
-    }
-
-    fn get_cached_size(&self) -> u32 {
-        self.cached_size.get()
-    }
-
-    fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
-        &self.unknown_fields
-    }
-
-    fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
-        &mut self.unknown_fields
-    }
-
-    fn as_any(&self) -> &dyn (::std::any::Any) {
-        self as &dyn (::std::any::Any)
-    }
-    fn as_any_mut(&mut self) -> &mut dyn (::std::any::Any) {
-        self as &mut dyn (::std::any::Any)
-    }
-    fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
-        self
-    }
-
-    fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
-        Self::descriptor_static()
-    }
-
-    fn new() -> QueryWorkspaceRequest {
-        QueryWorkspaceRequest::new()
-    }
-
-    fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
-        static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDescriptor> = ::protobuf::rt::LazyV2::INIT;
-        descriptor.get(|| {
-            let mut fields = ::std::vec::Vec::new();
-            fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
-                "workspace_id",
-                QueryWorkspaceRequest::has_workspace_id,
-                QueryWorkspaceRequest::get_workspace_id,
-            ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<QueryWorkspaceRequest>(
-                "QueryWorkspaceRequest",
-                fields,
-                file_descriptor_proto()
-            )
-        })
-    }
-
-    fn default_instance() -> &'static QueryWorkspaceRequest {
-        static instance: ::protobuf::rt::LazyV2<QueryWorkspaceRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(QueryWorkspaceRequest::new)
-    }
-}
-
-impl ::protobuf::Clear for QueryWorkspaceRequest {
-    fn clear(&mut self) {
-        self.one_of_workspace_id = ::std::option::Option::None;
-        self.unknown_fields.clear();
-    }
-}
-
-impl ::std::fmt::Debug for QueryWorkspaceRequest {
-    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
-        ::protobuf::text_format::fmt(self, f)
-    }
-}
-
-impl ::protobuf::reflect::ProtobufValue for QueryWorkspaceRequest {
-    fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
-        ::protobuf::reflect::ReflectValueRef::Message(self)
-    }
-}
-
 #[derive(PartialEq,Clone,Default)]
 pub struct WorkspaceId {
     // message oneof groups
-    pub one_of_workspace_id: ::std::option::Option<WorkspaceId_oneof_one_of_workspace_id>,
+    pub one_of_value: ::std::option::Option<WorkspaceId_oneof_one_of_value>,
     // special fields
     pub unknown_fields: ::protobuf::UnknownFields,
     pub cached_size: ::protobuf::CachedSize,
@@ -1175,8 +977,8 @@ impl<'a> ::std::default::Default for &'a WorkspaceId {
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum WorkspaceId_oneof_one_of_workspace_id {
-    workspace_id(::std::string::String),
+pub enum WorkspaceId_oneof_one_of_value {
+    value(::std::string::String),
 }
 
 impl WorkspaceId {
@@ -1184,48 +986,48 @@ impl WorkspaceId {
         ::std::default::Default::default()
     }
 
-    // string workspace_id = 1;
+    // string value = 1;
 
 
-    pub fn get_workspace_id(&self) -> &str {
-        match self.one_of_workspace_id {
-            ::std::option::Option::Some(WorkspaceId_oneof_one_of_workspace_id::workspace_id(ref v)) => v,
+    pub fn get_value(&self) -> &str {
+        match self.one_of_value {
+            ::std::option::Option::Some(WorkspaceId_oneof_one_of_value::value(ref v)) => v,
             _ => "",
         }
     }
-    pub fn clear_workspace_id(&mut self) {
-        self.one_of_workspace_id = ::std::option::Option::None;
+    pub fn clear_value(&mut self) {
+        self.one_of_value = ::std::option::Option::None;
     }
 
-    pub fn has_workspace_id(&self) -> bool {
-        match self.one_of_workspace_id {
-            ::std::option::Option::Some(WorkspaceId_oneof_one_of_workspace_id::workspace_id(..)) => true,
+    pub fn has_value(&self) -> bool {
+        match self.one_of_value {
+            ::std::option::Option::Some(WorkspaceId_oneof_one_of_value::value(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
-    pub fn set_workspace_id(&mut self, v: ::std::string::String) {
-        self.one_of_workspace_id = ::std::option::Option::Some(WorkspaceId_oneof_one_of_workspace_id::workspace_id(v))
+    pub fn set_value(&mut self, v: ::std::string::String) {
+        self.one_of_value = ::std::option::Option::Some(WorkspaceId_oneof_one_of_value::value(v))
     }
 
     // Mutable pointer to the field.
-    pub fn mut_workspace_id(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(WorkspaceId_oneof_one_of_workspace_id::workspace_id(_)) = self.one_of_workspace_id {
+    pub fn mut_value(&mut self) -> &mut ::std::string::String {
+        if let ::std::option::Option::Some(WorkspaceId_oneof_one_of_value::value(_)) = self.one_of_value {
         } else {
-            self.one_of_workspace_id = ::std::option::Option::Some(WorkspaceId_oneof_one_of_workspace_id::workspace_id(::std::string::String::new()));
+            self.one_of_value = ::std::option::Option::Some(WorkspaceId_oneof_one_of_value::value(::std::string::String::new()));
         }
-        match self.one_of_workspace_id {
-            ::std::option::Option::Some(WorkspaceId_oneof_one_of_workspace_id::workspace_id(ref mut v)) => v,
+        match self.one_of_value {
+            ::std::option::Option::Some(WorkspaceId_oneof_one_of_value::value(ref mut v)) => v,
             _ => panic!(),
         }
     }
 
     // Take field
-    pub fn take_workspace_id(&mut self) -> ::std::string::String {
-        if self.has_workspace_id() {
-            match self.one_of_workspace_id.take() {
-                ::std::option::Option::Some(WorkspaceId_oneof_one_of_workspace_id::workspace_id(v)) => v,
+    pub fn take_value(&mut self) -> ::std::string::String {
+        if self.has_value() {
+            match self.one_of_value.take() {
+                ::std::option::Option::Some(WorkspaceId_oneof_one_of_value::value(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -1247,7 +1049,7 @@ impl ::protobuf::Message for WorkspaceId {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_workspace_id = ::std::option::Option::Some(WorkspaceId_oneof_one_of_workspace_id::workspace_id(is.read_string()?));
+                    self.one_of_value = ::std::option::Option::Some(WorkspaceId_oneof_one_of_value::value(is.read_string()?));
                 },
                 _ => {
                     ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
@@ -1261,9 +1063,9 @@ impl ::protobuf::Message for WorkspaceId {
     #[allow(unused_variables)]
     fn compute_size(&self) -> u32 {
         let mut my_size = 0;
-        if let ::std::option::Option::Some(ref v) = self.one_of_workspace_id {
+        if let ::std::option::Option::Some(ref v) = self.one_of_value {
             match v {
-                &WorkspaceId_oneof_one_of_workspace_id::workspace_id(ref v) => {
+                &WorkspaceId_oneof_one_of_value::value(ref v) => {
                     my_size += ::protobuf::rt::string_size(1, &v);
                 },
             };
@@ -1274,9 +1076,9 @@ impl ::protobuf::Message for WorkspaceId {
     }
 
     fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
-        if let ::std::option::Option::Some(ref v) = self.one_of_workspace_id {
+        if let ::std::option::Option::Some(ref v) = self.one_of_value {
             match v {
-                &WorkspaceId_oneof_one_of_workspace_id::workspace_id(ref v) => {
+                &WorkspaceId_oneof_one_of_value::value(ref v) => {
                     os.write_string(1, v)?;
                 },
             };
@@ -1320,9 +1122,9 @@ impl ::protobuf::Message for WorkspaceId {
         descriptor.get(|| {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
-                "workspace_id",
-                WorkspaceId::has_workspace_id,
-                WorkspaceId::get_workspace_id,
+                "value",
+                WorkspaceId::has_value,
+                WorkspaceId::get_value,
             ));
             ::protobuf::reflect::MessageDescriptor::new_pb_name::<WorkspaceId>(
                 "WorkspaceId",
@@ -1340,7 +1142,7 @@ impl ::protobuf::Message for WorkspaceId {
 
 impl ::protobuf::Clear for WorkspaceId {
     fn clear(&mut self) {
-        self.one_of_workspace_id = ::std::option::Option::None;
+        self.one_of_value = ::std::option::Option::None;
         self.unknown_fields.clear();
     }
 }
@@ -2273,22 +2075,20 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     dified_time\x18\x05\x20\x01(\x03R\x0cmodifiedTime\x12\x1f\n\x0bcreate_ti\
     me\x18\x06\x20\x01(\x03R\ncreateTime\"5\n\x11RepeatedWorkspace\x12\x20\n\
     \x05items\x18\x01\x20\x03(\x0b2\n.WorkspaceR\x05items\"@\n\x16CreateWork\
-    spaceRequest\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x12\n\x04\
+    spacePayload\x12\x12\n\x04name\x18\x01\x20\x01(\tR\x04name\x12\x12\n\x04\
     desc\x18\x02\x20\x01(\tR\x04desc\"?\n\x15CreateWorkspaceParams\x12\x12\n\
     \x04name\x18\x01\x20\x01(\tR\x04name\x12\x12\n\x04desc\x18\x02\x20\x01(\
-    \tR\x04desc\"S\n\x15QueryWorkspaceRequest\x12#\n\x0cworkspace_id\x18\x01\
-    \x20\x01(\tH\0R\x0bworkspaceIdB\x15\n\x13one_of_workspace_id\"I\n\x0bWor\
-    kspaceId\x12#\n\x0cworkspace_id\x18\x01\x20\x01(\tH\0R\x0bworkspaceIdB\
-    \x15\n\x13one_of_workspace_id\"\x83\x01\n\x17CurrentWorkspaceSetting\x12\
-    (\n\tworkspace\x18\x01\x20\x01(\x0b2\n.WorkspaceR\tworkspace\x12(\n\x0bl\
-    atest_view\x18\x02\x20\x01(\x0b2\x05.ViewH\0R\nlatestViewB\x14\n\x12one_\
-    of_latest_view\"r\n\x16UpdateWorkspaceRequest\x12\x0e\n\x02id\x18\x01\
-    \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\
-    \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\
-    \x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04descB\r\n\x0bone_of_nameB\r\n\
-    \x0bone_of_descb\x06proto3\
+    \tR\x04desc\"5\n\x0bWorkspaceId\x12\x16\n\x05value\x18\x01\x20\x01(\tH\0\
+    R\x05valueB\x0e\n\x0cone_of_value\"\x83\x01\n\x17CurrentWorkspaceSetting\
+    \x12(\n\tworkspace\x18\x01\x20\x01(\x0b2\n.WorkspaceR\tworkspace\x12(\n\
+    \x0blatest_view\x18\x02\x20\x01(\x0b2\x05.ViewH\0R\nlatestViewB\x14\n\
+    \x12one_of_latest_view\"r\n\x16UpdateWorkspaceRequest\x12\x0e\n\x02id\
+    \x18\x01\x20\x01(\tR\x02id\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04n\
+    ame\x12\x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04descB\r\n\x0bone_of_na\
+    meB\r\n\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\x14\n\x04desc\x18\x03\x20\x01(\tH\x01R\x04descB\r\n\x0bone_of_nameB\
+    \r\n\x0bone_of_descb\x06proto3\
 ";
 
 static file_descriptor_proto_lazy: ::protobuf::rt::LazyV2<::protobuf::descriptor::FileDescriptorProto> = ::protobuf::rt::LazyV2::INIT;

+ 3 - 6
shared-lib/flowy-folder-data-model/src/protobuf/proto/app.proto

@@ -14,7 +14,7 @@ message App {
 message RepeatedApp {
     repeated App items = 1;
 }
-message CreateAppRequest {
+message CreateAppPayload {
     string workspace_id = 1;
     string name = 2;
     string desc = 3;
@@ -29,13 +29,10 @@ message CreateAppParams {
     string desc = 3;
     ColorStyle color_style = 4;
 }
-message QueryAppRequest {
-    repeated string app_ids = 1;
-}
 message AppId {
-    string app_id = 1;
+    string value = 1;
 }
-message UpdateAppRequest {
+message UpdateAppPayload {
     string app_id = 1;
     oneof one_of_name { string name = 2; };
     oneof one_of_desc { string desc = 3; };

+ 1 - 1
shared-lib/flowy-folder-data-model/src/protobuf/proto/share.proto

@@ -1,6 +1,6 @@
 syntax = "proto3";
 
-message ExportRequest {
+message ExportPayload {
     string doc_id = 1;
     ExportType export_type = 2;
 }

+ 3 - 6
shared-lib/flowy-folder-data-model/src/protobuf/proto/view.proto

@@ -14,7 +14,7 @@ message View {
 message RepeatedView {
     repeated View items = 1;
 }
-message CreateViewRequest {
+message CreateViewPayload {
     string belong_to_id = 1;
     string name = 2;
     string desc = 3;
@@ -30,16 +30,13 @@ message CreateViewParams {
     string view_data = 6;
     string view_id = 7;
 }
-message QueryViewRequest {
-    repeated string view_ids = 1;
-}
 message ViewId {
-    string view_id = 1;
+    string value = 1;
 }
 message RepeatedViewId {
     repeated string items = 1;
 }
-message UpdateViewRequest {
+message UpdateViewPayload {
     string view_id = 1;
     oneof one_of_name { string name = 2; };
     oneof one_of_desc { string desc = 3; };

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

@@ -13,7 +13,7 @@ message Workspace {
 message RepeatedWorkspace {
     repeated Workspace items = 1;
 }
-message CreateWorkspaceRequest {
+message CreateWorkspacePayload {
     string name = 1;
     string desc = 2;
 }
@@ -21,11 +21,8 @@ message CreateWorkspaceParams {
     string name = 1;
     string desc = 2;
 }
-message QueryWorkspaceRequest {
-    oneof one_of_workspace_id { string workspace_id = 1; };
-}
 message WorkspaceId {
-    oneof one_of_workspace_id { string workspace_id = 1; };
+    oneof one_of_value { string value = 1; };
 }
 message CurrentWorkspaceSetting {
     Workspace workspace = 1;

+ 4 - 4
shared-lib/flowy-user-data-model/src/entities/auth.rs

@@ -5,7 +5,7 @@ use flowy_derive::ProtoBuf;
 use crate::{errors::*, parser::*};
 
 #[derive(ProtoBuf, Default)]
-pub struct SignInRequest {
+pub struct SignInPayload {
     #[pb(index = 1)]
     pub email: String,
 
@@ -43,7 +43,7 @@ pub struct SignInResponse {
     pub token: String,
 }
 
-impl TryInto<SignInParams> for SignInRequest {
+impl TryInto<SignInParams> for SignInPayload {
     type Error = ErrorCode;
 
     fn try_into(self) -> Result<SignInParams, Self::Error> {
@@ -59,7 +59,7 @@ impl TryInto<SignInParams> for SignInRequest {
 }
 
 #[derive(ProtoBuf, Default)]
-pub struct SignUpRequest {
+pub struct SignUpPayload {
     #[pb(index = 1)]
     pub email: String,
 
@@ -69,7 +69,7 @@ pub struct SignUpRequest {
     #[pb(index = 3)]
     pub password: String,
 }
-impl TryInto<SignUpParams> for SignUpRequest {
+impl TryInto<SignUpParams> for SignUpPayload {
     type Error = ErrorCode;
 
     fn try_into(self) -> Result<SignUpParams, Self::Error> {

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

@@ -28,7 +28,7 @@ pub struct UserProfile {
 }
 
 #[derive(ProtoBuf, Default)]
-pub struct UpdateUserRequest {
+pub struct UpdateUserPayload {
     #[pb(index = 1)]
     pub id: String,
 
@@ -42,7 +42,7 @@ pub struct UpdateUserRequest {
     pub password: Option<String>,
 }
 
-impl UpdateUserRequest {
+impl UpdateUserPayload {
     pub fn new(id: &str) -> Self {
         Self {
             id: id.to_owned(),
@@ -105,7 +105,7 @@ impl UpdateUserParams {
     }
 }
 
-impl TryInto<UpdateUserParams> for UpdateUserRequest {
+impl TryInto<UpdateUserParams> for UpdateUserPayload {
     type Error = ErrorCode;
 
     fn try_into(self) -> Result<UpdateUserParams, Self::Error> {

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

@@ -24,7 +24,7 @@
 // const _PROTOBUF_VERSION_CHECK: () = ::protobuf::VERSION_2_25_2;
 
 #[derive(PartialEq,Clone,Default)]
-pub struct SignInRequest {
+pub struct SignInPayload {
     // message fields
     pub email: ::std::string::String,
     pub password: ::std::string::String,
@@ -34,14 +34,14 @@ pub struct SignInRequest {
     pub cached_size: ::protobuf::CachedSize,
 }
 
-impl<'a> ::std::default::Default for &'a SignInRequest {
-    fn default() -> &'a SignInRequest {
-        <SignInRequest as ::protobuf::Message>::default_instance()
+impl<'a> ::std::default::Default for &'a SignInPayload {
+    fn default() -> &'a SignInPayload {
+        <SignInPayload as ::protobuf::Message>::default_instance()
     }
 }
 
-impl SignInRequest {
-    pub fn new() -> SignInRequest {
+impl SignInPayload {
+    pub fn new() -> SignInPayload {
         ::std::default::Default::default()
     }
 
@@ -124,7 +124,7 @@ impl SignInRequest {
     }
 }
 
-impl ::protobuf::Message for SignInRequest {
+impl ::protobuf::Message for SignInPayload {
     fn is_initialized(&self) -> bool {
         true
     }
@@ -208,8 +208,8 @@ impl ::protobuf::Message for SignInRequest {
         Self::descriptor_static()
     }
 
-    fn new() -> SignInRequest {
-        SignInRequest::new()
+    fn new() -> SignInPayload {
+        SignInPayload::new()
     }
 
     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
@@ -218,34 +218,34 @@ impl ::protobuf::Message for SignInRequest {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "email",
-                |m: &SignInRequest| { &m.email },
-                |m: &mut SignInRequest| { &mut m.email },
+                |m: &SignInPayload| { &m.email },
+                |m: &mut SignInPayload| { &mut m.email },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "password",
-                |m: &SignInRequest| { &m.password },
-                |m: &mut SignInRequest| { &mut m.password },
+                |m: &SignInPayload| { &m.password },
+                |m: &mut SignInPayload| { &mut m.password },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "name",
-                |m: &SignInRequest| { &m.name },
-                |m: &mut SignInRequest| { &mut m.name },
+                |m: &SignInPayload| { &m.name },
+                |m: &mut SignInPayload| { &mut m.name },
             ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<SignInRequest>(
-                "SignInRequest",
+            ::protobuf::reflect::MessageDescriptor::new_pb_name::<SignInPayload>(
+                "SignInPayload",
                 fields,
                 file_descriptor_proto()
             )
         })
     }
 
-    fn default_instance() -> &'static SignInRequest {
-        static instance: ::protobuf::rt::LazyV2<SignInRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(SignInRequest::new)
+    fn default_instance() -> &'static SignInPayload {
+        static instance: ::protobuf::rt::LazyV2<SignInPayload> = ::protobuf::rt::LazyV2::INIT;
+        instance.get(SignInPayload::new)
     }
 }
 
-impl ::protobuf::Clear for SignInRequest {
+impl ::protobuf::Clear for SignInPayload {
     fn clear(&mut self) {
         self.email.clear();
         self.password.clear();
@@ -254,13 +254,13 @@ impl ::protobuf::Clear for SignInRequest {
     }
 }
 
-impl ::std::fmt::Debug for SignInRequest {
+impl ::std::fmt::Debug for SignInPayload {
     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         ::protobuf::text_format::fmt(self, f)
     }
 }
 
-impl ::protobuf::reflect::ProtobufValue for SignInRequest {
+impl ::protobuf::reflect::ProtobufValue for SignInPayload {
     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
         ::protobuf::reflect::ReflectValueRef::Message(self)
     }
@@ -795,7 +795,7 @@ impl ::protobuf::reflect::ProtobufValue for SignInResponse {
 }
 
 #[derive(PartialEq,Clone,Default)]
-pub struct SignUpRequest {
+pub struct SignUpPayload {
     // message fields
     pub email: ::std::string::String,
     pub name: ::std::string::String,
@@ -805,14 +805,14 @@ pub struct SignUpRequest {
     pub cached_size: ::protobuf::CachedSize,
 }
 
-impl<'a> ::std::default::Default for &'a SignUpRequest {
-    fn default() -> &'a SignUpRequest {
-        <SignUpRequest as ::protobuf::Message>::default_instance()
+impl<'a> ::std::default::Default for &'a SignUpPayload {
+    fn default() -> &'a SignUpPayload {
+        <SignUpPayload as ::protobuf::Message>::default_instance()
     }
 }
 
-impl SignUpRequest {
-    pub fn new() -> SignUpRequest {
+impl SignUpPayload {
+    pub fn new() -> SignUpPayload {
         ::std::default::Default::default()
     }
 
@@ -895,7 +895,7 @@ impl SignUpRequest {
     }
 }
 
-impl ::protobuf::Message for SignUpRequest {
+impl ::protobuf::Message for SignUpPayload {
     fn is_initialized(&self) -> bool {
         true
     }
@@ -979,8 +979,8 @@ impl ::protobuf::Message for SignUpRequest {
         Self::descriptor_static()
     }
 
-    fn new() -> SignUpRequest {
-        SignUpRequest::new()
+    fn new() -> SignUpPayload {
+        SignUpPayload::new()
     }
 
     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
@@ -989,34 +989,34 @@ impl ::protobuf::Message for SignUpRequest {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "email",
-                |m: &SignUpRequest| { &m.email },
-                |m: &mut SignUpRequest| { &mut m.email },
+                |m: &SignUpPayload| { &m.email },
+                |m: &mut SignUpPayload| { &mut m.email },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "name",
-                |m: &SignUpRequest| { &m.name },
-                |m: &mut SignUpRequest| { &mut m.name },
+                |m: &SignUpPayload| { &m.name },
+                |m: &mut SignUpPayload| { &mut m.name },
             ));
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "password",
-                |m: &SignUpRequest| { &m.password },
-                |m: &mut SignUpRequest| { &mut m.password },
+                |m: &SignUpPayload| { &m.password },
+                |m: &mut SignUpPayload| { &mut m.password },
             ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<SignUpRequest>(
-                "SignUpRequest",
+            ::protobuf::reflect::MessageDescriptor::new_pb_name::<SignUpPayload>(
+                "SignUpPayload",
                 fields,
                 file_descriptor_proto()
             )
         })
     }
 
-    fn default_instance() -> &'static SignUpRequest {
-        static instance: ::protobuf::rt::LazyV2<SignUpRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(SignUpRequest::new)
+    fn default_instance() -> &'static SignUpPayload {
+        static instance: ::protobuf::rt::LazyV2<SignUpPayload> = ::protobuf::rt::LazyV2::INIT;
+        instance.get(SignUpPayload::new)
     }
 }
 
-impl ::protobuf::Clear for SignUpRequest {
+impl ::protobuf::Clear for SignUpPayload {
     fn clear(&mut self) {
         self.email.clear();
         self.name.clear();
@@ -1025,13 +1025,13 @@ impl ::protobuf::Clear for SignUpRequest {
     }
 }
 
-impl ::std::fmt::Debug for SignUpRequest {
+impl ::std::fmt::Debug for SignUpPayload {
     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         ::protobuf::text_format::fmt(self, f)
     }
 }
 
-impl ::protobuf::reflect::ProtobufValue for SignUpRequest {
+impl ::protobuf::reflect::ProtobufValue for SignUpPayload {
     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
         ::protobuf::reflect::ReflectValueRef::Message(self)
     }
@@ -1566,7 +1566,7 @@ impl ::protobuf::reflect::ProtobufValue for SignUpResponse {
 }
 
 static file_descriptor_proto_data: &'static [u8] = b"\
-    \n\nauth.proto\"U\n\rSignInRequest\x12\x14\n\x05email\x18\x01\x20\x01(\t\
+    \n\nauth.proto\"U\n\rSignInPayload\x12\x14\n\x05email\x18\x01\x20\x01(\t\
     R\x05email\x12\x1a\n\x08password\x18\x02\x20\x01(\tR\x08password\x12\x12\
     \n\x04name\x18\x03\x20\x01(\tR\x04name\"T\n\x0cSignInParams\x12\x14\n\
     \x05email\x18\x01\x20\x01(\tR\x05email\x12\x1a\n\x08password\x18\x02\x20\
@@ -1574,7 +1574,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x0eSignInResponse\x12\x17\n\x07user_id\x18\x01\x20\x01(\tR\x06userId\
     \x12\x12\n\x04name\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\x05toke\
-    n\"U\n\rSignUpRequest\x12\x14\n\x05email\x18\x01\x20\x01(\tR\x05email\
+    n\"U\n\rSignUpPayload\x12\x14\n\x05email\x18\x01\x20\x01(\tR\x05email\
     \x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\x12\x1a\n\x08password\x18\
     \x03\x20\x01(\tR\x08password\"T\n\x0cSignUpParams\x12\x14\n\x05email\x18\
     \x01\x20\x01(\tR\x05email\x12\x12\n\x04name\x18\x02\x20\x01(\tR\x04name\

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

@@ -468,41 +468,41 @@ impl ::protobuf::reflect::ProtobufValue for UserProfile {
 }
 
 #[derive(PartialEq,Clone,Default)]
-pub struct UpdateUserRequest {
+pub struct UpdateUserPayload {
     // message fields
     pub id: ::std::string::String,
     // message oneof groups
-    pub one_of_name: ::std::option::Option<UpdateUserRequest_oneof_one_of_name>,
-    pub one_of_email: ::std::option::Option<UpdateUserRequest_oneof_one_of_email>,
-    pub one_of_password: ::std::option::Option<UpdateUserRequest_oneof_one_of_password>,
+    pub one_of_name: ::std::option::Option<UpdateUserPayload_oneof_one_of_name>,
+    pub one_of_email: ::std::option::Option<UpdateUserPayload_oneof_one_of_email>,
+    pub one_of_password: ::std::option::Option<UpdateUserPayload_oneof_one_of_password>,
     // special fields
     pub unknown_fields: ::protobuf::UnknownFields,
     pub cached_size: ::protobuf::CachedSize,
 }
 
-impl<'a> ::std::default::Default for &'a UpdateUserRequest {
-    fn default() -> &'a UpdateUserRequest {
-        <UpdateUserRequest as ::protobuf::Message>::default_instance()
+impl<'a> ::std::default::Default for &'a UpdateUserPayload {
+    fn default() -> &'a UpdateUserPayload {
+        <UpdateUserPayload as ::protobuf::Message>::default_instance()
     }
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateUserRequest_oneof_one_of_name {
+pub enum UpdateUserPayload_oneof_one_of_name {
     name(::std::string::String),
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateUserRequest_oneof_one_of_email {
+pub enum UpdateUserPayload_oneof_one_of_email {
     email(::std::string::String),
 }
 
 #[derive(Clone,PartialEq,Debug)]
-pub enum UpdateUserRequest_oneof_one_of_password {
+pub enum UpdateUserPayload_oneof_one_of_password {
     password(::std::string::String),
 }
 
-impl UpdateUserRequest {
-    pub fn new() -> UpdateUserRequest {
+impl UpdateUserPayload {
+    pub fn new() -> UpdateUserPayload {
         ::std::default::Default::default()
     }
 
@@ -537,7 +537,7 @@ impl UpdateUserRequest {
 
     pub fn get_name(&self) -> &str {
         match self.one_of_name {
-            ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(ref v)) => v,
+            ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_name::name(ref v)) => v,
             _ => "",
         }
     }
@@ -547,24 +547,24 @@ impl UpdateUserRequest {
 
     pub fn has_name(&self) -> bool {
         match self.one_of_name {
-            ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(..)) => true,
+            ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_name::name(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_name(&mut self, v: ::std::string::String) {
-        self.one_of_name = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(v))
+        self.one_of_name = ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_name::name(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_name(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(_)) = self.one_of_name {
+        if let ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_name::name(_)) = self.one_of_name {
         } else {
-            self.one_of_name = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(::std::string::String::new()));
+            self.one_of_name = ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_name::name(::std::string::String::new()));
         }
         match self.one_of_name {
-            ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(ref mut v)) => v,
+            ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_name::name(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -573,7 +573,7 @@ impl UpdateUserRequest {
     pub fn take_name(&mut self) -> ::std::string::String {
         if self.has_name() {
             match self.one_of_name.take() {
-                ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(v)) => v,
+                ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_name::name(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -586,7 +586,7 @@ impl UpdateUserRequest {
 
     pub fn get_email(&self) -> &str {
         match self.one_of_email {
-            ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(ref v)) => v,
+            ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_email::email(ref v)) => v,
             _ => "",
         }
     }
@@ -596,24 +596,24 @@ impl UpdateUserRequest {
 
     pub fn has_email(&self) -> bool {
         match self.one_of_email {
-            ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(..)) => true,
+            ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_email::email(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_email(&mut self, v: ::std::string::String) {
-        self.one_of_email = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(v))
+        self.one_of_email = ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_email::email(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_email(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(_)) = self.one_of_email {
+        if let ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_email::email(_)) = self.one_of_email {
         } else {
-            self.one_of_email = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(::std::string::String::new()));
+            self.one_of_email = ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_email::email(::std::string::String::new()));
         }
         match self.one_of_email {
-            ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(ref mut v)) => v,
+            ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_email::email(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -622,7 +622,7 @@ impl UpdateUserRequest {
     pub fn take_email(&mut self) -> ::std::string::String {
         if self.has_email() {
             match self.one_of_email.take() {
-                ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(v)) => v,
+                ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_email::email(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -635,7 +635,7 @@ impl UpdateUserRequest {
 
     pub fn get_password(&self) -> &str {
         match self.one_of_password {
-            ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(ref v)) => v,
+            ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_password::password(ref v)) => v,
             _ => "",
         }
     }
@@ -645,24 +645,24 @@ impl UpdateUserRequest {
 
     pub fn has_password(&self) -> bool {
         match self.one_of_password {
-            ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(..)) => true,
+            ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_password::password(..)) => true,
             _ => false,
         }
     }
 
     // Param is passed by value, moved
     pub fn set_password(&mut self, v: ::std::string::String) {
-        self.one_of_password = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(v))
+        self.one_of_password = ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_password::password(v))
     }
 
     // Mutable pointer to the field.
     pub fn mut_password(&mut self) -> &mut ::std::string::String {
-        if let ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(_)) = self.one_of_password {
+        if let ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_password::password(_)) = self.one_of_password {
         } else {
-            self.one_of_password = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(::std::string::String::new()));
+            self.one_of_password = ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_password::password(::std::string::String::new()));
         }
         match self.one_of_password {
-            ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(ref mut v)) => v,
+            ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_password::password(ref mut v)) => v,
             _ => panic!(),
         }
     }
@@ -671,7 +671,7 @@ impl UpdateUserRequest {
     pub fn take_password(&mut self) -> ::std::string::String {
         if self.has_password() {
             match self.one_of_password.take() {
-                ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(v)) => v,
+                ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_password::password(v)) => v,
                 _ => panic!(),
             }
         } else {
@@ -680,7 +680,7 @@ impl UpdateUserRequest {
     }
 }
 
-impl ::protobuf::Message for UpdateUserRequest {
+impl ::protobuf::Message for UpdateUserPayload {
     fn is_initialized(&self) -> bool {
         true
     }
@@ -696,19 +696,19 @@ impl ::protobuf::Message for UpdateUserRequest {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_name = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_name::name(is.read_string()?));
+                    self.one_of_name = ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_name::name(is.read_string()?));
                 },
                 3 => {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_email = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_email::email(is.read_string()?));
+                    self.one_of_email = ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_email::email(is.read_string()?));
                 },
                 4 => {
                     if wire_type != ::protobuf::wire_format::WireTypeLengthDelimited {
                         return ::std::result::Result::Err(::protobuf::rt::unexpected_wire_type(wire_type));
                     }
-                    self.one_of_password = ::std::option::Option::Some(UpdateUserRequest_oneof_one_of_password::password(is.read_string()?));
+                    self.one_of_password = ::std::option::Option::Some(UpdateUserPayload_oneof_one_of_password::password(is.read_string()?));
                 },
                 _ => {
                     ::protobuf::rt::read_unknown_or_skip_group(field_number, wire_type, is, self.mut_unknown_fields())?;
@@ -727,21 +727,21 @@ impl ::protobuf::Message for UpdateUserRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_name {
             match v {
-                &UpdateUserRequest_oneof_one_of_name::name(ref v) => {
+                &UpdateUserPayload_oneof_one_of_name::name(ref v) => {
                     my_size += ::protobuf::rt::string_size(2, &v);
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_email {
             match v {
-                &UpdateUserRequest_oneof_one_of_email::email(ref v) => {
+                &UpdateUserPayload_oneof_one_of_email::email(ref v) => {
                     my_size += ::protobuf::rt::string_size(3, &v);
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_password {
             match v {
-                &UpdateUserRequest_oneof_one_of_password::password(ref v) => {
+                &UpdateUserPayload_oneof_one_of_password::password(ref v) => {
                     my_size += ::protobuf::rt::string_size(4, &v);
                 },
             };
@@ -757,21 +757,21 @@ impl ::protobuf::Message for UpdateUserRequest {
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_name {
             match v {
-                &UpdateUserRequest_oneof_one_of_name::name(ref v) => {
+                &UpdateUserPayload_oneof_one_of_name::name(ref v) => {
                     os.write_string(2, v)?;
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_email {
             match v {
-                &UpdateUserRequest_oneof_one_of_email::email(ref v) => {
+                &UpdateUserPayload_oneof_one_of_email::email(ref v) => {
                     os.write_string(3, v)?;
                 },
             };
         }
         if let ::std::option::Option::Some(ref v) = self.one_of_password {
             match v {
-                &UpdateUserRequest_oneof_one_of_password::password(ref v) => {
+                &UpdateUserPayload_oneof_one_of_password::password(ref v) => {
                     os.write_string(4, v)?;
                 },
             };
@@ -806,8 +806,8 @@ impl ::protobuf::Message for UpdateUserRequest {
         Self::descriptor_static()
     }
 
-    fn new() -> UpdateUserRequest {
-        UpdateUserRequest::new()
+    fn new() -> UpdateUserPayload {
+        UpdateUserPayload::new()
     }
 
     fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
@@ -816,39 +816,39 @@ impl ::protobuf::Message for UpdateUserRequest {
             let mut fields = ::std::vec::Vec::new();
             fields.push(::protobuf::reflect::accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeString>(
                 "id",
-                |m: &UpdateUserRequest| { &m.id },
-                |m: &mut UpdateUserRequest| { &mut m.id },
+                |m: &UpdateUserPayload| { &m.id },
+                |m: &mut UpdateUserPayload| { &mut m.id },
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
                 "name",
-                UpdateUserRequest::has_name,
-                UpdateUserRequest::get_name,
+                UpdateUserPayload::has_name,
+                UpdateUserPayload::get_name,
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
                 "email",
-                UpdateUserRequest::has_email,
-                UpdateUserRequest::get_email,
+                UpdateUserPayload::has_email,
+                UpdateUserPayload::get_email,
             ));
             fields.push(::protobuf::reflect::accessor::make_singular_string_accessor::<_>(
                 "password",
-                UpdateUserRequest::has_password,
-                UpdateUserRequest::get_password,
+                UpdateUserPayload::has_password,
+                UpdateUserPayload::get_password,
             ));
-            ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateUserRequest>(
-                "UpdateUserRequest",
+            ::protobuf::reflect::MessageDescriptor::new_pb_name::<UpdateUserPayload>(
+                "UpdateUserPayload",
                 fields,
                 file_descriptor_proto()
             )
         })
     }
 
-    fn default_instance() -> &'static UpdateUserRequest {
-        static instance: ::protobuf::rt::LazyV2<UpdateUserRequest> = ::protobuf::rt::LazyV2::INIT;
-        instance.get(UpdateUserRequest::new)
+    fn default_instance() -> &'static UpdateUserPayload {
+        static instance: ::protobuf::rt::LazyV2<UpdateUserPayload> = ::protobuf::rt::LazyV2::INIT;
+        instance.get(UpdateUserPayload::new)
     }
 }
 
-impl ::protobuf::Clear for UpdateUserRequest {
+impl ::protobuf::Clear for UpdateUserPayload {
     fn clear(&mut self) {
         self.id.clear();
         self.one_of_name = ::std::option::Option::None;
@@ -858,13 +858,13 @@ impl ::protobuf::Clear for UpdateUserRequest {
     }
 }
 
-impl ::std::fmt::Debug for UpdateUserRequest {
+impl ::std::fmt::Debug for UpdateUserPayload {
     fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         ::protobuf::text_format::fmt(self, f)
     }
 }
 
-impl ::protobuf::reflect::ProtobufValue for UpdateUserRequest {
+impl ::protobuf::reflect::ProtobufValue for UpdateUserPayload {
     fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
         ::protobuf::reflect::ReflectValueRef::Message(self)
     }
@@ -1278,7 +1278,7 @@ static file_descriptor_proto_data: &'static [u8] = b"\
     \x01(\tR\x05token\"]\n\x0bUserProfile\x12\x0e\n\x02id\x18\x01\x20\x01(\t\
     R\x02id\x12\x14\n\x05email\x18\x02\x20\x01(\tR\x05email\x12\x12\n\x04nam\
     e\x18\x03\x20\x01(\tR\x04name\x12\x14\n\x05token\x18\x04\x20\x01(\tR\x05\
-    token\"\xa1\x01\n\x11UpdateUserRequest\x12\x0e\n\x02id\x18\x01\x20\x01(\
+    token\"\xa1\x01\n\x11UpdateUserPayload\x12\x0e\n\x02id\x18\x01\x20\x01(\
     \tR\x02id\x12\x14\n\x04name\x18\x02\x20\x01(\tH\0R\x04name\x12\x16\n\x05\
     email\x18\x03\x20\x01(\tH\x01R\x05email\x12\x1c\n\x08password\x18\x04\
     \x20\x01(\tH\x02R\x08passwordB\r\n\x0bone_of_nameB\x0e\n\x0cone_of_email\

+ 2 - 2
shared-lib/flowy-user-data-model/src/protobuf/proto/auth.proto

@@ -1,6 +1,6 @@
 syntax = "proto3";
 
-message SignInRequest {
+message SignInPayload {
     string email = 1;
     string password = 2;
     string name = 3;
@@ -16,7 +16,7 @@ message SignInResponse {
     string email = 3;
     string token = 4;
 }
-message SignUpRequest {
+message SignUpPayload {
     string email = 1;
     string name = 2;
     string password = 3;

+ 1 - 1
shared-lib/flowy-user-data-model/src/protobuf/proto/user_profile.proto

@@ -9,7 +9,7 @@ message UserProfile {
     string name = 3;
     string token = 4;
 }
-message UpdateUserRequest {
+message UpdateUserPayload {
     string id = 1;
     oneof one_of_name { string name = 2; };
     oneof one_of_email { string email = 3; };