From d046e4cabc4efdaa76e030b026fba3df145497ab Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Fri, 31 Jul 2020 13:13:05 +0200 Subject: [PATCH 01/34] bump ts to v4 --- package.json | 4 ++-- packages/kbn-analytics/package.json | 2 +- packages/kbn-config-schema/package.json | 2 +- packages/kbn-dev-utils/package.json | 2 +- packages/kbn-i18n/package.json | 2 +- packages/kbn-monaco/package.json | 2 +- packages/kbn-plugin-helpers/package.json | 2 +- packages/kbn-pm/package.json | 2 +- packages/kbn-release-notes/package.json | 2 +- packages/kbn-telemetry-tools/package.json | 2 +- .../application/utils/use/use_saved_vis_instance.test.ts | 1 + .../plugins/kbn_tp_run_pipeline/package.json | 2 +- test/plugin_functional/plugins/app_link_test/package.json | 2 +- .../plugins/core_app_status/package.json | 2 +- test/plugin_functional/plugins/core_plugin_a/package.json | 2 +- .../plugins/core_plugin_appleave/package.json | 2 +- test/plugin_functional/plugins/core_plugin_b/package.json | 2 +- .../plugins/core_plugin_chromeless/package.json | 2 +- .../plugins/core_plugin_legacy/package.json | 2 +- .../plugins/core_plugin_static_assets/package.json | 2 +- .../plugins/core_provider_plugin/package.json | 2 +- .../plugins/doc_views_plugin/package.json | 2 +- .../plugins/elasticsearch_client_plugin/package.json | 2 +- .../plugin_functional/plugins/index_patterns/package.json | 2 +- .../plugins/kbn_sample_panel_action/package.json | 2 +- test/plugin_functional/plugins/kbn_top_nav/package.json | 2 +- .../plugins/kbn_tp_custom_visualizations/package.json | 2 +- test/plugin_functional/plugins/legacy_plugin/package.json | 2 +- .../plugins/management_test_plugin/package.json | 2 +- .../plugins/rendering_plugin/package.json | 2 +- .../plugins/ui_settings_plugin/package.json | 2 +- x-pack/examples/ui_actions_enhanced_examples/package.json | 2 +- x-pack/package.json | 2 +- .../common/fixtures/plugins/aad/package.json | 2 +- .../fixtures/plugins/actions_simulators/package.json | 2 +- .../common/fixtures/plugins/alerts/package.json | 2 +- .../fixtures/plugins/task_manager_fixture/package.json | 2 +- .../plugins/iframe_embedded/package.json | 2 +- .../fixtures/plugins/alerts/package.json | 2 +- .../plugins/elasticsearch_client/package.json | 2 +- .../plugin_api_integration/plugins/event_log/package.json | 2 +- .../plugins/sample_task_plugin/package.json | 2 +- .../plugins/task_manager_performance/package.json | 2 +- yarn.lock | 8 ++++---- 44 files changed, 48 insertions(+), 47 deletions(-) diff --git a/package.json b/package.json index 880534997cff0..e3bc1b1c07341 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "**/@types/hoist-non-react-statics": "^3.3.1", "**/@types/chai": "^4.2.11", "**/cypress/@types/lodash": "^4.14.155", - "**/typescript": "3.9.5", + "**/typescript": "4.0.0-dev.20200730", "**/graphql-toolkit/lodash": "^4.17.15", "**/hoist-non-react-statics": "^3.3.2", "**/isomorphic-git/**/base64-js": "^1.2.1", @@ -495,7 +495,7 @@ "supertest-as-promised": "^4.0.2", "tape": "^4.13.0", "tree-kill": "^1.2.2", - "typescript": "3.9.5", + "typescript": "4.0.0-dev.20200730", "typings-tester": "^0.3.2", "vinyl-fs": "^3.0.3", "xml2js": "^0.4.22", diff --git a/packages/kbn-analytics/package.json b/packages/kbn-analytics/package.json index bd3f5832b7140..1aec1e34615bf 100644 --- a/packages/kbn-analytics/package.json +++ b/packages/kbn-analytics/package.json @@ -17,6 +17,6 @@ "@babel/cli": "^7.10.1", "@kbn/dev-utils": "1.0.0", "@kbn/babel-preset": "1.0.0", - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/packages/kbn-config-schema/package.json b/packages/kbn-config-schema/package.json index 10b607dcd4312..8469dcce9d3b5 100644 --- a/packages/kbn-config-schema/package.json +++ b/packages/kbn-config-schema/package.json @@ -10,7 +10,7 @@ "kbn:bootstrap": "yarn build" }, "devDependencies": { - "typescript": "3.9.5", + "typescript": "4.0.0-dev.20200730", "tsd": "^0.7.4" }, "peerDependencies": { diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index 83a7a7607816c..89cb1bb394ea3 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -25,7 +25,7 @@ "tslib": "^2.0.0" }, "devDependencies": { - "typescript": "3.9.5", + "typescript": "4.0.0-dev.20200730", "@kbn/expect": "1.0.0", "chance": "1.0.18" } diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index c5da144688c3c..652c58c870ec2 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -21,7 +21,7 @@ "del": "^5.1.0", "getopts": "^2.2.4", "supports-color": "^7.0.0", - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" }, "dependencies": { "intl-format-cache": "^2.1.0", diff --git a/packages/kbn-monaco/package.json b/packages/kbn-monaco/package.json index 3e5a3cd216225..a20f28c4dfd81 100644 --- a/packages/kbn-monaco/package.json +++ b/packages/kbn-monaco/package.json @@ -20,7 +20,7 @@ "del": "^5.1.0", "raw-loader": "3.1.0", "supports-color": "^7.0.0", - "typescript": "3.9.5", + "typescript": "4.0.0-dev.20200730", "webpack": "^4.41.5", "webpack-cli": "^3.3.10" } diff --git a/packages/kbn-plugin-helpers/package.json b/packages/kbn-plugin-helpers/package.json index f370265876df3..3b7ed2c3bbba7 100644 --- a/packages/kbn-plugin-helpers/package.json +++ b/packages/kbn-plugin-helpers/package.json @@ -37,7 +37,7 @@ "@types/through2": "^2.0.35", "@types/through2-map": "^3.0.0", "@types/vinyl": "^2.0.4", - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" }, "peerDependencies": { "@kbn/babel-preset": "1.0.0" diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index 188db0a8321a2..7b97fe93f460d 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -59,7 +59,7 @@ "strip-ansi": "^4.0.0", "strong-log-transformer": "^2.1.0", "tempy": "^0.3.0", - "typescript": "3.9.5", + "typescript": "4.0.0-dev.20200730", "unlazy-loader": "^0.1.3", "webpack": "^4.41.5", "webpack-cli": "^3.3.10", diff --git a/packages/kbn-release-notes/package.json b/packages/kbn-release-notes/package.json index 25e1816b6cc1e..49b00e6a9be07 100644 --- a/packages/kbn-release-notes/package.json +++ b/packages/kbn-release-notes/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "markdown-it": "^10.0.0", - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } \ No newline at end of file diff --git a/packages/kbn-telemetry-tools/package.json b/packages/kbn-telemetry-tools/package.json index 5593a72ecd965..92e1bcdaea973 100644 --- a/packages/kbn-telemetry-tools/package.json +++ b/packages/kbn-telemetry-tools/package.json @@ -17,6 +17,6 @@ "normalize-path": "^3.0.0", "@types/lodash": "^3.10.1", "moment": "^2.24.0", - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/src/plugins/visualize/public/application/utils/use/use_saved_vis_instance.test.ts b/src/plugins/visualize/public/application/utils/use/use_saved_vis_instance.test.ts index a6b6d8ca0e837..ce0f5fe965d7d 100644 --- a/src/plugins/visualize/public/application/utils/use/use_saved_vis_instance.test.ts +++ b/src/plugins/visualize/public/application/utils/use/use_saved_vis_instance.test.ts @@ -149,6 +149,7 @@ describe('useSavedVisInstance', () => { pathname: VisualizeConstants.CREATE_PATH, search: '?type=area&indexPattern=1a2b3c4d', }; + // @ts-ignore-error delete mockSavedVisInstance.savedVis.id; }); diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json index f3e5520a14fe2..95016e213fdbc 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/app_link_test/package.json b/test/plugin_functional/plugins/app_link_test/package.json index 9ee3527a237d3..941c9d152dac8 100644 --- a/test/plugin_functional/plugins/app_link_test/package.json +++ b/test/plugin_functional/plugins/app_link_test/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/core_app_status/package.json b/test/plugin_functional/plugins/core_app_status/package.json index 1f3e4c0b577f2..3a73ef84116be 100644 --- a/test/plugin_functional/plugins/core_app_status/package.json +++ b/test/plugin_functional/plugins/core_app_status/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/core_plugin_a/package.json b/test/plugin_functional/plugins/core_plugin_a/package.json index fea4d4cd9ac65..c9956932c8db7 100644 --- a/test/plugin_functional/plugins/core_plugin_a/package.json +++ b/test/plugin_functional/plugins/core_plugin_a/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/core_plugin_appleave/package.json b/test/plugin_functional/plugins/core_plugin_appleave/package.json index c80b5659d0167..4539a0a72120a 100644 --- a/test/plugin_functional/plugins/core_plugin_appleave/package.json +++ b/test/plugin_functional/plugins/core_plugin_appleave/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/core_plugin_b/package.json b/test/plugin_functional/plugins/core_plugin_b/package.json index 370776a2e42bb..aea1755343dc6 100644 --- a/test/plugin_functional/plugins/core_plugin_b/package.json +++ b/test/plugin_functional/plugins/core_plugin_b/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/core_plugin_chromeless/package.json b/test/plugin_functional/plugins/core_plugin_chromeless/package.json index e78f9249fb875..7e4d275789c5a 100644 --- a/test/plugin_functional/plugins/core_plugin_chromeless/package.json +++ b/test/plugin_functional/plugins/core_plugin_chromeless/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/core_plugin_legacy/package.json b/test/plugin_functional/plugins/core_plugin_legacy/package.json index 41c311e8d7153..218d71d7cb96d 100644 --- a/test/plugin_functional/plugins/core_plugin_legacy/package.json +++ b/test/plugin_functional/plugins/core_plugin_legacy/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/core_plugin_static_assets/package.json b/test/plugin_functional/plugins/core_plugin_static_assets/package.json index 3de8f7845b1a7..34ebb90bbad27 100644 --- a/test/plugin_functional/plugins/core_plugin_static_assets/package.json +++ b/test/plugin_functional/plugins/core_plugin_static_assets/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/core_provider_plugin/package.json b/test/plugin_functional/plugins/core_provider_plugin/package.json index 061b897cd9eea..643d7f2440591 100644 --- a/test/plugin_functional/plugins/core_provider_plugin/package.json +++ b/test/plugin_functional/plugins/core_provider_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/doc_views_plugin/package.json b/test/plugin_functional/plugins/doc_views_plugin/package.json index 6189ed2e024ab..4bfaa41e691f2 100644 --- a/test/plugin_functional/plugins/doc_views_plugin/package.json +++ b/test/plugin_functional/plugins/doc_views_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json b/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json index 02c2955f26c86..f1a56768f04d2 100644 --- a/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json +++ b/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json @@ -10,6 +10,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/index_patterns/package.json b/test/plugin_functional/plugins/index_patterns/package.json index eaba6ca624bd8..3c74482c1c712 100644 --- a/test/plugin_functional/plugins/index_patterns/package.json +++ b/test/plugin_functional/plugins/index_patterns/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } \ No newline at end of file diff --git a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json index b9c5b3bc5b836..b52cd6d6446d2 100644 --- a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json @@ -16,6 +16,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/kbn_top_nav/package.json b/test/plugin_functional/plugins/kbn_top_nav/package.json index 101593e7258e8..e9416e8419b93 100644 --- a/test/plugin_functional/plugins/kbn_top_nav/package.json +++ b/test/plugin_functional/plugins/kbn_top_nav/package.json @@ -12,7 +12,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json index 95fafdf221c64..5f8c265aa430c 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/legacy_plugin/package.json b/test/plugin_functional/plugins/legacy_plugin/package.json index c8ec7ffac865b..9fbbfeec7e437 100644 --- a/test/plugin_functional/plugins/legacy_plugin/package.json +++ b/test/plugin_functional/plugins/legacy_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/management_test_plugin/package.json b/test/plugin_functional/plugins/management_test_plugin/package.json index d4919970f06e7..f2712a8349987 100644 --- a/test/plugin_functional/plugins/management_test_plugin/package.json +++ b/test/plugin_functional/plugins/management_test_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/rendering_plugin/package.json b/test/plugin_functional/plugins/rendering_plugin/package.json index 5554669758aff..3660de7bc50b3 100644 --- a/test/plugin_functional/plugins/rendering_plugin/package.json +++ b/test/plugin_functional/plugins/rendering_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/test/plugin_functional/plugins/ui_settings_plugin/package.json b/test/plugin_functional/plugins/ui_settings_plugin/package.json index 1c5abcf2a65c2..055d02ab62d86 100644 --- a/test/plugin_functional/plugins/ui_settings_plugin/package.json +++ b/test/plugin_functional/plugins/ui_settings_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/x-pack/examples/ui_actions_enhanced_examples/package.json b/x-pack/examples/ui_actions_enhanced_examples/package.json index 4c8b2a716d98f..def1693e89d53 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/package.json +++ b/x-pack/examples/ui_actions_enhanced_examples/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/x-pack/package.json b/x-pack/package.json index e3104aabbb02b..761c20bf79f39 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -189,7 +189,7 @@ "tmp": "0.1.0", "tree-kill": "^1.2.2", "ts-loader": "^6.0.4", - "typescript": "3.9.5", + "typescript": "4.0.0-dev.20200730", "vinyl-fs": "^3.0.3", "whatwg-fetch": "^3.0.0", "xml-crypto": "^1.4.0", diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json index 50016592ba1ac..696ab843e807f 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json index 84e4783072f31..06c4c1ae223dc 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json index 7796538997de1..202ea952b4a9c 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json index 5b486da23c9e4..5524d9716b4b1 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json b/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json index 9fa1554e5312b..4dce5d1eece7b 100644 --- a/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json +++ b/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json @@ -9,6 +9,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json index 289017d37d634..e41c016f04ae0 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json +++ b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json @@ -10,6 +10,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json b/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json index ed31989472134..501ddf65e7053 100644 --- a/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json +++ b/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json @@ -9,6 +9,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/x-pack/test/plugin_api_integration/plugins/event_log/package.json b/x-pack/test/plugin_api_integration/plugins/event_log/package.json index 92c5fb5f36cfc..1b42c2cf48378 100644 --- a/x-pack/test/plugin_api_integration/plugins/event_log/package.json +++ b/x-pack/test/plugin_api_integration/plugins/event_log/package.json @@ -10,6 +10,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" } } diff --git a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json index f8de67e9c6974..9a32d9bd9f28b 100644 --- a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json +++ b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" }, "license": "Apache-2.0", "dependencies": {} diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json index 2b174a8cae076..4575927576ebd 100644 --- a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json @@ -16,7 +16,7 @@ "pretty-ms": "5.0.0" }, "devDependencies": { - "typescript": "3.9.5" + "typescript": "4.0.0-dev.20200730" }, "license": "Apache-2.0" } diff --git a/yarn.lock b/yarn.lock index 4e9f732f1e0a0..e9e08c85cd220 100644 --- a/yarn.lock +++ b/yarn.lock @@ -30083,10 +30083,10 @@ typescript-tuple@^2.2.1: dependencies: typescript-compare "^0.0.2" -typescript@3.9.5, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.7.2: - version "3.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36" - integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ== +typescript@4.0.0-dev.20200730, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.7.2: + version "4.0.0-dev.20200730" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.0-dev.20200730.tgz#0c1e874cbbfc702c32d9ac261c2f9dc9c37b14c1" + integrity sha512-bqw862eRy5niIZgCJTmn9DqkHTPoCF2eLlLA6jmOvubOgN8BNQrsaf+fE4PQkhzk9ae1/T9iAmDhapgmwWMHIA== typings-tester@^0.3.2: version "0.3.2" From 50ca66b9319fcd9f29a171de7172ca1e180f92ec Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Fri, 31 Jul 2020 13:13:30 +0200 Subject: [PATCH 02/34] MOAR RAM --- src/dev/typescript/run_type_check_cli.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/typescript/run_type_check_cli.ts b/src/dev/typescript/run_type_check_cli.ts index 5d4cf14c1cd95..9eeaeb4da7042 100644 --- a/src/dev/typescript/run_type_check_cli.ts +++ b/src/dev/typescript/run_type_check_cli.ts @@ -88,7 +88,7 @@ export function runTypeCheckCli() { } execInProjects(log, projects, process.execPath, (project) => [ - ...(project.name.startsWith('x-pack') ? ['--max-old-space-size=4096'] : []), + '--max-old-space-size=4096', require.resolve('typescript/bin/tsc'), ...['--project', project.tsConfigPath], ...tscArgs, From 3890f8e2475956b8dad96202540d696782507161 Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Fri, 31 Jul 2020 13:17:14 +0200 Subject: [PATCH 03/34] fix type errors for OSS --- .../public/management_app/advanced_settings.tsx | 2 +- src/plugins/dashboard/common/bwc/types.ts | 2 +- .../public/application/dashboard_app_controller.tsx | 1 + src/plugins/data/common/es_query/kuery/ast/ast.test.ts | 4 +++- src/plugins/kibana_react/public/context/context.test.tsx | 4 ++-- .../server/collectors/ops_stats/ops_stats_collector.ts | 2 ++ src/plugins/share/public/types.ts | 2 +- .../vis_default_editor/public/components/agg_select.tsx | 6 ++++-- .../public/components/controls/date_ranges.tsx | 3 ++- .../public/components/controls/filter.tsx | 9 +++++++-- .../public/components/controls/filters.tsx | 5 +++-- .../public/components/controls/precision.tsx | 3 ++- .../public/components/sidebar/sidebar_title.tsx | 3 ++- src/plugins/vis_type_vega/public/data_model/types.ts | 6 +++--- .../vis_type_vega/public/data_model/vega_parser.ts | 4 ++-- .../public/vislib/helpers/point_series/point_series.ts | 1 + .../public/vis_types/react_vis_type.test.ts | 1 + .../public/application/components/visualize_editor.tsx | 2 +- 18 files changed, 39 insertions(+), 21 deletions(-) diff --git a/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx b/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx index d8853015d362a..abfdbaa85efdc 100644 --- a/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx +++ b/src/plugins/advanced_settings/public/management_app/advanced_settings.tsx @@ -228,7 +228,7 @@ export class AdvancedSettingsComponent extends Component< } export const AdvancedSettings = (props: AdvancedSettingsProps) => { - const { query } = useParams(); + const { query } = useParams<{ query: string }>(); return ( { expect(toElasticsearchQuery((null as unknown) as KueryNode, undefined)).toEqual(expected); const noTypeNode = nodeTypes.function.buildNode('exists', 'foo'); + + // @ts-expect-error delete noTypeNode.type; expect(toElasticsearchQuery(noTypeNode)).toEqual(expected); const unknownTypeNode = nodeTypes.function.buildNode('exists', 'foo'); - // @ts-ignore + // @ts-expect-error unknownTypeNode.type = 'notValid'; expect(toElasticsearchQuery(unknownTypeNode)).toEqual(expected); }); diff --git a/src/plugins/kibana_react/public/context/context.test.tsx b/src/plugins/kibana_react/public/context/context.test.tsx index 4008daf69f25d..a873d1cc2ce30 100644 --- a/src/plugins/kibana_react/public/context/context.test.tsx +++ b/src/plugins/kibana_react/public/context/context.test.tsx @@ -122,7 +122,7 @@ test(' provider provides default kibana-react context', ( test(' can set custom services in context', () => { const Test: React.FC = () => { - const { services } = useKibana(); + const { services } = useKibana<{ test: string }>(); expect(services.test).toBe('quux'); return null; }; @@ -137,7 +137,7 @@ test(' can set custom services in context', () => { test('nested override and merge services', () => { const Test: React.FC = () => { - const { services } = useKibana(); + const { services } = useKibana<{ foo: string; bar: string; baz: string }>(); expect(services.foo).toBe('foo2'); expect(services.bar).toBe('bar'); expect(services.baz).toBe('baz3'); diff --git a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts index df9d6eb146eab..6e8b71d675f7b 100644 --- a/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts +++ b/src/plugins/kibana_usage_collection/server/collectors/ops_stats/ops_stats_collector.ts @@ -43,11 +43,13 @@ export function getOpsStatsCollector( metrics$.subscribe((_metrics) => { const metrics = cloneDeep(_metrics); // Ensure we only include the same data that Metricbeat collection would get + // @ts-expect-error delete metrics.process.pid; const responseTimes = { average: metrics.response_times.avg_in_millis, max: metrics.response_times.max_in_millis, }; + // @ts-expect-error delete metrics.requests.statusCodes; lastMetrics = { ...metrics, diff --git a/src/plugins/share/public/types.ts b/src/plugins/share/public/types.ts index 8dda9f1195a39..9dcfc3d9e8143 100644 --- a/src/plugins/share/public/types.ts +++ b/src/plugins/share/public/types.ts @@ -55,7 +55,7 @@ export interface ShareContext { * */ export interface ShareContextMenuPanelItem extends Omit { name: string; // EUI will accept a `ReactNode` for the `name` prop, but `ShareContentMenu` assumes a `string`. - sortOrder: number; + sortOrder?: number; } /** diff --git a/src/plugins/vis_default_editor/public/components/agg_select.tsx b/src/plugins/vis_default_editor/public/components/agg_select.tsx index 8d03940a92d34..64572eafe9989 100644 --- a/src/plugins/vis_default_editor/public/components/agg_select.tsx +++ b/src/plugins/vis_default_editor/public/components/agg_select.tsx @@ -22,8 +22,9 @@ import React, { useEffect, useCallback, useState } from 'react'; import { EuiComboBox, EuiComboBoxOptionOption, EuiFormRow, EuiLink, EuiText } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n/react'; - import { IAggType, IndexPattern } from 'src/plugins/data/public'; + +import { DocLinksStart } from '../../../../core/public'; import { useKibana } from '../../../kibana_react/public'; import { ComboBoxGroupedOptions } from '../utils'; import { AGG_TYPE_ACTION_KEYS, AggTypeAction } from './agg_params_state'; @@ -52,7 +53,7 @@ function DefaultEditorAggSelect({ onChangeAggType, }: DefaultEditorAggSelectProps) { const [isDirty, setIsDirty] = useState(false); - const { services } = useKibana(); + const { services } = useKibana<{ docLinks: DocLinksStart }>(); const selectedOptions: ComboBoxGroupedOptions = value ? [{ label: value.title, target: value }] : []; @@ -71,6 +72,7 @@ function DefaultEditorAggSelect({ let aggHelpLink: string | undefined; if (has(value, 'name')) { + // @ts-expect-error aggHelpLink = services.docLinks.links.aggs[value.name]; } diff --git a/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx b/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx index d3cf87c9ef14a..4afc85ba3b5c2 100644 --- a/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/date_ranges.tsx @@ -37,6 +37,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; import { isEqual, omit } from 'lodash'; import { useMount } from 'react-use'; +import { DocLinksStart } from 'src/core/public'; import { useKibana } from '../../../../kibana_react/public'; import { AggParamEditorProps } from '../agg_param_props'; @@ -67,7 +68,7 @@ function DateRangesParamEditor({ setValue, setValidity, }: AggParamEditorProps) { - const { services } = useKibana(); + const { services } = useKibana<{ docLinks: DocLinksStart }>(); const [ranges, setRanges] = useState(() => value.map((range) => ({ ...range, id: generateId() })) ); diff --git a/src/plugins/vis_default_editor/public/components/controls/filter.tsx b/src/plugins/vis_default_editor/public/components/controls/filter.tsx index 94fd2d9bc9151..101ca3e8ad457 100644 --- a/src/plugins/vis_default_editor/public/components/controls/filter.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/filter.tsx @@ -21,7 +21,12 @@ import React, { useState } from 'react'; import { EuiForm, EuiButtonIcon, EuiFieldText, EuiFormRow, EuiSpacer } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { IAggConfig, Query, QueryStringInput } from '../../../../data/public'; +import { + IAggConfig, + Query, + QueryStringInput, + DataPublicPluginStart, +} from '../../../../data/public'; import { useKibana } from '../../../../kibana_react/public'; interface FilterRowProps { @@ -49,7 +54,7 @@ function FilterRow({ onChangeValue, onRemoveFilter, }: FilterRowProps) { - const { services } = useKibana(); + const { services } = useKibana<{ data: DataPublicPluginStart; appName: string }>(); const [showCustomLabel, setShowCustomLabel] = useState(false); const filterLabel = i18n.translate('visDefaultEditor.controls.filters.filterLabel', { defaultMessage: 'Filter {index}', diff --git a/src/plugins/vis_default_editor/public/components/controls/filters.tsx b/src/plugins/vis_default_editor/public/components/controls/filters.tsx index fc676e25ff6d7..b2e6373edfc10 100644 --- a/src/plugins/vis_default_editor/public/components/controls/filters.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/filters.tsx @@ -23,7 +23,8 @@ import { htmlIdGenerator, EuiButton, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { useMount } from 'react-use'; -import { Query } from '../../../../data/public'; +import { Query, DataPublicPluginStart } from '../../../../data/public'; +import { IUiSettingsClient } from '../../../../../core/public'; import { useKibana } from '../../../../kibana_react/public'; import { FilterRow } from './filter'; import { AggParamEditorProps } from '../agg_param_props'; @@ -64,7 +65,7 @@ function FiltersParamEditor({ agg, value = [], setValue }: AggParamEditorProps(); const onAddFilter = () => updateFilters([ diff --git a/src/plugins/vis_default_editor/public/components/controls/precision.tsx b/src/plugins/vis_default_editor/public/components/controls/precision.tsx index ad2011513b171..1826c0ac4b9e6 100644 --- a/src/plugins/vis_default_editor/public/components/controls/precision.tsx +++ b/src/plugins/vis_default_editor/public/components/controls/precision.tsx @@ -21,12 +21,13 @@ import React from 'react'; import { EuiRange, EuiFormRow } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; +import { IUiSettingsClient } from '../../../../../core/public'; import { useKibana } from '../../../../kibana_react/public'; import { AggParamEditorProps } from '../agg_param_props'; function PrecisionParamEditor({ agg, value, setValue }: AggParamEditorProps) { - const { services } = useKibana(); + const { services } = useKibana<{ uiSettings: IUiSettingsClient }>(); const label = i18n.translate('visDefaultEditor.controls.precisionLabel', { defaultMessage: 'Precision', }); diff --git a/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx b/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx index 11ceb5885dd31..4889e6ca049ca 100644 --- a/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx +++ b/src/plugins/vis_default_editor/public/components/sidebar/sidebar_title.tsx @@ -37,6 +37,7 @@ import { i18n } from '@kbn/i18n'; import { Vis } from 'src/plugins/visualizations/public'; import { SavedObject } from 'src/plugins/saved_objects/public'; +import { ApplicationStart } from '../../../../../core/public'; import { useKibana } from '../../../../kibana_react/public'; interface LinkedSearchProps { @@ -55,7 +56,7 @@ export function LinkedSearch({ savedSearch, eventEmitter }: LinkedSearchProps) { const [showPopover, setShowPopover] = useState(false); const { services: { application }, - } = useKibana(); + } = useKibana<{ application: ApplicationStart }>(); const closePopover = useCallback(() => setShowPopover(false), []); const onClickButtonLink = useCallback(() => setShowPopover((v) => !v), []); diff --git a/src/plugins/vis_type_vega/public/data_model/types.ts b/src/plugins/vis_type_vega/public/data_model/types.ts index b830b24c92082..14848bf5e8739 100644 --- a/src/plugins/vis_type_vega/public/data_model/types.ts +++ b/src/plugins/vis_type_vega/public/data_model/types.ts @@ -63,7 +63,7 @@ interface Mark { type Renderer = 'svg' | 'canvas'; interface VegaSpecConfig extends KibanaConfig { - kibana: KibanaConfig; + kibana?: KibanaConfig; padding: Padding; projection: Projection; autosize: AutoSize; @@ -103,8 +103,8 @@ export interface VegaSpec { encoding?: Encoding; mark?: string; title?: string; - autosize: AutoSize; - projections: Projection[]; + autosize?: AutoSize; + projections?: Projection[]; width?: number; height?: number; padding?: number | Padding; diff --git a/src/plugins/vis_type_vega/public/data_model/vega_parser.ts b/src/plugins/vis_type_vega/public/data_model/vega_parser.ts index c867523d2b3b3..4c8d439b260e2 100644 --- a/src/plugins/vis_type_vega/public/data_model/vega_parser.ts +++ b/src/plugins/vis_type_vega/public/data_model/vega_parser.ts @@ -225,13 +225,13 @@ export class VegaParser { // and will be automatically updated on resize events. // We delete width & height if the autosize is set to "fit" // We also set useResize=true in case autosize=none, and width & height are not set - const autosize = this.spec.autosize.type || this.spec.autosize; + const autosize = this.spec.autosize?.type || this.spec.autosize; if (autosize === 'fit' || (autosize === 'none' && !this.spec.width && !this.spec.height)) { this.useResize = true; } } - if (this.useResize && this.spec.padding && this.spec.autosize.contains !== 'padding') { + if (this.useResize && this.spec.padding && this.spec.autosize?.contains !== 'padding') { if (typeof this.spec.padding === 'object') { this.paddingWidth += (+this.spec.padding.left || 0) + (+this.spec.padding.right || 0); this.paddingHeight += (+this.spec.padding.top || 0) + (+this.spec.padding.bottom || 0); diff --git a/src/plugins/vis_type_vislib/public/vislib/helpers/point_series/point_series.ts b/src/plugins/vis_type_vislib/public/vislib/helpers/point_series/point_series.ts index a1681e0d71bd3..4ba3101d34898 100644 --- a/src/plugins/vis_type_vislib/public/vislib/helpers/point_series/point_series.ts +++ b/src/plugins/vis_type_vislib/public/vislib/helpers/point_series/point_series.ts @@ -113,6 +113,7 @@ export const buildPointSeriesData = (table: Table, dimensions: Dimensions) => { chart.series = getSeries(table, chart); + // @ts-expect-error delete chart.aspects; return chart; }; diff --git a/src/plugins/visualizations/public/vis_types/react_vis_type.test.ts b/src/plugins/visualizations/public/vis_types/react_vis_type.test.ts index 134106bb3d42a..ecdac06c915fd 100644 --- a/src/plugins/visualizations/public/vis_types/react_vis_type.test.ts +++ b/src/plugins/visualizations/public/vis_types/react_vis_type.test.ts @@ -33,6 +33,7 @@ describe('React Vis Type', () => { it('should throw if component is not set', () => { expect(() => { const missingConfig = cloneDeep(visConfig); + // @ts-expect-error TS knows it's a required property delete missingConfig.visConfig.component; new ReactVisType(missingConfig); }).toThrow(); diff --git a/src/plugins/visualize/public/application/components/visualize_editor.tsx b/src/plugins/visualize/public/application/components/visualize_editor.tsx index 516dcacfe5813..eea4b720cb782 100644 --- a/src/plugins/visualize/public/application/components/visualize_editor.tsx +++ b/src/plugins/visualize/public/application/components/visualize_editor.tsx @@ -37,7 +37,7 @@ import { ExperimentalVisInfo } from './experimental_vis_info'; import { VisualizeTopNav } from './visualize_top_nav'; export const VisualizeEditor = () => { - const { id: visualizationIdFromUrl } = useParams(); + const { id: visualizationIdFromUrl } = useParams<{ id: string }>(); const [originatingApp, setOriginatingApp] = useState(); const { services } = useKibana(); const [eventEmitter] = useState(new EventEmitter()); From 095b3c8a950ed4b8aa7c999873cdca199b1f2e49 Mon Sep 17 00:00:00 2001 From: restrry Date: Fri, 31 Jul 2020 14:03:38 +0200 Subject: [PATCH 04/34] first pass on x-pack errors --- .../subscription_splash_content.tsx | 3 +- .../lists/public/exceptions/api.test.ts | 11 ++++++++ .../request/update_rules_bulk_schema.test.ts | 5 ++++ .../schemas/response/error_schema.test.ts | 1 + .../response/find_rules_schema.test.ts | 1 + .../schemas/types/lists.test.ts | 2 ++ .../components/user_action_tree/index.tsx | 2 +- .../user_action_tree/user_action_title.tsx | 2 +- .../common/hooks/endpoint/ingest_enabled.ts | 10 +++---- .../public/network/pages/network.tsx | 2 +- .../public/timelines/pages/timelines_page.tsx | 2 +- .../timelines/store/timeline/reducer.test.ts | 1 + .../notifications/read_notifications.test.ts | 1 + .../routes/rules/import_rules_route.test.ts | 2 ++ .../routes/rules/validate.test.ts | 3 ++ .../signals/build_bulk_body.test.ts | 4 +++ .../transform_list/expanded_row.tsx | 6 ++-- .../alerts/uptime_alerts_context_provider.tsx | 28 +++++++++++++++++-- .../overview/kuery_bar/kuery_bar.tsx | 3 +- .../__tests__/monitor_list_drawer.test.tsx | 1 + .../uptime/public/hooks/use_monitor.ts | 2 +- .../__tests__/get_infra_href.test.ts | 3 ++ .../__tests__/get_logging_href.test.ts | 3 ++ 23 files changed, 82 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/subscription_splash_content.tsx b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/subscription_splash_content.tsx index e0e293b1cc3e7..5fa8c604a9802 100644 --- a/x-pack/plugins/infra/public/components/logging/log_analysis_setup/subscription_splash_content.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_analysis_setup/subscription_splash_content.tsx @@ -20,6 +20,7 @@ import { EuiImage, } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; +import { HttpStart } from 'src/core/public'; import { LoadingPage } from '../../loading_page'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; @@ -27,7 +28,7 @@ import { euiStyled } from '../../../../../observability/public'; import { useTrialStatus } from '../../../hooks/use_trial_status'; export const SubscriptionSplashContent: React.FC = () => { - const { services } = useKibana(); + const { services } = useKibana<{ http: HttpStart }>(); const { loadState, isTrialAvailable, checkTrialAvailability } = useTrialStatus(); useEffect(() => { diff --git a/x-pack/plugins/lists/public/exceptions/api.test.ts b/x-pack/plugins/lists/public/exceptions/api.test.ts index 9add15c533d14..ba9c1db5af0a5 100644 --- a/x-pack/plugins/lists/public/exceptions/api.test.ts +++ b/x-pack/plugins/lists/public/exceptions/api.test.ts @@ -100,6 +100,7 @@ describe('Exceptions Lists API', () => { test('it returns error if response payload fails decode', async () => { const payload = getCreateExceptionListSchemaMock(); const badPayload = getExceptionListSchemaMock(); + // @ts-expect-error delete badPayload.id; fetchMock.mockResolvedValue(badPayload); @@ -162,6 +163,7 @@ describe('Exceptions Lists API', () => { test('it returns error if response payload fails decode', async () => { const payload = getCreateExceptionListItemSchemaMock(); const badPayload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete badPayload.id; fetchMock.mockResolvedValue(badPayload); @@ -209,6 +211,7 @@ describe('Exceptions Lists API', () => { test('it returns error and does not make request if request payload fails decode', async () => { const payload = getUpdateExceptionListSchemaMock(); + // @ts-expect-error delete payload.description; await expect( @@ -223,6 +226,7 @@ describe('Exceptions Lists API', () => { test('it returns error if response payload fails decode', async () => { const payload = getUpdateExceptionListSchemaMock(); const badPayload = getExceptionListSchemaMock(); + // @ts-expect-error delete badPayload.id; fetchMock.mockResolvedValue(badPayload); @@ -270,6 +274,7 @@ describe('Exceptions Lists API', () => { test('it returns error and does not make request if request payload fails decode', async () => { const payload = getUpdateExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.description; await expect( @@ -284,6 +289,7 @@ describe('Exceptions Lists API', () => { test('it returns error if response payload fails decode', async () => { const payload = getUpdateExceptionListItemSchemaMock(); const badPayload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete badPayload.id; fetchMock.mockResolvedValue(badPayload); @@ -344,6 +350,7 @@ describe('Exceptions Lists API', () => { test('it returns error if response payload fails decode', async () => { const badPayload = getExceptionListSchemaMock(); + // @ts-expect-error delete badPayload.id; fetchMock.mockResolvedValue(badPayload); @@ -548,6 +555,7 @@ describe('Exceptions Lists API', () => { test('it returns error if response payload fails decode', async () => { const badPayload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete badPayload.id; fetchMock.mockResolvedValue(badPayload); @@ -616,6 +624,7 @@ describe('Exceptions Lists API', () => { test('it returns error if response payload fails decode', async () => { const badPayload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete badPayload.id; fetchMock.mockResolvedValue(badPayload); @@ -677,6 +686,7 @@ describe('Exceptions Lists API', () => { test('it returns error if response payload fails decode', async () => { const badPayload = getExceptionListSchemaMock(); + // @ts-expect-error delete badPayload.id; fetchMock.mockResolvedValue(badPayload); @@ -738,6 +748,7 @@ describe('Exceptions Lists API', () => { test('it returns error if response payload fails decode', async () => { const badPayload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete badPayload.id; fetchMock.mockResolvedValue(badPayload); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_bulk_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_bulk_schema.test.ts index 4cb38889045fc..859d3409fd900 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_bulk_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/update_rules_bulk_schema.test.ts @@ -69,6 +69,7 @@ describe('update_rules_bulk_schema', () => { test('single array element with a missing value (risk_score) will not validate', () => { const singleItem = getUpdateRulesSchemaMock(); + // @ts-expect-error delete singleItem.risk_score; const payload: UpdateRulesBulkSchema = [singleItem]; @@ -84,6 +85,7 @@ describe('update_rules_bulk_schema', () => { test('two array elements where the first is valid but the second is invalid (risk_score) will not validate', () => { const singleItem = getUpdateRulesSchemaMock(); const secondItem = getUpdateRulesSchemaMock(); + // @ts-expect-error delete secondItem.risk_score; const payload: UpdateRulesBulkSchema = [singleItem, secondItem]; @@ -99,6 +101,7 @@ describe('update_rules_bulk_schema', () => { test('two array elements where the first is invalid (risk_score) but the second is valid will not validate', () => { const singleItem = getUpdateRulesSchemaMock(); const secondItem = getUpdateRulesSchemaMock(); + // @ts-expect-error delete singleItem.risk_score; const payload: UpdateRulesBulkSchema = [singleItem, secondItem]; @@ -114,7 +117,9 @@ describe('update_rules_bulk_schema', () => { test('two array elements where both are invalid (risk_score) will not validate', () => { const singleItem = getUpdateRulesSchemaMock(); const secondItem = getUpdateRulesSchemaMock(); + // @ts-expect-error delete singleItem.risk_score; + // @ts-expect-error delete secondItem.risk_score; const payload: UpdateRulesBulkSchema = [singleItem, secondItem]; diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts index d9e16105351bd..460ea0584cc3d 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/error_schema.test.ts @@ -47,6 +47,7 @@ describe('error_schema', () => { test('it should NOT validate an error when it has required elements deleted from it', () => { const error = getErrorSchemaMock(); + // @ts-expect-error delete error.error; const decoded = errorSchema.decode(error); const checked = exactCheck(error, decoded); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts index fc1ab9b87795d..73ba2347ddc4a 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts @@ -65,6 +65,7 @@ describe('find_rules_schema', () => { test('it should invalidate a typical single find rules response if the rule is missing a required field such as name', () => { const payload = getFindRulesSchemaMock(); const invalidRule = getRulesSchemaMock(); + // @ts-expect-error delete invalidRule.name; payload.data = [invalidRule]; const decoded = findRulesSchema.decode(payload); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists.test.ts index 7a2c167bfd855..d7cda0790bda5 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/types/lists.test.ts @@ -41,6 +41,7 @@ describe('Lists', () => { test('it should NOT validate a list without an "id"', () => { const payload = getListMock(); + // @ts-expect-error delete payload.id; const decoded = list.decode(payload); const message = pipe(decoded, foldLeftRight); @@ -53,6 +54,7 @@ describe('Lists', () => { test('it should NOT validate a list without "namespace_type"', () => { const payload = getListMock(); + // @ts-expect-error delete payload.namespace_type; const decoded = list.decode(payload); const message = pipe(decoded, foldLeftRight); diff --git a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx index 0c1da8694bf1a..aabfa53cb6ed0 100644 --- a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/index.tsx @@ -56,7 +56,7 @@ export const UserActionTree = React.memo( updateCase, userCanCrud, }: UserActionTreeProps) => { - const { commentId } = useParams(); + const { commentId } = useParams<{ commentId?: string }>(); const handlerTimeoutId = useRef(0); const [initLoading, setInitLoading] = useState(true); const [selectedOutlineCommentId, setSelectedOutlineCommentId] = useState(''); diff --git a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_title.tsx b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_title.tsx index 0bd6100b05df6..9477299e563a8 100644 --- a/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_title.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/user_action_tree/user_action_title.tsx @@ -65,7 +65,7 @@ export const UserActionTitle = ({ updatedAt, username = i18n.UNKNOWN, }: UserActionTitleProps) => { - const { detailName: caseId } = useParams(); + const { detailName: caseId } = useParams<{ detailName: string }>(); const urlSearch = useGetUrlSearch(navTabs.case); const propertyActions = useMemo(() => { return [ diff --git a/x-pack/plugins/security_solution/public/common/hooks/endpoint/ingest_enabled.ts b/x-pack/plugins/security_solution/public/common/hooks/endpoint/ingest_enabled.ts index c201d85a270c0..e48f48e501903 100644 --- a/x-pack/plugins/security_solution/public/common/hooks/endpoint/ingest_enabled.ts +++ b/x-pack/plugins/security_solution/public/common/hooks/endpoint/ingest_enabled.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { ApplicationStart } from 'src/core/public'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; - /** * Returns an object which ingest permissions are allowed */ @@ -15,12 +15,12 @@ export const useIngestEnabledCheck = (): { write: boolean; read: boolean; } => { - const { services } = useKibana(); + const { services } = useKibana<{ application: ApplicationStart }>(); // Check if Ingest Manager is present in the configuration - const show = services.application.capabilities.ingestManager?.show ?? false; - const write = services.application.capabilities.ingestManager?.write ?? false; - const read = services.application.capabilities.ingestManager?.read ?? false; + const show = Boolean(services.application.capabilities.ingestManager?.show); + const write = Boolean(services.application.capabilities.ingestManager?.write); + const read = Boolean(services.application.capabilities.ingestManager?.read); // Check if all Ingest Manager permissions are enabled const allEnabled = show && read && write ? true : false; diff --git a/x-pack/plugins/security_solution/public/network/pages/network.tsx b/x-pack/plugins/security_solution/public/network/pages/network.tsx index f516f2a2de346..2af0cad139288 100644 --- a/x-pack/plugins/security_solution/public/network/pages/network.tsx +++ b/x-pack/plugins/security_solution/public/network/pages/network.tsx @@ -63,7 +63,7 @@ const NetworkComponent = React.memo( const { to, from, setQuery, isInitializing } = useGlobalTime(); const { globalFullScreen } = useFullScreen(); const kibana = useKibana(); - const { tabName } = useParams(); + const { tabName } = useParams<{ tabName: string }>(); const tabsFilters = useMemo(() => { if (tabName === NetworkRouteType.alerts) { diff --git a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx b/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx index b59f9e90f8e74..4f32df121e268 100644 --- a/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx +++ b/x-pack/plugins/security_solution/public/timelines/pages/timelines_page.tsx @@ -33,7 +33,7 @@ const TimelinesContainer = styled.div` export const DEFAULT_SEARCH_RESULTS_PER_PAGE = 10; export const TimelinesPageComponent: React.FC = () => { - const { tabName } = useParams(); + const { tabName } = useParams<{ tabName: string }>(); const [importDataModalToggle, setImportDataModalToggle] = useState(false); const onImportTimelineBtnClick = useCallback(() => { setImportDataModalToggle(true); diff --git a/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts b/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts index 55451882d96fa..45bdbd0979276 100644 --- a/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts +++ b/x-pack/plugins/security_solution/public/timelines/store/timeline/reducer.test.ts @@ -806,6 +806,7 @@ describe('Timeline', () => { }; // temporary, we will have to decouple DataProvider & DataProvidersAnd // that's bigger a refactor than just fixing a bug + // @ts-expect-error delete andProviderToAdd.and; const update = addTimelineProvider({ id: 'foo', diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/read_notifications.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/read_notifications.test.ts index a46f65da58043..672842bd992ad 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/read_notifications.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/notifications/read_notifications.test.ts @@ -41,6 +41,7 @@ describe('read_notifications', () => { }); test('should return null if saved object found by alerts client given id is not alert type', async () => { const result = getNotificationResult(); + // @ts-expect-error delete result.alertTypeId; alertsClient.get.mockResolvedValue(result); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts index f6a903ca9a4ee..81c9387c6f39c 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/import_rules_route.test.ts @@ -233,7 +233,9 @@ describe('import_rules_route', () => { const rulesWithoutRuleIds = ['rule-1', 'rule-2'].map((ruleId) => getImportRulesWithIdSchemaMock(ruleId) ); + // @ts-expect-error delete rulesWithoutRuleIds[0].rule_id; + // @ts-expect-error delete rulesWithoutRuleIds[1].rule_id; const badPayload = buildHapiStream(rulesToNdJsonString(rulesWithoutRuleIds)); const badRequest = getImportRulesRequest(badPayload); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.test.ts index d03dd72937b01..06ec22b2f61b4 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.test.ts @@ -93,6 +93,7 @@ describe('validate', () => { test('it should do an in-validation correctly of a partial alert', () => { const ruleAlert = getResult(); + // @ts-expect-error delete ruleAlert.name; const [validated, errors] = transformValidate(ruleAlert); expect(validated).toEqual(null); @@ -110,6 +111,7 @@ describe('validate', () => { test('it should do an in-validation correctly of a partial alert', () => { const findResult: FindResult = { data: [getResult()], page: 1, perPage: 0, total: 0 }; + // @ts-expect-error delete findResult.page; const [validated, errors] = transformValidateFindAlerts(findResult, []); expect(validated).toEqual(null); @@ -126,6 +128,7 @@ describe('validate', () => { test('it should do an in-validation correctly of a rule id', () => { const ruleAlert = getResult(); + // @ts-expect-error delete ruleAlert.name; const validatedOrError = transformValidateBulkError('rule-1', ruleAlert); const expected: BulkError = { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts index fe2e0f2d96fd8..ee83c826371bc 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/signals/build_bulk_body.test.ts @@ -39,6 +39,7 @@ describe('buildBulkBody', () => { throttle: 'no_actions', }); // Timestamp will potentially always be different so remove it for the test + // @ts-expect-error delete fakeSignalSourceHit['@timestamp']; const expected: Omit & { someKey: 'someValue' } = { someKey: 'someValue', @@ -132,6 +133,7 @@ describe('buildBulkBody', () => { throttle: 'no_actions', }); // Timestamp will potentially always be different so remove it for the test + // @ts-expect-error delete fakeSignalSourceHit['@timestamp']; const expected: Omit & { someKey: 'someValue' } = { someKey: 'someValue', @@ -233,6 +235,7 @@ describe('buildBulkBody', () => { throttle: 'no_actions', }); // Timestamp will potentially always be different so remove it for the test + // @ts-expect-error delete fakeSignalSourceHit['@timestamp']; const expected: Omit & { someKey: 'someValue' } = { someKey: 'someValue', @@ -331,6 +334,7 @@ describe('buildBulkBody', () => { throttle: 'no_actions', }); // Timestamp will potentially always be different so remove it for the test + // @ts-expect-error delete fakeSignalSourceHit['@timestamp']; const expected: Omit & { someKey: 'someValue' } = { someKey: 'someValue', diff --git a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx index 311aed19e0706..15efa46dfb891 100644 --- a/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx +++ b/x-pack/plugins/transform/public/app/sections/transform_management/components/transform_list/expanded_row.tsx @@ -7,7 +7,7 @@ import React, { FC } from 'react'; import { EuiTabbedContent } from '@elastic/eui'; - +import { Optional } from '@kbn/utility-types'; import { i18n } from '@kbn/i18n'; import moment from 'moment-timezone'; @@ -35,8 +35,10 @@ interface Props { item: TransformListRow; } +type StateValues = Optional; + export const ExpandedRow: FC = ({ item }) => { - const stateValues = { ...item.stats }; + const stateValues: StateValues = { ...item.stats }; delete stateValues.stats; delete stateValues.checkpointing; diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/uptime_alerts_context_provider.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/uptime_alerts_context_provider.tsx index d1c6f076d6749..e59c55210c179 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/uptime_alerts_context_provider.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/uptime_alerts_context_provider.tsx @@ -5,9 +5,33 @@ */ import React from 'react'; -import { AlertsContextProvider } from '../../../../../../plugins/triggers_actions_ui/public'; +import { + HttpStart, + NotificationsStart, + IUiSettingsClient, + DocLinksStart, + ApplicationStart, +} from 'src/core/public'; +import { DataPublicPluginStart } from '../../../../../../../src/plugins/data/public'; +import { ChartsPluginStart } from '../../../../../../../src/plugins/charts/public'; +import { + AlertsContextProvider, + TriggersAndActionsUIPublicPluginStart, +} from '../../../../../../plugins/triggers_actions_ui/public'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; +interface KibanaDeps { + http: HttpStart; + notifications: NotificationsStart; + uiSettings: IUiSettingsClient; + docLinks: DocLinksStart; + application: ApplicationStart; + + data: DataPublicPluginStart; + charts: ChartsPluginStart; + triggers_actions_ui: TriggersAndActionsUIPublicPluginStart; +} + export const UptimeAlertsContextProvider: React.FC = ({ children }) => { const { services: { @@ -20,7 +44,7 @@ export const UptimeAlertsContextProvider: React.FC = ({ children }) => { docLinks, application: { capabilities }, }, - } = useKibana(); + } = useKibana(); return ( (); const [state, setState] = useState({ suggestions: [], diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx index 502ccd53ef80c..4b981664cf9ad 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx @@ -58,6 +58,7 @@ describe('MonitorListDrawer component', () => { }); it('renders nothing when no check data is present', () => { + // @ts-expect-error According to the code, the property is optional delete summary.state.summaryPings; const component = shallowWithRouter( diff --git a/x-pack/plugins/uptime/public/hooks/use_monitor.ts b/x-pack/plugins/uptime/public/hooks/use_monitor.ts index 8080ce2696a3c..000e497b29cff 100644 --- a/x-pack/plugins/uptime/public/hooks/use_monitor.ts +++ b/x-pack/plugins/uptime/public/hooks/use_monitor.ts @@ -7,7 +7,7 @@ import { useParams } from 'react-router-dom'; export const useMonitorId = (): string => { - const { monitorId } = useParams(); + const { monitorId } = useParams<{ monitorId: string }>(); // decode 64 base string, it was decoded to make it a valid url, since monitor id can be a url return atob(monitorId || ''); diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts index befa11d74df4a..b1247ad5b8935 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts @@ -79,6 +79,7 @@ describe('getInfraHref', () => { }); it('getInfraContainerHref returns undefined when summaryPings are undefined', () => { + // @ts-expect-error delete summary.state.summaryPings; expect(getInfraContainerHref(summary, '')).toBeUndefined(); }); @@ -125,6 +126,7 @@ describe('getInfraHref', () => { }); it('getInfraKubernetesHref returns undefined when summaryPings are undefined', () => { + // @ts-expect-error delete summary.state.summaryPings; expect(getInfraKubernetesHref(summary, '')).toBeUndefined(); }); @@ -183,6 +185,7 @@ describe('getInfraHref', () => { }); it('getInfraIpHref returns undefined if summaryPings are undefined', () => { + // @ts-expect-error delete summary.state.summaryPings; expect(getInfraIpHref(summary, 'foo')).toBeUndefined(); }); diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts index 203d5b84c433a..d2a7a96a8b6f9 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts @@ -93,6 +93,7 @@ describe('getLoggingHref', () => { }); it('returns undefined if necessary container is not present', () => { + // @ts-expect-error According to the code, the property is optional delete summary.state.summaryPings; expect(getLoggingContainerHref(summary, '')).toBeUndefined(); }); @@ -103,6 +104,7 @@ describe('getLoggingHref', () => { }); it('returns undefined if necessary pod is not present', () => { + // @ts-expect-error According to the code, the property is optional delete summary.state.summaryPings; expect(getLoggingKubernetesHref(summary, '')).toBeUndefined(); }); @@ -113,6 +115,7 @@ describe('getLoggingHref', () => { }); it('returns undefined ip href if ip is not present', () => { + // @ts-expect-error According to the code, the property is optional delete summary.state.summaryPings; expect(getLoggingIpHref(summary, '')).toBeUndefined(); }); From d43af38187edb0a681715a5bbdffbadd367bf9b1 Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 11:55:23 +0200 Subject: [PATCH 05/34] second pass on x-pack type errors --- .../builtin_action_types/lib/send_email.test.ts | 6 ++++++ .../create_endpoint_list_item_schema.test.ts | 4 ++++ .../create_exception_list_item_schema.test.ts | 5 +++++ .../request/export_list_item_query_schema.test.ts | 1 + .../update_endpoint_list_item_schema.test.ts | 4 ++++ .../update_exception_list_item_schema.test.ts | 4 ++++ .../request/update_exception_list_schema.test.ts | 3 +++ .../response/create_endpoint_list_schema.test.ts | 2 ++ .../response/exception_list_item_schema.test.ts | 14 ++++++++++++++ .../schemas/response/exception_list_schema.test.ts | 11 +++++++++++ .../found_exception_list_item_schema.test.ts | 4 ++++ .../response/found_exception_list_schema.test.ts | 4 ++++ .../response/list_item_index_exist_schema.test.ts | 2 ++ .../schemas/response/list_item_schema.test.ts | 8 ++++++++ .../common/schemas/response/list_schema.test.ts | 9 +++++++++ .../common/schemas/types/update_comment.test.ts | 1 + .../types/anomaly_detection_jobs/combined_job.ts | 1 + .../validate_model_memory_limit.test.ts | 1 + .../public/management/roles/roles_api_client.ts | 1 + .../request/add_prepackged_rules_schema.test.ts | 1 + .../request/create_rules_bulk_schema.test.ts | 5 +++++ .../schemas/request/import_rules_schema.test.ts | 1 + .../schemas/response/find_rules_schema.test.ts | 1 + .../response/prepackaged_rules_schema.test.ts | 2 ++ .../prepackaged_rules_status_schema.test.ts | 1 + .../schemas/response/rules_bulk_schema.test.ts | 2 ++ .../public/cases/pages/case_details.tsx | 2 +- .../detection_engine/rules/create/helpers.test.ts | 2 ++ .../pages/detection_engine/rules/details/index.tsx | 2 +- .../pages/detection_engine/rules/edit/index.tsx | 2 +- .../security_solution/public/hosts/pages/hosts.tsx | 2 +- .../pages/policy/view/policy_details.tsx | 2 +- .../lib/detection_engine/rules/read_rules.test.ts | 1 + .../lib/detection_engine/tags/read_tags.test.ts | 1 + .../transform/public/app/common/pivot_group_by.ts | 8 ++------ 35 files changed, 109 insertions(+), 11 deletions(-) diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts index 3514bd4257b0f..0648da8700e60 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts @@ -69,8 +69,11 @@ describe('send_email module', () => { port: 1025, }, }); + // @ts-expect-error delete sendEmailOptions.transport.service; + // @ts-expect-error delete sendEmailOptions.transport.user; + // @ts-expect-error delete sendEmailOptions.transport.password; const result = await sendEmail(mockLogger, sendEmailOptions); expect(result).toBe(sendMailMockResult); @@ -115,8 +118,11 @@ describe('send_email module', () => { secure: true, }, }); + // @ts-expect-error delete sendEmailOptions.transport.service; + // @ts-expect-error delete sendEmailOptions.transport.user; + // @ts-expect-error delete sendEmailOptions.transport.password; const result = await sendEmail(mockLogger, sendEmailOptions); diff --git a/x-pack/plugins/lists/common/schemas/request/create_endpoint_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/create_endpoint_list_item_schema.test.ts index e40a80a0d589d..624de2fb30d17 100644 --- a/x-pack/plugins/lists/common/schemas/request/create_endpoint_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/create_endpoint_list_item_schema.test.ts @@ -31,6 +31,7 @@ describe('create_endpoint_list_item_schema', () => { test('it should fail validation when supplied an undefined for "description"', () => { const payload = getCreateEndpointListItemSchemaMock(); + // @ts-expect-error delete payload.description; const decoded = createEndpointListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -43,6 +44,7 @@ describe('create_endpoint_list_item_schema', () => { test('it should fail validation when supplied an undefined for "name"', () => { const payload = getCreateEndpointListItemSchemaMock(); + // @ts-expect-error delete payload.name; const decoded = createEndpointListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -55,6 +57,7 @@ describe('create_endpoint_list_item_schema', () => { test('it should fail validation when supplied an undefined for "type"', () => { const payload = getCreateEndpointListItemSchemaMock(); + // @ts-expect-error delete payload.type; const decoded = createEndpointListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -145,6 +148,7 @@ describe('create_endpoint_list_item_schema', () => { test('it should fail validation when supplied an undefined for "entries"', () => { const inputPayload = getCreateEndpointListItemSchemaMock(); const outputPayload = getCreateEndpointListItemSchemaMock(); + // @ts-expect-error delete inputPayload.entries; outputPayload.entries = []; const decoded = createEndpointListItemSchema.decode(inputPayload); diff --git a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.test.ts index d2ad69d1ee7b6..4a4c3972dc1e3 100644 --- a/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/create_exception_list_item_schema.test.ts @@ -31,6 +31,7 @@ describe('create_exception_list_item_schema', () => { test('it should fail validation when supplied an undefined for "description"', () => { const payload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.description; const decoded = createExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -43,6 +44,7 @@ describe('create_exception_list_item_schema', () => { test('it should fail validation when supplied an undefined for "name"', () => { const payload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.name; const decoded = createExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -55,6 +57,7 @@ describe('create_exception_list_item_schema', () => { test('it should fail validation when supplied an undefined for "type"', () => { const payload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.type; const decoded = createExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -67,6 +70,7 @@ describe('create_exception_list_item_schema', () => { test('it should fail validation when supplied an undefined for "list_id"', () => { const inputPayload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error delete inputPayload.list_id; const decoded = createExceptionListItemSchema.decode(inputPayload); const checked = exactCheck(inputPayload, decoded); @@ -133,6 +137,7 @@ describe('create_exception_list_item_schema', () => { test('it should fail validation when supplied an undefined for "entries"', () => { const inputPayload = getCreateExceptionListItemSchemaMock(); const outputPayload = getCreateExceptionListItemSchemaMock(); + // @ts-expect-error delete inputPayload.entries; outputPayload.entries = []; const decoded = createExceptionListItemSchema.decode(inputPayload); diff --git a/x-pack/plugins/lists/common/schemas/request/export_list_item_query_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/export_list_item_query_schema.test.ts index cd6f4c1b147db..828544d392a3b 100644 --- a/x-pack/plugins/lists/common/schemas/request/export_list_item_query_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/export_list_item_query_schema.test.ts @@ -28,6 +28,7 @@ describe('export_list_item_schema', () => { test('it should NOT accept an undefined for an id', () => { const payload = getExportListItemQuerySchemaMock(); + // @ts-expect-error delete payload.list_id; const decoded = exportListItemQuerySchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/request/update_endpoint_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/update_endpoint_list_item_schema.test.ts index ecbbb250a88f6..671e38ceb5266 100644 --- a/x-pack/plugins/lists/common/schemas/request/update_endpoint_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/update_endpoint_list_item_schema.test.ts @@ -27,6 +27,7 @@ describe('update_endpoint_list_item_schema', () => { test('it should not accept an undefined for "description"', () => { const payload = getUpdateEndpointListItemSchemaMock(); + // @ts-expect-error delete payload.description; const decoded = updateEndpointListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -39,6 +40,7 @@ describe('update_endpoint_list_item_schema', () => { test('it should not accept an undefined for "name"', () => { const payload = getUpdateEndpointListItemSchemaMock(); + // @ts-expect-error delete payload.name; const decoded = updateEndpointListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -51,6 +53,7 @@ describe('update_endpoint_list_item_schema', () => { test('it should not accept an undefined for "type"', () => { const payload = getUpdateEndpointListItemSchemaMock(); + // @ts-expect-error delete payload.type; const decoded = updateEndpointListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -100,6 +103,7 @@ describe('update_endpoint_list_item_schema', () => { test('it should NOT accept an undefined for "entries"', () => { const inputPayload = getUpdateEndpointListItemSchemaMock(); const outputPayload = getUpdateEndpointListItemSchemaMock(); + // @ts-expect-error delete inputPayload.entries; outputPayload.entries = []; const decoded = updateEndpointListItemSchema.decode(inputPayload); diff --git a/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.test.ts index a49a5552603fd..da320a4983de3 100644 --- a/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/update_exception_list_item_schema.test.ts @@ -27,6 +27,7 @@ describe('update_exception_list_item_schema', () => { test('it should not accept an undefined for "description"', () => { const payload = getUpdateExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.description; const decoded = updateExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -39,6 +40,7 @@ describe('update_exception_list_item_schema', () => { test('it should not accept an undefined for "name"', () => { const payload = getUpdateExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.name; const decoded = updateExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -51,6 +53,7 @@ describe('update_exception_list_item_schema', () => { test('it should not accept an undefined for "type"', () => { const payload = getUpdateExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.type; const decoded = updateExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -100,6 +103,7 @@ describe('update_exception_list_item_schema', () => { test('it should NOT accept an undefined for "entries"', () => { const inputPayload = getUpdateExceptionListItemSchemaMock(); const outputPayload = getUpdateExceptionListItemSchemaMock(); + // @ts-expect-error delete inputPayload.entries; outputPayload.entries = []; const decoded = updateExceptionListItemSchema.decode(inputPayload); diff --git a/x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.test.ts index 650cbd439ad2b..32f114ae34d8e 100644 --- a/x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/update_exception_list_schema.test.ts @@ -27,6 +27,7 @@ describe('update_exception_list_schema', () => { test('it should not accept an undefined for "description"', () => { const payload = getUpdateExceptionListSchemaMock(); + // @ts-expect-error delete payload.description; const decoded = updateExceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -39,6 +40,7 @@ describe('update_exception_list_schema', () => { test('it should not accept an undefined for "name"', () => { const payload = getUpdateExceptionListSchemaMock(); + // @ts-expect-error delete payload.name; const decoded = updateExceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -51,6 +53,7 @@ describe('update_exception_list_schema', () => { test('it should not accept an undefined for "type"', () => { const payload = getUpdateExceptionListSchemaMock(); + // @ts-expect-error delete payload.type; const decoded = updateExceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/create_endpoint_list_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/create_endpoint_list_schema.test.ts index 8c1392109979e..380a1e3a4cfd5 100644 --- a/x-pack/plugins/lists/common/schemas/response/create_endpoint_list_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/create_endpoint_list_schema.test.ts @@ -35,6 +35,7 @@ describe('create_endpoint_list_schema', () => { test('it should NOT accept an undefined for "list_id"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.list_id; const decoded = createEndpointListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -48,6 +49,7 @@ describe('create_endpoint_list_schema', () => { test('it should NOT allow missing fields', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.list_id; const decoded = createEndpointListSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.test.ts index 32b55104e4fdf..58c6ed029a5e8 100644 --- a/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/exception_list_item_schema.test.ts @@ -25,6 +25,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "id"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.id; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -36,6 +37,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "list_id"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.list_id; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -49,6 +51,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "item_id"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.item_id; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -62,6 +65,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "comments"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.comments; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -75,6 +79,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "entries"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.entries; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -88,6 +93,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "name"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.name; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -101,6 +107,7 @@ describe('exception_list_item_schema', () => { test('it should accept an undefined for "namespace_type" and return "single" as a default value for "namespace_type"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.namespace_type; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -112,6 +119,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "description"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.description; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -136,6 +144,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "created_at"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.created_at; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -149,6 +158,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "created_by"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.created_by; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -162,6 +172,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "tie_breaker_id"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.tie_breaker_id; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -175,6 +186,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "type"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.type; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -188,6 +200,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "updated_at"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.updated_at; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -201,6 +214,7 @@ describe('exception_list_item_schema', () => { test('it should NOT accept an undefined for "updated_by"', () => { const payload = getExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.updated_by; const decoded = exceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/exception_list_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/exception_list_schema.test.ts index 1b5ef08b02d5f..934ff070561f6 100644 --- a/x-pack/plugins/lists/common/schemas/response/exception_list_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/exception_list_schema.test.ts @@ -25,6 +25,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "id"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.id; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -36,6 +37,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "list_id"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.list_id; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -49,6 +51,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "name"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.name; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -62,6 +65,7 @@ describe('exception_list_schema', () => { test('it should accept an undefined for "namespace_type" and make "namespace_type" that of "single"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.namespace_type; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -73,6 +77,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "description"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.description; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -97,6 +102,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "created_at"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.created_at; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -110,6 +116,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "created_by"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.created_by; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -123,6 +130,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "tie_breaker_id"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.tie_breaker_id; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -136,6 +144,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "type"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.type; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -149,6 +158,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "updated_at"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.updated_at; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -162,6 +172,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "updated_by"', () => { const payload = getExceptionListSchemaMock(); + // @ts-expect-error delete payload.updated_by; const decoded = exceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.test.ts index 5da3accccd9c2..46fc655614411 100644 --- a/x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/found_exception_list_item_schema.test.ts @@ -87,6 +87,7 @@ describe('found_exception_list_item_schema', () => { test('it should NOT accept an undefined for "page"', () => { const payload = getFoundExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.page; const decoded = foundExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -100,6 +101,7 @@ describe('found_exception_list_item_schema', () => { test('it should NOT accept an undefined for "per_page"', () => { const payload = getFoundExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.per_page; const decoded = foundExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -113,6 +115,7 @@ describe('found_exception_list_item_schema', () => { test('it should NOT accept an undefined for "total"', () => { const payload = getFoundExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.total; const decoded = foundExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -126,6 +129,7 @@ describe('found_exception_list_item_schema', () => { test('it should NOT accept an undefined for "data"', () => { const payload = getFoundExceptionListItemSchemaMock(); + // @ts-expect-error delete payload.data; const decoded = foundExceptionListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.test.ts index d4fa8ee0e3481..c367cec02d58b 100644 --- a/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/found_exception_list_schema.test.ts @@ -84,6 +84,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "page"', () => { const payload = getFoundExceptionListSchemaMock(); + // @ts-expect-error delete payload.page; const decoded = foundExceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -97,6 +98,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "per_page"', () => { const payload = getFoundExceptionListSchemaMock(); + // @ts-expect-error delete payload.per_page; const decoded = foundExceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -110,6 +112,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "total"', () => { const payload = getFoundExceptionListSchemaMock(); + // @ts-expect-error delete payload.total; const decoded = foundExceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -123,6 +126,7 @@ describe('exception_list_schema', () => { test('it should NOT accept an undefined for "data"', () => { const payload = getFoundExceptionListSchemaMock(); + // @ts-expect-error delete payload.data; const decoded = foundExceptionListSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.test.ts index 2b072d8f95cd8..4732da0213934 100644 --- a/x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/list_item_index_exist_schema.test.ts @@ -25,6 +25,7 @@ describe('list_item_index_exist_schema', () => { test('it should NOT accept an undefined for "list_index"', () => { const payload = getListItemIndexExistSchemaResponseMock(); + // @ts-expect-error delete payload.list_index; const decoded = listItemIndexExistSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -38,6 +39,7 @@ describe('list_item_index_exist_schema', () => { test('it should NOT accept an undefined for "list_item_index"', () => { const payload = getListItemIndexExistSchemaResponseMock(); + // @ts-expect-error delete payload.list_item_index; const decoded = listItemIndexExistSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/list_item_schema.test.ts index ec4c8d2c2d1ea..0c6e934163428 100644 --- a/x-pack/plugins/lists/common/schemas/response/list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/list_item_schema.test.ts @@ -25,6 +25,7 @@ describe('list_item_schema', () => { test('it should NOT accept an undefined for "id"', () => { const payload = getListItemResponseMock(); + // @ts-expect-error delete payload.id; const decoded = listItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -36,6 +37,7 @@ describe('list_item_schema', () => { test('it should NOT accept an undefined for "list_id"', () => { const payload = getListItemResponseMock(); + // @ts-expect-error delete payload.list_id; const decoded = listItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -95,6 +97,7 @@ describe('list_item_schema', () => { test('it should NOT accept an undefined for "created_by"', () => { const payload = getListItemResponseMock(); + // @ts-expect-error delete payload.created_by; const decoded = listItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -108,6 +111,7 @@ describe('list_item_schema', () => { test('it should NOT accept an undefined for "tie_breaker_id"', () => { const payload = getListItemResponseMock(); + // @ts-expect-error delete payload.tie_breaker_id; const decoded = listItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -121,6 +125,7 @@ describe('list_item_schema', () => { test('it should NOT accept an undefined for "type"', () => { const payload = getListItemResponseMock(); + // @ts-expect-error delete payload.type; const decoded = listItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -134,6 +139,7 @@ describe('list_item_schema', () => { test('it should NOT accept an undefined for "updated_at"', () => { const payload = getListItemResponseMock(); + // @ts-expect-error delete payload.updated_at; const decoded = listItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -147,6 +153,7 @@ describe('list_item_schema', () => { test('it should NOT accept an undefined for "updated_by"', () => { const payload = getListItemResponseMock(); + // @ts-expect-error delete payload.updated_by; const decoded = listItemSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -160,6 +167,7 @@ describe('list_item_schema', () => { test('it should NOT accept an undefined for "value"', () => { const payload = getListItemResponseMock(); + // @ts-expect-error delete payload.value; const decoded = listItemSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/list_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/list_schema.test.ts index 87e56e5dd95ac..ab1d17b97c57d 100644 --- a/x-pack/plugins/lists/common/schemas/response/list_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/list_schema.test.ts @@ -25,6 +25,7 @@ describe('list_schema', () => { test('it should NOT accept an undefined for "id"', () => { const payload = getListResponseMock(); + // @ts-expect-error delete payload.id; const decoded = listSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -69,6 +70,7 @@ describe('list_schema', () => { test('it should NOT accept an undefined for "created_at"', () => { const payload = getListResponseMock(); + // @ts-expect-error delete payload.created_at; const decoded = listSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -82,6 +84,7 @@ describe('list_schema', () => { test('it should NOT accept an undefined for "created_by"', () => { const payload = getListResponseMock(); + // @ts-expect-error delete payload.created_by; const decoded = listSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -95,6 +98,7 @@ describe('list_schema', () => { test('it should NOT accept an undefined for "tie_breaker_id"', () => { const payload = getListResponseMock(); + // @ts-expect-error delete payload.tie_breaker_id; const decoded = listSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -108,6 +112,7 @@ describe('list_schema', () => { test('it should NOT accept an undefined for "type"', () => { const payload = getListResponseMock(); + // @ts-expect-error delete payload.type; const decoded = listSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -121,6 +126,7 @@ describe('list_schema', () => { test('it should NOT accept an undefined for "updated_at"', () => { const payload = getListResponseMock(); + // @ts-expect-error delete payload.updated_at; const decoded = listSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -134,6 +140,7 @@ describe('list_schema', () => { test('it should NOT accept an undefined for "updated_by"', () => { const payload = getListResponseMock(); + // @ts-expect-error delete payload.updated_by; const decoded = listSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -147,6 +154,7 @@ describe('list_schema', () => { test('it should NOT accept an undefined for "name"', () => { const payload = getListResponseMock(); + // @ts-expect-error delete payload.name; const decoded = listSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -160,6 +168,7 @@ describe('list_schema', () => { test('it should NOT accept an undefined for "description"', () => { const payload = getListResponseMock(); + // @ts-expect-error delete payload.description; const decoded = listSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/types/update_comment.test.ts b/x-pack/plugins/lists/common/schemas/types/update_comment.test.ts index ac4d0304cbb8e..97dd358a2a00f 100644 --- a/x-pack/plugins/lists/common/schemas/types/update_comment.test.ts +++ b/x-pack/plugins/lists/common/schemas/types/update_comment.test.ts @@ -32,6 +32,7 @@ describe('CommentsUpdate', () => { test('it should fail validation when supplied an undefined for "comment"', () => { const payload = getUpdateCommentMock(); + // @ts-expect-error delete payload.comment; const decoded = updateComment.decode(payload); const message = pipe(decoded, foldLeftRight); diff --git a/x-pack/plugins/ml/common/types/anomaly_detection_jobs/combined_job.ts b/x-pack/plugins/ml/common/types/anomaly_detection_jobs/combined_job.ts index 6df7643c5221f..42dee46e71fd6 100644 --- a/x-pack/plugins/ml/common/types/anomaly_detection_jobs/combined_job.ts +++ b/x-pack/plugins/ml/common/types/anomaly_detection_jobs/combined_job.ts @@ -29,6 +29,7 @@ export function expandCombinedJobConfig(combinedJob: CombinedJob) { const combinedJobClone = cloneDeep(combinedJob); const job = combinedJobClone; const datafeed = combinedJobClone.datafeed_config; + // @ts-expect-error delete job.datafeed_config; return { job, datafeed }; diff --git a/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.test.ts b/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.test.ts index 61af960847f7f..6ffb0e320982b 100644 --- a/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.test.ts +++ b/x-pack/plugins/ml/server/models/job_validation/validate_model_memory_limit.test.ts @@ -208,6 +208,7 @@ describe('ML - validateModelMemoryLimit', () => { const dtrs = createDetectors(2); const job = getJobConfig(['instance'], dtrs); const duration = { start: 0, end: 1 }; + // @ts-expect-error delete mlInfoResponse.limits.max_model_memory_limit; // @ts-expect-error job.analysis_limits.model_memory_limit = '10mb'; diff --git a/x-pack/plugins/security/public/management/roles/roles_api_client.ts b/x-pack/plugins/security/public/management/roles/roles_api_client.ts index 50c490d2924ba..444f1eaaaf364 100644 --- a/x-pack/plugins/security/public/management/roles/roles_api_client.ts +++ b/x-pack/plugins/security/public/management/roles/roles_api_client.ts @@ -52,6 +52,7 @@ export class RolesAPIClient { } }); + // @ts-expect-error delete role.name; delete role.transient_metadata; delete role._unrecognized_applications; diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/add_prepackged_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/add_prepackged_rules_schema.test.ts index 3cad48ec18fc1..bcd8981219122 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/add_prepackged_rules_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/add_prepackged_rules_schema.test.ts @@ -618,6 +618,7 @@ describe('add prepackaged rules schema', () => { test('rule_id is required', () => { const payload: AddPrepackagedRulesSchema = getAddPrepackagedRulesSchemaMock(); + // @ts-expect-error delete payload.rule_id; const decoded = addPrepackagedRulesSchema.decode(payload); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_bulk_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_bulk_schema.test.ts index 00854f1ed5526..e8fc890a28a52 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_bulk_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/create_rules_bulk_schema.test.ts @@ -73,6 +73,7 @@ describe('create_rules_bulk_schema', () => { test('single array element with a missing value (risk_score) will not validate', () => { const singleItem = getCreateRulesSchemaMock(); + // @ts-expect-error delete singleItem.risk_score; const payload: CreateRulesBulkSchema = [singleItem]; @@ -88,6 +89,7 @@ describe('create_rules_bulk_schema', () => { test('two array elements where the first is valid but the second is invalid (risk_score) will not validate', () => { const singleItem = getCreateRulesSchemaMock(); const secondItem = getCreateRulesSchemaMock(); + // @ts-expect-error delete secondItem.risk_score; const payload: CreateRulesBulkSchema = [singleItem, secondItem]; @@ -103,6 +105,7 @@ describe('create_rules_bulk_schema', () => { test('two array elements where the first is invalid (risk_score) but the second is valid will not validate', () => { const singleItem = getCreateRulesSchemaMock(); const secondItem = getCreateRulesSchemaMock(); + // @ts-expect-error delete singleItem.risk_score; const payload: CreateRulesBulkSchema = [singleItem, secondItem]; @@ -118,7 +121,9 @@ describe('create_rules_bulk_schema', () => { test('two array elements where both are invalid (risk_score) will not validate', () => { const singleItem = getCreateRulesSchemaMock(); const secondItem = getCreateRulesSchemaMock(); + // @ts-expect-error delete singleItem.risk_score; + // @ts-expect-error delete secondItem.risk_score; const payload: CreateRulesBulkSchema = [singleItem, secondItem]; diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_schema.test.ts index 00a3f2126f44a..d40c4fd2e8bc8 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/request/import_rules_schema.test.ts @@ -1177,6 +1177,7 @@ describe('import rules schema', () => { ...getImportRulesSchemaMock(), id: 'c4e80a0d-e20f-4efc-84c1-08112da5a612', }; + // @ts-expect-error delete payload.rule_id; const decoded = importRulesSchema.decode(payload); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts index 73ba2347ddc4a..4db1e081c5610 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/find_rules_schema.test.ts @@ -80,6 +80,7 @@ describe('find_rules_schema', () => { test('it should invalidate a typical single find rules response if it is missing perPage', () => { const payload = getFindRulesSchemaMock(); + // @ts-expect-error delete payload.perPage; const decoded = findRulesSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_schema.test.ts index 61d3ede852ee1..f5c1a51b633cc 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_schema.test.ts @@ -86,6 +86,7 @@ describe('prepackaged_rules_schema', () => { timelines_installed: 0, timelines_updated: 0, }; + // @ts-expect-error delete payload.rules_installed; const decoded = prePackagedRulesAndTimelinesSchema.decode(payload); const checked = exactCheck(payload, decoded); @@ -104,6 +105,7 @@ describe('prepackaged_rules_schema', () => { timelines_installed: 0, timelines_updated: 0, }; + // @ts-expect-error delete payload.rules_updated; const decoded = prePackagedRulesAndTimelinesSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_status_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_status_schema.test.ts index 09cb7148fe90a..7931f1c7eca51 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_status_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/prepackaged_rules_status_schema.test.ts @@ -141,6 +141,7 @@ describe('prepackaged_rules_schema', () => { timelines_not_installed: 0, timelines_not_updated: 0, }; + // @ts-expect-error delete payload.rules_installed; const decoded = prePackagedRulesAndTimelinesStatusSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts index a169ac3deb9b9..3541fed7458e2 100644 --- a/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts +++ b/x-pack/plugins/security_solution/common/detection_engine/schemas/response/rules_bulk_schema.test.ts @@ -49,6 +49,7 @@ describe('prepackaged_rule_schema', () => { test('it should NOT validate a rule with a deleted value', () => { const rule = getRulesSchemaMock(); + // @ts-expect-error delete rule.name; const payload: RulesBulkSchema = [rule]; const decoded = rulesBulkSchema.decode(payload); @@ -64,6 +65,7 @@ describe('prepackaged_rule_schema', () => { test('it should NOT validate an invalid error message with a deleted value', () => { const error = getErrorSchemaMock('fake id'); + // @ts-expect-error delete error.error; const payload: RulesBulkSchema = [error]; const decoded = rulesBulkSchema.decode(payload); diff --git a/x-pack/plugins/security_solution/public/cases/pages/case_details.tsx b/x-pack/plugins/security_solution/public/cases/pages/case_details.tsx index c3538f0c18ed5..0d41e22719bba 100644 --- a/x-pack/plugins/security_solution/public/cases/pages/case_details.tsx +++ b/x-pack/plugins/security_solution/public/cases/pages/case_details.tsx @@ -20,7 +20,7 @@ import { savedObjectReadOnlyErrorMessage, CaseCallOut } from '../components/call export const CaseDetailsPage = React.memo(() => { const history = useHistory(); const userPermissions = useGetUserSavedObjectPermissions(); - const { detailName: caseId } = useParams(); + const { detailName: caseId } = useParams<{ detailName?: string }>(); const search = useGetUrlSearch(navTabs.case); if (userPermissions != null && !userPermissions.read) { diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.test.ts b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.test.ts index 4f2055424ca61..d6dc97fbae158 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.test.ts +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/create/helpers.test.ts @@ -132,6 +132,7 @@ describe('helpers', () => { const mockStepData = { ...mockData, }; + // @ts-expect-error delete mockStepData.timeline.id; const result: DefineStepRuleJson = formatDefineStepData(mockStepData); @@ -180,6 +181,7 @@ describe('helpers', () => { id: '86aa74d0-2136-11ea-9864-ebc8cc1cb8c2', }, }; + // @ts-expect-error delete mockStepData.timeline.title; const result: DefineStepRuleJson = formatDefineStepData(mockStepData); diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx index 789469e981fb4..c496c1b507d1f 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/details/index.tsx @@ -146,7 +146,7 @@ export const RuleDetailsPageComponent: FC = ({ needsConfiguration: needsListsConfiguration, } = useListsConfig(); const loading = userInfoLoading || listsConfigLoading; - const { detailName: ruleId } = useParams(); + const { detailName: ruleId } = useParams<{ detailName: string }>(); const { rule: maybeRule, refresh: refreshRule, loading: ruleLoading } = useRuleAsync(ruleId); const [rule, setRule] = useState(null); const isLoading = ruleLoading && rule == null; diff --git a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx index 3cc874b85ecf3..f22c9bfe5f389 100644 --- a/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx +++ b/x-pack/plugins/security_solution/public/detections/pages/detection_engine/rules/edit/index.tsx @@ -86,7 +86,7 @@ const EditRulePageComponent: FC = () => { needsConfiguration: needsListsConfiguration, } = useListsConfig(); const initLoading = userInfoLoading || listsConfigLoading; - const { detailName: ruleId } = useParams(); + const { detailName: ruleId } = useParams<{ detailName: string | undefined }>(); const [loading, rule] = useRule(ruleId); const [initForm, setInitForm] = useState(false); diff --git a/x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx b/x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx index 1d0b73f80a69a..549bdb55c5d45 100644 --- a/x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx +++ b/x-pack/plugins/security_solution/public/hosts/pages/hosts.tsx @@ -58,7 +58,7 @@ export const HostsComponent = React.memo( const { globalFullScreen } = useFullScreen(); const capabilities = useMlCapabilities(); const kibana = useKibana(); - const { tabName } = useParams(); + const { tabName } = useParams<{ tabName: string }>(); const tabsFilters = React.useMemo(() => { if (tabName === HostsTableType.alerts) { return filters.length > 0 ? [...filters, ...filterHostData] : filterHostData; diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx index d309faf59d044..8807d23aeefff 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_details.tsx @@ -55,7 +55,7 @@ export const PolicyDetails = React.memo(() => { services: { application: { navigateToApp }, }, - } = useKibana(); + } = useKibana<{ application: ApplicationStart }>(); const toasts = useToasts(); const { formatUrl } = useFormatUrl(SecurityPageName.administration); const { state: locationRouteState } = useLocation(); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.test.ts index b17a7358cfa52..c43ff6d203fec 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/rules/read_rules.test.ts @@ -40,6 +40,7 @@ describe('read_rules', () => { test('should return null if saved object found by alerts client given id is not alert type', async () => { const alertsClient = alertsClientMock.create(); const result = getResult(); + // @ts-expect-error delete result.alertTypeId; alertsClient.get.mockResolvedValue(result); diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.test.ts index d07fa382e114a..5c5d8605d7811 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/tags/read_tags.test.ts @@ -287,6 +287,7 @@ describe('read_tags', () => { const result2 = getResult(); result2.id = '99979e67-19a7-455f-b452-8eded6135716'; result2.params.ruleId = 'rule-2'; + // @ts-expect-error delete result2.tags; const result3 = getResult(); diff --git a/x-pack/plugins/transform/public/app/common/pivot_group_by.ts b/x-pack/plugins/transform/public/app/common/pivot_group_by.ts index bd5a5a26d9019..7da52fc018338 100644 --- a/x-pack/plugins/transform/public/app/common/pivot_group_by.ts +++ b/x-pack/plugins/transform/public/app/common/pivot_group_by.ts @@ -132,13 +132,9 @@ export type PivotGroupBy = GenericAgg | TermsAgg | HistogramAgg | DateHistogramA export type PivotGroupByDict = Dictionary; export function getEsAggFromGroupByConfig(groupByConfig: GroupByConfigBase): GenericAgg { - const esAgg = { ...groupByConfig }; - - delete esAgg.agg; - delete esAgg.aggName; - delete esAgg.dropDownName; + const { agg, aggName, dropDownName, ...esAgg } = groupByConfig; return { - [groupByConfig.agg]: esAgg, + [agg]: esAgg, }; } From 21e799ca66b2cfd2c4487891c46a1163419cae59 Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 12:37:22 +0200 Subject: [PATCH 06/34] 3rd pass on x-pack type-errors --- .../components/asset_manager/asset.component.tsx | 3 ++- .../explore_data/explore_data_chart_action.test.ts | 1 + .../explore_data_context_menu_action.test.ts | 1 + .../edit_policy/edit_policy.test.ts | 1 + .../alerting/inventory/components/alert_flyout.tsx | 13 +++++++++++-- .../metric_threshold/components/alert_flyout.tsx | 13 +++++++++++-- .../components/alerting/logs/alert_flyout.tsx | 13 +++++++++++-- .../plugins/infra/public/hooks/use_trial_status.tsx | 5 +++-- .../infra/public/pages/logs/page_providers.tsx | 3 ++- .../applications/ingest_manager/hooks/use_core.ts | 2 +- .../create_package_config_page/index.tsx | 2 +- .../agent_config/edit_package_config_page/index.tsx | 2 +- .../delete_endpoint_list_item_schema.test.ts | 1 + .../schemas/request/delete_list_schema.test.ts | 1 + .../schemas/request/import_list_item_schema.test.ts | 1 + .../schemas/request/patch_list_item_schema.test.ts | 1 + .../schemas/request/patch_list_schema.test.ts | 1 + .../request/read_endpoint_list_item_schema.test.ts | 1 + .../common/schemas/request/read_list_schema.test.ts | 1 + .../schemas/response/acknowledge_schema.test.ts | 1 + .../schemas/response/list_item_schema.test.ts | 1 + .../management/pages/policy/view/policy_list.tsx | 3 ++- .../public/application/context/alerts_context.tsx | 7 ++----- 23 files changed, 59 insertions(+), 19 deletions(-) diff --git a/x-pack/plugins/canvas/public/components/asset_manager/asset.component.tsx b/x-pack/plugins/canvas/public/components/asset_manager/asset.component.tsx index a04d37cf7f9fc..e3573fb80436b 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/asset.component.tsx +++ b/x-pack/plugins/canvas/public/components/asset_manager/asset.component.tsx @@ -23,6 +23,7 @@ import { ConfirmModal } from '../confirm_modal'; import { Clipboard } from '../clipboard'; import { Download } from '../download'; import { AssetType } from '../../../types'; +import { CanvasServices } from '../../services'; import { ComponentStrings } from '../../../i18n'; @@ -38,7 +39,7 @@ interface Props { } export const Asset: FC = ({ asset, onCreate, onDelete }) => { - const { services } = useKibana(); + const { services } = useKibana<{ canvas: CanvasServices }>(); const [isConfirmModalVisible, setIsConfirmModalVisible] = useState(false); const onCopy = (result: boolean) => diff --git a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts index 14cd48ae1f509..bd57c26aff6e6 100644 --- a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts +++ b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.test.ts @@ -165,6 +165,7 @@ describe('"Explore underlying data" panel action', () => { test('returns false if embeddable does not have index patterns', async () => { const { action, output, context } = setup(); + // @ts-expect-error delete output.indexPatterns; const isCompatible = await action.isCompatible(context); diff --git a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts index 68253655af890..e5bf1bef94c32 100644 --- a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts +++ b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.test.ts @@ -148,6 +148,7 @@ describe('"Explore underlying data" panel action', () => { test('returns false if embeddable does not have index patterns', async () => { const { action, output, context } = setup(); + // @ts-expect-error delete output.indexPatterns; const isCompatible = await action.isCompatible(context); diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts index 06829e6ef6f1e..c6024ae3b90ae 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts @@ -101,6 +101,7 @@ describe('', () => { }, }, }; + // @ts-expect-error delete expected.phases.delete.actions.wait_for_snapshot; const latestRequest = server.requests[server.requests.length - 1]; diff --git a/x-pack/plugins/infra/public/alerting/inventory/components/alert_flyout.tsx b/x-pack/plugins/infra/public/alerting/inventory/components/alert_flyout.tsx index 804ff9602c81c..79e47a6d64e1c 100644 --- a/x-pack/plugins/infra/public/alerting/inventory/components/alert_flyout.tsx +++ b/x-pack/plugins/infra/public/alerting/inventory/components/alert_flyout.tsx @@ -5,6 +5,8 @@ */ import React, { useContext } from 'react'; +import { ApplicationStart, DocLinksStart, HttpStart, NotificationsStart } from 'src/core/public'; + import { AlertsContextProvider, AlertAdd } from '../../../../../triggers_actions_ui/public'; import { TriggerActionsContext } from '../../../utils/triggers_actions_context'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; @@ -21,9 +23,16 @@ interface Props { setVisible: React.Dispatch>; } +interface KibanaDeps { + notifications: NotificationsStart; + http: HttpStart; + docLinks: DocLinksStart; + application: ApplicationStart; +} + export const AlertFlyout = (props: Props) => { const { triggersActionsUI } = useContext(TriggerActionsContext); - const { services } = useKibana(); + const { services } = useKibana(); return ( <> @@ -31,7 +40,7 @@ export const AlertFlyout = (props: Props) => { >; } +interface KibanaDeps { + notifications: NotificationsStart; + http: HttpStart; + docLinks: DocLinksStart; + application: ApplicationStart; +} + export const AlertFlyout = (props: Props) => { const { triggersActionsUI } = useContext(TriggerActionsContext); - const { services } = useKibana(); + const { services } = useKibana(); return ( <> @@ -33,7 +42,7 @@ export const AlertFlyout = (props: Props) => { currentOptions: props.options, series: props.series, }, - toastNotifications: services.notifications?.toasts, + toastNotifications: services.notifications.toasts, http: services.http, docLinks: services.docLinks, capabilities: services.application.capabilities, diff --git a/x-pack/plugins/infra/public/components/alerting/logs/alert_flyout.tsx b/x-pack/plugins/infra/public/components/alerting/logs/alert_flyout.tsx index bd889bff8cd0e..45e4f8576892c 100644 --- a/x-pack/plugins/infra/public/components/alerting/logs/alert_flyout.tsx +++ b/x-pack/plugins/infra/public/components/alerting/logs/alert_flyout.tsx @@ -5,6 +5,8 @@ */ import React, { useContext } from 'react'; +import { ApplicationStart, DocLinksStart, HttpStart, NotificationsStart } from 'src/core/public'; + import { AlertsContextProvider, AlertAdd } from '../../../../../triggers_actions_ui/public'; import { TriggerActionsContext } from '../../../utils/triggers_actions_context'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; @@ -15,9 +17,16 @@ interface Props { setVisible: React.Dispatch>; } +interface KibanaDeps { + notifications: NotificationsStart; + http: HttpStart; + docLinks: DocLinksStart; + application: ApplicationStart; +} + export const AlertFlyout = (props: Props) => { const { triggersActionsUI } = useContext(TriggerActionsContext); - const { services } = useKibana(); + const { services } = useKibana(); return ( <> @@ -27,7 +36,7 @@ export const AlertFlyout = (props: Props) => { metadata: { isInternal: true, }, - toastNotifications: services.notifications?.toasts, + toastNotifications: services.notifications.toasts, http: services.http, docLinks: services.docLinks, capabilities: services.application.capabilities, diff --git a/x-pack/plugins/infra/public/hooks/use_trial_status.tsx b/x-pack/plugins/infra/public/hooks/use_trial_status.tsx index 9cc118d09c7e0..3fb7fcfd8edf1 100644 --- a/x-pack/plugins/infra/public/hooks/use_trial_status.tsx +++ b/x-pack/plugins/infra/public/hooks/use_trial_status.tsx @@ -6,8 +6,9 @@ import { boolean } from 'io-ts'; import { i18n } from '@kbn/i18n'; - import { useState } from 'react'; +import { HttpStart, NotificationsStart } from 'src/core/public'; + import { useKibana } from '../../../../../src/plugins/kibana_react/public'; import { API_BASE_PATH as LICENSE_MANAGEMENT_API_BASE_PATH } from '../../../license_management/common/constants'; import { useTrackedPromise } from '../utils/use_tracked_promise'; @@ -20,7 +21,7 @@ interface UseTrialStatusState { } export function useTrialStatus(): UseTrialStatusState { - const { services } = useKibana(); + const { services } = useKibana<{ http: HttpStart; notifications: NotificationsStart }>(); const [isTrialAvailable, setIsTrialAvailable] = useState(false); const [loadState, checkTrialAvailability] = useTrackedPromise( diff --git a/x-pack/plugins/infra/public/pages/logs/page_providers.tsx b/x-pack/plugins/infra/public/pages/logs/page_providers.tsx index 1e053d8d4abc3..a3d0c2bafad40 100644 --- a/x-pack/plugins/infra/public/pages/logs/page_providers.tsx +++ b/x-pack/plugins/infra/public/pages/logs/page_providers.tsx @@ -5,6 +5,7 @@ */ import React from 'react'; +import { HttpStart } from 'src/core/public'; import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; import { LogAnalysisCapabilitiesProvider } from '../../containers/logs/log_analysis'; import { LogSourceProvider } from '../../containers/logs/log_source'; @@ -12,7 +13,7 @@ import { useSourceId } from '../../containers/source_id'; export const LogsPageProviders: React.FunctionComponent = ({ children }) => { const [sourceId] = useSourceId(); - const { services } = useKibana(); + const { services } = useKibana<{ http: HttpStart }>(); return ( {children} diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts index 9ce1e95aa91d5..dad2eaa1d8e0f 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/hooks/use_core.ts @@ -8,7 +8,7 @@ import { CoreStart } from 'kibana/public'; import { useKibana } from '../../../../../../../src/plugins/kibana_react/public'; export function useCore(): CoreStart { - const { services } = useKibana(); + const { services } = useKibana(); if (services === null) { throw new Error('KibanaContextProvider not initialized'); } diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/index.tsx index 74cbcdca512db..64a27d245c99a 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/create_package_config_page/index.tsx @@ -65,7 +65,7 @@ export const CreatePackageConfigPage: React.FunctionComponent = () => { } = useConfig(); const { params: { configId, pkgkey }, - } = useRouteMatch(); + } = useRouteMatch<{ configId: string; pkgkey: string }>(); const { getHref, getPath } = useLink(); const history = useHistory(); const routeState = useIntraAppState(); diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx index f4411a6057a15..81d508a6353e6 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_config/edit_package_config_page/index.tsx @@ -53,7 +53,7 @@ export const EditPackageConfigPage: React.FunctionComponent = () => { } = useConfig(); const { params: { configId, packageConfigId }, - } = useRouteMatch(); + } = useRouteMatch<{ configId: string; packageConfigId: string }>(); const history = useHistory(); const { getHref, getPath } = useLink(); const [isNavDrawerLocked, setIsNavDrawerLocked] = useState(false); diff --git a/x-pack/plugins/lists/common/schemas/request/delete_endpoint_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/delete_endpoint_list_item_schema.test.ts index fa3c1ef3b02f5..e881e8dd28adb 100644 --- a/x-pack/plugins/lists/common/schemas/request/delete_endpoint_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/delete_endpoint_list_item_schema.test.ts @@ -30,6 +30,7 @@ describe('delete_endpoint_list_item_schema', () => { const payload: DeleteEndpointListItemSchema & { namespace_type: string; } = { ...getDeleteEndpointListItemSchemaMock(), namespace_type: 'single' }; + // @ts-expect-error delete payload.namespace_type; const decoded = deleteEndpointListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/request/delete_list_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/delete_list_schema.test.ts index 65ca2f3f457e9..d099bdcff6710 100644 --- a/x-pack/plugins/lists/common/schemas/request/delete_list_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/delete_list_schema.test.ts @@ -25,6 +25,7 @@ describe('delete_list_schema', () => { test('it should NOT accept an undefined for an id', () => { const payload = getDeleteListSchemaMock(); + // @ts-expect-error delete payload.id; const decoded = deleteListSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.test.ts index 4de77b66610d3..a52824dd8be8e 100644 --- a/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/import_list_item_schema.test.ts @@ -25,6 +25,7 @@ describe('import_list_item_schema', () => { test('it should NOT accept an undefined for a file', () => { const payload = getImportListItemSchemaMock(); + // @ts-expect-error delete payload.file; const decoded = importListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/request/patch_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/patch_list_item_schema.test.ts index b148f19da8a86..35852954d5c46 100644 --- a/x-pack/plugins/lists/common/schemas/request/patch_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/patch_list_item_schema.test.ts @@ -25,6 +25,7 @@ describe('patch_list_item_schema', () => { test('it should NOT accept an undefined for "id"', () => { const payload = getPathListItemSchemaMock(); + // @ts-expect-error delete payload.id; const decoded = patchListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/request/patch_list_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/patch_list_schema.test.ts index dea48df3f1702..7ce0a1c2d8086 100644 --- a/x-pack/plugins/lists/common/schemas/request/patch_list_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/patch_list_schema.test.ts @@ -25,6 +25,7 @@ describe('patch_list_schema', () => { test('it should NOT accept an undefined for "id"', () => { const payload = getPathListSchemaMock(); + // @ts-expect-error delete payload.id; const decoded = patchListSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/request/read_endpoint_list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/read_endpoint_list_item_schema.test.ts index adec476ea5ad7..a0e790bef6e1e 100644 --- a/x-pack/plugins/lists/common/schemas/request/read_endpoint_list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/read_endpoint_list_item_schema.test.ts @@ -52,6 +52,7 @@ describe('read_endpoint_list_item_schema', () => { const payload: ReadEndpointListItemSchema & { namespace_type: string; } = { ...getReadEndpointListItemSchemaMock(), namespace_type: 'single' }; + // @ts-expect-error delete payload.namespace_type; const decoded = readEndpointListItemSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/request/read_list_schema.test.ts b/x-pack/plugins/lists/common/schemas/request/read_list_schema.test.ts index 0b7e92c23f77a..2f234766aff01 100644 --- a/x-pack/plugins/lists/common/schemas/request/read_list_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/request/read_list_schema.test.ts @@ -25,6 +25,7 @@ describe('read_list_schema', () => { test('it should NOT accept an undefined for "id"', () => { const payload = getReadListSchemaMock(); + // @ts-expect-error delete payload.id; const decoded = readListSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/acknowledge_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/acknowledge_schema.test.ts index a59a93b06e34d..c735e8ebaeb89 100644 --- a/x-pack/plugins/lists/common/schemas/response/acknowledge_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/acknowledge_schema.test.ts @@ -24,6 +24,7 @@ describe('acknowledge_schema', () => { }); test('it should NOT accept an undefined for "ok"', () => { const payload = getAcknowledgeSchemaResponseMock(); + // @ts-expect-error delete payload.acknowledged; const decoded = acknowledgeSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/lists/common/schemas/response/list_item_schema.test.ts b/x-pack/plugins/lists/common/schemas/response/list_item_schema.test.ts index 0c6e934163428..47f2e29fcb5ef 100644 --- a/x-pack/plugins/lists/common/schemas/response/list_item_schema.test.ts +++ b/x-pack/plugins/lists/common/schemas/response/list_item_schema.test.ts @@ -84,6 +84,7 @@ describe('list_item_schema', () => { test('it should NOT accept an undefined for "created_at"', () => { const payload = getListItemResponseMock(); + // @ts-expect-error delete payload.created_at; const decoded = listItemSchema.decode(payload); const checked = exactCheck(payload, decoded); diff --git a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx index 39b77d259add1..69391d51b2997 100644 --- a/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx +++ b/x-pack/plugins/security_solution/public/management/pages/policy/view/policy_list.tsx @@ -32,6 +32,7 @@ import { useDispatch } from 'react-redux'; import { useLocation, useHistory } from 'react-router-dom'; import { createStructuredSelector } from 'reselect'; import styled from 'styled-components'; +import { ApplicationStart } from 'src/core/public'; import { CreateStructuredSelector } from '../../../../common/store'; import * as selectors from '../store/policy_list/selectors'; import { usePolicyListSelector } from './policy_hooks'; @@ -125,7 +126,7 @@ const PolicyLink: React.FC<{ name: string; route: string; href: string }> = ({ const selector = (createStructuredSelector as CreateStructuredSelector)(selectors); export const PolicyList = React.memo(() => { - const { services } = useKibana(); + const { services } = useKibana<{ application: ApplicationStart }>(); const toasts = useToasts(); const history = useHistory(); const location = useLocation(); diff --git a/x-pack/plugins/triggers_actions_ui/public/application/context/alerts_context.tsx b/x-pack/plugins/triggers_actions_ui/public/application/context/alerts_context.tsx index 95620a5be8474..953a444500084 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/context/alerts_context.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/context/alerts_context.tsx @@ -8,7 +8,7 @@ import React, { useContext, createContext } from 'react'; import { HttpSetup, IUiSettingsClient, - ToastsApi, + ToastsStart, DocLinksStart, ApplicationStart, } from 'kibana/public'; @@ -22,10 +22,7 @@ export interface AlertsContextValue> { http: HttpSetup; alertTypeRegistry: TypeRegistry; actionTypeRegistry: TypeRegistry; - toastNotifications: Pick< - ToastsApi, - 'get$' | 'add' | 'remove' | 'addSuccess' | 'addWarning' | 'addDanger' | 'addError' - >; + toastNotifications: ToastsStart; uiSettings?: IUiSettingsClient; charts?: ChartsPluginSetup; docLinks: DocLinksStart; From 3d60683d8ab9ea03f846f0369e93cb99135ef967 Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Sat, 1 Aug 2020 12:52:53 +0200 Subject: [PATCH 07/34] mute errors if complex cases --- .../apm/public/components/app/Main/ProvideBreadcrumbs.test.tsx | 1 + x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/x-pack/plugins/apm/public/components/app/Main/ProvideBreadcrumbs.test.tsx b/x-pack/plugins/apm/public/components/app/Main/ProvideBreadcrumbs.test.tsx index c6e2c0eff8166..bf1cd75432ff5 100644 --- a/x-pack/plugins/apm/public/components/app/Main/ProvideBreadcrumbs.test.tsx +++ b/x-pack/plugins/apm/public/components/app/Main/ProvideBreadcrumbs.test.tsx @@ -74,6 +74,7 @@ Array [ const location = getLocation(); const routes = getTestRoutes(); + // @ts-expect-error delete routes[2].breadcrumb; const breadcrumbs = getBreadcrumbs({ location, routes }); diff --git a/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts b/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts index 73bf1d01924e7..6b7635040aba3 100644 --- a/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts +++ b/x-pack/plugins/apm/server/lib/transaction_groups/fetcher.ts @@ -109,6 +109,7 @@ export async function transactionGroupsFetcher( const isTopTraces = options.type === 'top_traces'; + // @ts-expect-error delete projection.body.aggs; // traces overview is hardcoded to 10000 From d356ee9a9965352f111c44f9fb754308d61a90ed Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Sat, 1 Aug 2020 12:54:15 +0200 Subject: [PATCH 08/34] don't delete if spread suffices --- .../ml/server/models/calendar/calendar_manager.ts | 7 ++----- .../plugins/ml/server/models/filter/filter_manager.ts | 5 ++--- .../role_mappings/role_mappings_api_client.ts | 10 ++++------ .../server/lib/events/elasticsearch_adapter.ts | 5 ++--- 4 files changed, 10 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/ml/server/models/calendar/calendar_manager.ts b/x-pack/plugins/ml/server/models/calendar/calendar_manager.ts index 43f4dc3cba7e2..b461e71c006ff 100644 --- a/x-pack/plugins/ml/server/models/calendar/calendar_manager.ts +++ b/x-pack/plugins/ml/server/models/calendar/calendar_manager.ts @@ -70,13 +70,10 @@ export class CalendarManager { } async newCalendar(calendar: FormCalendar) { - const calendarId = calendar.calendarId; - const events = calendar.events; - delete calendar.calendarId; - delete calendar.events; + const { calendarId, events, ...newCalendar } = calendar; await this._callAsInternalUser('ml.addCalendar', { calendarId, - body: calendar, + body: newCalendar, }); if (events.length) { diff --git a/x-pack/plugins/ml/server/models/filter/filter_manager.ts b/x-pack/plugins/ml/server/models/filter/filter_manager.ts index 20dc95e92a86c..768ca1f893b68 100644 --- a/x-pack/plugins/ml/server/models/filter/filter_manager.ts +++ b/x-pack/plugins/ml/server/models/filter/filter_manager.ts @@ -136,11 +136,10 @@ export class FilterManager { } async newFilter(filter: FormFilter) { - const filterId = filter.filterId; - delete filter.filterId; + const { filterId, ...body } = filter; try { // Returns the newly created filter. - return await this._callAsInternalUser('ml.addFilter', { filterId, body: filter }); + return await this._callAsInternalUser('ml.addFilter', { filterId, body }); } catch (error) { throw Boom.badRequest(error); } diff --git a/x-pack/plugins/security/public/management/role_mappings/role_mappings_api_client.ts b/x-pack/plugins/security/public/management/role_mappings/role_mappings_api_client.ts index 8e8bae42d4ad8..5eec3a0cfba37 100644 --- a/x-pack/plugins/security/public/management/role_mappings/role_mappings_api_client.ts +++ b/x-pack/plugins/security/public/management/role_mappings/role_mappings_api_client.ts @@ -36,13 +36,11 @@ export class RoleMappingsAPIClient { } public async saveRoleMapping(roleMapping: RoleMapping) { - const payload = { ...roleMapping }; - delete payload.name; + const { name, ...payload } = roleMapping; - return this.http.post( - `/internal/security/role_mapping/${encodeURIComponent(roleMapping.name)}`, - { body: JSON.stringify(payload) } - ); + return this.http.post(`/internal/security/role_mapping/${encodeURIComponent(name)}`, { + body: JSON.stringify(payload), + }); } public async deleteRoleMappings(names: string[]): Promise { diff --git a/x-pack/plugins/security_solution/server/lib/events/elasticsearch_adapter.ts b/x-pack/plugins/security_solution/server/lib/events/elasticsearch_adapter.ts index aabb18d419098..dda52e26ca42b 100644 --- a/x-pack/plugins/security_solution/server/lib/events/elasticsearch_adapter.ts +++ b/x-pack/plugins/security_solution/server/lib/events/elasticsearch_adapter.ts @@ -51,12 +51,11 @@ export class ElasticsearchEventsAdapter implements EventsAdapter { request: FrameworkRequest, options: TimelineRequestOptions ): Promise { - const queryOptions = cloneDeep(options); + const { fieldRequested, ...queryOptions } = cloneDeep(options); queryOptions.fields = uniq([ - ...queryOptions.fieldRequested, + ...fieldRequested, ...reduceFields(queryOptions.fields, eventFieldsMap), ]); - delete queryOptions.fieldRequested; const dsl = buildTimelineQuery(queryOptions); const response = await this.framework.callWithRequest( request, From 052afca20313b77e0af8bdcab106c686daca02e0 Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 13:17:15 +0200 Subject: [PATCH 09/34] mute other complex cases --- .../application/components/template_form/template_form.tsx | 1 + .../plugins/ml/server/models/data_recognizer/data_recognizer.ts | 1 + x-pack/plugins/security_solution/server/lib/events/mock.ts | 1 + 3 files changed, 3 insertions(+) diff --git a/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx b/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx index fb0ba0b68fa6c..85d6953264981 100644 --- a/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx +++ b/x-pack/plugins/index_management/public/application/components/template_form/template_form.tsx @@ -174,6 +174,7 @@ export const TemplateForm = ({ delete outputTemplate.template.aliases; } if (Object.keys(outputTemplate.template).length === 0) { + // @ts-expect-error delete outputTemplate.template; } diff --git a/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts b/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts index 21e178dcc7e76..cc42a545c11e2 100644 --- a/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts +++ b/x-pack/plugins/ml/server/models/data_recognizer/data_recognizer.ts @@ -1209,6 +1209,7 @@ export class DataRecognizer { const job = jobs.find((j) => j.id === `${jobPrefix}${jobSpecificOverride.job_id}`); if (job !== undefined) { // delete the job_id in the override as this shouldn't be overridden + // @ts-expect-error delete jobSpecificOverride.job_id; merge(job.config, jobSpecificOverride); processArrayValues(job.config, jobSpecificOverride); diff --git a/x-pack/plugins/security_solution/server/lib/events/mock.ts b/x-pack/plugins/security_solution/server/lib/events/mock.ts index f5fb2f481ca77..a3350a08c7d34 100644 --- a/x-pack/plugins/security_solution/server/lib/events/mock.ts +++ b/x-pack/plugins/security_solution/server/lib/events/mock.ts @@ -2875,6 +2875,7 @@ export const mockQueryDsl = { }; const mockTimelineDetailsInspectResponse = cloneDeep(mockResponseSearchTimelineDetails); +// @ts-expect-error delete mockTimelineDetailsInspectResponse.hits.hits[0]._source; export const mockTimelineDetailsResult = { From ea154f3d80a6fc3c48667c45d3ecc256bdd72ea1 Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 13:26:15 +0200 Subject: [PATCH 10/34] make User fields optional --- x-pack/plugins/security/common/model/user.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/security/common/model/user.ts b/x-pack/plugins/security/common/model/user.ts index ae6de7f4c5fbc..6e68f125f6f71 100644 --- a/x-pack/plugins/security/common/model/user.ts +++ b/x-pack/plugins/security/common/model/user.ts @@ -18,8 +18,8 @@ export interface User { } export interface EditUser extends User { - password: string; - confirmPassword: string; + password?: string; + confirmPassword?: string; } export function getUserDisplayName(user: User) { From 02712a0db10ed652f94a1e1247dbf70ca3945a2d Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 13:45:23 +0200 Subject: [PATCH 11/34] fix optional types --- x-pack/legacy/plugins/beats_management/common/domain_types.ts | 2 +- x-pack/legacy/plugins/beats_management/server/lib/beats.ts | 2 +- .../uptime/public/components/overview/kuery_bar/kuery_bar.tsx | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/legacy/plugins/beats_management/common/domain_types.ts b/x-pack/legacy/plugins/beats_management/common/domain_types.ts index 32e1d81451c65..77c1c05667d47 100644 --- a/x-pack/legacy/plugins/beats_management/common/domain_types.ts +++ b/x-pack/legacy/plugins/beats_management/common/domain_types.ts @@ -41,7 +41,7 @@ export interface CMBeat { status?: BeatEvent; enrollment_token: string; active: boolean; - access_token: string; + access_token?: string; verified_on?: string; type: string; version?: string; diff --git a/x-pack/legacy/plugins/beats_management/server/lib/beats.ts b/x-pack/legacy/plugins/beats_management/server/lib/beats.ts index 6b7053f40550b..c0d2eb62ce5f1 100644 --- a/x-pack/legacy/plugins/beats_management/server/lib/beats.ts +++ b/x-pack/legacy/plugins/beats_management/server/lib/beats.ts @@ -72,7 +72,7 @@ export class CMBeatsDomain { if (typeof userOrToken === 'string') { const { verified: isAccessTokenValid } = this.tokens.verifyToken( - beat ? beat.access_token : '', + beat?.access_token ?? '', userOrToken ); if (!isAccessTokenValid) { diff --git a/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar.tsx b/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar.tsx index 333a26637d1a4..61402008363da 100644 --- a/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar.tsx +++ b/x-pack/plugins/uptime/public/components/overview/kuery_bar/kuery_bar.tsx @@ -103,8 +103,8 @@ export function KueryBar({ language: 'kuery', indexPatterns: [indexPattern], query: inputValue, - selectionStart, - selectionEnd: selectionStart, + selectionStart: selectionStart || 0, + selectionEnd: selectionStart || 0, boolFilter: [ { range: { From 1c1e5af796b0c73f0b502a29df662afc9756e7c7 Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 13:57:04 +0200 Subject: [PATCH 12/34] fix tests --- .../alerts/server/alert_type_registry.test.ts | 21 ++++--------------- 1 file changed, 4 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/alerts/server/alert_type_registry.test.ts b/x-pack/plugins/alerts/server/alert_type_registry.test.ts index 229847bda1836..02c01fe189356 100644 --- a/x-pack/plugins/alerts/server/alert_type_registry.test.ts +++ b/x-pack/plugins/alerts/server/alert_type_registry.test.ts @@ -319,22 +319,9 @@ function alertTypeWithVariables(id: string, context: string, state: string): Ale producer: 'alerts', }; - if (!context && !state) { - return baseAlert; - } - - const actionVariables = { - context: [{ name: context, description: `${id} context` }], - state: [{ name: state, description: `${id} state` }], + return { + ...baseAlert, + ...(context ? { context: [{ name: context, description: `${id} context` }] } : {}), + ...(state ? { state: [{ name: state, description: `${id} state` }] } : {}), }; - - if (!context) { - delete actionVariables.context; - } - - if (!state) { - delete actionVariables.state; - } - - return { ...baseAlert, actionVariables }; } From 3391a8a3cb57e0b1dfc9c84be86ad7e3263ea065 Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 14:21:31 +0200 Subject: [PATCH 13/34] fix typings for time_range --- x-pack/plugins/ml/common/types/custom_urls.ts | 2 +- x-pack/plugins/ml/public/application/util/custom_url_utils.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/ml/common/types/custom_urls.ts b/x-pack/plugins/ml/common/types/custom_urls.ts index b6b074934cc63..e20e16bae87f2 100644 --- a/x-pack/plugins/ml/common/types/custom_urls.ts +++ b/x-pack/plugins/ml/common/types/custom_urls.ts @@ -15,7 +15,7 @@ export interface BaseUrlConfig { } export interface KibanaUrlConfig extends BaseUrlConfig { - time_range: string; + time_range?: string; } export type UrlConfig = BaseUrlConfig | KibanaUrlConfig; diff --git a/x-pack/plugins/ml/public/application/util/custom_url_utils.ts b/x-pack/plugins/ml/public/application/util/custom_url_utils.ts index 9c843af36192e..8263def2034aa 100644 --- a/x-pack/plugins/ml/public/application/util/custom_url_utils.ts +++ b/x-pack/plugins/ml/public/application/util/custom_url_utils.ts @@ -34,7 +34,9 @@ export function replaceTokensInUrlValue( const urlValue = customUrlConfig.url_value; const timestamp = doc[timeFieldName]; const timeRangeInterval = - 'time_range' in customUrlConfig ? parseInterval(customUrlConfig.time_range) : null; + 'time_range' in customUrlConfig && customUrlConfig.time_range + ? parseInterval(customUrlConfig.time_range) + : null; const record = { ...doc } as CustomUrlAnomalyRecordDoc; if (urlValue.includes('$earliest$')) { const earliestMoment = moment(timestamp); From 4d2b0921846b51b8ed6e64edea487818847c1898 Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 14:38:15 +0200 Subject: [PATCH 14/34] fix type errors in x-pack/tests --- .../alerting_api_integration/common/lib/alert_utils.ts | 8 ++++---- .../functional_with_es_ssl/services/alerting/actions.ts | 9 +++++---- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/x-pack/test/alerting_api_integration/common/lib/alert_utils.ts b/x-pack/test/alerting_api_integration/common/lib/alert_utils.ts index a68f8de39d48e..a9e5d0c832c8c 100644 --- a/x-pack/test/alerting_api_integration/common/lib/alert_utils.ts +++ b/x-pack/test/alerting_api_integration/common/lib/alert_utils.ts @@ -214,10 +214,10 @@ export class AlertUtils { .set('kbn-xsrf', 'foo') .auth(user.username, user.password); - const alertBody = getDefaultAlwaysFiringAlertData(reference, actionId); - delete alertBody.alertTypeId; - delete alertBody.enabled; - delete alertBody.consumer; + const { alertTypeId, enabled, consumer, ...alertBody } = getDefaultAlwaysFiringAlertData( + reference, + actionId + ); const response = await request.send({ ...alertBody, ...overwrites }); return response; diff --git a/x-pack/test/functional_with_es_ssl/services/alerting/actions.ts b/x-pack/test/functional_with_es_ssl/services/alerting/actions.ts index cff5b3c3ce9c3..060c4f13e70c7 100644 --- a/x-pack/test/functional_with_es_ssl/services/alerting/actions.ts +++ b/x-pack/test/functional_with_es_ssl/services/alerting/actions.ts @@ -30,10 +30,11 @@ export class Actions { }) { this.log.debug(`creating action ${actionParams.name}`); - const { data: action, status: actionStatus, actionStatusText } = await this.axios.post( - `/api/actions/action`, - actionParams - ); + const { + data: action, + status: actionStatus, + statusText: actionStatusText, + } = await this.axios.post(`/api/actions/action`, actionParams); if (actionStatus !== 200) { throw new Error( `Expected status code of 200, received ${actionStatus} ${actionStatusText}: ${util.inspect( From 5313695d784d0aaf34d68edc8aca63ece5a79d30 Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 14:49:11 +0200 Subject: [PATCH 15/34] rebuild kbn-pm --- packages/kbn-pm/dist/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/kbn-pm/dist/index.js b/packages/kbn-pm/dist/index.js index b8794124ad197..f11ba6cfcde4b 100644 --- a/packages/kbn-pm/dist/index.js +++ b/packages/kbn-pm/dist/index.js @@ -564,6 +564,7 @@ module.exports = require("path"); * under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); +exports.ToolingLogCollectingWriter = exports.parseLogLevel = exports.pickLevelFromFlags = exports.ToolingLogTextWriter = exports.ToolingLog = void 0; var tooling_log_1 = __webpack_require__(6); Object.defineProperty(exports, "ToolingLog", { enumerable: true, get: function () { return tooling_log_1.ToolingLog; } }); var tooling_log_text_writer_1 = __webpack_require__(110); From e5e2e7b0e546b2dd675f21e1110e406b5480c3d2 Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 15:03:57 +0200 Subject: [PATCH 16/34] remove leftovers from master update --- .../canvas/public/components/asset_manager/asset.component.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/x-pack/plugins/canvas/public/components/asset_manager/asset.component.tsx b/x-pack/plugins/canvas/public/components/asset_manager/asset.component.tsx index 88d0efc9eeca1..ed000741bc542 100644 --- a/x-pack/plugins/canvas/public/components/asset_manager/asset.component.tsx +++ b/x-pack/plugins/canvas/public/components/asset_manager/asset.component.tsx @@ -23,7 +23,6 @@ import { ConfirmModal } from '../confirm_modal'; import { Clipboard } from '../clipboard'; import { Download } from '../download'; import { AssetType } from '../../../types'; -import { CanvasServices } from '../../services'; import { ComponentStrings } from '../../../i18n'; From 85e5c278fa81fab947659f092ce857fbcf14c54c Mon Sep 17 00:00:00 2001 From: restrry Date: Sat, 1 Aug 2020 20:12:39 +0200 Subject: [PATCH 17/34] fix alert tests --- x-pack/plugins/alerts/server/alert_type_registry.test.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/alerts/server/alert_type_registry.test.ts b/x-pack/plugins/alerts/server/alert_type_registry.test.ts index 02c01fe189356..d2588e8f4fb33 100644 --- a/x-pack/plugins/alerts/server/alert_type_registry.test.ts +++ b/x-pack/plugins/alerts/server/alert_type_registry.test.ts @@ -319,9 +319,13 @@ function alertTypeWithVariables(id: string, context: string, state: string): Ale producer: 'alerts', }; + if (!context && !state) return baseAlert; + return { ...baseAlert, - ...(context ? { context: [{ name: context, description: `${id} context` }] } : {}), - ...(state ? { state: [{ name: state, description: `${id} state` }] } : {}), + actionVariables: { + ...(context ? { context: [{ name: context, description: `${id} context` }] } : {}), + ...(state ? { state: [{ name: state, description: `${id} state` }] } : {}), + }, }; } From 44e41e283da6629ee740044b03c19e38d3ffdb80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Ferna=CC=81ndez=20Haro?= Date: Thu, 6 Aug 2020 12:00:38 +0100 Subject: [PATCH 18/34] [Telemetry Checker] TS4 Fixes --- .../extract_collectors.test.ts.snap | 24 +++++++++---------- .../src/tools/serializer.ts | 17 +++++++------ 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/packages/kbn-telemetry-tools/src/tools/__snapshots__/extract_collectors.test.ts.snap b/packages/kbn-telemetry-tools/src/tools/__snapshots__/extract_collectors.test.ts.snap index fc933b6c7fd35..4e86a3cf6d4a4 100644 --- a/packages/kbn-telemetry-tools/src/tools/__snapshots__/extract_collectors.test.ts.snap +++ b/packages/kbn-telemetry-tools/src/tools/__snapshots__/extract_collectors.test.ts.snap @@ -9,7 +9,7 @@ Array [ "fetch": Object { "typeDescriptor": Object { "locale": Object { - "kind": 143, + "kind": 146, "type": "StringKeyword", }, }, @@ -31,7 +31,7 @@ Array [ "fetch": Object { "typeDescriptor": Object { "locale": Object { - "kind": 143, + "kind": 146, "type": "StringKeyword", }, }, @@ -53,7 +53,7 @@ Array [ "fetch": Object { "typeDescriptor": Object { "locale": Object { - "kind": 143, + "kind": 146, "type": "StringKeyword", }, }, @@ -75,7 +75,7 @@ Array [ "fetch": Object { "typeDescriptor": Object { "locale": Object { - "kind": 143, + "kind": 146, "type": "StringKeyword", }, }, @@ -97,7 +97,7 @@ Array [ "fetch": Object { "typeDescriptor": Object { "locale": Object { - "kind": 143, + "kind": 146, "type": "StringKeyword", }, }, @@ -119,35 +119,35 @@ Array [ "fetch": Object { "typeDescriptor": Object { "flat": Object { - "kind": 143, + "kind": 146, "type": "StringKeyword", }, "my_array": Object { "total": Object { - "kind": 140, + "kind": 143, "type": "NumberKeyword", }, "type": Object { - "kind": 128, + "kind": 131, "type": "BooleanKeyword", }, }, "my_objects": Object { "total": Object { - "kind": 140, + "kind": 143, "type": "NumberKeyword", }, "type": Object { - "kind": 128, + "kind": 131, "type": "BooleanKeyword", }, }, "my_str": Object { - "kind": 143, + "kind": 146, "type": "StringKeyword", }, "my_str_array": Object { - "kind": 143, + "kind": 146, "type": "StringKeyword", }, }, diff --git a/packages/kbn-telemetry-tools/src/tools/serializer.ts b/packages/kbn-telemetry-tools/src/tools/serializer.ts index bce5dd7f58643..2fcbad1e68380 100644 --- a/packages/kbn-telemetry-tools/src/tools/serializer.ts +++ b/packages/kbn-telemetry-tools/src/tools/serializer.ts @@ -137,14 +137,11 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor | } if (ts.isUnionTypeNode(node)) { - const types = node.types.filter((typeNode) => { - return ( - typeNode.kind !== ts.SyntaxKind.NullKeyword && - typeNode.kind !== ts.SyntaxKind.UndefinedKeyword - ); - }); + const types = node.types.filter(discardNullOrUndefined); - const kinds = types.map((typeNode) => getDescriptor(typeNode, program)); + const kinds = types + .map((typeNode) => getDescriptor(typeNode, program)) + .filter(discardNullOrUndefined); const uniqueKinds = uniq(kinds, 'kind'); @@ -167,3 +164,9 @@ export function getDescriptor(node: ts.Node, program: ts.Program): Descriptor | throw new Error(`Unknown type ${ts.SyntaxKind[node.kind]}; ${node.getText()}`); } } + +function discardNullOrUndefined(typeNode: ts.TypeNode | Descriptor | DescriptorValue) { + return ( + typeNode.kind !== ts.SyntaxKind.NullKeyword && typeNode.kind !== ts.SyntaxKind.UndefinedKeyword + ); +} From c6e7e2ab8bde6d02ff86ed60f3175d36ca1b096c Mon Sep 17 00:00:00 2001 From: restrry Date: Wed, 19 Aug 2020 09:28:55 +0200 Subject: [PATCH 19/34] bump to 4.0.1-rc --- package.json | 4 ++-- packages/kbn-analytics/package.json | 2 +- packages/kbn-config-schema/package.json | 2 +- packages/kbn-dev-utils/package.json | 2 +- packages/kbn-i18n/package.json | 2 +- packages/kbn-monaco/package.json | 2 +- packages/kbn-plugin-helpers/package.json | 2 +- packages/kbn-pm/package.json | 2 +- packages/kbn-release-notes/package.json | 4 ++-- packages/kbn-telemetry-tools/package.json | 2 +- .../plugins/kbn_tp_run_pipeline/package.json | 2 +- test/plugin_functional/plugins/app_link_test/package.json | 2 +- .../plugins/core_app_status/package.json | 2 +- test/plugin_functional/plugins/core_plugin_a/package.json | 2 +- .../plugins/core_plugin_appleave/package.json | 2 +- test/plugin_functional/plugins/core_plugin_b/package.json | 2 +- .../plugins/core_plugin_chromeless/package.json | 2 +- .../plugins/core_plugin_route_timeouts/package.json | 2 +- .../plugins/core_plugin_static_assets/package.json | 2 +- .../plugins/core_provider_plugin/package.json | 2 +- .../plugins/doc_views_plugin/package.json | 2 +- .../plugins/elasticsearch_client_plugin/package.json | 2 +- .../plugin_functional/plugins/index_patterns/package.json | 4 ++-- .../plugins/kbn_sample_panel_action/package.json | 2 +- test/plugin_functional/plugins/kbn_top_nav/package.json | 2 +- .../plugins/kbn_tp_custom_visualizations/package.json | 2 +- .../plugins/management_test_plugin/package.json | 2 +- .../plugins/rendering_plugin/package.json | 2 +- .../plugins/ui_settings_plugin/package.json | 2 +- x-pack/examples/ui_actions_enhanced_examples/package.json | 2 +- x-pack/package.json | 2 +- .../common/fixtures/plugins/aad/package.json | 2 +- .../fixtures/plugins/actions_simulators/package.json | 2 +- .../common/fixtures/plugins/alerts/package.json | 2 +- .../fixtures/plugins/alerts_restricted/package.json | 2 +- .../fixtures/plugins/task_manager_fixture/package.json | 2 +- .../plugins/iframe_embedded/package.json | 2 +- .../fixtures/plugins/alerts/package.json | 2 +- .../plugins/elasticsearch_client/package.json | 2 +- .../plugin_api_integration/plugins/event_log/package.json | 2 +- .../plugins/sample_task_plugin/package.json | 2 +- .../plugins/task_manager_performance/package.json | 2 +- yarn.lock | 8 ++++---- 43 files changed, 49 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index 5ab41d62f13dc..a25c457deb905 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "**/@types/chai": "^4.2.11", "**/cypress/@types/lodash": "^4.14.159", "**/cypress/lodash": "^4.17.20", - "**/typescript": "4.0.0-dev.20200730", + "**/typescript": "4.0.1-rc", "**/graphql-toolkit/lodash": "^4.17.15", "**/hoist-non-react-statics": "^3.3.2", "**/isomorphic-git/**/base64-js": "^1.2.1", @@ -471,7 +471,7 @@ "supertest-as-promised": "^4.0.2", "tape": "^4.13.0", "tree-kill": "^1.2.2", - "typescript": "4.0.0-dev.20200730", + "typescript": "4.0.1-rc", "typings-tester": "^0.3.2", "vinyl-fs": "^3.0.3", "xml2js": "^0.4.22", diff --git a/packages/kbn-analytics/package.json b/packages/kbn-analytics/package.json index 7b7c78d3381d8..3cf3e656b51cf 100644 --- a/packages/kbn-analytics/package.json +++ b/packages/kbn-analytics/package.json @@ -17,6 +17,6 @@ "@babel/cli": "^7.10.5", "@kbn/dev-utils": "1.0.0", "@kbn/babel-preset": "1.0.0", - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/packages/kbn-config-schema/package.json b/packages/kbn-config-schema/package.json index 8469dcce9d3b5..6759a5591dbd5 100644 --- a/packages/kbn-config-schema/package.json +++ b/packages/kbn-config-schema/package.json @@ -10,7 +10,7 @@ "kbn:bootstrap": "yarn build" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730", + "typescript": "4.0.1-rc", "tsd": "^0.7.4" }, "peerDependencies": { diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index 08e6fb4457980..a04a0533fb282 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -25,7 +25,7 @@ "tslib": "^2.0.0" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730", + "typescript": "4.0.1-rc", "@kbn/expect": "1.0.0", "chance": "1.0.18" } diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index a23128029369b..6ed1d75973b20 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -21,7 +21,7 @@ "del": "^5.1.0", "getopts": "^2.2.4", "supports-color": "^7.0.0", - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" }, "dependencies": { "intl-format-cache": "^2.1.0", diff --git a/packages/kbn-monaco/package.json b/packages/kbn-monaco/package.json index a20f28c4dfd81..b23e0e73ac1ff 100644 --- a/packages/kbn-monaco/package.json +++ b/packages/kbn-monaco/package.json @@ -20,7 +20,7 @@ "del": "^5.1.0", "raw-loader": "3.1.0", "supports-color": "^7.0.0", - "typescript": "4.0.0-dev.20200730", + "typescript": "4.0.1-rc", "webpack": "^4.41.5", "webpack-cli": "^3.3.10" } diff --git a/packages/kbn-plugin-helpers/package.json b/packages/kbn-plugin-helpers/package.json index e0debea412c70..3ed42fe803862 100644 --- a/packages/kbn-plugin-helpers/package.json +++ b/packages/kbn-plugin-helpers/package.json @@ -35,7 +35,7 @@ "@types/through2": "^2.0.35", "@types/through2-map": "^3.0.0", "@types/vinyl": "^2.0.4", - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" }, "peerDependencies": { "@kbn/babel-preset": "1.0.0" diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index 9aa4c15d3fbea..6309d18e95cfb 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -59,7 +59,7 @@ "strip-ansi": "^4.0.0", "strong-log-transformer": "^2.1.0", "tempy": "^0.3.0", - "typescript": "4.0.0-dev.20200730", + "typescript": "4.0.1-rc", "unlazy-loader": "^0.1.3", "webpack": "^4.41.5", "webpack-cli": "^3.3.10", diff --git a/packages/kbn-release-notes/package.json b/packages/kbn-release-notes/package.json index 49b00e6a9be07..32a38d05db3b7 100644 --- a/packages/kbn-release-notes/package.json +++ b/packages/kbn-release-notes/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "markdown-it": "^10.0.0", - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } -} \ No newline at end of file +} diff --git a/packages/kbn-telemetry-tools/package.json b/packages/kbn-telemetry-tools/package.json index 92e1bcdaea973..20a5679bb10d3 100644 --- a/packages/kbn-telemetry-tools/package.json +++ b/packages/kbn-telemetry-tools/package.json @@ -17,6 +17,6 @@ "normalize-path": "^3.0.0", "@types/lodash": "^3.10.1", "moment": "^2.24.0", - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json index fe856aab8b958..42983b295e035 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/app_link_test/package.json b/test/plugin_functional/plugins/app_link_test/package.json index 941c9d152dac8..33831a119e046 100644 --- a/test/plugin_functional/plugins/app_link_test/package.json +++ b/test/plugin_functional/plugins/app_link_test/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/core_app_status/package.json b/test/plugin_functional/plugins/core_app_status/package.json index 3a73ef84116be..f5a54fa8e8813 100644 --- a/test/plugin_functional/plugins/core_app_status/package.json +++ b/test/plugin_functional/plugins/core_app_status/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/core_plugin_a/package.json b/test/plugin_functional/plugins/core_plugin_a/package.json index c9956932c8db7..c7779a2d55e3e 100644 --- a/test/plugin_functional/plugins/core_plugin_a/package.json +++ b/test/plugin_functional/plugins/core_plugin_a/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/core_plugin_appleave/package.json b/test/plugin_functional/plugins/core_plugin_appleave/package.json index 4539a0a72120a..cac20d171a165 100644 --- a/test/plugin_functional/plugins/core_plugin_appleave/package.json +++ b/test/plugin_functional/plugins/core_plugin_appleave/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/core_plugin_b/package.json b/test/plugin_functional/plugins/core_plugin_b/package.json index aea1755343dc6..afd72b1279a7e 100644 --- a/test/plugin_functional/plugins/core_plugin_b/package.json +++ b/test/plugin_functional/plugins/core_plugin_b/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/core_plugin_chromeless/package.json b/test/plugin_functional/plugins/core_plugin_chromeless/package.json index 7e4d275789c5a..624f7492ebfaa 100644 --- a/test/plugin_functional/plugins/core_plugin_chromeless/package.json +++ b/test/plugin_functional/plugins/core_plugin_chromeless/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json b/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json index 94e290ddc0517..9c414e0f58e24 100644 --- a/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json +++ b/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/core_plugin_static_assets/package.json b/test/plugin_functional/plugins/core_plugin_static_assets/package.json index 34ebb90bbad27..3ef7a3127152b 100644 --- a/test/plugin_functional/plugins/core_plugin_static_assets/package.json +++ b/test/plugin_functional/plugins/core_plugin_static_assets/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/core_provider_plugin/package.json b/test/plugin_functional/plugins/core_provider_plugin/package.json index 643d7f2440591..a6d12651ad41b 100644 --- a/test/plugin_functional/plugins/core_provider_plugin/package.json +++ b/test/plugin_functional/plugins/core_provider_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/doc_views_plugin/package.json b/test/plugin_functional/plugins/doc_views_plugin/package.json index 4bfaa41e691f2..02966adb61f99 100644 --- a/test/plugin_functional/plugins/doc_views_plugin/package.json +++ b/test/plugin_functional/plugins/doc_views_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json b/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json index f1a56768f04d2..48989a04abf68 100644 --- a/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json +++ b/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json @@ -10,6 +10,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/index_patterns/package.json b/test/plugin_functional/plugins/index_patterns/package.json index 3c74482c1c712..e9a6ea6c5e0de 100644 --- a/test/plugin_functional/plugins/index_patterns/package.json +++ b/test/plugin_functional/plugins/index_patterns/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } -} \ No newline at end of file +} diff --git a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json index f274117c511c8..528103fbf6576 100644 --- a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json @@ -16,6 +16,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/kbn_top_nav/package.json b/test/plugin_functional/plugins/kbn_top_nav/package.json index e9416e8419b93..f1fc0c164bd6f 100644 --- a/test/plugin_functional/plugins/kbn_top_nav/package.json +++ b/test/plugin_functional/plugins/kbn_top_nav/package.json @@ -12,7 +12,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json index db95e9a8ba87b..e63cdeacea90d 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/management_test_plugin/package.json b/test/plugin_functional/plugins/management_test_plugin/package.json index f2712a8349987..7f1f0d4342e24 100644 --- a/test/plugin_functional/plugins/management_test_plugin/package.json +++ b/test/plugin_functional/plugins/management_test_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/rendering_plugin/package.json b/test/plugin_functional/plugins/rendering_plugin/package.json index 3660de7bc50b3..21590eab577c1 100644 --- a/test/plugin_functional/plugins/rendering_plugin/package.json +++ b/test/plugin_functional/plugins/rendering_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/test/plugin_functional/plugins/ui_settings_plugin/package.json b/test/plugin_functional/plugins/ui_settings_plugin/package.json index 055d02ab62d86..b1650ca700943 100644 --- a/test/plugin_functional/plugins/ui_settings_plugin/package.json +++ b/test/plugin_functional/plugins/ui_settings_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/x-pack/examples/ui_actions_enhanced_examples/package.json b/x-pack/examples/ui_actions_enhanced_examples/package.json index def1693e89d53..412977b71daca 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/package.json +++ b/x-pack/examples/ui_actions_enhanced_examples/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/x-pack/package.json b/x-pack/package.json index 567e829fe5263..7daba83301071 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -193,7 +193,7 @@ "tmp": "0.1.0", "tree-kill": "^1.2.2", "ts-loader": "^6.0.4", - "typescript": "4.0.0-dev.20200730", + "typescript": "4.0.1-rc", "vinyl-fs": "^3.0.3", "whatwg-fetch": "^3.0.0", "xml-crypto": "^1.4.0", diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json index 696ab843e807f..30ca1bcbc0045 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json index 06c4c1ae223dc..406a8150ff2a1 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json index 202ea952b4a9c..83010be844820 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json index fe3b905106ee0..d55ca4541f5a5 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "3.7.2" + "typescript": "4.0.1-rc" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json index 5524d9716b4b1..8333f13982b2a 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json b/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json index 4dce5d1eece7b..195b6e5af0559 100644 --- a/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json +++ b/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json @@ -9,6 +9,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json index e41c016f04ae0..63ad19d96d41d 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json +++ b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json @@ -10,6 +10,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json b/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json index 501ddf65e7053..e3888734e374b 100644 --- a/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json +++ b/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json @@ -9,6 +9,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/x-pack/test/plugin_api_integration/plugins/event_log/package.json b/x-pack/test/plugin_api_integration/plugins/event_log/package.json index 1b42c2cf48378..cb4bebaba0ca5 100644 --- a/x-pack/test/plugin_api_integration/plugins/event_log/package.json +++ b/x-pack/test/plugin_api_integration/plugins/event_log/package.json @@ -10,6 +10,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" } } diff --git a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json index 9a32d9bd9f28b..3cc9c79351d48 100644 --- a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json +++ b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" }, "license": "Apache-2.0", "dependencies": {} diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json index 4575927576ebd..1cd2f95315923 100644 --- a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json @@ -16,7 +16,7 @@ "pretty-ms": "5.0.0" }, "devDependencies": { - "typescript": "4.0.0-dev.20200730" + "typescript": "4.0.1-rc" }, "license": "Apache-2.0" } diff --git a/yarn.lock b/yarn.lock index 8546f8807447b..c9c3af0522bd6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28883,10 +28883,10 @@ typescript-tuple@^2.2.1: dependencies: typescript-compare "^0.0.2" -typescript@4.0.0-dev.20200730, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.7.2: - version "4.0.0-dev.20200730" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.0-dev.20200730.tgz#0c1e874cbbfc702c32d9ac261c2f9dc9c37b14c1" - integrity sha512-bqw862eRy5niIZgCJTmn9DqkHTPoCF2eLlLA6jmOvubOgN8BNQrsaf+fE4PQkhzk9ae1/T9iAmDhapgmwWMHIA== +typescript@4.0.1-rc, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.7.2: + version "4.0.1-rc" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.1-rc.tgz#8adc78223eae56fe71d906a5fa90c3543b07a677" + integrity sha512-TCkspT3dSKOykbzS3/WSK7pqU2h1d/lEO6i45Afm5Y3XNAEAo8YXTG3kHOQk/wFq/5uPyO1+X8rb/Q+g7UsxJw== typings-tester@^0.3.2: version "0.3.2" From 4741fc2923c7c45099fe925ddd8f70a1656432f2 Mon Sep 17 00:00:00 2001 From: restrry Date: Wed, 19 Aug 2020 10:09:38 +0200 Subject: [PATCH 20/34] fix new errors in master --- .../server/builtin_action_types/lib/send_email.test.ts | 3 +++ .../apm/server/lib/ui_filters/local_ui_filters/index.ts | 7 +++---- .../infra/public/pages/link_to/redirect_to_node_logs.tsx | 3 ++- .../server/session_management/session_cookie.test.ts | 1 + 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts b/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts index c4cf923ae73ee..f69a2fc1d209c 100644 --- a/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts +++ b/x-pack/plugins/actions/server/builtin_action_types/lib/send_email.test.ts @@ -76,8 +76,11 @@ describe('send_email module', () => { rejectUnauthorizedCertificates: false, } ); + // @ts-expect-error delete sendEmailOptions.transport.service; + // @ts-expect-error delete sendEmailOptions.transport.user; + // @ts-expect-error delete sendEmailOptions.transport.password; const result = await sendEmail(mockLogger, sendEmailOptions); expect(result).toBe(sendMailMockResult); diff --git a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/index.ts b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/index.ts index 12c02679d0859..78c4abd75f2ee 100644 --- a/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/index.ts +++ b/x-pack/plugins/apm/server/lib/ui_filters/local_ui_filters/index.ts @@ -52,10 +52,9 @@ export async function getLocalUIFilters({ buckets.map((bucket) => { return { name: bucket.key as string, - count: - 'bucket_count' in bucket - ? bucket.bucket_count.value - : bucket.doc_count, + count: bucket.bucket_count + ? bucket.bucket_count.value + : bucket.doc_count, }; }), 'count', diff --git a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx index d1d4b829fefc1..a32e1e68141b5 100644 --- a/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx +++ b/x-pack/plugins/infra/public/pages/link_to/redirect_to_node_logs.tsx @@ -9,6 +9,7 @@ import flowRight from 'lodash/flowRight'; import React from 'react'; import { Redirect, RouteComponentProps } from 'react-router-dom'; import { useMount } from 'react-use'; +import { HttpStart } from 'src/core/public'; import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; import { findInventoryFields } from '../../../common/inventory_models'; import { InventoryItemType } from '../../../common/inventory_models/types'; @@ -32,7 +33,7 @@ export const RedirectToNodeLogs = ({ }, location, }: RedirectToNodeLogsType) => { - const { services } = useKibana(); + const { services } = useKibana<{ http: HttpStart }>(); const { isLoading, loadSourceConfiguration, sourceConfiguration } = useLogSource({ fetch: services.http.fetch, sourceId, diff --git a/x-pack/plugins/security/server/session_management/session_cookie.test.ts b/x-pack/plugins/security/server/session_management/session_cookie.test.ts index 584988d201a22..cccdde0cc004f 100644 --- a/x-pack/plugins/security/server/session_management/session_cookie.test.ts +++ b/x-pack/plugins/security/server/session_management/session_cookie.test.ts @@ -110,6 +110,7 @@ describe('Session cookie', () => { it('returns `null` and clears session value if it is in incompatible format', async () => { const invalidValue = sessionCookieMock.createValue(); + // @ts-expect-error delete invalidValue.sid; mockSessionStorage.get.mockResolvedValue(invalidValue); From e3819159216c6d7509d54d6ee3c953b67ffaa13a Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 20 Aug 2020 11:25:28 +0200 Subject: [PATCH 21/34] bump typescript-eslint to version supporting TS v4 syntax --- package.json | 4 +- packages/eslint-config-kibana/package.json | 4 +- yarn.lock | 64 +++++++++++----------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index 073c864eb8a0e..f780f943cf1bc 100644 --- a/package.json +++ b/package.json @@ -381,8 +381,8 @@ "@types/vinyl": "^2.0.4", "@types/vinyl-fs": "^2.4.11", "@types/zen-observable": "^0.8.0", - "@typescript-eslint/eslint-plugin": "^3.7.1", - "@typescript-eslint/parser": "^3.7.1", + "@typescript-eslint/eslint-plugin": "^3.9.1", + "@typescript-eslint/parser": "^3.9.1", "angular-mocks": "^1.7.9", "archiver": "^3.1.1", "axe-core": "^3.4.1", diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index 618f71daf0339..03399bbf857c1 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -15,8 +15,8 @@ }, "homepage": "https://github.com/elastic/kibana/tree/master/packages/eslint-config-kibana", "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^3.7.1", - "@typescript-eslint/parser": "^3.7.1", + "@typescript-eslint/eslint-plugin": "^3.9.1", + "@typescript-eslint/parser": "^3.9.1", "babel-eslint": "^10.0.3", "eslint": "^6.8.0", "eslint-plugin-babel": "^5.3.0", diff --git a/yarn.lock b/yarn.lock index ee10b646a62a0..c7171a95c387c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4981,26 +4981,26 @@ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d" integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg== -"@typescript-eslint/eslint-plugin@^3.7.1": - version "3.7.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.7.1.tgz#d144c49a9a0ffe8dd704bb179c243df76c111bc9" - integrity sha512-3DB9JDYkMrc8Au00rGFiJLK2Ja9CoMP6Ut0sHsXp3ZtSugjNxvSSHTnKLfo4o+QmjYBJqEznDqsG1zj4F2xnsg== +"@typescript-eslint/eslint-plugin@^3.9.1": + version "3.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.1.tgz#8cf27b6227d12d66dd8dc1f1a4b04d1daad51c2e" + integrity sha512-XIr+Mfv7i4paEdBf0JFdIl9/tVxyj+rlilWIfZ97Be0lZ7hPvUbS5iHt9Glc8kRI53dsr0PcAEudbf8rO2wGgg== dependencies: - "@typescript-eslint/experimental-utils" "3.7.1" + "@typescript-eslint/experimental-utils" "3.9.1" debug "^4.1.1" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@3.7.1": - version "3.7.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.7.1.tgz#ab036caaed4c870d22531d41f9352f3147364d61" - integrity sha512-TqE97pv7HrqWcGJbLbZt1v59tcqsSVpWTOf1AqrWK7n8nok2sGgVtYRuGXeNeLw3wXlLEbY1MKP3saB2HsO/Ng== +"@typescript-eslint/experimental-utils@3.9.1": + version "3.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.1.tgz#b140b2dc7a7554a44f8a86fb6fe7cbfe57ca059e" + integrity sha512-lkiZ8iBBaYoyEKhCkkw4SAeatXyBq9Ece5bZXdLe1LWBUwTszGbmbiqmQbwWA8cSYDnjWXp9eDbXpf9Sn0hLAg== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/types" "3.7.1" - "@typescript-eslint/typescript-estree" "3.7.1" + "@typescript-eslint/types" "3.9.1" + "@typescript-eslint/typescript-estree" "3.9.1" eslint-scope "^5.0.0" eslint-utils "^2.0.0" @@ -5013,21 +5013,21 @@ "@typescript-eslint/typescript-estree" "2.15.0" eslint-scope "^5.0.0" -"@typescript-eslint/parser@^3.7.1": - version "3.7.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.7.1.tgz#5d9ccecb116d12d9c6073e9861c57c9b1aa88128" - integrity sha512-W4QV/gXvfIsccN8225784LNOorcm7ch68Fi3V4Wg7gmkWSQRKevO4RrRqWo6N/Z/myK1QAiGgeaXN57m+R/8iQ== +"@typescript-eslint/parser@^3.9.1": + version "3.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.9.1.tgz#ab7983abaea0ae138ff5671c7c7739d8a191b181" + integrity sha512-y5QvPFUn4Vl4qM40lI+pNWhTcOWtpZAJ8pOEQ21fTTW4xTJkRplMjMRje7LYTXqVKKX9GJhcyweMz2+W1J5bMg== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "3.7.1" - "@typescript-eslint/types" "3.7.1" - "@typescript-eslint/typescript-estree" "3.7.1" + "@typescript-eslint/experimental-utils" "3.9.1" + "@typescript-eslint/types" "3.9.1" + "@typescript-eslint/typescript-estree" "3.9.1" eslint-visitor-keys "^1.1.0" -"@typescript-eslint/types@3.7.1": - version "3.7.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.7.1.tgz#90375606b2fd73c1224fe9e397ee151e28fa1e0c" - integrity sha512-PZe8twm5Z4b61jt7GAQDor6KiMhgPgf4XmUb9zdrwTbgtC/Sj29gXP1dws9yEn4+aJeyXrjsD9XN7AWFhmnUfg== +"@typescript-eslint/types@3.9.1": + version "3.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.9.1.tgz#b2a6eaac843cf2f2777b3f2464fb1fbce5111416" + integrity sha512-15JcTlNQE1BsYy5NBhctnEhEoctjXOjOK+Q+rk8ugC+WXU9rAcS2BYhoh6X4rOaXJEpIYDl+p7ix+A5U0BqPTw== "@typescript-eslint/typescript-estree@2.15.0": version "2.15.0" @@ -5042,13 +5042,13 @@ semver "^6.3.0" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@3.7.1": - version "3.7.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.7.1.tgz#ce1ffbd0fa53f34d4ce851a7a364e392432f6eb3" - integrity sha512-m97vNZkI08dunYOr2lVZOHoyfpqRs0KDpd6qkGaIcLGhQ2WPtgHOd/eVbsJZ0VYCQvupKrObAGTOvk3tfpybYA== +"@typescript-eslint/typescript-estree@3.9.1": + version "3.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.1.tgz#fd81cada74bc8a7f3a2345b00897acb087935779" + integrity sha512-IqM0gfGxOmIKPhiHW/iyAEXwSVqMmR2wJ9uXHNdFpqVvPaQ3dWg302vW127sBpAiqM9SfHhyS40NKLsoMpN2KA== dependencies: - "@typescript-eslint/types" "3.7.1" - "@typescript-eslint/visitor-keys" "3.7.1" + "@typescript-eslint/types" "3.9.1" + "@typescript-eslint/visitor-keys" "3.9.1" debug "^4.1.1" glob "^7.1.6" is-glob "^4.0.1" @@ -5064,10 +5064,10 @@ lodash.unescape "4.0.1" semver "5.5.0" -"@typescript-eslint/visitor-keys@3.7.1": - version "3.7.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.7.1.tgz#b90191e74efdee656be8c5a30f428ed16dda46d1" - integrity sha512-xn22sQbEya+Utj2IqJHGLA3i1jDzR43RzWupxojbSWnj3nnPLavaQmWe5utw03CwYao3r00qzXfgJMGNkrzrAA== +"@typescript-eslint/visitor-keys@3.9.1": + version "3.9.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.1.tgz#92af3747cdb71509199a8f7a4f00b41d636551d1" + integrity sha512-zxdtUjeoSh+prCpogswMwVUJfEFmCOjdzK9rpNjNBfm6EyPt99x3RrJoBOGZO23FCt0WPKUCOL5mb/9D5LjdwQ== dependencies: eslint-visitor-keys "^1.1.0" From 1a96c4e107b9d0fce1c7fac4f5bcb1f33c377aa9 Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 20 Aug 2020 11:51:19 +0200 Subject: [PATCH 22/34] fix merge commit errors --- .../sections/agent_policy/create_package_policy_page/index.tsx | 2 +- .../sections/agent_policy/edit_package_policy_page/index.tsx | 2 +- .../server/saved_objects/migrations/to_v7_10_0.ts | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_policy/create_package_policy_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_policy/create_package_policy_page/index.tsx index deb62db82f5d8..1456d56222b4f 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_policy/create_package_policy_page/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_policy/create_package_policy_page/index.tsx @@ -65,7 +65,7 @@ export const CreatePackagePolicyPage: React.FunctionComponent = () => { } = useConfig(); const { params: { policyId, pkgkey }, - } = useRouteMatch<{ policyId?: string; pkgkey: string }>(); + } = useRouteMatch<{ policyId: string; pkgkey: string }>(); const { getHref, getPath } = useLink(); const history = useHistory(); const routeState = useIntraAppState(); diff --git a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_policy/edit_package_policy_page/index.tsx b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_policy/edit_package_policy_page/index.tsx index 499bcefe6528f..db76c3db9a983 100644 --- a/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_policy/edit_package_policy_page/index.tsx +++ b/x-pack/plugins/ingest_manager/public/applications/ingest_manager/sections/agent_policy/edit_package_policy_page/index.tsx @@ -53,7 +53,7 @@ export const EditPackagePolicyPage: React.FunctionComponent = () => { } = useConfig(); const { params: { policyId, packagePolicyId }, - } = useRouteMatch<{ policyId: string; packageConfigId: string }>(); + } = useRouteMatch<{ policyId: string; packagePolicyId: string }>(); const history = useHistory(); const { getHref, getPath } = useLink(); const [isNavDrawerLocked, setIsNavDrawerLocked] = useState(false); diff --git a/x-pack/plugins/ingest_manager/server/saved_objects/migrations/to_v7_10_0.ts b/x-pack/plugins/ingest_manager/server/saved_objects/migrations/to_v7_10_0.ts index f45b69eaaa79c..b60903dbd2bd0 100644 --- a/x-pack/plugins/ingest_manager/server/saved_objects/migrations/to_v7_10_0.ts +++ b/x-pack/plugins/ingest_manager/server/saved_objects/migrations/to_v7_10_0.ts @@ -42,6 +42,7 @@ export const migrateAgentPolicyToV7100: SavedObjectMigrationFn< AgentPolicy > = (agentPolicyDoc) => { agentPolicyDoc.attributes.package_policies = agentPolicyDoc.attributes.package_configs; + // @ts-expect-error delete agentPolicyDoc.attributes.package_configs; return agentPolicyDoc; @@ -66,6 +67,7 @@ export const migratePackagePolicyToV7100: SavedObjectMigrationFn< PackagePolicy > = (packagePolicyDoc) => { packagePolicyDoc.attributes.policy_id = packagePolicyDoc.attributes.config_id; + // @ts-expect-error delete packagePolicyDoc.attributes.config_id; return packagePolicyDoc; From aaa0fdd89c785a3125751226655fa82be8b65532 Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 20 Aug 2020 22:11:00 +0200 Subject: [PATCH 23/34] update to the stable TS version 4.0.2 --- package.json | 4 ++-- packages/kbn-analytics/package.json | 2 +- packages/kbn-config-schema/package.json | 2 +- packages/kbn-dev-utils/package.json | 2 +- packages/kbn-i18n/package.json | 2 +- packages/kbn-monaco/package.json | 2 +- packages/kbn-plugin-helpers/package.json | 2 +- packages/kbn-pm/package.json | 2 +- packages/kbn-release-notes/package.json | 2 +- packages/kbn-telemetry-tools/package.json | 2 +- .../plugins/kbn_tp_run_pipeline/package.json | 2 +- test/plugin_functional/plugins/app_link_test/package.json | 2 +- .../plugins/core_app_status/package.json | 2 +- test/plugin_functional/plugins/core_plugin_a/package.json | 2 +- .../plugins/core_plugin_appleave/package.json | 2 +- test/plugin_functional/plugins/core_plugin_b/package.json | 2 +- .../plugins/core_plugin_chromeless/package.json | 2 +- .../plugins/core_plugin_route_timeouts/package.json | 2 +- .../plugins/core_plugin_static_assets/package.json | 2 +- .../plugins/core_provider_plugin/package.json | 2 +- .../plugins/doc_views_plugin/package.json | 2 +- .../plugins/elasticsearch_client_plugin/package.json | 2 +- .../plugin_functional/plugins/index_patterns/package.json | 2 +- .../plugins/kbn_sample_panel_action/package.json | 2 +- test/plugin_functional/plugins/kbn_top_nav/package.json | 2 +- .../plugins/kbn_tp_custom_visualizations/package.json | 2 +- .../plugins/management_test_plugin/package.json | 2 +- .../plugins/rendering_plugin/package.json | 2 +- .../plugins/ui_settings_plugin/package.json | 2 +- x-pack/examples/ui_actions_enhanced_examples/package.json | 2 +- x-pack/package.json | 2 +- .../common/fixtures/plugins/aad/package.json | 2 +- .../fixtures/plugins/actions_simulators/package.json | 2 +- .../common/fixtures/plugins/alerts/package.json | 2 +- .../fixtures/plugins/alerts_restricted/package.json | 2 +- .../fixtures/plugins/task_manager_fixture/package.json | 2 +- .../plugins/iframe_embedded/package.json | 2 +- .../fixtures/plugins/alerts/package.json | 2 +- .../plugins/elasticsearch_client/package.json | 2 +- .../plugin_api_integration/plugins/event_log/package.json | 2 +- .../plugins/sample_task_plugin/package.json | 2 +- .../plugins/task_manager_performance/package.json | 2 +- yarn.lock | 8 ++++---- 43 files changed, 47 insertions(+), 47 deletions(-) diff --git a/package.json b/package.json index 24100146ff708..0c71527cdcf50 100644 --- a/package.json +++ b/package.json @@ -86,7 +86,7 @@ "**/@types/chai": "^4.2.11", "**/cypress/@types/lodash": "^4.14.159", "**/cypress/lodash": "^4.17.20", - "**/typescript": "4.0.1-rc", + "**/typescript": "4.0.2", "**/graphql-toolkit/lodash": "^4.17.15", "**/hoist-non-react-statics": "^3.3.2", "**/isomorphic-git/**/base64-js": "^1.2.1", @@ -473,7 +473,7 @@ "supertest-as-promised": "^4.0.2", "tape": "^4.13.0", "tree-kill": "^1.2.2", - "typescript": "4.0.1-rc", + "typescript": "4.0.2", "typings-tester": "^0.3.2", "vinyl-fs": "^3.0.3", "xml2js": "^0.4.22", diff --git a/packages/kbn-analytics/package.json b/packages/kbn-analytics/package.json index 3cf3e656b51cf..b04b5b32d0746 100644 --- a/packages/kbn-analytics/package.json +++ b/packages/kbn-analytics/package.json @@ -17,6 +17,6 @@ "@babel/cli": "^7.10.5", "@kbn/dev-utils": "1.0.0", "@kbn/babel-preset": "1.0.0", - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/packages/kbn-config-schema/package.json b/packages/kbn-config-schema/package.json index 6759a5591dbd5..10b1741d98441 100644 --- a/packages/kbn-config-schema/package.json +++ b/packages/kbn-config-schema/package.json @@ -10,7 +10,7 @@ "kbn:bootstrap": "yarn build" }, "devDependencies": { - "typescript": "4.0.1-rc", + "typescript": "4.0.2", "tsd": "^0.7.4" }, "peerDependencies": { diff --git a/packages/kbn-dev-utils/package.json b/packages/kbn-dev-utils/package.json index a04a0533fb282..768a67794517f 100644 --- a/packages/kbn-dev-utils/package.json +++ b/packages/kbn-dev-utils/package.json @@ -25,7 +25,7 @@ "tslib": "^2.0.0" }, "devDependencies": { - "typescript": "4.0.1-rc", + "typescript": "4.0.2", "@kbn/expect": "1.0.0", "chance": "1.0.18" } diff --git a/packages/kbn-i18n/package.json b/packages/kbn-i18n/package.json index 6ed1d75973b20..680c789bc9d9d 100644 --- a/packages/kbn-i18n/package.json +++ b/packages/kbn-i18n/package.json @@ -21,7 +21,7 @@ "del": "^5.1.0", "getopts": "^2.2.4", "supports-color": "^7.0.0", - "typescript": "4.0.1-rc" + "typescript": "4.0.2" }, "dependencies": { "intl-format-cache": "^2.1.0", diff --git a/packages/kbn-monaco/package.json b/packages/kbn-monaco/package.json index b23e0e73ac1ff..ca133010fe230 100644 --- a/packages/kbn-monaco/package.json +++ b/packages/kbn-monaco/package.json @@ -20,7 +20,7 @@ "del": "^5.1.0", "raw-loader": "3.1.0", "supports-color": "^7.0.0", - "typescript": "4.0.1-rc", + "typescript": "4.0.2", "webpack": "^4.41.5", "webpack-cli": "^3.3.10" } diff --git a/packages/kbn-plugin-helpers/package.json b/packages/kbn-plugin-helpers/package.json index 3ed42fe803862..ba39528a1f809 100644 --- a/packages/kbn-plugin-helpers/package.json +++ b/packages/kbn-plugin-helpers/package.json @@ -35,7 +35,7 @@ "@types/through2": "^2.0.35", "@types/through2-map": "^3.0.0", "@types/vinyl": "^2.0.4", - "typescript": "4.0.1-rc" + "typescript": "4.0.2" }, "peerDependencies": { "@kbn/babel-preset": "1.0.0" diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index 6309d18e95cfb..840d80e36eaf7 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -59,7 +59,7 @@ "strip-ansi": "^4.0.0", "strong-log-transformer": "^2.1.0", "tempy": "^0.3.0", - "typescript": "4.0.1-rc", + "typescript": "4.0.2", "unlazy-loader": "^0.1.3", "webpack": "^4.41.5", "webpack-cli": "^3.3.10", diff --git a/packages/kbn-release-notes/package.json b/packages/kbn-release-notes/package.json index 32a38d05db3b7..12d0122f9a4d3 100644 --- a/packages/kbn-release-notes/package.json +++ b/packages/kbn-release-notes/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "markdown-it": "^10.0.0", - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/packages/kbn-telemetry-tools/package.json b/packages/kbn-telemetry-tools/package.json index 20a5679bb10d3..63a8fcf30335e 100644 --- a/packages/kbn-telemetry-tools/package.json +++ b/packages/kbn-telemetry-tools/package.json @@ -17,6 +17,6 @@ "normalize-path": "^3.0.0", "@types/lodash": "^3.10.1", "moment": "^2.24.0", - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json index 42983b295e035..5d898f1ccdecf 100644 --- a/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json +++ b/test/interpreter_functional/plugins/kbn_tp_run_pipeline/package.json @@ -18,6 +18,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/app_link_test/package.json b/test/plugin_functional/plugins/app_link_test/package.json index 33831a119e046..39b56d89a8f0b 100644 --- a/test/plugin_functional/plugins/app_link_test/package.json +++ b/test/plugin_functional/plugins/app_link_test/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/core_app_status/package.json b/test/plugin_functional/plugins/core_app_status/package.json index f5a54fa8e8813..2bcd741d5a563 100644 --- a/test/plugin_functional/plugins/core_app_status/package.json +++ b/test/plugin_functional/plugins/core_app_status/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/core_plugin_a/package.json b/test/plugin_functional/plugins/core_plugin_a/package.json index c7779a2d55e3e..4cdecda569dbf 100644 --- a/test/plugin_functional/plugins/core_plugin_a/package.json +++ b/test/plugin_functional/plugins/core_plugin_a/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/core_plugin_appleave/package.json b/test/plugin_functional/plugins/core_plugin_appleave/package.json index cac20d171a165..8a63854c83e87 100644 --- a/test/plugin_functional/plugins/core_plugin_appleave/package.json +++ b/test/plugin_functional/plugins/core_plugin_appleave/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/core_plugin_b/package.json b/test/plugin_functional/plugins/core_plugin_b/package.json index afd72b1279a7e..2b4501cb306a9 100644 --- a/test/plugin_functional/plugins/core_plugin_b/package.json +++ b/test/plugin_functional/plugins/core_plugin_b/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/core_plugin_chromeless/package.json b/test/plugin_functional/plugins/core_plugin_chromeless/package.json index 624f7492ebfaa..976ca197a6d51 100644 --- a/test/plugin_functional/plugins/core_plugin_chromeless/package.json +++ b/test/plugin_functional/plugins/core_plugin_chromeless/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json b/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json index 9c414e0f58e24..a198e6ed70018 100644 --- a/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json +++ b/test/plugin_functional/plugins/core_plugin_route_timeouts/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/core_plugin_static_assets/package.json b/test/plugin_functional/plugins/core_plugin_static_assets/package.json index 3ef7a3127152b..0e944276605ff 100644 --- a/test/plugin_functional/plugins/core_plugin_static_assets/package.json +++ b/test/plugin_functional/plugins/core_plugin_static_assets/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/core_provider_plugin/package.json b/test/plugin_functional/plugins/core_provider_plugin/package.json index a6d12651ad41b..ce76df7fdf992 100644 --- a/test/plugin_functional/plugins/core_provider_plugin/package.json +++ b/test/plugin_functional/plugins/core_provider_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/doc_views_plugin/package.json b/test/plugin_functional/plugins/doc_views_plugin/package.json index 02966adb61f99..e6999fc6fe46c 100644 --- a/test/plugin_functional/plugins/doc_views_plugin/package.json +++ b/test/plugin_functional/plugins/doc_views_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json b/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json index 48989a04abf68..575363e83f029 100644 --- a/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json +++ b/test/plugin_functional/plugins/elasticsearch_client_plugin/package.json @@ -10,6 +10,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/index_patterns/package.json b/test/plugin_functional/plugins/index_patterns/package.json index e9a6ea6c5e0de..831f54cf9de8e 100644 --- a/test/plugin_functional/plugins/index_patterns/package.json +++ b/test/plugin_functional/plugins/index_patterns/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json index 528103fbf6576..d82795a043b93 100644 --- a/test/plugin_functional/plugins/kbn_sample_panel_action/package.json +++ b/test/plugin_functional/plugins/kbn_sample_panel_action/package.json @@ -16,6 +16,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/kbn_top_nav/package.json b/test/plugin_functional/plugins/kbn_top_nav/package.json index f1fc0c164bd6f..65986d7288381 100644 --- a/test/plugin_functional/plugins/kbn_top_nav/package.json +++ b/test/plugin_functional/plugins/kbn_top_nav/package.json @@ -12,7 +12,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json index e63cdeacea90d..2dc84f4f973af 100644 --- a/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json +++ b/test/plugin_functional/plugins/kbn_tp_custom_visualizations/package.json @@ -17,6 +17,6 @@ }, "devDependencies": { "@kbn/plugin-helpers": "9.0.2", - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/management_test_plugin/package.json b/test/plugin_functional/plugins/management_test_plugin/package.json index 7f1f0d4342e24..2854e8e332203 100644 --- a/test/plugin_functional/plugins/management_test_plugin/package.json +++ b/test/plugin_functional/plugins/management_test_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/rendering_plugin/package.json b/test/plugin_functional/plugins/rendering_plugin/package.json index 21590eab577c1..a53b47c9a1ecc 100644 --- a/test/plugin_functional/plugins/rendering_plugin/package.json +++ b/test/plugin_functional/plugins/rendering_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/test/plugin_functional/plugins/ui_settings_plugin/package.json b/test/plugin_functional/plugins/ui_settings_plugin/package.json index b1650ca700943..ec3185f8f49f6 100644 --- a/test/plugin_functional/plugins/ui_settings_plugin/package.json +++ b/test/plugin_functional/plugins/ui_settings_plugin/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/x-pack/examples/ui_actions_enhanced_examples/package.json b/x-pack/examples/ui_actions_enhanced_examples/package.json index 412977b71daca..057a0706b59b6 100644 --- a/x-pack/examples/ui_actions_enhanced_examples/package.json +++ b/x-pack/examples/ui_actions_enhanced_examples/package.json @@ -12,6 +12,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/x-pack/package.json b/x-pack/package.json index 94e9614daf817..61fc8919e2e10 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -193,7 +193,7 @@ "tmp": "0.1.0", "tree-kill": "^1.2.2", "ts-loader": "^6.0.4", - "typescript": "4.0.1-rc", + "typescript": "4.0.2", "vinyl-fs": "^3.0.3", "whatwg-fetch": "^3.0.0", "xml-crypto": "^1.4.0", diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json index 30ca1bcbc0045..fbc4d8d92203a 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/aad/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json index 406a8150ff2a1..20afe49fc1f19 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/actions_simulators/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json index 83010be844820..41147ab62d359 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json index d55ca4541f5a5..8d7010879b7d7 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/alerts_restricted/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json index 8333f13982b2a..8b8532af6eecf 100644 --- a/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json +++ b/x-pack/test/alerting_api_integration/common/fixtures/plugins/task_manager_fixture/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" }, "license": "Apache-2.0", "dependencies": { diff --git a/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json b/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json index 195b6e5af0559..c74aa683d6f32 100644 --- a/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json +++ b/x-pack/test/functional_embedded/plugins/iframe_embedded/package.json @@ -9,6 +9,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json index 63ad19d96d41d..f8bafad602269 100644 --- a/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json +++ b/x-pack/test/functional_with_es_ssl/fixtures/plugins/alerts/package.json @@ -10,6 +10,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json b/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json index e3888734e374b..c12de16b9b4af 100644 --- a/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json +++ b/x-pack/test/plugin_api_integration/plugins/elasticsearch_client/package.json @@ -9,6 +9,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/x-pack/test/plugin_api_integration/plugins/event_log/package.json b/x-pack/test/plugin_api_integration/plugins/event_log/package.json index cb4bebaba0ca5..03bef5b8272ba 100644 --- a/x-pack/test/plugin_api_integration/plugins/event_log/package.json +++ b/x-pack/test/plugin_api_integration/plugins/event_log/package.json @@ -10,6 +10,6 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" } } diff --git a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json index 3cc9c79351d48..513443486ad8e 100644 --- a/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json +++ b/x-pack/test/plugin_api_integration/plugins/sample_task_plugin/package.json @@ -11,7 +11,7 @@ "build": "rm -rf './target' && tsc" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" }, "license": "Apache-2.0", "dependencies": {} diff --git a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json index 1cd2f95315923..542c8358114f4 100644 --- a/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json +++ b/x-pack/test/plugin_api_perf/plugins/task_manager_performance/package.json @@ -16,7 +16,7 @@ "pretty-ms": "5.0.0" }, "devDependencies": { - "typescript": "4.0.1-rc" + "typescript": "4.0.2" }, "license": "Apache-2.0" } diff --git a/yarn.lock b/yarn.lock index ef05915d0432e..d7468b542f285 100644 --- a/yarn.lock +++ b/yarn.lock @@ -28586,10 +28586,10 @@ typescript-tuple@^2.2.1: dependencies: typescript-compare "^0.0.2" -typescript@4.0.1-rc, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.7.2: - version "4.0.1-rc" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.1-rc.tgz#8adc78223eae56fe71d906a5fa90c3543b07a677" - integrity sha512-TCkspT3dSKOykbzS3/WSK7pqU2h1d/lEO6i45Afm5Y3XNAEAo8YXTG3kHOQk/wFq/5uPyO1+X8rb/Q+g7UsxJw== +typescript@4.0.2, typescript@^3.0.1, typescript@^3.0.3, typescript@^3.2.2, typescript@^3.3.3333, typescript@^3.4.5, typescript@~3.7.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2" + integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ== typings-tester@^0.3.2: version "0.3.2" From 802bced15ddaf8e891df886b3508cb90f8df0da3 Mon Sep 17 00:00:00 2001 From: restrry Date: Mon, 24 Aug 2020 21:47:20 +0200 Subject: [PATCH 24/34] bump ts-eslint to version supporting ts v4 --- package.json | 4 +- packages/eslint-config-kibana/package.json | 4 +- yarn.lock | 64 +++++++++++----------- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/package.json b/package.json index b5b8cc3ceeebf..156563d93e08f 100644 --- a/package.json +++ b/package.json @@ -381,8 +381,8 @@ "@types/vinyl": "^2.0.4", "@types/vinyl-fs": "^2.4.11", "@types/zen-observable": "^0.8.0", - "@typescript-eslint/eslint-plugin": "^3.9.1", - "@typescript-eslint/parser": "^3.9.1", + "@typescript-eslint/eslint-plugin": "^3.10.0", + "@typescript-eslint/parser": "^3.10.0", "angular-mocks": "^1.7.9", "archiver": "^3.1.1", "axe-core": "^3.4.1", diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index 03399bbf857c1..2838faaae7ded 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -15,8 +15,8 @@ }, "homepage": "https://github.com/elastic/kibana/tree/master/packages/eslint-config-kibana", "peerDependencies": { - "@typescript-eslint/eslint-plugin": "^3.9.1", - "@typescript-eslint/parser": "^3.9.1", + "@typescript-eslint/eslint-plugin": "^3.10.0", + "@typescript-eslint/parser": "^3.10.0s", "babel-eslint": "^10.0.3", "eslint": "^6.8.0", "eslint-plugin-babel": "^5.3.0", diff --git a/yarn.lock b/yarn.lock index b6936a752f12c..dc0ea52ef0fa7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4999,26 +4999,26 @@ resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d" integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg== -"@typescript-eslint/eslint-plugin@^3.9.1": - version "3.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.9.1.tgz#8cf27b6227d12d66dd8dc1f1a4b04d1daad51c2e" - integrity sha512-XIr+Mfv7i4paEdBf0JFdIl9/tVxyj+rlilWIfZ97Be0lZ7hPvUbS5iHt9Glc8kRI53dsr0PcAEudbf8rO2wGgg== +"@typescript-eslint/eslint-plugin@^3.10.0": + version "3.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.0.tgz#40fd53e81639c0d1a515b44e5fdf4c03dfd3cd39" + integrity sha512-Bbeg9JAnSzZ85Y0gpInZscSpifA6SbEgRryaKdP5ZlUjhTKsvZS4GUIE6xAZCjhNTrf4zXXsySo83ZdHL7it0w== dependencies: - "@typescript-eslint/experimental-utils" "3.9.1" + "@typescript-eslint/experimental-utils" "3.10.0" debug "^4.1.1" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@3.9.1": - version "3.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.9.1.tgz#b140b2dc7a7554a44f8a86fb6fe7cbfe57ca059e" - integrity sha512-lkiZ8iBBaYoyEKhCkkw4SAeatXyBq9Ece5bZXdLe1LWBUwTszGbmbiqmQbwWA8cSYDnjWXp9eDbXpf9Sn0hLAg== +"@typescript-eslint/experimental-utils@3.10.0": + version "3.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.0.tgz#f97a669a84a78319ab324cd51169d0c52853a360" + integrity sha512-e5ZLSTuXgqC/Gq3QzK2orjlhTZVXzwxDujQmTBOM1NIVBZgW3wiIZjaXuVutk9R4UltFlwC9UD2+bdxsA7yyNg== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/types" "3.9.1" - "@typescript-eslint/typescript-estree" "3.9.1" + "@typescript-eslint/types" "3.10.0" + "@typescript-eslint/typescript-estree" "3.10.0" eslint-scope "^5.0.0" eslint-utils "^2.0.0" @@ -5031,21 +5031,21 @@ "@typescript-eslint/typescript-estree" "2.15.0" eslint-scope "^5.0.0" -"@typescript-eslint/parser@^3.9.1": - version "3.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.9.1.tgz#ab7983abaea0ae138ff5671c7c7739d8a191b181" - integrity sha512-y5QvPFUn4Vl4qM40lI+pNWhTcOWtpZAJ8pOEQ21fTTW4xTJkRplMjMRje7LYTXqVKKX9GJhcyweMz2+W1J5bMg== +"@typescript-eslint/parser@^3.10.0": + version "3.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.10.0.tgz#820322d990a82265a78f4c1fc9aae03ce95b76ac" + integrity sha512-iJyf3f2HVwscvJR7ySGMXw2DJgIAPKEz8TeU17XVKzgJRV4/VgCeDFcqLzueRe7iFI2gv+Tln4AV88ZOnsCNXg== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "3.9.1" - "@typescript-eslint/types" "3.9.1" - "@typescript-eslint/typescript-estree" "3.9.1" + "@typescript-eslint/experimental-utils" "3.10.0" + "@typescript-eslint/types" "3.10.0" + "@typescript-eslint/typescript-estree" "3.10.0" eslint-visitor-keys "^1.1.0" -"@typescript-eslint/types@3.9.1": - version "3.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.9.1.tgz#b2a6eaac843cf2f2777b3f2464fb1fbce5111416" - integrity sha512-15JcTlNQE1BsYy5NBhctnEhEoctjXOjOK+Q+rk8ugC+WXU9rAcS2BYhoh6X4rOaXJEpIYDl+p7ix+A5U0BqPTw== +"@typescript-eslint/types@3.10.0": + version "3.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.10.0.tgz#b81906674eca94a884345ba0bc1aaf6cd4da912a" + integrity sha512-ktUWSa75heQNwH85GRM7qP/UUrXqx9d6yIdw0iLO9/uE1LILW+i+3+B64dUodUS2WFWLzKTlwfi9giqrODibWg== "@typescript-eslint/typescript-estree@2.15.0": version "2.15.0" @@ -5060,13 +5060,13 @@ semver "^6.3.0" tsutils "^3.17.1" -"@typescript-eslint/typescript-estree@3.9.1": - version "3.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.9.1.tgz#fd81cada74bc8a7f3a2345b00897acb087935779" - integrity sha512-IqM0gfGxOmIKPhiHW/iyAEXwSVqMmR2wJ9uXHNdFpqVvPaQ3dWg302vW127sBpAiqM9SfHhyS40NKLsoMpN2KA== +"@typescript-eslint/typescript-estree@3.10.0": + version "3.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.0.tgz#65df13579a5e53c12afb4f1c5309589e3855a5de" + integrity sha512-yjuY6rmVHRhcUKgXaSPNVloRueGWpFNhxR5EQLzxXfiFSl1U/+FBqHhbaGwtPPEgCSt61QNhZgiFjWT27bgAyw== dependencies: - "@typescript-eslint/types" "3.9.1" - "@typescript-eslint/visitor-keys" "3.9.1" + "@typescript-eslint/types" "3.10.0" + "@typescript-eslint/visitor-keys" "3.10.0" debug "^4.1.1" glob "^7.1.6" is-glob "^4.0.1" @@ -5082,10 +5082,10 @@ lodash.unescape "4.0.1" semver "5.5.0" -"@typescript-eslint/visitor-keys@3.9.1": - version "3.9.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.9.1.tgz#92af3747cdb71509199a8f7a4f00b41d636551d1" - integrity sha512-zxdtUjeoSh+prCpogswMwVUJfEFmCOjdzK9rpNjNBfm6EyPt99x3RrJoBOGZO23FCt0WPKUCOL5mb/9D5LjdwQ== +"@typescript-eslint/visitor-keys@3.10.0": + version "3.10.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.0.tgz#6c0cac867e705a42e2c71b359bf6a10a88a28985" + integrity sha512-g4qftk8lWb/rHZe9uEp8oZSvsJhUvR2cfp7F7qE6DyUD2SsovEs8JDQTRP1xHzsD+pERsEpYNqkDgQXW6+ob5A== dependencies: eslint-visitor-keys "^1.1.0" From b2cda91c0f14ec2a85cc2e0461196cfb7694509e Mon Sep 17 00:00:00 2001 From: restrry Date: Tue, 25 Aug 2020 15:33:07 +0200 Subject: [PATCH 25/34] fix typo --- packages/eslint-config-kibana/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index 2838faaae7ded..4ec3bcdfd7c05 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -16,7 +16,7 @@ "homepage": "https://github.com/elastic/kibana/tree/master/packages/eslint-config-kibana", "peerDependencies": { "@typescript-eslint/eslint-plugin": "^3.10.0", - "@typescript-eslint/parser": "^3.10.0s", + "@typescript-eslint/parser": "^3.10.0", "babel-eslint": "^10.0.3", "eslint": "^6.8.0", "eslint-plugin-babel": "^5.3.0", From c1203c6594465d8490bcfc2d803d6f23f080c1bc Mon Sep 17 00:00:00 2001 From: restrry Date: Wed, 26 Aug 2020 09:51:40 +0200 Subject: [PATCH 26/34] fix type errors after merge --- .../client_integration/edit_policy/edit_policy.test.ts | 2 +- .../public/application/services/policies/cold_phase.ts | 2 ++ .../public/application/services/policies/warm_phase.ts | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts index aea85342ed99a..b465afb8b5d9f 100644 --- a/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts +++ b/x-pack/plugins/index_lifecycle_management/__jest__/client_integration/edit_policy/edit_policy.test.ts @@ -101,7 +101,7 @@ describe('', () => { }, }, }; - // @ts-expect-error + delete expected.phases.delete.actions.wait_for_snapshot; const latestRequest = server.requests[server.requests.length - 1]; diff --git a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/cold_phase.ts b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/cold_phase.ts index d9ed7a0bf51eb..6cc43042ed4ff 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/cold_phase.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/cold_phase.ts @@ -90,6 +90,7 @@ export const coldPhaseToES = ( }; } else { if (esPhase.actions.allocate) { + // @ts-expect-error delete esPhase.actions.allocate.require; } } @@ -99,6 +100,7 @@ export const coldPhaseToES = ( esPhase.actions.allocate.number_of_replicas = parseInt(phase.selectedReplicaCount, 10); } else { if (esPhase.actions.allocate) { + // @ts-expect-error delete esPhase.actions.allocate.number_of_replicas; } } diff --git a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/warm_phase.ts b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/warm_phase.ts index 3ca1a1cc83371..c331f4ccce38f 100644 --- a/x-pack/plugins/index_lifecycle_management/public/application/services/policies/warm_phase.ts +++ b/x-pack/plugins/index_lifecycle_management/public/application/services/policies/warm_phase.ts @@ -96,6 +96,7 @@ export const warmPhaseToES = ( // An index lifecycle switches to warm phase when rollover occurs, so you cannot specify a warm phase time // They are mutually exclusive if (phase.warmPhaseOnRollover) { + // @ts-expect-error delete esPhase.min_age; } @@ -109,6 +110,7 @@ export const warmPhaseToES = ( }; } else { if (esPhase.actions.allocate) { + // @ts-expect-error delete esPhase.actions.allocate.require; } } @@ -118,6 +120,7 @@ export const warmPhaseToES = ( esPhase.actions.allocate.number_of_replicas = parseInt(phase.selectedReplicaCount, 10); } else { if (esPhase.actions.allocate) { + // @ts-expect-error delete esPhase.actions.allocate.number_of_replicas; } } From 68214e22403282d06a51a59e29067dd446a6bf17 Mon Sep 17 00:00:00 2001 From: restrry Date: Wed, 26 Aug 2020 11:07:46 +0200 Subject: [PATCH 27/34] update ts in another new package.json --- x-pack/plugins/apm/e2e/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/apm/e2e/package.json b/x-pack/plugins/apm/e2e/package.json index d113b465fdf2f..56204b5fb9f9d 100644 --- a/x-pack/plugins/apm/e2e/package.json +++ b/x-pack/plugins/apm/e2e/package.json @@ -17,7 +17,7 @@ "p-limit": "^3.0.1", "p-retry": "^4.2.0", "ts-loader": "^7.0.5", - "typescript": "3.9.6", + "typescript": "4.0.2", "wait-on": "^5.0.1", "webpack": "^4.43.0", "yargs": "^15.4.0" From dc0fc3bae67a5eab43af06cf9fec80119966d3fc Mon Sep 17 00:00:00 2001 From: restrry Date: Wed, 26 Aug 2020 12:01:59 +0200 Subject: [PATCH 28/34] TEMP: remove me --- test/plugin_functional/test_suites/core_plugins/applications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin_functional/test_suites/core_plugins/applications.ts b/test/plugin_functional/test_suites/core_plugins/applications.ts index 9ecef65f5f09a..8acd7eb35ad9b 100644 --- a/test/plugin_functional/test_suites/core_plugins/applications.ts +++ b/test/plugin_functional/test_suites/core_plugins/applications.ts @@ -126,7 +126,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide expect(await appsMenu.linkExists('Chromeless')).to.be(false); }); - it('navigating to chromeless application hides chrome', async () => { + it.skip('navigating to chromeless application hides chrome', async () => { await PageObjects.common.navigateToApp('chromeless'); await loadingScreenNotShown(); expect(await testSubjects.exists('headerGlobalNav')).to.be(false); From 0190a92210fa0d998065526e723014b0b142873a Mon Sep 17 00:00:00 2001 From: restrry Date: Wed, 26 Aug 2020 12:08:19 +0200 Subject: [PATCH 29/34] Revert "TEMP: remove me" This reverts commit dc0fc3bae67a5eab43af06cf9fec80119966d3fc. --- test/plugin_functional/test_suites/core_plugins/applications.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/plugin_functional/test_suites/core_plugins/applications.ts b/test/plugin_functional/test_suites/core_plugins/applications.ts index 8acd7eb35ad9b..9ecef65f5f09a 100644 --- a/test/plugin_functional/test_suites/core_plugins/applications.ts +++ b/test/plugin_functional/test_suites/core_plugins/applications.ts @@ -126,7 +126,7 @@ export default function ({ getService, getPageObjects }: PluginFunctionalProvide expect(await appsMenu.linkExists('Chromeless')).to.be(false); }); - it.skip('navigating to chromeless application hides chrome', async () => { + it('navigating to chromeless application hides chrome', async () => { await PageObjects.common.navigateToApp('chromeless'); await loadingScreenNotShown(); expect(await testSubjects.exists('headerGlobalNav')).to.be(false); From 7271d039ae38953d10fc057e6ed68d903fbd1d09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Ferna=CC=81ndez=20Haro?= Date: Wed, 26 Aug 2020 17:58:21 +0100 Subject: [PATCH 30/34] [Telemetry] Update snapshot for new TS4 SyntaxKind --- .../src/tools/__snapshots__/extract_collectors.test.ts.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/kbn-telemetry-tools/src/tools/__snapshots__/extract_collectors.test.ts.snap b/packages/kbn-telemetry-tools/src/tools/__snapshots__/extract_collectors.test.ts.snap index 093b89a98d01c..68b068b0cfe06 100644 --- a/packages/kbn-telemetry-tools/src/tools/__snapshots__/extract_collectors.test.ts.snap +++ b/packages/kbn-telemetry-tools/src/tools/__snapshots__/extract_collectors.test.ts.snap @@ -99,11 +99,11 @@ Array [ "": Object { "@@INDEX@@": Object { "count_1": Object { - "kind": 140, + "kind": 143, "type": "NumberKeyword", }, "count_2": Object { - "kind": 140, + "kind": 143, "type": "NumberKeyword", }, }, @@ -167,7 +167,7 @@ Array [ "my_index_signature_prop": Object { "": Object { "@@INDEX@@": Object { - "kind": 140, + "kind": 143, "type": "NumberKeyword", }, }, From de8c29ca95b9445c4137117120af39e37640ce5a Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Wed, 26 Aug 2020 20:59:47 +0200 Subject: [PATCH 31/34] bump prettier to support TS v4 syntax --- package.json | 4 ++-- packages/kbn-plugin-generator/package.json | 2 +- packages/kbn-pm/package.json | 2 +- packages/kbn-spec-to-console/package.json | 2 +- yarn.lock | 16 ++++++++-------- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index 98ced9ab4d416..767f6ad80bca9 100644 --- a/package.json +++ b/package.json @@ -380,7 +380,7 @@ "eslint-plugin-no-unsanitized": "^3.0.2", "eslint-plugin-node": "^11.0.0", "eslint-plugin-prefer-object-spread": "^1.2.1", - "eslint-plugin-prettier": "^3.1.3", + "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-react": "^7.20.3", "eslint-plugin-react-hooks": "^4.0.4", "eslint-plugin-react-perf": "^3.2.3", @@ -442,7 +442,7 @@ "pkg-up": "^2.0.0", "pngjs": "^3.4.0", "postcss": "^7.0.32", - "prettier": "^2.0.5", + "prettier": "^2.1.1", "prop-types": "15.6.0", "proxyquire": "1.8.0", "react-grid-layout": "^0.16.2", diff --git a/packages/kbn-plugin-generator/package.json b/packages/kbn-plugin-generator/package.json index 89e4251bd7802..1d9637c8279da 100644 --- a/packages/kbn-plugin-generator/package.json +++ b/packages/kbn-plugin-generator/package.json @@ -14,7 +14,7 @@ "execa": "^4.0.2", "inquirer": "^7.3.3", "normalize-path": "^3.0.0", - "prettier": "^2.0.5", + "prettier": "^2.1.1", "vinyl": "^2.2.0", "vinyl-fs": "^3.0.3" }, diff --git a/packages/kbn-pm/package.json b/packages/kbn-pm/package.json index 840d80e36eaf7..914ca2fd65fa2 100644 --- a/packages/kbn-pm/package.json +++ b/packages/kbn-pm/package.json @@ -51,7 +51,7 @@ "multimatch": "^4.0.0", "ncp": "^2.0.0", "ora": "^1.4.0", - "prettier": "^2.0.5", + "prettier": "^2.1.1", "read-pkg": "^5.2.0", "rxjs": "^6.5.5", "spawn-sync": "^1.0.15", diff --git a/packages/kbn-spec-to-console/package.json b/packages/kbn-spec-to-console/package.json index 5423bc3fd4ecd..63ce93ac54f46 100644 --- a/packages/kbn-spec-to-console/package.json +++ b/packages/kbn-spec-to-console/package.json @@ -18,7 +18,7 @@ "homepage": "https://github.com/jbudz/spec-to-console#readme", "devDependencies": { "jest": "^25.5.4", - "prettier": "^2.0.5" + "prettier": "^2.1.1" }, "dependencies": { "commander": "^3.0.0", diff --git a/yarn.lock b/yarn.lock index 1efcbdc78a011..d3994337301cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -11979,10 +11979,10 @@ eslint-plugin-prefer-object-spread@^1.2.1: resolved "https://registry.yarnpkg.com/eslint-plugin-prefer-object-spread/-/eslint-plugin-prefer-object-spread-1.2.1.tgz#27fb91853690cceb3ae6101d9c8aecc6a67a402c" integrity sha1-J/uRhTaQzOs65hAdnIrsxqZ6QCw= -eslint-plugin-prettier@^3.1.3: - version "3.1.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.3.tgz#ae116a0fc0e598fdae48743a4430903de5b4e6ca" - integrity sha512-+HG5jmu/dN3ZV3T6eCD7a4BlAySdN7mLIbJYo0z1cFQuI+r2DiTJEFeF68ots93PsnrMxbzIZ2S/ieX+mkrBeQ== +eslint-plugin-prettier@^3.1.4: + version "3.1.4" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz#168ab43154e2ea57db992a2cd097c828171f75c2" + integrity sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg== dependencies: prettier-linter-helpers "^1.0.0" @@ -22451,10 +22451,10 @@ prettier@1.16.4: resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.16.4.tgz#73e37e73e018ad2db9c76742e2647e21790c9717" integrity sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g== -prettier@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.0.5.tgz#d6d56282455243f2f92cc1716692c08aa31522d4" - integrity sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg== +prettier@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.1.1.tgz#d9485dd5e499daa6cb547023b87a6cf51bee37d6" + integrity sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw== pretty-bytes@5.3.0: version "5.3.0" From da5ed0ff138129302ad1010c91d738a18f6b82b1 Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Wed, 26 Aug 2020 21:00:28 +0200 Subject: [PATCH 32/34] fix prettier rules --- src/fixtures/agg_resp/date_histogram.js | 2 +- src/fixtures/agg_resp/range.js | 2 +- src/legacy/server/status/lib/metrics.test.js | 8 +++---- .../__jest__/url_autocomplete.test.js | 18 +++++++------- .../embeddable/search_embeddable.ts | 3 ++- .../public/lib/containers/container.ts | 9 +++---- .../maps_legacy/public/map/grid_dimensions.js | 24 +++++++++---------- ...configured_action_disabled_modification.ts | 3 ++- x-pack/plugins/apm/public/plugin.ts | 8 +++---- .../lib/aeroelastic/layout_functions.js | 20 ++++++++-------- .../public/state/actions/elements.test.js | 6 ++--- .../state/reducers/resolved_args.test.js | 8 +++---- .../explore_data/explore_data_chart_action.ts | 3 ++- .../explore_data_context_menu_action.ts | 3 ++- .../mvt_single_layer_vector_source.tsx | 3 ++- .../properties/dynamic_style_property.tsx | 3 ++- .../public/application/store/reducer.ts | 2 +- .../components/header_section/index.tsx | 10 ++++---- .../common/components/utility_bar/styles.tsx | 12 ++++------ .../public/application/app.tsx | 4 ++-- .../action_factory_definition.ts | 3 +-- .../csv_saved_search.ts | 2 +- 22 files changed, 80 insertions(+), 76 deletions(-) diff --git a/src/fixtures/agg_resp/date_histogram.js b/src/fixtures/agg_resp/date_histogram.js index 5e898697a154c..12bc4e7daf3e5 100644 --- a/src/fixtures/agg_resp/date_histogram.js +++ b/src/fixtures/agg_resp/date_histogram.js @@ -31,7 +31,7 @@ export default { hits: [], }, aggregations: { - '1': { + 1: { buckets: [ { key_as_string: '2015-01-30T01:00:00.000Z', diff --git a/src/fixtures/agg_resp/range.js b/src/fixtures/agg_resp/range.js index 6f02d9b7c7a0a..71729a06f590f 100644 --- a/src/fixtures/agg_resp/range.js +++ b/src/fixtures/agg_resp/range.js @@ -31,7 +31,7 @@ export default { hits: [], }, aggregations: { - '1': { + 1: { buckets: { '*-1024.0': { to: 1024, diff --git a/src/legacy/server/status/lib/metrics.test.js b/src/legacy/server/status/lib/metrics.test.js index 6a734941eb70c..cc9c2607a2b59 100644 --- a/src/legacy/server/status/lib/metrics.test.js +++ b/src/legacy/server/status/lib/metrics.test.js @@ -100,8 +100,8 @@ describe('Metrics', function () { Object.defineProperty(process, 'pid', { get: pidMock }); // const hapiEvent = { - requests: { '5603': { total: 22, disconnects: 0, statusCodes: { '200': 22 } } }, - responseTimes: { '5603': { avg: 1.8636363636363635, max: 4 } }, + requests: { 5603: { total: 22, disconnects: 0, statusCodes: { 200: 22 } } }, + responseTimes: { 5603: { avg: 1.8636363636363635, max: 4 } }, osload: [2.20751953125, 2.02294921875, 1.89794921875], osmem: { total: 17179869184, free: 102318080 }, osup: 1008991, @@ -150,9 +150,9 @@ describe('Metrics', function () { it('parses event with missing fields / NaN for responseTimes.avg', async () => { const hapiEvent = { requests: { - '5603': { total: 22, disconnects: 0, statusCodes: { '200': 22 } }, + 5603: { total: 22, disconnects: 0, statusCodes: { 200: 22 } }, }, - responseTimes: { '5603': { avg: NaN, max: 4 } }, + responseTimes: { 5603: { avg: NaN, max: 4 } }, host: 'blahblah.local', }; diff --git a/src/plugins/console/public/lib/autocomplete/__jest__/url_autocomplete.test.js b/src/plugins/console/public/lib/autocomplete/__jest__/url_autocomplete.test.js index 0c3fcbafbe9f9..0f97416f053ee 100644 --- a/src/plugins/console/public/lib/autocomplete/__jest__/url_autocomplete.test.js +++ b/src/plugins/console/public/lib/autocomplete/__jest__/url_autocomplete.test.js @@ -93,7 +93,7 @@ describe('Url autocomplete', () => { (function () { const endpoints = { - '1': { + 1: { patterns: ['a/b'], methods: ['GET'], }, @@ -125,11 +125,11 @@ describe('Url autocomplete', () => { (function () { const endpoints = { - '1': { + 1: { patterns: ['a/b', 'a/b/{p}'], methods: ['GET'], }, - '2': { + 2: { patterns: ['a/c'], methods: ['GET'], }, @@ -176,14 +176,14 @@ describe('Url autocomplete', () => { (function () { const endpoints = { - '1': { + 1: { patterns: ['a/{p}'], url_components: { p: ['a', 'b'], }, methods: ['GET'], }, - '2': { + 2: { patterns: ['a/c'], methods: ['GET'], }, @@ -230,18 +230,18 @@ describe('Url autocomplete', () => { (function () { const endpoints = { - '1': { + 1: { patterns: ['a/{p}'], url_components: { p: ['a', 'b'], }, methods: ['GET'], }, - '2': { + 2: { patterns: ['b/{p}'], methods: ['GET'], }, - '3': { + 3: { patterns: ['b/{l}/c'], methods: ['GET'], url_components: { @@ -315,7 +315,7 @@ describe('Url autocomplete', () => { (function () { const endpoints = { - '1': { + 1: { patterns: ['a/b/{p}/c/e'], methods: ['GET'], }, diff --git a/src/plugins/discover/public/application/embeddable/search_embeddable.ts b/src/plugins/discover/public/application/embeddable/search_embeddable.ts index b621017677c58..1de62fe5a0348 100644 --- a/src/plugins/discover/public/application/embeddable/search_embeddable.ts +++ b/src/plugins/discover/public/application/embeddable/search_embeddable.ts @@ -78,7 +78,8 @@ interface SearchEmbeddableConfig { filterManager: FilterManager; } -export class SearchEmbeddable extends Embeddable +export class SearchEmbeddable + extends Embeddable implements ISearchEmbeddable { private readonly savedSearch: SavedSearch; private $rootScope: ng.IRootScopeService; diff --git a/src/plugins/embeddable/public/lib/containers/container.ts b/src/plugins/embeddable/public/lib/containers/container.ts index 8cf3d1a15883b..38975cc220bc2 100644 --- a/src/plugins/embeddable/public/lib/containers/container.ts +++ b/src/plugins/embeddable/public/lib/containers/container.ts @@ -35,10 +35,11 @@ import { isSavedObjectEmbeddableInput } from '../embeddables/saved_object_embedd const getKeys = (o: T): Array => Object.keys(o) as Array; export abstract class Container< - TChildInput extends Partial = {}, - TContainerInput extends ContainerInput = ContainerInput, - TContainerOutput extends ContainerOutput = ContainerOutput -> extends Embeddable + TChildInput extends Partial = {}, + TContainerInput extends ContainerInput = ContainerInput, + TContainerOutput extends ContainerOutput = ContainerOutput + > + extends Embeddable implements IContainer { public readonly isContainer: boolean = true; protected readonly children: { diff --git a/src/plugins/maps_legacy/public/map/grid_dimensions.js b/src/plugins/maps_legacy/public/map/grid_dimensions.js index b3438914d5636..d146adf2ca67f 100644 --- a/src/plugins/maps_legacy/public/map/grid_dimensions.js +++ b/src/plugins/maps_legacy/public/map/grid_dimensions.js @@ -22,18 +22,18 @@ import _ from 'lodash'; // geohash precision mapping of geohash grid cell dimensions (width x height, in meters) at equator. // https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-geohashgrid-aggregation.html#_cell_dimensions_at_the_equator const gridAtEquator = { - '1': [5009400, 4992600], - '2': [1252300, 624100], - '3': [156500, 156000], - '4': [39100, 19500], - '5': [4900, 4900], - '6': [1200, 609.4], - '7': [152.9, 152.4], - '8': [38.2, 19], - '9': [4.8, 4.8], - '10': [1.2, 0.595], - '11': [0.149, 0.149], - '12': [0.037, 0.019], + 1: [5009400, 4992600], + 2: [1252300, 624100], + 3: [156500, 156000], + 4: [39100, 19500], + 5: [4900, 4900], + 6: [1200, 609.4], + 7: [152.9, 152.4], + 8: [38.2, 19], + 9: [4.8, 4.8], + 10: [1.2, 0.595], + 11: [0.149, 0.149], + 12: [0.037, 0.019], }; export function gridDimensions(precision) { diff --git a/x-pack/plugins/actions/server/lib/errors/preconfigured_action_disabled_modification.ts b/x-pack/plugins/actions/server/lib/errors/preconfigured_action_disabled_modification.ts index 884353e132b9c..20790d7cf5128 100644 --- a/x-pack/plugins/actions/server/lib/errors/preconfigured_action_disabled_modification.ts +++ b/x-pack/plugins/actions/server/lib/errors/preconfigured_action_disabled_modification.ts @@ -9,7 +9,8 @@ import { ErrorThatHandlesItsOwnResponse } from './types'; export type PreconfiguredActionDisabledFrom = 'update' | 'delete'; -export class PreconfiguredActionDisabledModificationError extends Error +export class PreconfiguredActionDisabledModificationError + extends Error implements ErrorThatHandlesItsOwnResponse { public readonly disabledFrom: PreconfiguredActionDisabledFrom; diff --git a/x-pack/plugins/apm/public/plugin.ts b/x-pack/plugins/apm/public/plugin.ts index cf729fe0ff301..12a87eff587e6 100644 --- a/x-pack/plugins/apm/public/plugin.ts +++ b/x-pack/plugins/apm/public/plugin.ts @@ -143,8 +143,8 @@ export class ApmPlugin implements Plugin { defaultMessage: 'Error rate', }), iconClass: 'bell', - alertParamsExpression: lazy(() => - import('./components/shared/ErrorRateAlertTrigger') + alertParamsExpression: lazy( + () => import('./components/shared/ErrorRateAlertTrigger') ), validate: () => ({ errors: [], @@ -158,8 +158,8 @@ export class ApmPlugin implements Plugin { defaultMessage: 'Transaction duration', }), iconClass: 'bell', - alertParamsExpression: lazy(() => - import('./components/shared/TransactionDurationAlertTrigger') + alertParamsExpression: lazy( + () => import('./components/shared/TransactionDurationAlertTrigger') ), validate: () => ({ errors: [], diff --git a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js index c2c6f77fb167c..0bc6c099106a6 100644 --- a/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js +++ b/x-pack/plugins/canvas/public/lib/aeroelastic/layout_functions.js @@ -106,18 +106,18 @@ const cornerVertices = [ const resizeMultiplierHorizontal = { left: -1, center: 0, right: 1 }; const resizeMultiplierVertical = { top: -1, center: 0, bottom: 1 }; -const xNames = { '-1': 'left', '0': 'center', '1': 'right' }; -const yNames = { '-1': 'top', '0': 'center', '1': 'bottom' }; +const xNames = { '-1': 'left', 0: 'center', 1: 'right' }; +const yNames = { '-1': 'top', 0: 'center', 1: 'bottom' }; const bidirectionalCursors = { - '0': 'ns-resize', - '45': 'nesw-resize', - '90': 'ew-resize', - '135': 'nwse-resize', - '180': 'ns-resize', - '225': 'nesw-resize', - '270': 'ew-resize', - '315': 'nwse-resize', + 0: 'ns-resize', + 45: 'nesw-resize', + 90: 'ew-resize', + 135: 'nwse-resize', + 180: 'ns-resize', + 225: 'nesw-resize', + 270: 'ew-resize', + 315: 'nwse-resize', }; const identityAABB = () => [ diff --git a/x-pack/plugins/canvas/public/state/actions/elements.test.js b/x-pack/plugins/canvas/public/state/actions/elements.test.js index a790e81e65e25..fc27e422682e1 100644 --- a/x-pack/plugins/canvas/public/state/actions/elements.test.js +++ b/x-pack/plugins/canvas/public/state/actions/elements.test.js @@ -12,7 +12,7 @@ describe('getSiblingContext', () => { resolvedArgs: { 'element-foo': { expressionContext: { - '0': { + 0: { state: 'ready', value: { type: 'datatable', @@ -28,7 +28,7 @@ describe('getSiblingContext', () => { }, error: null, }, - '1': { + 1: { state: 'ready', value: { type: 'datatable', @@ -44,7 +44,7 @@ describe('getSiblingContext', () => { }, error: null, }, - '2': { + 2: { state: 'ready', value: { type: 'pointseries', diff --git a/x-pack/plugins/canvas/public/state/reducers/resolved_args.test.js b/x-pack/plugins/canvas/public/state/reducers/resolved_args.test.js index 74f1544403e67..987e468031713 100644 --- a/x-pack/plugins/canvas/public/state/reducers/resolved_args.test.js +++ b/x-pack/plugins/canvas/public/state/reducers/resolved_args.test.js @@ -162,22 +162,22 @@ describe('resolved args reducer', () => { resolvedArgs: { 'element-1': { expressionContext: { - '1': { + 1: { state: 'ready', value: 'test-1', error: null, }, - '2': { + 2: { state: 'ready', value: 'test-2', error: null, }, - '3': { + 3: { state: 'ready', value: 'test-3', error: null, }, - '4': { + 4: { state: 'ready', value: 'test-4', error: null, diff --git a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts index 44ad3c57f7e24..0a7be858691af 100644 --- a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts +++ b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_chart_action.ts @@ -25,7 +25,8 @@ export const ACTION_EXPLORE_DATA_CHART = 'ACTION_EXPLORE_DATA_CHART'; * This is "Explore underlying data" action which appears in popup context * menu when user clicks a value in visualization or brushes a time range. */ -export class ExploreDataChartAction extends AbstractExploreDataAction +export class ExploreDataChartAction + extends AbstractExploreDataAction implements Action { public readonly id = ACTION_EXPLORE_DATA_CHART; diff --git a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts index bc74748806beb..6e748030fe107 100644 --- a/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts +++ b/x-pack/plugins/discover_enhanced/public/actions/explore_data/explore_data_context_menu_action.ts @@ -17,7 +17,8 @@ export const ACTION_EXPLORE_DATA = 'ACTION_EXPLORE_DATA'; * This is "Explore underlying data" action which appears in the context * menu of a dashboard panel. */ -export class ExploreDataContextMenuAction extends AbstractExploreDataAction +export class ExploreDataContextMenuAction + extends AbstractExploreDataAction implements Action { public readonly id = ACTION_EXPLORE_DATA; diff --git a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx index e64d20138cfb8..52dc89a6bba58 100644 --- a/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx +++ b/x-pack/plugins/maps/public/classes/sources/mvt_single_layer_vector_source/mvt_single_layer_vector_source.tsx @@ -36,7 +36,8 @@ export const sourceTitle = i18n.translate( } ); -export class MVTSingleLayerVectorSource extends AbstractSource +export class MVTSingleLayerVectorSource + extends AbstractSource implements ITiledSingleLayerVectorSource { static createDescriptor({ urlTemplate, diff --git a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx index 826acd41e27a9..b16755e69f92d 100644 --- a/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx +++ b/x-pack/plugins/maps/public/classes/styles/vector/properties/dynamic_style_property.tsx @@ -50,7 +50,8 @@ export interface IDynamicStyleProperty extends IStyleProperty { export type FieldFormatter = (value: string | number | undefined) => string | number; -export class DynamicStyleProperty extends AbstractStyleProperty +export class DynamicStyleProperty + extends AbstractStyleProperty implements IDynamicStyleProperty { static type = STYLE_TYPE.DYNAMIC; diff --git a/x-pack/plugins/searchprofiler/public/application/store/reducer.ts b/x-pack/plugins/searchprofiler/public/application/store/reducer.ts index 5366dcec3fcf0..8b2f14b3ed45a 100644 --- a/x-pack/plugins/searchprofiler/public/application/store/reducer.ts +++ b/x-pack/plugins/searchprofiler/public/application/store/reducer.ts @@ -39,7 +39,7 @@ export const reducer: Reducer = (state, action) => { indexName: value.indexName, operation: Object.freeze(restOfOperation), // prettier-ignore - shardName: `[${/* shard id */value.shard.id[0]}][${/* shard number */value.shard.id[2] }]` + shardName: `[${/* shard id */value.shard.id[0]}][${/* shard number */value.shard.id[2] }]`, }; } else { nextState.highlightDetails = null; diff --git a/x-pack/plugins/security_solution/public/common/components/header_section/index.tsx b/x-pack/plugins/security_solution/public/common/components/header_section/index.tsx index f49001bd5d7af..df655bf179f5b 100644 --- a/x-pack/plugins/security_solution/public/common/components/header_section/index.tsx +++ b/x-pack/plugins/security_solution/public/common/components/header_section/index.tsx @@ -19,11 +19,11 @@ interface HeaderProps { const Header = styled.header.attrs(() => ({ className: 'siemHeaderSection', }))` -${({ height }) => - height && - css` - height: ${height}px; - `} + ${({ height }) => + height && + css` + height: ${height}px; + `} margin-bottom: ${({ height, theme }) => (height ? 0 : theme.eui.euiSizeL)}; user-select: text; diff --git a/x-pack/plugins/security_solution/public/common/components/utility_bar/styles.tsx b/x-pack/plugins/security_solution/public/common/components/utility_bar/styles.tsx index dd6b66350052e..0efd27c6ecbc6 100644 --- a/x-pack/plugins/security_solution/public/common/components/utility_bar/styles.tsx +++ b/x-pack/plugins/security_solution/public/common/components/utility_bar/styles.tsx @@ -26,13 +26,11 @@ export const Bar = styled.aside.attrs({ className: 'siemUtilityBar', })` ${({ border, theme }) => css` - ${ - border && - css` - border-bottom: ${theme.eui.euiBorderThin}; - padding-bottom: ${theme.eui.paddingSizes.s}; - ` - } + ${border && + css` + border-bottom: ${theme.eui.euiBorderThin}; + padding-bottom: ${theme.eui.paddingSizes.s}; + `} @media only screen and (min-width: ${theme.eui.euiBreakpoints.l}) { display: flex; diff --git a/x-pack/plugins/triggers_actions_ui/public/application/app.tsx b/x-pack/plugins/triggers_actions_ui/public/application/app.tsx index 1f9352d8405d2..c53dc0c105084 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/app.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/app.tsx @@ -26,8 +26,8 @@ import { PluginStartContract as AlertingStart } from '../../../alerts/public'; import { suspendedComponentWithProps } from './lib/suspended_component_with_props'; const TriggersActionsUIHome = lazy(async () => import('./home')); -const AlertDetailsRoute = lazy(() => - import('./sections/alert_details/components/alert_details_route') +const AlertDetailsRoute = lazy( + () => import('./sections/alert_details/components/alert_details_route') ); export interface AppDeps { diff --git a/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory_definition.ts b/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory_definition.ts index 0acd3ea3e51a7..d79614e47ccd4 100644 --- a/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory_definition.ts +++ b/x-pack/plugins/ui_actions_enhanced/public/dynamic_actions/action_factory_definition.ts @@ -24,8 +24,7 @@ export interface ActionFactoryDefinition< triggers: SupportedTriggers[]; }, ActionContext extends TriggerContextMapping[SupportedTriggers] = TriggerContextMapping[SupportedTriggers] -> - extends Partial, 'getHref'>>, +> extends Partial, 'getHref'>>, Configurable { /** * Unique ID of the action factory. This ID is used to identify this action diff --git a/x-pack/test/reporting_api_integration/reporting_and_security/csv_saved_search.ts b/x-pack/test/reporting_api_integration/reporting_and_security/csv_saved_search.ts index 7c08f377c9b15..9a7d17c971dfe 100644 --- a/x-pack/test/reporting_api_integration/reporting_and_security/csv_saved_search.ts +++ b/x-pack/test/reporting_api_integration/reporting_and_security/csv_saved_search.ts @@ -293,7 +293,7 @@ export default function ({ getService }: FtrProviderContext) { searchId: 'search:a6d51430-ace2-11ea-815f-39e12f89a8c2', postPayload: { timerange: { timezone: 'UTC', min: '1979-01-01T10:00:00Z', max: '1981-01-01T10:00:00Z' }, // prettier-ignore - state: { query: { bool: { filter: [ { bool: { filter: [ { bool: { minimum_should_match: 1, should: [{ query_string: { fields: ['name'], query: 'Fel*' } }] } } ] } } ] } } } // prettier-ignore + state: { query: { bool: { filter: [ { bool: { filter: [ { bool: { minimum_should_match: 1, should: [{ query_string: { fields: ['name'], query: 'Fel*' } }] } } ] } } ] } } }, // prettier-ignore }, isImmediate: true, }; From 5da422676bba9d81daaefaace6d4ca1d6e03857e Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 27 Aug 2020 07:52:39 +0200 Subject: [PATCH 33/34] last style change --- examples/embeddable_examples/public/book/book_embeddable.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/embeddable_examples/public/book/book_embeddable.tsx b/examples/embeddable_examples/public/book/book_embeddable.tsx index 33876ab24414e..b033fe86cd1c7 100644 --- a/examples/embeddable_examples/public/book/book_embeddable.tsx +++ b/examples/embeddable_examples/public/book/book_embeddable.tsx @@ -60,7 +60,8 @@ function getHasMatch(search?: string, savedAttributes?: BookSavedObjectAttribute ); } -export class BookEmbeddable extends Embeddable +export class BookEmbeddable + extends Embeddable implements ReferenceOrValueEmbeddable { public readonly type = BOOK_EMBEDDABLE; private subscription: Subscription; From 577b8fbd9c1002ba95e0ae07663d32d15cbb7195 Mon Sep 17 00:00:00 2001 From: restrry Date: Thu, 27 Aug 2020 08:34:45 +0200 Subject: [PATCH 34/34] fix new type errors --- .../components/settings/add_connector_flyout.tsx | 13 +++++++++++-- .../components/settings/alert_defaults_form.tsx | 7 ++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/uptime/public/components/settings/add_connector_flyout.tsx b/x-pack/plugins/uptime/public/components/settings/add_connector_flyout.tsx index 60c0807ae89a8..9dc64374f4d63 100644 --- a/x-pack/plugins/uptime/public/components/settings/add_connector_flyout.tsx +++ b/x-pack/plugins/uptime/public/components/settings/add_connector_flyout.tsx @@ -8,17 +8,26 @@ import React, { useEffect, useState } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { useDispatch } from 'react-redux'; import { EuiButtonEmpty } from '@elastic/eui'; +import { HttpStart, DocLinksStart, NotificationsStart, ApplicationStart } from 'src/core/public'; import { ActionsConnectorsContextProvider, ConnectorAddFlyout, + TriggersAndActionsUIPublicPluginStart, } from '../../../../triggers_actions_ui/public'; - import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; import { getConnectorsAction } from '../../state/alerts/alerts'; interface Props { focusInput: () => void; } +interface KibanaDeps { + triggers_actions_ui: TriggersAndActionsUIPublicPluginStart; + application: ApplicationStart; + docLinks: DocLinksStart; + http: HttpStart; + notifications: NotificationsStart; +} + export const AddConnectorFlyout = ({ focusInput }: Props) => { const [addFlyoutVisible, setAddFlyoutVisibility] = useState(false); @@ -30,7 +39,7 @@ export const AddConnectorFlyout = ({ focusInput }: Props) => { http, notifications, }, - } = useKibana(); + } = useKibana(); const dispatch = useDispatch(); diff --git a/x-pack/plugins/uptime/public/components/settings/alert_defaults_form.tsx b/x-pack/plugins/uptime/public/components/settings/alert_defaults_form.tsx index b3b38a84e4f22..7636d4ede4bab 100644 --- a/x-pack/plugins/uptime/public/components/settings/alert_defaults_form.tsx +++ b/x-pack/plugins/uptime/public/components/settings/alert_defaults_form.tsx @@ -24,9 +24,14 @@ import { useGetUrlParams, useUrlParams } from '../../hooks'; import { alertFormI18n } from './translations'; import { useInitApp } from '../../hooks/use_init_app'; import { useKibana } from '../../../../../../src/plugins/kibana_react/public'; +import { TriggersAndActionsUIPublicPluginStart } from '../../../../triggers_actions_ui/public/'; type ConnectorOption = EuiComboBoxOptionOption; +interface KibanaDeps { + triggers_actions_ui: TriggersAndActionsUIPublicPluginStart; +} + const ConnectorSpan = styled.span` .euiIcon { margin-right: 5px; @@ -48,7 +53,7 @@ export const AlertDefaultsForm: React.FC = ({ services: { triggers_actions_ui: { actionTypeRegistry }, }, - } = useKibana(); + } = useKibana(); const { focusConnectorField } = useGetUrlParams(); const updateUrlParams = useUrlParams()[1];