Skip to content

Commit

Permalink
[ML] Migrate ML plugin to TS project ref
Browse files Browse the repository at this point in the history
  • Loading branch information
peteharverson committed Feb 2, 2021
1 parent 7fa30ba commit 52885e3
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 10 deletions.
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
32 changes: 32 additions & 0 deletions x-pack/plugins/ml/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"extends": "../../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
"outDir": "./target/types",
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true
},
"include": [
"common/**/*",
"public/**/*",
"server/**/*",
"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": "../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 @@ -50,6 +50,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 @@ -24,6 +24,7 @@
"plugins/maps/**/*",
"plugins/maps_file_upload/**/*",
"plugins/maps_legacy_licensing/**/*",
"plugins/ml/**/*",
"plugins/reporting/**/*",
"plugins/searchprofiler/**/*",
"plugins/security_solution/cypress/**/*",
Expand Down Expand Up @@ -110,6 +111,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/painless_lab/tsconfig.json" },
{ "path": "./plugins/saved_objects_tagging/tsconfig.json" },
{ "path": "./plugins/searchprofiler/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 @@ -25,6 +25,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/painless_lab/tsconfig.json" },
{ "path": "./plugins/reporting/tsconfig.json" },
{ "path": "./plugins/saved_objects_tagging/tsconfig.json" },
Expand Down

0 comments on commit 52885e3

Please sign in to comment.