diff --git a/frontend/app_flowy/packages/flowy_sdk/.gitignore b/frontend/app_flowy/packages/flowy_sdk/.gitignore index f69054f37d..b61e296223 100644 --- a/frontend/app_flowy/packages/flowy_sdk/.gitignore +++ b/frontend/app_flowy/packages/flowy_sdk/.gitignore @@ -79,4 +79,5 @@ build/ **/*.dll **/*.so -lib/protobuf \ No newline at end of file +lib/protobuf +lib/dispatch/dart_event \ No newline at end of file diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-folder/dart_event.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-folder/dart_event.dart deleted file mode 100644 index 064fae1fa4..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-folder/dart_event.dart +++ /dev/null @@ -1,413 +0,0 @@ - -/// Auto generate. Do not edit -part of '../../dispatch.dart'; -class FolderEventCreateWorkspace { - CreateWorkspacePayload request; - FolderEventCreateWorkspace(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class FolderEventReadCurWorkspace { - FolderEventReadCurWorkspace(); - - Future> 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)), - )); - } -} - -class FolderEventReadWorkspaces { - WorkspaceId request; - FolderEventReadWorkspaces(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class FolderEventDeleteWorkspace { - WorkspaceId request; - FolderEventDeleteWorkspace(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.DeleteWorkspace.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventOpenWorkspace { - WorkspaceId request; - FolderEventOpenWorkspace(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class FolderEventReadWorkspaceApps { - WorkspaceId request; - FolderEventReadWorkspaceApps(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class FolderEventCreateApp { - CreateAppPayload request; - FolderEventCreateApp(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class FolderEventDeleteApp { - AppId request; - FolderEventDeleteApp(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.DeleteApp.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventReadApp { - AppId request; - FolderEventReadApp(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class FolderEventUpdateApp { - UpdateAppPayload request; - FolderEventUpdateApp(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.UpdateApp.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventCreateView { - CreateViewPayload request; - FolderEventCreateView(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class FolderEventReadView { - ViewId request; - FolderEventReadView(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class FolderEventUpdateView { - UpdateViewPayload request; - FolderEventUpdateView(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class FolderEventDeleteView { - RepeatedViewId request; - FolderEventDeleteView(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.DeleteView.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventDuplicateView { - ViewId request; - FolderEventDuplicateView(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.DuplicateView.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventCloseView { - ViewId request; - FolderEventCloseView(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.CloseView.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventReadViewInfo { - ViewId request; - FolderEventReadViewInfo(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.ReadViewInfo.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(ViewInfo.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventCopyLink { - FolderEventCopyLink(); - - Future> 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)), - )); - } -} - -class FolderEventSetLatestView { - ViewId request; - FolderEventSetLatestView(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.SetLatestView.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventMoveFolderItem { - MoveFolderItemPayload request; - FolderEventMoveFolderItem(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.MoveFolderItem.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventReadTrash { - FolderEventReadTrash(); - - Future> 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)), - )); - } -} - -class FolderEventPutbackTrash { - TrashId request; - FolderEventPutbackTrash(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.PutbackTrash.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventDeleteTrash { - RepeatedTrashId request; - FolderEventDeleteTrash(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = FolderEvent.DeleteTrash.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class FolderEventRestoreAllTrash { - FolderEventRestoreAllTrash(); - - Future> 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)), - )); - } -} - -class FolderEventDeleteAllTrash { - FolderEventDeleteAllTrash(); - - Future> 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)), - )); - } -} - diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-grid/dart_event.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-grid/dart_event.dart deleted file mode 100644 index 0149f63b3a..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-grid/dart_event.dart +++ /dev/null @@ -1,394 +0,0 @@ - -/// Auto generate. Do not edit -part of '../../dispatch.dart'; -class GridEventGetGridData { - GridId request; - GridEventGetGridData(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.GetGridData.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(Grid.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventGetGridBlocks { - QueryGridBlocksPayload request; - GridEventGetGridBlocks(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.GetGridBlocks.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(RepeatedGridBlock.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventGetFields { - QueryFieldPayload request; - GridEventGetFields(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.GetFields.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(RepeatedField.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventUpdateField { - FieldChangesetPayload request; - GridEventUpdateField(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.UpdateField.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventUpdateFieldTypeOption { - UpdateFieldTypeOptionPayload request; - GridEventUpdateFieldTypeOption(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.UpdateFieldTypeOption.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventInsertField { - InsertFieldPayload request; - GridEventInsertField(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.InsertField.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventDeleteField { - FieldIdentifierPayload request; - GridEventDeleteField(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.DeleteField.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventSwitchToField { - EditFieldPayload request; - GridEventSwitchToField(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.SwitchToField.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(FieldTypeOptionData.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventDuplicateField { - FieldIdentifierPayload request; - GridEventDuplicateField(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.DuplicateField.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventMoveItem { - MoveItemPayload request; - GridEventMoveItem(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.MoveItem.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventGetFieldTypeOption { - EditFieldPayload request; - GridEventGetFieldTypeOption(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.GetFieldTypeOption.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(FieldTypeOptionData.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventCreateFieldTypeOption { - EditFieldPayload request; - GridEventCreateFieldTypeOption(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.CreateFieldTypeOption.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(FieldTypeOptionData.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventNewSelectOption { - CreateSelectOptionPayload request; - GridEventNewSelectOption(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.NewSelectOption.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(SelectOption.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventGetSelectOptionCellData { - CellIdentifierPayload request; - GridEventGetSelectOptionCellData(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.GetSelectOptionCellData.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(SelectOptionCellData.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventUpdateSelectOption { - SelectOptionChangesetPayload request; - GridEventUpdateSelectOption(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.UpdateSelectOption.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventCreateRow { - CreateRowPayload request; - GridEventCreateRow(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.CreateRow.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(Row.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventGetRow { - RowIdentifierPayload request; - GridEventGetRow(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.GetRow.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(Row.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventDeleteRow { - RowIdentifierPayload request; - GridEventDeleteRow(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.DeleteRow.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventDuplicateRow { - RowIdentifierPayload request; - GridEventDuplicateRow(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.DuplicateRow.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventGetCell { - CellIdentifierPayload request; - GridEventGetCell(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.GetCell.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(Cell.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventUpdateCell { - CellChangeset request; - GridEventUpdateCell(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.UpdateCell.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventUpdateSelectOptionCell { - SelectOptionCellChangesetPayload request; - GridEventUpdateSelectOptionCell(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.UpdateSelectOptionCell.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class GridEventUpdateDateCell { - DateChangesetPayload request; - GridEventUpdateDateCell(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = GridEvent.UpdateDateCell.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-net/dart_event.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-net/dart_event.dart deleted file mode 100644 index 19f1bd0f09..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-net/dart_event.dart +++ /dev/null @@ -1,20 +0,0 @@ - -/// Auto generate. Do not edit -part of '../../dispatch.dart'; -class NetworkEventUpdateNetworkType { - NetworkState request; - NetworkEventUpdateNetworkType(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = NetworkEvent.UpdateNetworkType.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-text-block/dart_event.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-text-block/dart_event.dart deleted file mode 100644 index 6b9df7ae97..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-text-block/dart_event.dart +++ /dev/null @@ -1,54 +0,0 @@ - -/// Auto generate. Do not edit -part of '../../dispatch.dart'; -class TextBlockEventGetBlockData { - TextBlockId request; - TextBlockEventGetBlockData(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = TextBlockEvent.GetBlockData.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(TextBlockDelta.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class TextBlockEventApplyDelta { - TextBlockDelta request; - TextBlockEventApplyDelta(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = TextBlockEvent.ApplyDelta.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(TextBlockDelta.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class TextBlockEventExportDocument { - ExportPayload request; - TextBlockEventExportDocument(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = TextBlockEvent.ExportDocument.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (okBytes) => left(ExportData.fromBuffer(okBytes)), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - diff --git a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-user/dart_event.dart b/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-user/dart_event.dart deleted file mode 100644 index 683c77d7d7..0000000000 --- a/frontend/app_flowy/packages/flowy_sdk/lib/dispatch/dart_event/flowy-user/dart_event.dart +++ /dev/null @@ -1,141 +0,0 @@ - -/// Auto generate. Do not edit -part of '../../dispatch.dart'; -class UserEventInitUser { - UserEventInitUser(); - - Future> 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)), - )); - } -} - -class UserEventSignIn { - SignInPayload request; - UserEventSignIn(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class UserEventSignUp { - SignUpPayload request; - UserEventSignUp(this.request); - - Future> send() { - final request = FFIRequest.create() - ..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)), - )); - } -} - -class UserEventSignOut { - UserEventSignOut(); - - Future> 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)), - )); - } -} - -class UserEventUpdateUser { - UpdateUserPayload request; - UserEventUpdateUser(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = UserEvent.UpdateUser.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class UserEventGetUserProfile { - UserEventGetUserProfile(); - - Future> 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)), - )); - } -} - -class UserEventCheckUser { - UserEventCheckUser(); - - Future> 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 UserEventSetAppearanceSetting { - AppearanceSettings request; - UserEventSetAppearanceSetting(this.request); - - Future> send() { - final request = FFIRequest.create() - ..event = UserEvent.SetAppearanceSetting.toString() - ..payload = requestToBytes(this.request); - - return Dispatch.asyncRequest(request) - .then((bytesResult) => bytesResult.fold( - (bytes) => left(unit), - (errBytes) => right(FlowyError.fromBuffer(errBytes)), - )); - } -} - -class UserEventGetAppearanceSetting { - UserEventGetAppearanceSetting(); - - Future> 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)), - )); - } -} -