|
@@ -1,503 +1,569 @@
|
|
|
|
+
|
|
|
|
+
|
|
/// Auto gen code from rust ast, do not edit
|
|
/// Auto gen code from rust ast, do not edit
|
|
part of 'dispatch.dart';
|
|
part of 'dispatch.dart';
|
|
-
|
|
|
|
class FolderEventCreateWorkspace {
|
|
class FolderEventCreateWorkspace {
|
|
- CreateWorkspaceRequest request;
|
|
|
|
- FolderEventCreateWorkspace(this.request);
|
|
|
|
|
|
+ CreateWorkspaceRequest request;
|
|
|
|
+ FolderEventCreateWorkspace(this.request);
|
|
|
|
|
|
- Future<Either<Workspace, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Workspace, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.CreateWorkspace.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.CreateWorkspace.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(Workspace.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(Workspace.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventReadCurWorkspace {
|
|
class FolderEventReadCurWorkspace {
|
|
- FolderEventReadCurWorkspace();
|
|
|
|
|
|
+ FolderEventReadCurWorkspace();
|
|
|
|
|
|
- Future<Either<CurrentWorkspaceSetting, FlowyError>> send() {
|
|
|
|
- final request = FFIRequest.create()..event = FolderEvent.ReadCurWorkspace.toString();
|
|
|
|
|
|
+ Future<Either<CurrentWorkspaceSetting, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = FolderEvent.ReadCurWorkspace.toString();
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(CurrentWorkspaceSetting.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(CurrentWorkspaceSetting.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventReadWorkspaces {
|
|
class FolderEventReadWorkspaces {
|
|
- QueryWorkspaceRequest request;
|
|
|
|
- FolderEventReadWorkspaces(this.request);
|
|
|
|
|
|
+ QueryWorkspaceRequest request;
|
|
|
|
+ FolderEventReadWorkspaces(this.request);
|
|
|
|
|
|
- Future<Either<RepeatedWorkspace, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<RepeatedWorkspace, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.ReadWorkspaces.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.ReadWorkspaces.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(RepeatedWorkspace.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(RepeatedWorkspace.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventDeleteWorkspace {
|
|
class FolderEventDeleteWorkspace {
|
|
- QueryWorkspaceRequest request;
|
|
|
|
- FolderEventDeleteWorkspace(this.request);
|
|
|
|
|
|
+ QueryWorkspaceRequest request;
|
|
|
|
+ FolderEventDeleteWorkspace(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.DeleteWorkspace.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.DeleteWorkspace.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventOpenWorkspace {
|
|
class FolderEventOpenWorkspace {
|
|
- QueryWorkspaceRequest request;
|
|
|
|
- FolderEventOpenWorkspace(this.request);
|
|
|
|
|
|
+ QueryWorkspaceRequest request;
|
|
|
|
+ FolderEventOpenWorkspace(this.request);
|
|
|
|
|
|
- Future<Either<Workspace, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Workspace, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.OpenWorkspace.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.OpenWorkspace.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(Workspace.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(Workspace.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventReadWorkspaceApps {
|
|
class FolderEventReadWorkspaceApps {
|
|
- QueryWorkspaceRequest request;
|
|
|
|
- FolderEventReadWorkspaceApps(this.request);
|
|
|
|
|
|
+ QueryWorkspaceRequest request;
|
|
|
|
+ FolderEventReadWorkspaceApps(this.request);
|
|
|
|
|
|
- Future<Either<RepeatedApp, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<RepeatedApp, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.ReadWorkspaceApps.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.ReadWorkspaceApps.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(RepeatedApp.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(RepeatedApp.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventCreateApp {
|
|
class FolderEventCreateApp {
|
|
- CreateAppRequest request;
|
|
|
|
- FolderEventCreateApp(this.request);
|
|
|
|
|
|
+ CreateAppRequest request;
|
|
|
|
+ FolderEventCreateApp(this.request);
|
|
|
|
|
|
- Future<Either<App, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<App, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.CreateApp.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.CreateApp.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(App.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(App.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventDeleteApp {
|
|
class FolderEventDeleteApp {
|
|
- QueryAppRequest request;
|
|
|
|
- FolderEventDeleteApp(this.request);
|
|
|
|
|
|
+ QueryAppRequest request;
|
|
|
|
+ FolderEventDeleteApp(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.DeleteApp.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.DeleteApp.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventReadApp {
|
|
class FolderEventReadApp {
|
|
- QueryAppRequest request;
|
|
|
|
- FolderEventReadApp(this.request);
|
|
|
|
|
|
+ QueryAppRequest request;
|
|
|
|
+ FolderEventReadApp(this.request);
|
|
|
|
|
|
- Future<Either<App, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<App, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.ReadApp.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.ReadApp.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(App.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(App.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventUpdateApp {
|
|
class FolderEventUpdateApp {
|
|
- UpdateAppRequest request;
|
|
|
|
- FolderEventUpdateApp(this.request);
|
|
|
|
|
|
+ UpdateAppRequest request;
|
|
|
|
+ FolderEventUpdateApp(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.UpdateApp.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.UpdateApp.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventCreateView {
|
|
class FolderEventCreateView {
|
|
- CreateViewRequest request;
|
|
|
|
- FolderEventCreateView(this.request);
|
|
|
|
|
|
+ CreateViewRequest request;
|
|
|
|
+ FolderEventCreateView(this.request);
|
|
|
|
|
|
- Future<Either<View, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<View, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.CreateView.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.CreateView.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(View.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(View.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventReadView {
|
|
class FolderEventReadView {
|
|
- QueryViewRequest request;
|
|
|
|
- FolderEventReadView(this.request);
|
|
|
|
|
|
+ QueryViewRequest request;
|
|
|
|
+ FolderEventReadView(this.request);
|
|
|
|
|
|
- Future<Either<View, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<View, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.ReadView.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.ReadView.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(View.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(View.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventUpdateView {
|
|
class FolderEventUpdateView {
|
|
- UpdateViewRequest request;
|
|
|
|
- FolderEventUpdateView(this.request);
|
|
|
|
|
|
+ UpdateViewRequest request;
|
|
|
|
+ FolderEventUpdateView(this.request);
|
|
|
|
|
|
- Future<Either<View, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<View, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.UpdateView.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.UpdateView.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(View.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(View.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventDeleteView {
|
|
class FolderEventDeleteView {
|
|
- QueryViewRequest request;
|
|
|
|
- FolderEventDeleteView(this.request);
|
|
|
|
|
|
+ QueryViewRequest request;
|
|
|
|
+ FolderEventDeleteView(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.DeleteView.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.DeleteView.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventDuplicateView {
|
|
class FolderEventDuplicateView {
|
|
- QueryViewRequest request;
|
|
|
|
- FolderEventDuplicateView(this.request);
|
|
|
|
|
|
+ QueryViewRequest request;
|
|
|
|
+ FolderEventDuplicateView(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.DuplicateView.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.DuplicateView.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventCopyLink {
|
|
class FolderEventCopyLink {
|
|
- FolderEventCopyLink();
|
|
|
|
|
|
+ FolderEventCopyLink();
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
- final request = FFIRequest.create()..event = FolderEvent.CopyLink.toString();
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = FolderEvent.CopyLink.toString();
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventOpenDocument {
|
|
class FolderEventOpenDocument {
|
|
- QueryViewRequest request;
|
|
|
|
- FolderEventOpenDocument(this.request);
|
|
|
|
|
|
+ QueryViewRequest request;
|
|
|
|
+ FolderEventOpenDocument(this.request);
|
|
|
|
|
|
- Future<Either<DocumentDelta, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<DocumentDelta, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.OpenDocument.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.OpenDocument.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(DocumentDelta.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(DocumentDelta.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventCloseView {
|
|
class FolderEventCloseView {
|
|
- QueryViewRequest request;
|
|
|
|
- FolderEventCloseView(this.request);
|
|
|
|
|
|
+ QueryViewRequest request;
|
|
|
|
+ FolderEventCloseView(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.CloseView.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.CloseView.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventReadTrash {
|
|
class FolderEventReadTrash {
|
|
- FolderEventReadTrash();
|
|
|
|
|
|
+ FolderEventReadTrash();
|
|
|
|
|
|
- Future<Either<RepeatedTrash, FlowyError>> send() {
|
|
|
|
- final request = FFIRequest.create()..event = FolderEvent.ReadTrash.toString();
|
|
|
|
|
|
+ Future<Either<RepeatedTrash, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = FolderEvent.ReadTrash.toString();
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(RepeatedTrash.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(RepeatedTrash.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventPutbackTrash {
|
|
class FolderEventPutbackTrash {
|
|
- TrashId request;
|
|
|
|
- FolderEventPutbackTrash(this.request);
|
|
|
|
|
|
+ TrashId request;
|
|
|
|
+ FolderEventPutbackTrash(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.PutbackTrash.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.PutbackTrash.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventDeleteTrash {
|
|
class FolderEventDeleteTrash {
|
|
- RepeatedTrashId request;
|
|
|
|
- FolderEventDeleteTrash(this.request);
|
|
|
|
|
|
+ RepeatedTrashId request;
|
|
|
|
+ FolderEventDeleteTrash(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.DeleteTrash.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.DeleteTrash.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventRestoreAllTrash {
|
|
class FolderEventRestoreAllTrash {
|
|
- FolderEventRestoreAllTrash();
|
|
|
|
|
|
+ FolderEventRestoreAllTrash();
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
- final request = FFIRequest.create()..event = FolderEvent.RestoreAllTrash.toString();
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = FolderEvent.RestoreAllTrash.toString();
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventDeleteAllTrash {
|
|
class FolderEventDeleteAllTrash {
|
|
- FolderEventDeleteAllTrash();
|
|
|
|
|
|
+ FolderEventDeleteAllTrash();
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
- final request = FFIRequest.create()..event = FolderEvent.DeleteAllTrash.toString();
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = FolderEvent.DeleteAllTrash.toString();
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventApplyDocDelta {
|
|
class FolderEventApplyDocDelta {
|
|
- DocumentDelta request;
|
|
|
|
- FolderEventApplyDocDelta(this.request);
|
|
|
|
|
|
+ DocumentDelta request;
|
|
|
|
+ FolderEventApplyDocDelta(this.request);
|
|
|
|
|
|
- Future<Either<DocumentDelta, FlowyError>> send() {
|
|
|
|
- FFIRequest request = FFIRequest.create()
|
|
|
|
- ..event = FolderEvent.ApplyDocDelta.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ Future<Either<DocumentDelta, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = FolderEvent.ApplyDocDelta.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(DocumentDelta.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(DocumentDelta.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class FolderEventExportDocument {
|
|
class FolderEventExportDocument {
|
|
- ExportRequest request;
|
|
|
|
- FolderEventExportDocument(this.request);
|
|
|
|
|
|
+ ExportRequest request;
|
|
|
|
+ FolderEventExportDocument(this.request);
|
|
|
|
|
|
- Future<Either<ExportData, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<ExportData, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = FolderEvent.ExportDocument.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = FolderEvent.ExportDocument.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(ExportData.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(ExportData.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class NetworkEventUpdateNetworkType {
|
|
class NetworkEventUpdateNetworkType {
|
|
- NetworkState request;
|
|
|
|
- NetworkEventUpdateNetworkType(this.request);
|
|
|
|
|
|
+ NetworkState request;
|
|
|
|
+ NetworkEventUpdateNetworkType(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = NetworkEvent.UpdateNetworkType.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = NetworkEvent.UpdateNetworkType.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class UserEventInitUser {
|
|
class UserEventInitUser {
|
|
- UserEventInitUser();
|
|
|
|
|
|
+ UserEventInitUser();
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
- final request = FFIRequest.create()..event = UserEvent.InitUser.toString();
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = UserEvent.InitUser.toString();
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class UserEventSignIn {
|
|
class UserEventSignIn {
|
|
- SignInRequest request;
|
|
|
|
- UserEventSignIn(this.request);
|
|
|
|
|
|
+ SignInRequest request;
|
|
|
|
+ UserEventSignIn(this.request);
|
|
|
|
|
|
- Future<Either<UserProfile, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<UserProfile, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = UserEvent.SignIn.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = UserEvent.SignIn.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(UserProfile.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(UserProfile.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class UserEventSignUp {
|
|
class UserEventSignUp {
|
|
- SignUpRequest request;
|
|
|
|
- UserEventSignUp(this.request);
|
|
|
|
|
|
+ SignUpRequest request;
|
|
|
|
+ UserEventSignUp(this.request);
|
|
|
|
|
|
- Future<Either<UserProfile, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<UserProfile, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = UserEvent.SignUp.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = UserEvent.SignUp.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(UserProfile.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(UserProfile.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class UserEventSignOut {
|
|
class UserEventSignOut {
|
|
- UserEventSignOut();
|
|
|
|
|
|
+ UserEventSignOut();
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
- final request = FFIRequest.create()..event = UserEvent.SignOut.toString();
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = UserEvent.SignOut.toString();
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class UserEventUpdateUser {
|
|
class UserEventUpdateUser {
|
|
- UpdateUserRequest request;
|
|
|
|
- UserEventUpdateUser(this.request);
|
|
|
|
|
|
+ UpdateUserRequest request;
|
|
|
|
+ UserEventUpdateUser(this.request);
|
|
|
|
|
|
- Future<Either<Unit, FlowyError>> send() {
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
final request = FFIRequest.create()
|
|
final request = FFIRequest.create()
|
|
- ..event = UserEvent.UpdateUser.toString()
|
|
|
|
- ..payload = requestToBytes(this.request);
|
|
|
|
|
|
+ ..event = UserEvent.UpdateUser.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (bytes) => left(unit),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class UserEventGetUserProfile {
|
|
class UserEventGetUserProfile {
|
|
- UserEventGetUserProfile();
|
|
|
|
|
|
+ UserEventGetUserProfile();
|
|
|
|
|
|
- Future<Either<UserProfile, FlowyError>> send() {
|
|
|
|
- final request = FFIRequest.create()..event = UserEvent.GetUserProfile.toString();
|
|
|
|
|
|
+ Future<Either<UserProfile, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = UserEvent.GetUserProfile.toString();
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(UserProfile.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
- ));
|
|
|
|
- }
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(UserProfile.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
class UserEventCheckUser {
|
|
class UserEventCheckUser {
|
|
- UserEventCheckUser();
|
|
|
|
|
|
+ UserEventCheckUser();
|
|
|
|
+
|
|
|
|
+ Future<Either<UserProfile, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = UserEvent.CheckUser.toString();
|
|
|
|
+
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(UserProfile.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+class UserEventUpdateAppearanceSetting {
|
|
|
|
+ AppearanceSettings request;
|
|
|
|
+ UserEventUpdateAppearanceSetting(this.request);
|
|
|
|
|
|
- Future<Either<UserProfile, FlowyError>> send() {
|
|
|
|
- final request = FFIRequest.create()..event = UserEvent.CheckUser.toString();
|
|
|
|
|
|
+ Future<Either<Unit, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = UserEvent.UpdateAppearanceSetting.toString()
|
|
|
|
+ ..payload = requestToBytes(this.request);
|
|
|
|
|
|
- return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
- (okBytes) => left(UserProfile.fromBuffer(okBytes)),
|
|
|
|
- (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
|
|
+ return Dispatch.asyncRequest(request)
|
|
|
|
+ .then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (bytes) => left(unit),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
));
|
|
));
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+class UserEventGetAppearanceSetting {
|
|
|
|
+ UserEventGetAppearanceSetting();
|
|
|
|
+
|
|
|
|
+ Future<Either<AppearanceSettings, FlowyError>> send() {
|
|
|
|
+ final request = FFIRequest.create()
|
|
|
|
+ ..event = UserEvent.GetAppearanceSetting.toString();
|
|
|
|
+
|
|
|
|
+ return Dispatch.asyncRequest(request).then((bytesResult) => bytesResult.fold(
|
|
|
|
+ (okBytes) => left(AppearanceSettings.fromBuffer(okBytes)),
|
|
|
|
+ (errBytes) => right(FlowyError.fromBuffer(errBytes)),
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|