From cbf30e147a1cf43d25fda490fd6455847f59b871 Mon Sep 17 00:00:00 2001 From: Jean-Louis Leysens Date: Mon, 9 Dec 2019 17:52:05 +0100 Subject: [PATCH] Fix types --- x-pack/legacy/plugins/watcher/plugin_definition.ts | 1 - .../server/np_ready/lib/call_with_request_factory.ts | 10 ++++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/x-pack/legacy/plugins/watcher/plugin_definition.ts b/x-pack/legacy/plugins/watcher/plugin_definition.ts index d8ab02d8022bd..2da05253fdb32 100644 --- a/x-pack/legacy/plugins/watcher/plugin_definition.ts +++ b/x-pack/legacy/plugins/watcher/plugin_definition.ts @@ -23,7 +23,6 @@ export const pluginDefinition = { __LEGACY: { route: server.route.bind(server), plugins: { - elasticsearch: server.plugins.elasticsearch, watcher: server.plugins[PLUGIN.ID], xpack_main: server.plugins.xpack_main, }, diff --git a/x-pack/legacy/plugins/watcher/server/np_ready/lib/call_with_request_factory.ts b/x-pack/legacy/plugins/watcher/server/np_ready/lib/call_with_request_factory.ts index 659e5b5fdbeb5..eaec9cd91b23c 100644 --- a/x-pack/legacy/plugins/watcher/server/np_ready/lib/call_with_request_factory.ts +++ b/x-pack/legacy/plugins/watcher/server/np_ready/lib/call_with_request_factory.ts @@ -7,7 +7,6 @@ import { ElasticsearchServiceSetup } from 'src/core/server'; import { once } from 'lodash'; import { elasticsearchJsPlugin } from './elasticsearch_js_plugin'; -import { ServerShim } from '../types'; const callWithRequest = once((elasticsearchService: ElasticsearchServiceSetup) => { const config = { plugins: [elasticsearchJsPlugin] }; @@ -19,8 +18,11 @@ export const callWithRequestFactory = ( request: any ) => { return (...args: any[]) => { - return callWithRequest(elasticsearchService) - .asScoped(request) - .callAsCurrentUser(...args); + return ( + callWithRequest(elasticsearchService) + .asScoped(request) + // @ts-ignore + .callAsCurrentUser(...args) + ); }; };