From a95a0e1fd7f6529ae53880fe73bba045af2c495e Mon Sep 17 00:00:00 2001 From: Timothy Sullivan Date: Tue, 19 Nov 2019 14:14:59 -0700 Subject: [PATCH] ts simplification --- .../server/lib/get_job_params_from_request.ts | 2 +- .../plugins/reporting/server/lib/export_types_registry.ts | 1 - .../server/routes/generate_from_savedobject_immediate.ts | 3 +-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_job_params_from_request.ts b/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_job_params_from_request.ts index 8e5440b700d1e..774e430d593cd 100644 --- a/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_job_params_from_request.ts +++ b/x-pack/legacy/plugins/reporting/export_types/csv_from_savedobject/server/lib/get_job_params_from_request.ts @@ -10,7 +10,7 @@ import { JobParamsPostPayloadPanelCsv, JobParamsPanelCsv } from '../../types'; export function getJobParamsFromRequest( request: RequestFacade, opts: { isImmediate: boolean } -): JobParamsPanelCsv { +): Partial { const { savedObjectType, savedObjectId } = request.params; const { timerange, state } = request.payload as JobParamsPostPayloadPanelCsv; const post = timerange || state ? { timerange, state } : undefined; diff --git a/x-pack/legacy/plugins/reporting/server/lib/export_types_registry.ts b/x-pack/legacy/plugins/reporting/server/lib/export_types_registry.ts index c42a8b41f19d8..35c97f1db10dc 100644 --- a/x-pack/legacy/plugins/reporting/server/lib/export_types_registry.ts +++ b/x-pack/legacy/plugins/reporting/server/lib/export_types_registry.ts @@ -26,7 +26,6 @@ function scan(pattern: string) { } const pattern = pathResolve(__dirname, '../../export_types/*/server/index.[jt]s'); - async function exportTypesRegistryFn(server: ServerFacade) { const logger = LevelLogger.createForServer(server, [PLUGIN_ID, 'exportTypes']); const exportTypesRegistry = new ExportTypesRegistry(); diff --git a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts b/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts index ff214f344877c..557f7c3702038 100644 --- a/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts +++ b/x-pack/legacy/plugins/reporting/server/routes/generate_from_savedobject_immediate.ts @@ -15,7 +15,6 @@ import { JobDocPayload, JobIDForImmediate, JobDocOutputExecuted, - ImmediateCreateJobFn, } from '../../types'; import { getRouteOptionsCsv } from './lib/route_config_factories'; import { getJobParamsFromRequest } from '../../export_types/csv_from_savedobject/server/lib/get_job_params_from_request'; @@ -47,7 +46,7 @@ export function registerGenerateCsvFromSavedObjectImmediate( handler: async (request: RequestFacade, h: ReportingResponseToolkit) => { const logger = parentLogger.clone(['savedobject-csv']); const jobParams = getJobParamsFromRequest(request, { isImmediate: true }); - const createJobFn: ImmediateCreateJobFn = createJobFactory(server); + const createJobFn = createJobFactory(server); const executeJobFn = executeJobFactory(server); const jobDocPayload: JobDocPayload = await createJobFn(jobParams, request.headers, request); const {