[Console] Remove unused function (#159041)

## Summary
While working on https://github.com/elastic/kibana/issues/159410, I
noticed that there are some unused functions in the Console server side
plugin contracts. This PR removes the function `addProcessorDefinition`
from the `start` contract. I was not able to find any uses of this
function in the Kibana code. I believe it might have been planned to be
used for ingest processors but currently we use the `_processor`
endpoint for that (see
[here](6f94e42a32/src/plugins/console/server/lib/spec_definitions/js/ingest.ts (LL605C15-L605C37))).
And since the tests also pass I think it's safe to remove this function.
I'm using the label `release_note:breaking` because the plugin's
contracts are public and theoretically it's possible that there are some
external plugins that use that function.

### Release note
The function `addProcessorDefinition` is removed from the Console plugin
start contract (server side).
This commit is contained in:
Yulia Čech 2023-06-23 20:02:47 +02:00 committed by GitHub
parent 863f6bdb8b
commit 87e31ce7b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 15 deletions

View file

@ -83,9 +83,7 @@ export class ConsoleServerPlugin implements Plugin<ConsoleSetup, ConsoleStart> {
}
start() {
return {
...this.specDefinitionsService.start(),
};
this.specDefinitionsService.start();
}
stop() {

View file

@ -87,15 +87,6 @@ export class SpecDefinitionsService {
this.extensionSpecFilePaths.push(path);
}
public addProcessorDefinition(processor: unknown) {
if (!this.hasLoadedSpec) {
throw new Error(
'Cannot add a processor definition because spec definitions have not loaded!'
);
}
this.endpoints._processor!.data_autocomplete_rules.__one_of.push(processor);
}
public setup() {
return {
addExtensionSpecFilePath: this.addExtensionSpecFilePath.bind(this),
@ -107,9 +98,6 @@ export class SpecDefinitionsService {
this.loadJsonSpec();
this.loadJSSpec();
this.hasLoadedSpec = true;
return {
addProcessorDefinition: this.addProcessorDefinition.bind(this),
};
} else {
throw new Error('Service has already started!');
}