From c7900da3f15e1951cd7cd59a4dc34bc7b1cf21cf Mon Sep 17 00:00:00 2001 From: Shahzad Date: Mon, 2 Nov 2020 13:12:56 +0100 Subject: [PATCH 01/13] [Uptime] Remove custom handling of license enabling (#82019) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../__snapshots__/license_info.test.tsx.snap | 42 +++++++---------- .../__snapshots__/ml_flyout.test.tsx.snap | 25 +++++----- .../components/monitor/ml/license_info.tsx | 46 ++++--------------- 3 files changed, 35 insertions(+), 78 deletions(-) diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/license_info.test.tsx.snap b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/license_info.test.tsx.snap index 68e3606d880d6..edf89caaff557 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/license_info.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/license_info.test.tsx.snap @@ -26,24 +26,21 @@ Array [

In order to access duration anomaly detection, you have to be subscribed to an Elastic Platinum license.

- - + - - Start free 14-day trial - + Start free 14-day trial - - + + ,
In order to access duration anomaly detection, you have to be subscribed to an Elastic Platinum license.

- - - Start free 14-day trial - - + Start free 14-day trial + diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap index ac1afccd1feae..fd59b14520ce1 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap +++ b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/__snapshots__/ml_flyout.test.tsx.snap @@ -146,24 +146,21 @@ exports[`ML Flyout component shows license info if no ml available 1`] = `

In order to access duration anomaly detection, you have to be subscribed to an Elastic Platinum license.

- - + - - Start free 14-day trial - + Start free 14-day trial - - + +
{ const { basePath } = useContext(UptimeSettingsContext); - const [loading, setLoading] = useState(false); - const hasMlFeature = useSelector(hasMLFeatureSelector); const dispatch = useDispatch(); @@ -22,29 +19,6 @@ export const ShowLicenseInfo = () => { dispatch(getMLCapabilitiesAction.get()); }, [dispatch]); - useEffect(() => { - let retryInterval: any; - if (loading) { - retryInterval = setInterval(() => { - dispatch(getMLCapabilitiesAction.get()); - }, 5000); - } else { - clearInterval(retryInterval); - } - - return () => { - clearInterval(retryInterval); - }; - }, [dispatch, loading]); - - useEffect(() => { - setLoading(false); - }, [hasMlFeature]); - - const startLicenseTrial = () => { - setLoading(true); - }; - return ( <> { iconType="help" >

{labels.START_TRAIL_DESC}

- {}}> - - {labels.START_TRAIL} - - + + {labels.START_TRAIL} +
From 700225061a3c736aec36ddc12e9669b213894d3b Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Mon, 2 Nov 2020 13:18:00 +0100 Subject: [PATCH 02/13] Upgrade to hapi version 18 (#80468) --- package.json | 34 +- src/core/public/public.api.md | 2 +- .../elasticsearch/legacy/errors.test.ts | 2 +- .../server/elasticsearch/legacy/errors.ts | 2 +- .../server/http/base_path_proxy_server.ts | 4 +- .../server/http/cookie_session_storage.ts | 26 +- src/core/server/http/http_server.mocks.ts | 21 +- src/core/server/http/http_server.ts | 4 +- src/core/server/http/http_service.mock.ts | 3 +- src/core/server/http/http_service.ts | 2 +- src/core/server/http/http_tools.test.ts | 2 +- src/core/server/http/http_tools.ts | 4 +- src/core/server/http/https_redirect_server.ts | 2 +- .../integration_tests/core_services.test.ts | 4 +- .../http/integration_tests/request.test.ts | 48 ++ .../http/integration_tests/router.test.ts | 44 +- src/core/server/http/lifecycle/auth.ts | 2 +- .../server/http/lifecycle/on_post_auth.ts | 2 +- src/core/server/http/lifecycle/on_pre_auth.ts | 2 +- .../server/http/lifecycle/on_pre_response.ts | 9 +- .../server/http/lifecycle/on_pre_routing.ts | 7 +- .../server/http/router/error_wrapper.test.ts | 2 +- src/core/server/http/router/error_wrapper.ts | 2 +- src/core/server/http/router/request.test.ts | 20 +- src/core/server/http/router/request.ts | 20 +- .../server/http/router/response_adapter.ts | 7 +- src/core/server/http/router/router.ts | 4 +- .../legacy/logging/legacy_logging_server.ts | 4 +- src/core/server/metrics/collectors/process.ts | 2 +- src/core/server/metrics/collectors/server.ts | 2 +- .../server_collector.test.ts | 2 +- .../server/metrics/ops_metrics_collector.ts | 2 +- .../export/get_sorted_objects_for_export.ts | 2 +- .../import/create_limit_stream.ts | 2 +- .../import/validate_references.ts | 2 +- .../migrations/core/document_migrator.ts | 2 +- .../saved_objects/service/lib/errors.test.ts | 2 +- .../saved_objects/service/lib/errors.ts | 2 +- .../service/lib/search_dsl/search_dsl.ts | 2 +- .../service/lib/search_dsl/sorting_params.ts | 2 +- .../version/decode_version.test.ts | 2 +- src/core/server/server.api.md | 10 +- src/legacy/server/core/index.ts | 2 +- src/legacy/server/http/index.js | 2 +- .../server/http/register_hapi_plugins.js | 6 +- src/legacy/server/i18n/i18n_mixin.ts | 2 +- src/legacy/server/kbn_server.d.ts | 4 +- src/legacy/server/logging/rotate/index.ts | 2 +- .../server/logging/rotate/log_rotator.ts | 2 +- src/legacy/ui/ui_render/ui_render_mixin.js | 2 +- .../bundles_route/bundles_route.test.ts | 4 +- src/optimize/bundles_route/bundles_route.ts | 2 +- .../bundles_route/dynamic_asset_response.ts | 4 +- src/optimize/optimize_mixin.ts | 2 +- .../console/server/lib/proxy_request.ts | 2 +- src/plugins/data/public/public.api.md | 2 +- .../index_patterns/fetcher/lib/errors.ts | 2 +- .../data/server/plugins_data_server.api.md | 8 +- src/plugins/embeddable/public/public.api.md | 2 +- .../routes/lib/short_url_assert_valid.ts | 2 +- .../vis_type_timeseries/server/plugin.ts | 2 +- .../server/routes/fields.ts | 2 +- .../apis/index_patterns/es_errors/errors.js | 2 +- x-pack/package.json | 7 +- .../actions/server/action_type_registry.ts | 2 +- .../plugins/actions/server/actions_client.ts | 2 +- .../authorization/actions_authorization.ts | 2 +- .../server/lib/task_runner_factory.test.ts | 18 - .../actions/server/lib/task_runner_factory.ts | 6 - .../server/lib/validate_with_schema.ts | 2 +- .../actions/server/lib/verify_api_access.ts | 2 +- .../alerts/server/alert_type_registry.ts | 2 +- .../server/alerts_client/alerts_client.ts | 2 +- .../server/alerts_client_factory.test.ts | 8 +- .../authorization/alerts_authorization.ts | 2 +- .../alerts/server/lib/license_api_access.ts | 2 +- .../alerts/server/lib/license_state.ts | 2 +- .../server/lib/validate_alert_type_params.ts | 2 +- x-pack/plugins/alerts/server/plugin.test.ts | 6 - .../server/task_runner/task_runner.test.ts | 18 - .../alerts/server/task_runner/task_runner.ts | 6 - .../create_anomaly_detection_jobs.ts | 2 +- .../get_anomaly_detection_jobs.ts | 2 +- .../lib/anomaly_detection/has_legacy_jobs.ts | 2 +- .../lib/service_map/get_service_anomalies.ts | 2 +- .../lib/service_map/get_trace_sample_ids.ts | 2 +- .../apm/server/routes/create_api/index.ts | 2 +- .../plugins/apm/server/routes/service_map.ts | 2 +- x-pack/plugins/apm/server/routes/services.ts | 2 +- .../routes/settings/agent_configuration.ts | 2 +- .../routes/settings/anomaly_detection.ts | 2 +- .../apm/server/routes/settings/custom_link.ts | 2 +- .../apm/server/routes/transaction_groups.ts | 2 +- .../canvas/server/lib/format_response.js | 2 +- .../server/routes/templates/list.test.ts | 2 +- .../case/server/client/cases/create.ts | 2 +- .../case/server/client/cases/update.ts | 2 +- .../case/server/client/comments/add.ts | 2 +- .../api/cases/comments/delete_comment.ts | 2 +- .../api/cases/comments/find_comments.ts | 2 +- .../api/cases/comments/patch_comment.ts | 2 +- .../api/cases/configure/get_connectors.ts | 2 +- .../api/cases/configure/patch_configure.ts | 2 +- .../api/cases/configure/post_configure.ts | 2 +- .../server/routes/api/cases/find_cases.ts | 2 +- .../case/server/routes/api/cases/push_case.ts | 2 +- .../case/server/routes/api/utils.test.ts | 2 +- .../plugins/case/server/routes/api/utils.ts | 2 +- .../event_log/server/event_log_client.test.ts | 6 - .../server/event_log_start_service.test.ts | 6 - .../saved_object_provider_registry.test.ts | 6 - .../file_upload/server/client/errors.js | 2 +- .../plugins/graph/server/lib/license_state.ts | 2 +- x-pack/plugins/graph/server/routes/explore.ts | 2 +- x-pack/plugins/infra/server/kibana.index.ts | 2 +- .../lib/adapters/framework/adapter_types.ts | 2 +- x-pack/plugins/infra/server/plugin.ts | 2 +- .../results/metrics_hosts_anomalies.ts | 2 +- .../infra_ml/results/metrics_k8s_anomalies.ts | 2 +- .../server/routes/inventory_metadata/index.ts | 2 +- .../routes/log_alerts/chart_preview_data.ts | 2 +- .../results/log_entry_anomalies.ts | 2 +- .../results/log_entry_anomalies_datasets.ts | 2 +- .../results/log_entry_categories.ts | 2 +- .../results/log_entry_category_datasets.ts | 2 +- .../log_entry_category_datasets_stats.ts | 2 +- .../results/log_entry_category_examples.ts | 2 +- .../results/log_entry_examples.ts | 2 +- .../log_analysis/results/log_entry_rate.ts | 2 +- .../log_analysis/validation/datasets.ts | 2 +- .../routes/log_analysis/validation/indices.ts | 2 +- .../server/routes/log_entries/highlights.ts | 2 +- .../server/routes/log_entries/summary.ts | 2 +- .../routes/log_entries/summary_highlights.ts | 2 +- .../routes/log_sources/configuration.ts | 2 +- .../infra/server/routes/log_sources/status.ts | 2 +- .../infra/server/routes/metadata/index.ts | 2 +- .../infra/server/routes/metrics_api/index.ts | 2 +- .../server/routes/metrics_explorer/index.ts | 2 +- .../infra/server/routes/node_details/index.ts | 2 +- .../infra/server/routes/snapshot/index.ts | 2 +- .../server/errors/handlers.test.ts | 2 +- .../ingest_manager/server/errors/handlers.ts | 2 +- .../server/routes/package_policy/handlers.ts | 2 +- .../server/services/agent_policy_update.ts | 6 - .../server/services/agents/acks.test.ts | 2 +- .../server/services/agents/acks.ts | 2 +- .../server/services/agents/authenticate.ts | 2 +- .../agents/checkin/state_connected_agents.ts | 6 - .../agents/checkin/state_new_actions.ts | 6 - .../server/services/agents/crud.ts | 2 +- .../server/services/agents/enroll.ts | 2 +- .../server/services/agents/reassign.ts | 2 +- .../server/services/agents/saved_objects.ts | 2 +- .../services/api_keys/enrollment_api_key.ts | 2 +- .../epm/elasticsearch/template/install.ts | 2 +- .../server/services/epm/packages/install.ts | 2 +- .../server/services/epm/packages/remove.ts | 2 +- .../server/services/settings.ts | 2 +- .../lens/server/routes/existing_fields.ts | 2 +- .../plugins/lens/server/routes/field_stats.ts | 2 +- .../plugins/lens/server/routes/telemetry.ts | 2 +- .../server/models/pipeline/pipeline.ts | 2 +- .../ml/common/types/data_frame_analytics.ts | 2 +- .../ml/common/util/errors/errors.test.ts | 2 +- x-pack/plugins/ml/common/util/errors/types.ts | 2 +- .../plugins/ml/server/client/error_wrapper.ts | 2 +- x-pack/plugins/ml/server/client/errors.js | 2 +- .../models/annotation_service/annotation.ts | 2 +- .../models/data_recognizer/data_recognizer.ts | 2 +- .../models/fields_service/fields_service.ts | 2 +- .../ml/server/models/filter/filter_manager.ts | 2 +- .../ml/server/models/job_service/jobs.ts | 2 +- .../models/job_service/model_snapshots.ts | 2 +- .../models/job_validation/job_validation.ts | 2 +- .../get_partition_fields_values.ts | 2 +- .../models/results_service/results_service.ts | 2 +- .../plugins/ml/server/routes/annotations.ts | 2 +- .../ml/server/routes/job_validation.ts | 2 +- x-pack/plugins/ml/server/routes/system.ts | 2 +- .../no_data/__tests__/checker_errors.test.js | 2 +- .../__tests__/enabler.test.js | 2 +- .../server/lib/cluster/get_cluster_stats.js | 2 +- .../lib/cluster/get_clusters_from_request.js | 2 +- .../elasticsearch/verify_monitoring_auth.js | 2 +- .../lib/errors/__tests__/auth_errors.js | 2 +- .../server/lib/errors/auth_errors.js | 2 +- .../server/lib/errors/handle_error.js | 2 +- .../lib/errors/handle_settings_error.js | 2 +- .../server/lib/errors/known_errors.js | 2 +- .../server/lib/logstash/get_pipeline.js | 2 +- .../lib/logstash/get_pipeline_vertex.js | 2 +- x-pack/plugins/monitoring/server/plugin.ts | 2 +- .../annotations/create_annotations_client.ts | 2 +- .../server/routes/api/get_route.test.ts | 2 +- x-pack/plugins/reporting/server/core.ts | 9 +- .../csv_from_savedobject/create_job.ts | 2 +- .../csv_from_savedobject/lib/get_filters.ts | 2 +- .../reporting/server/routes/generation.ts | 2 +- .../plugins/reporting/server/routes/jobs.ts | 2 +- .../authentication_result.test.ts | 2 +- .../authentication/authenticator.test.ts | 2 +- .../server/authentication/index.test.ts | 2 +- .../authentication/providers/kerberos.test.ts | 2 +- .../authentication/providers/kerberos.ts | 2 +- .../authentication/providers/oidc.test.ts | 2 +- .../server/authentication/providers/oidc.ts | 2 +- .../authentication/providers/pki.test.ts | 2 +- .../server/authentication/providers/pki.ts | 2 +- .../authentication/providers/saml.test.ts | 2 +- .../server/authentication/providers/saml.ts | 2 +- .../authentication/providers/token.test.ts | 2 +- .../server/authentication/providers/token.ts | 2 +- x-pack/plugins/security/server/errors.test.ts | 2 +- x-pack/plugins/security/server/errors.ts | 2 +- .../server/routes/api_keys/enabled.test.ts | 2 +- .../server/routes/api_keys/get.test.ts | 2 +- .../server/routes/api_keys/invalidate.test.ts | 2 +- .../server/routes/api_keys/privileges.test.ts | 2 +- .../routes/authorization/roles/delete.test.ts | 2 +- .../routes/authorization/roles/get.test.ts | 2 +- .../authorization/roles/get_all.test.ts | 2 +- .../server/routes/role_mapping/get.test.ts | 2 +- .../endpoint/routes/metadata/handlers.ts | 2 +- .../lib/detection_engine/routes/utils.test.ts | 2 +- .../lib/detection_engine/routes/utils.ts | 2 +- .../components/copy_to_space_flyout.test.tsx | 2 +- .../components/share_to_space_flyout.test.tsx | 2 +- .../lib/create_empty_failure_response.ts | 2 +- .../spaces/server/lib/copy_to_spaces/types.ts | 2 +- x-pack/plugins/spaces/server/lib/errors.ts | 2 +- .../on_post_auth_interceptor.test.ts | 2 +- .../server/lib/spaces_client/spaces_client.ts | 2 +- .../server/routes/api/external/delete.ts | 2 +- .../spaces/server/routes/api/external/post.ts | 2 +- .../spaces_saved_objects_client.test.ts | 2 +- .../spaces_saved_objects_client.ts | 2 +- .../server/routes/api/error_utils.ts | 2 +- x-pack/plugins/uptime/server/kibana.index.ts | 2 +- .../models/action_status/action_status.js | 2 +- .../watcher/server/models/fields/fields.js | 2 +- .../watcher/server/models/watch/base_watch.js | 2 +- .../server/models/watch/monitoring_watch.js | 2 +- .../watcher/server/models/watch/watch.js | 2 +- .../watch_history_item/watch_history_item.js | 2 +- .../models/watch_status/watch_status.js | 2 +- yarn.lock | 696 ++++++++++-------- 247 files changed, 789 insertions(+), 738 deletions(-) diff --git a/package.json b/package.json index 1d5c5059cd03e..a613a7a9337bd 100644 --- a/package.json +++ b/package.json @@ -77,6 +77,10 @@ "url": "https://github.com/elastic/kibana.git" }, "resolutions": { + "**/@hapi/iron": "^5.1.4", + "**/@types/hapi__boom": "^7.4.1", + "**/@types/hapi__hapi": "^18.2.6", + "**/@types/hapi__mimos": "4.1.0", "**/@types/node": ">=10.17.17 <10.20.0", "**/cross-fetch/node-fetch": "^2.6.1", "**/deepmerge": "^4.2.2", @@ -124,7 +128,16 @@ "@elastic/numeral": "^2.5.0", "@elastic/request-crypto": "1.1.4", "@elastic/safer-lodash-set": "0.0.0", + "@hapi/boom": "^7.4.11", + "@hapi/cookie": "^10.1.2", "@hapi/good-squeeze": "5.2.1", + "@hapi/h2o2": "^8.3.2", + "@hapi/hapi": "^18.4.1", + "@hapi/hoek": "^8.5.1", + "@hapi/inert": "^5.2.2", + "@hapi/podium": "^3.4.3", + "@hapi/statehood": "^6.1.2", + "@hapi/vision": "^5.5.4", "@hapi/wreck": "^15.0.2", "@kbn/ace": "1.0.0", "@kbn/analytics": "1.0.0", @@ -147,7 +160,6 @@ "angular-elastic": "^2.5.1", "angular-sanitize": "^1.8.0", "bluebird": "3.5.5", - "boom": "^7.2.0", "chalk": "^4.1.0", "check-disk-space": "^2.1.0", "chokidar": "^3.4.2", @@ -167,15 +179,10 @@ "glob": "^7.1.2", "glob-all": "^3.2.1", "globby": "^8.0.1", - "h2o2": "^8.1.2", "handlebars": "4.7.6", - "hapi": "^17.5.3", - "hapi-auth-cookie": "^9.0.0", "hjson": "3.2.1", - "hoek": "^5.0.4", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^5.0.0", - "inert": "^5.1.0", "inline-style": "^2.0.0", "joi": "^13.5.2", "js-yaml": "^3.14.0", @@ -220,7 +227,6 @@ "tslib": "^2.0.0", "type-detect": "^4.0.8", "uuid": "3.3.2", - "vision": "^5.3.3", "whatwg-fetch": "^3.0.0", "yauzl": "^2.10.0" }, @@ -274,7 +280,6 @@ "@types/archiver": "^3.1.0", "@types/babel__core": "^7.1.10", "@types/bluebird": "^3.1.1", - "@types/boom": "^7.2.0", "@types/chance": "^1.0.0", "@types/cheerio": "^0.22.10", "@types/chromedriver": "^81.0.0", @@ -294,14 +299,16 @@ "@types/glob": "^7.1.2", "@types/globby": "^8.0.0", "@types/graphql": "^0.13.2", - "@types/h2o2": "^8.1.1", - "@types/hapi": "^17.0.18", - "@types/hapi-auth-cookie": "^9.1.0", + "@types/hapi__boom": "^7.4.1", + "@types/hapi__cookie": "^10.1.1", + "@types/hapi__h2o2": "8.3.0", + "@types/hapi__hapi": "^18.2.6", + "@types/hapi__hoek": "^6.2.0", + "@types/hapi__inert": "^5.2.1", + "@types/hapi__podium": "^3.4.1", "@types/has-ansi": "^3.0.0", "@types/history": "^4.7.3", "@types/hjson": "^2.4.2", - "@types/hoek": "^4.1.3", - "@types/inert": "^5.1.2", "@types/jest": "^26.0.14", "@types/jest-when": "^2.7.1", "@types/joi": "^13.4.2", @@ -326,7 +333,6 @@ "@types/opn": "^5.1.0", "@types/pegjs": "^0.10.1", "@types/pngjs": "^3.4.0", - "@types/podium": "^1.0.0", "@types/prop-types": "^15.7.3", "@types/reach__router": "^1.2.6", "@types/react": "^16.9.36", diff --git a/src/core/public/public.api.md b/src/core/public/public.api.md index 4babec38a936e..da4a7f446add7 100644 --- a/src/core/public/public.api.md +++ b/src/core/public/public.api.md @@ -6,7 +6,7 @@ import { Action } from 'history'; import { ApiResponse } from '@elastic/elasticsearch/lib/Transport'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ConfigPath } from '@kbn/config'; import { EnvironmentMode } from '@kbn/config'; import { EuiBreadcrumb } from '@elastic/eui'; diff --git a/src/core/server/elasticsearch/legacy/errors.test.ts b/src/core/server/elasticsearch/legacy/errors.test.ts index 85e5eba721b34..4b315bf8aff45 100644 --- a/src/core/server/elasticsearch/legacy/errors.test.ts +++ b/src/core/server/elasticsearch/legacy/errors.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { LegacyElasticsearchErrorHelpers } from './errors'; diff --git a/src/core/server/elasticsearch/legacy/errors.ts b/src/core/server/elasticsearch/legacy/errors.ts index de4d2739977bb..e557e7395fe56 100644 --- a/src/core/server/elasticsearch/legacy/errors.ts +++ b/src/core/server/elasticsearch/legacy/errors.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { get } from 'lodash'; const code = Symbol('ElasticsearchError'); diff --git a/src/core/server/http/base_path_proxy_server.ts b/src/core/server/http/base_path_proxy_server.ts index acb83962bd457..42841377e7369 100644 --- a/src/core/server/http/base_path_proxy_server.ts +++ b/src/core/server/http/base_path_proxy_server.ts @@ -22,8 +22,8 @@ import { Agent as HttpsAgent, ServerOptions as TlsOptions } from 'https'; import apm from 'elastic-apm-node'; import { ByteSizeValue } from '@kbn/config-schema'; -import { Server, Request } from 'hapi'; -import HapiProxy from 'h2o2'; +import { Server, Request } from '@hapi/hapi'; +import HapiProxy from '@hapi/h2o2'; import { sampleSize } from 'lodash'; import * as Rx from 'rxjs'; import { take } from 'rxjs/operators'; diff --git a/src/core/server/http/cookie_session_storage.ts b/src/core/server/http/cookie_session_storage.ts index 5ca70045f81db..1ff0670d78f4e 100644 --- a/src/core/server/http/cookie_session_storage.ts +++ b/src/core/server/http/cookie_session_storage.ts @@ -17,10 +17,10 @@ * under the License. */ -import { Request, Server } from 'hapi'; -import hapiAuthCookie from 'hapi-auth-cookie'; +import { Request, Server } from '@hapi/hapi'; +import hapiAuthCookie from '@hapi/cookie'; // @ts-expect-error no TS definitions -import Statehood from 'statehood'; +import Statehood from '@hapi/statehood'; import { KibanaRequest, ensureRawRequest } from './router'; import { SessionStorageFactory, SessionStorage } from './session_storage'; @@ -80,7 +80,7 @@ class ScopedCookieSessionStorage> implements Sessi const session = await this.server.auth.test('security-cookie', this.request); // A browser can send several cookies, if it's not an array, just return the session value if (!Array.isArray(session)) { - return session as T; + return session.credentials as T; } // If we have an array with one value, we're good also @@ -141,20 +141,22 @@ export async function createCookieSessionStorageFactory( await server.register({ plugin: hapiAuthCookie }); server.auth.strategy('security-cookie', 'cookie', { - cookie: cookieOptions.name, - password: cookieOptions.encryptionKey, - validateFunc: async (req, session: T | T[]) => { + cookie: { + name: cookieOptions.name, + password: cookieOptions.encryptionKey, + isSecure: cookieOptions.isSecure, + path: basePath === undefined ? '/' : basePath, + clearInvalid: false, + isHttpOnly: true, + isSameSite: cookieOptions.sameSite === 'None' ? false : cookieOptions.sameSite ?? false, + }, + validateFunc: async (req: Request, session: T | T[]) => { const result = cookieOptions.validate(session); if (!result.isValid) { clearInvalidCookie(req, result.path); } return { valid: result.isValid }; }, - isSecure: cookieOptions.isSecure, - path: basePath, - clearInvalid: false, - isHttpOnly: true, - isSameSite: cookieOptions.sameSite === 'None' ? false : cookieOptions.sameSite ?? false, }); // A hack to support SameSite: 'None'. diff --git a/src/core/server/http/http_server.mocks.ts b/src/core/server/http/http_server.mocks.ts index d615e799f383f..8e8eaf46a7064 100644 --- a/src/core/server/http/http_server.mocks.ts +++ b/src/core/server/http/http_server.mocks.ts @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { parse as parseUrl } from 'url'; -import { Request } from 'hapi'; +import { URL, format as formatUrl } from 'url'; +import { Request } from '@hapi/hapi'; import { merge } from 'lodash'; import { Socket } from 'net'; import { stringify } from 'query-string'; @@ -73,7 +73,7 @@ function createKibanaRequestMock

({ auth = { isAuthenticated: true }, }: RequestFixtureOptions = {}) { const queryString = stringify(query, { sort: false }); - const url = parseUrl(`${path}${queryString ? `?${queryString}` : ''}`); + const url = new URL(`${path}${queryString ? `?${queryString}` : ''}`, 'http://localhost'); return KibanaRequest.from( createRawRequestMock({ @@ -87,6 +87,9 @@ function createKibanaRequestMock

({ method, url, route: { + // @ts-expect-error According to types/hapi__hapi the following settings-fields have problems: + // - `auth` can't be a boolean, but it can according to the @hapi/hapi source (https://github.com/hapijs/hapi/blob/v18.4.2/lib/route.js#L139) + // - `app` isn't a valid property, but it is and this was fixed in the types in v19.0.1 (https://github.com/DefinitelyTyped/DefinitelyTyped/pull/41968) settings: { tags: routeTags, auth: routeAuthRequired, app: kibanaRouteOptions }, }, raw: { @@ -120,9 +123,11 @@ type DeepPartialObject = { [P in keyof T]+?: DeepPartial }; function createRawRequestMock(customization: DeepPartial = {}) { const pathname = customization.url?.pathname || '/'; const path = `${pathname}${customization.url?.search || ''}`; - const url = Object.assign({ pathname, path, href: path }, customization.url); + const url = new URL( + formatUrl(Object.assign({ pathname, path, href: path }, customization.url)), + 'http://localhost' + ); - // @ts-expect-error _core isn't supposed to be accessed - remove once we upgrade to hapi v18 return merge( {}, { @@ -140,12 +145,6 @@ function createRawRequestMock(customization: DeepPartial = {}) { socket: {}, }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }, customization ) as Request; diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index d94bce12fb439..ced728e685f3b 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -16,8 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import { Server } from 'hapi'; -import HapiStaticFiles from 'inert'; +import { Server } from '@hapi/hapi'; +import HapiStaticFiles from '@hapi/inert'; import url from 'url'; import uuid from 'uuid'; diff --git a/src/core/server/http/http_service.mock.ts b/src/core/server/http/http_service.mock.ts index df837dc35505a..4fc972c9679bb 100644 --- a/src/core/server/http/http_service.mock.ts +++ b/src/core/server/http/http_service.mock.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { CspConfig } from '../csp'; @@ -88,6 +88,7 @@ const createInternalSetupContractMock = () => { start: jest.fn(), stop: jest.fn(), config: jest.fn().mockReturnValue(configMock.create()), + // @ts-expect-error somehow it thinks that `Server` isn't a `Construtable` } as unknown) as jest.MockedClass, createCookieSessionStorageFactory: jest.fn(), registerOnPreRouting: jest.fn(), diff --git a/src/core/server/http/http_service.ts b/src/core/server/http/http_service.ts index 82b141c8e50dd..0127a6493e7fd 100644 --- a/src/core/server/http/http_service.ts +++ b/src/core/server/http/http_service.ts @@ -19,7 +19,7 @@ import { Observable, Subscription, combineLatest } from 'rxjs'; import { first, map } from 'rxjs/operators'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { pick } from '@kbn/std'; import { CoreService } from '../../types'; diff --git a/src/core/server/http/http_tools.test.ts b/src/core/server/http/http_tools.test.ts index bdeca3a87799a..336c491a131d6 100644 --- a/src/core/server/http/http_tools.test.ts +++ b/src/core/server/http/http_tools.test.ts @@ -31,7 +31,7 @@ jest.mock('uuid', () => ({ })); import supertest from 'supertest'; -import { Request, ResponseToolkit } from 'hapi'; +import { Request, ResponseToolkit } from '@hapi/hapi'; import Joi from 'joi'; import { diff --git a/src/core/server/http/http_tools.ts b/src/core/server/http/http_tools.ts index b70680594151b..14adbced95c7a 100644 --- a/src/core/server/http/http_tools.ts +++ b/src/core/server/http/http_tools.ts @@ -17,8 +17,8 @@ * under the License. */ -import { Lifecycle, Request, ResponseToolkit, Server, ServerOptions, Util } from 'hapi'; -import Hoek from 'hoek'; +import { Lifecycle, Request, ResponseToolkit, Server, ServerOptions, Util } from '@hapi/hapi'; +import Hoek from '@hapi/hoek'; import { ServerOptions as TLSOptions } from 'https'; import { ValidationError } from 'joi'; import uuid from 'uuid'; diff --git a/src/core/server/http/https_redirect_server.ts b/src/core/server/http/https_redirect_server.ts index 7e1086752023f..81c50c1325dd3 100644 --- a/src/core/server/http/https_redirect_server.ts +++ b/src/core/server/http/https_redirect_server.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Request, ResponseToolkit, Server } from 'hapi'; +import { Request, ResponseToolkit, Server } from '@hapi/hapi'; import { format as formatUrl } from 'url'; import { Logger } from '../logging'; diff --git a/src/core/server/http/integration_tests/core_services.test.ts b/src/core/server/http/integration_tests/core_services.test.ts index f30ff66ed803a..7f785d4d67c29 100644 --- a/src/core/server/http/integration_tests/core_services.test.ts +++ b/src/core/server/http/integration_tests/core_services.test.ts @@ -23,8 +23,8 @@ import { legacyClusterClientInstanceMock, } from './core_service.test.mocks'; -import Boom from 'boom'; -import { Request } from 'hapi'; +import Boom from '@hapi/boom'; +import { Request } from '@hapi/hapi'; import { errors as esErrors } from 'elasticsearch'; import { LegacyElasticsearchErrorHelpers } from '../../elasticsearch/legacy'; diff --git a/src/core/server/http/integration_tests/request.test.ts b/src/core/server/http/integration_tests/request.test.ts index 3d0eba6de632e..710d7915c60a1 100644 --- a/src/core/server/http/integration_tests/request.test.ts +++ b/src/core/server/http/integration_tests/request.test.ts @@ -124,6 +124,54 @@ describe('KibanaRequest', () => { }); }); }); + + describe('route options', () => { + describe('authRequired', () => { + it('returns false if a route configured with "authRequired": false', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + registerAuth((req, res, t) => t.authenticated()); + const router = createRouter('/'); + router.get( + { path: '/', validate: false, options: { authRequired: false } }, + (context, req, res) => res.ok({ body: { authRequired: req.route.options.authRequired } }) + ); + await server.start(); + + await supertest(innerServer.listener).get('/').expect(200, { + authRequired: false, + }); + }); + it('returns "optional" if a route configured with "authRequired": optional', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + registerAuth((req, res, t) => t.authenticated()); + const router = createRouter('/'); + router.get( + { path: '/', validate: false, options: { authRequired: 'optional' } }, + (context, req, res) => res.ok({ body: { authRequired: req.route.options.authRequired } }) + ); + await server.start(); + + await supertest(innerServer.listener).get('/').expect(200, { + authRequired: 'optional', + }); + }); + it('returns true if a route configured with "authRequired": true', async () => { + const { server: innerServer, createRouter, registerAuth } = await server.setup(setupDeps); + registerAuth((req, res, t) => t.authenticated()); + const router = createRouter('/'); + router.get( + { path: '/', validate: false, options: { authRequired: true } }, + (context, req, res) => res.ok({ body: { authRequired: req.route.options.authRequired } }) + ); + await server.start(); + + await supertest(innerServer.listener).get('/').expect(200, { + authRequired: true, + }); + }); + }); + }); + describe('events', () => { describe('aborted$', () => { it('emits once and completes when request aborted', async (done) => { diff --git a/src/core/server/http/integration_tests/router.test.ts b/src/core/server/http/integration_tests/router.test.ts index ad228d9b0bb9d..e6a47fa54c12e 100644 --- a/src/core/server/http/integration_tests/router.test.ts +++ b/src/core/server/http/integration_tests/router.test.ts @@ -17,7 +17,7 @@ * under the License. */ import { Stream } from 'stream'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import supertest from 'supertest'; import { schema } from '@kbn/config-schema'; @@ -769,7 +769,7 @@ describe('Response factory', () => { await supertest(innerServer.listener).get('/').expect(200); }); - it('supports answering with Stream', async () => { + it('supports answering with Stream (without custom Content-Type)', async () => { const { server: innerServer, createRouter } = await server.setup(setupDeps); const router = createRouter('/'); @@ -790,8 +790,39 @@ describe('Response factory', () => { const result = await supertest(innerServer.listener).get('/').expect(200); + expect(result.text).toBe(undefined); + expect(result.body.toString()).toBe('abc'); + expect(result.header['content-type']).toBe('application/octet-stream'); + }); + + it('supports answering with Stream (with custom Content-Type)', async () => { + const { server: innerServer, createRouter } = await server.setup(setupDeps); + const router = createRouter('/'); + + router.get({ path: '/', validate: false }, (context, req, res) => { + const stream = new Stream.Readable({ + read() { + this.push('a'); + this.push('b'); + this.push('c'); + this.push(null); + }, + }); + + return res.ok({ + body: stream, + headers: { + 'Content-Type': 'text/plain', + }, + }); + }); + + await server.start(); + + const result = await supertest(innerServer.listener).get('/').expect(200); + expect(result.text).toBe('abc'); - expect(result.header['content-type']).toBe(undefined); + expect(result.header['content-type']).toBe('text/plain; charset=utf-8'); }); it('supports answering with chunked Stream', async () => { @@ -807,7 +838,12 @@ describe('Response factory', () => { stream.end(); }, 100); - return res.ok({ body: stream }); + return res.ok({ + body: stream, + headers: { + 'Content-Type': 'text/plain', + }, + }); }); await server.start(); diff --git a/src/core/server/http/lifecycle/auth.ts b/src/core/server/http/lifecycle/auth.ts index 2eaf7e0f6fbfe..5fa88fd2ed3f6 100644 --- a/src/core/server/http/lifecycle/auth.ts +++ b/src/core/server/http/lifecycle/auth.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { Lifecycle, Request, ResponseToolkit } from 'hapi'; +import { Lifecycle, Request, ResponseToolkit } from '@hapi/hapi'; import { Logger } from '../../logging'; import { HapiResponseAdapter, diff --git a/src/core/server/http/lifecycle/on_post_auth.ts b/src/core/server/http/lifecycle/on_post_auth.ts index 6ce70af2082c1..047dd660ae5d1 100644 --- a/src/core/server/http/lifecycle/on_post_auth.ts +++ b/src/core/server/http/lifecycle/on_post_auth.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from 'hapi'; +import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi'; import { Logger } from '../../logging'; import { HapiResponseAdapter, diff --git a/src/core/server/http/lifecycle/on_pre_auth.ts b/src/core/server/http/lifecycle/on_pre_auth.ts index f76fe87fd14a3..b5f0cf39d2773 100644 --- a/src/core/server/http/lifecycle/on_pre_auth.ts +++ b/src/core/server/http/lifecycle/on_pre_auth.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from 'hapi'; +import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi'; import { Logger } from '../../logging'; import { HapiResponseAdapter, diff --git a/src/core/server/http/lifecycle/on_pre_response.ts b/src/core/server/http/lifecycle/on_pre_response.ts index 37dddf4dd4767..42179374ec672 100644 --- a/src/core/server/http/lifecycle/on_pre_response.ts +++ b/src/core/server/http/lifecycle/on_pre_response.ts @@ -17,8 +17,13 @@ * under the License. */ -import { Lifecycle, Request, ResponseObject, ResponseToolkit as HapiResponseToolkit } from 'hapi'; -import Boom from 'boom'; +import { + Lifecycle, + Request, + ResponseObject, + ResponseToolkit as HapiResponseToolkit, +} from '@hapi/hapi'; +import Boom from '@hapi/boom'; import { Logger } from '../../logging'; import { HapiResponseAdapter, KibanaRequest, ResponseHeaders } from '../router'; diff --git a/src/core/server/http/lifecycle/on_pre_routing.ts b/src/core/server/http/lifecycle/on_pre_routing.ts index e553f113a7cf8..620ad9ed276b9 100644 --- a/src/core/server/http/lifecycle/on_pre_routing.ts +++ b/src/core/server/http/lifecycle/on_pre_routing.ts @@ -17,8 +17,7 @@ * under the License. */ -import { URL } from 'url'; -import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from 'hapi'; +import { Lifecycle, Request, ResponseToolkit as HapiResponseToolkit } from '@hapi/hapi'; import { Logger } from '../../logging'; import { HapiResponseAdapter, @@ -111,9 +110,7 @@ export function adoptToHapiOnRequest(fn: OnPreRoutingHandler, log: Logger) { if (preRoutingResult.isRewriteUrl(result)) { const appState = request.app as KibanaRequestState; - appState.rewrittenUrl = - // @ts-expect-error request._core isn't supposed to be accessed - remove once we upgrade to hapi v18 - appState.rewrittenUrl ?? new URL(request.url.href!, request._core.info.uri); + appState.rewrittenUrl = appState.rewrittenUrl ?? request.url; const { url } = result; diff --git a/src/core/server/http/router/error_wrapper.test.ts b/src/core/server/http/router/error_wrapper.test.ts index aa20b49dc9c91..33c652c6789ad 100644 --- a/src/core/server/http/router/error_wrapper.test.ts +++ b/src/core/server/http/router/error_wrapper.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaResponse, KibanaResponseFactory, kibanaResponseFactory } from './response'; import { wrapErrors } from './error_wrapper'; import { KibanaRequest, RequestHandler, RequestHandlerContext } from 'kibana/server'; diff --git a/src/core/server/http/router/error_wrapper.ts b/src/core/server/http/router/error_wrapper.ts index 75d0e0d630296..5a4b7e9f77582 100644 --- a/src/core/server/http/router/error_wrapper.ts +++ b/src/core/server/http/router/error_wrapper.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { RequestHandlerWrapper } from './router'; export const wrapErrors: RequestHandlerWrapper = (handler) => { diff --git a/src/core/server/http/router/request.test.ts b/src/core/server/http/router/request.test.ts index 0bf81a7aca852..8e8ef2d692e32 100644 --- a/src/core/server/http/router/request.test.ts +++ b/src/core/server/http/router/request.test.ts @@ -21,7 +21,7 @@ jest.mock('uuid', () => ({ v4: jest.fn().mockReturnValue('xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'), })); -import { RouteOptions } from 'hapi'; +import { RouteOptions } from '@hapi/hapi'; import { KibanaRequest } from './request'; import { httpServerMock } from '../http_server.mocks'; import { schema } from '@kbn/config-schema'; @@ -198,6 +198,7 @@ describe('KibanaRequest', () => { const request = httpServerMock.createRawRequest({ route: { settings: { + // @ts-expect-error According to types/hapi__hapi, `auth` can't be a boolean, but it can according to the @hapi/hapi source (https://github.com/hapijs/hapi/blob/v18.4.2/lib/route.js#L139) auth, }, }, @@ -207,11 +208,10 @@ describe('KibanaRequest', () => { expect(kibanaRequest.route.options.authRequired).toBe(false); }); it('handles required auth: { mode: "required" }', () => { - const auth: RouteOptions['auth'] = { mode: 'required' }; const request = httpServerMock.createRawRequest({ route: { settings: { - auth, + auth: { mode: 'required' }, }, }, }); @@ -221,11 +221,10 @@ describe('KibanaRequest', () => { }); it('handles required auth: { mode: "optional" }', () => { - const auth: RouteOptions['auth'] = { mode: 'optional' }; const request = httpServerMock.createRawRequest({ route: { settings: { - auth, + auth: { mode: 'optional' }, }, }, }); @@ -235,11 +234,10 @@ describe('KibanaRequest', () => { }); it('handles required auth: { mode: "try" } as "optional"', () => { - const auth: RouteOptions['auth'] = { mode: 'try' }; const request = httpServerMock.createRawRequest({ route: { settings: { - auth, + auth: { mode: 'try' }, }, }, }); @@ -249,26 +247,24 @@ describe('KibanaRequest', () => { }); it('throws on auth: strategy name', () => { - const auth: RouteOptions['auth'] = 'session'; const request = httpServerMock.createRawRequest({ route: { settings: { - auth, + auth: { strategies: ['session'] }, }, }, }); expect(() => KibanaRequest.from(request)).toThrowErrorMatchingInlineSnapshot( - `"unexpected authentication options: \\"session\\" for route: /"` + `"unexpected authentication options: {\\"strategies\\":[\\"session\\"]} for route: /"` ); }); it('throws on auth: { mode: unexpected mode }', () => { - const auth: RouteOptions['auth'] = { mode: undefined }; const request = httpServerMock.createRawRequest({ route: { settings: { - auth, + auth: { mode: undefined }, }, }, }); diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index 561bf742050c3..57665a4fad594 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -19,7 +19,7 @@ import { URL } from 'url'; import uuid from 'uuid'; -import { Request, RouteOptionsApp, ApplicationState } from 'hapi'; +import { Request, RouteOptionsApp, RequestApplicationState, RouteOptions } from '@hapi/hapi'; import { Observable, fromEvent, merge } from 'rxjs'; import { shareReplay, first, takeUntil } from 'rxjs/operators'; import { RecursiveReadonly } from '@kbn/utility-types'; @@ -42,7 +42,7 @@ export interface KibanaRouteOptions extends RouteOptionsApp { /** * @internal */ -export interface KibanaRequestState extends ApplicationState { +export interface KibanaRequestState extends RequestApplicationState { requestId: string; requestUuid: string; rewrittenUrl?: URL; @@ -212,8 +212,7 @@ export class KibanaRequest< this.uuid = appState?.requestUuid ?? uuid.v4(); this.rewrittenUrl = appState?.rewrittenUrl; - // @ts-expect-error request._core isn't supposed to be accessed - remove once we upgrade to hapi v18 - this.url = new URL(request.url.href!, request._core.info.uri); + this.url = request.url; this.headers = deepFreeze({ ...request.headers }); this.isSystemRequest = request.headers['kbn-system-request'] === 'true' || @@ -261,8 +260,16 @@ export class KibanaRequest< const socketTimeout = (request.raw.req.socket as any)?.timeout; const options = ({ authRequired: this.getAuthRequired(request), - // some places in LP call KibanaRequest.from(request) manually. remove fallback to true before v8 - xsrfRequired: (request.route.settings.app as KibanaRouteOptions)?.xsrfRequired ?? true, + // TypeScript note: Casting to `RouterOptions` to fix the following error: + // + // Property 'app' does not exist on type 'RouteSettings' + // + // In @types/hapi__hapi v18, `request.route.settings` is of type + // `RouteSettings`, which doesn't have an `app` property. I think this is + // a mistake. In v19, the `RouteSettings` interface does have an `app` + // property. + xsrfRequired: + ((request.route.settings as RouteOptions).app as KibanaRouteOptions)?.xsrfRequired ?? true, // some places in LP call KibanaRequest.from(request) manually. remove fallback to true before v8 tags: request.route.settings.tags || [], timeout: { payload: payloadTimeout, @@ -302,6 +309,7 @@ export class KibanaRequest< return true; } + // @ts-expect-error According to @types/hapi__hapi, `route.settings` should be of type `RouteSettings`, but it seems that it's actually `RouteOptions` (https://github.com/hapijs/hapi/blob/v18.4.2/lib/route.js#L139) if (authOptions === false) return false; throw new Error( `unexpected authentication options: ${JSON.stringify(authOptions)} for route: ${ diff --git a/src/core/server/http/router/response_adapter.ts b/src/core/server/http/router/response_adapter.ts index 948b4596e2658..63acd2207ac3a 100644 --- a/src/core/server/http/router/response_adapter.ts +++ b/src/core/server/http/router/response_adapter.ts @@ -16,9 +16,12 @@ * specific language governing permissions and limitations * under the License. */ -import { ResponseObject as HapiResponseObject, ResponseToolkit as HapiResponseToolkit } from 'hapi'; +import { + ResponseObject as HapiResponseObject, + ResponseToolkit as HapiResponseToolkit, +} from '@hapi/hapi'; import typeDetect from 'type-detect'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import * as stream from 'stream'; import { diff --git a/src/core/server/http/router/router.ts b/src/core/server/http/router/router.ts index cc5279a396163..b1e092ba5786a 100644 --- a/src/core/server/http/router/router.ts +++ b/src/core/server/http/router/router.ts @@ -17,8 +17,8 @@ * under the License. */ -import { Request, ResponseObject, ResponseToolkit } from 'hapi'; -import Boom from 'boom'; +import { Request, ResponseObject, ResponseToolkit } from '@hapi/hapi'; +import Boom from '@hapi/boom'; import { isConfigSchema } from '@kbn/config-schema'; import { Logger } from '../../logging'; diff --git a/src/core/server/legacy/logging/legacy_logging_server.ts b/src/core/server/legacy/logging/legacy_logging_server.ts index 096dbe54565e1..690c9c0bfe21d 100644 --- a/src/core/server/legacy/logging/legacy_logging_server.ts +++ b/src/core/server/legacy/logging/legacy_logging_server.ts @@ -17,8 +17,8 @@ * under the License. */ -import { ServerExtType } from 'hapi'; -import Podium from 'podium'; +import { ServerExtType } from '@hapi/hapi'; +import Podium from '@hapi/podium'; // @ts-expect-error: implicit any for JS file import { Config } from '../../../../legacy/server/config'; // @ts-expect-error: implicit any for JS file diff --git a/src/core/server/metrics/collectors/process.ts b/src/core/server/metrics/collectors/process.ts index b020eebcbbd0b..8b9cabe6227b6 100644 --- a/src/core/server/metrics/collectors/process.ts +++ b/src/core/server/metrics/collectors/process.ts @@ -18,7 +18,7 @@ */ import v8 from 'v8'; -import { Bench } from 'hoek'; +import { Bench } from '@hapi/hoek'; import { OpsProcessMetrics, MetricsCollector } from './types'; export class ProcessMetricsCollector implements MetricsCollector { diff --git a/src/core/server/metrics/collectors/server.ts b/src/core/server/metrics/collectors/server.ts index 036332c24c34f..e3dac1d1de897 100644 --- a/src/core/server/metrics/collectors/server.ts +++ b/src/core/server/metrics/collectors/server.ts @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import { ResponseObject, Server as HapiServer } from 'hapi'; +import { ResponseObject, Server as HapiServer } from '@hapi/hapi'; import { OpsServerMetrics, MetricsCollector } from './types'; interface ServerResponseTime { diff --git a/src/core/server/metrics/integration_tests/server_collector.test.ts b/src/core/server/metrics/integration_tests/server_collector.test.ts index 4476b3c26a2e1..ee3a066505a16 100644 --- a/src/core/server/metrics/integration_tests/server_collector.test.ts +++ b/src/core/server/metrics/integration_tests/server_collector.test.ts @@ -20,7 +20,7 @@ import { BehaviorSubject, Subject } from 'rxjs'; import { take, filter } from 'rxjs/operators'; import supertest from 'supertest'; -import { Server as HapiServer } from 'hapi'; +import { Server as HapiServer } from '@hapi/hapi'; import { createHttpServer } from '../../http/test_utils'; import { HttpService, IRouter } from '../../http'; import { contextServiceMock } from '../../context/context_service.mock'; diff --git a/src/core/server/metrics/ops_metrics_collector.ts b/src/core/server/metrics/ops_metrics_collector.ts index af74caa6cb386..184a4f3451c36 100644 --- a/src/core/server/metrics/ops_metrics_collector.ts +++ b/src/core/server/metrics/ops_metrics_collector.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Server as HapiServer } from 'hapi'; +import { Server as HapiServer } from '@hapi/hapi'; import { ProcessMetricsCollector, OsMetricsCollector, diff --git a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts index 214b51db7dd6b..9b13c9b24ffdc 100644 --- a/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts +++ b/src/core/server/saved_objects/export/get_sorted_objects_for_export.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { createListStream } from '../../utils/streams'; import { SavedObjectsClientContract, SavedObject } from '../types'; import { fetchNestedDependencies } from './inject_nested_depdendencies'; diff --git a/src/core/server/saved_objects/import/create_limit_stream.ts b/src/core/server/saved_objects/import/create_limit_stream.ts index 8f6ac91d0d315..709bb3b2d0065 100644 --- a/src/core/server/saved_objects/import/create_limit_stream.ts +++ b/src/core/server/saved_objects/import/create_limit_stream.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { Transform } from 'stream'; export function createLimitStream(limit: number) { diff --git a/src/core/server/saved_objects/import/validate_references.ts b/src/core/server/saved_objects/import/validate_references.ts index 89fe8ec8c0901..b0686215c00dd 100644 --- a/src/core/server/saved_objects/import/validate_references.ts +++ b/src/core/server/saved_objects/import/validate_references.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObject, SavedObjectsClientContract } from '../types'; import { SavedObjectsImportError, SavedObjectsImportRetry } from './types'; diff --git a/src/core/server/saved_objects/migrations/core/document_migrator.ts b/src/core/server/saved_objects/migrations/core/document_migrator.ts index 345704fbfd783..ccda72702b53c 100644 --- a/src/core/server/saved_objects/migrations/core/document_migrator.ts +++ b/src/core/server/saved_objects/migrations/core/document_migrator.ts @@ -60,7 +60,7 @@ * given an empty migrationVersion property {} if no such property exists. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { set } from '@elastic/safer-lodash-set'; import _ from 'lodash'; import Semver from 'semver'; diff --git a/src/core/server/saved_objects/service/lib/errors.test.ts b/src/core/server/saved_objects/service/lib/errors.test.ts index 931d9f725e412..497dc1bbe4c45 100644 --- a/src/core/server/saved_objects/service/lib/errors.test.ts +++ b/src/core/server/saved_objects/service/lib/errors.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsErrorHelpers } from './errors'; diff --git a/src/core/server/saved_objects/service/lib/errors.ts b/src/core/server/saved_objects/service/lib/errors.ts index 6fd5bc9de0ec5..78956ca8d6868 100644 --- a/src/core/server/saved_objects/service/lib/errors.ts +++ b/src/core/server/saved_objects/service/lib/errors.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; // 400 - badRequest const CODE_BAD_REQUEST = 'SavedObjectsClient/badRequest'; diff --git a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts index 858770579fb9e..fca361b8ffda0 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/search_dsl.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IndexMapping } from '../../../mappings'; import { getQueryParams } from './query_params'; diff --git a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts index ccf5ccd50bb75..a56cf6462dbe7 100644 --- a/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts +++ b/src/core/server/saved_objects/service/lib/search_dsl/sorting_params.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getProperty, IndexMapping } from '../../../mappings'; const TOP_LEVEL_FIELDS = ['_id', '_score']; diff --git a/src/core/server/saved_objects/version/decode_version.test.ts b/src/core/server/saved_objects/version/decode_version.test.ts index b157d97ae8a23..987af3e693823 100644 --- a/src/core/server/saved_objects/version/decode_version.test.ts +++ b/src/core/server/saved_objects/version/decode_version.test.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { decodeVersion } from './decode_version'; diff --git a/src/core/server/server.api.md b/src/core/server/server.api.md index 914b5fbdb5196..4562b6d696c87 100644 --- a/src/core/server/server.api.md +++ b/src/core/server/server.api.md @@ -5,7 +5,7 @@ ```ts import { ApiResponse } from '@elastic/elasticsearch/lib/Transport'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { BulkIndexDocumentsParams } from 'elasticsearch'; import { CatAliasesParams } from 'elasticsearch'; import { CatAllocationParams } from 'elasticsearch'; @@ -129,16 +129,16 @@ import { RecursiveReadonly } from '@kbn/utility-types'; import { ReindexParams } from 'elasticsearch'; import { ReindexRethrottleParams } from 'elasticsearch'; import { RenderSearchTemplateParams } from 'elasticsearch'; -import { Request } from 'hapi'; -import { ResponseObject } from 'hapi'; -import { ResponseToolkit } from 'hapi'; +import { Request } from '@hapi/hapi'; +import { ResponseObject } from '@hapi/hapi'; +import { ResponseToolkit } from '@hapi/hapi'; import { SchemaTypeError } from '@kbn/config-schema'; import { ScrollParams } from 'elasticsearch'; import { SearchParams } from 'elasticsearch'; import { SearchResponse as SearchResponse_2 } from 'elasticsearch'; import { SearchShardsParams } from 'elasticsearch'; import { SearchTemplateParams } from 'elasticsearch'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { ShallowPromise } from '@kbn/utility-types'; import { SnapshotCreateParams } from 'elasticsearch'; import { SnapshotCreateRepositoryParams } from 'elasticsearch'; diff --git a/src/legacy/server/core/index.ts b/src/legacy/server/core/index.ts index de5391d33cada..bfa7853de233d 100644 --- a/src/legacy/server/core/index.ts +++ b/src/legacy/server/core/index.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import KbnServer from '../kbn_server'; /** diff --git a/src/legacy/server/http/index.js b/src/legacy/server/http/index.js index 0cab1a1609287..16705e9241be8 100644 --- a/src/legacy/server/http/index.js +++ b/src/legacy/server/http/index.js @@ -18,7 +18,7 @@ */ import { format } from 'url'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { registerHapiPlugins } from './register_hapi_plugins'; import { setupBasePathProvider } from './setup_base_path_provider'; diff --git a/src/legacy/server/http/register_hapi_plugins.js b/src/legacy/server/http/register_hapi_plugins.js index 103e4a77cb4b2..19560351f3624 100644 --- a/src/legacy/server/http/register_hapi_plugins.js +++ b/src/legacy/server/http/register_hapi_plugins.js @@ -17,9 +17,9 @@ * under the License. */ -import HapiTemplates from 'vision'; -import HapiStaticFiles from 'inert'; -import HapiProxy from 'h2o2'; +import HapiTemplates from '@hapi/vision'; +import HapiStaticFiles from '@hapi/inert'; +import HapiProxy from '@hapi/h2o2'; const plugins = [HapiTemplates, HapiStaticFiles, HapiProxy]; diff --git a/src/legacy/server/i18n/i18n_mixin.ts b/src/legacy/server/i18n/i18n_mixin.ts index 4f77fa8df96cd..0b3879073c164 100644 --- a/src/legacy/server/i18n/i18n_mixin.ts +++ b/src/legacy/server/i18n/i18n_mixin.ts @@ -19,7 +19,7 @@ import { i18n, i18nLoader } from '@kbn/i18n'; import { basename } from 'path'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import type { UsageCollectionSetup } from '../../../plugins/usage_collection/server'; import { getKibanaTranslationPaths } from './get_kibana_translation_paths'; import KbnServer, { KibanaConfig } from '../kbn_server'; diff --git a/src/legacy/server/kbn_server.d.ts b/src/legacy/server/kbn_server.d.ts index 1718a9a8f55da..224398e1603ea 100644 --- a/src/legacy/server/kbn_server.d.ts +++ b/src/legacy/server/kbn_server.d.ts @@ -17,7 +17,7 @@ * under the License. */ -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { CoreSetup, @@ -104,4 +104,4 @@ export default class KbnServer { } // Re-export commonly used hapi types. -export { Server, Request, ResponseToolkit } from 'hapi'; +export { Server, Request, ResponseToolkit } from '@hapi/hapi'; diff --git a/src/legacy/server/logging/rotate/index.ts b/src/legacy/server/logging/rotate/index.ts index 646c89efe8e20..d6b7cfa76f9ee 100644 --- a/src/legacy/server/logging/rotate/index.ts +++ b/src/legacy/server/logging/rotate/index.ts @@ -18,7 +18,7 @@ */ import { isMaster, isWorker } from 'cluster'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { LogRotator } from './log_rotator'; import { KibanaConfig } from '../../kbn_server'; diff --git a/src/legacy/server/logging/rotate/log_rotator.ts b/src/legacy/server/logging/rotate/log_rotator.ts index 22183b2f0777a..c4054b2daed45 100644 --- a/src/legacy/server/logging/rotate/log_rotator.ts +++ b/src/legacy/server/logging/rotate/log_rotator.ts @@ -20,7 +20,7 @@ import * as chokidar from 'chokidar'; import { isMaster } from 'cluster'; import fs from 'fs'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { throttle } from 'lodash'; import { tmpdir } from 'os'; import { basename, dirname, join, sep } from 'path'; diff --git a/src/legacy/ui/ui_render/ui_render_mixin.js b/src/legacy/ui/ui_render/ui_render_mixin.js index 2983dbbc28667..a02c2fca14c18 100644 --- a/src/legacy/ui/ui_render/ui_render_mixin.js +++ b/src/legacy/ui/ui_render/ui_render_mixin.js @@ -18,7 +18,7 @@ */ import { createHash } from 'crypto'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import * as UiSharedDeps from '@kbn/ui-shared-deps'; import { KibanaRequest } from '../../../core/server'; diff --git a/src/optimize/bundles_route/bundles_route.test.ts b/src/optimize/bundles_route/bundles_route.test.ts index 8cf4e9d72685c..cbf9db2f3cd4b 100644 --- a/src/optimize/bundles_route/bundles_route.test.ts +++ b/src/optimize/bundles_route/bundles_route.test.ts @@ -22,8 +22,8 @@ import { readFileSync } from 'fs'; import crypto from 'crypto'; import Chance from 'chance'; -import Hapi from 'hapi'; -import Inert from 'inert'; +import Hapi from '@hapi/hapi'; +import Inert from '@hapi/inert'; import { createBundlesRoute } from './bundles_route'; diff --git a/src/optimize/bundles_route/bundles_route.ts b/src/optimize/bundles_route/bundles_route.ts index 6d618fba50ccf..0546ebda22761 100644 --- a/src/optimize/bundles_route/bundles_route.ts +++ b/src/optimize/bundles_route/bundles_route.ts @@ -19,7 +19,7 @@ import { extname, join } from 'path'; -import Hapi from 'hapi'; +import Hapi from '@hapi/hapi'; import * as UiSharedDeps from '@kbn/ui-shared-deps'; import { createDynamicAssetResponse } from './dynamic_asset_response'; diff --git a/src/optimize/bundles_route/dynamic_asset_response.ts b/src/optimize/bundles_route/dynamic_asset_response.ts index ce839b33ccac0..43560c08f4919 100644 --- a/src/optimize/bundles_route/dynamic_asset_response.ts +++ b/src/optimize/bundles_route/dynamic_asset_response.ts @@ -22,8 +22,8 @@ import { resolve } from 'path'; import { promisify } from 'util'; import Accept from 'accept'; -import Boom from 'boom'; -import Hapi from 'hapi'; +import Boom from '@hapi/boom'; +import Hapi from '@hapi/hapi'; import { FileHashCache } from './file_hash_cache'; import { getFileHash } from './file_hash'; diff --git a/src/optimize/optimize_mixin.ts b/src/optimize/optimize_mixin.ts index 37f8b08dde3b8..8bcb2c0a68a4a 100644 --- a/src/optimize/optimize_mixin.ts +++ b/src/optimize/optimize_mixin.ts @@ -17,7 +17,7 @@ * under the License. */ -import Hapi from 'hapi'; +import Hapi from '@hapi/hapi'; import { createBundlesRoute } from './bundles_route'; import { getNpUiPluginPublicDirs } from './np_ui_plugin_public_dirs'; diff --git a/src/plugins/console/server/lib/proxy_request.ts b/src/plugins/console/server/lib/proxy_request.ts index fb07b7c49a003..27e19d920ad17 100644 --- a/src/plugins/console/server/lib/proxy_request.ts +++ b/src/plugins/console/server/lib/proxy_request.ts @@ -21,7 +21,7 @@ import http from 'http'; import https from 'https'; import net from 'net'; import stream from 'stream'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { URL } from 'url'; interface Args { diff --git a/src/plugins/data/public/public.api.md b/src/plugins/data/public/public.api.md index b072407a5fe10..86a8f73c1e8ff 100644 --- a/src/plugins/data/public/public.api.md +++ b/src/plugins/data/public/public.api.md @@ -11,7 +11,7 @@ import { ApiResponse as ApiResponse_2 } from '@elastic/elasticsearch/lib/Transpo import { ApplicationStart } from 'kibana/public'; import { Assign } from '@kbn/utility-types'; import { BehaviorSubject } from 'rxjs'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { CoreSetup } from 'src/core/public'; import { CoreSetup as CoreSetup_2 } from 'kibana/public'; import { CoreStart } from 'kibana/public'; diff --git a/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts b/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts index e5a96c67c56b5..cbb3c2fbf3442 100644 --- a/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts +++ b/src/plugins/data/server/index_patterns/fetcher/lib/errors.ts @@ -17,7 +17,7 @@ * under the License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { get } from 'lodash'; const ERR_ES_INDEX_NOT_FOUND = 'index_not_found_exception'; diff --git a/src/plugins/data/server/plugins_data_server.api.md b/src/plugins/data/server/plugins_data_server.api.md index 0f0abe7df8a39..9faa7439d70a4 100644 --- a/src/plugins/data/server/plugins_data_server.api.md +++ b/src/plugins/data/server/plugins_data_server.api.md @@ -5,7 +5,7 @@ ```ts import { APICaller as APICaller_2 } from 'kibana/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { BulkIndexDocumentsParams } from 'elasticsearch'; import { CallCluster as CallCluster_2 } from 'src/legacy/core_plugins/elasticsearch'; import { CatAliasesParams } from 'elasticsearch'; @@ -116,9 +116,9 @@ import { RecursiveReadonly } from 'kibana/public'; import { ReindexParams } from 'elasticsearch'; import { ReindexRethrottleParams } from 'elasticsearch'; import { RenderSearchTemplateParams } from 'elasticsearch'; -import { Request } from 'hapi'; -import { ResponseObject } from 'hapi'; -import { ResponseToolkit } from 'hapi'; +import { Request } from '@hapi/hapi'; +import { ResponseObject } from '@hapi/hapi'; +import { ResponseToolkit } from '@hapi/hapi'; import { SchemaTypeError } from '@kbn/config-schema'; import { ScrollParams } from 'elasticsearch'; import { SearchParams } from 'elasticsearch'; diff --git a/src/plugins/embeddable/public/public.api.md b/src/plugins/embeddable/public/public.api.md index e84dff1172c2e..983daa4d5af73 100644 --- a/src/plugins/embeddable/public/public.api.md +++ b/src/plugins/embeddable/public/public.api.md @@ -12,7 +12,7 @@ import { ApiResponse as ApiResponse_2 } from '@elastic/elasticsearch'; import { ApplicationStart as ApplicationStart_2 } from 'kibana/public'; import { Assign } from '@kbn/utility-types'; import { BehaviorSubject } from 'rxjs'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { CoreSetup as CoreSetup_2 } from 'src/core/public'; import { CoreSetup as CoreSetup_3 } from 'kibana/public'; import { CoreStart as CoreStart_2 } from 'kibana/public'; diff --git a/src/plugins/share/server/routes/lib/short_url_assert_valid.ts b/src/plugins/share/server/routes/lib/short_url_assert_valid.ts index 2f120bbc03cd7..462fc31944b74 100644 --- a/src/plugins/share/server/routes/lib/short_url_assert_valid.ts +++ b/src/plugins/share/server/routes/lib/short_url_assert_valid.ts @@ -19,7 +19,7 @@ import { parse } from 'url'; import { trim } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; export function shortUrlAssertValid(url: string) { const { protocol, hostname, pathname } = parse(url); diff --git a/src/plugins/vis_type_timeseries/server/plugin.ts b/src/plugins/vis_type_timeseries/server/plugin.ts index 678ba2b371978..aabfa8a40e064 100644 --- a/src/plugins/vis_type_timeseries/server/plugin.ts +++ b/src/plugins/vis_type_timeseries/server/plugin.ts @@ -28,7 +28,7 @@ import { FakeRequest, } from 'src/core/server'; import { Observable } from 'rxjs'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { VisTypeTimeseriesConfig } from './config'; import { getVisData, GetVisData, GetVisDataOptions } from './lib/get_vis_data'; import { ValidationTelemetryService } from './validation_telemetry'; diff --git a/src/plugins/vis_type_timeseries/server/routes/fields.ts b/src/plugins/vis_type_timeseries/server/routes/fields.ts index 255c85c9eefa7..f9a600fa4b1f3 100644 --- a/src/plugins/vis_type_timeseries/server/routes/fields.ts +++ b/src/plugins/vis_type_timeseries/server/routes/fields.ts @@ -17,7 +17,7 @@ * under the License. */ -import { isBoom } from 'boom'; +import { isBoom } from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { getFields } from '../lib/get_fields'; import { Framework } from '../plugin'; diff --git a/test/api_integration/apis/index_patterns/es_errors/errors.js b/test/api_integration/apis/index_patterns/es_errors/errors.js index 9da29a0d3a3da..49a64f835fb35 100644 --- a/test/api_integration/apis/index_patterns/es_errors/errors.js +++ b/test/api_integration/apis/index_patterns/es_errors/errors.js @@ -19,7 +19,7 @@ import expect from '@kbn/expect'; import { errors as esErrors } from 'elasticsearch'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { isEsIndexNotFoundError, diff --git a/x-pack/package.json b/x-pack/package.json index ea1b7b9713df9..bc58cc5516cf9 100644 --- a/x-pack/package.json +++ b/x-pack/package.json @@ -32,6 +32,7 @@ "@cypress/webpack-preprocessor": "^5.4.1", "@elastic/apm-rum-react": "^1.2.5", "@elastic/maki": "6.3.0", + "@hapi/hapi": "^18.4.1", "@kbn/babel-preset": "1.0.0", "@kbn/dev-utils": "1.0.0", "@kbn/es": "1.0.0", @@ -57,7 +58,6 @@ "@types/angular": "^1.6.56", "@types/archiver": "^3.1.0", "@types/base64-js": "^1.2.5", - "@types/boom": "^7.2.0", "@types/cheerio": "^0.22.10", "@types/chroma-js": "^1.4.2", "@types/color": "^3.0.0", @@ -174,7 +174,6 @@ "graphql-codegen-typescript-resolvers": "^0.18.2", "graphql-codegen-typescript-server": "^0.18.2", "gulp": "4.0.2", - "hapi": "^17.5.3", "he": "^1.2.0", "history-extra": "^5.0.1", "hoist-non-react-statics": "^3.3.2", @@ -272,6 +271,8 @@ "@elastic/node-crypto": "1.2.1", "@elastic/numeral": "^2.5.0", "@elastic/safer-lodash-set": "0.0.0", + "@hapi/boom": "^7.4.11", + "@hapi/h2o2": "^8.3.2", "@kbn/config-schema": "1.0.0", "@kbn/i18n": "1.0.0", "@kbn/interpreter": "1.0.0", @@ -289,7 +290,6 @@ "archiver": "^3.1.1", "axios": "^0.19.2", "bluebird": "3.5.5", - "boom": "^7.2.0", "chroma-js": "^1.4.1", "classnames": "2.2.6", "concat-stream": "1.6.2", @@ -314,7 +314,6 @@ "graphql-fields": "^1.0.2", "graphql-tag": "^2.10.3", "graphql-tools": "^3.0.2", - "h2o2": "^8.1.2", "handlebars": "4.7.6", "history": "^4.9.0", "idx": "^2.5.6", diff --git a/x-pack/plugins/actions/server/action_type_registry.ts b/x-pack/plugins/actions/server/action_type_registry.ts index cacf7166b96ba..15ff7e558025e 100644 --- a/x-pack/plugins/actions/server/action_type_registry.ts +++ b/x-pack/plugins/actions/server/action_type_registry.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { RunContext, TaskManagerSetupContract } from '../../task_manager/server'; import { ActionType as CommonActionType } from '../common'; diff --git a/x-pack/plugins/actions/server/actions_client.ts b/x-pack/plugins/actions/server/actions_client.ts index e565d420d772e..2735a1ab44521 100644 --- a/x-pack/plugins/actions/server/actions_client.ts +++ b/x-pack/plugins/actions/server/actions_client.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ILegacyScopedClusterClient, SavedObjectsClientContract, diff --git a/x-pack/plugins/actions/server/authorization/actions_authorization.ts b/x-pack/plugins/actions/server/authorization/actions_authorization.ts index cad58bed50981..e8d7bc89f2dbf 100644 --- a/x-pack/plugins/actions/server/authorization/actions_authorization.ts +++ b/x-pack/plugins/actions/server/authorization/actions_authorization.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaRequest } from 'src/core/server'; import { SecurityPluginSetup } from '../../../security/server'; import { ActionsAuthorizationAuditLogger } from './audit_logger'; diff --git a/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts b/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts index c8e2684651598..18cbd9f9c5fad 100644 --- a/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts +++ b/x-pack/plugins/actions/server/lib/task_runner_factory.test.ts @@ -145,12 +145,6 @@ test('executes the task by calling the executor with proper parameters', async ( url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }, }); }); @@ -277,12 +271,6 @@ test('uses API key when provided', async () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }, }); }); @@ -322,12 +310,6 @@ test(`doesn't use API key when not provided`, async () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }, }); }); diff --git a/x-pack/plugins/actions/server/lib/task_runner_factory.ts b/x-pack/plugins/actions/server/lib/task_runner_factory.ts index 93ae5a2c807f9..aeeeb4ed7d520 100644 --- a/x-pack/plugins/actions/server/lib/task_runner_factory.ts +++ b/x-pack/plugins/actions/server/lib/task_runner_factory.ts @@ -102,12 +102,6 @@ export class TaskRunnerFactory { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; let executorResult: ActionTypeExecutorResult; diff --git a/x-pack/plugins/actions/server/lib/validate_with_schema.ts b/x-pack/plugins/actions/server/lib/validate_with_schema.ts index 50231f1c9a3a1..4cf5e924e3f24 100644 --- a/x-pack/plugins/actions/server/lib/validate_with_schema.ts +++ b/x-pack/plugins/actions/server/lib/validate_with_schema.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ActionType, ActionTypeConfig, ActionTypeSecrets, ActionTypeParams } from '../types'; export function validateParams< diff --git a/x-pack/plugins/actions/server/lib/verify_api_access.ts b/x-pack/plugins/actions/server/lib/verify_api_access.ts index 2055c66865c4e..ddbcaa90dcee1 100644 --- a/x-pack/plugins/actions/server/lib/verify_api_access.ts +++ b/x-pack/plugins/actions/server/lib/verify_api_access.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ILicenseState } from './license_state'; export function verifyApiAccess(licenseState: ILicenseState) { diff --git a/x-pack/plugins/alerts/server/alert_type_registry.ts b/x-pack/plugins/alerts/server/alert_type_registry.ts index 0cd218571035a..1d2d9981faeaa 100644 --- a/x-pack/plugins/alerts/server/alert_type_registry.ts +++ b/x-pack/plugins/alerts/server/alert_type_registry.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { schema } from '@kbn/config-schema'; import typeDetect from 'type-detect'; diff --git a/x-pack/plugins/alerts/server/alerts_client/alerts_client.ts b/x-pack/plugins/alerts/server/alerts_client/alerts_client.ts index 88abce7298622..a455872d23702 100644 --- a/x-pack/plugins/alerts/server/alerts_client/alerts_client.ts +++ b/x-pack/plugins/alerts/server/alerts_client/alerts_client.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { omit, isEqual, map, uniq, pick, truncate, trim } from 'lodash'; import { i18n } from '@kbn/i18n'; import { diff --git a/x-pack/plugins/alerts/server/alerts_client_factory.test.ts b/x-pack/plugins/alerts/server/alerts_client_factory.test.ts index 4e457cdb12bd3..3cf6666e90eb0 100644 --- a/x-pack/plugins/alerts/server/alerts_client_factory.test.ts +++ b/x-pack/plugins/alerts/server/alerts_client_factory.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Request } from 'hapi'; +import { Request } from '@hapi/hapi'; import { AlertsClientFactory, AlertsClientFactoryOpts } from './alerts_client_factory'; import { alertTypeRegistryMock } from './alert_type_registry.mock'; import { taskManagerMock } from '../../task_manager/server/mocks'; @@ -60,12 +60,6 @@ const fakeRequest = ({ url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: () => savedObjectsClient, } as unknown) as Request; diff --git a/x-pack/plugins/alerts/server/authorization/alerts_authorization.ts b/x-pack/plugins/alerts/server/authorization/alerts_authorization.ts index 17691baa25af8..6814e4ac1cc1b 100644 --- a/x-pack/plugins/alerts/server/authorization/alerts_authorization.ts +++ b/x-pack/plugins/alerts/server/authorization/alerts_authorization.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { map, mapValues, fromPairs, has } from 'lodash'; import { KibanaRequest } from 'src/core/server'; import { ALERTS_FEATURE_ID } from '../../common'; diff --git a/x-pack/plugins/alerts/server/lib/license_api_access.ts b/x-pack/plugins/alerts/server/lib/license_api_access.ts index 2e650ebf5eb17..f9ef51f6b3c9a 100644 --- a/x-pack/plugins/alerts/server/lib/license_api_access.ts +++ b/x-pack/plugins/alerts/server/lib/license_api_access.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { LicenseState } from './license_state'; export function verifyApiAccess(licenseState: LicenseState) { diff --git a/x-pack/plugins/alerts/server/lib/license_state.ts b/x-pack/plugins/alerts/server/lib/license_state.ts index b3204d886960f..ead6b743f1719 100644 --- a/x-pack/plugins/alerts/server/lib/license_state.ts +++ b/x-pack/plugins/alerts/server/lib/license_state.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { assertNever } from '@kbn/std'; import { Observable, Subscription } from 'rxjs'; diff --git a/x-pack/plugins/alerts/server/lib/validate_alert_type_params.ts b/x-pack/plugins/alerts/server/lib/validate_alert_type_params.ts index b6dcb522f0925..a443143d8cbde 100644 --- a/x-pack/plugins/alerts/server/lib/validate_alert_type_params.ts +++ b/x-pack/plugins/alerts/server/lib/validate_alert_type_params.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { AlertType, AlertExecutorOptions } from '../types'; export function validateAlertTypeParams( diff --git a/x-pack/plugins/alerts/server/plugin.test.ts b/x-pack/plugins/alerts/server/plugin.test.ts index ece7d31d2f7fd..b13a1c62f6602 100644 --- a/x-pack/plugins/alerts/server/plugin.test.ts +++ b/x-pack/plugins/alerts/server/plugin.test.ts @@ -149,12 +149,6 @@ describe('Alerting Plugin', () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: jest.fn(), } as unknown) as KibanaRequest; await startContract.getAlertsClientWithRequest(fakeRequest); diff --git a/x-pack/plugins/alerts/server/task_runner/task_runner.test.ts b/x-pack/plugins/alerts/server/task_runner/task_runner.test.ts index 17d5fcd31b745..8e345d6ff66a8 100644 --- a/x-pack/plugins/alerts/server/task_runner/task_runner.test.ts +++ b/x-pack/plugins/alerts/server/task_runner/task_runner.test.ts @@ -364,12 +364,6 @@ describe('Task Runner', () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }); expect(actionsClient.enqueueExecution).toHaveBeenCalledTimes(1); expect(actionsClient.enqueueExecution.mock.calls[0]).toMatchInlineSnapshot(` @@ -668,12 +662,6 @@ describe('Task Runner', () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }); }); @@ -706,12 +694,6 @@ describe('Task Runner', () => { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, }); }); diff --git a/x-pack/plugins/alerts/server/task_runner/task_runner.ts b/x-pack/plugins/alerts/server/task_runner/task_runner.ts index 76125da20d552..954c5675df89c 100644 --- a/x-pack/plugins/alerts/server/task_runner/task_runner.ts +++ b/x-pack/plugins/alerts/server/task_runner/task_runner.ts @@ -101,12 +101,6 @@ export class TaskRunner { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; } diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts index d0673335387c6..73e590064bac0 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/create_anomaly_detection_jobs.ts @@ -7,7 +7,7 @@ import { Logger } from 'kibana/server'; import uuid from 'uuid/v4'; import { snakeCase } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ProcessorEvent } from '../../../common/processor_event'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { PromiseReturnType } from '../../../../observability/typings/common'; diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts index ead0c79a02836..88da6f619d610 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/get_anomaly_detection_jobs.ts @@ -5,7 +5,7 @@ */ import { Logger } from 'kibana/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { Setup } from '../helpers/setup_request'; import { getMlJobsWithAPMGroup } from './get_ml_jobs_with_apm_group'; diff --git a/x-pack/plugins/apm/server/lib/anomaly_detection/has_legacy_jobs.ts b/x-pack/plugins/apm/server/lib/anomaly_detection/has_legacy_jobs.ts index c1f346aa30e1f..eca8ad273a53d 100644 --- a/x-pack/plugins/apm/server/lib/anomaly_detection/has_legacy_jobs.ts +++ b/x-pack/plugins/apm/server/lib/anomaly_detection/has_legacy_jobs.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { Setup } from '../helpers/setup_request'; import { getMlJobsWithAPMGroup } from './get_ml_jobs_with_apm_group'; diff --git a/x-pack/plugins/apm/server/lib/service_map/get_service_anomalies.ts b/x-pack/plugins/apm/server/lib/service_map/get_service_anomalies.ts index 895fc70d76af1..19864cb420b82 100644 --- a/x-pack/plugins/apm/server/lib/service_map/get_service_anomalies.ts +++ b/x-pack/plugins/apm/server/lib/service_map/get_service_anomalies.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getServiceHealthStatus } from '../../../common/service_health_status'; import { Setup, SetupTimeRange } from '../helpers/setup_request'; import { PromiseReturnType } from '../../../typings/common'; diff --git a/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts b/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts index 524b9bfdc7891..22c655bb96f50 100644 --- a/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts +++ b/x-pack/plugins/apm/server/lib/service_map/get_trace_sample_ids.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { uniq, take, sortBy } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ProcessorEvent } from '../../../common/processor_event'; import { Setup, SetupTimeRange } from '../helpers/setup_request'; import { rangeFilter } from '../../../common/utils/range_filter'; diff --git a/x-pack/plugins/apm/server/routes/create_api/index.ts b/x-pack/plugins/apm/server/routes/create_api/index.ts index 42eebc51463db..cecb4f6ed3367 100644 --- a/x-pack/plugins/apm/server/routes/create_api/index.ts +++ b/x-pack/plugins/apm/server/routes/create_api/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { pick, difference } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import * as t from 'io-ts'; import { PathReporter } from 'io-ts/lib/PathReporter'; diff --git a/x-pack/plugins/apm/server/routes/service_map.ts b/x-pack/plugins/apm/server/routes/service_map.ts index 6e86ececd1bfe..ffc8cb84b690a 100644 --- a/x-pack/plugins/apm/server/routes/service_map.ts +++ b/x-pack/plugins/apm/server/routes/service_map.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import * as t from 'io-ts'; import { invalidLicenseMessage, diff --git a/x-pack/plugins/apm/server/routes/services.ts b/x-pack/plugins/apm/server/routes/services.ts index 5673aa123b6aa..590b6c49d71bf 100644 --- a/x-pack/plugins/apm/server/routes/services.ts +++ b/x-pack/plugins/apm/server/routes/services.ts @@ -5,7 +5,7 @@ */ import * as t from 'io-ts'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { uniq } from 'lodash'; import { setupRequest } from '../lib/helpers/setup_request'; import { getServiceAgentName } from '../lib/services/get_service_agent_name'; diff --git a/x-pack/plugins/apm/server/routes/settings/agent_configuration.ts b/x-pack/plugins/apm/server/routes/settings/agent_configuration.ts index beab6b6c850e3..7ed5ef442b6fc 100644 --- a/x-pack/plugins/apm/server/routes/settings/agent_configuration.ts +++ b/x-pack/plugins/apm/server/routes/settings/agent_configuration.ts @@ -5,7 +5,7 @@ */ import * as t from 'io-ts'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { setupRequest } from '../../lib/helpers/setup_request'; import { getServiceNames } from '../../lib/settings/agent_configuration/get_service_names'; import { createOrUpdateConfiguration } from '../../lib/settings/agent_configuration/create_or_update_configuration'; diff --git a/x-pack/plugins/apm/server/routes/settings/anomaly_detection.ts b/x-pack/plugins/apm/server/routes/settings/anomaly_detection.ts index f0a22356d074b..3e5a9ee725991 100644 --- a/x-pack/plugins/apm/server/routes/settings/anomaly_detection.ts +++ b/x-pack/plugins/apm/server/routes/settings/anomaly_detection.ts @@ -5,7 +5,7 @@ */ import * as t from 'io-ts'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { isActivePlatinumLicense } from '../../../common/service_map'; import { ML_ERRORS } from '../../../common/anomaly_detection'; import { createRoute } from '../create_route'; diff --git a/x-pack/plugins/apm/server/routes/settings/custom_link.ts b/x-pack/plugins/apm/server/routes/settings/custom_link.ts index 7882383d78ab0..33769ac1d1c6f 100644 --- a/x-pack/plugins/apm/server/routes/settings/custom_link.ts +++ b/x-pack/plugins/apm/server/routes/settings/custom_link.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import * as t from 'io-ts'; import { pick } from 'lodash'; import { INVALID_LICENSE } from '../../../common/custom_link'; diff --git a/x-pack/plugins/apm/server/routes/transaction_groups.ts b/x-pack/plugins/apm/server/routes/transaction_groups.ts index 18fc73b468cd4..a3a73222210bb 100644 --- a/x-pack/plugins/apm/server/routes/transaction_groups.ts +++ b/x-pack/plugins/apm/server/routes/transaction_groups.ts @@ -5,7 +5,7 @@ */ import * as t from 'io-ts'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { setupRequest } from '../lib/helpers/setup_request'; import { getTransactionCharts } from '../lib/transactions/charts'; import { getTransactionDistribution } from '../lib/transactions/distribution'; diff --git a/x-pack/plugins/canvas/server/lib/format_response.js b/x-pack/plugins/canvas/server/lib/format_response.js index a317ca8be56f8..f313d4978d58d 100644 --- a/x-pack/plugins/canvas/server/lib/format_response.js +++ b/x-pack/plugins/canvas/server/lib/format_response.js @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import boom from 'boom'; +import boom from '@hapi/boom'; export const formatResponse = (esErrors) => (resp) => { if (resp.isBoom) { diff --git a/x-pack/plugins/canvas/server/routes/templates/list.test.ts b/x-pack/plugins/canvas/server/routes/templates/list.test.ts index 9ceab3b5c9705..72a0427306f7f 100644 --- a/x-pack/plugins/canvas/server/routes/templates/list.test.ts +++ b/x-pack/plugins/canvas/server/routes/templates/list.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { initializeListTemplates } from './list'; import { kibanaResponseFactory, RequestHandlerContext, RequestHandler } from 'src/core/server'; import { savedObjectsClientMock, httpServerMock } from 'src/core/server/mocks'; diff --git a/x-pack/plugins/case/server/client/cases/create.ts b/x-pack/plugins/case/server/client/cases/create.ts index 3379099419a75..59222be062c75 100644 --- a/x-pack/plugins/case/server/client/cases/create.ts +++ b/x-pack/plugins/case/server/client/cases/create.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/client/cases/update.ts b/x-pack/plugins/case/server/client/cases/update.ts index 424f51ee40f08..a754ce27c5e41 100644 --- a/x-pack/plugins/case/server/client/cases/update.ts +++ b/x-pack/plugins/case/server/client/cases/update.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/client/comments/add.ts b/x-pack/plugins/case/server/client/comments/add.ts index 765eb2c873765..a95b7833a5232 100644 --- a/x-pack/plugins/case/server/client/comments/add.ts +++ b/x-pack/plugins/case/server/client/comments/add.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/routes/api/cases/comments/delete_comment.ts b/x-pack/plugins/case/server/routes/api/cases/comments/delete_comment.ts index 70c0d8c2f84f9..c7770810d172f 100644 --- a/x-pack/plugins/case/server/routes/api/cases/comments/delete_comment.ts +++ b/x-pack/plugins/case/server/routes/api/cases/comments/delete_comment.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { CASE_SAVED_OBJECT } from '../../../../saved_object_types'; diff --git a/x-pack/plugins/case/server/routes/api/cases/comments/find_comments.ts b/x-pack/plugins/case/server/routes/api/cases/comments/find_comments.ts index 3df9fdb80ba8a..a4b89353ef3fe 100644 --- a/x-pack/plugins/case/server/routes/api/cases/comments/find_comments.ts +++ b/x-pack/plugins/case/server/routes/api/cases/comments/find_comments.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/case/server/routes/api/cases/comments/patch_comment.ts b/x-pack/plugins/case/server/routes/api/cases/comments/patch_comment.ts index 61d7382fca808..e75e89fa207b9 100644 --- a/x-pack/plugins/case/server/routes/api/cases/comments/patch_comment.ts +++ b/x-pack/plugins/case/server/routes/api/cases/comments/patch_comment.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/routes/api/cases/configure/get_connectors.ts b/x-pack/plugins/case/server/routes/api/cases/configure/get_connectors.ts index c3e565a404e97..547e67379ad6c 100644 --- a/x-pack/plugins/case/server/routes/api/cases/configure/get_connectors.ts +++ b/x-pack/plugins/case/server/routes/api/cases/configure/get_connectors.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { RouteDeps } from '../../types'; import { wrapError } from '../../utils'; // eslint-disable-next-line @kbn/eslint/no-restricted-paths diff --git a/x-pack/plugins/case/server/routes/api/cases/configure/patch_configure.ts b/x-pack/plugins/case/server/routes/api/cases/configure/patch_configure.ts index d3a64559e5a2b..b3305a2c0b8e4 100644 --- a/x-pack/plugins/case/server/routes/api/cases/configure/patch_configure.ts +++ b/x-pack/plugins/case/server/routes/api/cases/configure/patch_configure.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/routes/api/cases/configure/post_configure.ts b/x-pack/plugins/case/server/routes/api/cases/configure/post_configure.ts index 48b4582b2447b..97856c84d60fc 100644 --- a/x-pack/plugins/case/server/routes/api/cases/configure/post_configure.ts +++ b/x-pack/plugins/case/server/routes/api/cases/configure/post_configure.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/case/server/routes/api/cases/find_cases.ts b/x-pack/plugins/case/server/routes/api/cases/find_cases.ts index 4cdafca1cc9e7..e70225456d5a8 100644 --- a/x-pack/plugins/case/server/routes/api/cases/find_cases.ts +++ b/x-pack/plugins/case/server/routes/api/cases/find_cases.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/case/server/routes/api/cases/push_case.ts b/x-pack/plugins/case/server/routes/api/cases/push_case.ts index 11e501bf8f71f..80b65b54468fc 100644 --- a/x-pack/plugins/case/server/routes/api/cases/push_case.ts +++ b/x-pack/plugins/case/server/routes/api/cases/push_case.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import isEmpty from 'lodash/isEmpty'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/case/server/routes/api/utils.test.ts b/x-pack/plugins/case/server/routes/api/utils.test.ts index bb38fae35ad50..00584a9d7431f 100644 --- a/x-pack/plugins/case/server/routes/api/utils.test.ts +++ b/x-pack/plugins/case/server/routes/api/utils.test.ts @@ -17,7 +17,7 @@ import { sortToSnake, } from './utils'; import { newCase } from './__mocks__/request_responses'; -import { isBoom, boomify } from 'boom'; +import { isBoom, boomify } from '@hapi/boom'; import { mockCases, mockCaseComments, diff --git a/x-pack/plugins/case/server/routes/api/utils.ts b/x-pack/plugins/case/server/routes/api/utils.ts index 90066bf29ae66..3f82dac96a70e 100644 --- a/x-pack/plugins/case/server/routes/api/utils.ts +++ b/x-pack/plugins/case/server/routes/api/utils.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import { boomify, isBoom } from 'boom'; +import { boomify, isBoom } from '@hapi/boom'; import { CustomHttpResponseOptions, ResponseError, diff --git a/x-pack/plugins/event_log/server/event_log_client.test.ts b/x-pack/plugins/event_log/server/event_log_client.test.ts index d9846428b9488..d6793be425585 100644 --- a/x-pack/plugins/event_log/server/event_log_client.test.ts +++ b/x-pack/plugins/event_log/server/event_log_client.test.ts @@ -322,12 +322,6 @@ function FakeRequest(): KibanaRequest { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: () => savedObjectGetter, } as unknown) as KibanaRequest; } diff --git a/x-pack/plugins/event_log/server/event_log_start_service.test.ts b/x-pack/plugins/event_log/server/event_log_start_service.test.ts index db6f4a1ad0f27..0a5b169e87d4d 100644 --- a/x-pack/plugins/event_log/server/event_log_start_service.test.ts +++ b/x-pack/plugins/event_log/server/event_log_start_service.test.ts @@ -56,12 +56,6 @@ function fakeRequest(): KibanaRequest { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: () => savedObjectsClient, } as unknown) as KibanaRequest; } diff --git a/x-pack/plugins/event_log/server/saved_object_provider_registry.test.ts b/x-pack/plugins/event_log/server/saved_object_provider_registry.test.ts index 076260ab2fe53..6a02d54c87514 100644 --- a/x-pack/plugins/event_log/server/saved_object_provider_registry.test.ts +++ b/x-pack/plugins/event_log/server/saved_object_provider_registry.test.ts @@ -93,12 +93,6 @@ function fakeRequest(): KibanaRequest { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, getSavedObjectsClient: () => savedObjectsClient, } as unknown) as KibanaRequest; } diff --git a/x-pack/plugins/file_upload/server/client/errors.js b/x-pack/plugins/file_upload/server/client/errors.js index 0f8a0f0d8c0a9..a86edb330dec1 100644 --- a/x-pack/plugins/file_upload/server/client/errors.js +++ b/x-pack/plugins/file_upload/server/client/errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; export function wrapError(error) { return boomify(error, { statusCode: error.status }); diff --git a/x-pack/plugins/graph/server/lib/license_state.ts b/x-pack/plugins/graph/server/lib/license_state.ts index 8d64c826d8fa1..eceecdac2d7c9 100644 --- a/x-pack/plugins/graph/server/lib/license_state.ts +++ b/x-pack/plugins/graph/server/lib/license_state.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { map } from 'rxjs/operators'; import { Observable, Subscription } from 'rxjs'; import { LicensingPluginStart } from '../../../licensing/server'; diff --git a/x-pack/plugins/graph/server/routes/explore.ts b/x-pack/plugins/graph/server/routes/explore.ts index c436fbd1c79af..a1e24695413c9 100644 --- a/x-pack/plugins/graph/server/routes/explore.ts +++ b/x-pack/plugins/graph/server/routes/explore.ts @@ -6,7 +6,7 @@ import { IRouter } from 'kibana/server'; import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { get } from 'lodash'; import { LicenseState, verifyApiAccess } from '../lib/license_state'; diff --git a/x-pack/plugins/infra/server/kibana.index.ts b/x-pack/plugins/infra/server/kibana.index.ts index e47f27117b309..a1e9456ce8084 100644 --- a/x-pack/plugins/infra/server/kibana.index.ts +++ b/x-pack/plugins/infra/server/kibana.index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import JoiNamespace from 'joi'; export interface KbnServer extends Server { diff --git a/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts index 40ff69f78cee2..ad82939ec7f9d 100644 --- a/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/infra/server/lib/adapters/framework/adapter_types.ts @@ -5,7 +5,7 @@ */ import { GenericParams, SearchResponse } from 'elasticsearch'; -import { Lifecycle } from 'hapi'; +import { Lifecycle } from '@hapi/hapi'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { RouteConfig, RouteMethod } from '../../../../../../../src/core/server'; import { HomeServerPluginSetup } from '../../../../../../../src/plugins/home/server'; diff --git a/x-pack/plugins/infra/server/plugin.ts b/x-pack/plugins/infra/server/plugin.ts index 737f7ed1b6e4f..a83e9ec2a42be 100644 --- a/x-pack/plugins/infra/server/plugin.ts +++ b/x-pack/plugins/infra/server/plugin.ts @@ -5,7 +5,7 @@ */ import { CoreSetup, PluginInitializerContext } from 'src/core/server'; -import { Server } from 'hapi'; +import { Server } from '@hapi/hapi'; import { Observable } from 'rxjs'; import { schema, TypeOf } from '@kbn/config-schema'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts index 9dc309c605206..e0b141be3f5ef 100644 --- a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts +++ b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_hosts_anomalies.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { INFA_ML_GET_METRICS_HOSTS_ANOMALIES_PATH, diff --git a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts index 1618018b85fcf..34a17b45ad1bd 100644 --- a/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts +++ b/x-pack/plugins/infra/server/routes/infra_ml/results/metrics_k8s_anomalies.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { INFA_ML_GET_METRICS_K8S_ANOMALIES_PATH, diff --git a/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts b/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts index 687e368736a41..8b5271cb960c1 100644 --- a/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts +++ b/x-pack/plugins/infra/server/routes/inventory_metadata/index.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/infra/server/routes/log_alerts/chart_preview_data.ts b/x-pack/plugins/infra/server/routes/log_alerts/chart_preview_data.ts index 95389e14acdb8..ba144ef6491b2 100644 --- a/x-pack/plugins/infra/server/routes/log_alerts/chart_preview_data.ts +++ b/x-pack/plugins/infra/server/routes/log_alerts/chart_preview_data.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../lib/infra_types'; import { LOG_ALERTS_CHART_PREVIEW_DATA_PATH, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies.ts index 559609ebc7fbd..ec2bc6e5ed739 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { LOG_ANALYSIS_GET_LOG_ENTRY_ANOMALIES_PATH, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies_datasets.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies_datasets.ts index 8b36f32f318a1..9adb8e71f25e4 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies_datasets.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_anomalies_datasets.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogEntryAnomaliesDatasetsRequestPayloadRT, getLogEntryAnomaliesDatasetsSuccessReponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_categories.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_categories.ts index 2e2f2642b4a45..7071d38dffe5d 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_categories.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_categories.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogEntryCategoriesRequestPayloadRT, getLogEntryCategoriesSuccessReponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets.ts index 20d1d919b5006..fa50e4cea7365 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogEntryCategoryDatasetsRequestPayloadRT, getLogEntryCategoryDatasetsSuccessReponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets_stats.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets_stats.ts index 8414fc2062ae9..7250f6abe17b5 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets_stats.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_datasets_stats.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLatestLogEntryCategoryDatasetsStatsRequestPayloadRT, getLatestLogEntryCategoryDatasetsStatsSuccessResponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_examples.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_examples.ts index 0c408b7fc93f7..1c0dacda61829 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_examples.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_category_examples.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogEntryCategoryExamplesRequestPayloadRT, getLogEntryCategoryExamplesSuccessReponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_examples.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_examples.ts index 678c9f5666fc8..f1ad852e923c2 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_examples.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_examples.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { createValidationFunction } from '../../../../common/runtime_types'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { getLogEntryExamples } from '../../../lib/log_analysis'; diff --git a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate.ts b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate.ts index 23d8bd30c659b..5def58505f00b 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/results/log_entry_rate.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { LOG_ANALYSIS_GET_LOG_ENTRY_RATE_PATH, diff --git a/x-pack/plugins/infra/server/routes/log_analysis/validation/datasets.ts b/x-pack/plugins/infra/server/routes/log_analysis/validation/datasets.ts index ba83f7e3f02fa..22790f5110f14 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/validation/datasets.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/validation/datasets.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { InfraBackendLibs } from '../../../lib/infra_types'; import { diff --git a/x-pack/plugins/infra/server/routes/log_analysis/validation/indices.ts b/x-pack/plugins/infra/server/routes/log_analysis/validation/indices.ts index 9b8219e514c13..832d8b3e08d64 100644 --- a/x-pack/plugins/infra/server/routes/log_analysis/validation/indices.ts +++ b/x-pack/plugins/infra/server/routes/log_analysis/validation/indices.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/log_entries/highlights.ts b/x-pack/plugins/infra/server/routes/log_entries/highlights.ts index be6be88e4b5ec..cc8483fb5c658 100644 --- a/x-pack/plugins/infra/server/routes/log_entries/highlights.ts +++ b/x-pack/plugins/infra/server/routes/log_entries/highlights.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/log_entries/summary.ts b/x-pack/plugins/infra/server/routes/log_entries/summary.ts index c1d532fa5a083..f8b71b161cd6c 100644 --- a/x-pack/plugins/infra/server/routes/log_entries/summary.ts +++ b/x-pack/plugins/infra/server/routes/log_entries/summary.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/log_entries/summary_highlights.ts b/x-pack/plugins/infra/server/routes/log_entries/summary_highlights.ts index 20f572787e5a4..becf9396e8937 100644 --- a/x-pack/plugins/infra/server/routes/log_entries/summary_highlights.ts +++ b/x-pack/plugins/infra/server/routes/log_entries/summary_highlights.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/log_sources/configuration.ts b/x-pack/plugins/infra/server/routes/log_sources/configuration.ts index 46929954431f5..df2a889e5a34d 100644 --- a/x-pack/plugins/infra/server/routes/log_sources/configuration.ts +++ b/x-pack/plugins/infra/server/routes/log_sources/configuration.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogSourceConfigurationRequestParamsRT, getLogSourceConfigurationSuccessResponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/log_sources/status.ts b/x-pack/plugins/infra/server/routes/log_sources/status.ts index 193c3541d740b..e9466f7fa8878 100644 --- a/x-pack/plugins/infra/server/routes/log_sources/status.ts +++ b/x-pack/plugins/infra/server/routes/log_sources/status.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { getLogSourceStatusRequestParamsRT, getLogSourceStatusSuccessResponsePayloadRT, diff --git a/x-pack/plugins/infra/server/routes/metadata/index.ts b/x-pack/plugins/infra/server/routes/metadata/index.ts index ee71167b5a1c7..2ad4a1492a534 100644 --- a/x-pack/plugins/infra/server/routes/metadata/index.ts +++ b/x-pack/plugins/infra/server/routes/metadata/index.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { get } from 'lodash'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/metrics_api/index.ts b/x-pack/plugins/infra/server/routes/metrics_api/index.ts index f3dcdeeb70cc1..06d9fe0f6fc94 100644 --- a/x-pack/plugins/infra/server/routes/metrics_api/index.ts +++ b/x-pack/plugins/infra/server/routes/metrics_api/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/infra/server/routes/metrics_explorer/index.ts b/x-pack/plugins/infra/server/routes/metrics_explorer/index.ts index 4b90b52cb51f6..86575a4bfb618 100644 --- a/x-pack/plugins/infra/server/routes/metrics_explorer/index.ts +++ b/x-pack/plugins/infra/server/routes/metrics_explorer/index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; import { identity } from 'fp-ts/lib/function'; diff --git a/x-pack/plugins/infra/server/routes/node_details/index.ts b/x-pack/plugins/infra/server/routes/node_details/index.ts index a457ccac2416c..008096261b082 100644 --- a/x-pack/plugins/infra/server/routes/node_details/index.ts +++ b/x-pack/plugins/infra/server/routes/node_details/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/infra/server/routes/snapshot/index.ts b/x-pack/plugins/infra/server/routes/snapshot/index.ts index 3f09ae89bc97e..0cbd2d1767e1e 100644 --- a/x-pack/plugins/infra/server/routes/snapshot/index.ts +++ b/x-pack/plugins/infra/server/routes/snapshot/index.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { pipe } from 'fp-ts/lib/pipeable'; import { fold } from 'fp-ts/lib/Either'; diff --git a/x-pack/plugins/ingest_manager/server/errors/handlers.test.ts b/x-pack/plugins/ingest_manager/server/errors/handlers.test.ts index 272d95c0b3688..4f8eff6c6c75a 100644 --- a/x-pack/plugins/ingest_manager/server/errors/handlers.test.ts +++ b/x-pack/plugins/ingest_manager/server/errors/handlers.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors } from 'elasticsearch'; import { httpServerMock } from 'src/core/server/mocks'; import { createAppContextStartContractMock } from '../mocks'; diff --git a/x-pack/plugins/ingest_manager/server/errors/handlers.ts b/x-pack/plugins/ingest_manager/server/errors/handlers.ts index ec237c4ca833b..08372571240ff 100644 --- a/x-pack/plugins/ingest_manager/server/errors/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/errors/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom, { isBoom } from 'boom'; +import Boom, { isBoom } from '@hapi/boom'; import { RequestHandlerContext, KibanaRequest, diff --git a/x-pack/plugins/ingest_manager/server/routes/package_policy/handlers.ts b/x-pack/plugins/ingest_manager/server/routes/package_policy/handlers.ts index 9e582e6960ade..d9baeca4deb47 100644 --- a/x-pack/plugins/ingest_manager/server/routes/package_policy/handlers.ts +++ b/x-pack/plugins/ingest_manager/server/routes/package_policy/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { TypeOf } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { RequestHandler, SavedObjectsErrorHelpers } from '../../../../../../src/core/server'; import { appContextService, packagePolicyService } from '../../services'; import { getPackageInfo } from '../../services/epm/packages'; diff --git a/x-pack/plugins/ingest_manager/server/services/agent_policy_update.ts b/x-pack/plugins/ingest_manager/server/services/agent_policy_update.ts index 1ad710ba70e29..fe06de765bbff 100644 --- a/x-pack/plugins/ingest_manager/server/services/agent_policy_update.ts +++ b/x-pack/plugins/ingest_manager/server/services/agent_policy_update.ts @@ -23,12 +23,6 @@ const fakeRequest = ({ url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; export async function agentPolicyUpdateEventHandler( diff --git a/x-pack/plugins/ingest_manager/server/services/agents/acks.test.ts b/x-pack/plugins/ingest_manager/server/services/agents/acks.test.ts index 8bcf275fce6ac..4b09fb93e01a1 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/acks.test.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/acks.test.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsBulkResponse } from 'kibana/server'; import { savedObjectsClientMock } from 'src/core/server/mocks'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/acks.ts b/x-pack/plugins/ingest_manager/server/services/agents/acks.ts index a552caa12b95e..814251345788e 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/acks.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/acks.ts @@ -10,7 +10,7 @@ import { SavedObjectsBulkResponse, SavedObjectsClientContract, } from 'src/core/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import LRU from 'lru-cache'; import { Agent, diff --git a/x-pack/plugins/ingest_manager/server/services/agents/authenticate.ts b/x-pack/plugins/ingest_manager/server/services/agents/authenticate.ts index 2515a02da4e78..ce82a27a1a151 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/authenticate.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/authenticate.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaRequest, SavedObjectsClientContract } from 'src/core/server'; import { Agent } from '../../types'; import * as APIKeyService from '../api_keys'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_connected_agents.ts b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_connected_agents.ts index b9ef36ecaae54..994ecc64c82a7 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_connected_agents.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_connected_agents.ts @@ -23,12 +23,6 @@ function getInternalUserSOClient() { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; return appContextService.getInternalUserSOClient(fakeRequest); diff --git a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts index c0e8540004930..aa48d8fe18e9f 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/checkin/state_new_actions.ts @@ -58,12 +58,6 @@ function getInternalUserSOClient() { url: '/', }, }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, } as unknown) as KibanaRequest; return appContextService.getInternalUserSOClient(fakeRequest); diff --git a/x-pack/plugins/ingest_manager/server/services/agents/crud.ts b/x-pack/plugins/ingest_manager/server/services/agents/crud.ts index 90db6c4b17713..bcd409e5f7eab 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/crud.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/crud.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsClientContract } from 'src/core/server'; import { isAgentUpgradeable } from '../../../common'; import { AGENT_SAVED_OBJECT_TYPE, AGENT_EVENT_SAVED_OBJECT_TYPE } from '../../constants'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts b/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts index 3c5850c722e97..89ee0c70ba87c 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/enroll.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import semver from 'semver'; import { SavedObjectsClientContract } from 'src/core/server'; import { AgentType, Agent, AgentSOAttributes } from '../../types'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/reassign.ts b/x-pack/plugins/ingest_manager/server/services/agents/reassign.ts index ab671d5eebc92..b656ab12e96c8 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/reassign.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/reassign.ts @@ -5,7 +5,7 @@ */ import { SavedObjectsClientContract } from 'kibana/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { AGENT_SAVED_OBJECT_TYPE } from '../../constants'; import { AgentSOAttributes } from '../../types'; import { agentPolicyService } from '../agent_policy'; diff --git a/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts b/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts index 3ae664c086da9..76efbd7e4b759 100644 --- a/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts +++ b/x-pack/plugins/ingest_manager/server/services/agents/saved_objects.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObject } from 'src/core/server'; import { Agent, diff --git a/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts b/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts index ea5d25dc9884f..b9d0cf883d35c 100644 --- a/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts +++ b/x-pack/plugins/ingest_manager/server/services/api_keys/enrollment_api_key.ts @@ -5,7 +5,7 @@ */ import uuid from 'uuid'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsClientContract, SavedObject } from 'src/core/server'; import { EnrollmentAPIKey, EnrollmentAPIKeySOAttributes } from '../../types'; import { ENROLLMENT_API_KEYS_SAVED_OBJECT_TYPE } from '../../constants'; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/install.ts b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/install.ts index d32d5b8093c52..6a4d1ca0e1d0a 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/install.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/elasticsearch/template/install.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsClientContract } from 'src/core/server'; import { RegistryDataStream, diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts index 9651eafbf1e1c..fdd6db9396da8 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/install.ts @@ -6,7 +6,7 @@ import { SavedObject, SavedObjectsClientContract } from 'src/core/server'; import semver from 'semver'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { UnwrapPromise } from '@kbn/utility-types'; import { BulkInstallPackageInfo, InstallSource } from '../../../../common'; import { PACKAGES_SAVED_OBJECT_TYPE, MAX_TIME_COMPLETE_INSTALL } from '../../../constants'; diff --git a/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts b/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts index 8d5995f92c95f..4b4fe9540dd95 100644 --- a/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts +++ b/x-pack/plugins/ingest_manager/server/services/epm/packages/remove.ts @@ -5,7 +5,7 @@ */ import { SavedObjectsClientContract } from 'src/core/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { PACKAGE_POLICY_SAVED_OBJECT_TYPE, PACKAGES_SAVED_OBJECT_TYPE } from '../../../constants'; import { AssetReference, diff --git a/x-pack/plugins/ingest_manager/server/services/settings.ts b/x-pack/plugins/ingest_manager/server/services/settings.ts index 44aece1c83a18..1b82be09ee62d 100644 --- a/x-pack/plugins/ingest_manager/server/services/settings.ts +++ b/x-pack/plugins/ingest_manager/server/services/settings.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsClientContract } from 'kibana/server'; import url from 'url'; import { diff --git a/x-pack/plugins/lens/server/routes/existing_fields.ts b/x-pack/plugins/lens/server/routes/existing_fields.ts index d3b2314a199cb..844c7b16e1eaa 100644 --- a/x-pack/plugins/lens/server/routes/existing_fields.ts +++ b/x-pack/plugins/lens/server/routes/existing_fields.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { ILegacyScopedClusterClient, SavedObject, RequestHandlerContext } from 'src/core/server'; import { CoreSetup, Logger } from 'src/core/server'; diff --git a/x-pack/plugins/lens/server/routes/field_stats.ts b/x-pack/plugins/lens/server/routes/field_stats.ts index a7368a12f0e2c..a884aeffa6134 100644 --- a/x-pack/plugins/lens/server/routes/field_stats.ts +++ b/x-pack/plugins/lens/server/routes/field_stats.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import DateMath from '@elastic/datemath'; import { schema } from '@kbn/config-schema'; import { CoreSetup } from 'src/core/server'; diff --git a/x-pack/plugins/lens/server/routes/telemetry.ts b/x-pack/plugins/lens/server/routes/telemetry.ts index 06a7091104871..306c631cd78a7 100644 --- a/x-pack/plugins/lens/server/routes/telemetry.ts +++ b/x-pack/plugins/lens/server/routes/telemetry.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { CoreSetup } from 'src/core/server'; import { schema } from '@kbn/config-schema'; import { BASE_API_URL } from '../../common'; diff --git a/x-pack/plugins/logstash/server/models/pipeline/pipeline.ts b/x-pack/plugins/logstash/server/models/pipeline/pipeline.ts index 0b7c3888b6f03..66aac63811050 100755 --- a/x-pack/plugins/logstash/server/models/pipeline/pipeline.ts +++ b/x-pack/plugins/logstash/server/models/pipeline/pipeline.ts @@ -5,7 +5,7 @@ */ import moment from 'moment'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { get } from 'lodash'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/ml/common/types/data_frame_analytics.ts b/x-pack/plugins/ml/common/types/data_frame_analytics.ts index cbf2acd152476..8874b0f7e111a 100644 --- a/x-pack/plugins/ml/common/types/data_frame_analytics.ts +++ b/x-pack/plugins/ml/common/types/data_frame_analytics.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { EsErrorBody } from '../util/errors'; import { ANALYSIS_CONFIG_TYPE } from '../constants/data_frame_analytics'; diff --git a/x-pack/plugins/ml/common/util/errors/errors.test.ts b/x-pack/plugins/ml/common/util/errors/errors.test.ts index ddaf0b04dd12b..166264ebddee1 100644 --- a/x-pack/plugins/ml/common/util/errors/errors.test.ts +++ b/x-pack/plugins/ml/common/util/errors/errors.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { extractErrorMessage, MLHttpFetchError, MLResponseError, EsErrorBody } from './index'; diff --git a/x-pack/plugins/ml/common/util/errors/types.ts b/x-pack/plugins/ml/common/util/errors/types.ts index fec35141f1b5a..667e6e34a5640 100644 --- a/x-pack/plugins/ml/common/util/errors/types.ts +++ b/x-pack/plugins/ml/common/util/errors/types.ts @@ -5,7 +5,7 @@ */ import { HttpFetchError } from 'kibana/public'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; export interface EsErrorRootCause { type: string; diff --git a/x-pack/plugins/ml/server/client/error_wrapper.ts b/x-pack/plugins/ml/server/client/error_wrapper.ts index c635eb74e1f19..e2e97e3a87696 100644 --- a/x-pack/plugins/ml/server/client/error_wrapper.ts +++ b/x-pack/plugins/ml/server/client/error_wrapper.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify, isBoom } from 'boom'; +import { boomify, isBoom } from '@hapi/boom'; import { ResponseError, CustomHttpResponseOptions } from 'kibana/server'; export function wrapError(error: any): CustomHttpResponseOptions { diff --git a/x-pack/plugins/ml/server/client/errors.js b/x-pack/plugins/ml/server/client/errors.js index 0f8a0f0d8c0a9..a86edb330dec1 100644 --- a/x-pack/plugins/ml/server/client/errors.js +++ b/x-pack/plugins/ml/server/client/errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; export function wrapError(error) { return boomify(error, { statusCode: error.status }); diff --git a/x-pack/plugins/ml/server/models/annotation_service/annotation.ts b/x-pack/plugins/ml/server/models/annotation_service/annotation.ts index d45532e956f42..adcf93a6f11ec 100644 --- a/x-pack/plugins/ml/server/models/annotation_service/annotation.ts +++ b/x-pack/plugins/ml/server/models/annotation_service/annotation.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { each, get } from 'lodash'; import { IScopedClusterClient } from 'kibana/server'; 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 96be6db03c52b..2c08005cecc09 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 @@ -5,7 +5,7 @@ */ import fs from 'fs'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import numeral from '@elastic/numeral'; import { KibanaRequest, IScopedClusterClient, SavedObjectsClientContract } from 'kibana/server'; import moment from 'moment'; diff --git a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts index 68427e98750eb..ed8d3f48e387c 100644 --- a/x-pack/plugins/ml/server/models/fields_service/fields_service.ts +++ b/x-pack/plugins/ml/server/models/fields_service/fields_service.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { duration } from 'moment'; import { parseInterval } from '../../../common/util/parse_interval'; 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 19ba1b76f8a60..de174420d2535 100644 --- a/x-pack/plugins/ml/server/models/filter/filter_manager.ts +++ b/x-pack/plugins/ml/server/models/filter/filter_manager.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { DetectorRule, DetectorRuleScope } from '../../../common/types/detector_rules'; diff --git a/x-pack/plugins/ml/server/models/job_service/jobs.ts b/x-pack/plugins/ml/server/models/job_service/jobs.ts index 822aa4671302e..3209d5748cfd7 100644 --- a/x-pack/plugins/ml/server/models/job_service/jobs.ts +++ b/x-pack/plugins/ml/server/models/job_service/jobs.ts @@ -6,7 +6,7 @@ import { i18n } from '@kbn/i18n'; import { uniq } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { parseTimeIntervalForJob } from '../../../common/util/job_utils'; import { JOB_STATE, DATAFEED_STATE } from '../../../common/constants/states'; diff --git a/x-pack/plugins/ml/server/models/job_service/model_snapshots.ts b/x-pack/plugins/ml/server/models/job_service/model_snapshots.ts index 34206a68ffeb9..5b7f4bd8516ed 100644 --- a/x-pack/plugins/ml/server/models/job_service/model_snapshots.ts +++ b/x-pack/plugins/ml/server/models/job_service/model_snapshots.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { IScopedClusterClient } from 'kibana/server'; import { ModelSnapshot } from '../../../common/types/anomaly_detection_jobs'; diff --git a/x-pack/plugins/ml/server/models/job_validation/job_validation.ts b/x-pack/plugins/ml/server/models/job_validation/job_validation.ts index 9e272f1f770fc..243439115e712 100644 --- a/x-pack/plugins/ml/server/models/job_validation/job_validation.ts +++ b/x-pack/plugins/ml/server/models/job_validation/job_validation.ts @@ -5,7 +5,7 @@ */ import { i18n } from '@kbn/i18n'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; import { fieldsServiceProvider } from '../fields_service'; diff --git a/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts b/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts index 76dc68d2b59e3..eb2c6b461a9df 100644 --- a/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts +++ b/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { PARTITION_FIELDS } from '../../../common/constants/anomalies'; import { PartitionFieldsType } from '../../../common/types/anomalies'; diff --git a/x-pack/plugins/ml/server/models/results_service/results_service.ts b/x-pack/plugins/ml/server/models/results_service/results_service.ts index abb42a5a18689..4a4ab73b5ef3a 100644 --- a/x-pack/plugins/ml/server/models/results_service/results_service.ts +++ b/x-pack/plugins/ml/server/models/results_service/results_service.ts @@ -8,7 +8,7 @@ import { sortBy, slice, get } from 'lodash'; import moment from 'moment'; import { SearchResponse } from 'elasticsearch'; import { IScopedClusterClient } from 'kibana/server'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { buildAnomalyTableItems } from './build_anomaly_table_items'; import { ML_RESULTS_INDEX_PATTERN } from '../../../common/constants/index_patterns'; import { ANOMALIES_TABLE_DEFAULT_QUERY_SIZE } from '../../../common/constants/search'; diff --git a/x-pack/plugins/ml/server/routes/annotations.ts b/x-pack/plugins/ml/server/routes/annotations.ts index 5c4b36164fbb0..05d0624deba59 100644 --- a/x-pack/plugins/ml/server/routes/annotations.ts +++ b/x-pack/plugins/ml/server/routes/annotations.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { SecurityPluginSetup } from '../../../security/server'; diff --git a/x-pack/plugins/ml/server/routes/job_validation.ts b/x-pack/plugins/ml/server/routes/job_validation.ts index b52043595327b..2958b0bc41c24 100644 --- a/x-pack/plugins/ml/server/routes/job_validation.ts +++ b/x-pack/plugins/ml/server/routes/job_validation.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { IScopedClusterClient } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; import { AnalysisConfig } from '../../common/types/anomaly_detection_jobs'; diff --git a/x-pack/plugins/ml/server/routes/system.ts b/x-pack/plugins/ml/server/routes/system.ts index 3a66f60943bb3..a4c61f4eb4576 100644 --- a/x-pack/plugins/ml/server/routes/system.ts +++ b/x-pack/plugins/ml/server/routes/system.ts @@ -6,7 +6,7 @@ import { schema } from '@kbn/config-schema'; -import { Request } from 'hapi'; +import { Request } from '@hapi/hapi'; import { IScopedClusterClient } from 'kibana/server'; import { wrapError } from '../client/error_wrapper'; import { mlLog } from '../client/log'; diff --git a/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js b/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js index 8902460507eb0..22700bf3fb5a8 100644 --- a/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js +++ b/x-pack/plugins/monitoring/public/components/no_data/__tests__/checker_errors.test.js @@ -5,7 +5,7 @@ */ import React from 'react'; -import { boomify, forbidden } from 'boom'; +import { boomify, forbidden } from '@hapi/boom'; import { renderWithIntl } from 'test_utils/enzyme_helpers'; import { CheckerErrors } from '../checker_errors'; diff --git a/x-pack/plugins/monitoring/public/lib/elasticsearch_settings/__tests__/enabler.test.js b/x-pack/plugins/monitoring/public/lib/elasticsearch_settings/__tests__/enabler.test.js index 06db546581700..70fc8e405f904 100644 --- a/x-pack/plugins/monitoring/public/lib/elasticsearch_settings/__tests__/enabler.test.js +++ b/x-pack/plugins/monitoring/public/lib/elasticsearch_settings/__tests__/enabler.test.js @@ -6,7 +6,7 @@ import { Enabler } from '../'; import sinon from 'sinon'; -import { forbidden } from 'boom'; +import { forbidden } from '@hapi/boom'; const updateModel = (properties) => properties; const updateModelSpy = sinon.spy(updateModel); diff --git a/x-pack/plugins/monitoring/server/lib/cluster/get_cluster_stats.js b/x-pack/plugins/monitoring/server/lib/cluster/get_cluster_stats.js index fa0dff9c09431..ea4eb36964b5c 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/get_cluster_stats.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/get_cluster_stats.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest, notFound } from 'boom'; +import { badRequest, notFound } from '@hapi/boom'; import { getClustersStats } from './get_clusters_stats'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js index e91679eff2817..ddc33a4b93730 100644 --- a/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js +++ b/x-pack/plugins/monitoring/server/lib/cluster/get_clusters_from_request.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { notFound } from 'boom'; +import { notFound } from '@hapi/boom'; import { set } from '@elastic/safer-lodash-set'; import { findIndex } from 'lodash'; import { getClustersStats } from './get_clusters_stats'; diff --git a/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_monitoring_auth.js b/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_monitoring_auth.js index 6d2a853ee24d2..8d774b752b5c0 100644 --- a/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_monitoring_auth.js +++ b/x-pack/plugins/monitoring/server/lib/elasticsearch/verify_monitoring_auth.js @@ -5,7 +5,7 @@ */ import { get } from 'lodash'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { INDEX_PATTERN } from '../../../common/constants'; /* diff --git a/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js b/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js index df10624999afd..677b395caedd4 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js +++ b/x-pack/plugins/monitoring/server/lib/errors/__tests__/auth_errors.js @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { errors } from 'elasticsearch'; -import { forbidden, unauthorized } from 'boom'; +import { forbidden, unauthorized } from '@hapi/boom'; import { isAuthError, handleAuthError } from '../auth_errors'; describe('Error handling for 401/403 errors', () => { diff --git a/x-pack/plugins/monitoring/server/lib/errors/auth_errors.js b/x-pack/plugins/monitoring/server/lib/errors/auth_errors.js index b0c4d35a5b095..96535ac6d5311 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/auth_errors.js +++ b/x-pack/plugins/monitoring/server/lib/errors/auth_errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { forbidden } from 'boom'; +import { forbidden } from '@hapi/boom'; import { i18n } from '@kbn/i18n'; const getStatusCode = (err) => { diff --git a/x-pack/plugins/monitoring/server/lib/errors/handle_error.js b/x-pack/plugins/monitoring/server/lib/errors/handle_error.js index 4726020210ce7..6e7dca15a392c 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/handle_error.js +++ b/x-pack/plugins/monitoring/server/lib/errors/handle_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; import { isKnownError, handleKnownError } from './known_errors'; import { isAuthError, handleAuthError } from './auth_errors'; diff --git a/x-pack/plugins/monitoring/server/lib/errors/handle_settings_error.js b/x-pack/plugins/monitoring/server/lib/errors/handle_settings_error.js index 54c0c39d0b396..dfe5f1c4a614f 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/handle_settings_error.js +++ b/x-pack/plugins/monitoring/server/lib/errors/handle_settings_error.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; export function handleSettingsError(err) { return boomify(err, { statusCode: err.statusCode }); diff --git a/x-pack/plugins/monitoring/server/lib/errors/known_errors.js b/x-pack/plugins/monitoring/server/lib/errors/known_errors.js index 17bcdd0414adf..fb62dc7261057 100644 --- a/x-pack/plugins/monitoring/server/lib/errors/known_errors.js +++ b/x-pack/plugins/monitoring/server/lib/errors/known_errors.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify } from 'boom'; +import { boomify } from '@hapi/boom'; import { i18n } from '@kbn/i18n'; import { MonitoringLicenseError } from './custom_errors'; diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js index a2665aeb041f8..2977159f4206d 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import boom from 'boom'; +import boom from '@hapi/boom'; import { get } from 'lodash'; import { checkParam } from '../error_missing_required'; import { getPipelineStateDocument } from './get_pipeline_state_document'; diff --git a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js index 295d86c52b801..cdbe26d993f75 100644 --- a/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js +++ b/x-pack/plugins/monitoring/server/lib/logstash/get_pipeline_vertex.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import boom from 'boom'; +import boom from '@hapi/boom'; import { get } from 'lodash'; import { checkParam } from '../error_missing_required'; import { getPipelineStateDocument } from './get_pipeline_state_document'; diff --git a/x-pack/plugins/monitoring/server/plugin.ts b/x-pack/plugins/monitoring/server/plugin.ts index 6093eacffe9b7..56368a5ece10a 100644 --- a/x-pack/plugins/monitoring/server/plugin.ts +++ b/x-pack/plugins/monitoring/server/plugin.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { combineLatest } from 'rxjs'; import { first, map } from 'rxjs/operators'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/observability/server/lib/annotations/create_annotations_client.ts b/x-pack/plugins/observability/server/lib/annotations/create_annotations_client.ts index 1fb5211a71bcd..41f45683d244c 100644 --- a/x-pack/plugins/observability/server/lib/annotations/create_annotations_client.ts +++ b/x-pack/plugins/observability/server/lib/annotations/create_annotations_client.ts @@ -7,7 +7,7 @@ import { LegacyAPICaller, Logger } from 'kibana/server'; import * as t from 'io-ts'; import { Client } from 'elasticsearch'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ILicense } from '../../../../licensing/server'; import { createAnnotationRt, diff --git a/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts b/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts index 910f9e69ea80c..e30cd80bec227 100644 --- a/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts +++ b/x-pack/plugins/remote_clusters/server/routes/api/get_route.test.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { kibanaResponseFactory } from '../../../../../../src/core/server'; import { register } from './get_route'; diff --git a/x-pack/plugins/reporting/server/core.ts b/x-pack/plugins/reporting/server/core.ts index d62adc62bc9aa..2c1ac95d6e824 100644 --- a/x-pack/plugins/reporting/server/core.ts +++ b/x-pack/plugins/reporting/server/core.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Hapi from 'hapi'; +import Hapi from '@hapi/hapi'; import * as Rx from 'rxjs'; import { first, map, take } from 'rxjs/operators'; import { @@ -210,18 +210,11 @@ export class ReportingCore { } public getFakeRequest(baseRequest: object, spaceId: string | undefined, logger = this.logger) { - // @ts-expect-error _core isn't supposed to be accessed - remove once we upgrade to hapi v18 const fakeRequest = KibanaRequest.from({ path: '/', route: { settings: {} }, url: { href: '/' }, raw: { req: { url: '/' } }, - // TODO: Remove once we upgrade to hapi v18 - _core: { - info: { - uri: 'http://localhost', - }, - }, ...baseRequest, } as Hapi.Request); diff --git a/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/create_job.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/create_job.ts index c780247dd61b3..96653b1573662 100644 --- a/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/create_job.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/create_job.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { notFound, notImplemented } from 'boom'; +import { notFound, notImplemented } from '@hapi/boom'; import { get } from 'lodash'; import { RequestHandlerContext } from 'src/core/server'; import { CSV_FROM_SAVEDOBJECT_JOB_TYPE } from '../../../common/constants'; diff --git a/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/lib/get_filters.ts b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/lib/get_filters.ts index 8827a30d370d4..3680fdc54ebe9 100644 --- a/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/lib/get_filters.ts +++ b/x-pack/plugins/reporting/server/export_types/csv_from_savedobject/lib/get_filters.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import moment from 'moment-timezone'; import { TimeRangeParams } from '../../common'; import { Filter, QueryFilter, SavedSearchObjectAttributes, SearchSourceFilter } from '../types'; diff --git a/x-pack/plugins/reporting/server/routes/generation.ts b/x-pack/plugins/reporting/server/routes/generation.ts index b2115076aada4..ba69b97bee7f1 100644 --- a/x-pack/plugins/reporting/server/routes/generation.ts +++ b/x-pack/plugins/reporting/server/routes/generation.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors as elasticsearchErrors } from 'elasticsearch'; import { kibanaResponseFactory } from 'src/core/server'; import { ReportingCore } from '../'; diff --git a/x-pack/plugins/reporting/server/routes/jobs.ts b/x-pack/plugins/reporting/server/routes/jobs.ts index 43e73c137fb13..3f067fdec9b0b 100644 --- a/x-pack/plugins/reporting/server/routes/jobs.ts +++ b/x-pack/plugins/reporting/server/routes/jobs.ts @@ -5,7 +5,7 @@ */ import { schema } from '@kbn/config-schema'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { ReportingCore } from '../'; import { API_BASE_URL } from '../../common/constants'; import { authorizedUserPreRoutingFactory } from './lib/authorized_user_pre_routing'; diff --git a/x-pack/plugins/security/server/authentication/authentication_result.test.ts b/x-pack/plugins/security/server/authentication/authentication_result.test.ts index fd875a7e029d2..8460df6f5de95 100644 --- a/x-pack/plugins/security/server/authentication/authentication_result.test.ts +++ b/x-pack/plugins/security/server/authentication/authentication_result.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { mockAuthenticatedUser } from '../../common/model/authenticated_user.mock'; import { AuthenticationResult } from './authentication_result'; diff --git a/x-pack/plugins/security/server/authentication/authenticator.test.ts b/x-pack/plugins/security/server/authentication/authenticator.test.ts index 51c937f1edcb5..16cb51cbfccf5 100644 --- a/x-pack/plugins/security/server/authentication/authenticator.test.ts +++ b/x-pack/plugins/security/server/authentication/authenticator.test.ts @@ -9,7 +9,7 @@ jest.mock('./providers/token'); jest.mock('./providers/saml'); jest.mock('./providers/http'); -import Boom from 'boom'; +import Boom from '@hapi/boom'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { loggingSystemMock, diff --git a/x-pack/plugins/security/server/authentication/index.test.ts b/x-pack/plugins/security/server/authentication/index.test.ts index b5ce5283df8ce..3d2d26550215c 100644 --- a/x-pack/plugins/security/server/authentication/index.test.ts +++ b/x-pack/plugins/security/server/authentication/index.test.ts @@ -7,7 +7,7 @@ jest.mock('./api_keys'); jest.mock('./authenticator'); -import Boom from 'boom'; +import Boom from '@hapi/boom'; import type { PublicMethodsOf } from '@kbn/utility-types'; import { diff --git a/x-pack/plugins/security/server/authentication/providers/kerberos.test.ts b/x-pack/plugins/security/server/authentication/providers/kerberos.test.ts index 839b5c991f09b..ee89af10cbeba 100644 --- a/x-pack/plugins/security/server/authentication/providers/kerberos.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/kerberos.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors } from 'elasticsearch'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; diff --git a/x-pack/plugins/security/server/authentication/providers/kerberos.ts b/x-pack/plugins/security/server/authentication/providers/kerberos.ts index d7de71f4da9ed..34ed9ac920e93 100644 --- a/x-pack/plugins/security/server/authentication/providers/kerberos.ts +++ b/x-pack/plugins/security/server/authentication/providers/kerberos.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { LegacyElasticsearchError, LegacyElasticsearchErrorHelpers, diff --git a/x-pack/plugins/security/server/authentication/providers/oidc.test.ts b/x-pack/plugins/security/server/authentication/providers/oidc.test.ts index 81e9ecb8a377b..fe46b159833bc 100644 --- a/x-pack/plugins/security/server/authentication/providers/oidc.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/oidc.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; import { mockAuthenticatedUser } from '../../../common/model/authenticated_user.mock'; diff --git a/x-pack/plugins/security/server/authentication/providers/oidc.ts b/x-pack/plugins/security/server/authentication/providers/oidc.ts index 9570c59f8ea1d..eede9f334a5a1 100644 --- a/x-pack/plugins/security/server/authentication/providers/oidc.ts +++ b/x-pack/plugins/security/server/authentication/providers/oidc.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import type from 'type-detect'; import { KibanaRequest } from '../../../../../../src/core/server'; import { AuthenticatedUser } from '../../../common/model'; diff --git a/x-pack/plugins/security/server/authentication/providers/pki.test.ts b/x-pack/plugins/security/server/authentication/providers/pki.test.ts index 053d20e37b39e..7e76f4c81998d 100644 --- a/x-pack/plugins/security/server/authentication/providers/pki.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/pki.test.ts @@ -9,7 +9,7 @@ jest.mock('tls'); import { Socket } from 'net'; import { PeerCertificate, TLSSocket } from 'tls'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors } from 'elasticsearch'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; diff --git a/x-pack/plugins/security/server/authentication/providers/pki.ts b/x-pack/plugins/security/server/authentication/providers/pki.ts index 6dcb448e08150..9214a025484fe 100644 --- a/x-pack/plugins/security/server/authentication/providers/pki.ts +++ b/x-pack/plugins/security/server/authentication/providers/pki.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { DetailedPeerCertificate } from 'tls'; import { KibanaRequest } from '../../../../../../src/core/server'; import { AuthenticationResult } from '../authentication_result'; diff --git a/x-pack/plugins/security/server/authentication/providers/saml.test.ts b/x-pack/plugins/security/server/authentication/providers/saml.test.ts index 75eb7ae93f360..d160b79bf659d 100644 --- a/x-pack/plugins/security/server/authentication/providers/saml.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/saml.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; import { mockAuthenticatedUser } from '../../../common/model/authenticated_user.mock'; diff --git a/x-pack/plugins/security/server/authentication/providers/saml.ts b/x-pack/plugins/security/server/authentication/providers/saml.ts index 59a1782c1f1fd..54619c851470a 100644 --- a/x-pack/plugins/security/server/authentication/providers/saml.ts +++ b/x-pack/plugins/security/server/authentication/providers/saml.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaRequest } from '../../../../../../src/core/server'; import { AuthenticatedUser } from '../../../common/model'; import { isInternalURL } from '../../../common/is_internal_url'; diff --git a/x-pack/plugins/security/server/authentication/providers/token.test.ts b/x-pack/plugins/security/server/authentication/providers/token.test.ts index ffb1c89b24e47..8cd11bce98269 100644 --- a/x-pack/plugins/security/server/authentication/providers/token.test.ts +++ b/x-pack/plugins/security/server/authentication/providers/token.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors } from 'elasticsearch'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; diff --git a/x-pack/plugins/security/server/authentication/providers/token.ts b/x-pack/plugins/security/server/authentication/providers/token.ts index 7dace488bc95a..f919c20c15225 100644 --- a/x-pack/plugins/security/server/authentication/providers/token.ts +++ b/x-pack/plugins/security/server/authentication/providers/token.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { KibanaRequest } from '../../../../../../src/core/server'; import { AuthenticationResult } from '../authentication_result'; import { DeauthenticationResult } from '../deauthentication_result'; diff --git a/x-pack/plugins/security/server/errors.test.ts b/x-pack/plugins/security/server/errors.test.ts index 7c4668b245b0e..630ab5b9295db 100644 --- a/x-pack/plugins/security/server/errors.test.ts +++ b/x-pack/plugins/security/server/errors.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { errors as esErrors } from 'elasticsearch'; import * as errors from './errors'; diff --git a/x-pack/plugins/security/server/errors.ts b/x-pack/plugins/security/server/errors.ts index b5f3667558f55..9c177c3916faf 100644 --- a/x-pack/plugins/security/server/errors.ts +++ b/x-pack/plugins/security/server/errors.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { CustomHttpResponseOptions, ResponseError } from '../../../../src/core/server'; export function wrapError(error: any) { diff --git a/x-pack/plugins/security/server/routes/api_keys/enabled.test.ts b/x-pack/plugins/security/server/routes/api_keys/enabled.test.ts index 3c6dc3c0d7bda..7968402cd2176 100644 --- a/x-pack/plugins/security/server/routes/api_keys/enabled.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/enabled.test.ts @@ -9,7 +9,7 @@ import { LicenseCheck } from '../../../../licensing/server'; import { httpServerMock } from '../../../../../../src/core/server/mocks'; import { routeDefinitionParamsMock } from '../index.mock'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { defineEnabledApiKeysRoutes } from './enabled'; import { APIKeys } from '../../authentication/api_keys'; diff --git a/x-pack/plugins/security/server/routes/api_keys/get.test.ts b/x-pack/plugins/security/server/routes/api_keys/get.test.ts index 40065e757e999..cb991fb2f5aac 100644 --- a/x-pack/plugins/security/server/routes/api_keys/get.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/get.test.ts @@ -10,7 +10,7 @@ import { defineGetApiKeysRoutes } from './get'; import { elasticsearchServiceMock, httpServerMock } from '../../../../../../src/core/server/mocks'; import { routeDefinitionParamsMock } from '../index.mock'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; interface TestOptions { isAdmin?: boolean; diff --git a/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts b/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts index 33c52688ce8e3..88e52f735395d 100644 --- a/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/invalidate.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { Type } from '@kbn/config-schema'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; import { LicenseCheck } from '../../../../licensing/server'; diff --git a/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts b/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts index a506cc6306c53..ecc3d32e20aec 100644 --- a/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts +++ b/x-pack/plugins/security/server/routes/api_keys/privileges.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { LicenseCheck } from '../../../../licensing/server'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../src/core/server'; diff --git a/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts index 399f79f44744d..9f5ec635f56cd 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/delete.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; import { LicenseCheck } from '../../../../../licensing/server'; import { defineDeleteRolesRoutes } from './delete'; diff --git a/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts index d9062bcfa2efe..b25b13b9fc04a 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/get.test.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; import { LicenseCheck } from '../../../../../licensing/server'; import { defineGetRolesRoutes } from './get'; diff --git a/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts b/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts index 66e8086d49c66..30e0c52c4c443 100644 --- a/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts +++ b/x-pack/plugins/security/server/routes/authorization/roles/get_all.test.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { kibanaResponseFactory, RequestHandlerContext } from '../../../../../../../src/core/server'; import { LicenseCheck } from '../../../../../licensing/server'; import { defineGetAllRolesRoutes } from './get_all'; diff --git a/x-pack/plugins/security/server/routes/role_mapping/get.test.ts b/x-pack/plugins/security/server/routes/role_mapping/get.test.ts index 9af7268a57f9c..2519034b386bf 100644 --- a/x-pack/plugins/security/server/routes/role_mapping/get.test.ts +++ b/x-pack/plugins/security/server/routes/role_mapping/get.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { routeDefinitionParamsMock } from '../index.mock'; import { elasticsearchServiceMock, httpServerMock } from 'src/core/server/mocks'; import { defineRoleMappingGetRoutes } from './get'; diff --git a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts index c8e0292e8d93a..194f0a1c2e7c5 100644 --- a/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts +++ b/x-pack/plugins/security_solution/server/endpoint/routes/metadata/handlers.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { RequestHandlerContext, Logger, RequestHandler } from 'kibana/server'; import { TypeOf } from '@kbn/config-schema'; import { diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts index 977dad680f8a4..25e47b38e8a56 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsFindResponse } from 'kibana/server'; diff --git a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts index 72be7a3c0fa08..6a304a207d000 100644 --- a/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts +++ b/x-pack/plugins/security_solution/server/lib/detection_engine/routes/utils.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import Joi from 'joi'; import { has, snakeCase } from 'lodash/fp'; import { SanitizedAlert } from '../../../../../alerts/common'; diff --git a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx index e214db22aa9cc..f484b738bd222 100644 --- a/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx +++ b/x-pack/plugins/spaces/public/copy_saved_objects_to_space/components/copy_to_space_flyout.test.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import React from 'react'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { mountWithIntl, nextTick } from 'test_utils/enzyme_helpers'; import { CopySavedObjectsToSpaceFlyout } from './copy_to_space_flyout'; import { CopyToSpaceForm } from './copy_to_space_form'; diff --git a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.test.tsx b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.test.tsx index ad49161ddd705..0c9f4847a4952 100644 --- a/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.test.tsx +++ b/x-pack/plugins/spaces/public/share_saved_objects_to_space/components/share_to_space_flyout.test.tsx @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import React from 'react'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { mountWithIntl, nextTick } from 'test_utils/enzyme_helpers'; import { ShareSavedObjectsToSpaceFlyout } from './share_to_space_flyout'; import { ShareToSpaceForm } from './share_to_space_form'; diff --git a/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts b/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts index 4913a0ae988e9..764ae5a87ec0e 100644 --- a/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts +++ b/x-pack/plugins/spaces/server/lib/copy_to_spaces/lib/create_empty_failure_response.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom, { Payload } from 'boom'; +import Boom, { Payload } from '@hapi/boom'; import { SavedObjectsImportError } from 'src/core/server'; export const createEmptyFailureResponse = (errors?: Array) => { diff --git a/x-pack/plugins/spaces/server/lib/copy_to_spaces/types.ts b/x-pack/plugins/spaces/server/lib/copy_to_spaces/types.ts index 8d4169f972795..d774231d3eb48 100644 --- a/x-pack/plugins/spaces/server/lib/copy_to_spaces/types.ts +++ b/x-pack/plugins/spaces/server/lib/copy_to_spaces/types.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Payload } from 'boom'; +import { Payload } from '@hapi/boom'; import { SavedObjectsImportSuccess, SavedObjectsImportError, diff --git a/x-pack/plugins/spaces/server/lib/errors.ts b/x-pack/plugins/spaces/server/lib/errors.ts index d800020038a38..13a5c2440877a 100644 --- a/x-pack/plugins/spaces/server/lib/errors.ts +++ b/x-pack/plugins/spaces/server/lib/errors.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { boomify, isBoom } from 'boom'; +import { boomify, isBoom } from '@hapi/boom'; import { ResponseError, CustomHttpResponseOptions } from 'src/core/server'; export function wrapError(error: any): CustomHttpResponseOptions { diff --git a/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts b/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts index fe1acd93570f6..89371259ae04c 100644 --- a/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts +++ b/x-pack/plugins/spaces/server/lib/request_interceptors/on_post_auth_interceptor.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import * as Rx from 'rxjs'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { Legacy } from 'kibana'; // @ts-ignore import { kibanaTestUser } from '@kbn/test'; diff --git a/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts b/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts index 50e7182b76686..a054ff773be4d 100644 --- a/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts +++ b/x-pack/plugins/spaces/server/lib/spaces_client/spaces_client.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { omit } from 'lodash'; import { KibanaRequest } from 'src/core/server'; import { SecurityPluginSetup } from '../../../../security/server'; diff --git a/x-pack/plugins/spaces/server/routes/api/external/delete.ts b/x-pack/plugins/spaces/server/routes/api/external/delete.ts index 150f1d198cdf6..81e643bf5ede8 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/delete.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/delete.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { schema } from '@kbn/config-schema'; import { SavedObjectsErrorHelpers } from '../../../../../../../src/core/server'; import { wrapError } from '../../../lib/errors'; diff --git a/x-pack/plugins/spaces/server/routes/api/external/post.ts b/x-pack/plugins/spaces/server/routes/api/external/post.ts index 61f90adb300ab..0c77bcc74bb50 100644 --- a/x-pack/plugins/spaces/server/routes/api/external/post.ts +++ b/x-pack/plugins/spaces/server/routes/api/external/post.ts @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsErrorHelpers } from '../../../../../../../src/core/server'; import { wrapError } from '../../../lib/errors'; import { spaceSchema } from '../../../lib/space_schema'; diff --git a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts index f7621f11a1c05..254cf3817ca48 100644 --- a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts +++ b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.test.ts @@ -11,7 +11,7 @@ import { savedObjectsClientMock } from '../../../../../src/core/server/mocks'; import { SavedObjectTypeRegistry } from 'src/core/server'; import { SpacesClient } from '../lib/spaces_client'; import { spacesClientMock } from '../lib/spaces_client/spaces_client.mock'; -import Boom from 'boom'; +import Boom from '@hapi/boom'; const typeRegistry = new SavedObjectTypeRegistry(); typeRegistry.registerType({ diff --git a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.ts b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.ts index 4c8e93acd68ac..e96ae49b41679 100644 --- a/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.ts +++ b/x-pack/plugins/spaces/server/saved_objects/spaces_saved_objects_client.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { SavedObjectsBaseOptions, SavedObjectsBulkCreateObject, diff --git a/x-pack/plugins/transform/server/routes/api/error_utils.ts b/x-pack/plugins/transform/server/routes/api/error_utils.ts index ef5927651df88..cf388f3c8ca08 100644 --- a/x-pack/plugins/transform/server/routes/api/error_utils.ts +++ b/x-pack/plugins/transform/server/routes/api/error_utils.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import Boom from 'boom'; +import Boom from '@hapi/boom'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts index 1100fbf5a828d..59d7ee6762c70 100644 --- a/x-pack/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { Request, Server } from 'hapi'; +import { Request, Server } from '@hapi/hapi'; import { DEFAULT_APP_CATEGORIES } from '../../../../src/core/server'; import { PLUGIN } from '../common/constants/plugin'; import { compose } from './lib/compose/kibana'; diff --git a/x-pack/plugins/watcher/server/models/action_status/action_status.js b/x-pack/plugins/watcher/server/models/action_status/action_status.js index 2348ab37b3d2b..b747e5b86cfa6 100644 --- a/x-pack/plugins/watcher/server/models/action_status/action_status.js +++ b/x-pack/plugins/watcher/server/models/action_status/action_status.js @@ -5,7 +5,7 @@ */ import { get } from 'lodash'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { getMoment } from '../../../common/lib/get_moment'; import { ACTION_STATES } from '../../../common/constants'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/watcher/server/models/fields/fields.js b/x-pack/plugins/watcher/server/models/fields/fields.js index cd28b49166383..e0ec9bc6e620d 100644 --- a/x-pack/plugins/watcher/server/models/fields/fields.js +++ b/x-pack/plugins/watcher/server/models/fields/fields.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { forEach, keys, sortBy } from 'lodash'; import { normalizedFieldTypes } from '../../lib/normalized_field_types'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/watcher/server/models/watch/base_watch.js b/x-pack/plugins/watcher/server/models/watch/base_watch.js index 7dbc8458eb062..204d470ce2330 100644 --- a/x-pack/plugins/watcher/server/models/watch/base_watch.js +++ b/x-pack/plugins/watcher/server/models/watch/base_watch.js @@ -5,7 +5,7 @@ */ import { get, map, pick } from 'lodash'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { Action } from '../../../common/models/action'; import { WatchStatus } from '../watch_status'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/watcher/server/models/watch/monitoring_watch.js b/x-pack/plugins/watcher/server/models/watch/monitoring_watch.js index 8f32621bfbb86..769f86e925559 100644 --- a/x-pack/plugins/watcher/server/models/watch/monitoring_watch.js +++ b/x-pack/plugins/watcher/server/models/watch/monitoring_watch.js @@ -5,7 +5,7 @@ */ import { merge } from 'lodash'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { BaseWatch } from './base_watch'; import { WATCH_TYPES } from '../../../common/constants'; import { i18n } from '@kbn/i18n'; diff --git a/x-pack/plugins/watcher/server/models/watch/watch.js b/x-pack/plugins/watcher/server/models/watch/watch.js index 4e7ecf7feae09..ee30efa66faa9 100644 --- a/x-pack/plugins/watcher/server/models/watch/watch.js +++ b/x-pack/plugins/watcher/server/models/watch/watch.js @@ -5,7 +5,7 @@ */ import { set } from '@elastic/safer-lodash-set'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { WATCH_TYPES } from '../../../common/constants'; import { JsonWatch } from './json_watch'; import { MonitoringWatch } from './monitoring_watch'; diff --git a/x-pack/plugins/watcher/server/models/watch_history_item/watch_history_item.js b/x-pack/plugins/watcher/server/models/watch_history_item/watch_history_item.js index 134b201628195..5b19c9afcd1b2 100644 --- a/x-pack/plugins/watcher/server/models/watch_history_item/watch_history_item.js +++ b/x-pack/plugins/watcher/server/models/watch_history_item/watch_history_item.js @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { getMoment } from '../../../common/lib/get_moment'; import { get, cloneDeep } from 'lodash'; import { WatchStatus } from '../watch_status'; diff --git a/x-pack/plugins/watcher/server/models/watch_status/watch_status.js b/x-pack/plugins/watcher/server/models/watch_status/watch_status.js index 30d6e72a9645d..e5dd7d8ef186c 100644 --- a/x-pack/plugins/watcher/server/models/watch_status/watch_status.js +++ b/x-pack/plugins/watcher/server/models/watch_status/watch_status.js @@ -5,7 +5,7 @@ */ import { get, map, forEach, max } from 'lodash'; -import { badRequest } from 'boom'; +import { badRequest } from '@hapi/boom'; import { getMoment } from '../../../common/lib/get_moment'; import { ActionStatus } from '../action_status'; import { ACTION_STATES, WATCH_STATES, WATCH_STATE_COMMENTS } from '../../../common/constants'; diff --git a/yarn.lock b/yarn.lock index 9b2c18e238547..071615965c4ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1505,18 +1505,113 @@ normalize-path "^2.0.1" through2 "^2.0.3" -"@hapi/boom@7.x.x": +"@hapi/accept@^3.2.4": + version "3.2.4" + resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-3.2.4.tgz#687510529493fe1d7d47954c31aff360d9364bd1" + integrity sha512-soThGB+QMgfxlh0Vzhzlf3ZOEOPk5biEwcOXhkF0Eedqx8VnhGiggL9UYHrIsOb1rUg3Be3K8kp0iDL2wbVSOQ== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/address@2.x.x", "@hapi/address@^2.1.2": + version "2.1.4" + resolved "https://registry.yarnpkg.com/@hapi/address/-/address-2.1.4.tgz#5d67ed43f3fd41a69d4b9ff7b56e7c0d1d0a81e5" + integrity sha512-QD1PhQk+s31P1ixsX0H0Suoupp3VMXzIVMSwobR3F3MSUO2YCV0B7xqLcUw/Bh8yuvd3LhpyqLQWTNcRmp6IdQ== + +"@hapi/ammo@3.x.x", "@hapi/ammo@^3.1.2": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@hapi/ammo/-/ammo-3.1.2.tgz#a9edf5d48d99b75fdcd7ab3dabf9059942a06961" + integrity sha512-ej9OtFmiZv1qr45g1bxEZNGyaR4jRpyMxU6VhbxjaYThymvOwsyIsUKMZnP5Qw2tfYFuwqCJuIBHGpeIbdX9gQ== + dependencies: + "@hapi/hoek" "8.x.x" + +"@hapi/b64@4.x.x": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@hapi/b64/-/b64-4.2.1.tgz#bf8418d7907c5e73463f2e3b5c6fca7e9f2a1357" + integrity sha512-zqHpQuH5CBMw6hADzKfU/IGNrxq1Q+/wTYV+OiZRQN9F3tMyk+9BUMeBvFRMamduuqL8iSp62QAnJ+7ATiYLWA== + dependencies: + "@hapi/hoek" "8.x.x" + +"@hapi/boom@7.x.x", "@hapi/boom@^7.4.11": version "7.4.11" resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-7.4.11.tgz#37af8417eb9416aef3367aa60fa04a1a9f1fc262" integrity sha512-VSU/Cnj1DXouukYxxkes4nNJonCnlogHvIff1v1RVoN4xzkKhMXX+GRmb3NyH1iar10I9WFPDv2JPwfH3GaV0A== dependencies: "@hapi/hoek" "8.x.x" +"@hapi/bounce@1.x.x": + version "1.3.2" + resolved "https://registry.yarnpkg.com/@hapi/bounce/-/bounce-1.3.2.tgz#3b096bb02f67de6115e6e4f0debc390be5a86bad" + integrity sha512-3bnb1AlcEByFZnpDIidxQyw1Gds81z/1rSqlx4bIEE+wUN0ATj0D49B5cE1wGocy90Rp/de4tv7GjsKd5RQeew== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "^8.3.1" + "@hapi/bourne@1.x.x": version "1.3.2" resolved "https://registry.yarnpkg.com/@hapi/bourne/-/bourne-1.3.2.tgz#0a7095adea067243ce3283e1b56b8a8f453b242a" integrity sha512-1dVNHT76Uu5N3eJNTYcvxee+jzX4Z9lfciqRRHCU27ihbUcYi+iSc2iml5Ke1LXe1SyJCLA0+14Jh4tXJgOppA== +"@hapi/call@^5.1.3": + version "5.1.3" + resolved "https://registry.yarnpkg.com/@hapi/call/-/call-5.1.3.tgz#217af45e3bc3d38b03aa5c9edfe1be939eee3741" + integrity sha512-5DfWpMk7qZiYhvBhM5oUiT4GQ/O8a2rFR121/PdwA/eZ2C1EsuD547ZggMKAR5bZ+FtxOf0fdM20zzcXzq2mZA== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/catbox-memory@4.x.x": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@hapi/catbox-memory/-/catbox-memory-4.1.1.tgz#263a6f3361f7a200552c5772c98a8e80a1da712f" + integrity sha512-T6Hdy8DExzG0jY7C8yYWZB4XHfc0v+p1EGkwxl2HoaPYAmW7I3E59M/IvmSVpis8RPcIoBp41ZpO2aZPBpM2Ww== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/catbox@10.x.x": + version "10.2.3" + resolved "https://registry.yarnpkg.com/@hapi/catbox/-/catbox-10.2.3.tgz#2df51ab943d7613df3718fa2bfd981dd9558cec5" + integrity sha512-kN9hXO4NYyOHW09CXiuj5qW1syc/0XeVOBsNNk0Tz89wWNQE5h21WF+VsfAw3uFR8swn/Wj3YEVBnWqo82m/JQ== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + "@hapi/podium" "3.x.x" + +"@hapi/content@^4.1.1": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@hapi/content/-/content-4.1.1.tgz#179673d1e2b7eb36c564d8f9605d019bd2252cbf" + integrity sha512-3TWvmwpVPxFSF3KBjKZ8yDqIKKZZIm7VurDSweYpXYENZrJH3C1hd1+qEQW9wQaUaI76pPBLGrXl6I3B7i3ipA== + dependencies: + "@hapi/boom" "7.x.x" + +"@hapi/cookie@^10.1.2": + version "10.1.2" + resolved "https://registry.yarnpkg.com/@hapi/cookie/-/cookie-10.1.2.tgz#9ea7d80f05d764faaf892b84e80c1bf13f5e3bf5" + integrity sha512-wch/uT5NgDEujmaLIqUoohbEP6PUr4ML2Z6zqheWHeHrSzXangPH4dveW+fiMsoPMW2S9ecAyUjCfkh4qRfxjg== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/cryptiles@4.x.x": + version "4.2.1" + resolved "https://registry.yarnpkg.com/@hapi/cryptiles/-/cryptiles-4.2.1.tgz#ff0f18d79074659838caedbb911851313ad1ffbc" + integrity sha512-XoqgKsHK0l/VpqPs+tr6j6vE+VQ3+2bkF2stvttmc7xAOf1oSAwHcJ0tlp/6MxMysktt1IEY0Csy3khKaP9/uQ== + dependencies: + "@hapi/boom" "7.x.x" + +"@hapi/file@1.x.x": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@hapi/file/-/file-1.0.0.tgz#c91c39fd04db8bed5af82d2e032e7a4e65555b38" + integrity sha512-Bsfp/+1Gyf70eGtnIgmScvrH8sSypO3TcK3Zf0QdHnzn/ACnAkI6KLtGACmNRPEzzIy+W7aJX5E+1fc9GwIABQ== + +"@hapi/formula@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@hapi/formula/-/formula-1.2.0.tgz#994649c7fea1a90b91a0a1e6d983523f680e10cd" + integrity sha512-UFbtbGPjstz0eWHb+ga/GM3Z9EzqKXFWIbSOFURU0A/Gku0Bky4bCk9/h//K2Xr3IrCfjFNhMm4jyZ5dbCewGA== + "@hapi/good-squeeze@5.2.1": version "5.2.1" resolved "https://registry.yarnpkg.com/@hapi/good-squeeze/-/good-squeeze-5.2.1.tgz#a7ed3f344c9602348af8f059beda663610ab8a4c" @@ -1525,12 +1620,210 @@ "@hapi/hoek" "8.x.x" fast-safe-stringify "2.x.x" -"@hapi/hoek@8.x.x": +"@hapi/h2o2@^8.3.2": + version "8.3.2" + resolved "https://registry.yarnpkg.com/@hapi/h2o2/-/h2o2-8.3.2.tgz#008a8f9ec3d9bba29077691aa9ec0ace93d4de80" + integrity sha512-2WkZq+QAkvYHWGqnUuG0stcVeGyv9T7bopBYnCJSUEuvBZlUf2BTX2JCVSKxsnTLOxCYwoC/aI4Rr0ZSRd2oVg== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + "@hapi/wreck" "15.x.x" + +"@hapi/hapi@^18.4.1": + version "18.4.1" + resolved "https://registry.yarnpkg.com/@hapi/hapi/-/hapi-18.4.1.tgz#023fbc131074b1cb2cd7f6766d65f4b0e92df788" + integrity sha512-9HjVGa0Z4Qv9jk9AVoUdJMQLA+KuZ+liKWyEEkVBx3e3H1F0JM6aGbPkY9jRfwsITBWGBU2iXazn65SFKSi/tg== + dependencies: + "@hapi/accept" "^3.2.4" + "@hapi/ammo" "^3.1.2" + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/call" "^5.1.3" + "@hapi/catbox" "10.x.x" + "@hapi/catbox-memory" "4.x.x" + "@hapi/heavy" "6.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "15.x.x" + "@hapi/mimos" "4.x.x" + "@hapi/podium" "3.x.x" + "@hapi/shot" "4.x.x" + "@hapi/somever" "2.x.x" + "@hapi/statehood" "6.x.x" + "@hapi/subtext" "^6.1.3" + "@hapi/teamwork" "3.x.x" + "@hapi/topo" "3.x.x" + +"@hapi/heavy@6.x.x": + version "6.2.2" + resolved "https://registry.yarnpkg.com/@hapi/heavy/-/heavy-6.2.2.tgz#d42a282c62d5bb6332e497d8ce9ba52f1609f3e6" + integrity sha512-PY1dCCO6dsze7RlafIRhTaGeyTgVe49A/lSkxbhKGjQ7x46o/OFf7hLiRqTCDh3atcEKf6362EaB3+kTUbCsVA== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/hoek@8.x.x", "@hapi/hoek@^8.2.4", "@hapi/hoek@^8.3.0", "@hapi/hoek@^8.3.1", "@hapi/hoek@^8.5.1": version "8.5.1" resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-8.5.1.tgz#fde96064ca446dec8c55a8c2f130957b070c6e06" integrity sha512-yN7kbciD87WzLGc5539Tn0sApjyiGHAJgKvG9W8C7O+6c7qmoQMfVs0W4bX17eqz6C78QJqqFrtgdK5EWf6Qow== -"@hapi/wreck@^15.0.2": +"@hapi/inert@^5.2.2": + version "5.2.2" + resolved "https://registry.yarnpkg.com/@hapi/inert/-/inert-5.2.2.tgz#3ba4d93afc6d5b42e4bab19cd09556ddd49b5dac" + integrity sha512-8IaGfAEF8SwZtpdaTq0G3aDPG35ZTfWKjnMNniG2N3kE+qioMsBuImIGxna8TNQ+sYMXYK78aqmvzbQHno8qSQ== + dependencies: + "@hapi/ammo" "3.x.x" + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + lru-cache "4.1.x" + +"@hapi/iron@*", "@hapi/iron@5.x.x", "@hapi/iron@^5.1.4": + version "5.1.4" + resolved "https://registry.yarnpkg.com/@hapi/iron/-/iron-5.1.4.tgz#7406f36847f798f52b92d1d97f855e27973832b7" + integrity sha512-+ElC+OCiwWLjlJBmm8ZEWjlfzTMQTdgPnU/TsoU5QsktspIWmWi9IU4kU83nH+X/SSya8TP8h8P11Wr5L7dkQQ== + dependencies: + "@hapi/b64" "4.x.x" + "@hapi/boom" "7.x.x" + "@hapi/bourne" "1.x.x" + "@hapi/cryptiles" "4.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/joi@15.x.x": + version "15.1.1" + resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-15.1.1.tgz#c675b8a71296f02833f8d6d243b34c57b8ce19d7" + integrity sha512-entf8ZMOK8sc+8YfeOlM8pCfg3b5+WZIKBfUaaJT8UsjAAPjartzxIYm3TIbjvA4u+u++KbcXD38k682nVHDAQ== + dependencies: + "@hapi/address" "2.x.x" + "@hapi/bourne" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/topo" "3.x.x" + +"@hapi/joi@16.x.x": + version "16.1.8" + resolved "https://registry.yarnpkg.com/@hapi/joi/-/joi-16.1.8.tgz#84c1f126269489871ad4e2decc786e0adef06839" + integrity sha512-wAsVvTPe+FwSrsAurNt5vkg3zo+TblvC5Bb1zMVK6SJzZqw9UrJnexxR+76cpePmtUZKHAPxcQ2Bf7oVHyahhg== + dependencies: + "@hapi/address" "^2.1.2" + "@hapi/formula" "^1.2.0" + "@hapi/hoek" "^8.2.4" + "@hapi/pinpoint" "^1.0.2" + "@hapi/topo" "^3.1.3" + +"@hapi/mimos@4.x.x": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@hapi/mimos/-/mimos-4.1.1.tgz#4dab8ed5c64df0603c204c725963a5faa4687e8a" + integrity sha512-CXoi/zfcTWfKYX756eEea8rXJRIb9sR4d7VwyAH9d3BkDyNgAesZxvqIdm55npQc6S9mU3FExinMAQVlIkz0eA== + dependencies: + "@hapi/hoek" "8.x.x" + mime-db "1.x.x" + +"@hapi/nigel@3.x.x": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@hapi/nigel/-/nigel-3.1.1.tgz#84794021c9ee6e48e854fea9fb76e9f7e78c99ad" + integrity sha512-R9YWx4S8yu0gcCBrMUDCiEFm1SQT895dMlYoeNBp8I6YhF1BFF1iYPueKA2Kkp9BvyHdjmvrxCOns7GMmpl+Fw== + dependencies: + "@hapi/hoek" "8.x.x" + "@hapi/vise" "3.x.x" + +"@hapi/pez@^4.1.2": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@hapi/pez/-/pez-4.1.2.tgz#14984d0c31fed348f10c962968a21d9761f55503" + integrity sha512-8zSdJ8cZrJLFldTgwjU9Fb1JebID+aBCrCsycgqKYe0OZtM2r3Yv3aAwW5z97VsZWCROC1Vx6Mdn4rujh5Ktcg== + dependencies: + "@hapi/b64" "4.x.x" + "@hapi/boom" "7.x.x" + "@hapi/content" "^4.1.1" + "@hapi/hoek" "8.x.x" + "@hapi/nigel" "3.x.x" + +"@hapi/pinpoint@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@hapi/pinpoint/-/pinpoint-1.0.2.tgz#025b7a36dbbf4d35bf1acd071c26b20ef41e0d13" + integrity sha512-dtXC/WkZBfC5vxscazuiJ6iq4j9oNx1SHknmIr8hofarpKUZKmlUVYVIhNVzIEgK5Wrc4GMHL5lZtt1uS2flmQ== + +"@hapi/podium@3.x.x", "@hapi/podium@^3.4.3": + version "3.4.3" + resolved "https://registry.yarnpkg.com/@hapi/podium/-/podium-3.4.3.tgz#d28935870ae1372e2f983a7161e710c968a60de1" + integrity sha512-QJlnYLEYZWlKQ9fSOtuUcpANyoVGwT68GA9P0iQQCAetBK0fI+nbRBt58+aMixoifczWZUthuGkNjqKxgPh/CQ== + dependencies: + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/shot@4.x.x": + version "4.1.2" + resolved "https://registry.yarnpkg.com/@hapi/shot/-/shot-4.1.2.tgz#69f999956041fe468701a89a413175a521dabed5" + integrity sha512-6LeHLjvsq/bQ0R+fhEyr7mqExRGguNTrxFZf5DyKe3CK6pNabiGgYO4JVFaRrLZ3JyuhkS0fo8iiRE2Ql2oA/A== + dependencies: + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/somever@2.x.x": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@hapi/somever/-/somever-2.1.1.tgz#142bddf7cc4d829f678ed4e60618630a9a7ae845" + integrity sha512-cic5Sto4KGd9B0oQSdKTokju+rYhCbdpzbMb0EBnrH5Oc1z048hY8PaZ1lx2vBD7I/XIfTQVQetBH57fU51XRA== + dependencies: + "@hapi/bounce" "1.x.x" + "@hapi/hoek" "8.x.x" + +"@hapi/statehood@6.x.x", "@hapi/statehood@^6.1.2": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@hapi/statehood/-/statehood-6.1.2.tgz#6dda508b5da99a28a3ed295c3cac795cf6c12a02" + integrity sha512-pYXw1x6npz/UfmtcpUhuMvdK5kuOGTKcJNfLqdNptzietK2UZH5RzNJSlv5bDHeSmordFM3kGItcuQWX2lj2nQ== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/bourne" "1.x.x" + "@hapi/cryptiles" "4.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/iron" "5.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/subtext@^6.1.3": + version "6.1.3" + resolved "https://registry.yarnpkg.com/@hapi/subtext/-/subtext-6.1.3.tgz#bbd07771ae2a4e73ac360c93ed74ac641718b9c6" + integrity sha512-qWN6NbiHNzohVcJMeAlpku/vzbyH4zIpnnMPMPioQMwIxbPFKeNViDCNI6fVBbMPBiw/xB4FjqiJkRG5P9eWWg== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/bourne" "1.x.x" + "@hapi/content" "^4.1.1" + "@hapi/file" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/pez" "^4.1.2" + "@hapi/wreck" "15.x.x" + +"@hapi/teamwork@3.x.x": + version "3.3.1" + resolved "https://registry.yarnpkg.com/@hapi/teamwork/-/teamwork-3.3.1.tgz#b52d0ec48682dc793926bd432e22ceb19c915d3f" + integrity sha512-61tiqWCYvMKP7fCTXy0M4VE6uNIwA0qvgFoiDubgfj7uqJ0fdHJFQNnVPGrxhLWlwz0uBPWrQlBH7r8y9vFITQ== + +"@hapi/topo@3.x.x", "@hapi/topo@^3.1.3": + version "3.1.6" + resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-3.1.6.tgz#68d935fa3eae7fdd5ab0d7f953f3205d8b2bfc29" + integrity sha512-tAag0jEcjwH+P2quUfipd7liWCNX2F8NvYjQp2wtInsZxnMlypdw0FtAOLxtvvkO+GSRRbmNi8m/5y42PQJYCQ== + dependencies: + "@hapi/hoek" "^8.3.0" + +"@hapi/vise@3.x.x": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@hapi/vise/-/vise-3.1.1.tgz#dfc88f2ac90682f48bdc1b3f9b8f1eab4eabe0c8" + integrity sha512-OXarbiCSadvtg+bSdVPqu31Z1JoBL+FwNYz3cYoBKQ5xq1/Cr4A3IkGpAZbAuxU5y4NL5pZFZG3d2a3ZGm/dOQ== + dependencies: + "@hapi/hoek" "8.x.x" + +"@hapi/vision@^5.5.4": + version "5.5.4" + resolved "https://registry.yarnpkg.com/@hapi/vision/-/vision-5.5.4.tgz#03a01374fb5e0a498d6e502e635a0b54d70501a1" + integrity sha512-/DFgnQtcrlf2eQNkh/DHnjrCRHLSmHraU+PHe1SlxLUJxATQCw8VIEt6rJraM2jGTpFgHNk6B6ELtu3sBJCClg== + dependencies: + "@hapi/boom" "7.x.x" + "@hapi/bounce" "1.x.x" + "@hapi/hoek" "8.x.x" + "@hapi/joi" "16.x.x" + +"@hapi/wreck@15.x.x", "@hapi/wreck@^15.0.2": version "15.1.0" resolved "https://registry.yarnpkg.com/@hapi/wreck/-/wreck-15.1.0.tgz#7917cd25950ce9b023f7fd2bea6e2ef72c71e59d" integrity sha512-tQczYRTTeYBmvhsek/D49En/5khcShaBEmzrAaDjMrFXKJRuF8xA8+tlq1ETLBFwGd6Do6g2OC74rt11kzawzg== @@ -3703,11 +3996,6 @@ resolved "https://registry.yarnpkg.com/@types/bluebird/-/bluebird-3.5.30.tgz#ee034a0eeea8b84ed868b1aa60d690b08a6cfbc5" integrity sha512-8LhzvcjIoqoi1TghEkRMkbbmM+jhHnBokPGkJWjclMK+Ks0MxEBow3/p2/iFTZ+OIbJHQDSfpgdZEb+af3gfVw== -"@types/boom@*", "@types/boom@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@types/boom/-/boom-7.2.0.tgz#19c36cbb5811a7493f0f2e37f31d42b28df1abc1" - integrity sha512-HonbGsHFbskh9zRAzA6tabcw18mCOsSEOL2ibGAuVqk6e7nElcRmWO5L4UfIHpDbWBWw+eZYFdsQ1+MEGgpcVA== - "@types/braces@*": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/braces/-/braces-3.0.0.tgz#7da1c0d44ff1c7eb660a36ec078ea61ba7eb42cb" @@ -3728,11 +4016,6 @@ resolved "https://registry.yarnpkg.com/@types/caseless/-/caseless-0.12.2.tgz#f65d3d6389e01eeb458bd54dc8f52b95a9463bc8" integrity sha512-6ckxMjBBD8URvjB6J3NcnuAn5Pkl7t3TizAg+xdlzzQGSPSmBcXf8KoIH0ua/i+tio+ZRUHEXp0HEmvaR4kt0w== -"@types/catbox@*": - version "10.0.1" - resolved "https://registry.yarnpkg.com/@types/catbox/-/catbox-10.0.1.tgz#266679017749041fe9873fee1131dd2aaa04a07e" - integrity sha512-ECuJ+f5gGHiLeiE4RlE/xdqv/0JVDToegPV1aTb10tQStYa0Ycq2OJfQukDv3IFaw3B+CMV46jHc5bXe6QXEQg== - "@types/chance@^1.0.0": version "1.0.1" resolved "https://registry.yarnpkg.com/@types/chance/-/chance-1.0.1.tgz#c10703020369602c40dd9428cc6e1437027116df" @@ -4028,40 +4311,88 @@ "@types/vinyl-fs" "*" chokidar "^2.1.2" -"@types/h2o2@^8.1.1": - version "8.1.1" - resolved "https://registry.yarnpkg.com/@types/h2o2/-/h2o2-8.1.1.tgz#f990302cd2fdfd7909cff9d6643052002b69998f" - integrity sha512-lwF9WSvo4sfT0TnDZDXKef9Yza4xUXC3561QG4Q3Axhrkr+ZFBVJ7kCwI1mUNzk60jI1aMTYVIIoHKZjwCGuHw== +"@types/hapi__boom@*", "@types/hapi__boom@^7.4.1": + version "7.4.1" + resolved "https://registry.yarnpkg.com/@types/hapi__boom/-/hapi__boom-7.4.1.tgz#06439d7637245dcbe6dd6548d2a91f2c1243d80b" + integrity sha512-x/ZK824GomII7Yoei/nMoB46NQcSfGe0iVpZK3uUivxIAfUUSzRvu8RQO7ZkKapIgzgshHZc+GR+z/BQ8l2VLg== + +"@types/hapi__catbox@*": + version "10.2.3" + resolved "https://registry.yarnpkg.com/@types/hapi__catbox/-/hapi__catbox-10.2.3.tgz#c9279c16d709bf2987491c332e11d18124ae018f" + integrity sha512-gs6MKMKXzWpSqeYsPaDIDAxD8jLNg7aFxgAJE6Jnc+ns072Z9fuh39/NF5gSk1KNoGCLnIpeZ0etT9gY9QDCKg== + +"@types/hapi__cookie@^10.1.1": + version "10.1.1" + resolved "https://registry.yarnpkg.com/@types/hapi__cookie/-/hapi__cookie-10.1.1.tgz#4420c7f89ef466aa8c1f4d9975c62e6b5b066b1c" + integrity sha512-sWVS20wvqbYSjpjpfOwsD/gtDBba3mi+Y4Yg2qZMBs0/VAgvhOOmpBXzFf2rE8rrEuR44n7tzmEgPWRw5q7kaw== dependencies: - "@types/boom" "*" - "@types/hapi" "*" - "@types/node" "*" + "@types/hapi__hapi" "*" -"@types/hapi-auth-cookie@^9.1.0": - version "9.1.0" - resolved "https://registry.yarnpkg.com/@types/hapi-auth-cookie/-/hapi-auth-cookie-9.1.0.tgz#cbcd2236b7d429bd0632a8cc45cfd355fdd7e7a2" - integrity sha512-qsP08L+fNaE2K5dsDVKvHp0AmSBs8m9PD5eWsTdHnkJOk81iD7c0J4GYt/1aDJwZsyx6CgcxpbkPOCwBJmrwAg== +"@types/hapi__h2o2@8.3.0": + version "8.3.0" + resolved "https://registry.yarnpkg.com/@types/hapi__h2o2/-/hapi__h2o2-8.3.0.tgz#c2e6598ab6ed28edb1a5edd44ddc185e1c252dd8" + integrity sha512-jD6L+8BJ+SVbwBzQK3W7zGnDYgrwuCNDl9r1P0GdwoYsysNADl7STfrhJ/m9qPt2fD1vFVJsfsFjoJ/iCyNlOQ== dependencies: - "@types/hapi" "*" + "@types/hapi__boom" "*" + "@types/hapi__hapi" "*" + "@types/node" "*" -"@types/hapi@*", "@types/hapi@^17.0.18": - version "17.0.18" - resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-17.0.18.tgz#f855fe18766aa2592a3a689c3e6eabe72989ff1a" - integrity sha512-sRoDjz1iVOCxTqq+EepzDQI773k2PjboHpvMpp524278grosStxZ5+oooVjNLJZj1iZIbiLeeR5/ZeIRgVXsCg== +"@types/hapi__hapi@*", "@types/hapi__hapi@^18.2.6": + version "18.2.6" + resolved "https://registry.yarnpkg.com/@types/hapi__hapi/-/hapi__hapi-18.2.6.tgz#61c1b210c55dee4636df594e7a0868ad48c8042a" + integrity sha512-sXFlSg9btu/LdHqK/N/kuQXVqZhSvibXbtZc0KfEcelRXKthdU5ZSu5qItDIov7SYnyK2faMe7dbZaC/VpC33w== dependencies: - "@types/boom" "*" - "@types/catbox" "*" - "@types/iron" "*" - "@types/joi" "*" - "@types/mimos" "*" + "@types/hapi__boom" "*" + "@types/hapi__catbox" "*" + "@types/hapi__iron" "*" + "@types/hapi__joi" "*" + "@types/hapi__mimos" "*" + "@types/hapi__podium" "*" + "@types/hapi__shot" "*" "@types/node" "*" - "@types/podium" "*" - "@types/shot" "*" -"@types/hapi__boom@*": - version "7.4.0" - resolved "https://registry.yarnpkg.com/@types/hapi__boom/-/hapi__boom-7.4.0.tgz#81d58cffb67c54896614560c007a5015a79c30ba" - integrity sha512-i4nerd/aJd5zW8OPHxgeuDYiuiuHxHczkqIaALhINUqBCavRgbiwjfndpgrarB43jcb/2LxzrohMOH7akyt3og== +"@types/hapi__hoek@^6.2.0": + version "6.2.0" + resolved "https://registry.yarnpkg.com/@types/hapi__hoek/-/hapi__hoek-6.2.0.tgz#61ec4dfb93e6aaccf2b407d6074a0633069e5d2d" + integrity sha512-MMS8ZD0SR2lklVkpNJw7iUYBmlvBLw1T04VSBhbWpiOi0ee6RoJUCcocVao1FLnSYR8Tt03dykRBv+FkvPIJSg== + +"@types/hapi__inert@^5.2.1": + version "5.2.1" + resolved "https://registry.yarnpkg.com/@types/hapi__inert/-/hapi__inert-5.2.1.tgz#cce395e7470a969f63cf57d561da230218b8b2bb" + integrity sha512-pFvXfN9bTGgR6jkgKseXmu5/eHVGVEsGh0LKHCkcezEqZZMJV9YabREVLa6kcYEQMIDQzQSwSakSnemCFiSnOg== + dependencies: + "@types/hapi__hapi" "*" + +"@types/hapi__iron@*": + version "6.0.1" + resolved "https://registry.yarnpkg.com/@types/hapi__iron/-/hapi__iron-6.0.1.tgz#ec8b23eff3d69313f1187c234deb80652384ad6b" + integrity sha512-NTr+1FKl+nvEeSwVpfcks36dCm6+tbcQh3tJYbyQ5XWb5sIbCIptW6p38zmCYE5ppOoU/2PK1Y8taGpl6cOl5w== + dependencies: + "@hapi/iron" "*" + +"@types/hapi__joi@*": + version "17.1.6" + resolved "https://registry.yarnpkg.com/@types/hapi__joi/-/hapi__joi-17.1.6.tgz#b84663676aa9753c17183718338dd40ddcbd3754" + integrity sha512-y3A1MzNC0FmzD5+ys59RziE1WqKrL13nxtJgrSzjoO7boue5B7zZD2nZLPwrSuUviFjpKFQtgHYSvhDGfIE4jA== + +"@types/hapi__mimos@*", "@types/hapi__mimos@4.1.0": + version "4.1.0" + resolved "https://registry.yarnpkg.com/@types/hapi__mimos/-/hapi__mimos-4.1.0.tgz#47dbf89ebfc05183c1de2797e9426793db9a0d85" + integrity sha512-hcdSoYa32wcP+sEfyf85ieGwElwokcZ/mma8eyqQ4OTHeCAGwfaoiGxjG4z1Dm+RGhIYLHlW54ji5FFwahH12A== + dependencies: + "@types/mime-db" "*" + +"@types/hapi__podium@*", "@types/hapi__podium@^3.4.1": + version "3.4.1" + resolved "https://registry.yarnpkg.com/@types/hapi__podium/-/hapi__podium-3.4.1.tgz#826ffed038979c844410e576b574f8237afd59bc" + integrity sha512-qgMyeXTZhGWvvUnXFavW2Pksf07IV1haBM/Fdq6cFi1lCIXhUHsaTrr2w651q+rhHZf+1dgP1vltJ0/quLxYYw== + +"@types/hapi__shot@*": + version "4.1.1" + resolved "https://registry.yarnpkg.com/@types/hapi__shot/-/hapi__shot-4.1.1.tgz#c760322b90eb77f36a3003a442e8dc69e6ae3922" + integrity sha512-44Jj7jJAFgNVgfdbyVtBUbEIbYqWRKAbLR4kiQxBbVEdf8ZKfa5Hg1qg4QdzXBgjw0mopewU4wx1/eWRTVelNQ== + dependencies: + "@types/node" "*" "@types/hapi__wreck@^15.0.1": version "15.0.1" @@ -4098,11 +4429,6 @@ resolved "https://registry.yarnpkg.com/@types/hjson/-/hjson-2.4.2.tgz#fd0288a5b6778cda993c978e43cc978ddc8f22e9" integrity sha512-MSKTfEyR8DbzJTOAY47BIJBD72ol4cu6BOw5inda0q1eEtEmurVHL4OmYB3Lxa4/DwXbWidkddvtoygbGQEDIw== -"@types/hoek@^4.1.3": - version "4.1.3" - resolved "https://registry.yarnpkg.com/@types/hoek/-/hoek-4.1.3.tgz#d1982d48fb0d2a0e5d7e9d91838264d8e428d337" - integrity sha1-0ZgtSPsNKg5dfp2Rg4Jk2OQo0zc= - "@types/hoist-non-react-statics@*", "@types/hoist-non-react-statics@^3.3.0", "@types/hoist-non-react-statics@^3.3.1": version "3.3.1" resolved "https://registry.yarnpkg.com/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.1.tgz#1124aafe5118cb591977aeb1ceaaed1070eb039f" @@ -4135,13 +4461,6 @@ dependencies: "@types/node" "*" -"@types/inert@^5.1.2": - version "5.1.2" - resolved "https://registry.yarnpkg.com/@types/inert/-/inert-5.1.2.tgz#2bb8bef3b2462f904c960654c9edfa39285a85c6" - integrity sha512-3IoSFLQWvhLfZ85kHas/F3iD/TyZPfeJbTsDjrwYljK1MgBGCB2OywAsyeA/YiJ62VbNXfXBwpD1/VbJPIZSGA== - dependencies: - "@types/hapi" "*" - "@types/inquirer@^7.3.1": version "7.3.1" resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-7.3.1.tgz#1f231224e7df11ccfaf4cf9acbcc3b935fea292d" @@ -4155,13 +4474,6 @@ resolved "https://registry.yarnpkg.com/@types/intl-relativeformat/-/intl-relativeformat-2.1.0.tgz#3a2b0043380388f39c666665ec517e11412f1358" integrity sha512-AfsEUBFuVaTKL+t82wmU0yEvNjaZEIuGRCLUmgKQkn4nA5M84EbTrDobd8x/D3WohY34MBO5h9al5cGeLQ4Y1g== -"@types/iron@*": - version "5.0.1" - resolved "https://registry.yarnpkg.com/@types/iron/-/iron-5.0.1.tgz#5420bbda8623c48ee51b9a78ebad05d7305b4b24" - integrity sha512-Ng5BkVGPt7Tw9k1OJ6qYwuD9+dmnWgActmsnnrdvs4075N8V2go1f6Pz8omG3q5rbHjXN6yzzZDYo3JOgAE/Ug== - dependencies: - "@types/node" "*" - "@types/is-function@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/is-function/-/is-function-1.0.0.tgz#1b0b819b1636c7baf0d6785d030d12edf70c3e83" @@ -4229,7 +4541,7 @@ jest-diff "^25.2.1" pretty-format "^25.2.1" -"@types/joi@*", "@types/joi@^13.4.2": +"@types/joi@^13.4.2": version "13.6.1" resolved "https://registry.yarnpkg.com/@types/joi/-/joi-13.6.1.tgz#325486a397504f8e22c8c551dc8b0e1d41d5d5ae" integrity sha512-JxZ0NP8NuB0BJOXi1KvAA6rySLTPmhOy4n2gzSFq/IFM3LNFm0h+2Vn/bPPgEYlWqzS2NPeLgKqfm75baX+Hog== @@ -4416,13 +4728,6 @@ resolved "https://registry.yarnpkg.com/@types/mime/-/mime-2.0.1.tgz#dc488842312a7f075149312905b5e3c0b054c79d" integrity sha512-FwI9gX75FgVBJ7ywgnq/P7tw+/o1GUbtP0KzbtusLigAOgIgNISRK0ZPl4qertvXSIE8YbsVJueQ90cDt9YYyw== -"@types/mimos@*": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/mimos/-/mimos-3.0.1.tgz#59d96abe1c9e487e7463fe41e8d86d76b57a441a" - integrity sha512-MATIRH4VMIJki8lcYUZdNQEHuAG7iQ1FWwoLgxV+4fUOly2xZYdhHtGgvQyWiTeJqq2tZbE0nOOgZD6pR0FpNQ== - dependencies: - "@types/mime-db" "*" - "@types/minimatch@*", "@types/minimatch@^3.0.3": version "3.0.3" resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" @@ -4612,11 +4917,6 @@ dependencies: "@types/node" "*" -"@types/podium@*", "@types/podium@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/podium/-/podium-1.0.0.tgz#bfaa2151be2b1d6109cc69f7faa9dac2cba3bb20" - integrity sha1-v6ohUb4rHWEJzGn3+qnawsujuyA= - "@types/prettier@1.16.1": version "1.16.1" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-1.16.1.tgz#328d1c9b54402e44119398bcb6a31b7bbd606d59" @@ -4880,13 +5180,6 @@ resolved "https://registry.yarnpkg.com/@types/set-value/-/set-value-2.0.0.tgz#63d386b103926dcf49b50e16e0f6dd49983046be" integrity sha512-k8dCJEC80F/mbsIOZ5Hj3YSzTVVVBwMdtP/M9Rtc2TM4F5etVd+2UG8QUiAUfbXm4fABedL2tBZnrBheY7UwpA== -"@types/shot@*": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/shot/-/shot-4.0.0.tgz#7545500c489b65c69b5bc5446ba4fef3bd26af92" - integrity sha512-Xv+n8yfccuicMlwBY58K5PVVNtXRm7uDzcwwmCarBxMP+XxGfnh1BI06YiVAsPbTAzcnYsrzpoS5QHeyV7LS8A== - dependencies: - "@types/node" "*" - "@types/sinon@^7.0.13": version "7.0.13" resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-7.0.13.tgz#ca039c23a9e27ebea53e0901ef928ea2a1a6d313" @@ -5552,7 +5845,7 @@ abortcontroller-polyfill@^1.4.0: resolved "https://registry.yarnpkg.com/abortcontroller-polyfill/-/abortcontroller-polyfill-1.4.0.tgz#0d5eb58e522a461774af8086414f68e1dda7a6c4" integrity sha512-3ZFfCRfDzx3GFjO6RAkYx81lPGpUS20ISxux9gLxuKnqafNcFQo59+IoZqpO2WvQlyc287B62HDnDdNYRmlvWA== -accept@3.0.2, accept@3.x.x: +accept@3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/accept/-/accept-3.0.2.tgz#83e41cec7e1149f3fd474880423873db6c6cc9ac" integrity sha512-bghLXFkCOsC1Y2TZ51etWfKDs6q249SAoHTZVfzWWdlZxoij+mgkj9AmUJWQpDY48TfnrTDIe43Xem4zdMe7mQ== @@ -5786,13 +6079,6 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= -ammo@3.x.x: - version "3.0.1" - resolved "https://registry.yarnpkg.com/ammo/-/ammo-3.0.1.tgz#c79ceeac36fb4e55085ea3fe0c2f42bfa5f7c914" - integrity sha512-4UqoM8xQjwkQ78oiU4NbBK0UgYqeKMAKmwE4ec7Rz3rGU8ZEBFxzgF2sUYKOAlqIXExBDYLN6y1ShF5yQ4hwLQ== - dependencies: - hoek "5.x.x" - angular-aria@^1.8.0: version "1.8.0" resolved "https://registry.yarnpkg.com/angular-aria/-/angular-aria-1.8.0.tgz#97aec9b1e8bafd07d5fab30f98d8ec832e18e25d" @@ -6805,11 +7091,6 @@ axobject-query@^2.0.2: dependencies: ast-types-flow "0.0.7" -b64@4.x.x: - version "4.0.0" - resolved "https://registry.yarnpkg.com/b64/-/b64-4.0.0.tgz#c37f587f0a383c7019e821120e8c3f58f0d22772" - integrity sha512-EhmUQodKB0sdzPPrbIWbGqA5cQeTWxYrAgNeeT1rLZWtD3tbNTnphz8J4vkXI3cPgBNlXBjzEbzDzq0Nwi4f9A== - babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -7414,11 +7695,6 @@ big-integer@^1.6.16: resolved "https://registry.yarnpkg.com/big-integer/-/big-integer-1.6.48.tgz#8fd88bd1632cba4a1c8c3e3d7159f08bb95b4b9e" integrity sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w== -big-time@2.x.x: - version "2.0.1" - resolved "https://registry.yarnpkg.com/big-time/-/big-time-2.0.1.tgz#68c7df8dc30f97e953f25a67a76ac9713c16c9de" - integrity sha1-aMffjcMPl+lT8lpnp2rJcTwWyd4= - big.js@^5.2.2: version "5.2.2" resolved "https://registry.yarnpkg.com/big.js/-/big.js-5.2.2.tgz#65f0af382f578bcdc742bd9c281e9cb2d7768328" @@ -7557,7 +7833,7 @@ boolbase@^1.0.0, boolbase@~1.0.0: resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= -boom@7.x.x, boom@^7.1.0, boom@^7.2.0: +boom@7.x.x, boom@^7.1.0: version "7.2.2" resolved "https://registry.yarnpkg.com/boom/-/boom-7.2.2.tgz#ac92101451aa5cea901aed07d881dd32b4f08345" integrity sha512-IFUbOa8PS7xqmhIjpeStwT3d09hGkNYQ6aj2iELSTxcVs2u0aKn1NzhkdUQSzsRg1FVkj3uit3I6mXQCBixw+A== @@ -7569,14 +7845,6 @@ bottleneck@^2.15.3: resolved "https://registry.yarnpkg.com/bottleneck/-/bottleneck-2.18.0.tgz#41fa63ae185b65435d789d1700334bc48222dacf" integrity sha512-U1xiBRaokw4yEguzikOl0VrnZp6uekjpmfrh6rKtr1D+/jFjYCL6J83ZXlGtlBDwVdTmJJ+4Lg5FpB3xmLSiyA== -bounce@1.x.x: - version "1.2.0" - resolved "https://registry.yarnpkg.com/bounce/-/bounce-1.2.0.tgz#e3bac68c73fd256e38096551efc09f504873c8c8" - integrity sha512-8syCGe8B2/WC53118/F/tFy5aW00j+eaGPXmAUP7iBhxc+EBZZxS1vKelWyBCH6IqojgS2t1gF0glH30qAJKEw== - dependencies: - boom "7.x.x" - hoek "5.x.x" - bowser@^1.7.3: version "1.9.4" resolved "https://registry.yarnpkg.com/bowser/-/bowser-1.9.4.tgz#890c58a2813a9d3243704334fa81b96a5c150c9a" @@ -8035,14 +8303,6 @@ call-me-maybe@^1.0.1: resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" integrity sha1-JtII6onje1y95gJQoV8DHBak1ms= -call@5.x.x: - version "5.0.1" - resolved "https://registry.yarnpkg.com/call/-/call-5.0.1.tgz#ac1b5c106d9edc2a17af2a4a4f74dd4f0c06e910" - integrity sha512-ollfFPSshiuYLp7AsrmpkQJ/PxCi6AzV81rCjBwWhyF2QGyUY/vPDMzoh4aUcWyucheRglG2LaS5qkIEfLRh6A== - dependencies: - boom "7.x.x" - hoek "5.x.x" - caller-callsite@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/caller-callsite/-/caller-callsite-2.0.0.tgz#847e0fce0a223750a9a027c54b33731ad3154134" @@ -8187,24 +8447,6 @@ caseless@~0.12.0: resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= -catbox-memory@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/catbox-memory/-/catbox-memory-3.1.2.tgz#4aeec1bc994419c0f7e60087f172aaedd9b4911c" - integrity sha512-lhWtutLVhsq3Mucxk2McxBPPibJ34WcHuWFz3xqub9u9Ve/IQYpZv3ijLhQXfQped9DXozURiaq9O3aZpP91eg== - dependencies: - big-time "2.x.x" - boom "7.x.x" - hoek "5.x.x" - -catbox@10.x.x: - version "10.0.3" - resolved "https://registry.yarnpkg.com/catbox/-/catbox-10.0.3.tgz#1f6f6436dfab30cdd23f753877bcb4afe980414b" - integrity sha512-qwus6RnVctHXYwfxvvDwvlMWHwCjQdIpQQbtyHnRF0JpwmxbQJ/UIZi9y8O6DpphKCdfO9gpxgb2ne9ZDx39BQ== - dependencies: - boom "7.x.x" - hoek "5.x.x" - joi "13.x.x" - ccount@^1.0.0: version "1.0.5" resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.5.tgz#ac82a944905a65ce204eb03023157edf29425c17" @@ -9244,13 +9486,6 @@ content-type@~1.0.4: resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== -content@4.x.x: - version "4.0.5" - resolved "https://registry.yarnpkg.com/content/-/content-4.0.5.tgz#bc547deabc889ab69bce17faf3585c29f4c41bf2" - integrity sha512-wDP6CTWDpwCf791fNxlCCkZGRkrNzSEU/8ju9Hnr3Uc5mF/gFR5W+fcoGm6zUSlVPdSXYn5pCbySADKj7YM4Cg== - dependencies: - boom "7.x.x" - continuable-cache@^0.3.1: version "0.3.1" resolved "https://registry.yarnpkg.com/continuable-cache/-/continuable-cache-0.3.1.tgz#bd727a7faed77e71ff3985ac93351a912733ad0f" @@ -9571,13 +9806,6 @@ crypt@~0.0.1: resolved "https://registry.yarnpkg.com/crypt/-/crypt-0.0.2.tgz#88d7ff7ec0dfb86f713dc87bbb42d044d3e6c41b" integrity sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs= -cryptiles@4.x.x: - version "4.1.3" - resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-4.1.3.tgz#2461d3390ea0b82c643a6ba79f0ed491b0934c25" - integrity sha512-gT9nyTMSUC1JnziQpPbxKGBbUg8VL7Zn2NB4E1cJYvuXdElHrwxrV9bmltZGDzet45zSDGyYceueke1TjynGzw== - dependencies: - boom "7.x.x" - crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -14638,16 +14866,6 @@ gzip-size@5.1.1: duplexer "^0.1.1" pify "^4.0.1" -h2o2@^8.1.2: - version "8.1.2" - resolved "https://registry.yarnpkg.com/h2o2/-/h2o2-8.1.2.tgz#25e6f69f453175c9ca1e3618741c5ebe1b5000c1" - integrity sha1-Jeb2n0UxdcnKHjYYdBxevhtQAME= - dependencies: - boom "7.x.x" - hoek "5.x.x" - joi "13.x.x" - wreck "14.x.x" - handle-thing@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.0.tgz#0e039695ff50c93fc288557d696f3c1dc6776754" @@ -14665,39 +14883,6 @@ handlebars@4.7.6: optionalDependencies: uglify-js "^3.1.4" -hapi-auth-cookie@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/hapi-auth-cookie/-/hapi-auth-cookie-9.0.0.tgz#3b0af443334e2bd92490ddb17bed16e3e9edfd01" - integrity sha512-N71Mt7Jk0+7WLnuvfSv0DoGzgpn7TqOd+/AB73RfHpLvzYoskJ9AlFV3Op60DB01RJNaABZtdcH1l4HM3DMbog== - dependencies: - boom "7.x.x" - bounce "1.x.x" - hoek "5.x.x" - joi "13.x.x" - -hapi@^17.5.3: - version "17.6.0" - resolved "https://registry.yarnpkg.com/hapi/-/hapi-17.6.0.tgz#158a2276253a8de727be678c4daeb1f73929e588" - integrity sha512-GSHjE1hJExluAukrT/QuYSk96irmbYBDd3wOgywiHsPoR2QeKgDnIttD+dB6NbADEmSdb9MS5gTUIVq0uHTdkA== - dependencies: - accept "3.x.x" - ammo "3.x.x" - boom "7.x.x" - bounce "1.x.x" - call "5.x.x" - catbox "10.x.x" - catbox-memory "3.x.x" - heavy "6.x.x" - hoek "5.x.x" - joi "13.x.x" - mimos "4.x.x" - podium "3.x.x" - shot "4.x.x" - statehood "6.x.x" - subtext "6.x.x" - teamwork "3.x.x" - topo "3.x.x" - har-schema@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/har-schema/-/har-schema-2.0.0.tgz#a94c2224ebcac04782a0d9035521f24735b7ec92" @@ -14990,15 +15175,6 @@ heap@^0.2.6: resolved "https://registry.yarnpkg.com/heap/-/heap-0.2.6.tgz#087e1f10b046932fc8594dd9e6d378afc9d1e5ac" integrity sha1-CH4fELBGky/IWU3Z5tN4r8nR5aw= -heavy@6.x.x: - version "6.1.0" - resolved "https://registry.yarnpkg.com/heavy/-/heavy-6.1.0.tgz#1bbfa43dc61dd4b543ede3ff87db8306b7967274" - integrity sha512-TKS9DC9NOTGulHQI31Lx+bmeWmNOstbJbGMiN3pX6bF+Zc2GKSpbbym4oasNnB6yPGkqJ9TQXXYDGohqNSJRxA== - dependencies: - boom "7.x.x" - hoek "5.x.x" - joi "13.x.x" - highlight.js@9.15.10, highlight.js@^9.12.0, highlight.js@~9.15.0, highlight.js@~9.15.1: version "9.15.10" resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-9.15.10.tgz#7b18ed75c90348c045eef9ed08ca1319a2219ad2" @@ -15040,7 +15216,7 @@ hmac-drbg@^1.0.0: minimalistic-assert "^1.0.0" minimalistic-crypto-utils "^1.0.1" -hoek@5.x.x, hoek@^5.0.4: +hoek@5.x.x: version "5.0.4" resolved "https://registry.yarnpkg.com/hoek/-/hoek-5.0.4.tgz#0f7fa270a1cafeb364a4b2ddfaa33f864e4157da" integrity sha512-Alr4ZQgoMlnere5FZJsIyfIjORBqZll5POhDsF4q64dPuJR6rNxXdDxtHSQq8OXRurhmx+PWYEE8bXRROY8h0w== @@ -15575,18 +15751,6 @@ indexes-of@^1.0.1: resolved "https://registry.yarnpkg.com/indexes-of/-/indexes-of-1.0.1.tgz#f30f716c8e2bd346c7b67d3df3915566a7c05607" integrity sha1-8w9xbI4r00bHtn0985FVZqfAVgc= -inert@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/inert/-/inert-5.1.0.tgz#e9f130dc3047ccd9ffaa64b157b4c1114611035d" - integrity sha512-5rJZbezGEkBN4QrP/HEEwsQ0N+7YzqDZrvBZrE7B0CrNY6I4XKI434aL3UNLCmbI4HzPGQs7Ae/4h1tiTMJ6Wg== - dependencies: - ammo "3.x.x" - boom "7.x.x" - bounce "1.x.x" - hoek "5.x.x" - joi "13.x.x" - lru-cache "4.1.x" - infer-owner@^1.0.3, infer-owner@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" @@ -15881,15 +16045,6 @@ ipaddr.js@1.9.0, ipaddr.js@^1.9.0: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== -iron@5.x.x: - version "5.0.4" - resolved "https://registry.yarnpkg.com/iron/-/iron-5.0.4.tgz#003ed822f656f07c2b62762815f5de3947326867" - integrity sha512-7iQ5/xFMIYaNt9g2oiNiWdhrOTdRUMFaWENUd0KghxwPUhrIH8DUY8FEyLNTTzf75jaII+jMexLdY/2HfV61RQ== - dependencies: - boom "7.x.x" - cryptiles "4.x.x" - hoek "5.x.x" - irregular-plurals@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/irregular-plurals/-/irregular-plurals-3.2.0.tgz#b19c490a0723798db51b235d7e39add44dab0822" @@ -16776,11 +16931,6 @@ isurl@^1.0.0-alpha5: has-to-string-tag-x "^1.2.0" is-object "^1.0.1" -items@2.x.x: - version "2.1.1" - resolved "https://registry.yarnpkg.com/items/-/items-2.1.1.tgz#8bd16d9c83b19529de5aea321acaada78364a198" - integrity sha1-i9FtnIOxlSneWuoyGsqtp4NkoZg= - iterall@^1.1.3, iterall@^1.2.1: version "1.2.2" resolved "https://registry.yarnpkg.com/iterall/-/iterall-1.2.2.tgz#92d70deb8028e0c39ff3164fdbf4d8b088130cd7" @@ -19324,14 +19474,6 @@ mimic-response@^2.0.0, mimic-response@^2.1.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.1.0.tgz#d13763d35f613d09ec37ebb30bac0469c0ee8f43" integrity sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA== -mimos@4.x.x: - version "4.0.0" - resolved "https://registry.yarnpkg.com/mimos/-/mimos-4.0.0.tgz#76e3d27128431cb6482fd15b20475719ad626a5a" - integrity sha512-JvlvRLqGIlk+AYypWrbrDmhsM+6JVx/xBM5S3AMwTBz1trPCEoPN/swO2L4Wu653fL7oJdgk8DMQyG/Gq3JkZg== - dependencies: - hoek "5.x.x" - mime-db "1.x.x" - min-document@^2.19.0: version "2.19.0" resolved "https://registry.yarnpkg.com/min-document/-/min-document-2.19.0.tgz#7bd282e3f5842ed295bb748cdd9f1ffa2c824685" @@ -19949,14 +20091,6 @@ nice-try@^1.0.4: resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.4.tgz#d93962f6c52f2c1558c0fbda6d512819f1efe1c4" integrity sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA== -nigel@3.x.x: - version "3.0.1" - resolved "https://registry.yarnpkg.com/nigel/-/nigel-3.0.1.tgz#48a08859d65177312f1c25af7252c1e07bb07c2a" - integrity sha512-kCVtUG9JyD//tsYrZY+/Y+2gUrANVSba8y23QkM5Znx0FOxlnl9Z4OVPBODmstKWTOvigfTO+Va1VPOu3eWSOQ== - dependencies: - hoek "5.x.x" - vise "3.x.x" - nise@^1.5.2: version "1.5.3" resolved "https://registry.yarnpkg.com/nise/-/nise-1.5.3.tgz#9d2cfe37d44f57317766c6e9408a359c5d3ac1f7" @@ -21579,17 +21713,6 @@ performance-now@^2.1.0: resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= -pez@4.x.x: - version "4.0.2" - resolved "https://registry.yarnpkg.com/pez/-/pez-4.0.2.tgz#0a7c81b64968e90b0e9562b398f390939e9c4b53" - integrity sha512-HuPxmGxHsEFPWhdkwBs2gIrHhFqktIxMtudISTFN95RQ85ZZAOl8Ki6u3nnN/X8OUaGlIGldk/l8p2IR4/i76w== - dependencies: - b64 "4.x.x" - boom "7.x.x" - content "4.x.x" - hoek "5.x.x" - nigel "3.x.x" - phin@^2.9.1: version "2.9.3" resolved "https://registry.yarnpkg.com/phin/-/phin-2.9.3.tgz#f9b6ac10a035636fb65dfc576aaaa17b8743125c" @@ -21742,14 +21865,6 @@ pnp-webpack-plugin@1.6.4: dependencies: ts-pnp "^1.1.6" -podium@3.x.x: - version "3.1.2" - resolved "https://registry.yarnpkg.com/podium/-/podium-3.1.2.tgz#b701429739cf6bdde6b3015ae6b48d400817ce9e" - integrity sha512-18VrjJAduIdPv7d9zWsfmKxTj3cQTYC5Pv5gtKxcWujYBpGbV+mhNSPYhlHW5xeWoazYyKfB9FEsPT12r5rY1A== - dependencies: - hoek "5.x.x" - joi "13.x.x" - polished@^1.9.2: version "1.9.2" resolved "https://registry.yarnpkg.com/polished/-/polished-1.9.2.tgz#d705cac66f3a3ed1bd38aad863e2c1e269baf6b6" @@ -24959,14 +25074,6 @@ shellwords@^0.1.1: resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" integrity sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww== -shot@4.x.x: - version "4.0.5" - resolved "https://registry.yarnpkg.com/shot/-/shot-4.0.5.tgz#c7e7455d11d60f6b6cd3c43e15a3b431c17e5566" - integrity sha1-x+dFXRHWD2ts08Q+FaO0McF+VWY= - dependencies: - hoek "5.x.x" - joi "13.x.x" - side-channel@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.2.tgz#df5d1abadb4e4bf4af1cd8852bf132d2f7876947" @@ -25484,18 +25591,6 @@ state-toggle@^1.0.0: resolved "https://registry.yarnpkg.com/state-toggle/-/state-toggle-1.0.0.tgz#d20f9a616bb4f0c3b98b91922d25b640aa2bc425" integrity sha1-0g+aYWu08MO5i5GSLSW2QKorxCU= -statehood@6.x.x: - version "6.0.6" - resolved "https://registry.yarnpkg.com/statehood/-/statehood-6.0.6.tgz#0dbd7c50774d3f61a24e42b0673093bbc81fa5f0" - integrity sha512-jR45n5ZMAkasw0xoE9j9TuLmJv4Sa3AkXe+6yIFT6a07kXYHgSbuD2OVGECdZGFxTmvNqLwL1iRIgvq6O6rq+A== - dependencies: - boom "7.x.x" - bounce "1.x.x" - cryptiles "4.x.x" - hoek "5.x.x" - iron "5.x.x" - joi "13.x.x" - static-eval@^2.0.5: version "2.0.5" resolved "https://registry.yarnpkg.com/static-eval/-/static-eval-2.0.5.tgz#f0782e66999c4b3651cda99d9ce59c507d188f71" @@ -25955,17 +26050,6 @@ stylus-lookup@^3.0.1: commander "^2.8.1" debug "^4.1.0" -subtext@6.x.x: - version "6.0.7" - resolved "https://registry.yarnpkg.com/subtext/-/subtext-6.0.7.tgz#8e40a67901a734d598142665c90e398369b885f9" - integrity sha512-IcJUvRjeR+NB437Iq+LORFNJW4L6Knqkj3oQrBrkdhIaS2VKJvx/9aYEq7vi+PEx5/OuehOL/40SkSZotLi/MA== - dependencies: - boom "7.x.x" - content "4.x.x" - hoek "5.x.x" - pez "4.x.x" - wreck "14.x.x" - success-symbol@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/success-symbol/-/success-symbol-0.1.0.tgz#24022e486f3bf1cdca094283b769c472d3b72897" @@ -26335,11 +26419,6 @@ tcp-port-used@^1.0.1: debug "4.1.0" is2 "2.0.1" -teamwork@3.x.x: - version "3.0.1" - resolved "https://registry.yarnpkg.com/teamwork/-/teamwork-3.0.1.tgz#ff38c7161f41f8070b7813716eb6154036ece196" - integrity sha512-hEkJIpDOfOYe9NYaLFk00zQbzZeKNCY8T2pRH3I13Y1mJwxaSQ6NEsjY5rCp+11ezCiZpWGoGFTbOuhg4qKevQ== - telejson@^5.0.2: version "5.0.2" resolved "https://registry.yarnpkg.com/telejson/-/telejson-5.0.2.tgz#ed1e64be250cc1c757a53c19e1740b49832b3d51" @@ -28474,23 +28553,6 @@ vinyl@^2.0.0, vinyl@^2.0.1, vinyl@^2.1.0, vinyl@^2.2.0: remove-trailing-separator "^1.0.1" replace-ext "^1.0.0" -vise@3.x.x: - version "3.0.0" - resolved "https://registry.yarnpkg.com/vise/-/vise-3.0.0.tgz#76ad14ab31669c50fbb0817bc0e72fedcbb3bf4c" - integrity sha512-kBFZLmiL1Vm3rHXphkhvvAcsjgeQXRrOFCbJb0I50YZZP4HGRNH+xGzK3matIMcpbsfr3I02u9odj4oCD0TWgA== - dependencies: - hoek "5.x.x" - -vision@^5.3.3: - version "5.4.0" - resolved "https://registry.yarnpkg.com/vision/-/vision-5.4.0.tgz#fc620deb95227881ea8b8d8a044dc1d1fd40e584" - integrity sha512-f8kbjvo/dUbR4ZDF0pHPuOjQFg/6zOMlP1Tb9gK2ukCa7Ksd24174DCzubtov6AxIDhZhO5RYQeeDlF8ujlKWQ== - dependencies: - boom "7.x.x" - hoek "5.x.x" - items "2.x.x" - joi "13.x.x" - vm-browserify@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/vm-browserify/-/vm-browserify-1.1.0.tgz#bd76d6a23323e2ca8ffa12028dc04559c75f9019" @@ -29088,14 +29150,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -wreck@14.x.x: - version "14.1.0" - resolved "https://registry.yarnpkg.com/wreck/-/wreck-14.1.0.tgz#b13e526b6a8318e5ebc6969c0b21075c06337067" - integrity sha512-y/iwFhwdGoM8Hk1t1I4LbuLhM3curVD8STd5NcFI0c/4b4cQAMLcnCRxXX9sLQAggDC8dXYSaQNsT64hga6lvA== - dependencies: - boom "7.x.x" - hoek "5.x.x" - write-file-atomic@^1.1.2: version "1.3.4" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" From 032760181167bb47ec60628526153263b85ebf0a Mon Sep 17 00:00:00 2001 From: Dario Gieselaar Date: Mon, 2 Nov 2020 13:35:40 +0100 Subject: [PATCH 03/13] [APM] Scale transaction rate correctly (#82155) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../charts/get_timeseries_data/transform.ts | 6 +- .../__snapshots__/transaction_charts.snap | 194 ++++++------ .../tests/csm/__snapshots__/page_views.snap | 280 ++++++++++++++++++ 3 files changed, 379 insertions(+), 101 deletions(-) create mode 100644 x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_views.snap diff --git a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts index 7afb7427c210f..e5d6aad693869 100644 --- a/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts +++ b/x-pack/plugins/apm/server/lib/transactions/charts/get_timeseries_data/transform.ts @@ -58,12 +58,10 @@ export function getTpmBuckets({ const buckets = transactionResultBuckets.map( ({ key: resultKey, timeseries }) => { const dataPoints = timeseries.buckets.map((bucket) => { - // calculate request/minute. Avoid up-scaling numbers if bucketSize is below 60s (1 minute). - // Eg. 1 request during a 10 second window should be displayed as "1 rpm" instead of "6 rpm". - const tmpValue = bucket.count.value * (60 / Math.max(60, bucketSize)); return { x: bucket.key, - y: tmpValue, + // divide by minutes + y: bucket.count.value / (bucketSize / 60), }; }); diff --git a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/__snapshots__/transaction_charts.snap b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/__snapshots__/transaction_charts.snap index 75dc775d887e4..a75b8918ed5e4 100644 --- a/x-pack/test/apm_api_integration/basic/tests/transaction_groups/__snapshots__/transaction_charts.snap +++ b/x-pack/test/apm_api_integration/basic/tests/transaction_groups/__snapshots__/transaction_charts.snap @@ -750,15 +750,15 @@ Object { "dataPoints": Array [ Object { "x": 1601389800000, - "y": 3, + "y": 6, }, Object { "x": 1601389830000, - "y": 2, + "y": 4, }, Object { "x": 1601389860000, - "y": 1, + "y": 2, }, Object { "x": 1601389890000, @@ -766,15 +766,15 @@ Object { }, Object { "x": 1601389920000, - "y": 4, + "y": 8, }, Object { "x": 1601389950000, - "y": 1, + "y": 2, }, Object { "x": 1601389980000, - "y": 1, + "y": 2, }, Object { "x": 1601390010000, @@ -782,15 +782,15 @@ Object { }, Object { "x": 1601390040000, - "y": 11, + "y": 22, }, Object { "x": 1601390070000, - "y": 4, + "y": 8, }, Object { "x": 1601390100000, - "y": 1, + "y": 2, }, Object { "x": 1601390130000, @@ -798,11 +798,11 @@ Object { }, Object { "x": 1601390160000, - "y": 10, + "y": 20, }, Object { "x": 1601390190000, - "y": 1, + "y": 2, }, Object { "x": 1601390220000, @@ -814,7 +814,7 @@ Object { }, Object { "x": 1601390280000, - "y": 1, + "y": 2, }, Object { "x": 1601390310000, @@ -822,7 +822,7 @@ Object { }, Object { "x": 1601390340000, - "y": 1, + "y": 2, }, Object { "x": 1601390370000, @@ -834,11 +834,11 @@ Object { }, Object { "x": 1601390430000, - "y": 1, + "y": 2, }, Object { "x": 1601390460000, - "y": 4, + "y": 8, }, Object { "x": 1601390490000, @@ -846,11 +846,11 @@ Object { }, Object { "x": 1601390520000, - "y": 3, + "y": 6, }, Object { "x": 1601390550000, - "y": 3, + "y": 6, }, Object { "x": 1601390580000, @@ -866,7 +866,7 @@ Object { }, Object { "x": 1601390670000, - "y": 2, + "y": 4, }, Object { "x": 1601390700000, @@ -878,23 +878,23 @@ Object { }, Object { "x": 1601390760000, - "y": 2, + "y": 4, }, Object { "x": 1601390790000, - "y": 2, + "y": 4, }, Object { "x": 1601390820000, - "y": 3, + "y": 6, }, Object { "x": 1601390850000, - "y": 1, + "y": 2, }, Object { "x": 1601390880000, - "y": 6, + "y": 12, }, Object { "x": 1601390910000, @@ -902,7 +902,7 @@ Object { }, Object { "x": 1601390940000, - "y": 3, + "y": 6, }, Object { "x": 1601390970000, @@ -910,7 +910,7 @@ Object { }, Object { "x": 1601391000000, - "y": 5, + "y": 10, }, Object { "x": 1601391030000, @@ -922,19 +922,19 @@ Object { }, Object { "x": 1601391090000, - "y": 1, + "y": 2, }, Object { "x": 1601391120000, - "y": 4, + "y": 8, }, Object { "x": 1601391150000, - "y": 1, + "y": 2, }, Object { "x": 1601391180000, - "y": 2, + "y": 4, }, Object { "x": 1601391210000, @@ -942,11 +942,11 @@ Object { }, Object { "x": 1601391240000, - "y": 3, + "y": 6, }, Object { "x": 1601391270000, - "y": 1, + "y": 2, }, Object { "x": 1601391300000, @@ -958,7 +958,7 @@ Object { }, Object { "x": 1601391360000, - "y": 1, + "y": 2, }, Object { "x": 1601391390000, @@ -966,7 +966,7 @@ Object { }, Object { "x": 1601391420000, - "y": 1, + "y": 2, }, Object { "x": 1601391450000, @@ -974,11 +974,11 @@ Object { }, Object { "x": 1601391480000, - "y": 2, + "y": 4, }, Object { "x": 1601391510000, - "y": 6, + "y": 12, }, Object { "x": 1601391540000, @@ -986,7 +986,7 @@ Object { }, Object { "x": 1601391570000, - "y": 1, + "y": 2, }, Object { "x": 1601391600000, @@ -1020,7 +1020,7 @@ Object { }, Object { "x": 1601389950000, - "y": 1, + "y": 2, }, Object { "x": 1601389980000, @@ -1032,7 +1032,7 @@ Object { }, Object { "x": 1601390040000, - "y": 1, + "y": 2, }, Object { "x": 1601390070000, @@ -1048,7 +1048,7 @@ Object { }, Object { "x": 1601390160000, - "y": 2, + "y": 4, }, Object { "x": 1601390190000, @@ -1116,7 +1116,7 @@ Object { }, Object { "x": 1601390670000, - "y": 1, + "y": 2, }, Object { "x": 1601390700000, @@ -1128,7 +1128,7 @@ Object { }, Object { "x": 1601390760000, - "y": 1, + "y": 2, }, Object { "x": 1601390790000, @@ -1250,27 +1250,27 @@ Object { "dataPoints": Array [ Object { "x": 1601389800000, - "y": 4, + "y": 8, }, Object { "x": 1601389830000, - "y": 3, + "y": 6, }, Object { "x": 1601389860000, - "y": 2, + "y": 4, }, Object { "x": 1601389890000, - "y": 2, + "y": 4, }, Object { "x": 1601389920000, - "y": 1, + "y": 2, }, Object { "x": 1601389950000, - "y": 4, + "y": 8, }, Object { "x": 1601389980000, @@ -1278,23 +1278,23 @@ Object { }, Object { "x": 1601390010000, - "y": 3, + "y": 6, }, Object { "x": 1601390040000, - "y": 3, + "y": 6, }, Object { "x": 1601390070000, - "y": 1, + "y": 2, }, Object { "x": 1601390100000, - "y": 2, + "y": 4, }, Object { "x": 1601390130000, - "y": 3, + "y": 6, }, Object { "x": 1601390160000, @@ -1302,15 +1302,15 @@ Object { }, Object { "x": 1601390190000, - "y": 3, + "y": 6, }, Object { "x": 1601390220000, - "y": 2, + "y": 4, }, Object { "x": 1601390250000, - "y": 3, + "y": 6, }, Object { "x": 1601390280000, @@ -1318,15 +1318,15 @@ Object { }, Object { "x": 1601390310000, - "y": 3, + "y": 6, }, Object { "x": 1601390340000, - "y": 3, + "y": 6, }, Object { "x": 1601390370000, - "y": 2, + "y": 4, }, Object { "x": 1601390400000, @@ -1334,159 +1334,159 @@ Object { }, Object { "x": 1601390430000, - "y": 3, + "y": 6, }, Object { "x": 1601390460000, - "y": 1, + "y": 2, }, Object { "x": 1601390490000, - "y": 3, + "y": 6, }, Object { "x": 1601390520000, - "y": 1, + "y": 2, }, Object { "x": 1601390550000, - "y": 2, + "y": 4, }, Object { "x": 1601390580000, - "y": 2, + "y": 4, }, Object { "x": 1601390610000, - "y": 2, + "y": 4, }, Object { "x": 1601390640000, - "y": 1, + "y": 2, }, Object { "x": 1601390670000, - "y": 2, + "y": 4, }, Object { "x": 1601390700000, - "y": 2, + "y": 4, }, Object { "x": 1601390730000, - "y": 3, + "y": 6, }, Object { "x": 1601390760000, - "y": 1, + "y": 2, }, Object { "x": 1601390790000, - "y": 2, + "y": 4, }, Object { "x": 1601390820000, - "y": 3, + "y": 6, }, Object { "x": 1601390850000, - "y": 2, + "y": 4, }, Object { "x": 1601390880000, - "y": 2, + "y": 4, }, Object { "x": 1601390910000, - "y": 4, + "y": 8, }, Object { "x": 1601390940000, - "y": 1, + "y": 2, }, Object { "x": 1601390970000, - "y": 3, + "y": 6, }, Object { "x": 1601391000000, - "y": 1, + "y": 2, }, Object { "x": 1601391030000, - "y": 3, + "y": 6, }, Object { "x": 1601391060000, - "y": 2, + "y": 4, }, Object { "x": 1601391090000, - "y": 3, + "y": 6, }, Object { "x": 1601391120000, - "y": 2, + "y": 4, }, Object { "x": 1601391150000, - "y": 2, + "y": 4, }, Object { "x": 1601391180000, - "y": 1, + "y": 2, }, Object { "x": 1601391210000, - "y": 2, + "y": 4, }, Object { "x": 1601391240000, - "y": 2, + "y": 4, }, Object { "x": 1601391270000, - "y": 2, + "y": 4, }, Object { "x": 1601391300000, - "y": 3, + "y": 6, }, Object { "x": 1601391330000, - "y": 2, + "y": 4, }, Object { "x": 1601391360000, - "y": 2, + "y": 4, }, Object { "x": 1601391390000, - "y": 3, + "y": 6, }, Object { "x": 1601391420000, - "y": 3, + "y": 6, }, Object { "x": 1601391450000, - "y": 2, + "y": 4, }, Object { "x": 1601391480000, - "y": 1, + "y": 2, }, Object { "x": 1601391510000, - "y": 3, + "y": 6, }, Object { "x": 1601391540000, - "y": 1, + "y": 2, }, Object { "x": 1601391570000, - "y": 4, + "y": 8, }, Object { "x": 1601391600000, diff --git a/x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_views.snap b/x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_views.snap new file mode 100644 index 0000000000000..38b009fc73d34 --- /dev/null +++ b/x-pack/test/apm_api_integration/trial/tests/csm/__snapshots__/page_views.snap @@ -0,0 +1,280 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`CSM page views when there is data returns page views 1`] = ` +Object { + "items": Array [ + Object { + "x": 1600149947000, + "y": 1, + }, + Object { + "x": 1600149957000, + "y": 0, + }, + Object { + "x": 1600149967000, + "y": 0, + }, + Object { + "x": 1600149977000, + "y": 0, + }, + Object { + "x": 1600149987000, + "y": 0, + }, + Object { + "x": 1600149997000, + "y": 0, + }, + Object { + "x": 1600150007000, + "y": 0, + }, + Object { + "x": 1600150017000, + "y": 0, + }, + Object { + "x": 1600150027000, + "y": 1, + }, + Object { + "x": 1600150037000, + "y": 0, + }, + Object { + "x": 1600150047000, + "y": 0, + }, + Object { + "x": 1600150057000, + "y": 0, + }, + Object { + "x": 1600150067000, + "y": 0, + }, + Object { + "x": 1600150077000, + "y": 1, + }, + Object { + "x": 1600150087000, + "y": 0, + }, + Object { + "x": 1600150097000, + "y": 0, + }, + Object { + "x": 1600150107000, + "y": 0, + }, + Object { + "x": 1600150117000, + "y": 0, + }, + Object { + "x": 1600150127000, + "y": 0, + }, + Object { + "x": 1600150137000, + "y": 0, + }, + Object { + "x": 1600150147000, + "y": 0, + }, + Object { + "x": 1600150157000, + "y": 0, + }, + Object { + "x": 1600150167000, + "y": 0, + }, + Object { + "x": 1600150177000, + "y": 1, + }, + Object { + "x": 1600150187000, + "y": 0, + }, + Object { + "x": 1600150197000, + "y": 0, + }, + Object { + "x": 1600150207000, + "y": 1, + }, + Object { + "x": 1600150217000, + "y": 0, + }, + Object { + "x": 1600150227000, + "y": 0, + }, + Object { + "x": 1600150237000, + "y": 1, + }, + ], + "topItems": Array [], +} +`; + +exports[`CSM page views when there is data returns page views with breakdown 1`] = ` +Object { + "items": Array [ + Object { + "Chrome": 1, + "x": 1600149947000, + "y": 1, + }, + Object { + "x": 1600149957000, + "y": 0, + }, + Object { + "x": 1600149967000, + "y": 0, + }, + Object { + "x": 1600149977000, + "y": 0, + }, + Object { + "x": 1600149987000, + "y": 0, + }, + Object { + "x": 1600149997000, + "y": 0, + }, + Object { + "x": 1600150007000, + "y": 0, + }, + Object { + "x": 1600150017000, + "y": 0, + }, + Object { + "Chrome": 1, + "x": 1600150027000, + "y": 1, + }, + Object { + "x": 1600150037000, + "y": 0, + }, + Object { + "x": 1600150047000, + "y": 0, + }, + Object { + "x": 1600150057000, + "y": 0, + }, + Object { + "x": 1600150067000, + "y": 0, + }, + Object { + "Chrome": 1, + "x": 1600150077000, + "y": 1, + }, + Object { + "x": 1600150087000, + "y": 0, + }, + Object { + "x": 1600150097000, + "y": 0, + }, + Object { + "x": 1600150107000, + "y": 0, + }, + Object { + "x": 1600150117000, + "y": 0, + }, + Object { + "x": 1600150127000, + "y": 0, + }, + Object { + "x": 1600150137000, + "y": 0, + }, + Object { + "x": 1600150147000, + "y": 0, + }, + Object { + "x": 1600150157000, + "y": 0, + }, + Object { + "x": 1600150167000, + "y": 0, + }, + Object { + "Chrome": 1, + "x": 1600150177000, + "y": 1, + }, + Object { + "x": 1600150187000, + "y": 0, + }, + Object { + "x": 1600150197000, + "y": 0, + }, + Object { + "Chrome Mobile": 1, + "x": 1600150207000, + "y": 1, + }, + Object { + "x": 1600150217000, + "y": 0, + }, + Object { + "x": 1600150227000, + "y": 0, + }, + Object { + "Chrome Mobile": 1, + "x": 1600150237000, + "y": 1, + }, + ], + "topItems": Array [ + "Chrome", + "Chrome Mobile", + ], +} +`; + +exports[`CSM page views when there is no data returns empty list 1`] = ` +Object { + "items": Array [], + "topItems": Array [], +} +`; + +exports[`CSM page views when there is no data returns empty list with breakdowns 1`] = ` +Object { + "items": Array [], + "topItems": Array [], +} +`; From ff0e9e49298c956400ec15bdd39291912a002e15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yulia=20=C4=8Cech?= <6585477+yuliacech@users.noreply.github.com> Date: Mon, 2 Nov 2020 14:30:19 +0100 Subject: [PATCH 04/13] [CCR] Update README.md on how to start 2 clusters for testing (#81487) * Update Cross cluster replication README.md on how to start 2 Elasticsearch clusters for local testing. * Update README.md for an easier CCR local testing setup * Fix the command for a remote cluster Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- x-pack/plugins/cross_cluster_replication/README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/cross_cluster_replication/README.md b/x-pack/plugins/cross_cluster_replication/README.md index 8baccf4f7333e..9c500950c20df 100644 --- a/x-pack/plugins/cross_cluster_replication/README.md +++ b/x-pack/plugins/cross_cluster_replication/README.md @@ -4,11 +4,9 @@ You can run a local cluster and simulate a remote cluster within a single Kibana directory. -1. Run `yarn es snapshot --license=trial` and kill the process once the snapshot has been installed. -2. Duplicate the ES installation by running `cp -aR .es/8.0.0 .es/8.0.0-2`. -3. Start your "local" cluster by running `.es/8.0.0/bin/elasticsearch` and starting Kibana. -4. Start your "remote" cluster by running `.es/8.0.0-2/bin/elasticsearch -E cluster.name=europe -E transport.port=9400`. -5. Index a document into your remote cluster by running `curl -X PUT http://elastic:changeme@localhost:9201/my-leader-index --data '{"settings":{"number_of_shards":1,"soft_deletes.enabled":true}}' --header "Content-Type: application/json"`. +1. Start your "local" cluster by running `yarn es snapshot --license=trial` and `yarn start` to start Kibana. +2. Start your "remote" cluster by running `yarn es snapshot --license=trial -E cluster.name=europe -E transport.port=9400` in a separate terminal tab. +3. Index a document into your remote cluster by running `curl -X PUT http://elastic:changeme@localhost:9201/my-leader-index --data '{"settings":{"number_of_shards":1,"soft_deletes.enabled":true}}' --header "Content-Type: application/json"`. Note that these settings are required for testing auto-follow pattern conflicts errors (see below). Now you can create follower indices and auto-follow patterns to replicate the `my-leader-index` From dbf60afbe474ae1bf1a7d05ad1f9e5f11a677753 Mon Sep 17 00:00:00 2001 From: Mikhail Shustov Date: Mon, 2 Nov 2020 16:59:06 +0300 Subject: [PATCH 05/13] do not stop not started yet hapi server (#82217) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- src/core/server/http/http_server.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/server/http/http_server.ts b/src/core/server/http/http_server.ts index ced728e685f3b..892396b8e2ad7 100644 --- a/src/core/server/http/http_server.ts +++ b/src/core/server/http/http_server.ts @@ -245,8 +245,11 @@ export class HttpServer { return; } - this.log.debug('stopping http server'); - await this.server.stop(); + const hasStarted = this.server.info.started > 0; + if (hasStarted) { + this.log.debug('stopping http server'); + await this.server.stop(); + } } private getAuthOption( From 2653b9069ea2d9457671ddc4f83f7a507c590bdc Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 2 Nov 2020 16:13:44 +0200 Subject: [PATCH 06/13] [TSVB] Handle correctly {{key}} placeholder on series name (#81748) * [TSVB] Handle correctly key placeholder in series name * Add unit test Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- .../application/components/vis_with_splits.js | 4 +- .../server/lib/vis_data/helpers/get_splits.js | 2 +- .../lib/vis_data/helpers/get_splits.test.js | 118 ++++++++++++++++++ 3 files changed, 122 insertions(+), 2 deletions(-) diff --git a/src/plugins/vis_type_timeseries/public/application/components/vis_with_splits.js b/src/plugins/vis_type_timeseries/public/application/components/vis_with_splits.js index ccf486bff5626..f583d087e60ef 100644 --- a/src/plugins/vis_type_timeseries/public/application/components/vis_with_splits.js +++ b/src/plugins/vis_type_timeseries/public/application/components/vis_with_splits.js @@ -46,11 +46,13 @@ export function visWithSplits(WrappedComponent) { }; } + const labelHasKeyPlaceholder = /{{\s*key\s*}}/.test(seriesModel.label); + acc[splitId].series.push({ ...series, id: seriesId, color: series.color || seriesModel.color, - label: seriesModel.label || label, + label: seriesModel.label && !labelHasKeyPlaceholder ? seriesModel.label : label, }); return acc; }, {}); diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.js index 37cc7fd3380d0..6c162e327fb21 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.js @@ -42,7 +42,7 @@ export function getSplits(resp, panel, series, meta) { return buckets.map((bucket) => { bucket.id = `${series.id}:${bucket.key}`; bucket.label = formatKey(bucket.key, series); - bucket.labelFormatted = bucket.key_as_string || ''; + bucket.labelFormatted = bucket.key_as_string ? formatKey(bucket.key_as_string, series) : ''; bucket.color = panel.type === 'top_n' ? color.string() : colors.shift(); bucket.meta = meta; return bucket; diff --git a/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.test.js b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.test.js index 28f056613b082..5ccd61a1c9102 100644 --- a/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.test.js +++ b/src/plugins/vis_type_timeseries/server/lib/vis_data/helpers/get_splits.test.js @@ -108,6 +108,124 @@ describe('getSplits(resp, panel, series)', () => { ]); }); + test('should return a splits for terms group with label formatted by {{key}} placeholder', () => { + const resp = { + aggregations: { + SERIES: { + buckets: [ + { + key: 'example-01', + timeseries: { buckets: [] }, + SIBAGG: { value: 1 }, + }, + { + key: 'example-02', + timeseries: { buckets: [] }, + SIBAGG: { value: 2 }, + }, + ], + meta: { bucketSize: 10 }, + }, + }, + }; + const series = { + id: 'SERIES', + label: '--{{key}}--', + color: '#F00', + split_mode: 'terms', + terms_field: 'beat.hostname', + terms_size: 10, + metrics: [ + { id: 'AVG', type: 'avg', field: 'cpu' }, + { id: 'SIBAGG', type: 'avg_bucket', field: 'AVG' }, + ], + }; + const panel = { type: 'top_n' }; + expect(getSplits(resp, panel, series)).toEqual([ + { + id: 'SERIES:example-01', + key: 'example-01', + label: '--example-01--', + labelFormatted: '', + meta: { bucketSize: 10 }, + color: 'rgb(255, 0, 0)', + timeseries: { buckets: [] }, + SIBAGG: { value: 1 }, + }, + { + id: 'SERIES:example-02', + key: 'example-02', + label: '--example-02--', + labelFormatted: '', + meta: { bucketSize: 10 }, + color: 'rgb(255, 0, 0)', + timeseries: { buckets: [] }, + SIBAGG: { value: 2 }, + }, + ]); + }); + + test('should return a splits for terms group with labelFormatted if {{key}} placeholder is applied and key_as_string exists', () => { + const resp = { + aggregations: { + SERIES: { + buckets: [ + { + key: 'example-01', + key_as_string: 'false', + timeseries: { buckets: [] }, + SIBAGG: { value: 1 }, + }, + { + key: 'example-02', + key_as_string: 'true', + timeseries: { buckets: [] }, + SIBAGG: { value: 2 }, + }, + ], + meta: { bucketSize: 10 }, + }, + }, + }; + const series = { + id: 'SERIES', + label: '--{{key}}--', + color: '#F00', + split_mode: 'terms', + terms_field: 'beat.hostname', + terms_size: 10, + metrics: [ + { id: 'AVG', type: 'avg', field: 'cpu' }, + { id: 'SIBAGG', type: 'avg_bucket', field: 'AVG' }, + ], + }; + const panel = { type: 'top_n' }; + expect(getSplits(resp, panel, series)).toEqual([ + { + id: 'SERIES:example-01', + key: 'example-01', + key_as_string: 'false', + label: '--example-01--', + labelFormatted: '--false--', + meta: { bucketSize: 10 }, + color: 'rgb(255, 0, 0)', + timeseries: { buckets: [] }, + SIBAGG: { value: 1 }, + }, + { + id: 'SERIES:example-02', + key: 'example-02', + key_as_string: 'true', + label: '--example-02--', + labelFormatted: '--true--', + meta: { bucketSize: 10 }, + color: 'rgb(255, 0, 0)', + timeseries: { buckets: [] }, + SIBAGG: { value: 2 }, + }, + ]); + }); + describe('terms group bys', () => { const resp = { aggregations: { From 02a238a1d87cf4646e6f75cb2493c613efcf5dcd Mon Sep 17 00:00:00 2001 From: Matthew Kime Date: Mon, 2 Nov 2020 08:27:31 -0600 Subject: [PATCH 07/13] Export DefaultFormatEditor from IndexPatternManagement (#82236) * export default field format editor --- src/plugins/index_pattern_management/public/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/index_pattern_management/public/index.ts b/src/plugins/index_pattern_management/public/index.ts index 9a0fd39fb4fd9..859b7649a57e4 100644 --- a/src/plugins/index_pattern_management/public/index.ts +++ b/src/plugins/index_pattern_management/public/index.ts @@ -42,4 +42,6 @@ export { IndexPatternListConfig, } from './service'; +export { DefaultFormatEditor } from './components/field_editor/components/field_format_editor'; + export { MlCardState } from './types'; From fb629bd94d4b721e0151736a33f5a2492d4d94d1 Mon Sep 17 00:00:00 2001 From: Pierre Gayvallet Date: Mon, 2 Nov 2020 15:32:00 +0100 Subject: [PATCH 08/13] Fireproof onChange (#82252) --- .../public/components/search_bar.tsx | 38 +++++++++++++------ 1 file changed, 26 insertions(+), 12 deletions(-) diff --git a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx index e73f9d954d5ad..adc55329962e9 100644 --- a/x-pack/plugins/global_search_bar/public/components/search_bar.tsx +++ b/x-pack/plugins/global_search_bar/public/components/search_bar.tsx @@ -159,23 +159,36 @@ export function SearchBar({ } }; - const onChange = (selected: EuiSelectableTemplateSitewideOption[]) => { + const onChange = (selection: EuiSelectableTemplateSitewideOption[]) => { + const selected = selection.find(({ checked }) => checked === 'on'); + if (!selected) { + return; + } + // @ts-ignore - ts error is "union type is too complex to express" - const { url, type, key } = selected.find(({ checked }) => checked === 'on'); + const { url, type } = selected; - if (type === 'application') { - trackUiMetric(METRIC_TYPE.CLICK, [ - 'user_navigated_to_application', - `user_navigated_to_application_${key.toLowerCase().replaceAll(' ', '_')}`, // which application - ]); - } else { - trackUiMetric(METRIC_TYPE.CLICK, [ - 'user_navigated_to_saved_object', - `user_navigated_to_saved_object_${type}`, // which type of saved object - ]); + // errors in tracking should not prevent selection behavior + try { + if (type === 'application') { + const key = selected.keys ?? 'unknown'; + trackUiMetric(METRIC_TYPE.CLICK, [ + 'user_navigated_to_application', + `user_navigated_to_application_${key.toLowerCase().replaceAll(' ', '_')}`, // which application + ]); + } else { + trackUiMetric(METRIC_TYPE.CLICK, [ + 'user_navigated_to_saved_object', + `user_navigated_to_saved_object_${type}`, // which type of saved object + ]); + } + } catch (e) { + // eslint-disable-next-line no-console + console.log('Error trying to track searchbar metrics', e); } navigateToUrl(url); + (document.activeElement as HTMLElement).blur(); if (searchRef) { clearField(searchRef); @@ -218,6 +231,7 @@ export function SearchBar({ onChange={onChange} options={options} popoverButtonBreakpoints={['xs', 's']} + singleSelection={true} popoverButton={ Date: Mon, 2 Nov 2020 16:04:59 +0100 Subject: [PATCH 09/13] [ML] Configure sorting for partition values on Single Metric Viewer (#81510) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [ML] fix callout styles * [ML] refactor timeseriesexplorer.js, add series_controls.tsx, storage support for partition config * [ML] anomalousOnly support * [ML] sort by control * [ML] update query * [ML] sort order controls * [ML] adjust query * [ML] merge default and local configs, add info * [ML] fix types, adjust sorting logic for model plot results * [ML] fix translation keys * [ML] fixed size for the icon flex item * [ML] fix time range condition, refactor * [ML] change info messages and the icon color * Fix model plot info message Co-authored-by: István Zoltán Szabó * [ML] functional tests * [ML] rename ML_ENTITY_FIELDS_CONFIG * [ML] support manual input * [ML] show max record score color indicator * [ML] use :checked selector * [ML] refactor functional tests * [ML] extend config with "applyTimeRange", refactor with entity_config.tsx * [ML] info messages * [ML] remove custom message * [ML] adjust the endpoint * [ML] customOptionText * [ML] sort by name UI tweak * [ML] change text * [ML] remove TODO comment * [ML] fix functional test * [ML] move "Anomalous only"/"Apply time range" control to the bottom of the popover * [ML] update types --- x-pack/plugins/ml/common/types/anomalies.ts | 2 + x-pack/plugins/ml/common/types/storage.ts | 38 +++ .../contexts/kibana/kibana_context.ts | 7 +- .../application/contexts/ml/use_storage.ts | 32 ++ .../services/ml_api_service/results.ts | 13 +- .../results_service/result_service_rx.ts | 6 +- .../_timeseriesexplorer.scss | 19 -- .../entity_control/entity_config.tsx | 227 +++++++++++++ .../entity_control/entity_control.tsx | 94 +++++- .../components/series_controls/index.ts | 7 + .../series_controls/series_controls.tsx | 314 ++++++++++++++++++ .../get_controls_for_detector.ts | 61 ++++ .../timeseriesexplorer/timeseriesexplorer.js | 232 ++----------- .../get_partition_fields_values.ts | 172 +++++++--- .../ml/server/routes/results_service.ts | 11 +- .../routes/schemas/results_service_schema.ts | 23 +- .../apps/ml/anomaly_detection/annotations.ts | 2 +- .../anomaly_detection/single_metric_viewer.ts | 183 ++++++++-- .../apps/ml/permissions/full_ml_access.ts | 6 +- .../apps/ml/permissions/read_ml_access.ts | 6 +- .../test/functional/services/ml/common_ui.ts | 18 + x-pack/test/functional/services/ml/index.ts | 2 +- .../services/ml/single_metric_viewer.ts | 78 ++++- 23 files changed, 1210 insertions(+), 343 deletions(-) create mode 100644 x-pack/plugins/ml/common/types/storage.ts create mode 100644 x-pack/plugins/ml/public/application/contexts/ml/use_storage.ts create mode 100644 x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx create mode 100644 x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/index.ts create mode 100644 x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx create mode 100644 x-pack/plugins/ml/public/application/timeseriesexplorer/get_controls_for_detector.ts diff --git a/x-pack/plugins/ml/common/types/anomalies.ts b/x-pack/plugins/ml/common/types/anomalies.ts index 703d74d1bd5e5..7182c8c47f981 100644 --- a/x-pack/plugins/ml/common/types/anomalies.ts +++ b/x-pack/plugins/ml/common/types/anomalies.ts @@ -74,3 +74,5 @@ export interface AnomalyCategorizerStatsDoc { log_time: number; timestamp: number; } + +export type EntityFieldType = 'partition_field' | 'over_field' | 'by_field'; diff --git a/x-pack/plugins/ml/common/types/storage.ts b/x-pack/plugins/ml/common/types/storage.ts new file mode 100644 index 0000000000000..885288b9389e1 --- /dev/null +++ b/x-pack/plugins/ml/common/types/storage.ts @@ -0,0 +1,38 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { EntityFieldType } from './anomalies'; + +export const ML_ENTITY_FIELDS_CONFIG = 'ml.singleMetricViewer.partitionFields'; + +export type PartitionFieldConfig = + | { + /** + * Relevant for jobs with enabled model plot. + * If true, entity values are based on records with anomalies. + * Otherwise aggregated from the model plot results. + */ + anomalousOnly: boolean; + /** + * Relevant for jobs with disabled model plot. + * If true, entity values are filtered by the active time range. + * If false, the lists consist of the values from all existing records. + */ + applyTimeRange: boolean; + sort: { + by: 'anomaly_score' | 'name'; + order: 'asc' | 'desc'; + }; + } + | undefined; + +export type PartitionFieldsConfig = + | Partial> + | undefined; + +export type MlStorage = Partial<{ + [ML_ENTITY_FIELDS_CONFIG]: PartitionFieldsConfig; +}> | null; diff --git a/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts b/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts index f631361d06584..4a7550788db56 100644 --- a/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts +++ b/x-pack/plugins/ml/public/application/contexts/kibana/kibana_context.ts @@ -14,6 +14,7 @@ import { SecurityPluginSetup } from '../../../../../security/public'; import { LicenseManagementUIPluginSetup } from '../../../../../license_management/public'; import { SharePluginStart } from '../../../../../../../src/plugins/share/public'; import { MlServicesContext } from '../../app'; +import { IStorageWrapper } from '../../../../../../../src/plugins/kibana_utils/public'; interface StartPlugins { data: DataPublicPluginStart; @@ -22,6 +23,10 @@ interface StartPlugins { share: SharePluginStart; } export type StartServices = CoreStart & - StartPlugins & { appName: string; kibanaVersion: string } & MlServicesContext; + StartPlugins & { + appName: string; + kibanaVersion: string; + storage: IStorageWrapper; + } & MlServicesContext; export const useMlKibana = () => useKibana(); export type MlKibanaReactContextValue = KibanaReactContextValue; diff --git a/x-pack/plugins/ml/public/application/contexts/ml/use_storage.ts b/x-pack/plugins/ml/public/application/contexts/ml/use_storage.ts new file mode 100644 index 0000000000000..87aa6011e6be1 --- /dev/null +++ b/x-pack/plugins/ml/public/application/contexts/ml/use_storage.ts @@ -0,0 +1,32 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { useCallback, useState } from 'react'; +import { useMlKibana } from '../kibana'; + +/** + * Hook for accessing and changing a value in the storage. + * @param key - Storage key + * @param initValue + */ +export function useStorage(key: string, initValue?: T): [T, (value: T) => void] { + const { + services: { storage }, + } = useMlKibana(); + + const [val, setVal] = useState(storage.get(key) ?? initValue); + + const setStorage = useCallback((value: T): void => { + try { + storage.set(key, value); + setVal(value); + } catch (e) { + throw new Error('Unable to update storage with provided value'); + } + }, []); + + return [val, setStorage]; +} diff --git a/x-pack/plugins/ml/public/application/services/ml_api_service/results.ts b/x-pack/plugins/ml/public/application/services/ml_api_service/results.ts index 65bd4fb1eccc2..d98060114b066 100644 --- a/x-pack/plugins/ml/public/application/services/ml_api_service/results.ts +++ b/x-pack/plugins/ml/public/application/services/ml_api_service/results.ts @@ -11,6 +11,7 @@ import { basePath } from './index'; import { JobId } from '../../../../common/types/anomaly_detection_jobs'; import { JOB_ID, PARTITION_FIELD_VALUE } from '../../../../common/constants/anomalies'; import { PartitionFieldsDefinition } from '../results_service/result_service_rx'; +import { PartitionFieldsConfig } from '../../../../common/types/storage'; export const resultsApiProvider = (httpService: HttpService) => ({ getAnomaliesTableData( @@ -87,9 +88,17 @@ export const resultsApiProvider = (httpService: HttpService) => ({ searchTerm: Record, criteriaFields: Array<{ fieldName: string; fieldValue: any }>, earliestMs: number, - latestMs: number + latestMs: number, + fieldsConfig?: PartitionFieldsConfig ) { - const body = JSON.stringify({ jobId, searchTerm, criteriaFields, earliestMs, latestMs }); + const body = JSON.stringify({ + jobId, + searchTerm, + criteriaFields, + earliestMs, + latestMs, + fieldsConfig, + }); return httpService.http$({ path: `${basePath()}/results/partition_fields_values`, method: 'POST', diff --git a/x-pack/plugins/ml/public/application/services/results_service/result_service_rx.ts b/x-pack/plugins/ml/public/application/services/results_service/result_service_rx.ts index e1c322910e237..4df47d76a81dc 100644 --- a/x-pack/plugins/ml/public/application/services/results_service/result_service_rx.ts +++ b/x-pack/plugins/ml/public/application/services/results_service/result_service_rx.ts @@ -31,13 +31,13 @@ export interface MetricData extends ResultResponse { export interface FieldDefinition { /** - * Partition field name. + * Field name. */ name: string | number; /** - * Partitions field distinct values. + * Field distinct values. */ - values: any[]; + values: Array<{ value: any; maxRecordScore?: number }>; } type FieldTypes = 'partition_field' | 'over_field' | 'by_field'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/_timeseriesexplorer.scss b/x-pack/plugins/ml/public/application/timeseriesexplorer/_timeseriesexplorer.scss index 45678f6e71c2e..5ea4e8bd7ffbd 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/_timeseriesexplorer.scss +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/_timeseriesexplorer.scss @@ -37,25 +37,6 @@ } } - .series-controls { - div.entity-controls { - display: inline-block; - padding-left: $euiSize; - - input.entity-input-blank { - border-color: $euiColorDanger; - } - - .entity-input { - width: 300px; - } - } - - button { - margin-left: $euiSizeXS; - } - } - .forecast-controls { float: right; } diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx new file mode 100644 index 0000000000000..4c2e277ae9138 --- /dev/null +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_config.tsx @@ -0,0 +1,227 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { FC, useMemo, useState } from 'react'; +import { + EuiButtonIcon, + EuiFlexGroup, + EuiFlexItem, + EuiFormRow, + EuiHorizontalRule, + EuiIcon, + EuiPopover, + EuiRadioGroup, + EuiRadioGroupOption, + EuiSwitch, + EuiToolTip, +} from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { Entity } from './entity_control'; +import { UiPartitionFieldConfig } from '../series_controls/series_controls'; +import { EntityFieldType } from '../../../../../common/types/anomalies'; + +interface EntityConfigProps { + entity: Entity; + isModelPlotEnabled: boolean; + config: UiPartitionFieldConfig; + onConfigChange: (fieldType: EntityFieldType, config: Partial) => void; +} + +export const EntityConfig: FC = ({ + entity, + isModelPlotEnabled, + config, + onConfigChange, +}) => { + const [isEntityConfigPopoverOpen, setIsEntityConfigPopoverOpen] = useState(false); + + const forceSortByName = isModelPlotEnabled && !config?.anomalousOnly; + + const sortOptions: EuiRadioGroupOption[] = useMemo(() => { + return [ + { + id: 'anomaly_score', + label: i18n.translate('xpack.ml.timeSeriesExplorer.sortByScoreLabel', { + defaultMessage: 'Anomaly score', + }), + disabled: forceSortByName, + }, + { + id: 'name', + label: i18n.translate('xpack.ml.timeSeriesExplorer.sortByNameLabel', { + defaultMessage: 'Name', + }), + }, + ]; + }, [isModelPlotEnabled, config]); + + const orderOptions: EuiRadioGroupOption[] = useMemo(() => { + return [ + { + id: 'asc', + label: i18n.translate('xpack.ml.timeSeriesExplorer.ascOptionsOrderLabel', { + defaultMessage: 'asc', + }), + }, + { + id: 'desc', + label: i18n.translate('xpack.ml.timeSeriesExplorer.descOptionsOrderLabel', { + defaultMessage: 'desc', + }), + }, + ]; + }, []); + + return ( + { + setIsEntityConfigPopoverOpen(!isEntityConfigPopoverOpen); + }} + data-test-subj={`mlSingleMetricViewerEntitySelectionConfigButton_${entity.fieldName}`} + /> + } + isOpen={isEntityConfigPopoverOpen} + closePopover={() => { + setIsEntityConfigPopoverOpen(false); + }} + > +

+ + } + > + { + onConfigChange(entity.fieldType, { + sort: { + order: config.sort.order, + by: id as UiPartitionFieldConfig['sort']['by'], + }, + }); + }} + compressed + data-test-subj={`mlSingleMetricViewerEntitySelectionConfigSortBy_${entity.fieldName}`} + /> + + + } + > + { + onConfigChange(entity.fieldType, { + sort: { + by: config.sort.by, + order: id as UiPartitionFieldConfig['sort']['order'], + }, + }); + }} + compressed + data-test-subj={`mlSingleMetricViewerEntitySelectionConfigOrder_${entity.fieldName}`} + /> + + + + + + + {isModelPlotEnabled ? ( + + } + checked={config.anomalousOnly} + onChange={(e) => { + const isAnomalousOnly = e.target.checked; + onConfigChange(entity.fieldType, { + anomalousOnly: isAnomalousOnly, + sort: { + order: config.sort.order, + by: config.sort.by, + }, + }); + }} + compressed + data-test-subj={`mlSingleMetricViewerEntitySelectionConfigAnomalousOnly_${entity.fieldName}`} + /> + ) : ( + + } + checked={config.applyTimeRange} + onChange={(e) => { + const applyTimeRange = e.target.checked; + onConfigChange(entity.fieldType, { + applyTimeRange, + }); + }} + compressed + data-test-subj={`mlSingleMetricViewerEntitySelectionConfigAnomalousOnly_${entity.fieldName}`} + /> + )} + + + + {isModelPlotEnabled && !config?.anomalousOnly ? ( + + } + > + + + ) : null} + + {!isModelPlotEnabled && !config?.applyTimeRange ? ( + + } + > + + + ) : null} + + +
+ + ); +}; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_control.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_control.tsx index e1323019d61db..c16b55ec256ce 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_control.tsx +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/entity_control/entity_control.tsx @@ -9,27 +9,55 @@ import React, { Component } from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { EuiComboBox, EuiComboBoxOptionOption, EuiFlexItem, EuiFormRow } from '@elastic/eui'; +import { + EuiComboBox, + EuiComboBoxOptionOption, + EuiFlexItem, + EuiFormRow, + EuiHealth, + EuiHighlight, +} from '@elastic/eui'; +import { EntityFieldType } from '../../../../../common/types/anomalies'; +import { UiPartitionFieldConfig } from '../series_controls/series_controls'; +import { getSeverityColor } from '../../../../../common'; +import { EntityConfig } from './entity_config'; export interface Entity { fieldName: string; + fieldType: EntityFieldType; fieldValue: any; - fieldValues: any; + fieldValues?: any; } -interface EntityControlProps { +/** + * Configuration for entity field dropdown options + */ +export interface FieldConfig { + isAnomalousOnly: boolean; +} + +export type ComboBoxOption = EuiComboBoxOptionOption<{ + value: string | number; + maxRecordScore?: number; +}>; + +export interface EntityControlProps { entity: Entity; - entityFieldValueChanged: (entity: Entity, fieldValue: any) => void; + entityFieldValueChanged: (entity: Entity, fieldValue: string | number | null) => void; isLoading: boolean; onSearchChange: (entity: Entity, queryTerm: string) => void; + config: UiPartitionFieldConfig; + onConfigChange: (fieldType: EntityFieldType, config: Partial) => void; forceSelection: boolean; - options: Array>; + options: ComboBoxOption[]; + isModelPlotEnabled: boolean; } interface EntityControlState { - selectedOptions: Array> | undefined; + selectedOptions: ComboBoxOption[] | undefined; isLoading: boolean; - options: Array> | undefined; + options: ComboBoxOption[] | undefined; + isEntityConfigPopoverOpen: boolean; } export const EMPTY_FIELD_VALUE_LABEL = i18n.translate( @@ -46,6 +74,7 @@ export class EntityControl extends Component> | undefined = selectedOptions; + let selectedOptionsUpdate: ComboBoxOption[] | undefined = selectedOptions; if ( (selectedOptions === undefined && fieldValue !== null) || (Array.isArray(selectedOptions) && @@ -87,17 +116,36 @@ export class EntityControl extends Component>) => { + onChange = (selectedOptions: ComboBoxOption[]) => { const options = selectedOptions.length > 0 ? selectedOptions : undefined; this.setState({ selectedOptions: options, }); const fieldValue = - Array.isArray(options) && options[0].value !== null ? options[0].value : null; + Array.isArray(options) && options[0].value?.value !== null + ? options[0].value?.value ?? null + : null; this.props.entityFieldValueChanged(this.props.entity, fieldValue); }; + onManualInput = (inputValue: string) => { + const normalizedSearchValue = inputValue.trim().toLowerCase(); + if (!normalizedSearchValue) { + return; + } + const manualInputValue: ComboBoxOption = { + label: inputValue, + value: { + value: inputValue, + }, + }; + this.setState({ + selectedOptions: [manualInputValue], + }); + this.props.entityFieldValueChanged(this.props.entity, inputValue); + }; + onSearchChange = (searchValue: string) => { this.setState({ isLoading: true, @@ -106,13 +154,19 @@ export class EntityControl extends Component { - const { label } = option; - return label === EMPTY_FIELD_VALUE_LABEL ? {label} : label; + renderOption = (option: ComboBoxOption, searchValue: string) => { + const highlightedLabel = {option.label}; + return option.value?.maxRecordScore ? ( + + {highlightedLabel} + + ) : ( + highlightedLabel + ); }; render() { - const { entity, forceSelection } = this.props; + const { entity, forceSelection, isModelPlotEnabled, config, onConfigChange } = this.props; const { isLoading, options, selectedOptions } = this.state; const control = ( @@ -129,6 +183,10 @@ export class EntityControl extends Component + } /> ); diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/index.ts b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/index.ts new file mode 100644 index 0000000000000..a60b60fc83911 --- /dev/null +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/index.ts @@ -0,0 +1,7 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +export { SeriesControls } from './series_controls'; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx new file mode 100644 index 0000000000000..55c7bcbef68be --- /dev/null +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/components/series_controls/series_controls.tsx @@ -0,0 +1,314 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import React, { FC, useCallback, useEffect, useMemo, useState } from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; +import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiSelect, EuiSelectProps } from '@elastic/eui'; +import { debounce } from 'lodash'; +import { EntityControl } from '../entity_control'; +import { mlJobService } from '../../../services/job_service'; +import { Detector, JobId } from '../../../../../common/types/anomaly_detection_jobs'; +import { useMlKibana } from '../../../contexts/kibana'; +import { APP_STATE_ACTION } from '../../timeseriesexplorer_constants'; +import { + ComboBoxOption, + EMPTY_FIELD_VALUE_LABEL, + EntityControlProps, +} from '../entity_control/entity_control'; +import { getControlsForDetector } from '../../get_controls_for_detector'; +// @ts-ignore +import { getViewableDetectors } from '../../timeseriesexplorer'; +import { + ML_ENTITY_FIELDS_CONFIG, + PartitionFieldConfig, + PartitionFieldsConfig, +} from '../../../../../common/types/storage'; +import { useStorage } from '../../../contexts/ml/use_storage'; +import { EntityFieldType } from '../../../../../common/types/anomalies'; +import { FieldDefinition } from '../../../services/results_service/result_service_rx'; + +function getEntityControlOptions(fieldValues: FieldDefinition['values']): ComboBoxOption[] { + if (!Array.isArray(fieldValues)) { + return []; + } + + return fieldValues.map((value) => { + return { label: value.value === '' ? EMPTY_FIELD_VALUE_LABEL : value.value, value }; + }); +} + +export type UiPartitionFieldsConfig = Exclude; + +export type UiPartitionFieldConfig = Exclude; + +/** + * Provides default fields configuration. + */ +const getDefaultFieldConfig = ( + fieldTypes: EntityFieldType[], + isAnomalousOnly: boolean, + applyTimeRange: boolean +): UiPartitionFieldsConfig => { + return fieldTypes.reduce((acc, f) => { + acc[f] = { + applyTimeRange, + anomalousOnly: isAnomalousOnly, + sort: { by: 'anomaly_score', order: 'desc' }, + }; + return acc; + }, {} as UiPartitionFieldsConfig); +}; + +interface SeriesControlsProps { + selectedDetectorIndex: any; + selectedJobId: JobId; + bounds: any; + appStateHandler: Function; + selectedEntities: Record; +} + +/** + * Component for handling the detector and entities controls. + */ +export const SeriesControls: FC = ({ + bounds, + selectedDetectorIndex, + selectedJobId, + appStateHandler, + children, + selectedEntities, +}) => { + const { + services: { + mlServices: { + mlApiServices: { results: mlResultsService }, + }, + }, + } = useMlKibana(); + + const selectedJob = useMemo(() => mlJobService.getJob(selectedJobId), [selectedJobId]); + + const isModelPlotEnabled = !!selectedJob.model_plot_config?.enabled; + + const [entitiesLoading, setEntitiesLoading] = useState(false); + const [entityValues, setEntityValues] = useState>({}); + + const detectors: Array<{ + index: number; + detector_description: Detector['detector_description']; + }> = useMemo(() => { + return getViewableDetectors(selectedJob); + }, [selectedJob]); + + const entityControls = useMemo(() => { + return getControlsForDetector(selectedDetectorIndex, selectedEntities, selectedJobId); + }, [selectedDetectorIndex, selectedEntities, selectedJobId]); + + const [storageFieldsConfig, setStorageFieldsConfig] = useStorage( + ML_ENTITY_FIELDS_CONFIG + ); + + // Merge the default config with the one from the local storage + const resultFieldsConfig = useMemo(() => { + return { + ...getDefaultFieldConfig( + entityControls.map((v) => v.fieldType), + !storageFieldsConfig + ? true + : Object.values(storageFieldsConfig).some((v) => !!v?.anomalousOnly), + !storageFieldsConfig + ? true + : Object.values(storageFieldsConfig).some((v) => !!v?.applyTimeRange) + ), + ...(!storageFieldsConfig ? {} : storageFieldsConfig), + }; + }, [entityControls, storageFieldsConfig]); + + /** + * Loads available entity values. + * @param {Object} searchTerm - Search term for partition, e.g. { partition_field: 'partition' } + */ + const loadEntityValues = async (searchTerm = {}) => { + setEntitiesLoading(true); + + // Populate the entity input data lists with the values from the top records by score + // for the selected detector across the full time range. No need to pass through finish(). + const detectorIndex = selectedDetectorIndex; + + const fieldsConfig = resultFieldsConfig + ? Object.fromEntries( + Object.entries(resultFieldsConfig).filter(([k]) => + entityControls.some((v) => v.fieldType === k) + ) + ) + : undefined; + + const { + partition_field: partitionField, + over_field: overField, + by_field: byField, + } = await mlResultsService + .fetchPartitionFieldsValues( + selectedJob.job_id, + searchTerm, + [ + { + fieldName: 'detector_index', + fieldValue: detectorIndex, + }, + ], + bounds.min.valueOf(), + bounds.max.valueOf(), + fieldsConfig + ) + .toPromise(); + + const entityValuesUpdate: Record = {}; + entityControls.forEach((entity) => { + let fieldValues; + + if (partitionField?.name === entity.fieldName) { + fieldValues = partitionField.values; + } + if (overField?.name === entity.fieldName) { + fieldValues = overField.values; + } + if (byField?.name === entity.fieldName) { + fieldValues = byField.values; + } + entityValuesUpdate[entity.fieldName] = fieldValues; + }); + + setEntitiesLoading(false); + setEntityValues(entityValuesUpdate); + }; + + useEffect(() => { + loadEntityValues(); + }, [selectedJobId, selectedDetectorIndex, JSON.stringify(selectedEntities), resultFieldsConfig]); + + const entityFieldSearchChanged = debounce(async (entity, queryTerm) => { + await loadEntityValues({ + [entity.fieldType]: queryTerm, + }); + }, 500); + + const entityFieldValueChanged: EntityControlProps['entityFieldValueChanged'] = ( + entity, + fieldValue + ) => { + const resultEntities = { + ...entityControls.reduce((appStateEntities, appStateEntity) => { + appStateEntities[appStateEntity.fieldName] = appStateEntity.fieldValue; + return appStateEntities; + }, {} as Record), + [entity.fieldName]: fieldValue, + }; + + appStateHandler(APP_STATE_ACTION.SET_ENTITIES, resultEntities); + }; + + const detectorIndexChangeHandler: EuiSelectProps['onChange'] = useCallback( + (e) => { + const id = e.target.value; + if (id !== undefined) { + appStateHandler(APP_STATE_ACTION.SET_DETECTOR_INDEX, +id); + } + }, + [appStateHandler] + ); + + const detectorSelectOptions = detectors.map((d) => ({ + value: d.index, + text: d.detector_description, + })); + + const onFieldConfigChange: EntityControlProps['onConfigChange'] = useCallback( + (fieldType, config) => { + const updatedFieldConfig = { + ...(resultFieldsConfig[fieldType] ? resultFieldsConfig[fieldType] : {}), + ...config, + } as UiPartitionFieldConfig; + + const updatedResultConfig = { ...resultFieldsConfig }; + + if (resultFieldsConfig[fieldType]?.anomalousOnly !== updatedFieldConfig.anomalousOnly) { + // In case anomalous selector has been changed + // we need to change it for all the other fields + for (const c in updatedResultConfig) { + if (updatedResultConfig.hasOwnProperty(c)) { + updatedResultConfig[c as EntityFieldType]!.anomalousOnly = + updatedFieldConfig.anomalousOnly; + } + } + } + + if (resultFieldsConfig[fieldType]?.applyTimeRange !== updatedFieldConfig.applyTimeRange) { + // In case time range selector has been changed + // we need to change it for all the other fields + for (const c in updatedResultConfig) { + if (updatedResultConfig.hasOwnProperty(c)) { + updatedResultConfig[c as EntityFieldType]!.applyTimeRange = + updatedFieldConfig.applyTimeRange; + } + } + } + + setStorageFieldsConfig({ + ...updatedResultConfig, + [fieldType]: updatedFieldConfig, + }); + }, + [resultFieldsConfig, setStorageFieldsConfig] + ); + + /** Indicates if any of the previous controls is empty */ + let hasEmptyFieldValues = false; + + return ( +
+ + + + } + > + + + + {entityControls.map((entity) => { + const entityKey = `${entity.fieldName}`; + const forceSelection = !hasEmptyFieldValues && entity.fieldValue === null; + hasEmptyFieldValues = !hasEmptyFieldValues && forceSelection; + return ( + + ); + })} + {children} + +
+ ); +}; diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/get_controls_for_detector.ts b/x-pack/plugins/ml/public/application/timeseriesexplorer/get_controls_for_detector.ts new file mode 100644 index 0000000000000..1461faf335db2 --- /dev/null +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/get_controls_for_detector.ts @@ -0,0 +1,61 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License; + * you may not use this file except in compliance with the Elastic License. + */ + +import { mlJobService } from '../services/job_service'; +import { Entity } from './components/entity_control/entity_control'; +import { JobId } from '../../../common/types/anomaly_detection_jobs'; + +/** + * Extracts entities from the detector configuration + */ +export function getControlsForDetector( + selectedDetectorIndex: number, + selectedEntities: Record, + selectedJobId: JobId +) { + const selectedJob = mlJobService.getJob(selectedJobId); + + const entities: Entity[] = []; + + if (selectedJob === undefined) { + return entities; + } + + // Update the entity dropdown control(s) according to the partitioning fields for the selected detector. + const detectorIndex = selectedDetectorIndex; + const detector = selectedJob.analysis_config.detectors[detectorIndex]; + + const entitiesState = selectedEntities; + const partitionFieldName = detector?.partition_field_name; + const overFieldName = detector?.over_field_name; + const byFieldName = detector?.by_field_name; + if (partitionFieldName !== undefined) { + const partitionFieldValue = entitiesState?.[partitionFieldName] ?? null; + entities.push({ + fieldType: 'partition_field', + fieldName: partitionFieldName, + fieldValue: partitionFieldValue, + }); + } + if (overFieldName !== undefined) { + const overFieldValue = entitiesState?.[overFieldName] ?? null; + entities.push({ + fieldType: 'over_field', + fieldName: overFieldName, + fieldValue: overFieldValue, + }); + } + + // For jobs with by and over fields, don't add the 'by' field as this + // field will only be added to the top-level fields for record type results + // if it also an influencer over the bucket. + if (byFieldName !== undefined && overFieldName === undefined) { + const byFieldValue = entitiesState?.[byFieldName] ?? null; + entities.push({ fieldType: 'by_field', fieldName: byFieldName, fieldValue: byFieldValue }); + } + + return entities; +} diff --git a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js index 3c48f7288aa42..5e452dab2f883 100644 --- a/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js +++ b/x-pack/plugins/ml/public/application/timeseriesexplorer/timeseriesexplorer.js @@ -8,7 +8,7 @@ * React component for rendering Single Metric Viewer. */ -import { debounce, each, find, get, has, isEqual } from 'lodash'; +import { each, find, get, has, isEqual } from 'lodash'; import moment from 'moment-timezone'; import { Subject, Subscription, forkJoin } from 'rxjs'; import { map, debounceTime, switchMap, tap, withLatestFrom } from 'rxjs/operators'; @@ -25,7 +25,6 @@ import { EuiFlexGroup, EuiFlexItem, EuiFormRow, - EuiSelect, EuiSpacer, EuiPanel, EuiTitle, @@ -49,7 +48,6 @@ import { AnnotationFlyout } from '../components/annotations/annotation_flyout'; import { AnnotationsTable } from '../components/annotations/annotations_table'; import { AnomaliesTable } from '../components/anomalies_table/anomalies_table'; import { MlTooltipComponent } from '../components/chart_tooltip'; -import { EntityControl } from './components/entity_control'; import { ForecastingModal } from './components/forecasting_modal/forecasting_modal'; import { LoadingIndicator } from '../components/loading_indicator/loading_indicator'; import { SelectInterval } from '../components/controls/select_interval/select_interval'; @@ -82,8 +80,9 @@ import { processRecordScoreResults, getFocusData, } from './timeseriesexplorer_utils'; -import { EMPTY_FIELD_VALUE_LABEL } from './components/entity_control/entity_control'; import { ANOMALY_DETECTION_DEFAULT_TIME_RANGE } from '../../../common/constants/settings'; +import { getControlsForDetector } from './get_controls_for_detector'; +import { SeriesControls } from './components/series_controls'; // Used to indicate the chart is being plotted across // all partition field values, where the cardinality of the field cannot be @@ -92,19 +91,7 @@ const allValuesLabel = i18n.translate('xpack.ml.timeSeriesExplorer.allPartitionV defaultMessage: 'all', }); -function getEntityControlOptions(fieldValues) { - if (!Array.isArray(fieldValues)) { - return []; - } - - fieldValues.sort(); - - return fieldValues.map((value) => { - return { label: value === '' ? EMPTY_FIELD_VALUE_LABEL : value, value }; - }); -} - -function getViewableDetectors(selectedJob) { +export function getViewableDetectors(selectedJob) { const jobDetectors = selectedJob.analysis_config.detectors; const viewableDetectors = []; each(jobDetectors, (dtr, index) => { @@ -212,14 +199,6 @@ export class TimeSeriesExplorer extends React.Component { return fieldNamesWithEmptyValues.length === 0; }; - detectorIndexChangeHandler = (e) => { - const { appStateHandler } = this.props; - const id = e.target.value; - if (id !== undefined) { - appStateHandler(APP_STATE_ACTION.SET_DETECTOR_INDEX, +id); - } - }; - toggleShowAnnotationsHandler = () => { this.setState((prevState) => ({ showAnnotations: !prevState.showAnnotations, @@ -335,28 +314,6 @@ export class TimeSeriesExplorer extends React.Component { this.props.appStateHandler(APP_STATE_ACTION.SET_ZOOM, zoomState); }; - entityFieldValueChanged = (entity, fieldValue) => { - const { appStateHandler } = this.props; - const entityControls = this.getControlsForDetector(); - - const resultEntities = { - ...entityControls.reduce((appStateEntities, appStateEntity) => { - appStateEntities[appStateEntity.fieldName] = appStateEntity.fieldValue; - return appStateEntities; - }, {}), - [entity.fieldName]: fieldValue, - }; - - appStateHandler(APP_STATE_ACTION.SET_ENTITIES, resultEntities); - }; - - entityFieldSearchChanged = debounce((entity, queryTerm) => { - const entityControls = this.getControlsForDetector(); - this.loadEntityValues(entityControls, { - [entity.fieldType]: queryTerm, - }); - }, 500); - loadAnomaliesTableData = (earliestMs, latestMs) => { const { dateFormatTz, @@ -421,59 +378,6 @@ export class TimeSeriesExplorer extends React.Component { ); }; - /** - * Loads available entity values. - * @param {Array} entities - Entity controls configuration - * @param {Object} searchTerm - Search term for partition, e.g. { partition_field: 'partition' } - */ - loadEntityValues = async (entities, searchTerm = {}) => { - this.setState({ entitiesLoading: true }); - - const { bounds, selectedJobId, selectedDetectorIndex } = this.props; - const selectedJob = mlJobService.getJob(selectedJobId); - - // Populate the entity input datalists with the values from the top records by score - // for the selected detector across the full time range. No need to pass through finish(). - const detectorIndex = selectedDetectorIndex; - - const { - partition_field: partitionField, - over_field: overField, - by_field: byField, - } = await mlResultsService - .fetchPartitionFieldsValues( - selectedJob.job_id, - searchTerm, - [ - { - fieldName: 'detector_index', - fieldValue: detectorIndex, - }, - ], - bounds.min.valueOf(), - bounds.max.valueOf() - ) - .toPromise(); - - const entityValues = {}; - entities.forEach((entity) => { - let fieldValues; - - if (partitionField?.name === entity.fieldName) { - fieldValues = partitionField.values; - } - if (overField?.name === entity.fieldName) { - fieldValues = overField.values; - } - if (byField?.name === entity.fieldName) { - fieldValues = byField.values; - } - entityValues[entity.fieldName] = fieldValues; - }); - - this.setState({ entitiesLoading: false, entityValues }); - }; - setForecastId = (forecastId) => { this.props.appStateHandler(APP_STATE_ACTION.SET_FORECAST_ID, forecastId); }; @@ -728,50 +632,7 @@ export class TimeSeriesExplorer extends React.Component { */ getControlsForDetector = () => { const { selectedDetectorIndex, selectedEntities, selectedJobId } = this.props; - const selectedJob = mlJobService.getJob(selectedJobId); - - const entities = []; - - if (selectedJob === undefined) { - return entities; - } - - // Update the entity dropdown control(s) according to the partitioning fields for the selected detector. - const detectorIndex = selectedDetectorIndex; - const detector = selectedJob.analysis_config.detectors[detectorIndex]; - - const entitiesState = selectedEntities; - const partitionFieldName = get(detector, 'partition_field_name'); - const overFieldName = get(detector, 'over_field_name'); - const byFieldName = get(detector, 'by_field_name'); - if (partitionFieldName !== undefined) { - const partitionFieldValue = get(entitiesState, partitionFieldName, null); - entities.push({ - fieldType: 'partition_field', - fieldName: partitionFieldName, - fieldValue: partitionFieldValue, - }); - } - if (overFieldName !== undefined) { - const overFieldValue = get(entitiesState, overFieldName, null); - entities.push({ - fieldType: 'over_field', - fieldName: overFieldName, - fieldValue: overFieldValue, - }); - } - - // For jobs with by and over fields, don't add the 'by' field as this - // field will only be added to the top-level fields for record type results - // if it also an influencer over the bucket. - // TODO - metric data can be filtered by this field, so should only exclude - // from filter for the anomaly records. - if (byFieldName !== undefined && overFieldName === undefined) { - const byFieldValue = get(entitiesState, byFieldName, null); - entities.push({ fieldType: 'by_field', fieldName: byFieldName, fieldValue: byFieldValue }); - } - - return entities; + return getControlsForDetector(selectedDetectorIndex, selectedEntities, selectedJobId); }; /** @@ -957,16 +818,6 @@ export class TimeSeriesExplorer extends React.Component { }); } - if ( - previousProps === undefined || - previousProps.selectedJobId !== this.props.selectedJobId || - previousProps.selectedDetectorIndex !== this.props.selectedDetectorIndex || - !isEqual(previousProps.selectedEntities, this.props.selectedEntities) - ) { - const entityControls = this.getControlsForDetector(); - this.loadEntityValues(entityControls); - } - if ( previousProps === undefined || previousProps.selectedForecastId !== this.props.selectedForecastId @@ -1044,7 +895,6 @@ export class TimeSeriesExplorer extends React.Component { contextChartData, contextForecastData, dataNotChartable, - entityValues, focusAggregationInterval, focusAnnotationError, focusAnnotationData, @@ -1100,10 +950,6 @@ export class TimeSeriesExplorer extends React.Component { const fieldNamesWithEmptyValues = this.getFieldNamesWithEmptyValues(); const arePartitioningFieldsProvided = this.arePartitioningFieldsProvided(); const detectors = getViewableDetectors(selectedJob); - const detectorSelectOptions = detectors.map((d) => ({ - value: d.index, - text: d.detector_description, - })); let renderFocusChartOnly = true; @@ -1124,12 +970,6 @@ export class TimeSeriesExplorer extends React.Component { this.previousShowForecast = showForecast; this.previousShowModelBounds = showModelBounds; - /** - * Indicates if any of the previous controls is empty. - * @type {boolean} - */ - let hasEmptyFieldValues = false; - return ( {fieldNamesWithEmptyValues.length > 0 && ( @@ -1154,53 +994,27 @@ export class TimeSeriesExplorer extends React.Component { )} -
- - - - + {arePartitioningFieldsProvided && ( + + + - {entityControls.map((entity) => { - const entityKey = `${entity.fieldName}`; - const forceSelection = !hasEmptyFieldValues && entity.fieldValue === null; - hasEmptyFieldValues = !hasEmptyFieldValues && forceSelection; - return ( - - ); - })} - {arePartitioningFieldsProvided && ( - - - - - - )} - -
+ )} + diff --git a/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts b/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts index eb2c6b461a9df..876125433d794 100644 --- a/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts +++ b/x-pack/plugins/ml/server/models/results_service/get_partition_fields_values.ts @@ -10,6 +10,8 @@ import { PARTITION_FIELDS } from '../../../common/constants/anomalies'; import { PartitionFieldsType } from '../../../common/types/anomalies'; import { ML_RESULTS_INDEX_PATTERN } from '../../../common/constants/index_patterns'; import { CriteriaField } from './results_service'; +import { FieldConfig, FieldsConfig } from '../../routes/schemas/results_service_schema'; +import { Job } from '../../../common/types/anomaly_detection_jobs'; type SearchTerm = | { @@ -20,15 +22,25 @@ type SearchTerm = /** * Gets an object for aggregation query to retrieve field name and values. * @param fieldType - Field type + * @param isModelPlotSearch * @param query - Optional query string for partition value + * @param fieldConfig - Optional config for filtering and sorting * @returns {Object} */ -function getFieldAgg(fieldType: PartitionFieldsType, query?: string) { +function getFieldAgg( + fieldType: PartitionFieldsType, + isModelPlotSearch: boolean, + query?: string, + fieldConfig?: FieldConfig +) { const AGG_SIZE = 100; const fieldNameKey = `${fieldType}_name`; const fieldValueKey = `${fieldType}_value`; + const sortByField = + fieldConfig?.sort?.by === 'name' || isModelPlotSearch ? '_key' : 'maxRecordScore'; + return { [fieldNameKey]: { terms: { @@ -37,10 +49,31 @@ function getFieldAgg(fieldType: PartitionFieldsType, query?: string) { }, [fieldValueKey]: { filter: { - wildcard: { - [fieldValueKey]: { - value: query ? `*${query}*` : '*', - }, + bool: { + must: [ + ...(query + ? [ + { + wildcard: { + [fieldValueKey]: { + value: `*${query}*`, + }, + }, + }, + ] + : []), + ...(fieldConfig?.anomalousOnly + ? [ + { + range: { + record_score: { + gt: 0, + }, + }, + }, + ] + : []), + ], }, }, aggs: { @@ -48,7 +81,25 @@ function getFieldAgg(fieldType: PartitionFieldsType, query?: string) { terms: { size: AGG_SIZE, field: fieldValueKey, + ...(fieldConfig?.sort + ? { + order: { + [sortByField]: fieldConfig.sort.order ?? 'desc', + }, + } + : {}), }, + ...(isModelPlotSearch + ? {} + : { + aggs: { + maxRecordScore: { + max: { + field: 'record_score', + }, + }, + }, + }), }, }, }, @@ -68,7 +119,10 @@ function getFieldObject(fieldType: PartitionFieldsType, aggs: any) { ? { [fieldType]: { name: aggs[fieldNameKey].buckets[0].key, - values: aggs[fieldValueKey].values.buckets.map(({ key }: any) => key), + values: aggs[fieldValueKey].values.buckets.map(({ key, maxRecordScore }: any) => ({ + value: key, + ...(maxRecordScore ? { maxRecordScore: maxRecordScore.value } : {}), + })), }, } : {}; @@ -82,68 +136,94 @@ export const getPartitionFieldsValuesFactory = ({ asInternalUser }: IScopedClust * @param criteriaFields - key - value pairs of the term field, e.g. { detector_index: 0 } * @param earliestMs * @param latestMs + * @param fieldsConfig */ async function getPartitionFieldsValues( jobId: string, searchTerm: SearchTerm = {}, criteriaFields: CriteriaField[], earliestMs: number, - latestMs: number + latestMs: number, + fieldsConfig: FieldsConfig = {} ) { const { body: jobsResponse } = await asInternalUser.ml.getJobs({ job_id: jobId }); if (jobsResponse.count === 0 || jobsResponse.jobs === undefined) { throw Boom.notFound(`Job with the id "${jobId}" not found`); } - const job = jobsResponse.jobs[0]; + const job: Job = jobsResponse.jobs[0]; const isModelPlotEnabled = job?.model_plot_config?.enabled; + const isAnomalousOnly = (Object.entries(fieldsConfig) as Array<[string, FieldConfig]>).some( + ([k, v]) => { + return !!v?.anomalousOnly; + } + ); - const { body } = await asInternalUser.search({ - index: ML_RESULTS_INDEX_PATTERN, - size: 0, - body: { - query: { - bool: { - filter: [ - ...criteriaFields.map(({ fieldName, fieldValue }) => { - return { - term: { - [fieldName]: fieldValue, - }, - }; - }), - { + const applyTimeRange = (Object.entries(fieldsConfig) as Array<[string, FieldConfig]>).some( + ([k, v]) => { + return !!v?.applyTimeRange; + } + ); + + const isModelPlotSearch = !!isModelPlotEnabled && !isAnomalousOnly; + + // Remove the time filter in case model plot is not enabled + // and time range is not applied, so + // it includes the records that occurred as anomalies historically + const searchAllTime = !isModelPlotEnabled && !applyTimeRange; + + const requestBody = { + query: { + bool: { + filter: [ + ...criteriaFields.map(({ fieldName, fieldValue }) => { + return { term: { - job_id: jobId, + [fieldName]: fieldValue, }, + }; + }), + { + term: { + job_id: jobId, }, - { - range: { - timestamp: { - gte: earliestMs, - lte: latestMs, - format: 'epoch_millis', + }, + ...(searchAllTime + ? [] + : [ + { + range: { + timestamp: { + gte: earliestMs, + lte: latestMs, + format: 'epoch_millis', + }, + }, }, - }, + ]), + { + term: { + result_type: isModelPlotSearch ? 'model_plot' : 'record', }, - { - term: { - result_type: isModelPlotEnabled ? 'model_plot' : 'record', - }, - }, - ], - }, - }, - aggs: { - ...PARTITION_FIELDS.reduce((acc, key) => { - return { - ...acc, - ...getFieldAgg(key, searchTerm[key]), - }; - }, {}), + }, + ], }, }, + aggs: { + ...PARTITION_FIELDS.reduce((acc, key) => { + return { + ...acc, + ...getFieldAgg(key, isModelPlotSearch, searchTerm[key], fieldsConfig[key]), + }; + }, {}), + }, + }; + + const { body } = await asInternalUser.search({ + index: ML_RESULTS_INDEX_PATTERN, + size: 0, + body: requestBody, }); return PARTITION_FIELDS.reduce((acc, key) => { diff --git a/x-pack/plugins/ml/server/routes/results_service.ts b/x-pack/plugins/ml/server/routes/results_service.ts index 4e34320d51333..c9d6fce86deb0 100644 --- a/x-pack/plugins/ml/server/routes/results_service.ts +++ b/x-pack/plugins/ml/server/routes/results_service.ts @@ -72,8 +72,15 @@ function getMaxAnomalyScore(client: IScopedClusterClient, payload: any) { function getPartitionFieldsValues(client: IScopedClusterClient, payload: any) { const rs = resultsServiceProvider(client); - const { jobId, searchTerm, criteriaFields, earliestMs, latestMs } = payload; - return rs.getPartitionFieldsValues(jobId, searchTerm, criteriaFields, earliestMs, latestMs); + const { jobId, searchTerm, criteriaFields, earliestMs, latestMs, fieldsConfig } = payload; + return rs.getPartitionFieldsValues( + jobId, + searchTerm, + criteriaFields, + earliestMs, + latestMs, + fieldsConfig + ); } function getCategorizerStats(client: IScopedClusterClient, params: any, query: any) { diff --git a/x-pack/plugins/ml/server/routes/schemas/results_service_schema.ts b/x-pack/plugins/ml/server/routes/schemas/results_service_schema.ts index 0bf37826b6146..2b5c8c8338c72 100644 --- a/x-pack/plugins/ml/server/routes/schemas/results_service_schema.ts +++ b/x-pack/plugins/ml/server/routes/schemas/results_service_schema.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { schema } from '@kbn/config-schema'; +import { schema, TypeOf } from '@kbn/config-schema'; const criteriaFieldSchema = schema.object({ fieldType: schema.maybe(schema.string()), @@ -45,14 +45,35 @@ export const categoryExamplesSchema = schema.object({ maxExamples: schema.number(), }); +const fieldConfig = schema.maybe( + schema.object({ + applyTimeRange: schema.maybe(schema.boolean()), + anomalousOnly: schema.maybe(schema.boolean()), + sort: schema.object({ + by: schema.string(), + order: schema.maybe(schema.string()), + }), + }) +); + export const partitionFieldValuesSchema = schema.object({ jobId: schema.string(), searchTerm: schema.maybe(schema.any()), criteriaFields: schema.arrayOf(criteriaFieldSchema), earliestMs: schema.number(), latestMs: schema.number(), + fieldsConfig: schema.maybe( + schema.object({ + partition_field: fieldConfig, + over_field: fieldConfig, + by_field: fieldConfig, + }) + ), }); +export type FieldsConfig = TypeOf['fieldsConfig']; +export type FieldConfig = TypeOf; + export const getCategorizerStatsSchema = schema.nullable( schema.object({ /** diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/annotations.ts b/x-pack/test/functional/apps/ml/anomaly_detection/annotations.ts index 5353f53e74d0b..a1517020b6e09 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/annotations.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/annotations.ts @@ -70,7 +70,7 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobSelection.assertJobSelection([JOB_CONFIG.job_id]); await ml.testExecution.logTestStep('pre-fills the detector input'); - await ml.singleMetricViewer.assertDetectorInputExsist(); + await ml.singleMetricViewer.assertDetectorInputExist(); await ml.singleMetricViewer.assertDetectorInputValue('0'); await ml.testExecution.logTestStep('should display the annotations section showing an error'); diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_viewer.ts b/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_viewer.ts index 1dc4708c57dbc..6eac71dd05a98 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_viewer.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/single_metric_viewer.ts @@ -39,51 +39,166 @@ export default function ({ getService }: FtrProviderContext) { describe('single metric viewer', function () { this.tags(['mlqa']); - before(async () => { - await esArchiver.loadIfNeeded('ml/farequote'); - await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); - await ml.testResources.setKibanaTimeZoneToUTC(); - await ml.api.createAndRunAnomalyDetectionLookbackJob(JOB_CONFIG, DATAFEED_CONFIG); - await ml.securityUI.loginAsMlPowerUser(); - }); + describe('with single metric job', function () { + before(async () => { + await esArchiver.loadIfNeeded('ml/farequote'); + await ml.testResources.createIndexPatternIfNeeded('ft_farequote', '@timestamp'); + await ml.testResources.setKibanaTimeZoneToUTC(); - after(async () => { - await ml.api.cleanMlIndices(); - }); + await ml.api.createAndRunAnomalyDetectionLookbackJob(JOB_CONFIG, DATAFEED_CONFIG); + await ml.securityUI.loginAsMlPowerUser(); + }); - it('opens a job from job list link', async () => { - await ml.testExecution.logTestStep('navigate to job list'); - await ml.navigation.navigateToMl(); - await ml.navigation.navigateToJobManagement(); + after(async () => { + await ml.api.cleanMlIndices(); + }); - await ml.testExecution.logTestStep('open job in single metric viewer'); - await ml.jobTable.waitForJobsToLoad(); - await ml.jobTable.filterWithSearchString(JOB_CONFIG.job_id, 1); + it('opens a job from job list link', async () => { + await ml.testExecution.logTestStep('navigate to job list'); + await ml.navigation.navigateToMl(); + await ml.navigation.navigateToJobManagement(); - await ml.jobTable.clickOpenJobInSingleMetricViewerButton(JOB_CONFIG.job_id); - await ml.commonUI.waitForMlLoadingIndicatorToDisappear(); - }); + await ml.testExecution.logTestStep('open job in single metric viewer'); + await ml.jobTable.waitForJobsToLoad(); + await ml.jobTable.filterWithSearchString(JOB_CONFIG.job_id, 1); - it('displays job results', async () => { - await ml.testExecution.logTestStep('pre-fills the job selection'); - await ml.jobSelection.assertJobSelection([JOB_CONFIG.job_id]); + await ml.jobTable.clickOpenJobInSingleMetricViewerButton(JOB_CONFIG.job_id); + await ml.commonUI.waitForMlLoadingIndicatorToDisappear(); + }); - await ml.testExecution.logTestStep('pre-fills the detector input'); - await ml.singleMetricViewer.assertDetectorInputExsist(); - await ml.singleMetricViewer.assertDetectorInputValue('0'); + it('displays job results', async () => { + await ml.testExecution.logTestStep('pre-fills the job selection'); + await ml.jobSelection.assertJobSelection([JOB_CONFIG.job_id]); - await ml.testExecution.logTestStep('displays the chart'); - await ml.singleMetricViewer.assertChartExsist(); + await ml.testExecution.logTestStep('pre-fills the detector input'); + await ml.singleMetricViewer.assertDetectorInputExist(); + await ml.singleMetricViewer.assertDetectorInputValue('0'); - await ml.testExecution.logTestStep('should display the annotations section'); - await ml.singleMetricViewer.assertAnnotationsExists('loaded'); + await ml.testExecution.logTestStep('displays the chart'); + await ml.singleMetricViewer.assertChartExist(); - await ml.testExecution.logTestStep('displays the anomalies table'); - await ml.anomaliesTable.assertTableExists(); + await ml.testExecution.logTestStep('should display the annotations section'); + await ml.singleMetricViewer.assertAnnotationsExists('loaded'); + + await ml.testExecution.logTestStep('displays the anomalies table'); + await ml.anomaliesTable.assertTableExists(); + + await ml.testExecution.logTestStep('anomalies table is not empty'); + await ml.anomaliesTable.assertTableNotEmpty(); + }); + }); - await ml.testExecution.logTestStep('anomalies table is not empty'); - await ml.anomaliesTable.assertTableNotEmpty(); + describe('with entity fields', function () { + const jobConfig: Job = { + job_id: `ecom_01`, + description: + 'mean(taxless_total_price) over "geoip.city_name" partitionfield=day_of_week on ecommerce dataset with 15m bucket span', + groups: ['ecommerce', 'automated', 'advanced'], + analysis_config: { + bucket_span: '15m', + detectors: [ + { + detector_description: + 'mean(taxless_total_price) over "geoip.city_name" partitionfield=day_of_week', + function: 'mean', + field_name: 'taxless_total_price', + over_field_name: 'geoip.city_name', + partition_field_name: 'day_of_week', + detector_index: 0, + }, + ], + influencers: ['day_of_week'], + }, + data_description: { + time_field: 'order_date', + time_format: 'epoch_ms', + }, + analysis_limits: { + model_memory_limit: '11mb', + categorization_examples_limit: 4, + }, + model_plot_config: { enabled: true }, + }; + + const datafeedConfig: Datafeed = { + datafeed_id: 'datafeed-ecom_01', + indices: ['ft_ecommerce'], + job_id: 'ecom_01', + query: { bool: { must: [{ match_all: {} }] } }, + }; + + before(async () => { + await esArchiver.loadIfNeeded('ml/ecommerce'); + await ml.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date'); + await ml.testResources.setKibanaTimeZoneToUTC(); + await ml.api.createAndRunAnomalyDetectionLookbackJob(jobConfig, datafeedConfig); + await ml.securityUI.loginAsMlPowerUser(); + }); + + after(async () => { + await ml.api.cleanMlIndices(); + }); + + it('opens a job from job list link', async () => { + await ml.testExecution.logTestStep('navigate to job list'); + await ml.navigation.navigateToMl(); + await ml.navigation.navigateToJobManagement(); + + await ml.testExecution.logTestStep('open job in single metric viewer'); + await ml.jobTable.waitForJobsToLoad(); + await ml.jobTable.filterWithSearchString(jobConfig.job_id, 1); + + await ml.jobTable.clickOpenJobInSingleMetricViewerButton(jobConfig.job_id); + await ml.commonUI.waitForMlLoadingIndicatorToDisappear(); + }); + + it('render entity control', async () => { + await ml.testExecution.logTestStep('pre-fills the detector input'); + await ml.singleMetricViewer.assertDetectorInputExist(); + await ml.singleMetricViewer.assertDetectorInputValue('0'); + + await ml.testExecution.logTestStep('should input entities values'); + await ml.singleMetricViewer.assertEntityInputExist('day_of_week'); + await ml.singleMetricViewer.assertEntityInputSelection('day_of_week', []); + await ml.singleMetricViewer.selectEntityValue('day_of_week', 'Friday'); + await ml.singleMetricViewer.assertEntityInputExist('geoip.city_name'); + await ml.singleMetricViewer.assertEntityInputSelection('geoip.city_name', []); + await ml.singleMetricViewer.selectEntityValue('geoip.city_name', 'Abu Dhabi'); + + // TODO if placed before combobox update, tests fail to update combobox values + await ml.testExecution.logTestStep('assert the default state of entity configs'); + await ml.singleMetricViewer.assertEntityConfig( + 'day_of_week', + true, + 'anomaly_score', + 'desc' + ); + + await ml.singleMetricViewer.assertEntityConfig( + 'geoip.city_name', + true, + 'anomaly_score', + 'desc' + ); + + await ml.testExecution.logTestStep('modify the entity config'); + await ml.singleMetricViewer.setEntityConfig('geoip.city_name', false, 'name', 'asc'); + + // Make sure anomalous only control has been synced. + // Also sorting by name is enforced because the model plot is enabled + // and anomalous only is disabled + await ml.singleMetricViewer.assertEntityConfig('day_of_week', false, 'name', 'desc'); + + await ml.testExecution.logTestStep('displays the chart'); + await ml.singleMetricViewer.assertChartExist(); + + await ml.testExecution.logTestStep('displays the anomalies table'); + await ml.anomaliesTable.assertTableExists(); + + await ml.testExecution.logTestStep('anomalies table is not empty'); + await ml.anomaliesTable.assertTableNotEmpty(); + }); }); }); } diff --git a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts index c3dde872fa4a6..a10a5a59c01ad 100644 --- a/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts +++ b/x-pack/test/functional/apps/ml/permissions/full_ml_access.ts @@ -192,16 +192,16 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobSelection.assertJobSelection([adJobId]); await ml.testExecution.logTestStep('should pre-fill the detector input'); - await ml.singleMetricViewer.assertDetectorInputExsist(); + await ml.singleMetricViewer.assertDetectorInputExist(); await ml.singleMetricViewer.assertDetectorInputValue('0'); await ml.testExecution.logTestStep('should input the airline entity value'); - await ml.singleMetricViewer.assertEntityInputExsist('airline'); + await ml.singleMetricViewer.assertEntityInputExist('airline'); await ml.singleMetricViewer.assertEntityInputSelection('airline', []); await ml.singleMetricViewer.selectEntityValue('airline', 'AAL'); await ml.testExecution.logTestStep('should display the chart'); - await ml.singleMetricViewer.assertChartExsist(); + await ml.singleMetricViewer.assertChartExist(); await ml.testExecution.logTestStep('should display the annotations section'); await ml.singleMetricViewer.assertAnnotationsExists('loaded'); diff --git a/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts b/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts index cb964995511ef..b849877913a30 100644 --- a/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts +++ b/x-pack/test/functional/apps/ml/permissions/read_ml_access.ts @@ -185,16 +185,16 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobSelection.assertJobSelection([adJobId]); await ml.testExecution.logTestStep('should pre-fill the detector input'); - await ml.singleMetricViewer.assertDetectorInputExsist(); + await ml.singleMetricViewer.assertDetectorInputExist(); await ml.singleMetricViewer.assertDetectorInputValue('0'); await ml.testExecution.logTestStep('should input the airline entity value'); - await ml.singleMetricViewer.assertEntityInputExsist('airline'); + await ml.singleMetricViewer.assertEntityInputExist('airline'); await ml.singleMetricViewer.assertEntityInputSelection('airline', []); await ml.singleMetricViewer.selectEntityValue('airline', 'AAL'); await ml.testExecution.logTestStep('should display the chart'); - await ml.singleMetricViewer.assertChartExsist(); + await ml.singleMetricViewer.assertChartExist(); await ml.testExecution.logTestStep('should display the annotations section'); await ml.singleMetricViewer.assertAnnotationsExists('loaded'); diff --git a/x-pack/test/functional/services/ml/common_ui.ts b/x-pack/test/functional/services/ml/common_ui.ts index c3ee05db599a9..ef2fccab8a2cc 100644 --- a/x-pack/test/functional/services/ml/common_ui.ts +++ b/x-pack/test/functional/services/ml/common_ui.ts @@ -3,6 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ +import expect from '@kbn/expect'; import { ProvidedType } from '@kbn/test/types/ftr'; import { FtrProviderContext } from '../../ftr_provider_context'; @@ -98,5 +99,22 @@ export function MachineLearningCommonUIProvider({ getService }: FtrProviderConte async assertKibanaHomeFileDataVisLinkNotExists() { await testSubjects.missingOrFail('homeSynopsisLinkml_file_data_visualizer'); }, + + async assertRadioGroupValue(testSubject: string, expectedValue: string) { + const assertRadioGroupValue = await testSubjects.find(testSubject); + const input = await assertRadioGroupValue.findByCssSelector(':checked'); + const selectedOptionId = await input.getAttribute('id'); + expect(selectedOptionId).to.eql( + expectedValue, + `Expected the radio group value to equal "${expectedValue}" (got "${selectedOptionId}")` + ); + }, + + async selectRadioGroupValue(testSubject: string, value: string) { + const radioGroup = await testSubjects.find(testSubject); + const label = await radioGroup.findByCssSelector(`label[for="${value}"]`); + await label.click(); + await this.assertRadioGroupValue(testSubject, value); + }, }; } diff --git a/x-pack/test/functional/services/ml/index.ts b/x-pack/test/functional/services/ml/index.ts index 50da8425e493d..b9ff0692cb737 100644 --- a/x-pack/test/functional/services/ml/index.ts +++ b/x-pack/test/functional/services/ml/index.ts @@ -80,7 +80,7 @@ export function MachineLearningProvider(context: FtrProviderContext) { const settings = MachineLearningSettingsProvider(context); const settingsCalendar = MachineLearningSettingsCalendarProvider(context, commonUI); const settingsFilterList = MachineLearningSettingsFilterListProvider(context, commonUI); - const singleMetricViewer = MachineLearningSingleMetricViewerProvider(context); + const singleMetricViewer = MachineLearningSingleMetricViewerProvider(context, commonUI); const testExecution = MachineLearningTestExecutionProvider(context); const testResources = MachineLearningTestResourcesProvider(context); diff --git a/x-pack/test/functional/services/ml/single_metric_viewer.ts b/x-pack/test/functional/services/ml/single_metric_viewer.ts index c6b912d83fae6..bb628d704c373 100644 --- a/x-pack/test/functional/services/ml/single_metric_viewer.ts +++ b/x-pack/test/functional/services/ml/single_metric_viewer.ts @@ -6,8 +6,12 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; +import { MlCommonUI } from './common_ui'; -export function MachineLearningSingleMetricViewerProvider({ getService }: FtrProviderContext) { +export function MachineLearningSingleMetricViewerProvider( + { getService }: FtrProviderContext, + mlCommonUI: MlCommonUI +) { const comboBox = getService('comboBox'); const testSubjects = getService('testSubjects'); @@ -34,7 +38,7 @@ export function MachineLearningSingleMetricViewerProvider({ getService }: FtrPro ); }, - async assertDetectorInputExsist() { + async assertDetectorInputExist() { await testSubjects.existOrFail( 'mlSingleMetricViewerSeriesControls > mlSingleMetricViewerDetectorSelect' ); @@ -59,7 +63,7 @@ export function MachineLearningSingleMetricViewerProvider({ getService }: FtrPro await this.assertDetectorInputValue(detectorOptionValue); }, - async assertEntityInputExsist(entityFieldName: string) { + async assertEntityInputExist(entityFieldName: string) { await testSubjects.existOrFail(`mlSingleMetricViewerEntitySelection ${entityFieldName}`); }, @@ -81,7 +85,7 @@ export function MachineLearningSingleMetricViewerProvider({ getService }: FtrPro await this.assertEntityInputSelection(entityFieldName, [entityFieldValue]); }, - async assertChartExsist() { + async assertChartExist() { await testSubjects.existOrFail('mlSingleMetricViewerChart'); }, @@ -117,5 +121,71 @@ export function MachineLearningSingleMetricViewerProvider({ getService }: FtrPro await testSubjects.click('mlAnomalyResultsViewSelectorExplorer'); await testSubjects.existOrFail('mlPageAnomalyExplorer'); }, + + async openConfigForControl(entityFieldName: string) { + const isPopoverOpened = await testSubjects.exists( + `mlSingleMetricViewerEntitySelectionConfigPopover_${entityFieldName}` + ); + + if (isPopoverOpened) { + return; + } + + await testSubjects.click( + `mlSingleMetricViewerEntitySelectionConfigButton_${entityFieldName}` + ); + await testSubjects.existOrFail( + `mlSingleMetricViewerEntitySelectionConfigPopover_${entityFieldName}` + ); + }, + + async assertEntityConfig( + entityFieldName: string, + anomalousOnly: boolean, + sortBy: 'anomaly_score' | 'name', + order: 'asc' | 'desc' + ) { + await this.openConfigForControl(entityFieldName); + expect( + await testSubjects.isEuiSwitchChecked( + `mlSingleMetricViewerEntitySelectionConfigAnomalousOnly_${entityFieldName}` + ) + ).to.eql( + anomalousOnly, + `Expected the "Anomalous only" control for "${entityFieldName}" to be ${ + anomalousOnly ? 'enabled' : 'disabled' + }` + ); + await mlCommonUI.assertRadioGroupValue( + `mlSingleMetricViewerEntitySelectionConfigSortBy_${entityFieldName}`, + sortBy + ); + await mlCommonUI.assertRadioGroupValue( + `mlSingleMetricViewerEntitySelectionConfigOrder_${entityFieldName}`, + order + ); + }, + + async setEntityConfig( + entityFieldName: string, + anomalousOnly: boolean, + sortBy: 'anomaly_score' | 'name', + order: 'asc' | 'desc' + ) { + await this.openConfigForControl(entityFieldName); + await testSubjects.setEuiSwitch( + `mlSingleMetricViewerEntitySelectionConfigAnomalousOnly_${entityFieldName}`, + anomalousOnly ? 'check' : 'uncheck' + ); + await mlCommonUI.selectRadioGroupValue( + `mlSingleMetricViewerEntitySelectionConfigSortBy_${entityFieldName}`, + sortBy + ); + await mlCommonUI.selectRadioGroupValue( + `mlSingleMetricViewerEntitySelectionConfigOrder_${entityFieldName}`, + order + ); + await this.assertEntityConfig(entityFieldName, anomalousOnly, sortBy, order); + }, }; } From 3daa6e2524b0b33bd0ef5bd714af8a36160e6c05 Mon Sep 17 00:00:00 2001 From: Gidi Meir Morris Date: Mon, 2 Nov 2020 15:08:29 +0000 Subject: [PATCH 10/13] avoid refreshing by using useCallback (#82260) A small UI tweak to avoid unnecessarily rerendering in Case --- .../components/configure_cases/index.tsx | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx b/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx index a660ac0c097bf..4bf774dde2373 100644 --- a/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx +++ b/x-pack/plugins/security_solution/public/cases/components/configure_cases/index.tsx @@ -93,19 +93,13 @@ const ConfigureCasesComponent: React.FC = ({ userC setEditFlyoutVisibility(true); }, []); - const handleSetAddFlyoutVisibility = useCallback( - (isVisible: boolean) => { - setAddFlyoutVisibility(isVisible); - }, - [setAddFlyoutVisibility] - ); + const onCloseAddFlyout = useCallback(() => setAddFlyoutVisibility(false), [ + setAddFlyoutVisibility, + ]); - const handleSetEditFlyoutVisibility = useCallback( - (isVisible: boolean) => { - setEditFlyoutVisibility(isVisible); - }, - [setEditFlyoutVisibility] - ); + const onCloseEditFlyout = useCallback(() => setEditFlyoutVisibility(false), [ + setEditFlyoutVisibility, + ]); const onChangeConnector = useCallback( (id: string) => { @@ -205,16 +199,13 @@ const ConfigureCasesComponent: React.FC = ({ userC }} > {addFlyoutVisible && ( - handleSetAddFlyoutVisibility(false)} - actionTypes={actionTypes} - /> + )} {editedConnectorItem && editFlyoutVisible && ( handleSetEditFlyoutVisibility(false)} + onClose={onCloseEditFlyout} /> )} From 6451a8fd7ad4691e0c918d39b05553b3364861ae Mon Sep 17 00:00:00 2001 From: Spencer Date: Mon, 2 Nov 2020 08:32:33 -0700 Subject: [PATCH 11/13] [docs] describe steps for resolving limit overages (#81716) Co-authored-by: spalger --- .../development-ci-metrics.asciidoc | 80 ++++++++++++++++++- 1 file changed, 77 insertions(+), 3 deletions(-) diff --git a/docs/developer/contributing/development-ci-metrics.asciidoc b/docs/developer/contributing/development-ci-metrics.asciidoc index d4d54f1da7b8b..485b7af6a6221 100644 --- a/docs/developer/contributing/development-ci-metrics.asciidoc +++ b/docs/developer/contributing/development-ci-metrics.asciidoc @@ -3,6 +3,10 @@ In addition to running our tests, CI collects metrics about the Kibana build. These metrics are sent to an external service to track changes over time, and to provide PR authors insights into the impact of their changes. +* <> +* <> +* <> + [[ci-metric-types]] === Metric types @@ -16,7 +20,7 @@ These metrics help contributors know how they are impacting the size of the bund [[ci-metric-page-load-bundle-size]] `page load bundle size` :: The size of the entry file produced for each bundle/plugin. This file is always loaded on every page load, so it should be as small as possible. To reduce this metric you can put any code that isn't necessary on every page load behind an https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports[`async import()`]. + -Code that is shared statically with other plugins will contribute to the `page load bundle size` of that plugin. This includes exports from the `public/index.ts` file and any file referenced by the `extraPublicDirs` manifest property. +Code that is shared statically with other plugins will contribute to the `page load bundle size` of that plugin. This includes exports from the `public/index.ts` file and any file referenced by the `extraPublicDirs` manifest property. [[ci-metric-async-chunks-size]] `async chunks size` :: An "async chunk" is created for the files imported by each https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import#Dynamic_Imports[`async import()`] statement. This metric tracks the sum size of these chunks, in bytes, broken down by plugin/bundle id. You can think of this as the amount of code users will have to download if they access all the components/applications within a bundle. @@ -44,7 +48,7 @@ The number of files included in the default distributable. The number of files included in the OSS distributable. [[ci-metric-distributable-size]] `distributable size` :: -The size, in bytes, of the default distributable. _(not reported on PRs)_ +The size, in bytes, of the default distributable. _(not reported on PRs)_ [[ci-metric-oss-distributable-size]] `oss distributable size` :: The size, in bytes, of the OSS distributable. _(not reported on PRs)_ @@ -62,4 +66,74 @@ The number of saved object fields broken down by saved object type. [[ci-metric-adding-new-metrics]] === Adding new metrics -You can report new metrics by using the `CiStatsReporter` class provided by the `@kbn/dev-utils` package. This class is automatically configured on CI and its methods noop when running outside of CI. For more details checkout the {kib-repo}blob/{branch}/packages/kbn-dev-utils/src/ci_stats_reporter[`CiStatsReporter` readme]. \ No newline at end of file +You can report new metrics by using the `CiStatsReporter` class provided by the `@kbn/dev-utils` package. This class is automatically configured on CI and its methods noop when running outside of CI. For more details checkout the {kib-repo}blob/{branch}/packages/kbn-dev-utils/src/ci_stats_reporter[`CiStatsReporter` readme]. + +[[ci-metric-resolving-overages]] +=== Resolving `page load bundle size` overages + +In order to prevent the page load bundles from growing unexpectedly large we limit the `page load asset size` metric for each plugin. When a PR increases this metric beyond the limit defined for that plugin in {kib-repo}blob/{branch}/packages/kbn-optimizer/limits.yml[`limits.yml`] a failed commit status is set and the PR author needs to decide how to resolve this issue before the PR can be merged. + +In most cases the limit should be high enough that PRs shouldn't trigger overages, but when they do make sure it's clear what is cuasing the overage by trying the following: + +1. Run the optimizer locally with the `--profile` flag to produce webpack `stats.json` files for bundles which can be inspected using a number of different online tools. Focus on the chunk named `{pluginId}.plugin.js`; the `*.chunk.js` chunks make up the `async chunks size` metric which is currently unlimited and is the main way that we {kib-repo}blob/{branch}/src/core/MIGRATION.md#keep-kibana-fast[reduce the size of page load chunks]. ++ +[source,shell] +----------- +node scripts/build_kibana_platform_plugins --focus {pluginid} --profile +# builds and creates {pluginDir}target/public/stats.json files for {pluginId} and any plugin it depends on +----------- + + - Official Webpack tool: http://webpack.github.io/analyse/ + - Webpack visualizer: https://chrisbateman.github.io/webpack-visualizer/ + +2. You might want to create stats for the upstream branch of your PR as well and then compare them side by side in Webpack visualizer to spot where the size difference is (using two browser tabs). + +3. For relatively small changes you might be able to better understand the problem by sticking stats.json files from two different branches into https://www.scootersoftware.com/download.php[Beyond Compare] + +4. If the number of changes in https://www.scootersoftware.com/download.php[Beyond Compare] are too large, you can reduce the stats.json file down to just a sorted list of module ids using https://github.com/stedolan/jq[jq]: ++ +[source,shell] +----------- +jq -r .modules[].id {pluginDir}/target/public/stats.json | sort - > moduleids.txt +----------- ++ +Produce a moduleids.txt file for both your branch and master and then pop them into Beyond Compare to get a very specific view of what's new. + +5. As a last resort you might want to try comparing the bundle source directly. It's usually best to do this using the production source so that you're inspecting the actual change in bytes that CI is seeing. After building the distributable version of your bundle run it through prettier and then dropping it into Beyond Compare along with the chunk from upstream: ++ +[source,shell] +----------- +node scripts/build_kibana_platform_plugins --focus {pluginId} --dist +npm install -g prettier +prettier -w {pluginDir}/target/public/{pluginId}.plugin.js +# repeat these steps for upstream and then compare the two {pluginId}.plugin.js files in Beyond Compare +----------- + +6. If all else fails reach out to Operations for help. + +Once you've identified the files which were added to the build you likely just need to stick them behind an async import as described in {kib-repo}blob/{branch}/src/core/MIGRATION.md#keep-kibana-fast[the MIGRATION.md docs]. + +In the case that the bundle size is not being bloated by anything obvious, but it's still larger than the limit, you can raise the limit in your PR. Do this either by editting the {kib-repo}blob/{branch}/packages/kbn-optimizer/limits.yml[`limits.yml` file] manually or by running the following to have the limit updated to the current size + 15kb + +[source,shell] +----------- +node scripts/build_kibana_platform_plugins --focus {pluginId} --update-limits +----------- + +This command has to run the optimizer in distributable mode so it will take a lot longer and spawn one worker for each CPU on your machine. + +Changes to the {kib-repo}blob/{branch}/packages/kbn-optimizer/limits.yml[`limits.yml` file] will trigger review from the Operations team, who will attempt to verify that the size increase is justified. If you have findings you can share from the steps above that would be very helpful! + +[[ci-metric-validating-limits]] +=== Validating `page load bundle size` limits + +Once you've fixed any issues discovered while diagnosing overages you probably should just push the changes to your PR and let CI validate them. + +If you have a pretty powerful dev machine, or the necessary patience/determination, you can validate the limits locally by running the following command: + +[source,shell] +----------- +node scripts/build_kibana_platform_plugins --validate-limits +----------- + +This command needs to apply production optimizations to get the right sizes, which means that the optimizer will take significantly longer to run and on most developmer machines will consume all of your machines resources for 20 minutes or more. If you'd like to multi-task while this is running you might need to limit the number of workers using the `--max-workers` flag. \ No newline at end of file From ed19912c666c30b865bf7b6265f277dfbecf99ea Mon Sep 17 00:00:00 2001 From: Kerry Gallagher Date: Mon, 2 Nov 2020 15:46:32 +0000 Subject: [PATCH 12/13] Add secondary sort to getJourneySteps query (#82281) Fixes ordering bug --- x-pack/plugins/uptime/server/lib/requests/get_journey_steps.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/uptime/server/lib/requests/get_journey_steps.ts b/x-pack/plugins/uptime/server/lib/requests/get_journey_steps.ts index d0bb67795d46c..9c139b2ce8588 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_journey_steps.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_journey_steps.ts @@ -35,7 +35,7 @@ export const getJourneySteps: UMElasticsearchQueryFn Date: Mon, 2 Nov 2020 10:57:18 -0500 Subject: [PATCH 13/13] Fix example in docs (#82185) --- docs/user/alerting/action-types/index.asciidoc | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/docs/user/alerting/action-types/index.asciidoc b/docs/user/alerting/action-types/index.asciidoc index 3a57c44494394..2c6da7c7c3026 100644 --- a/docs/user/alerting/action-types/index.asciidoc +++ b/docs/user/alerting/action-types/index.asciidoc @@ -77,13 +77,11 @@ PUT test "number_of_shards" : 1 }, "mappings" : { - "_doc" : { - "properties" : { - "alert_id" : { "type" : "text" }, - "alert_name" : { "type" : "text" }, - "alert_instance_id" : { "type" : "text" }, - "context_message": { "type" : "text" } - } + "properties" : { + "alert_id" : { "type" : "text" }, + "alert_name" : { "type" : "text" }, + "alert_instance_id" : { "type" : "text" }, + "context_message": { "type" : "text" } } } }