Skip to content

Commit

Permalink
[Workspace] Add WorkspacePluginSetup interface (#6118) (#6469)
Browse files Browse the repository at this point in the history
* Add workspacePluginSetup type



* add fakenews.co to .lycheeexclude



* [Workspace] Add a workspace client in workspace plugin (#6094)

* feat: add comment



* feat: update unit test



* feat: add CHANGELOG



* feat: optimize comment



* feat: optimize comment



* feat: optimize code



* feat: optimize code



---------




* Revert "add fakenews.co to .lycheeexclude"

This reverts commit 55f6344.



* Add WorkspacePluginStart



---------




(cherry picked from commit 9cdc7c9)

Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: SuZhou-Joe <[email protected]>
  • Loading branch information
3 people authored Apr 16, 2024
1 parent e33cc22 commit 690eaf8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/plugins/workspace/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export const config: PluginConfigDescriptor = {
schema: configSchema,
};

export { WorkspaceFindOptions } from './types';
export { WorkspaceFindOptions, WorkspacePluginSetup, WorkspacePluginStart } from './types';
4 changes: 2 additions & 2 deletions src/plugins/workspace/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ import {
Logger,
CoreStart,
} from '../../../core/server';
import { IWorkspaceClientImpl } from './types';
import { IWorkspaceClientImpl, WorkspacePluginSetup, WorkspacePluginStart } from './types';
import { WorkspaceClient } from './workspace_client';
import { registerRoutes } from './routes';
import { WORKSPACE_CONFLICT_CONTROL_SAVED_OBJECTS_CLIENT_WRAPPER_ID } from '../common/constants';
import { WorkspaceConflictSavedObjectsClientWrapper } from './saved_objects/saved_objects_wrapper_for_check_workspace_conflict';
import { cleanWorkspaceId, getWorkspaceIdFromUrl } from '../../../core/server/utils';

export class WorkspacePlugin implements Plugin<{}, {}> {
export class WorkspacePlugin implements Plugin<WorkspacePluginSetup, WorkspacePluginStart> {
private readonly logger: Logger;
private client?: IWorkspaceClientImpl;
private workspaceConflictControl?: WorkspaceConflictSavedObjectsClientWrapper;
Expand Down
8 changes: 8 additions & 0 deletions src/plugins/workspace/server/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,11 @@ export type IResponse<T> =
success: false;
error?: string;
};

export interface WorkspacePluginSetup {
client: IWorkspaceClientImpl;
}

export interface WorkspacePluginStart {
client: IWorkspaceClientImpl;
}

0 comments on commit 690eaf8

Please sign in to comment.