Skip to content

Commit

Permalink
[Workspace] Add WorkspacePluginSetup interface (opensearch-project#6118)
Browse files Browse the repository at this point in the history
* 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 (opensearch-project#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]>
  • Loading branch information
Hailong-am and SuZhou-Joe authored Mar 13, 2024
1 parent 2536ad1 commit 9cdc7c9
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,13 +10,13 @@ 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';

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 9cdc7c9

Please sign in to comment.