From fc285c5a30c3c28c007601fee16004ddbdabdf51 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 16 Apr 2024 03:23:19 +0000 Subject: [PATCH] [Workspace] Add WorkspacePluginSetup interface (#6118) * Add workspacePluginSetup type Signed-off-by: Hailong Cui * add fakenews.co to .lycheeexclude Signed-off-by: Hailong Cui * [Workspace] Add a workspace client in workspace plugin (#6094) * feat: add comment Signed-off-by: SuZhou-Joe * feat: update unit test Signed-off-by: SuZhou-Joe * feat: add CHANGELOG Signed-off-by: SuZhou-Joe * feat: optimize comment Signed-off-by: SuZhou-Joe * feat: optimize comment Signed-off-by: SuZhou-Joe * feat: optimize code Signed-off-by: SuZhou-Joe * feat: optimize code Signed-off-by: SuZhou-Joe --------- Signed-off-by: SuZhou-Joe Signed-off-by: Hailong Cui * Revert "add fakenews.co to .lycheeexclude" This reverts commit 55f63448c58ac62287cb09da1105a7b4a0b3e24e. Signed-off-by: Hailong Cui * Add WorkspacePluginStart Signed-off-by: Hailong Cui --------- Signed-off-by: Hailong Cui Signed-off-by: SuZhou-Joe Co-authored-by: SuZhou-Joe (cherry picked from commit 9cdc7c96ef1829460563f20eb0f9861fa6d4cfc8) Signed-off-by: github-actions[bot] --- src/plugins/workspace/server/index.ts | 2 +- src/plugins/workspace/server/plugin.ts | 4 ++-- src/plugins/workspace/server/types.ts | 8 ++++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/plugins/workspace/server/index.ts b/src/plugins/workspace/server/index.ts index fe44b4d71757..2cfd05aaea8a 100644 --- a/src/plugins/workspace/server/index.ts +++ b/src/plugins/workspace/server/index.ts @@ -18,4 +18,4 @@ export const config: PluginConfigDescriptor = { schema: configSchema, }; -export { WorkspaceFindOptions } from './types'; +export { WorkspaceFindOptions, WorkspacePluginSetup, WorkspacePluginStart } from './types'; diff --git a/src/plugins/workspace/server/plugin.ts b/src/plugins/workspace/server/plugin.ts index 56abf1afb918..e846470210c3 100644 --- a/src/plugins/workspace/server/plugin.ts +++ b/src/plugins/workspace/server/plugin.ts @@ -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 { private readonly logger: Logger; private client?: IWorkspaceClientImpl; private workspaceConflictControl?: WorkspaceConflictSavedObjectsClientWrapper; diff --git a/src/plugins/workspace/server/types.ts b/src/plugins/workspace/server/types.ts index 0f60597a7a8a..29e8747c7618 100644 --- a/src/plugins/workspace/server/types.ts +++ b/src/plugins/workspace/server/types.ts @@ -117,3 +117,11 @@ export type IResponse = success: false; error?: string; }; + +export interface WorkspacePluginSetup { + client: IWorkspaceClientImpl; +} + +export interface WorkspacePluginStart { + client: IWorkspaceClientImpl; +}