Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Migrates ML plugin to TS project ref #90021

Merged
merged 8 commits into from
Feb 3, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,19 @@ export type GetDataFrameAnalyticsStatsResponse =
| GetDataFrameAnalyticsStatsResponseOk
| GetDataFrameAnalyticsStatsResponseError;

interface GetDataFrameAnalyticsResponse {
export interface GetDataFrameAnalyticsResponse {
count: number;
data_frame_analytics: DataFrameAnalyticsConfig[];
}

interface DeleteDataFrameAnalyticsWithIndexResponse {
export interface DeleteDataFrameAnalyticsWithIndexResponse {
acknowledged: boolean;
analyticsJobDeleted: DeleteDataFrameAnalyticsWithIndexStatus;
destIndexDeleted: DeleteDataFrameAnalyticsWithIndexStatus;
destIndexPatternDeleted: DeleteDataFrameAnalyticsWithIndexStatus;
}
interface JobsExistsResponse {

export interface JobsExistsResponse {
results: {
[jobId: string]: boolean;
};
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/server/models/job_service/error_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export function isRequestTimeout(error: { name: string }) {
return error.name === REQUEST_TIMEOUT_NAME;
}

interface Results {
export interface Results {
[id: string]: {
[status: string]: any;
error?: any;
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/ml/server/models/job_service/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { Job } from '../../../common/types/anomaly_detection_jobs';
import { MlJobsResponse } from '../../../common/types/job_service';
import type { MlClient } from '../../lib/ml_client';

interface Group {
export interface Group {
id: string;
jobIds: string[];
calendarIds: string[];
}

interface Results {
export interface Results {
[id: string]: {
success: boolean;
error?: any;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface Result {
value: Value;
}

interface ProcessedResults {
export interface ProcessedResults {
success: boolean;
results: Record<number, Result[]>;
totalResults: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface Result {
values: Thing[];
}

interface ProcessedResults {
export interface ProcessedResults {
success: boolean;
results: Record<number, Result[]>;
totalResults: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { _DOC_COUNT } from '../../../../common/constants/field_types';
import { Aggregation, Field, NewJobCaps } from '../../../../common/types/fields';
import { fieldServiceProvider } from './field_service';

interface NewJobCapsResponse {
export interface NewJobCapsResponse {
[indexPattern: string]: NewJobCaps;
}

Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/server/saved_objects/checks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface JobStatus {
};
}

interface StatusResponse {
export interface StatusResponse {
savedObjects: {
[type in JobType]: JobSavedObjectStatus[];
};
Expand Down
34 changes: 34 additions & 0 deletions x-pack/plugins/ml/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
"__mocks__/**/*",
"shared_imports.ts",
"../../../typings/**/*",
// have to declare *.json explicitly due to https://github.com/microsoft/TypeScript/issues/25636
"public/**/*.json",
"server/**/*.json",
],
"references": [
{ "path": "../../../src/core/tsconfig.json" },
{ "path": "../../../src/plugins/embeddable/tsconfig.json" },
{ "path": "../../../src/plugins/index_pattern_management/tsconfig.json" },
{ "path": "../cloud/tsconfig.json" },
{ "path": "../features/tsconfig.json" },
{ "path": "../file_upload/tsconfig.json" },
{ "path": "../license_management/tsconfig.json" },
{ "path": "../licensing/tsconfig.json" },
{ "path": "../maps/tsconfig.json" },
{ "path": "../security/tsconfig.json" },
{ "path": "../spaces/tsconfig.json" },
]
}
1 change: 1 addition & 0 deletions x-pack/test/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
{ "path": "../plugins/event_log/tsconfig.json" },
{ "path": "../plugins/licensing/tsconfig.json" },
{ "path": "../plugins/lens/tsconfig.json" },
{ "path": "../plugins/ml/tsconfig.json" },
{ "path": "../plugins/task_manager/tsconfig.json" },
{ "path": "../plugins/telemetry_collection_xpack/tsconfig.json" },
{ "path": "../plugins/triggers_actions_ui/tsconfig.json" },
Expand Down
2 changes: 2 additions & 0 deletions x-pack/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"plugins/maps/**/*",
"plugins/maps_file_upload/**/*",
"plugins/maps_legacy_licensing/**/*",
"plugins/ml/**/*",
"plugins/observability/**/*",
"plugins/reporting/**/*",
"plugins/searchprofiler/**/*",
Expand Down Expand Up @@ -118,6 +119,7 @@
{ "path": "./plugins/maps_file_upload/tsconfig.json" },
{ "path": "./plugins/maps_legacy_licensing/tsconfig.json" },
{ "path": "./plugins/maps/tsconfig.json" },
{ "path": "./plugins/ml/tsconfig.json" },
{ "path": "./plugins/observability/tsconfig.json" },
{ "path": "./plugins/painless_lab/tsconfig.json" },
{ "path": "./plugins/saved_objects_tagging/tsconfig.json" },
Expand Down
1 change: 1 addition & 0 deletions x-pack/tsconfig.refs.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
{ "path": "./plugins/maps_file_upload/tsconfig.json" },
{ "path": "./plugins/maps_legacy_licensing/tsconfig.json" },
{ "path": "./plugins/maps/tsconfig.json" },
{ "path": "./plugins/ml/tsconfig.json" },
{ "path": "./plugins/observability/tsconfig.json" },
{ "path": "./plugins/painless_lab/tsconfig.json" },
{ "path": "./plugins/reporting/tsconfig.json" },
Expand Down