Remove deprecated & unused ElasticsearchServiceStart.legacy (#127050)

This commit is contained in:
Alejandro Fernández Haro 2022-03-09 09:47:41 +01:00 committed by GitHub
parent d1f0d23ad7
commit eb4cd4a2ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 0 additions and 49 deletions

View file

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

View file

@ -1,18 +0,0 @@
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) &gt; [kibana-plugin-core-server](./kibana-plugin-core-server.md) &gt; [ElasticsearchServiceStart](./kibana-plugin-core-server.elasticsearchservicestart.md) &gt; [legacy](./kibana-plugin-core-server.elasticsearchservicestart.legacy.md)
## ElasticsearchServiceStart.legacy property
> Warning: This API is now obsolete.
>
> Provided for the backward compatibility. Switch to the new elasticsearch client as soon as https://github.com/elastic/kibana/issues/35508 done.
>
<b>Signature:</b>
```typescript
legacy: {
readonly config$: Observable<ElasticsearchConfig>;
};
```

View file

@ -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;; } | |

View file

@ -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
@ -71,9 +68,6 @@ const createStartContractMock = () => {
const startContract: MockedElasticSearchServiceStart = {
client: elasticsearchClientMock.createClusterClient(),
createClient: jest.fn(),
legacy: {
config$: new BehaviorSubject({} as ElasticsearchConfig),
},
};
startContract.createClient.mockImplementation(() =>

View file

@ -141,9 +141,6 @@ export class ElasticsearchService
return {
client: this.client!,
createClient: (type, clientConfig) => this.createClusterClient(type, config, clientConfig),
legacy: {
config$: this.config$,
},
};
}

View file

@ -81,7 +81,6 @@ export interface ElasticsearchServiceSetup {
/**
* @deprecated
* Use {@link ElasticsearchServiceStart.legacy} instead.
*/
legacy: {
/**
@ -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>;
};
}
/**

View file

@ -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: {

View file

@ -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)