Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] [Workspace] Add WorkspacePluginSetup interface #6469

Merged
merged 1 commit into from
Apr 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[Workspace] Add WorkspacePluginSetup interface (#6118)
* Add workspacePluginSetup type

Signed-off-by: Hailong Cui <[email protected]>

* add fakenews.co to .lycheeexclude

Signed-off-by: Hailong Cui <[email protected]>

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

* feat: add comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: update unit test

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: add CHANGELOG

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize comment

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize code

Signed-off-by: SuZhou-Joe <[email protected]>

* feat: optimize code

Signed-off-by: SuZhou-Joe <[email protected]>

---------

Signed-off-by: SuZhou-Joe <[email protected]>
Signed-off-by: Hailong Cui <[email protected]>

* Revert "add fakenews.co to .lycheeexclude"

This reverts commit 55f6344.

Signed-off-by: Hailong Cui <[email protected]>

* Add WorkspacePluginStart

Signed-off-by: Hailong Cui <[email protected]>

---------

Signed-off-by: Hailong Cui <[email protected]>
Signed-off-by: SuZhou-Joe <[email protected]>
Co-authored-by: SuZhou-Joe <[email protected]>
(cherry picked from commit 9cdc7c9)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
github-actions[bot] and SuZhou-Joe committed Apr 16, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit fc285c5a30c3c28c007601fee16004ddbdabdf51
2 changes: 1 addition & 1 deletion src/plugins/workspace/server/index.ts
Original file line number Diff line number Diff line change
@@ -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
@@ -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;
8 changes: 8 additions & 0 deletions src/plugins/workspace/server/types.ts
Original file line number Diff line number Diff line change
@@ -117,3 +117,11 @@ export type IResponse<T> =
success: false;
error?: string;
};

export interface WorkspacePluginSetup {
client: IWorkspaceClientImpl;
}

export interface WorkspacePluginStart {
client: IWorkspaceClientImpl;
}