mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 04:48:53 +00:00
refactor: rename WorkspacePlugin to WorkspaceAdapter (#2330)
This commit is contained in:
@@ -80,13 +80,16 @@ export interface AffineWebSocketProvider extends BackgroundProvider {
|
||||
|
||||
export type Provider = BackgroundProvider | NecessaryProvider;
|
||||
|
||||
export interface AffineWorkspace extends RemoteWorkspace {
|
||||
export interface AffineLegacyCloudWorkspace extends RemoteWorkspace {
|
||||
flavour: WorkspaceFlavour.AFFINE;
|
||||
// empty
|
||||
blockSuiteWorkspace: BlockSuiteWorkspace;
|
||||
providers: Provider[];
|
||||
}
|
||||
|
||||
// todo: update type with nest.js
|
||||
export type AffineCloudWorkspace = LocalWorkspace;
|
||||
|
||||
export interface LocalWorkspace {
|
||||
flavour: WorkspaceFlavour.LOCAL;
|
||||
id: string;
|
||||
@@ -101,6 +104,12 @@ export interface AffinePublicWorkspace {
|
||||
providers: Provider[];
|
||||
}
|
||||
|
||||
export const enum ReleaseType {
|
||||
// if workspace is not released yet, we will not show it in the workspace list
|
||||
UNRELEASED = 'unreleased',
|
||||
STABLE = 'stable',
|
||||
}
|
||||
|
||||
export const enum LoadPriority {
|
||||
HIGH = 1,
|
||||
MEDIUM = 2,
|
||||
@@ -108,7 +117,18 @@ export const enum LoadPriority {
|
||||
}
|
||||
|
||||
export const enum WorkspaceFlavour {
|
||||
/**
|
||||
* AFFiNE Workspace is the workspace
|
||||
* that hosted on the Legacy AFFiNE Cloud Server.
|
||||
*
|
||||
* @deprecated
|
||||
* We no longer maintain this kind of workspace, please use AFFiNE-Cloud instead.
|
||||
*/
|
||||
AFFINE = 'affine',
|
||||
/**
|
||||
* New AFFiNE Cloud Workspace using Nest.js Server.
|
||||
*/
|
||||
AFFINE_CLOUD = 'affine-cloud',
|
||||
LOCAL = 'local',
|
||||
PUBLIC = 'affine-public',
|
||||
}
|
||||
@@ -125,9 +145,11 @@ export type SettingPanel = (typeof settingPanel)[keyof typeof settingPanel];
|
||||
|
||||
// built-in workspaces
|
||||
export interface WorkspaceRegistry {
|
||||
[WorkspaceFlavour.AFFINE]: AffineWorkspace;
|
||||
[WorkspaceFlavour.AFFINE]: AffineLegacyCloudWorkspace;
|
||||
[WorkspaceFlavour.LOCAL]: LocalWorkspace;
|
||||
[WorkspaceFlavour.PUBLIC]: AffinePublicWorkspace;
|
||||
// todo: update workspace type to new
|
||||
[WorkspaceFlavour.AFFINE_CLOUD]: AffineCloudWorkspace;
|
||||
}
|
||||
|
||||
export interface WorkspaceCRUD<Flavour extends keyof WorkspaceRegistry> {
|
||||
|
||||
Reference in New Issue
Block a user