mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: update refs
This commit is contained in:
parent
6e028c4f64
commit
1d6f74180f
@ -9,7 +9,7 @@ import {
|
||||
DatabaseGroupIdPB,
|
||||
MoveGroupPayloadPB,
|
||||
MoveGroupRowPayloadPB,
|
||||
} from '../../../../services/backend/events/flowy-database';
|
||||
} from '@/services/backend/events/flowy-database';
|
||||
import {
|
||||
GetFieldPayloadPB,
|
||||
RepeatedFieldIdPB,
|
||||
@ -17,9 +17,10 @@ import {
|
||||
DatabaseViewIdPB,
|
||||
CreateRowPayloadPB,
|
||||
ViewIdPB,
|
||||
} from '../../../../services/backend';
|
||||
import { FolderEventCloseView } from '../../../../services/backend/events/flowy-folder';
|
||||
} from '@/services/backend';
|
||||
import { FolderEventCloseView } from '@/services/backend/events/flowy-folder';
|
||||
|
||||
/// A service that wraps the backend service
|
||||
export class DatabaseBackendService {
|
||||
viewId: string;
|
||||
|
||||
@ -27,6 +28,7 @@ export class DatabaseBackendService {
|
||||
this.viewId = viewId;
|
||||
}
|
||||
|
||||
/// Open a database
|
||||
openDatabase = async () => {
|
||||
const payload = DatabaseViewIdPB.fromObject({
|
||||
value: this.viewId,
|
||||
@ -34,6 +36,7 @@ export class DatabaseBackendService {
|
||||
return DatabaseEventGetDatabase(payload);
|
||||
};
|
||||
|
||||
/// Close a database
|
||||
closeDatabase = async () => {
|
||||
const payload = ViewIdPB.fromObject({ value: this.viewId });
|
||||
return FolderEventCloseView(payload);
|
||||
@ -56,6 +59,7 @@ export class DatabaseBackendService {
|
||||
return DatabaseEventCreateRow(payload);
|
||||
};
|
||||
|
||||
/// Move a row to another group
|
||||
moveRow = (rowId: string, groupId?: string) => {
|
||||
const payload = MoveGroupRowPayloadPB.fromObject({ view_id: this.viewId, from_row_id: rowId });
|
||||
if (groupId !== undefined) {
|
||||
@ -73,6 +77,7 @@ export class DatabaseBackendService {
|
||||
return DatabaseEventMoveGroup(payload);
|
||||
};
|
||||
|
||||
/// Get all fields in database
|
||||
getFields = async (fieldIds?: FieldIdPB[]) => {
|
||||
const payload = GetFieldPayloadPB.fromObject({ view_id: this.viewId });
|
||||
|
||||
@ -83,11 +88,13 @@ export class DatabaseBackendService {
|
||||
return DatabaseEventGetFields(payload).then((result) => result.map((value) => value.items));
|
||||
};
|
||||
|
||||
/// Get a group by id
|
||||
getGroup = (groupId: string) => {
|
||||
const payload = DatabaseGroupIdPB.fromObject({ view_id: this.viewId, group_id: groupId });
|
||||
return DatabaseEventGetGroup(payload);
|
||||
};
|
||||
|
||||
/// Get all groups in database
|
||||
loadGroups = () => {
|
||||
const payload = DatabaseViewIdPB.fromObject({ value: this.viewId });
|
||||
return DatabaseEventGetGroups(payload);
|
||||
|
@ -1,13 +1,13 @@
|
||||
import { DatabaseBackendService } from './database_bd_svc';
|
||||
import { FieldController, FieldInfo } from './field/field_controller';
|
||||
import { DatabaseViewCache } from './view/database_view_cache';
|
||||
import { DatabasePB, GroupPB } from '../../../../services/backend';
|
||||
import { DatabasePB, GroupPB } from '@/services/backend';
|
||||
import { RowChangedReason, RowInfo } from './row/row_cache';
|
||||
import { Err } from 'ts-results';
|
||||
import { DatabaseGroupController } from './group/group_controller';
|
||||
import { BehaviorSubject } from 'rxjs';
|
||||
import { DatabaseGroupObserver } from './group/group_observer';
|
||||
import { Log } from '../../../utils/log';
|
||||
import { Log } from '$app/utils/log';
|
||||
|
||||
export type DatabaseSubscriberCallbacks = {
|
||||
onViewChanged?: (data: DatabasePB) => void;
|
||||
|
@ -5,14 +5,14 @@ import {
|
||||
FieldType,
|
||||
TypeOptionChangesetPB,
|
||||
TypeOptionPathPB,
|
||||
} from '../../../../../services/backend/models/flowy-database/field_entities';
|
||||
} from '@/services/backend';
|
||||
import {
|
||||
DatabaseEventDeleteField,
|
||||
DatabaseEventDuplicateField,
|
||||
DatabaseEventGetTypeOption,
|
||||
DatabaseEventUpdateField,
|
||||
DatabaseEventUpdateFieldTypeOption,
|
||||
} from '../../../../../services/backend/events/flowy-database';
|
||||
} from '@/services/backend/events/flowy-database';
|
||||
|
||||
export abstract class TypeOptionParser<T> {
|
||||
abstract fromBuffer(buffer: Uint8Array): T;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import { Log } from '../../../../utils/log';
|
||||
import { Log } from '$app/utils/log';
|
||||
import { DatabaseBackendService } from '../database_bd_svc';
|
||||
import { DatabaseFieldChangesetObserver } from './field_observer';
|
||||
import { FieldIdPB, FieldPB, IndexFieldPB } from '../../../../../services/backend';
|
||||
import { ChangeNotifier } from '../../../../utils/change_notifier';
|
||||
import { FieldIdPB, FieldPB, IndexFieldPB } from '@/services/backend';
|
||||
import { ChangeNotifier } from '$app/utils/change_notifier';
|
||||
|
||||
export class FieldController {
|
||||
private backendService: DatabaseBackendService;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Ok, Result } from 'ts-results';
|
||||
import { DatabaseNotification, DatabaseFieldChangesetPB, FlowyError, FieldPB } from '../../../../../services/backend';
|
||||
import { ChangeNotifier } from '../../../../utils/change_notifier';
|
||||
import { DatabaseNotification, DatabaseFieldChangesetPB, FlowyError, FieldPB } from '@/services/backend';
|
||||
import { ChangeNotifier } from '$app/utils/change_notifier';
|
||||
import { DatabaseNotificationObserver } from '../notifications/observer';
|
||||
|
||||
export type FieldChangesetSubscribeCallback = (value: Result<DatabaseFieldChangesetPB, FlowyError>) => void;
|
||||
|
@ -3,12 +3,12 @@ import {
|
||||
FieldType,
|
||||
TypeOptionPathPB,
|
||||
UpdateFieldTypePayloadPB,
|
||||
} from '../../../../../../services/backend';
|
||||
} from '@/services/backend';
|
||||
import {
|
||||
DatabaseEventCreateTypeOption,
|
||||
DatabaseEventGetTypeOption,
|
||||
DatabaseEventUpdateFieldType,
|
||||
} from '../../../../../../services/backend/events/flowy-database';
|
||||
} from '@/services/backend/events/flowy-database';
|
||||
|
||||
export class TypeOptionBackendService {
|
||||
constructor(public readonly viewId: string) {}
|
||||
|
@ -9,7 +9,7 @@ import {
|
||||
NumberTypeOptionPB,
|
||||
SingleSelectTypeOptionPB,
|
||||
URLTypeOptionPB,
|
||||
} from '../../../../../../services/backend';
|
||||
} from '@/services/backend';
|
||||
import { utf8Decoder, utf8Encoder } from '../../cell/data_parser';
|
||||
import { DatabaseFieldObserver } from '../field_observer';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { FieldPB, FieldType, TypeOptionPB } from '../../../../../../services/backend';
|
||||
import { ChangeNotifier } from '../../../../../utils/change_notifier';
|
||||
import { FieldPB, FieldType, TypeOptionPB } from '@/services/backend';
|
||||
import { ChangeNotifier } from '$app/utils/change_notifier';
|
||||
import { FieldBackendService } from '../field_bd_svc';
|
||||
import { Log } from '../../../../../utils/log';
|
||||
import { Log } from '$app/utils/log';
|
||||
import { None, Option, Some } from 'ts-results';
|
||||
import { FieldInfo } from '../field_controller';
|
||||
import { TypeOptionBackendService } from './type_option_bd_svc';
|
||||
|
@ -4,11 +4,11 @@ import {
|
||||
GroupPB,
|
||||
GroupRowsNotificationPB,
|
||||
RowPB,
|
||||
} from '../../../../../services/backend';
|
||||
import { ChangeNotifier } from '../../../../utils/change_notifier';
|
||||
} from '@/services/backend';
|
||||
import { ChangeNotifier } from '$app/utils/change_notifier';
|
||||
import { None, Ok, Option, Result, Some } from 'ts-results';
|
||||
import { DatabaseNotificationObserver } from '../notifications/observer';
|
||||
import { Log } from '../../../../utils/log';
|
||||
import { Log } from '$app/utils/log';
|
||||
import { DatabaseBackendService } from '../database_bd_svc';
|
||||
|
||||
export type GroupDataCallbacks = {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { ChangeNotifier } from '../../../../utils/change_notifier';
|
||||
import { ChangeNotifier } from '$app/utils/change_notifier';
|
||||
import { Ok, Result } from 'ts-results';
|
||||
import { DatabaseNotification, FlowyError, GroupChangesetPB, GroupPB } from '../../../../../services/backend';
|
||||
import { DatabaseNotification, FlowyError, GroupChangesetPB, GroupPB } from '@/services/backend';
|
||||
import { DatabaseNotificationObserver } from '../notifications/observer';
|
||||
|
||||
export type GroupByFieldCallback = (value: Result<GroupPB[], FlowyError>) => void;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { DatabaseNotification, FlowyError } from '../../../../../services/backend';
|
||||
import { AFNotificationObserver } from '../../../../../services/backend/notifications';
|
||||
import { DatabaseNotification, FlowyError } from '@/services/backend';
|
||||
import { AFNotificationObserver } from '@/services/backend/notifications';
|
||||
import { DatabaseNotificationParser } from './parser';
|
||||
import { Result } from 'ts-results';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { DatabaseNotification, FlowyError } from '../../../../../services/backend';
|
||||
import { NotificationParser } from '../../../../../services/backend/notifications';
|
||||
import { DatabaseNotification, FlowyError } from '@/services/backend';
|
||||
import { NotificationParser } from '@/services/backend/notifications';
|
||||
import { Result } from 'ts-results';
|
||||
|
||||
declare type DatabaseNotificationCallback = (ty: DatabaseNotification, payload: Result<Uint8Array, FlowyError>) => void;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { CreateRowPayloadPB, RowIdPB } from '../../../../../services/backend';
|
||||
import { CreateRowPayloadPB, RowIdPB } from '@/services/backend';
|
||||
import {
|
||||
DatabaseEventCreateRow,
|
||||
DatabaseEventDeleteRow,
|
||||
DatabaseEventDuplicateRow,
|
||||
DatabaseEventGetRow,
|
||||
} from '../../../../../services/backend/events/flowy-database';
|
||||
} from '@/services/backend/events/flowy-database';
|
||||
|
||||
export class RowBackendService {
|
||||
constructor(public readonly viewId: string) {}
|
||||
|
@ -7,14 +7,14 @@ import {
|
||||
RowsChangesetPB,
|
||||
RowsVisibilityChangesetPB,
|
||||
ReorderSingleRowPB,
|
||||
} from '../../../../../services/backend';
|
||||
import { ChangeNotifier } from '../../../../utils/change_notifier';
|
||||
} from '@/services/backend';
|
||||
import { ChangeNotifier } from '$app/utils/change_notifier';
|
||||
import { FieldInfo } from '../field/field_controller';
|
||||
import { CellCache, CellCacheKey } from '../cell/cell_cache';
|
||||
import { CellIdentifier } from '../cell/cell_bd_svc';
|
||||
import { DatabaseEventGetRow } from '../../../../../services/backend/events/flowy-database';
|
||||
import { DatabaseEventGetRow } from '@/services/backend/events/flowy-database';
|
||||
import { None, Option, Some } from 'ts-results';
|
||||
import { Log } from '../../../../utils/log';
|
||||
import { Log } from '$app/utils/log';
|
||||
|
||||
export type CellByFieldId = Map<string, CellIdentifier>;
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
import { DatabaseViewRowsObserver } from './view_row_observer';
|
||||
import { RowCache, RowInfo } from '../row/row_cache';
|
||||
import { FieldController } from '../field/field_controller';
|
||||
import { RowPB } from '../../../../../services/backend';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { RowPB } from '@/services/backend';
|
||||
|
||||
export class DatabaseViewCache {
|
||||
private readonly rowsObserver: DatabaseViewRowsObserver;
|
||||
|
@ -5,10 +5,10 @@ import {
|
||||
FlowyError,
|
||||
OpenDocumentPayloadPB,
|
||||
ViewIdPB,
|
||||
} from '../../../../services/backend';
|
||||
import { DocumentEventApplyEdit, DocumentEventGetDocument } from '../../../../services/backend/events/flowy-document';
|
||||
} from '@/services/backend';
|
||||
import { DocumentEventApplyEdit, DocumentEventGetDocument } from '@/services/backend/events/flowy-document';
|
||||
import { Result } from 'ts-results';
|
||||
import { FolderEventCloseView } from '../../../../services/backend/events/flowy-folder';
|
||||
import { FolderEventCloseView } from '@/services/backend/events/flowy-folder';
|
||||
|
||||
export class DocumentBackendService {
|
||||
constructor(public readonly viewId: string) {}
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
FolderEventReadApp,
|
||||
FolderEventUpdateApp,
|
||||
ViewLayoutTypePB,
|
||||
} from '../../../../../services/backend/events/flowy-folder';
|
||||
} from '@/services/backend/events/flowy-folder';
|
||||
import {
|
||||
AppIdPB,
|
||||
UpdateAppPayloadPB,
|
||||
@ -16,7 +16,7 @@ import {
|
||||
MoveFolderItemPayloadPB,
|
||||
MoveFolderItemType,
|
||||
FlowyError,
|
||||
} from '../../../../../services/backend';
|
||||
} from '@/services/backend';
|
||||
import { None, Result, Some } from 'ts-results';
|
||||
|
||||
export class AppBackendService {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Ok, Result } from 'ts-results';
|
||||
import { AppPB, FlowyError, FolderNotification } from '../../../../../services/backend';
|
||||
import { ChangeNotifier } from '../../../../utils/change_notifier';
|
||||
import { AppPB, FlowyError, FolderNotification } from '@/services/backend';
|
||||
import { ChangeNotifier } from '$app/utils/change_notifier';
|
||||
import { FolderNotificationObserver } from '../notifications/observer';
|
||||
|
||||
export type AppUpdateNotifyCallback = (value: Result<AppPB, FlowyError>) => void;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { OnNotificationError, AFNotificationObserver } from '../../../../../services/backend/notifications';
|
||||
import { OnNotificationError, AFNotificationObserver } from '@/services/backend/notifications';
|
||||
import { FolderNotificationParser } from './parser';
|
||||
import { FlowyError, FolderNotification } from '../../../../../services/backend';
|
||||
import { FlowyError, FolderNotification } from '@/services/backend';
|
||||
import { Result } from 'ts-results';
|
||||
|
||||
export type ParserHandler = (notification: FolderNotification, payload: Result<Uint8Array, FlowyError>) => void;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { NotificationParser, OnNotificationError } from '../../../../../services/backend/notifications';
|
||||
import { FlowyError, FolderNotification } from '../../../../../services/backend';
|
||||
import { NotificationParser, OnNotificationError } from '@/services/backend/notifications';
|
||||
import { FlowyError, FolderNotification } from '@/services/backend';
|
||||
import { Result } from 'ts-results';
|
||||
|
||||
declare type FolderNotificationCallback = (ty: FolderNotification, payload: Result<Uint8Array, FlowyError>) => void;
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { UpdateViewPayloadPB, RepeatedViewIdPB, ViewPB } from '../../../../../services/backend/models/flowy-folder/view';
|
||||
import { UpdateViewPayloadPB, RepeatedViewIdPB, ViewPB } from '@/services/backend';
|
||||
import {
|
||||
FolderEventDeleteView,
|
||||
FolderEventDuplicateView,
|
||||
FolderEventUpdateView,
|
||||
} from '../../../../../services/backend/events/flowy-folder';
|
||||
} from '@/services/backend/events/flowy-folder';
|
||||
|
||||
export class ViewBackendService {
|
||||
constructor(public readonly viewId: string) {}
|
||||
|
@ -1,7 +1,6 @@
|
||||
import { Ok, Result } from 'ts-results';
|
||||
import { FlowyError } from '../../../../../services/backend/models/flowy-error/errors';
|
||||
import { DeletedViewPB, FolderNotification, ViewPB } from '../../../../../services/backend/models/flowy-folder';
|
||||
import { ChangeNotifier } from '../../../../utils/change_notifier';
|
||||
import { DeletedViewPB, FolderNotification, ViewPB, FlowyError } from '@/services/backend';
|
||||
import { ChangeNotifier } from '$app/utils/change_notifier';
|
||||
import { FolderNotificationObserver } from '../notifications/observer';
|
||||
|
||||
type DeleteViewNotifyValue = Result<ViewPB, FlowyError>;
|
||||
|
@ -4,8 +4,8 @@ import {
|
||||
FolderEventMoveItem,
|
||||
FolderEventReadWorkspaceApps,
|
||||
FolderEventReadWorkspaces,
|
||||
} from '../../../../../services/backend/events/flowy-folder';
|
||||
import { CreateAppPayloadPB, WorkspaceIdPB, FlowyError, MoveFolderItemPayloadPB } from '../../../../../services/backend';
|
||||
} from '@/services/backend/events/flowy-folder';
|
||||
import { CreateAppPayloadPB, WorkspaceIdPB, FlowyError, MoveFolderItemPayloadPB } from '@/services/backend';
|
||||
import assert from 'assert';
|
||||
|
||||
export class WorkspaceBackendService {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Ok, Result } from 'ts-results';
|
||||
import { AppPB, FolderNotification, RepeatedAppPB, WorkspacePB, FlowyError } from '../../../../../services/backend';
|
||||
import { ChangeNotifier } from '../../../../utils/change_notifier';
|
||||
import { AppPB, FolderNotification, RepeatedAppPB, WorkspacePB, FlowyError } from '@/services/backend';
|
||||
import { ChangeNotifier } from '$app/utils/change_notifier';
|
||||
import { FolderNotificationObserver } from '../notifications/observer';
|
||||
|
||||
export type AppListNotifyValue = Result<AppPB[], FlowyError>;
|
||||
|
@ -6,7 +6,7 @@ import {
|
||||
UserEventSignOut,
|
||||
UserEventSignUp,
|
||||
UserEventUpdateUserProfile,
|
||||
} from '../../../../services/backend/events/flowy-user';
|
||||
} from '@/services/backend/events/flowy-user';
|
||||
import {
|
||||
SignInPayloadPB,
|
||||
SignUpPayloadPB,
|
||||
@ -15,13 +15,13 @@ import {
|
||||
CreateWorkspacePayloadPB,
|
||||
WorkspaceSettingPB,
|
||||
WorkspacePB,
|
||||
} from '../../../../services/backend';
|
||||
} from '@/services/backend';
|
||||
import {
|
||||
FolderEventCreateWorkspace,
|
||||
FolderEventOpenWorkspace,
|
||||
FolderEventReadCurrentWorkspace,
|
||||
FolderEventReadWorkspaces,
|
||||
} from '../../../../services/backend/events/flowy-folder';
|
||||
} from '@/services/backend/events/flowy-folder';
|
||||
|
||||
export class UserBackendService {
|
||||
constructor(public readonly userId: string) {}
|
||||
|
Loading…
Reference in New Issue
Block a user