[ML] Remove export wildcard syntax for ML plugin. (#123177)

Remove export wildcard syntax for ML plugin. Types exported at the plugin level were prefixed with Ml.
This commit is contained in:
Walter Rafelsberger 2022-01-25 10:20:49 +01:00 committed by GitHub
parent cef886f073
commit 0305c6eff4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 8 deletions

View file

@ -5,12 +5,21 @@
* 2.0.
*/
// TODO: https://github.com/elastic/kibana/issues/110898
/* eslint-disable @kbn/eslint/no_export_all */
import { PluginInitializerContext } from 'kibana/server';
import { MlServerPlugin } from './plugin';
export type { MlPluginSetup, MlPluginStart } from './plugin';
export * from './shared';
export type {
AnomalyRecordDoc as MlAnomalyRecordDoc,
AnomaliesTableRecord as MlAnomaliesTableRecord,
AnomalyResultType as MlAnomalyResultType,
DatafeedStats as MlDatafeedStats,
Job as MlJob,
} from './shared';
export {
UnknownMLCapabilitiesError,
InsufficientMLCapabilities,
MLPrivilegesUninitialized,
getHistogramsForFields,
} from './shared';
export const plugin = (ctx: PluginInitializerContext) => new MlServerPlugin(ctx);

View file

@ -9,7 +9,7 @@ import type * as estypes from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import type { ExceptionListItemSchema } from '@kbn/securitysolution-io-ts-list-types';
import { buildExceptionFilter } from '@kbn/securitysolution-list-utils';
import { AnomalyRecordDoc as Anomaly } from '../../../../ml/server';
import { MlAnomalyRecordDoc as Anomaly } from '../../../../ml/server';
export type { Anomaly };
export type AnomalyResults = estypes.SearchResponse<Anomaly>;

View file

@ -6,7 +6,7 @@
*/
import { KibanaRequest, SavedObjectsClientContract } from '../../../../../../src/core/server';
import { DatafeedStats, Job, MlPluginSetup } from '../../../../ml/server';
import { MlDatafeedStats, MlJob, MlPluginSetup } from '../../../../ml/server';
import { isJobStarted } from '../../../common/machine_learning/helpers';
import { isSecurityJob } from '../../../common/machine_learning/is_security_job';
import { DetectionsMetric, MlJobMetric, MlJobsUsage, MlJobUsage } from './types';
@ -94,14 +94,14 @@ export const getMlJobMetrics = async (
.anomalyDetectorsProvider(fakeRequest, savedObjectClient)
.jobs(jobsType);
const jobDetailsCache = new Map<string, Job>();
const jobDetailsCache = new Map<string, MlJob>();
jobDetails.jobs.forEach((detail) => jobDetailsCache.set(detail.job_id, detail));
const datafeedStats = await ml
.anomalyDetectorsProvider(fakeRequest, savedObjectClient)
.datafeedStats();
const datafeedStatsCache = new Map<string, DatafeedStats>();
const datafeedStatsCache = new Map<string, MlDatafeedStats>();
datafeedStats.datafeeds.forEach((datafeedStat) =>
datafeedStatsCache.set(`${datafeedStat.datafeed_id}`, datafeedStat)
);