Skip to content

Commit

Permalink
[ML] Migrates ML plugin to TS project ref (#90021) (#90162)
Browse files Browse the repository at this point in the history
* [ML] Migrate ML plugin to TS project ref

* [ML] Adding mocks folder to list of includes

* [ML] Remove duplicates from x-pack tsconfig.refs.json

* [ML] Add file_upload plugin to project references

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
peteharverson and kibanamachine authored Feb 3, 2021
1 parent d13b776 commit 69f07c3
Show file tree
Hide file tree
Showing 11 changed files with 49 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
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

0 comments on commit 69f07c3

Please sign in to comment.