Skip to content

Commit

Permalink
Remove deprecated & unused ElasticsearchServiceStart.legacy (#127050)
Browse files Browse the repository at this point in the history
  • Loading branch information
afharo authored Mar 9, 2022
1 parent d1f0d23 commit eb4cd4a
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

> Warning: This API is now obsolete.
>
> Use [ElasticsearchServiceStart.legacy](./kibana-plugin-core-server.elasticsearchservicestart.legacy.md) instead.
>
<b>Signature:</b>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ export interface ElasticsearchServiceStart
| --- | --- | --- |
| [client](./kibana-plugin-core-server.elasticsearchservicestart.client.md) | IClusterClient | A pre-configured [Elasticsearch client](./kibana-plugin-core-server.iclusterclient.md) |
| [createClient](./kibana-plugin-core-server.elasticsearchservicestart.createclient.md) | (type: string, clientConfig?: Partial&lt;ElasticsearchClientConfig&gt;) =&gt; ICustomClusterClient | Create application specific Elasticsearch cluster API client with customized config. See [IClusterClient](./kibana-plugin-core-server.iclusterclient.md)<!-- -->. |
| [legacy](./kibana-plugin-core-server.elasticsearchservicestart.legacy.md) | { readonly config$: Observable&lt;ElasticsearchConfig&gt;; } | |

6 changes: 0 additions & 6 deletions src/core/server/elasticsearch/elasticsearch_service.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ export type MockedElasticSearchServiceSetup = jest.Mocked<
};

export interface MockedElasticSearchServiceStart {
legacy: {
config$: BehaviorSubject<ElasticsearchConfig>;
};
client: ClusterClientMock;
createClient: jest.MockedFunction<
(name: string, config?: Partial<ElasticsearchClientConfig>) => CustomClusterClientMock
Expand Down Expand Up @@ -71,9 +68,6 @@ const createStartContractMock = () => {
const startContract: MockedElasticSearchServiceStart = {
client: elasticsearchClientMock.createClusterClient(),
createClient: jest.fn(),
legacy: {
config$: new BehaviorSubject({} as ElasticsearchConfig),
},
};

startContract.createClient.mockImplementation(() =>
Expand Down
3 changes: 0 additions & 3 deletions src/core/server/elasticsearch/elasticsearch_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ export class ElasticsearchService
return {
client: this.client!,
createClient: (type, clientConfig) => this.createClusterClient(type, config, clientConfig),
legacy: {
config$: this.config$,
},
};
}

Expand Down
15 changes: 0 additions & 15 deletions src/core/server/elasticsearch/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export interface ElasticsearchServiceSetup {

/**
* @deprecated
* Use {@link ElasticsearchServiceStart.legacy} instead.
*/
legacy: {
/**
Expand Down Expand Up @@ -136,20 +135,6 @@ export interface ElasticsearchServiceStart {
type: string,
clientConfig?: Partial<ElasticsearchClientConfig>
) => ICustomClusterClient;

/**
* @deprecated
* Provided for the backward compatibility.
* Switch to the new elasticsearch client as soon as https://github.com/elastic/kibana/issues/35508 done.
* */
legacy: {
/**
* Provide direct access to the current elasticsearch configuration.
*
* @deprecated this will be removed in a later version.
*/
readonly config$: Observable<ElasticsearchConfig>;
};
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/core/server/plugins/plugin_context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ export function createPluginStartContext<TPlugin, TPluginDependencies>(
elasticsearch: {
client: deps.elasticsearch.client,
createClient: deps.elasticsearch.createClient,
legacy: deps.elasticsearch.legacy,
},
executionContext: deps.executionContext,
http: {
Expand Down
4 changes: 0 additions & 4 deletions src/core/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -959,10 +959,6 @@ export interface ElasticsearchServiceSetup {
export interface ElasticsearchServiceStart {
readonly client: IClusterClient;
readonly createClient: (type: string, clientConfig?: Partial<ElasticsearchClientConfig>) => ICustomClusterClient;
// @deprecated (undocumented)
legacy: {
readonly config$: Observable<ElasticsearchConfig>;
};
}

// @public (undocumented)
Expand Down

0 comments on commit eb4cd4a

Please sign in to comment.