Skip to content

Commit

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

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* add fakenews.co to .lycheeexclude

Signed-off-by: Hailong Cui <ihailong@amazon.com>

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

* feat: add comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: update unit test

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: add CHANGELOG

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: optimize comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: optimize comment

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: optimize code

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

* feat: optimize code

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>

---------

Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Signed-off-by: Hailong Cui <ihailong@amazon.com>

* Revert "add fakenews.co to .lycheeexclude"

This reverts commit 55f6344.

Signed-off-by: Hailong Cui <ihailong@amazon.com>

* Add WorkspacePluginStart

Signed-off-by: Hailong Cui <ihailong@amazon.com>

---------

Signed-off-by: Hailong Cui <ihailong@amazon.com>
Signed-off-by: SuZhou-Joe <suzhou@amazon.com>
Co-authored-by: SuZhou-Joe <suzhou@amazon.com>
(cherry picked from commit 9cdc7c9)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and SuZhou-Joe committed Apr 16, 2024
1 parent e33cc22 commit fc285c5
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 fc285c5

Please sign in to comment.