mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
[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:
parent
cef886f073
commit
0305c6eff4
3 changed files with 17 additions and 8 deletions
|
@ -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);
|
||||
|
|
|
@ -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>;
|
||||
|
|
|
@ -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)
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue