[ML] removed orphaned code (#152196)

Removes client side `getTimeFieldRange()` code within the data
visualizer plugin. The code has been moved to the date picker package in
`x-pack/packages/ml/date_picker/src/services/time_field_range.ts`and the
duplicate is no longer necessary.
This commit is contained in:
Walter Rafelsberger 2023-03-02 08:37:08 +01:00 committed by GitHub
parent babe0339e3
commit b3c3461fe1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,32 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
import { lazyLoadModules } from '../../../lazy_load_bundle';
import { GetTimeFieldRangeResponse } from '../../../../common/types/time_field_request';
export async function getTimeFieldRange({
index,
timeFieldName,
query,
runtimeMappings,
}: {
index: string;
timeFieldName?: string;
query?: QueryDslQueryContainer;
runtimeMappings?: estypes.MappingRuntimeFields;
}) {
const body = JSON.stringify({ index, timeFieldName, query, runtimeMappings });
const fileUploadModules = await lazyLoadModules();
return await fileUploadModules.getHttp().fetch<GetTimeFieldRangeResponse>({
path: `/internal/file_upload/time_field_range`,
method: 'POST',
body,
});
}