From 84d39418888cd26b9e3c728d0834c46624e083b4 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 3 Jan 2020 09:09:05 -0500 Subject: [PATCH 01/36] Move uptime legacy server to plugins directory. --- x-pack/legacy/plugins/uptime/index.ts | 19 ---------- .../plugins/uptime/scripts/graphql_schemas.ts | 15 -------- x-pack/legacy/plugins/uptime/server/plugin.ts | 19 ---------- x-pack/plugins/uptime/kibana.json | 9 +++++ .../uptime/server/graphql/constants.ts | 0 .../plugins/uptime/server/graphql/index.ts | 0 .../server/graphql/monitor_states/index.ts | 0 .../graphql/monitor_states/resolvers.ts | 6 ++-- .../graphql/monitor_states/schema.gql.ts | 0 .../uptime/server/graphql/monitors/index.ts | 0 .../server/graphql/monitors/resolvers.ts | 8 ++--- .../server/graphql/monitors/schema.gql.ts | 0 .../uptime/server/graphql/pings/index.ts | 0 .../uptime/server/graphql/pings/resolvers.ts | 8 +++-- .../uptime/server/graphql/pings/schema.gql.ts | 0 .../plugins/uptime/server/graphql/types.ts | 0 .../__tests__/parse_literal.test.ts | 0 .../__tests__/parse_value.test.ts | 0 .../__tests__/serialize.test.ts | 0 .../graphql/unsigned_int_scalar/index.ts | 0 .../graphql/unsigned_int_scalar/resolvers.ts | 0 .../graphql/unsigned_int_scalar/schema.gql.ts | 0 .../plugins/uptime/server/index.ts | 5 ++- .../plugins/uptime/server/kibana.index.ts | 35 ++----------------- .../lib/adapters/framework/adapter_types.ts | 5 +-- .../server/lib/adapters/framework/index.ts | 0 .../framework/kibana_framework_adapter.ts | 6 ++-- .../uptime/server/lib/adapters/index.ts | 0 .../get_snapshot_helper.test.ts.snap | 0 .../__tests__/get_snapshot_helper.test.ts | 0 .../adapters/monitor_states/adapter_types.ts | 4 +-- .../elasticsearch_monitor_states_adapter.ts | 5 ++- .../monitor_states/get_snapshot_helper.ts | 2 +- .../lib/adapters/monitor_states/index.ts | 0 .../search/__tests__/fetch_page.test.ts | 2 +- .../__tests__/find_potential_matches_test.ts | 0 .../__tests__/monitor_group_iterator.test.ts | 0 .../search/__tests__/test_helpers.ts | 5 ++- .../search/enrich_monitor_groups.ts | 4 +-- .../monitor_states/search/fetch_chunk.ts | 0 .../monitor_states/search/fetch_page.ts | 8 +++-- .../search/find_potential_matches.ts | 4 +-- .../adapters/monitor_states/search/index.ts | 0 .../search/monitor_group_iterator.ts | 2 +- .../search/refine_potential_matches.ts | 4 +-- ...lasticsearch_monitors_adapter.test.ts.snap | 0 .../elasticsearch_monitors_adapter.test.ts | 0 .../__tests__/monitor_charts_mock.json | 0 .../lib/adapters/monitors/adapter_types.ts | 10 ++++-- .../elasticsearch_monitors_adapter.ts | 13 +++++-- .../server/lib/adapters/monitors/index.ts | 0 .../elasticsearch_pings_adapter.test.ts.snap | 0 .../elasticsearch_pings_adapter.test.ts | 0 .../lib/adapters/pings/adapter_types.ts | 8 +++-- .../pings/elasticsearch_pings_adapter.ts | 8 +++-- .../uptime/server/lib/adapters/pings/index.ts | 0 .../heartbeat_index_pattern.json | 0 .../lib/adapters/saved_objects/index.ts | 0 .../kibana_saved_objects_adapter.ts | 0 .../lib/adapters/saved_objects/types.ts | 0 .../kibana_telemetry_adapter.test.ts.snap | 0 .../kibana_telemetry_adapter.test.ts | 0 .../server/lib/adapters/telemetry/index.ts | 0 .../telemetry/kibana_telemetry_adapter.ts | 0 .../uptime/server/lib/compose/kibana.ts | 4 +-- .../__snapshots__/license.test.ts.snap | 0 .../lib/domains/__tests__/license.test.ts | 2 +- .../uptime/server/lib/domains/index.ts | 0 .../uptime/server/lib/domains/license.ts | 2 +- .../assert_close_to.test.ts.snap | 0 .../get_filter_clause.test.ts.snap | 0 .../helper/__test__/assert_close_to.test.ts | 0 .../helper/__test__/get_filter_clause.test.ts | 0 .../__test__/get_histogram_interval.test.ts | 0 .../get_histogram_interval_formatted.test.ts | 0 .../server/lib/helper/assert_close_to.ts | 0 .../server/lib/helper/get_filter_clause.ts | 0 .../lib/helper/get_histogram_interval.ts | 2 +- .../get_histogram_interval_formatted.ts | 0 .../plugins/uptime/server/lib/helper/index.ts | 0 .../lib/helper/make_date_rate_filter.ts | 0 .../server/lib/helper/parse_filter_query.ts | 0 .../plugins/uptime/server/lib/lib.ts | 0 x-pack/plugins/uptime/server/plugin.ts | 35 +++++++++++++++++++ .../server/rest_api/create_route_with_auth.ts | 0 .../plugins/uptime/server/rest_api/index.ts | 0 .../index_pattern/get_index_pattern.ts | 0 .../server/rest_api/index_pattern/index.ts | 0 .../uptime/server/rest_api/monitors/index.ts | 0 .../rest_api/monitors/monitor_locations.ts | 0 .../rest_api/monitors/monitors_details.ts | 0 .../uptime/server/rest_api/pings/get_all.ts | 0 .../uptime/server/rest_api/pings/index.ts | 0 .../rest_api/snapshot/get_snapshot_count.ts | 0 .../uptime/server/rest_api/snapshot/index.ts | 0 .../uptime/server/rest_api/telemetry/index.ts | 0 .../rest_api/telemetry/log_monitor_page.ts | 0 .../rest_api/telemetry/log_overview_page.ts | 0 .../plugins/uptime/server/rest_api/types.ts | 0 .../server/rest_api/uptime_route_wrapper.ts | 0 .../plugins/uptime/server/uptime_server.ts | 0 .../apis/uptime/graphql/snapshot_histogram.ts | 2 +- 102 files changed, 128 insertions(+), 133 deletions(-) delete mode 100644 x-pack/legacy/plugins/uptime/scripts/graphql_schemas.ts delete mode 100644 x-pack/legacy/plugins/uptime/server/plugin.ts create mode 100644 x-pack/plugins/uptime/kibana.json rename x-pack/{legacy => }/plugins/uptime/server/graphql/constants.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitor_states/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitor_states/resolvers.ts (89%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitor_states/schema.gql.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitors/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitors/resolvers.ts (90%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitors/schema.gql.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/pings/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/pings/resolvers.ts (86%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/pings/schema.gql.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/index.ts (60%) rename x-pack/{legacy => }/plugins/uptime/server/kibana.index.ts (56%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/framework/adapter_types.ts (92%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/framework/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts (95%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts (90%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts (91%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts (89%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts (98%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts (95%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts (98%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts (88%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts (97%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/adapter_types.ts (91%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/saved_objects/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/saved_objects/types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/telemetry/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/compose/kibana.ts (86%) rename x-pack/{legacy => }/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/domains/__tests__/license.test.ts (93%) rename x-pack/{legacy => }/plugins/uptime/server/lib/domains/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/domains/license.ts (93%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/assert_close_to.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/get_filter_clause.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/get_histogram_interval.ts (90%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/make_date_rate_filter.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/parse_filter_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/lib.ts (100%) create mode 100644 x-pack/plugins/uptime/server/plugin.ts rename x-pack/{legacy => }/plugins/uptime/server/rest_api/create_route_with_auth.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/index_pattern/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/monitors/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/monitors/monitor_locations.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/monitors/monitors_details.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/pings/get_all.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/pings/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/snapshot/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/telemetry/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/uptime_route_wrapper.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/uptime_server.ts (100%) diff --git a/x-pack/legacy/plugins/uptime/index.ts b/x-pack/legacy/plugins/uptime/index.ts index e090a2c85e136..20a2c8514ca70 100644 --- a/x-pack/legacy/plugins/uptime/index.ts +++ b/x-pack/legacy/plugins/uptime/index.ts @@ -6,9 +6,7 @@ import { i18n } from '@kbn/i18n'; import { resolve } from 'path'; -import { PluginInitializerContext } from 'src/core/server'; import { PLUGIN } from './common/constants'; -import { KibanaServer, plugin } from './server'; export const uptime = (kibana: any) => new kibana.Plugin({ @@ -33,21 +31,4 @@ export const uptime = (kibana: any) => }, home: ['plugins/uptime/register_feature'], }, - init(server: KibanaServer) { - const initializerContext = {} as PluginInitializerContext; - const { savedObjects } = server; - const { xpack_main } = server.plugins; - const { usageCollection } = server.newPlatform.setup.plugins; - - plugin(initializerContext).setup( - { - route: server.newPlatform.setup.core.http.createRouter(), - }, - { - savedObjects, - usageCollection, - xpack: xpack_main, - } - ); - }, }); diff --git a/x-pack/legacy/plugins/uptime/scripts/graphql_schemas.ts b/x-pack/legacy/plugins/uptime/scripts/graphql_schemas.ts deleted file mode 100644 index c337cf098e48d..0000000000000 --- a/x-pack/legacy/plugins/uptime/scripts/graphql_schemas.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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 { buildSchemaFromTypeDefinitions } from 'graphql-tools'; -import { typeDefs } from '../server/graphql'; - -export const schemas = [...typeDefs]; - -// this default export is used to feed the combined types to the gql-gen tool -// which generates the corresponding typescript types -// eslint-disable-next-line import/no-default-export -export default buildSchemaFromTypeDefinitions(schemas); diff --git a/x-pack/legacy/plugins/uptime/server/plugin.ts b/x-pack/legacy/plugins/uptime/server/plugin.ts deleted file mode 100644 index acecce305e7cb..0000000000000 --- a/x-pack/legacy/plugins/uptime/server/plugin.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 { PluginInitializerContext } from 'src/core/server'; -import { initServerWithKibana } from './kibana.index'; -import { UptimeCoreSetup, UptimeCorePlugins } from './lib/adapters/framework'; - -export function plugin(initializerContext: PluginInitializerContext) { - return new Plugin(); -} - -export class Plugin { - public setup(core: UptimeCoreSetup, plugins: UptimeCorePlugins) { - initServerWithKibana(core, plugins); - } -} diff --git a/x-pack/plugins/uptime/kibana.json b/x-pack/plugins/uptime/kibana.json new file mode 100644 index 0000000000000..711c8b806a436 --- /dev/null +++ b/x-pack/plugins/uptime/kibana.json @@ -0,0 +1,9 @@ +{ + "configPath": ["xpack"], + "id": "uptime", + "kibanaVersion": "kibana", + "requiredPlugins": ["licensing", "usageCollection"], + "server": true, + "ui": false, + "version": "8.0.0" +} diff --git a/x-pack/legacy/plugins/uptime/server/graphql/constants.ts b/x-pack/plugins/uptime/server/graphql/constants.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/constants.ts rename to x-pack/plugins/uptime/server/graphql/constants.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/index.ts b/x-pack/plugins/uptime/server/graphql/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/index.ts rename to x-pack/plugins/uptime/server/graphql/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/index.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/monitor_states/index.ts rename to x-pack/plugins/uptime/server/graphql/monitor_states/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts similarity index 89% rename from x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts rename to x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts index 8ddb07b3093d0..713d3f2b6392a 100644 --- a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts @@ -6,13 +6,13 @@ import { CreateUMGraphQLResolvers, UMContext } from '../types'; import { UMServerLibs } from '../../lib/lib'; -import { UMResolver } from '../../../common/graphql/resolver_types'; +import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; import { GetMonitorStatesQueryArgs, MonitorSummaryResult, StatesIndexStatus, -} from '../../../common/graphql/types'; -import { CONTEXT_DEFAULTS } from '../../../common/constants/context_defaults'; +} from '../../../../../legacy/plugins/uptime/common/graphql/types'; +import { CONTEXT_DEFAULTS } from '../../../../../legacy/plugins/uptime/common/constants/context_defaults'; export type UMGetMonitorStatesResolver = UMResolver< MonitorSummaryResult | Promise, diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/monitor_states/schema.gql.ts rename to x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitors/index.ts b/x-pack/plugins/uptime/server/graphql/monitors/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/monitors/index.ts rename to x-pack/plugins/uptime/server/graphql/monitors/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitors/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts similarity index 90% rename from x-pack/legacy/plugins/uptime/server/graphql/monitors/resolvers.ts rename to x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts index 8b685d8e08a2b..02ad2141e27b8 100644 --- a/x-pack/legacy/plugins/uptime/server/graphql/monitors/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { UMGqlRange } from '../../../common/domain_types'; -import { UMResolver } from '../../../common/graphql/resolver_types'; +import { UMGqlRange } from '../../../../../legacy/plugins/uptime/common/domain_types'; +import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; import { FilterBar, GetFilterBarQueryArgs, @@ -16,10 +16,10 @@ import { MonitorPageTitle, Ping, GetSnapshotHistogramQueryArgs, -} from '../../../common/graphql/types'; +} from '../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMServerLibs } from '../../lib/lib'; import { CreateUMGraphQLResolvers, UMContext } from '../types'; -import { HistogramResult } from '../../../common/domain_types'; +import { HistogramResult } from '../../../../../legacy/plugins/uptime/common/domain_types'; export type UMMonitorsResolver = UMResolver, any, UMGqlRange, UMContext>; diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitors/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/monitors/schema.gql.ts rename to x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/pings/index.ts b/x-pack/plugins/uptime/server/graphql/pings/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/pings/index.ts rename to x-pack/plugins/uptime/server/graphql/pings/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/pings/resolvers.ts b/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts similarity index 86% rename from x-pack/legacy/plugins/uptime/server/graphql/pings/resolvers.ts rename to x-pack/plugins/uptime/server/graphql/pings/resolvers.ts index 373e1467433a2..13dace5da8f12 100644 --- a/x-pack/legacy/plugins/uptime/server/graphql/pings/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts @@ -4,8 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { UMResolver } from '../../../common/graphql/resolver_types'; -import { AllPingsQueryArgs, DocCount, PingResults } from '../../../common/graphql/types'; +import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; +import { + AllPingsQueryArgs, + DocCount, + PingResults, +} from '../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMServerLibs } from '../../lib/lib'; import { UMContext } from '../types'; import { CreateUMGraphQLResolvers } from '../types'; diff --git a/x-pack/legacy/plugins/uptime/server/graphql/pings/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/pings/schema.gql.ts rename to x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/types.ts b/x-pack/plugins/uptime/server/graphql/types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/types.ts rename to x-pack/plugins/uptime/server/graphql/types.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts diff --git a/x-pack/legacy/plugins/uptime/server/index.ts b/x-pack/plugins/uptime/server/index.ts similarity index 60% rename from x-pack/legacy/plugins/uptime/server/index.ts rename to x-pack/plugins/uptime/server/index.ts index d063f0d8c2288..275983c259f9d 100644 --- a/x-pack/legacy/plugins/uptime/server/index.ts +++ b/x-pack/plugins/uptime/server/index.ts @@ -4,5 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { PluginInitializerContext } from '../../../../src/core/server'; +import { UptimePlugin } from './plugin'; + export { initServerWithKibana, KibanaServer } from './kibana.index'; -export { plugin } from './plugin'; +export const plugin = (_initializerContext: PluginInitializerContext) => new UptimePlugin(); diff --git a/x-pack/legacy/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts similarity index 56% rename from x-pack/legacy/plugins/uptime/server/kibana.index.ts rename to x-pack/plugins/uptime/server/kibana.index.ts index 73fabc629946b..f2599a74ae1fa 100644 --- a/x-pack/legacy/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -4,9 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { i18n } from '@kbn/i18n'; import { Request, Server } from 'hapi'; -import { PLUGIN } from '../common/constants'; import { KibanaTelemetryAdapter } from './lib/adapters/telemetry'; import { compose } from './lib/compose/kibana'; import { initUptimeServer } from './uptime_server'; @@ -25,38 +23,9 @@ export interface KibanaServer extends Server { } export const initServerWithKibana = (server: UptimeCoreSetup, plugins: UptimeCorePlugins) => { - const { usageCollection, xpack } = plugins; - const libs = compose(server, plugins); + const { usageCollection } = plugins; + const libs = compose(server); KibanaTelemetryAdapter.registerUsageCollector(usageCollection); initUptimeServer(libs); - - xpack.registerFeature({ - id: PLUGIN.ID, - name: i18n.translate('xpack.uptime.featureRegistry.uptimeFeatureName', { - defaultMessage: 'Uptime', - }), - navLinkId: PLUGIN.ID, - icon: 'uptimeApp', - app: ['uptime', 'kibana'], - catalogue: ['uptime'], - privileges: { - all: { - api: ['uptime'], - savedObject: { - all: [], - read: [], - }, - ui: ['save'], - }, - read: { - api: ['uptime'], - savedObject: { - all: [], - read: [], - }, - ui: [], - }, - }, - }); }; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts similarity index 92% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts rename to x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts index b490bf17e292c..7fec73bdcc01a 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts @@ -7,7 +7,6 @@ import { GraphQLSchema } from 'graphql'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { - SavedObjectsLegacyService, RequestHandler, IRouter, CallAPIOptions, @@ -44,13 +43,11 @@ export type UMSavedObjectsQueryFn = ( ) => Promise | T; export interface UptimeCoreSetup { - route: IRouter; + router: IRouter; } export interface UptimeCorePlugins { - savedObjects: SavedObjectsLegacyService; usageCollection: UsageCollectionSetup; - xpack: any; } export interface UMBackendFrameworkAdapter { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/index.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/framework/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/framework/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts similarity index 95% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts index 7ac3db9d0f3d7..01fb174ec1524 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts @@ -24,10 +24,10 @@ export class UMKibanaBackendFrameworkAdapter implements UMBackendFrameworkAdapte }; switch (method) { case 'GET': - this.server.route.get(routeDefinition, handler); + this.server.router.get(routeDefinition, handler); break; case 'POST': - this.server.route.post(routeDefinition, handler); + this.server.router.post(routeDefinition, handler); break; default: throw new Error(`Handler for method ${method} is not defined`); @@ -35,7 +35,7 @@ export class UMKibanaBackendFrameworkAdapter implements UMBackendFrameworkAdapte } public registerGraphQLEndpoint(routePath: string, schema: GraphQLSchema): void { - this.server.route.post( + this.server.router.post( { path: routePath, validate: { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/index.ts b/x-pack/plugins/uptime/server/lib/adapters/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts similarity index 90% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts index 4104a9287a28d..c9f287ad279fd 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts @@ -9,9 +9,9 @@ import { CursorDirection, SortOrder, StatesIndexStatus, -} from '../../../../common/graphql/types'; +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMElasticsearchQueryFn } from '../framework'; -import { Snapshot } from '../../../../common/runtime_types'; +import { Snapshot } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; export interface MonitorStatesParams { dateRangeStart: string; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts index d264da2e7ec0c..fcb160e37bf4e 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts @@ -5,7 +5,10 @@ */ import { UMMonitorStatesAdapter, CursorPagination } from './adapter_types'; -import { INDEX_NAMES, CONTEXT_DEFAULTS } from '../../../../common/constants'; +import { + INDEX_NAMES, + CONTEXT_DEFAULTS, +} from '../../../../../../legacy/plugins/uptime/common/constants'; import { fetchPage } from './search'; import { MonitorGroupIterator } from './search/monitor_group_iterator'; import { getSnapshotCountHelper } from './get_snapshot_helper'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts similarity index 91% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts index 8bd21b77406df..95f3c4243f6dc 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts @@ -5,7 +5,7 @@ */ import { MonitorGroups, MonitorGroupIterator } from './search'; -import { Snapshot } from '../../../../common/runtime_types'; +import { Snapshot } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; const reduceItemsToCounts = (items: MonitorGroups[]) => { let down = 0; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/index.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts index d571a5a902539..968f2df686ed6 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts @@ -12,7 +12,7 @@ import { MonitorGroupsPage, } from '../fetch_page'; import { QueryContext } from '../../elasticsearch_monitor_states_adapter'; -import { MonitorSummary } from '../../../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { nextPagination, prevPagination, simpleQueryContext } from './test_helpers'; const simpleFixture: MonitorGroups[] = [ diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts similarity index 89% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts index d6fe5f82e735d..7df0c04f844fe 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts @@ -5,7 +5,10 @@ */ import { CursorPagination } from '../../adapter_types'; -import { CursorDirection, SortOrder } from '../../../../../../common/graphql/types'; +import { + CursorDirection, + SortOrder, +} from '../../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { QueryContext } from '../../elasticsearch_monitor_states_adapter'; export const prevPagination = (key: any): CursorPagination => { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts similarity index 98% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts index 093e105635c2c..4d4e4616f7e73 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts @@ -7,14 +7,14 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; import { getHistogramIntervalFormatted } from '../../../helper'; -import { INDEX_NAMES, STATES } from '../../../../../common/constants'; +import { INDEX_NAMES, STATES } from '../../../../../../../legacy/plugins/uptime/common/constants'; import { MonitorSummary, SummaryHistogram, Check, CursorDirection, SortOrder, -} from '../../../../../common/graphql/types'; +} from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { MonitorEnricher } from './fetch_page'; export const enrichMonitorGroups: MonitorEnricher = async ( diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts index 085c11f78b8f5..f3f30abbd3139 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts @@ -7,8 +7,12 @@ import { flatten } from 'lodash'; import { CursorPagination } from '../adapter_types'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; -import { QUERY } from '../../../../../common/constants'; -import { CursorDirection, MonitorSummary, SortOrder } from '../../../../../common/graphql/types'; +import { QUERY } from '../../../../../../../legacy/plugins/uptime/common/constants'; +import { + CursorDirection, + MonitorSummary, + SortOrder, +} from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { enrichMonitorGroups } from './enrich_monitor_groups'; import { MonitorGroupIterator } from './monitor_group_iterator'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts similarity index 95% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts index 8f5e26b75f56c..fc1567dd0916c 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts @@ -6,8 +6,8 @@ import { get, set } from 'lodash'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; -import { CursorDirection } from '../../../../../common/graphql/types'; -import { INDEX_NAMES } from '../../../../../common/constants'; +import { CursorDirection } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { INDEX_NAMES } from '../../../../../../../legacy/plugins/uptime/common/constants'; import { makeDateRangeFilter } from '../../../helper/make_date_rate_filter'; // This is the first phase of the query. In it, we find the most recent check groups that matched the given query. diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts similarity index 98% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts index 1de2dbb0e364d..924a361e0ed1a 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts @@ -7,7 +7,7 @@ import { QueryContext } from '../elasticsearch_monitor_states_adapter'; import { CursorPagination } from '../adapter_types'; import { fetchChunk } from './fetch_chunk'; -import { CursorDirection } from '../../../../../common/graphql/types'; +import { CursorDirection } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { MonitorGroups } from './fetch_page'; // Hardcoded chunk size for how many monitors to fetch at a time when querying diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts index b0060cbee17bb..944604c50aa38 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { INDEX_NAMES } from '../../../../../common/constants'; +import { INDEX_NAMES } from '../../../../../../../legacy/plugins/uptime/common/constants'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; -import { CursorDirection } from '../../../../../common/graphql/types'; +import { CursorDirection } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { MonitorGroups, MonitorLocCheckGroup } from './fetch_page'; import { makeDateRangeFilter } from '../../../helper/make_date_rate_filter'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap rename to x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json b/x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json rename to x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts similarity index 88% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts index b3d8cb855d55a..988f21db0034a 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts @@ -4,9 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MonitorChart, MonitorPageTitle } from '../../../../common/graphql/types'; +import { + MonitorChart, + MonitorPageTitle, +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMElasticsearchQueryFn } from '../framework'; -import { MonitorDetails, MonitorLocations } from '../../../../common/runtime_types'; +import { + MonitorDetails, + MonitorLocations, +} from '../../../../../../legacy/plugins/uptime/common/runtime_types'; export interface GetMonitorChartsDataParams { /** @member monitorId ID value for the selected monitor */ diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts similarity index 97% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts index b335205458965..e72834d3245d0 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts @@ -5,10 +5,17 @@ */ import { get } from 'lodash'; -import { INDEX_NAMES } from '../../../../common/constants'; -import { MonitorChart, Ping, LocationDurationLine } from '../../../../common/graphql/types'; +import { INDEX_NAMES } from '../../../../../../legacy/plugins/uptime/common/constants'; +import { + MonitorChart, + Ping, + LocationDurationLine, +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; import { getHistogramIntervalFormatted } from '../../helper'; -import { MonitorError, MonitorLocation } from '../../../../common/runtime_types'; +import { + MonitorError, + MonitorLocation, +} from '../../../../../../legacy/plugins/uptime/common/runtime_types'; import { UMMonitorsAdapter } from './adapter_types'; const formatStatusBuckets = (time: any, buckets: any, docCount: any) => { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/index.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitors/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap rename to x-pack/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts similarity index 91% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/adapter_types.ts rename to x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts index 81df1c7c0f631..ece88a248ed61 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts @@ -4,8 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DocCount, Ping, PingResults } from '../../../../common/graphql/types'; -import { HistogramResult } from '../../../../common/domain_types'; +import { + DocCount, + Ping, + PingResults, +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { HistogramResult } from '../../../../../../legacy/plugins/uptime/common/domain_types'; import { UMElasticsearchQueryFn } from '../framework'; export interface GetAllParams { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts index 6862bed8d2bdd..de24737d05acd 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts @@ -5,8 +5,12 @@ */ import { get } from 'lodash'; -import { INDEX_NAMES } from '../../../../common/constants'; -import { HttpBody, Ping, PingResults } from '../../../../common/graphql/types'; +import { INDEX_NAMES } from '../../../../../../legacy/plugins/uptime/common/constants'; +import { + HttpBody, + Ping, + PingResults, +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; import { parseFilterQuery, getFilterClause, getHistogramIntervalFormatted } from '../../helper'; import { UMPingsAdapter, HistogramQueryResult } from './adapter_types'; import { getHistogramInterval } from '../../helper/get_histogram_interval'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/index.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/pings/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json b/x-pack/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json rename to x-pack/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/index.ts b/x-pack/plugins/uptime/server/lib/adapters/saved_objects/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/saved_objects/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/types.ts b/x-pack/plugins/uptime/server/lib/adapters/saved_objects/types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/types.ts rename to x-pack/plugins/uptime/server/lib/adapters/saved_objects/types.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap rename to x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/index.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/telemetry/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts b/x-pack/plugins/uptime/server/lib/compose/kibana.ts similarity index 86% rename from x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts rename to x-pack/plugins/uptime/server/lib/compose/kibana.ts index cc11bf90da5f3..12a7ab3fc7b80 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts +++ b/x-pack/plugins/uptime/server/lib/compose/kibana.ts @@ -11,9 +11,9 @@ import { licenseCheck } from '../domains'; import { UMDomainLibs, UMServerLibs } from '../lib'; import { elasticsearchMonitorStatesAdapter } from '../adapters/monitor_states'; import { savedObjectsAdapter } from '../adapters/saved_objects'; -import { UptimeCorePlugins, UptimeCoreSetup } from '../adapters/framework'; +import { UptimeCoreSetup } from '../adapters/framework'; -export function compose(server: UptimeCoreSetup, plugins: UptimeCorePlugins): UMServerLibs { +export function compose(server: UptimeCoreSetup): UMServerLibs { const framework = new UMKibanaBackendFrameworkAdapter(server); const domainLibs: UMDomainLibs = { diff --git a/x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap b/x-pack/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap rename to x-pack/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/license.test.ts b/x-pack/plugins/uptime/server/lib/domains/__tests__/license.test.ts similarity index 93% rename from x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/license.test.ts rename to x-pack/plugins/uptime/server/lib/domains/__tests__/license.test.ts index 8c47b318da9bd..b842f55fc7579 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/license.test.ts +++ b/x-pack/plugins/uptime/server/lib/domains/__tests__/license.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ILicense } from '../../../../../../../plugins/licensing/server'; +import { ILicense } from '../../../../../licensing/server'; import { licenseCheck } from '../license'; describe('license check', () => { diff --git a/x-pack/legacy/plugins/uptime/server/lib/domains/index.ts b/x-pack/plugins/uptime/server/lib/domains/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/domains/index.ts rename to x-pack/plugins/uptime/server/lib/domains/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/domains/license.ts b/x-pack/plugins/uptime/server/lib/domains/license.ts similarity index 93% rename from x-pack/legacy/plugins/uptime/server/lib/domains/license.ts rename to x-pack/plugins/uptime/server/lib/domains/license.ts index b8b5722d79877..d272424379e48 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/domains/license.ts +++ b/x-pack/plugins/uptime/server/lib/domains/license.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ILicense } from '../../../../../../plugins/licensing/server'; +import { ILicense } from '../../../../licensing/server'; export interface UMLicenseStatusResponse { statusCode: number; diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap b/x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap rename to x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap b/x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap rename to x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts rename to x-pack/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts rename to x-pack/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts rename to x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts rename to x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/assert_close_to.ts b/x-pack/plugins/uptime/server/lib/helper/assert_close_to.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/assert_close_to.ts rename to x-pack/plugins/uptime/server/lib/helper/assert_close_to.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/get_filter_clause.ts b/x-pack/plugins/uptime/server/lib/helper/get_filter_clause.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/get_filter_clause.ts rename to x-pack/plugins/uptime/server/lib/helper/get_filter_clause.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts similarity index 90% rename from x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval.ts rename to x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts index 0dedc3e456f51..f13b44c553569 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval.ts +++ b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts @@ -5,7 +5,7 @@ */ import DateMath from '@elastic/datemath'; -import { QUERY } from '../../../common/constants'; +import { QUERY } from '../../../../../legacy/plugins/uptime/common/constants'; export const getHistogramInterval = ( dateRangeStart: string, diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts rename to x-pack/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/index.ts b/x-pack/plugins/uptime/server/lib/helper/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/index.ts rename to x-pack/plugins/uptime/server/lib/helper/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/make_date_rate_filter.ts b/x-pack/plugins/uptime/server/lib/helper/make_date_rate_filter.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/make_date_rate_filter.ts rename to x-pack/plugins/uptime/server/lib/helper/make_date_rate_filter.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/parse_filter_query.ts b/x-pack/plugins/uptime/server/lib/helper/parse_filter_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/parse_filter_query.ts rename to x-pack/plugins/uptime/server/lib/helper/parse_filter_query.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/lib.ts b/x-pack/plugins/uptime/server/lib/lib.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/lib.ts rename to x-pack/plugins/uptime/server/lib/lib.ts diff --git a/x-pack/plugins/uptime/server/plugin.ts b/x-pack/plugins/uptime/server/plugin.ts new file mode 100644 index 0000000000000..d197a4becb165 --- /dev/null +++ b/x-pack/plugins/uptime/server/plugin.ts @@ -0,0 +1,35 @@ +/* + * 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 { CoreSetup, Plugin, PluginInitializerContext } from '../../../../src/core/server'; +import { initServerWithKibana } from './kibana.index'; + +interface UptimePluginsSetup { + usageCollection: any; +} + +export class UptimePlugin implements Plugin { + public async setup(coreSetup: CoreSetup, plugins: UptimePluginsSetup) { + const { usageCollection } = plugins; + + initServerWithKibana( + { + router: coreSetup.http.createRouter(), + }, + { + usageCollection, + } + ); + } + + public start() {} + + public stop() {} +} + +export function plugin(_initializerContext: PluginInitializerContext) { + return new Plugin(); +} diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/create_route_with_auth.ts b/x-pack/plugins/uptime/server/rest_api/create_route_with_auth.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/create_route_with_auth.ts rename to x-pack/plugins/uptime/server/rest_api/create_route_with_auth.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/index.ts b/x-pack/plugins/uptime/server/rest_api/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/index.ts rename to x-pack/plugins/uptime/server/rest_api/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts b/x-pack/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts rename to x-pack/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/index.ts b/x-pack/plugins/uptime/server/rest_api/index_pattern/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/index.ts rename to x-pack/plugins/uptime/server/rest_api/index_pattern/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/monitors/index.ts b/x-pack/plugins/uptime/server/rest_api/monitors/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/monitors/index.ts rename to x-pack/plugins/uptime/server/rest_api/monitors/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/monitors/monitor_locations.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/monitors/monitor_locations.ts rename to x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/monitors/monitors_details.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/monitors/monitors_details.ts rename to x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/pings/get_all.ts b/x-pack/plugins/uptime/server/rest_api/pings/get_all.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/pings/get_all.ts rename to x-pack/plugins/uptime/server/rest_api/pings/get_all.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/pings/index.ts b/x-pack/plugins/uptime/server/rest_api/pings/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/pings/index.ts rename to x-pack/plugins/uptime/server/rest_api/pings/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts b/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts rename to x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/snapshot/index.ts b/x-pack/plugins/uptime/server/rest_api/snapshot/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/snapshot/index.ts rename to x-pack/plugins/uptime/server/rest_api/snapshot/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/telemetry/index.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/telemetry/index.ts rename to x-pack/plugins/uptime/server/rest_api/telemetry/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts rename to x-pack/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts rename to x-pack/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/types.ts b/x-pack/plugins/uptime/server/rest_api/types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/types.ts rename to x-pack/plugins/uptime/server/rest_api/types.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/uptime_route_wrapper.ts b/x-pack/plugins/uptime/server/rest_api/uptime_route_wrapper.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/uptime_route_wrapper.ts rename to x-pack/plugins/uptime/server/rest_api/uptime_route_wrapper.ts diff --git a/x-pack/legacy/plugins/uptime/server/uptime_server.ts b/x-pack/plugins/uptime/server/uptime_server.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/uptime_server.ts rename to x-pack/plugins/uptime/server/uptime_server.ts diff --git a/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts b/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts index 02fd3fd630d4b..17256574f60b9 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts +++ b/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts @@ -7,7 +7,7 @@ import { snapshotHistogramQueryString } from '../../../../../legacy/plugins/uptime/public/queries/snapshot_histogram_query'; import { expectFixtureEql } from './helpers/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { assertCloseTo } from '../../../../../legacy/plugins/uptime/server/lib/helper'; +import { assertCloseTo } from '../../../../../plugins/uptime/server/lib/helper'; export default function({ getService }: FtrProviderContext) { describe('snapshotHistogram', () => { From a6caa0c875bbf433f3bf671e317684ad612a95cf Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 3 Jan 2020 16:44:55 -0500 Subject: [PATCH 02/36] Re-add feature registration code. --- x-pack/plugins/uptime/kibana.json | 2 +- x-pack/plugins/uptime/server/kibana.index.ts | 4 +- .../lib/adapters/framework/adapter_types.ts | 2 + x-pack/plugins/uptime/server/plugin.ts | 11 +++-- .../plugins/uptime/server/register_feature.ts | 40 +++++++++++++++++++ 5 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 x-pack/plugins/uptime/server/register_feature.ts diff --git a/x-pack/plugins/uptime/kibana.json b/x-pack/plugins/uptime/kibana.json index 711c8b806a436..dd61716325afc 100644 --- a/x-pack/plugins/uptime/kibana.json +++ b/x-pack/plugins/uptime/kibana.json @@ -2,7 +2,7 @@ "configPath": ["xpack"], "id": "uptime", "kibanaVersion": "kibana", - "requiredPlugins": ["licensing", "usageCollection"], + "requiredPlugins": ["features", "licensing", "usageCollection"], "server": true, "ui": false, "version": "8.0.0" diff --git a/x-pack/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts index f2599a74ae1fa..1ee6e1c1d1a2e 100644 --- a/x-pack/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -9,6 +9,7 @@ import { KibanaTelemetryAdapter } from './lib/adapters/telemetry'; import { compose } from './lib/compose/kibana'; import { initUptimeServer } from './uptime_server'; import { UptimeCorePlugins, UptimeCoreSetup } from './lib/adapters/framework'; +import { registerFeature } from './register_feature'; export interface KibanaRouteOptions { path: string; @@ -23,9 +24,10 @@ export interface KibanaServer extends Server { } export const initServerWithKibana = (server: UptimeCoreSetup, plugins: UptimeCorePlugins) => { - const { usageCollection } = plugins; + const { features, usageCollection } = plugins; const libs = compose(server); KibanaTelemetryAdapter.registerUsageCollector(usageCollection); + registerFeature(features); initUptimeServer(libs); }; diff --git a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts index 7fec73bdcc01a..ee4334d560049 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts @@ -14,6 +14,7 @@ import { } from 'src/core/server'; import { ObjectType } from '@kbn/config-schema'; import { UMKibanaRoute } from '../../../rest_api'; +import { PluginSetupContract } from '../../../../../features/server'; export interface UMFrameworkRouteOptions< P extends ObjectType, @@ -47,6 +48,7 @@ export interface UptimeCoreSetup { } export interface UptimeCorePlugins { + features: PluginSetupContract; usageCollection: UsageCollectionSetup; } diff --git a/x-pack/plugins/uptime/server/plugin.ts b/x-pack/plugins/uptime/server/plugin.ts index d197a4becb165..f7a67161c4830 100644 --- a/x-pack/plugins/uptime/server/plugin.ts +++ b/x-pack/plugins/uptime/server/plugin.ts @@ -6,22 +6,21 @@ import { CoreSetup, Plugin, PluginInitializerContext } from '../../../../src/core/server'; import { initServerWithKibana } from './kibana.index'; +import { PluginSetupContract } from '../../features/server'; +import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/server'; interface UptimePluginsSetup { - usageCollection: any; + features: PluginSetupContract; + usageCollection: UsageCollectionSetup; } export class UptimePlugin implements Plugin { public async setup(coreSetup: CoreSetup, plugins: UptimePluginsSetup) { - const { usageCollection } = plugins; - initServerWithKibana( { router: coreSetup.http.createRouter(), }, - { - usageCollection, - } + plugins ); } diff --git a/x-pack/plugins/uptime/server/register_feature.ts b/x-pack/plugins/uptime/server/register_feature.ts new file mode 100644 index 0000000000000..3562e138aafb3 --- /dev/null +++ b/x-pack/plugins/uptime/server/register_feature.ts @@ -0,0 +1,40 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { PluginSetupContract } from '../../features/server'; +import { PLUGIN } from '../../../legacy/plugins/uptime/common/constants'; + +export const registerFeature = (features: PluginSetupContract) => { + features.registerFeature({ + id: PLUGIN.ID, + name: i18n.translate('xpack.uptime.featureRegistry.uptimeFeatureName', { + defaultMessage: 'Uptime', + }), + navLinkId: PLUGIN.ID, + icon: 'uptimeApp', + app: ['uptime', 'kibana'], + catalogue: ['uptime'], + privileges: { + all: { + api: ['uptime'], + savedObject: { + all: [], + read: [], + }, + ui: ['save'], + }, + read: { + api: ['uptime'], + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + }, + }); +}; From 66873c168e607a57c52f4b85939915bc23bc3da9 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 3 Jan 2020 09:09:05 -0500 Subject: [PATCH 03/36] Move uptime legacy server to plugins directory. --- x-pack/legacy/plugins/uptime/index.ts | 19 ---------- .../plugins/uptime/scripts/graphql_schemas.ts | 15 -------- x-pack/legacy/plugins/uptime/server/plugin.ts | 19 ---------- x-pack/plugins/uptime/kibana.json | 9 +++++ .../uptime/server/graphql/constants.ts | 0 .../plugins/uptime/server/graphql/index.ts | 0 .../server/graphql/monitor_states/index.ts | 0 .../graphql/monitor_states/resolvers.ts | 6 ++-- .../graphql/monitor_states/schema.gql.ts | 0 .../uptime/server/graphql/monitors/index.ts | 0 .../server/graphql/monitors/resolvers.ts | 8 ++--- .../server/graphql/monitors/schema.gql.ts | 0 .../uptime/server/graphql/pings/index.ts | 0 .../uptime/server/graphql/pings/resolvers.ts | 8 +++-- .../uptime/server/graphql/pings/schema.gql.ts | 0 .../plugins/uptime/server/graphql/types.ts | 0 .../__tests__/parse_literal.test.ts | 0 .../__tests__/parse_value.test.ts | 0 .../__tests__/serialize.test.ts | 0 .../graphql/unsigned_int_scalar/index.ts | 0 .../graphql/unsigned_int_scalar/resolvers.ts | 0 .../graphql/unsigned_int_scalar/schema.gql.ts | 0 .../plugins/uptime/server/index.ts | 5 ++- .../plugins/uptime/server/kibana.index.ts | 35 ++----------------- .../lib/adapters/framework/adapter_types.ts | 5 +-- .../server/lib/adapters/framework/index.ts | 0 .../framework/kibana_framework_adapter.ts | 6 ++-- .../uptime/server/lib/adapters/index.ts | 0 .../get_snapshot_helper.test.ts.snap | 0 .../__tests__/get_snapshot_helper.test.ts | 0 .../adapters/monitor_states/adapter_types.ts | 4 +-- .../elasticsearch_monitor_states_adapter.ts | 5 ++- .../monitor_states/get_snapshot_helper.ts | 2 +- .../lib/adapters/monitor_states/index.ts | 0 .../search/__tests__/fetch_page.test.ts | 2 +- .../__tests__/find_potential_matches_test.ts | 0 .../__tests__/monitor_group_iterator.test.ts | 0 .../search/__tests__/test_helpers.ts | 5 ++- .../search/enrich_monitor_groups.ts | 4 +-- .../monitor_states/search/fetch_chunk.ts | 0 .../monitor_states/search/fetch_page.ts | 8 +++-- .../search/find_potential_matches.ts | 4 +-- .../adapters/monitor_states/search/index.ts | 0 .../search/monitor_group_iterator.ts | 2 +- .../search/refine_potential_matches.ts | 4 +-- ...lasticsearch_monitors_adapter.test.ts.snap | 0 .../elasticsearch_monitors_adapter.test.ts | 0 .../__tests__/monitor_charts_mock.json | 0 .../lib/adapters/monitors/adapter_types.ts | 10 ++++-- .../elasticsearch_monitors_adapter.ts | 13 +++++-- .../server/lib/adapters/monitors/index.ts | 0 .../elasticsearch_pings_adapter.test.ts.snap | 0 .../elasticsearch_pings_adapter.test.ts | 0 .../lib/adapters/pings/adapter_types.ts | 8 +++-- .../pings/elasticsearch_pings_adapter.ts | 8 +++-- .../uptime/server/lib/adapters/pings/index.ts | 0 .../heartbeat_index_pattern.json | 0 .../lib/adapters/saved_objects/index.ts | 0 .../kibana_saved_objects_adapter.ts | 0 .../lib/adapters/saved_objects/types.ts | 0 .../kibana_telemetry_adapter.test.ts.snap | 0 .../kibana_telemetry_adapter.test.ts | 0 .../server/lib/adapters/telemetry/index.ts | 0 .../telemetry/kibana_telemetry_adapter.ts | 0 .../uptime/server/lib/compose/kibana.ts | 4 +-- .../__snapshots__/license.test.ts.snap | 0 .../lib/domains/__tests__/license.test.ts | 2 +- .../uptime/server/lib/domains/index.ts | 0 .../uptime/server/lib/domains/license.ts | 2 +- .../assert_close_to.test.ts.snap | 0 .../get_filter_clause.test.ts.snap | 0 .../helper/__test__/assert_close_to.test.ts | 0 .../helper/__test__/get_filter_clause.test.ts | 0 .../__test__/get_histogram_interval.test.ts | 0 .../get_histogram_interval_formatted.test.ts | 0 .../server/lib/helper/assert_close_to.ts | 0 .../server/lib/helper/get_filter_clause.ts | 0 .../lib/helper/get_histogram_interval.ts | 2 +- .../get_histogram_interval_formatted.ts | 0 .../plugins/uptime/server/lib/helper/index.ts | 0 .../lib/helper/make_date_rate_filter.ts | 0 .../server/lib/helper/parse_filter_query.ts | 0 .../plugins/uptime/server/lib/lib.ts | 0 x-pack/plugins/uptime/server/plugin.ts | 35 +++++++++++++++++++ .../server/rest_api/create_route_with_auth.ts | 0 .../plugins/uptime/server/rest_api/index.ts | 0 .../index_pattern/get_index_pattern.ts | 0 .../server/rest_api/index_pattern/index.ts | 0 .../uptime/server/rest_api/monitors/index.ts | 0 .../rest_api/monitors/monitor_locations.ts | 0 .../rest_api/monitors/monitors_details.ts | 0 .../uptime/server/rest_api/pings/get_all.ts | 0 .../uptime/server/rest_api/pings/index.ts | 0 .../rest_api/snapshot/get_snapshot_count.ts | 0 .../uptime/server/rest_api/snapshot/index.ts | 0 .../uptime/server/rest_api/telemetry/index.ts | 0 .../rest_api/telemetry/log_monitor_page.ts | 0 .../rest_api/telemetry/log_overview_page.ts | 0 .../plugins/uptime/server/rest_api/types.ts | 0 .../server/rest_api/uptime_route_wrapper.ts | 0 .../plugins/uptime/server/uptime_server.ts | 0 .../apis/uptime/graphql/snapshot_histogram.ts | 2 +- 102 files changed, 128 insertions(+), 133 deletions(-) delete mode 100644 x-pack/legacy/plugins/uptime/scripts/graphql_schemas.ts delete mode 100644 x-pack/legacy/plugins/uptime/server/plugin.ts create mode 100644 x-pack/plugins/uptime/kibana.json rename x-pack/{legacy => }/plugins/uptime/server/graphql/constants.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitor_states/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitor_states/resolvers.ts (89%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitor_states/schema.gql.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitors/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitors/resolvers.ts (90%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/monitors/schema.gql.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/pings/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/pings/resolvers.ts (86%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/pings/schema.gql.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/index.ts (60%) rename x-pack/{legacy => }/plugins/uptime/server/kibana.index.ts (56%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/framework/adapter_types.ts (92%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/framework/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts (95%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts (90%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts (91%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts (89%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts (98%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts (95%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts (98%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts (88%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts (97%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/monitors/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/adapter_types.ts (91%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts (96%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/pings/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/saved_objects/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/saved_objects/types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/telemetry/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/compose/kibana.ts (86%) rename x-pack/{legacy => }/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/domains/__tests__/license.test.ts (93%) rename x-pack/{legacy => }/plugins/uptime/server/lib/domains/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/domains/license.ts (93%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/assert_close_to.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/get_filter_clause.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/get_histogram_interval.ts (90%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/make_date_rate_filter.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/helper/parse_filter_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/lib/lib.ts (100%) create mode 100644 x-pack/plugins/uptime/server/plugin.ts rename x-pack/{legacy => }/plugins/uptime/server/rest_api/create_route_with_auth.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/index_pattern/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/monitors/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/monitors/monitor_locations.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/monitors/monitors_details.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/pings/get_all.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/pings/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/snapshot/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/telemetry/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/rest_api/uptime_route_wrapper.ts (100%) rename x-pack/{legacy => }/plugins/uptime/server/uptime_server.ts (100%) diff --git a/x-pack/legacy/plugins/uptime/index.ts b/x-pack/legacy/plugins/uptime/index.ts index e090a2c85e136..20a2c8514ca70 100644 --- a/x-pack/legacy/plugins/uptime/index.ts +++ b/x-pack/legacy/plugins/uptime/index.ts @@ -6,9 +6,7 @@ import { i18n } from '@kbn/i18n'; import { resolve } from 'path'; -import { PluginInitializerContext } from 'src/core/server'; import { PLUGIN } from './common/constants'; -import { KibanaServer, plugin } from './server'; export const uptime = (kibana: any) => new kibana.Plugin({ @@ -33,21 +31,4 @@ export const uptime = (kibana: any) => }, home: ['plugins/uptime/register_feature'], }, - init(server: KibanaServer) { - const initializerContext = {} as PluginInitializerContext; - const { savedObjects } = server; - const { xpack_main } = server.plugins; - const { usageCollection } = server.newPlatform.setup.plugins; - - plugin(initializerContext).setup( - { - route: server.newPlatform.setup.core.http.createRouter(), - }, - { - savedObjects, - usageCollection, - xpack: xpack_main, - } - ); - }, }); diff --git a/x-pack/legacy/plugins/uptime/scripts/graphql_schemas.ts b/x-pack/legacy/plugins/uptime/scripts/graphql_schemas.ts deleted file mode 100644 index c337cf098e48d..0000000000000 --- a/x-pack/legacy/plugins/uptime/scripts/graphql_schemas.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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 { buildSchemaFromTypeDefinitions } from 'graphql-tools'; -import { typeDefs } from '../server/graphql'; - -export const schemas = [...typeDefs]; - -// this default export is used to feed the combined types to the gql-gen tool -// which generates the corresponding typescript types -// eslint-disable-next-line import/no-default-export -export default buildSchemaFromTypeDefinitions(schemas); diff --git a/x-pack/legacy/plugins/uptime/server/plugin.ts b/x-pack/legacy/plugins/uptime/server/plugin.ts deleted file mode 100644 index acecce305e7cb..0000000000000 --- a/x-pack/legacy/plugins/uptime/server/plugin.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 { PluginInitializerContext } from 'src/core/server'; -import { initServerWithKibana } from './kibana.index'; -import { UptimeCoreSetup, UptimeCorePlugins } from './lib/adapters/framework'; - -export function plugin(initializerContext: PluginInitializerContext) { - return new Plugin(); -} - -export class Plugin { - public setup(core: UptimeCoreSetup, plugins: UptimeCorePlugins) { - initServerWithKibana(core, plugins); - } -} diff --git a/x-pack/plugins/uptime/kibana.json b/x-pack/plugins/uptime/kibana.json new file mode 100644 index 0000000000000..711c8b806a436 --- /dev/null +++ b/x-pack/plugins/uptime/kibana.json @@ -0,0 +1,9 @@ +{ + "configPath": ["xpack"], + "id": "uptime", + "kibanaVersion": "kibana", + "requiredPlugins": ["licensing", "usageCollection"], + "server": true, + "ui": false, + "version": "8.0.0" +} diff --git a/x-pack/legacy/plugins/uptime/server/graphql/constants.ts b/x-pack/plugins/uptime/server/graphql/constants.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/constants.ts rename to x-pack/plugins/uptime/server/graphql/constants.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/index.ts b/x-pack/plugins/uptime/server/graphql/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/index.ts rename to x-pack/plugins/uptime/server/graphql/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/index.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/monitor_states/index.ts rename to x-pack/plugins/uptime/server/graphql/monitor_states/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts similarity index 89% rename from x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts rename to x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts index 8ddb07b3093d0..713d3f2b6392a 100644 --- a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts @@ -6,13 +6,13 @@ import { CreateUMGraphQLResolvers, UMContext } from '../types'; import { UMServerLibs } from '../../lib/lib'; -import { UMResolver } from '../../../common/graphql/resolver_types'; +import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; import { GetMonitorStatesQueryArgs, MonitorSummaryResult, StatesIndexStatus, -} from '../../../common/graphql/types'; -import { CONTEXT_DEFAULTS } from '../../../common/constants/context_defaults'; +} from '../../../../../legacy/plugins/uptime/common/graphql/types'; +import { CONTEXT_DEFAULTS } from '../../../../../legacy/plugins/uptime/common/constants/context_defaults'; export type UMGetMonitorStatesResolver = UMResolver< MonitorSummaryResult | Promise, diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitor_states/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/monitor_states/schema.gql.ts rename to x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitors/index.ts b/x-pack/plugins/uptime/server/graphql/monitors/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/monitors/index.ts rename to x-pack/plugins/uptime/server/graphql/monitors/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitors/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts similarity index 90% rename from x-pack/legacy/plugins/uptime/server/graphql/monitors/resolvers.ts rename to x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts index 8b685d8e08a2b..02ad2141e27b8 100644 --- a/x-pack/legacy/plugins/uptime/server/graphql/monitors/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { UMGqlRange } from '../../../common/domain_types'; -import { UMResolver } from '../../../common/graphql/resolver_types'; +import { UMGqlRange } from '../../../../../legacy/plugins/uptime/common/domain_types'; +import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; import { FilterBar, GetFilterBarQueryArgs, @@ -16,10 +16,10 @@ import { MonitorPageTitle, Ping, GetSnapshotHistogramQueryArgs, -} from '../../../common/graphql/types'; +} from '../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMServerLibs } from '../../lib/lib'; import { CreateUMGraphQLResolvers, UMContext } from '../types'; -import { HistogramResult } from '../../../common/domain_types'; +import { HistogramResult } from '../../../../../legacy/plugins/uptime/common/domain_types'; export type UMMonitorsResolver = UMResolver, any, UMGqlRange, UMContext>; diff --git a/x-pack/legacy/plugins/uptime/server/graphql/monitors/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/monitors/schema.gql.ts rename to x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/pings/index.ts b/x-pack/plugins/uptime/server/graphql/pings/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/pings/index.ts rename to x-pack/plugins/uptime/server/graphql/pings/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/pings/resolvers.ts b/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts similarity index 86% rename from x-pack/legacy/plugins/uptime/server/graphql/pings/resolvers.ts rename to x-pack/plugins/uptime/server/graphql/pings/resolvers.ts index 373e1467433a2..13dace5da8f12 100644 --- a/x-pack/legacy/plugins/uptime/server/graphql/pings/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts @@ -4,8 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { UMResolver } from '../../../common/graphql/resolver_types'; -import { AllPingsQueryArgs, DocCount, PingResults } from '../../../common/graphql/types'; +import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; +import { + AllPingsQueryArgs, + DocCount, + PingResults, +} from '../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMServerLibs } from '../../lib/lib'; import { UMContext } from '../types'; import { CreateUMGraphQLResolvers } from '../types'; diff --git a/x-pack/legacy/plugins/uptime/server/graphql/pings/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/pings/schema.gql.ts rename to x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/types.ts b/x-pack/plugins/uptime/server/graphql/types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/types.ts rename to x-pack/plugins/uptime/server/graphql/types.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_literal.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/parse_value.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/__tests__/serialize.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/resolvers.ts diff --git a/x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts rename to x-pack/plugins/uptime/server/graphql/unsigned_int_scalar/schema.gql.ts diff --git a/x-pack/legacy/plugins/uptime/server/index.ts b/x-pack/plugins/uptime/server/index.ts similarity index 60% rename from x-pack/legacy/plugins/uptime/server/index.ts rename to x-pack/plugins/uptime/server/index.ts index d063f0d8c2288..275983c259f9d 100644 --- a/x-pack/legacy/plugins/uptime/server/index.ts +++ b/x-pack/plugins/uptime/server/index.ts @@ -4,5 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ +import { PluginInitializerContext } from '../../../../src/core/server'; +import { UptimePlugin } from './plugin'; + export { initServerWithKibana, KibanaServer } from './kibana.index'; -export { plugin } from './plugin'; +export const plugin = (_initializerContext: PluginInitializerContext) => new UptimePlugin(); diff --git a/x-pack/legacy/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts similarity index 56% rename from x-pack/legacy/plugins/uptime/server/kibana.index.ts rename to x-pack/plugins/uptime/server/kibana.index.ts index 73fabc629946b..f2599a74ae1fa 100644 --- a/x-pack/legacy/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -4,9 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { i18n } from '@kbn/i18n'; import { Request, Server } from 'hapi'; -import { PLUGIN } from '../common/constants'; import { KibanaTelemetryAdapter } from './lib/adapters/telemetry'; import { compose } from './lib/compose/kibana'; import { initUptimeServer } from './uptime_server'; @@ -25,38 +23,9 @@ export interface KibanaServer extends Server { } export const initServerWithKibana = (server: UptimeCoreSetup, plugins: UptimeCorePlugins) => { - const { usageCollection, xpack } = plugins; - const libs = compose(server, plugins); + const { usageCollection } = plugins; + const libs = compose(server); KibanaTelemetryAdapter.registerUsageCollector(usageCollection); initUptimeServer(libs); - - xpack.registerFeature({ - id: PLUGIN.ID, - name: i18n.translate('xpack.uptime.featureRegistry.uptimeFeatureName', { - defaultMessage: 'Uptime', - }), - navLinkId: PLUGIN.ID, - icon: 'uptimeApp', - app: ['uptime', 'kibana'], - catalogue: ['uptime'], - privileges: { - all: { - api: ['uptime'], - savedObject: { - all: [], - read: [], - }, - ui: ['save'], - }, - read: { - api: ['uptime'], - savedObject: { - all: [], - read: [], - }, - ui: [], - }, - }, - }); }; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts similarity index 92% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts rename to x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts index b490bf17e292c..7fec73bdcc01a 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts @@ -7,7 +7,6 @@ import { GraphQLSchema } from 'graphql'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; import { - SavedObjectsLegacyService, RequestHandler, IRouter, CallAPIOptions, @@ -44,13 +43,11 @@ export type UMSavedObjectsQueryFn = ( ) => Promise | T; export interface UptimeCoreSetup { - route: IRouter; + router: IRouter; } export interface UptimeCorePlugins { - savedObjects: SavedObjectsLegacyService; usageCollection: UsageCollectionSetup; - xpack: any; } export interface UMBackendFrameworkAdapter { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/index.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/framework/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/framework/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts similarity index 95% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts index 7ac3db9d0f3d7..01fb174ec1524 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts @@ -24,10 +24,10 @@ export class UMKibanaBackendFrameworkAdapter implements UMBackendFrameworkAdapte }; switch (method) { case 'GET': - this.server.route.get(routeDefinition, handler); + this.server.router.get(routeDefinition, handler); break; case 'POST': - this.server.route.post(routeDefinition, handler); + this.server.router.post(routeDefinition, handler); break; default: throw new Error(`Handler for method ${method} is not defined`); @@ -35,7 +35,7 @@ export class UMKibanaBackendFrameworkAdapter implements UMBackendFrameworkAdapte } public registerGraphQLEndpoint(routePath: string, schema: GraphQLSchema): void { - this.server.route.post( + this.server.router.post( { path: routePath, validate: { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/index.ts b/x-pack/plugins/uptime/server/lib/adapters/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/__tests__/__snapshots__/get_snapshot_helper.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/__tests__/get_snapshot_helper.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts similarity index 90% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts index 4104a9287a28d..c9f287ad279fd 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts @@ -9,9 +9,9 @@ import { CursorDirection, SortOrder, StatesIndexStatus, -} from '../../../../common/graphql/types'; +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMElasticsearchQueryFn } from '../framework'; -import { Snapshot } from '../../../../common/runtime_types'; +import { Snapshot } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; export interface MonitorStatesParams { dateRangeStart: string; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts index d264da2e7ec0c..fcb160e37bf4e 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts @@ -5,7 +5,10 @@ */ import { UMMonitorStatesAdapter, CursorPagination } from './adapter_types'; -import { INDEX_NAMES, CONTEXT_DEFAULTS } from '../../../../common/constants'; +import { + INDEX_NAMES, + CONTEXT_DEFAULTS, +} from '../../../../../../legacy/plugins/uptime/common/constants'; import { fetchPage } from './search'; import { MonitorGroupIterator } from './search/monitor_group_iterator'; import { getSnapshotCountHelper } from './get_snapshot_helper'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts similarity index 91% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts index 8bd21b77406df..95f3c4243f6dc 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts @@ -5,7 +5,7 @@ */ import { MonitorGroups, MonitorGroupIterator } from './search'; -import { Snapshot } from '../../../../common/runtime_types'; +import { Snapshot } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; const reduceItemsToCounts = (items: MonitorGroups[]) => { let down = 0; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/index.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts index d571a5a902539..968f2df686ed6 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts @@ -12,7 +12,7 @@ import { MonitorGroupsPage, } from '../fetch_page'; import { QueryContext } from '../../elasticsearch_monitor_states_adapter'; -import { MonitorSummary } from '../../../../../../common/graphql/types'; +import { MonitorSummary } from '../../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { nextPagination, prevPagination, simpleQueryContext } from './test_helpers'; const simpleFixture: MonitorGroups[] = [ diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/find_potential_matches_test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/monitor_group_iterator.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts similarity index 89% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts index d6fe5f82e735d..7df0c04f844fe 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts @@ -5,7 +5,10 @@ */ import { CursorPagination } from '../../adapter_types'; -import { CursorDirection, SortOrder } from '../../../../../../common/graphql/types'; +import { + CursorDirection, + SortOrder, +} from '../../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { QueryContext } from '../../elasticsearch_monitor_states_adapter'; export const prevPagination = (key: any): CursorPagination => { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts similarity index 98% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts index 093e105635c2c..4d4e4616f7e73 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts @@ -7,14 +7,14 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; import { getHistogramIntervalFormatted } from '../../../helper'; -import { INDEX_NAMES, STATES } from '../../../../../common/constants'; +import { INDEX_NAMES, STATES } from '../../../../../../../legacy/plugins/uptime/common/constants'; import { MonitorSummary, SummaryHistogram, Check, CursorDirection, SortOrder, -} from '../../../../../common/graphql/types'; +} from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { MonitorEnricher } from './fetch_page'; export const enrichMonitorGroups: MonitorEnricher = async ( diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_chunk.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts index 085c11f78b8f5..f3f30abbd3139 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts @@ -7,8 +7,12 @@ import { flatten } from 'lodash'; import { CursorPagination } from '../adapter_types'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; -import { QUERY } from '../../../../../common/constants'; -import { CursorDirection, MonitorSummary, SortOrder } from '../../../../../common/graphql/types'; +import { QUERY } from '../../../../../../../legacy/plugins/uptime/common/constants'; +import { + CursorDirection, + MonitorSummary, + SortOrder, +} from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { enrichMonitorGroups } from './enrich_monitor_groups'; import { MonitorGroupIterator } from './monitor_group_iterator'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts similarity index 95% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts index 8f5e26b75f56c..fc1567dd0916c 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts @@ -6,8 +6,8 @@ import { get, set } from 'lodash'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; -import { CursorDirection } from '../../../../../common/graphql/types'; -import { INDEX_NAMES } from '../../../../../common/constants'; +import { CursorDirection } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { INDEX_NAMES } from '../../../../../../../legacy/plugins/uptime/common/constants'; import { makeDateRangeFilter } from '../../../helper/make_date_rate_filter'; // This is the first phase of the query. In it, we find the most recent check groups that matched the given query. diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts similarity index 98% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts index 1de2dbb0e364d..924a361e0ed1a 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts @@ -7,7 +7,7 @@ import { QueryContext } from '../elasticsearch_monitor_states_adapter'; import { CursorPagination } from '../adapter_types'; import { fetchChunk } from './fetch_chunk'; -import { CursorDirection } from '../../../../../common/graphql/types'; +import { CursorDirection } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { MonitorGroups } from './fetch_page'; // Hardcoded chunk size for how many monitors to fetch at a time when querying diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts index b0060cbee17bb..944604c50aa38 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { INDEX_NAMES } from '../../../../../common/constants'; +import { INDEX_NAMES } from '../../../../../../../legacy/plugins/uptime/common/constants'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; -import { CursorDirection } from '../../../../../common/graphql/types'; +import { CursorDirection } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; import { MonitorGroups, MonitorLocCheckGroup } from './fetch_page'; import { makeDateRangeFilter } from '../../../helper/make_date_rate_filter'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap rename to x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/__snapshots__/elasticsearch_monitors_adapter.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/elasticsearch_monitors_adapter.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json b/x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json rename to x-pack/plugins/uptime/server/lib/adapters/monitors/__tests__/monitor_charts_mock.json diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts similarity index 88% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts index b3d8cb855d55a..988f21db0034a 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts @@ -4,9 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MonitorChart, MonitorPageTitle } from '../../../../common/graphql/types'; +import { + MonitorChart, + MonitorPageTitle, +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMElasticsearchQueryFn } from '../framework'; -import { MonitorDetails, MonitorLocations } from '../../../../common/runtime_types'; +import { + MonitorDetails, + MonitorLocations, +} from '../../../../../../legacy/plugins/uptime/common/runtime_types'; export interface GetMonitorChartsDataParams { /** @member monitorId ID value for the selected monitor */ diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts similarity index 97% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts index b335205458965..e72834d3245d0 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts @@ -5,10 +5,17 @@ */ import { get } from 'lodash'; -import { INDEX_NAMES } from '../../../../common/constants'; -import { MonitorChart, Ping, LocationDurationLine } from '../../../../common/graphql/types'; +import { INDEX_NAMES } from '../../../../../../legacy/plugins/uptime/common/constants'; +import { + MonitorChart, + Ping, + LocationDurationLine, +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; import { getHistogramIntervalFormatted } from '../../helper'; -import { MonitorError, MonitorLocation } from '../../../../common/runtime_types'; +import { + MonitorError, + MonitorLocation, +} from '../../../../../../legacy/plugins/uptime/common/runtime_types'; import { UMMonitorsAdapter } from './adapter_types'; const formatStatusBuckets = (time: any, buckets: any, docCount: any) => { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/index.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/monitors/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/monitors/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap rename to x-pack/plugins/uptime/server/lib/adapters/pings/__tests__/__snapshots__/elasticsearch_pings_adapter.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/pings/__tests__/elasticsearch_pings_adapter.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts similarity index 91% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/adapter_types.ts rename to x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts index 81df1c7c0f631..ece88a248ed61 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts @@ -4,8 +4,12 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DocCount, Ping, PingResults } from '../../../../common/graphql/types'; -import { HistogramResult } from '../../../../common/domain_types'; +import { + DocCount, + Ping, + PingResults, +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { HistogramResult } from '../../../../../../legacy/plugins/uptime/common/domain_types'; import { UMElasticsearchQueryFn } from '../framework'; export interface GetAllParams { diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts similarity index 96% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts index 6862bed8d2bdd..de24737d05acd 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts @@ -5,8 +5,12 @@ */ import { get } from 'lodash'; -import { INDEX_NAMES } from '../../../../common/constants'; -import { HttpBody, Ping, PingResults } from '../../../../common/graphql/types'; +import { INDEX_NAMES } from '../../../../../../legacy/plugins/uptime/common/constants'; +import { + HttpBody, + Ping, + PingResults, +} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; import { parseFilterQuery, getFilterClause, getHistogramIntervalFormatted } from '../../helper'; import { UMPingsAdapter, HistogramQueryResult } from './adapter_types'; import { getHistogramInterval } from '../../helper/get_histogram_interval'; diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/pings/index.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/pings/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/pings/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json b/x-pack/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json rename to x-pack/plugins/uptime/server/lib/adapters/saved_objects/heartbeat_index_pattern.json diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/index.ts b/x-pack/plugins/uptime/server/lib/adapters/saved_objects/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/saved_objects/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/saved_objects/kibana_saved_objects_adapter.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/types.ts b/x-pack/plugins/uptime/server/lib/adapters/saved_objects/types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/saved_objects/types.ts rename to x-pack/plugins/uptime/server/lib/adapters/saved_objects/types.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap rename to x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts rename to x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/index.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/index.ts rename to x-pack/plugins/uptime/server/lib/adapters/telemetry/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts rename to x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts b/x-pack/plugins/uptime/server/lib/compose/kibana.ts similarity index 86% rename from x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts rename to x-pack/plugins/uptime/server/lib/compose/kibana.ts index cc11bf90da5f3..12a7ab3fc7b80 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/compose/kibana.ts +++ b/x-pack/plugins/uptime/server/lib/compose/kibana.ts @@ -11,9 +11,9 @@ import { licenseCheck } from '../domains'; import { UMDomainLibs, UMServerLibs } from '../lib'; import { elasticsearchMonitorStatesAdapter } from '../adapters/monitor_states'; import { savedObjectsAdapter } from '../adapters/saved_objects'; -import { UptimeCorePlugins, UptimeCoreSetup } from '../adapters/framework'; +import { UptimeCoreSetup } from '../adapters/framework'; -export function compose(server: UptimeCoreSetup, plugins: UptimeCorePlugins): UMServerLibs { +export function compose(server: UptimeCoreSetup): UMServerLibs { const framework = new UMKibanaBackendFrameworkAdapter(server); const domainLibs: UMDomainLibs = { diff --git a/x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap b/x-pack/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap rename to x-pack/plugins/uptime/server/lib/domains/__tests__/__snapshots__/license.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/license.test.ts b/x-pack/plugins/uptime/server/lib/domains/__tests__/license.test.ts similarity index 93% rename from x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/license.test.ts rename to x-pack/plugins/uptime/server/lib/domains/__tests__/license.test.ts index 8c47b318da9bd..b842f55fc7579 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/domains/__tests__/license.test.ts +++ b/x-pack/plugins/uptime/server/lib/domains/__tests__/license.test.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ILicense } from '../../../../../../../plugins/licensing/server'; +import { ILicense } from '../../../../../licensing/server'; import { licenseCheck } from '../license'; describe('license check', () => { diff --git a/x-pack/legacy/plugins/uptime/server/lib/domains/index.ts b/x-pack/plugins/uptime/server/lib/domains/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/domains/index.ts rename to x-pack/plugins/uptime/server/lib/domains/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/domains/license.ts b/x-pack/plugins/uptime/server/lib/domains/license.ts similarity index 93% rename from x-pack/legacy/plugins/uptime/server/lib/domains/license.ts rename to x-pack/plugins/uptime/server/lib/domains/license.ts index b8b5722d79877..d272424379e48 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/domains/license.ts +++ b/x-pack/plugins/uptime/server/lib/domains/license.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { ILicense } from '../../../../../../plugins/licensing/server'; +import { ILicense } from '../../../../licensing/server'; export interface UMLicenseStatusResponse { statusCode: number; diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap b/x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap rename to x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/assert_close_to.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap b/x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap rename to x-pack/plugins/uptime/server/lib/helper/__test__/__snapshots__/get_filter_clause.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts rename to x-pack/plugins/uptime/server/lib/helper/__test__/assert_close_to.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts rename to x-pack/plugins/uptime/server/lib/helper/__test__/get_filter_clause.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts rename to x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts b/x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts rename to x-pack/plugins/uptime/server/lib/helper/__test__/get_histogram_interval_formatted.test.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/assert_close_to.ts b/x-pack/plugins/uptime/server/lib/helper/assert_close_to.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/assert_close_to.ts rename to x-pack/plugins/uptime/server/lib/helper/assert_close_to.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/get_filter_clause.ts b/x-pack/plugins/uptime/server/lib/helper/get_filter_clause.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/get_filter_clause.ts rename to x-pack/plugins/uptime/server/lib/helper/get_filter_clause.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts similarity index 90% rename from x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval.ts rename to x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts index 0dedc3e456f51..f13b44c553569 100644 --- a/x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval.ts +++ b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts @@ -5,7 +5,7 @@ */ import DateMath from '@elastic/datemath'; -import { QUERY } from '../../../common/constants'; +import { QUERY } from '../../../../../legacy/plugins/uptime/common/constants'; export const getHistogramInterval = ( dateRangeStart: string, diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts rename to x-pack/plugins/uptime/server/lib/helper/get_histogram_interval_formatted.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/index.ts b/x-pack/plugins/uptime/server/lib/helper/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/index.ts rename to x-pack/plugins/uptime/server/lib/helper/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/make_date_rate_filter.ts b/x-pack/plugins/uptime/server/lib/helper/make_date_rate_filter.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/make_date_rate_filter.ts rename to x-pack/plugins/uptime/server/lib/helper/make_date_rate_filter.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/helper/parse_filter_query.ts b/x-pack/plugins/uptime/server/lib/helper/parse_filter_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/helper/parse_filter_query.ts rename to x-pack/plugins/uptime/server/lib/helper/parse_filter_query.ts diff --git a/x-pack/legacy/plugins/uptime/server/lib/lib.ts b/x-pack/plugins/uptime/server/lib/lib.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/lib/lib.ts rename to x-pack/plugins/uptime/server/lib/lib.ts diff --git a/x-pack/plugins/uptime/server/plugin.ts b/x-pack/plugins/uptime/server/plugin.ts new file mode 100644 index 0000000000000..d197a4becb165 --- /dev/null +++ b/x-pack/plugins/uptime/server/plugin.ts @@ -0,0 +1,35 @@ +/* + * 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 { CoreSetup, Plugin, PluginInitializerContext } from '../../../../src/core/server'; +import { initServerWithKibana } from './kibana.index'; + +interface UptimePluginsSetup { + usageCollection: any; +} + +export class UptimePlugin implements Plugin { + public async setup(coreSetup: CoreSetup, plugins: UptimePluginsSetup) { + const { usageCollection } = plugins; + + initServerWithKibana( + { + router: coreSetup.http.createRouter(), + }, + { + usageCollection, + } + ); + } + + public start() {} + + public stop() {} +} + +export function plugin(_initializerContext: PluginInitializerContext) { + return new Plugin(); +} diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/create_route_with_auth.ts b/x-pack/plugins/uptime/server/rest_api/create_route_with_auth.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/create_route_with_auth.ts rename to x-pack/plugins/uptime/server/rest_api/create_route_with_auth.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/index.ts b/x-pack/plugins/uptime/server/rest_api/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/index.ts rename to x-pack/plugins/uptime/server/rest_api/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts b/x-pack/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts rename to x-pack/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/index.ts b/x-pack/plugins/uptime/server/rest_api/index_pattern/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/index_pattern/index.ts rename to x-pack/plugins/uptime/server/rest_api/index_pattern/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/monitors/index.ts b/x-pack/plugins/uptime/server/rest_api/monitors/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/monitors/index.ts rename to x-pack/plugins/uptime/server/rest_api/monitors/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/monitors/monitor_locations.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/monitors/monitor_locations.ts rename to x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/monitors/monitors_details.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/monitors/monitors_details.ts rename to x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/pings/get_all.ts b/x-pack/plugins/uptime/server/rest_api/pings/get_all.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/pings/get_all.ts rename to x-pack/plugins/uptime/server/rest_api/pings/get_all.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/pings/index.ts b/x-pack/plugins/uptime/server/rest_api/pings/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/pings/index.ts rename to x-pack/plugins/uptime/server/rest_api/pings/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts b/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts rename to x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/snapshot/index.ts b/x-pack/plugins/uptime/server/rest_api/snapshot/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/snapshot/index.ts rename to x-pack/plugins/uptime/server/rest_api/snapshot/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/telemetry/index.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/telemetry/index.ts rename to x-pack/plugins/uptime/server/rest_api/telemetry/index.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts rename to x-pack/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts rename to x-pack/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/types.ts b/x-pack/plugins/uptime/server/rest_api/types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/types.ts rename to x-pack/plugins/uptime/server/rest_api/types.ts diff --git a/x-pack/legacy/plugins/uptime/server/rest_api/uptime_route_wrapper.ts b/x-pack/plugins/uptime/server/rest_api/uptime_route_wrapper.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/rest_api/uptime_route_wrapper.ts rename to x-pack/plugins/uptime/server/rest_api/uptime_route_wrapper.ts diff --git a/x-pack/legacy/plugins/uptime/server/uptime_server.ts b/x-pack/plugins/uptime/server/uptime_server.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/server/uptime_server.ts rename to x-pack/plugins/uptime/server/uptime_server.ts diff --git a/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts b/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts index 02fd3fd630d4b..17256574f60b9 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts +++ b/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts @@ -7,7 +7,7 @@ import { snapshotHistogramQueryString } from '../../../../../legacy/plugins/uptime/public/queries/snapshot_histogram_query'; import { expectFixtureEql } from './helpers/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { assertCloseTo } from '../../../../../legacy/plugins/uptime/server/lib/helper'; +import { assertCloseTo } from '../../../../../plugins/uptime/server/lib/helper'; export default function({ getService }: FtrProviderContext) { describe('snapshotHistogram', () => { From 4660e366960569351b3ea0a7672266bea676d286 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 3 Jan 2020 16:44:55 -0500 Subject: [PATCH 04/36] Re-add feature registration code. --- x-pack/plugins/uptime/kibana.json | 2 +- x-pack/plugins/uptime/server/kibana.index.ts | 4 +- .../lib/adapters/framework/adapter_types.ts | 2 + x-pack/plugins/uptime/server/plugin.ts | 11 +++-- .../plugins/uptime/server/register_feature.ts | 40 +++++++++++++++++++ 5 files changed, 51 insertions(+), 8 deletions(-) create mode 100644 x-pack/plugins/uptime/server/register_feature.ts diff --git a/x-pack/plugins/uptime/kibana.json b/x-pack/plugins/uptime/kibana.json index 711c8b806a436..dd61716325afc 100644 --- a/x-pack/plugins/uptime/kibana.json +++ b/x-pack/plugins/uptime/kibana.json @@ -2,7 +2,7 @@ "configPath": ["xpack"], "id": "uptime", "kibanaVersion": "kibana", - "requiredPlugins": ["licensing", "usageCollection"], + "requiredPlugins": ["features", "licensing", "usageCollection"], "server": true, "ui": false, "version": "8.0.0" diff --git a/x-pack/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts index f2599a74ae1fa..1ee6e1c1d1a2e 100644 --- a/x-pack/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -9,6 +9,7 @@ import { KibanaTelemetryAdapter } from './lib/adapters/telemetry'; import { compose } from './lib/compose/kibana'; import { initUptimeServer } from './uptime_server'; import { UptimeCorePlugins, UptimeCoreSetup } from './lib/adapters/framework'; +import { registerFeature } from './register_feature'; export interface KibanaRouteOptions { path: string; @@ -23,9 +24,10 @@ export interface KibanaServer extends Server { } export const initServerWithKibana = (server: UptimeCoreSetup, plugins: UptimeCorePlugins) => { - const { usageCollection } = plugins; + const { features, usageCollection } = plugins; const libs = compose(server); KibanaTelemetryAdapter.registerUsageCollector(usageCollection); + registerFeature(features); initUptimeServer(libs); }; diff --git a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts index 7fec73bdcc01a..ee4334d560049 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts @@ -14,6 +14,7 @@ import { } from 'src/core/server'; import { ObjectType } from '@kbn/config-schema'; import { UMKibanaRoute } from '../../../rest_api'; +import { PluginSetupContract } from '../../../../../features/server'; export interface UMFrameworkRouteOptions< P extends ObjectType, @@ -47,6 +48,7 @@ export interface UptimeCoreSetup { } export interface UptimeCorePlugins { + features: PluginSetupContract; usageCollection: UsageCollectionSetup; } diff --git a/x-pack/plugins/uptime/server/plugin.ts b/x-pack/plugins/uptime/server/plugin.ts index d197a4becb165..f7a67161c4830 100644 --- a/x-pack/plugins/uptime/server/plugin.ts +++ b/x-pack/plugins/uptime/server/plugin.ts @@ -6,22 +6,21 @@ import { CoreSetup, Plugin, PluginInitializerContext } from '../../../../src/core/server'; import { initServerWithKibana } from './kibana.index'; +import { PluginSetupContract } from '../../features/server'; +import { UsageCollectionSetup } from '../../../../src/plugins/usage_collection/server'; interface UptimePluginsSetup { - usageCollection: any; + features: PluginSetupContract; + usageCollection: UsageCollectionSetup; } export class UptimePlugin implements Plugin { public async setup(coreSetup: CoreSetup, plugins: UptimePluginsSetup) { - const { usageCollection } = plugins; - initServerWithKibana( { router: coreSetup.http.createRouter(), }, - { - usageCollection, - } + plugins ); } diff --git a/x-pack/plugins/uptime/server/register_feature.ts b/x-pack/plugins/uptime/server/register_feature.ts new file mode 100644 index 0000000000000..3562e138aafb3 --- /dev/null +++ b/x-pack/plugins/uptime/server/register_feature.ts @@ -0,0 +1,40 @@ +/* + * 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 { i18n } from '@kbn/i18n'; +import { PluginSetupContract } from '../../features/server'; +import { PLUGIN } from '../../../legacy/plugins/uptime/common/constants'; + +export const registerFeature = (features: PluginSetupContract) => { + features.registerFeature({ + id: PLUGIN.ID, + name: i18n.translate('xpack.uptime.featureRegistry.uptimeFeatureName', { + defaultMessage: 'Uptime', + }), + navLinkId: PLUGIN.ID, + icon: 'uptimeApp', + app: ['uptime', 'kibana'], + catalogue: ['uptime'], + privileges: { + all: { + api: ['uptime'], + savedObject: { + all: [], + read: [], + }, + ui: ['save'], + }, + read: { + api: ['uptime'], + savedObject: { + all: [], + read: [], + }, + ui: [], + }, + }, + }); +}; From a9764c4cc030ea16f053b4b75f6280cf20b79d18 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Mon, 6 Jan 2020 17:40:24 -0500 Subject: [PATCH 05/36] Move all files. --- x-pack/index.js | 4 +- x-pack/legacy/plugins/uptime/index.ts | 64 ++++----- .../plugins/uptime/public/apps/index.ts | 15 --- .../plugins/uptime/public/apps/plugin.ts | 58 -------- x-pack/legacy/plugins/uptime/tsconfig.json | 7 - x-pack/{legacy => }/plugins/uptime/README.md | 0 .../uptime/common/constants/capabilities.ts | 0 .../common/constants/chart_format_limits.ts | 0 .../common/constants/client_defaults.ts | 0 .../common/constants/context_defaults.ts | 0 .../plugins/uptime/common/constants/index.ts | 0 .../uptime/common/constants/index_names.ts | 0 .../plugins/uptime/common/constants/plugin.ts | 21 +++ .../plugins/uptime/common/constants/query.ts | 0 .../uptime/common/domain_types/index.ts | 0 .../uptime/common/domain_types/monitors.ts | 0 .../uptime/common/graphql/index.ts} | 8 +- .../uptime/common/graphql/introspection.json | 0 .../uptime/common/graphql/resolver_types.ts | 0 .../plugins/uptime/common/graphql/types.ts | 76 +++++++---- x-pack/plugins/uptime/common/index.ts | 10 ++ .../uptime/common/runtime_types/common.ts | 0 .../uptime/common/runtime_types/index.ts | 0 .../runtime_types/monitor/monitor_details.ts | 0 .../monitor/monitor_locations.ts | 0 .../common/runtime_types/snapshot/index.ts | 0 .../runtime_types/snapshot/snapshot_count.ts | 0 x-pack/plugins/uptime/kibana.json | 5 +- .../{legacy => }/plugins/uptime/public/app.ts | 0 x-pack/plugins/uptime/public/apps/index.ts | 17 +++ x-pack/plugins/uptime/public/apps/plugin.ts | 125 ++++++++++++++++++ .../plugins/uptime/public/apps/render_app.tsx | 7 + .../plugins/uptime/public/apps/template.html | 0 .../plugins/uptime/public/badge.ts | 0 .../plugins/uptime/public/breadcrumbs.ts | 0 .../empty_status_bar.test.tsx.snap | 0 .../integration_group.test.tsx.snap | 0 .../integration_link.test.tsx.snap | 0 .../monitor_charts.test.tsx.snap | 0 .../monitor_ssl_certificate.test.tsx.snap | 0 .../monitor_status.bar.test.tsx.snap | 0 ...w_page_parsing_error_callout.test.tsx.snap | 0 .../__snapshots__/snapshot.test.tsx.snap | 0 .../snapshot_heading.test.tsx.snap | 0 .../uptime_date_picker.test.tsx.snap | 0 .../__tests__/empty_status_bar.test.tsx | 0 .../__tests__/integration_group.test.tsx | 0 .../__tests__/integration_link.test.tsx | 0 .../__tests__/monitor_charts.test.tsx | 0 .../monitor_ssl_certificate.test.tsx | 0 .../__tests__/monitor_status.bar.test.tsx | 0 ...erview_page_parsing_error_callout.test.tsx | 0 .../functional/__tests__/snapshot.test.tsx | 0 .../__tests__/snapshot_heading.test.tsx | 0 .../__tests__/uptime_date_picker.test.tsx | 0 .../__snapshots__/chart_wrapper.test.tsx.snap | 0 .../__snapshots__/donut_chart.test.tsx.snap | 0 .../donut_chart_legend.test.tsx.snap | 0 .../donut_chart_legend_row.test.tsx.snap | 0 .../monitor_bar_series.test.tsx.snap | 0 .../snapshot_histogram.test.tsx.snap | 0 .../charts/__tests__/chart_wrapper.test.tsx | 0 .../charts/__tests__/donut_chart.test.tsx | 0 .../__tests__/donut_chart_legend.test.tsx | 0 .../__tests__/donut_chart_legend_row.test.tsx | 0 .../charts/__tests__/get_tick_format.test.ts | 0 .../__tests__/monitor_bar_series.test.tsx | 0 .../__tests__/snapshot_histogram.test.tsx | 0 .../charts/chart_wrapper/chart_wrapper.tsx | 0 .../functional/charts/chart_wrapper/index.ts | 0 .../functional/charts/checks_chart.tsx | 0 .../functional/charts/donut_chart.tsx | 0 .../functional/charts/donut_chart_legend.tsx | 0 .../charts/donut_chart_legend_row.tsx | 0 .../functional/charts/duration_chart.tsx | 0 .../charts/duration_chart_empty_state.tsx | 0 .../charts/duration_line_series_list.tsx | 0 .../functional/charts/get_colors_map.ts | 23 ++++ .../functional/charts/get_tick_format.ts | 0 .../components/functional/charts/index.ts | 0 .../functional/charts/monitor_bar_series.tsx | 0 .../functional/charts/snapshot_histogram.tsx | 0 .../__snapshots__/data_missing.test.tsx.snap | 0 .../__snapshots__/empty_state.test.tsx.snap | 0 .../__tests__/data_missing.test.tsx | 0 .../__tests__/empty_state.test.tsx | 0 .../functional/empty_state/data_missing.tsx | 0 .../functional/empty_state/empty_index.tsx | 0 .../functional/empty_state/empty_state.tsx | 0 .../empty_state/empty_state_error.tsx | 0 .../empty_state/empty_state_loading.tsx | 0 .../functional/empty_state/index.ts | 0 .../functional/empty_status_bar.tsx | 0 .../filter_popover.test.tsx.snap | 0 .../filter_status_button.test.tsx.snap | 0 .../__tests__/filter_popover.test.tsx | 0 .../__tests__/filter_status_button.test.tsx | 0 .../__tests__/toggle_selected_item.test.ts | 0 .../functional/filter_group/filter_group.tsx | 0 .../filter_group/filter_popover.tsx | 0 .../filter_group/filter_status_button.tsx | 0 .../functional/filter_group/index.ts | 0 .../filter_group/toggle_selected_item.ts | 0 .../filter_group/uptime_filter_button.tsx | 0 .../public/components/functional/index.ts | 0 .../functional/integration_group.tsx | 0 .../functional/integration_link.tsx | 0 .../components/functional/kuery_bar/index.tsx | 2 +- .../kuery_bar/typeahead/click_outside.js | 0 .../functional/kuery_bar/typeahead/index.d.ts | 0 .../functional/kuery_bar/typeahead/index.js | 0 .../kuery_bar/typeahead/suggestion.js | 2 +- .../kuery_bar/typeahead/suggestions.js | 2 +- .../embeddables/__mocks__/mock.ts | 0 .../location_map/embeddables/embedded_map.tsx | 4 +- .../embeddables/low_poly_layer.json | 0 .../embeddables/map_config.test.ts | 0 .../location_map/embeddables/map_config.ts | 0 .../location_map/embeddables/translations.ts | 0 .../location_map/embeddables/types.ts | 4 +- .../functional/location_map/index.tsx | 0 .../functional/location_map/location_map.tsx | 0 .../components/functional/location_name.tsx | 0 .../components/functional/monitor_charts.tsx | 0 .../__snapshots__/monitor_list.test.tsx.snap | 0 .../monitor_list_pagination.test.tsx.snap | 0 .../monitor_list_status_column.test.tsx.snap | 0 .../monitor_page_link.test.tsx.snap | 0 .../__tests__/monitor_list.test.tsx | 0 .../monitor_list_pagination.test.tsx | 0 .../monitor_list_status_column.test.tsx | 0 .../__tests__/monitor_page_link.test.tsx | 0 .../__tests__/parse_timestamp.test.ts | 0 .../functional/monitor_list/index.ts | 0 .../functional/monitor_list/monitor_list.tsx | 0 .../monitor_list_actions_popover.tsx | 0 .../__snapshots__/location_link.test.tsx.snap | 0 .../monitor_list_drawer.test.tsx.snap | 0 .../monitor_status_list.test.tsx.snap | 0 .../monitor_status_row.test.tsx.snap | 0 .../most_recent_error.test.tsx.snap | 0 .../monitor_list_drawer/__tests__/data.json | 0 .../__tests__/location_link.test.tsx | 0 .../__tests__/monitor_list_drawer.test.tsx | 0 .../__tests__/monitor_status_list.test.tsx | 0 .../__tests__/monitor_status_row.test.tsx | 0 .../__tests__/most_recent_error.test.tsx | 0 .../monitor_list/monitor_list_drawer/index.ts | 0 .../monitor_list_drawer/location_link.tsx | 0 .../monitor_list_drawer.tsx | 0 .../monitor_status_list.tsx | 0 .../monitor_status_row.tsx | 0 .../monitor_list_drawer/most_recent_error.tsx | 0 .../monitor_list_status_column.tsx | 0 .../monitor_list/monitor_page_link.tsx | 0 .../monitor_list/overview_page_link.tsx | 0 .../monitor_list/parse_timestamp.ts | 0 .../functional/monitor_list/translations.ts | 0 .../functional/monitor_list/types.ts | 0 .../functional/monitor_page_title.tsx | 0 .../functional/monitor_status_bar/index.ts | 0 .../monitor_ssl_certificate.tsx | 0 .../monitor_status_bar/monitor_status_bar.tsx | 0 .../monitor_status_bar/translations.ts | 0 .../monitor_status_details/index.ts | 0 .../monitor_status_details.tsx | 0 .../monitor_status_details/translations.ts | 0 .../overview_page_parsing_error_callout.tsx | 0 .../__snapshots__/expanded_row.test.tsx.snap | 0 .../__snapshots__/ping_list.test.tsx.snap | 0 .../ping_list/__tests__/expanded_row.test.tsx | 0 .../ping_list/__tests__/ping_list.test.tsx | 0 .../functional/ping_list/expanded_row.tsx | 0 .../components/functional/ping_list/index.tsx | 0 .../functional/ping_list/ping_list.tsx | 0 .../components/functional/search_schema.ts | 0 .../public/components/functional/snapshot.tsx | 0 .../functional/snapshot_heading.tsx | 0 .../components/functional/status_panel.tsx | 0 .../functional/uptime_date_picker.tsx | 0 .../responsive_wrapper.test.tsx.snap | 0 .../__tests__/responsive_wrapper.test.tsx | 0 .../public/components/higher_order/index.ts | 0 .../higher_order/responsive_wrapper.tsx | 0 .../higher_order/uptime_graphql_query.tsx | 0 .../plugins/uptime/public/contexts/index.ts | 0 .../public/contexts/uptime_refresh_context.ts | 0 .../contexts/uptime_settings_context.ts | 0 .../use_url_params.test.tsx.snap | 0 .../hooks/__tests__/use_url_params.test.tsx | 0 .../plugins/uptime/public/hooks/index.ts | 0 .../uptime/public/hooks/use_url_params.ts | 0 .../uptime/public/icons/heartbeat_white.svg | 0 x-pack/plugins/uptime/public/index.ts | 10 ++ .../framework/apollo_client_adapter.ts | 0 .../framework/capabilities_adapter.ts | 0 .../framework/framework_adapter_types.ts | 0 .../framework/new_platform_adapter.tsx | 11 +- .../__tests__/get_index_pattern.test.ts | 0 .../index_pattern/get_index_pattern.ts | 0 .../lib/adapters/index_pattern/index.ts | 0 .../public/lib/adapters/telemetry/index.ts | 0 .../lib/adapters/telemetry/log_monitor.ts | 0 .../lib/adapters/telemetry/log_overview.ts | 0 .../format_error_string.test.ts.snap | 0 .../stringify_kueries.test.ts.snap | 0 .../stringify_url_params.test.ts.snap | 0 .../to_static_index_pattern.test.ts.snap | 0 .../combine_filters_and_user_search.test.ts | 0 .../__tests__/convert_measurements.test.ts | 0 .../__tests__/format_error_string.test.ts | 0 .../lib/helper/__tests__/get_api_path.test.ts | 0 .../__tests__/series_has_down_values.test.ts | 0 .../__tests__/stringify_kueries.test.ts | 0 .../__tests__/stringify_url_params.test.ts | 0 .../__tests__/to_static_index_pattern.test.ts | 0 .../charts/__tests__/get_label_format.test.ts | 0 .../__tests__/is_within_current_date.test.ts | 0 .../lib/helper/charts/get_chart_date_label.ts | 0 .../lib/helper/charts/get_label_format.ts | 0 .../uptime/public/lib/helper/charts/index.ts | 0 .../helper/charts/is_within_current_date.ts | 0 .../helper/combine_filters_and_user_search.ts | 0 .../public/lib/helper/convert_measurements.ts | 0 .../public/lib/helper/format_error_list.ts | 0 .../uptime/public/lib/helper/get_api_path.ts | 0 .../uptime/public/lib/helper/get_title.ts | 0 .../plugins/uptime/public/lib/helper/index.ts | 0 .../__snapshots__/get_apm_href.test.ts.snap | 0 .../__snapshots__/get_infra_href.test.ts.snap | 0 .../get_logging_href.test.ts.snap | 0 .../__tests__/get_apm_href.test.ts | 0 .../__tests__/get_infra_href.test.ts | 0 .../__tests__/get_logging_href.test.ts | 0 .../add_base_path.ts | 0 .../observability_integration/build_href.ts | 0 .../observability_integration/get_apm_href.ts | 0 .../get_infra_href.ts | 0 .../get_logging_href.ts | 0 .../helper/observability_integration/index.ts | 0 .../lib/helper/series_has_down_values.ts | 0 .../public/lib/helper/stringify_kueries.ts | 0 .../public/lib/helper/stringify_url_params.ts | 0 .../lib/helper/to_static_index_pattern.ts | 0 .../get_supported_url_params.test.ts.snap | 0 .../get_supported_url_params.test.ts | 0 .../__tests__/parse_absolute_date.test.ts | 0 .../parse_autorefresh_interval.test.ts | 0 .../__tests__/parse_is_paused.test.ts | 0 .../__tests__/parse_url_int.test.ts | 0 .../url_params/get_supported_url_params.ts | 0 .../public/lib/helper/url_params/index.ts | 0 .../helper/url_params/parse_absolute_date.ts | 0 .../lib/helper/url_params/parse_is_paused.ts | 0 .../lib/helper/url_params/parse_url_int.ts | 0 .../plugins/uptime/public/lib/lib.ts | 6 +- .../plugins/uptime/public/pages/index.ts | 0 .../plugins/uptime/public/pages/monitor.tsx | 6 +- .../plugins/uptime/public/pages/not_found.tsx | 0 .../plugins/uptime/public/pages/overview.tsx | 8 +- .../uptime/public/queries/doc_count_query.ts | 0 .../uptime/public/queries/filter_bar_query.ts | 0 .../plugins/uptime/public/queries/index.ts | 0 .../public/queries/monitor_charts_query.ts | 0 .../queries/monitor_page_title_query.ts | 0 .../public/queries/monitor_states_query.ts | 0 .../queries/monitor_status_bar_query.ts | 0 .../uptime/public/queries/pings_query.ts | 0 .../queries/snapshot_histogram_query.ts | 0 .../plugins/uptime/public/register_feature.ts | 0 .../uptime/public/state/actions/index.ts | 0 .../uptime/public/state/actions/monitor.ts | 0 .../uptime/public/state/actions/snapshot.ts | 0 .../uptime/public/state/actions/types.ts | 0 .../plugins/uptime/public/state/actions/ui.ts | 0 .../__snapshots__/snapshot.test.ts.snap | 0 .../state/api/__tests__/snapshot.test.ts | 0 .../plugins/uptime/public/state/api/index.ts | 0 .../uptime/public/state/api/monitor.ts | 0 .../uptime/public/state/api/snapshot.ts | 0 .../uptime/public/state/effects/index.ts | 0 .../uptime/public/state/effects/monitor.ts | 0 .../uptime/public/state/effects/snapshot.ts | 0 .../plugins/uptime/public/state/index.ts | 0 .../__snapshots__/snapshot.test.ts.snap | 0 .../__tests__/__snapshots__/ui.test.ts.snap | 0 .../state/reducers/__tests__/snapshot.test.ts | 0 .../state/reducers/__tests__/ui.test.ts | 0 .../uptime/public/state/reducers/index.ts | 0 .../uptime/public/state/reducers/monitor.ts | 0 .../uptime/public/state/reducers/snapshot.ts | 0 .../uptime/public/state/reducers/ui.ts | 0 .../state/selectors/__tests__/index.test.ts | 0 .../uptime/public/state/selectors/index.ts | 0 .../plugins/uptime/public/uptime_app.tsx | 0 .../plugins/uptime/scripts/gql_gen.json | 0 .../uptime/scripts/infer_graphql_types.js | 0 .../graphql/monitor_states/resolvers.ts | 6 +- .../server/graphql/monitors/resolvers.ts | 10 +- .../uptime/server/graphql/pings/resolvers.ts | 7 +- .../adapters/monitor_states/adapter_types.ts | 4 +- .../elasticsearch_monitor_states_adapter.ts | 5 +- .../monitor_states/get_snapshot_helper.ts | 2 +- .../search/__tests__/fetch_page.test.ts | 2 +- .../search/__tests__/test_helpers.ts | 5 +- .../search/enrich_monitor_groups.ts | 5 +- .../monitor_states/search/fetch_page.ts | 7 +- .../search/find_potential_matches.ts | 3 +- .../search/monitor_group_iterator.ts | 2 +- .../search/refine_potential_matches.ts | 3 +- .../lib/adapters/monitors/adapter_types.ts | 8 +- .../elasticsearch_monitors_adapter.ts | 8 +- .../lib/adapters/pings/adapter_types.ts | 7 +- .../pings/elasticsearch_pings_adapter.ts | 7 +- .../lib/helper/get_histogram_interval.ts | 2 +- .../plugins/uptime/server/register_feature.ts | 2 +- 316 files changed, 356 insertions(+), 234 deletions(-) delete mode 100644 x-pack/legacy/plugins/uptime/public/apps/index.ts delete mode 100644 x-pack/legacy/plugins/uptime/public/apps/plugin.ts delete mode 100644 x-pack/legacy/plugins/uptime/tsconfig.json rename x-pack/{legacy => }/plugins/uptime/README.md (100%) rename x-pack/{legacy => }/plugins/uptime/common/constants/capabilities.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/constants/chart_format_limits.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/constants/client_defaults.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/constants/context_defaults.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/constants/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/constants/index_names.ts (100%) create mode 100644 x-pack/plugins/uptime/common/constants/plugin.ts rename x-pack/{legacy => }/plugins/uptime/common/constants/query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/domain_types/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/domain_types/monitors.ts (100%) rename x-pack/{legacy/plugins/uptime/common/constants/plugin.ts => plugins/uptime/common/graphql/index.ts} (61%) rename x-pack/{legacy => }/plugins/uptime/common/graphql/introspection.json (100%) rename x-pack/{legacy => }/plugins/uptime/common/graphql/resolver_types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/graphql/types.ts (95%) create mode 100644 x-pack/plugins/uptime/common/index.ts rename x-pack/{legacy => }/plugins/uptime/common/runtime_types/common.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/runtime_types/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/runtime_types/monitor/monitor_details.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/runtime_types/monitor/monitor_locations.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/runtime_types/snapshot/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/common/runtime_types/snapshot/snapshot_count.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/app.ts (100%) create mode 100644 x-pack/plugins/uptime/public/apps/index.ts create mode 100644 x-pack/plugins/uptime/public/apps/plugin.ts create mode 100644 x-pack/plugins/uptime/public/apps/render_app.tsx rename x-pack/{legacy => }/plugins/uptime/public/apps/template.html (100%) rename x-pack/{legacy => }/plugins/uptime/public/badge.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/breadcrumbs.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/empty_status_bar.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_group.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_link.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_ssl_certificate.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_status.bar.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/overview_page_parsing_error_callout.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot_heading.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/__snapshots__/uptime_date_picker.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/empty_status_bar.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/integration_group.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/integration_link.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/monitor_charts.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/monitor_ssl_certificate.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/monitor_status.bar.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/overview_page_parsing_error_callout.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/snapshot.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/snapshot_heading.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/__tests__/uptime_date_picker.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/chart_wrapper.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend_row.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/monitor_bar_series.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/snapshot_histogram.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/chart_wrapper.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/donut_chart.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend_row.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/get_tick_format.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/monitor_bar_series.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/__tests__/snapshot_histogram.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/chart_wrapper/chart_wrapper.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/chart_wrapper/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/checks_chart.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/donut_chart.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/donut_chart_legend.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/donut_chart_legend_row.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/duration_chart.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/duration_chart_empty_state.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/duration_line_series_list.tsx (100%) create mode 100644 x-pack/plugins/uptime/public/components/functional/charts/get_colors_map.ts rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/get_tick_format.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/monitor_bar_series.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/charts/snapshot_histogram.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_missing.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/__tests__/data_missing.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/data_missing.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/empty_index.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/empty_state.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/empty_state_error.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/empty_state_loading.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_state/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/empty_status_bar.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_popover.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_status_button.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/__tests__/filter_popover.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/__tests__/filter_status_button.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/__tests__/toggle_selected_item.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/filter_group.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/filter_popover.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/filter_status_button.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/toggle_selected_item.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/filter_group/uptime_filter_button.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/integration_group.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/integration_link.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/kuery_bar/index.tsx (98%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/kuery_bar/typeahead/click_outside.js (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.d.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.js (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestion.js (97%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestions.js (95%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_map/embeddables/__mocks__/mock.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx (92%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_map/embeddables/low_poly_layer.json (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_map/embeddables/map_config.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_map/embeddables/map_config.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_map/embeddables/translations.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_map/embeddables/types.ts (81%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_map/index.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_map/location_map.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/location_name.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_charts.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_status_column.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_page_link.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_status_column.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_page_link.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/__tests__/parse_timestamp.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_actions_popover.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/location_link.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_list_drawer.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_list.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_row.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/most_recent_error.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/data.json (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/location_link.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_row.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/location_link.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_list.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_row.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/most_recent_error.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_list_status_column.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/monitor_page_link.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/overview_page_link.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/parse_timestamp.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/translations.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_list/types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_page_title.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_status_bar/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_status_bar/monitor_ssl_certificate.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_status_bar/monitor_status_bar.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_status_bar/translations.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_status_details/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_status_details/monitor_status_details.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/monitor_status_details/translations.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/overview_page_parsing_error_callout.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/expanded_row.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/ping_list.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/ping_list/__tests__/expanded_row.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/ping_list/__tests__/ping_list.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/ping_list/expanded_row.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/ping_list/index.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/ping_list/ping_list.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/search_schema.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/snapshot.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/snapshot_heading.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/status_panel.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/functional/uptime_date_picker.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/higher_order/__tests__/__snapshots__/responsive_wrapper.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/higher_order/__tests__/responsive_wrapper.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/higher_order/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/higher_order/responsive_wrapper.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/components/higher_order/uptime_graphql_query.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/contexts/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/contexts/uptime_refresh_context.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/contexts/uptime_settings_context.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/hooks/__tests__/__snapshots__/use_url_params.test.tsx.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/hooks/__tests__/use_url_params.test.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/hooks/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/hooks/use_url_params.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/icons/heartbeat_white.svg (100%) create mode 100644 x-pack/plugins/uptime/public/index.ts rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/framework/capabilities_adapter.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx (92%) rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/index_pattern/__tests__/get_index_pattern.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/index_pattern/get_index_pattern.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/index_pattern/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/telemetry/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/telemetry/log_monitor.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/adapters/telemetry/log_overview.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_kueries.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_url_params.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/combine_filters_and_user_search.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/convert_measurements.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/format_error_string.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/get_api_path.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/series_has_down_values.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/stringify_kueries.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/stringify_url_params.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/charts/__tests__/get_label_format.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/charts/__tests__/is_within_current_date.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/charts/get_label_format.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/charts/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/charts/is_within_current_date.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/combine_filters_and_user_search.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/convert_measurements.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/format_error_list.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/get_api_path.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/get_title.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/add_base_path.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/build_href.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/observability_integration/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/series_has_down_values.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/stringify_kueries.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/stringify_url_params.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/to_static_index_pattern.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/__tests__/__snapshots__/get_supported_url_params.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/__tests__/parse_absolute_date.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/__tests__/parse_autorefresh_interval.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/__tests__/parse_is_paused.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/__tests__/parse_url_int.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/parse_is_paused.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/helper/url_params/parse_url_int.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/lib/lib.ts (88%) rename x-pack/{legacy => }/plugins/uptime/public/pages/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/pages/monitor.tsx (95%) rename x-pack/{legacy => }/plugins/uptime/public/pages/not_found.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/public/pages/overview.tsx (95%) rename x-pack/{legacy => }/plugins/uptime/public/queries/doc_count_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/queries/filter_bar_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/queries/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/queries/monitor_charts_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/queries/monitor_page_title_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/queries/monitor_states_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/queries/monitor_status_bar_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/queries/pings_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/queries/snapshot_histogram_query.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/register_feature.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/actions/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/actions/monitor.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/actions/snapshot.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/actions/types.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/actions/ui.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/api/__tests__/__snapshots__/snapshot.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/api/__tests__/snapshot.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/api/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/api/monitor.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/api/snapshot.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/effects/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/effects/monitor.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/effects/snapshot.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/reducers/__tests__/__snapshots__/snapshot.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/reducers/__tests__/__snapshots__/ui.test.ts.snap (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/reducers/__tests__/snapshot.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/reducers/__tests__/ui.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/reducers/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/reducers/monitor.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/reducers/snapshot.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/reducers/ui.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/selectors/__tests__/index.test.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/state/selectors/index.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/uptime_app.tsx (100%) rename x-pack/{legacy => }/plugins/uptime/scripts/gql_gen.json (100%) rename x-pack/{legacy => }/plugins/uptime/scripts/infer_graphql_types.js (100%) diff --git a/x-pack/index.js b/x-pack/index.js index 56547f89b1e90..fae6cca1fe5bc 100644 --- a/x-pack/index.js +++ b/x-pack/index.js @@ -33,7 +33,7 @@ import { siem } from './legacy/plugins/siem'; import { remoteClusters } from './legacy/plugins/remote_clusters'; import { crossClusterReplication } from './legacy/plugins/cross_cluster_replication'; import { upgradeAssistant } from './legacy/plugins/upgrade_assistant'; -import { uptime } from './legacy/plugins/uptime'; +// import { uptime } from './legacy/plugins/uptime'; import { ossTelemetry } from './legacy/plugins/oss_telemetry'; import { fileUpload } from './legacy/plugins/file_upload'; import { encryptedSavedObjects } from './legacy/plugins/encrypted_saved_objects'; @@ -75,7 +75,7 @@ module.exports = function(kibana) { remoteClusters(kibana), crossClusterReplication(kibana), upgradeAssistant(kibana), - uptime(kibana), + // uptime(kibana), ossTelemetry(kibana), fileUpload(kibana), encryptedSavedObjects(kibana), diff --git a/x-pack/legacy/plugins/uptime/index.ts b/x-pack/legacy/plugins/uptime/index.ts index 20a2c8514ca70..3ba1c75c9f84e 100644 --- a/x-pack/legacy/plugins/uptime/index.ts +++ b/x-pack/legacy/plugins/uptime/index.ts @@ -1,34 +1,34 @@ -/* - * 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. - */ +// /* +// * 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 { i18n } from '@kbn/i18n'; -import { resolve } from 'path'; -import { PLUGIN } from './common/constants'; +// import { i18n } from '@kbn/i18n'; +// import { resolve } from 'path'; +// import { PLUGIN } from '../../../plugins/uptime/common'; -export const uptime = (kibana: any) => - new kibana.Plugin({ - configPrefix: 'xpack.uptime', - id: PLUGIN.ID, - publicDir: resolve(__dirname, 'public'), - require: ['kibana', 'elasticsearch', 'xpack_main'], - uiExports: { - app: { - description: i18n.translate('xpack.uptime.pluginDescription', { - defaultMessage: 'Uptime monitoring', - description: 'The description text that will be shown to users in Kibana', - }), - icon: 'plugins/uptime/icons/heartbeat_white.svg', - euiIconType: 'uptimeApp', - title: i18n.translate('xpack.uptime.uptimeFeatureCatalogueTitle', { - defaultMessage: 'Uptime', - }), - main: 'plugins/uptime/app', - order: 8900, - url: '/app/uptime#/', - }, - home: ['plugins/uptime/register_feature'], - }, - }); +// export const uptime = (kibana: any) => +// new kibana.Plugin({ +// configPrefix: 'xpack.uptime', +// id: PLUGIN.ID, +// publicDir: resolve(__dirname, 'public'), +// require: ['kibana', 'elasticsearch', 'xpack_main'], +// uiExports: { +// app: { +// description: i18n.translate('xpack.uptime.pluginDescription', { +// defaultMessage: 'Uptime monitoring', +// description: 'The description text that will be shown to users in Kibana', +// }), +// icon: 'plugins/uptime/icons/heartbeat_white.svg', +// euiIconType: 'uptimeApp', +// title: i18n.translate('xpack.uptime.uptimeFeatureCatalogueTitle', { +// defaultMessage: 'Uptime', +// }), +// main: 'plugins/uptime/app', +// order: 8900, +// url: '/app/uptime#/', +// }, +// home: ['plugins/uptime/register_feature'], +// }, +// }); diff --git a/x-pack/legacy/plugins/uptime/public/apps/index.ts b/x-pack/legacy/plugins/uptime/public/apps/index.ts deleted file mode 100644 index 06776842aa6de..0000000000000 --- a/x-pack/legacy/plugins/uptime/public/apps/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * 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 chrome from 'ui/chrome'; -import { npStart } from 'ui/new_platform'; -import { Plugin } from './plugin'; -import 'uiExports/embeddableFactories'; - -new Plugin( - { opaqueId: Symbol('uptime'), env: {} as any, config: { get: () => ({} as any) } }, - chrome -).start(npStart); diff --git a/x-pack/legacy/plugins/uptime/public/apps/plugin.ts b/x-pack/legacy/plugins/uptime/public/apps/plugin.ts deleted file mode 100644 index bc4e30b79cb15..0000000000000 --- a/x-pack/legacy/plugins/uptime/public/apps/plugin.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 { LegacyCoreStart, PluginInitializerContext } from 'src/core/public'; -import { PluginsStart } from 'ui/new_platform/new_platform'; -import { Chrome } from 'ui/chrome'; -import { UMFrontendLibs } from '../lib/lib'; -import { PLUGIN } from '../../common/constants'; -import { getKibanaFrameworkAdapter } from '../lib/adapters/framework/new_platform_adapter'; -import template from './template.html'; -import { UptimeApp } from '../uptime_app'; -import { createApolloClient } from '../lib/adapters/framework/apollo_client_adapter'; - -export interface StartObject { - core: LegacyCoreStart; - plugins: PluginsStart; -} - -export class Plugin { - constructor( - // @ts-ignore this is added to satisfy the New Platform typing constraint, - // but we're not leveraging any of its functionality yet. - private readonly initializerContext: PluginInitializerContext, - private readonly chrome: Chrome - ) { - this.chrome = chrome; - } - - public start(start: StartObject): void { - const { - core, - plugins: { - data: { autocomplete }, - }, - } = start; - const libs: UMFrontendLibs = { - framework: getKibanaFrameworkAdapter(core, autocomplete), - }; - // @ts-ignore improper type description - this.chrome.setRootTemplate(template); - const checkForRoot = () => { - return new Promise(resolve => { - const ready = !!document.getElementById(PLUGIN.APP_ROOT_ID); - if (ready) { - resolve(); - } else { - setTimeout(() => resolve(checkForRoot()), 10); - } - }); - }; - checkForRoot().then(() => { - libs.framework.render(UptimeApp, createApolloClient); - }); - } -} diff --git a/x-pack/legacy/plugins/uptime/tsconfig.json b/x-pack/legacy/plugins/uptime/tsconfig.json deleted file mode 100644 index 53425909db3e8..0000000000000 --- a/x-pack/legacy/plugins/uptime/tsconfig.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": "../../../tsconfig.json", - "exclude": ["**/node_modules/**"], - "paths": { - "react": ["../../../node_modules/@types/react"] - } -} \ No newline at end of file diff --git a/x-pack/legacy/plugins/uptime/README.md b/x-pack/plugins/uptime/README.md similarity index 100% rename from x-pack/legacy/plugins/uptime/README.md rename to x-pack/plugins/uptime/README.md diff --git a/x-pack/legacy/plugins/uptime/common/constants/capabilities.ts b/x-pack/plugins/uptime/common/constants/capabilities.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/constants/capabilities.ts rename to x-pack/plugins/uptime/common/constants/capabilities.ts diff --git a/x-pack/legacy/plugins/uptime/common/constants/chart_format_limits.ts b/x-pack/plugins/uptime/common/constants/chart_format_limits.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/constants/chart_format_limits.ts rename to x-pack/plugins/uptime/common/constants/chart_format_limits.ts diff --git a/x-pack/legacy/plugins/uptime/common/constants/client_defaults.ts b/x-pack/plugins/uptime/common/constants/client_defaults.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/constants/client_defaults.ts rename to x-pack/plugins/uptime/common/constants/client_defaults.ts diff --git a/x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts b/x-pack/plugins/uptime/common/constants/context_defaults.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/constants/context_defaults.ts rename to x-pack/plugins/uptime/common/constants/context_defaults.ts diff --git a/x-pack/legacy/plugins/uptime/common/constants/index.ts b/x-pack/plugins/uptime/common/constants/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/constants/index.ts rename to x-pack/plugins/uptime/common/constants/index.ts diff --git a/x-pack/legacy/plugins/uptime/common/constants/index_names.ts b/x-pack/plugins/uptime/common/constants/index_names.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/constants/index_names.ts rename to x-pack/plugins/uptime/common/constants/index_names.ts diff --git a/x-pack/plugins/uptime/common/constants/plugin.ts b/x-pack/plugins/uptime/common/constants/plugin.ts new file mode 100644 index 0000000000000..7f5cd3c7b926f --- /dev/null +++ b/x-pack/plugins/uptime/common/constants/plugin.ts @@ -0,0 +1,21 @@ +/* + * 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 { i18n } from '@kbn/i18n'; + +export const PLUGIN = { + APP_ROOT_ID: 'react-uptime-root', + DESCRIPTION: i18n.translate('xpack.uptime.pluginDescription', { + defaultMessage: 'Uptime monitoring', + description: 'The description text that will be shown to users in Kibana', + }), + ID: 'uptime', + ROUTER_BASE_NAME: '/app/uptime#', + LOCAL_STORAGE_KEY: 'xpack.uptime', + TITLE: i18n.translate('xpack.uptime.uptimeFeatureCatalogueTitle', { + defaultMessage: 'Uptime', + }), +}; diff --git a/x-pack/legacy/plugins/uptime/common/constants/query.ts b/x-pack/plugins/uptime/common/constants/query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/constants/query.ts rename to x-pack/plugins/uptime/common/constants/query.ts diff --git a/x-pack/legacy/plugins/uptime/common/domain_types/index.ts b/x-pack/plugins/uptime/common/domain_types/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/domain_types/index.ts rename to x-pack/plugins/uptime/common/domain_types/index.ts diff --git a/x-pack/legacy/plugins/uptime/common/domain_types/monitors.ts b/x-pack/plugins/uptime/common/domain_types/monitors.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/domain_types/monitors.ts rename to x-pack/plugins/uptime/common/domain_types/monitors.ts diff --git a/x-pack/legacy/plugins/uptime/common/constants/plugin.ts b/x-pack/plugins/uptime/common/graphql/index.ts similarity index 61% rename from x-pack/legacy/plugins/uptime/common/constants/plugin.ts rename to x-pack/plugins/uptime/common/graphql/index.ts index 93c3f00a0a45c..af689fb9c2822 100644 --- a/x-pack/legacy/plugins/uptime/common/constants/plugin.ts +++ b/x-pack/plugins/uptime/common/graphql/index.ts @@ -4,9 +4,5 @@ * you may not use this file except in compliance with the Elastic License. */ -export const PLUGIN = { - APP_ROOT_ID: 'react-uptime-root', - ID: 'uptime', - ROUTER_BASE_NAME: '/app/uptime#', - LOCAL_STORAGE_KEY: 'xpack.uptime', -}; +export * from './resolver_types'; +export * from './types'; diff --git a/x-pack/legacy/plugins/uptime/common/graphql/introspection.json b/x-pack/plugins/uptime/common/graphql/introspection.json similarity index 100% rename from x-pack/legacy/plugins/uptime/common/graphql/introspection.json rename to x-pack/plugins/uptime/common/graphql/introspection.json diff --git a/x-pack/legacy/plugins/uptime/common/graphql/resolver_types.ts b/x-pack/plugins/uptime/common/graphql/resolver_types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/graphql/resolver_types.ts rename to x-pack/plugins/uptime/common/graphql/resolver_types.ts diff --git a/x-pack/legacy/plugins/uptime/common/graphql/types.ts b/x-pack/plugins/uptime/common/graphql/types.ts similarity index 95% rename from x-pack/legacy/plugins/uptime/common/graphql/types.ts rename to x-pack/plugins/uptime/common/graphql/types.ts index ed7c9ef19f484..3657f5a43cc5d 100644 --- a/x-pack/legacy/plugins/uptime/common/graphql/types.ts +++ b/x-pack/plugins/uptime/common/graphql/types.ts @@ -22,7 +22,9 @@ export interface Query { getMonitors?: LatestMonitorsResult | null; - getSnapshot?: Snapshot | null; + getSnapshot?: { + counts: SnapshotCount; + } | null; getSnapshotHistogram: HistogramDataPoint[]; @@ -82,7 +84,21 @@ export interface Ping { socks5?: Socks5 | null; - summary?: Summary | null; + summary?: { + up?: number | null; + + down?: number | null; + + geo?: { + name?: string | null; + + location?: { + lat?: number | null; + + lon?: number | null; + } | null; + } | null; + } | null; tags?: string | null; @@ -328,26 +344,6 @@ export interface Rtt { validate?: Duration | null; } -export interface Summary { - up?: number | null; - - down?: number | null; - - geo?: CheckGeo | null; -} - -export interface CheckGeo { - name?: string | null; - - location?: Location | null; -} - -export interface Location { - lat?: number | null; - - lon?: number | null; -} - export interface Tcp { port?: number | null; @@ -410,10 +406,6 @@ export interface MonitorSeriesPoint { y?: number | null; } -export interface Snapshot { - counts: SnapshotCount; -} - export interface SnapshotCount { up: number; @@ -526,7 +518,21 @@ export interface State { monitor?: MonitorState | null; - summary: Summary; + summary: { + up?: number | null; + + down?: number | null; + + geo?: { + name?: string | null; + + location?: { + lat?: number | null; + + lon?: number | null; + } | null; + } | null; + }; timestamp: UnsignedInteger; /** Transport encryption information. */ @@ -574,13 +580,25 @@ export interface CheckMonitor { } export interface CheckObserver { - geo?: CheckGeo | null; + geo?: { + name?: string | null; + + location?: { + lat?: number | null; + + lon?: number | null; + } | null; + } | null; } export interface StateGeo { name?: (string | null)[] | null; - location?: Location | null; + location?: { + lat?: number | null; + + lon?: number | null; + } | null; } export interface StateObserver { diff --git a/x-pack/plugins/uptime/common/index.ts b/x-pack/plugins/uptime/common/index.ts new file mode 100644 index 0000000000000..78855d44c1acf --- /dev/null +++ b/x-pack/plugins/uptime/common/index.ts @@ -0,0 +1,10 @@ +/* + * 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 * from './constants'; +export * from './domain_types'; +export * from './graphql'; +export * from './runtime_types'; diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/common.ts b/x-pack/plugins/uptime/common/runtime_types/common.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/runtime_types/common.ts rename to x-pack/plugins/uptime/common/runtime_types/common.ts diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/index.ts b/x-pack/plugins/uptime/common/runtime_types/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/runtime_types/index.ts rename to x-pack/plugins/uptime/common/runtime_types/index.ts diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/monitor/monitor_details.ts b/x-pack/plugins/uptime/common/runtime_types/monitor/monitor_details.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/runtime_types/monitor/monitor_details.ts rename to x-pack/plugins/uptime/common/runtime_types/monitor/monitor_details.ts diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/monitor/monitor_locations.ts b/x-pack/plugins/uptime/common/runtime_types/monitor/monitor_locations.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/runtime_types/monitor/monitor_locations.ts rename to x-pack/plugins/uptime/common/runtime_types/monitor/monitor_locations.ts diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/snapshot/index.ts b/x-pack/plugins/uptime/common/runtime_types/snapshot/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/runtime_types/snapshot/index.ts rename to x-pack/plugins/uptime/common/runtime_types/snapshot/index.ts diff --git a/x-pack/legacy/plugins/uptime/common/runtime_types/snapshot/snapshot_count.ts b/x-pack/plugins/uptime/common/runtime_types/snapshot/snapshot_count.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/runtime_types/snapshot/snapshot_count.ts rename to x-pack/plugins/uptime/common/runtime_types/snapshot/snapshot_count.ts diff --git a/x-pack/plugins/uptime/kibana.json b/x-pack/plugins/uptime/kibana.json index dd61716325afc..667a3a9595a4b 100644 --- a/x-pack/plugins/uptime/kibana.json +++ b/x-pack/plugins/uptime/kibana.json @@ -2,8 +2,9 @@ "configPath": ["xpack"], "id": "uptime", "kibanaVersion": "kibana", - "requiredPlugins": ["features", "licensing", "usageCollection"], + "optionalPlugins": ["home", "data", "capabilities"], + "requiredPlugins": ["embeddable", "features", "licensing", "usageCollection"], "server": true, - "ui": false, + "ui": true, "version": "8.0.0" } diff --git a/x-pack/legacy/plugins/uptime/public/app.ts b/x-pack/plugins/uptime/public/app.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/app.ts rename to x-pack/plugins/uptime/public/app.ts diff --git a/x-pack/plugins/uptime/public/apps/index.ts b/x-pack/plugins/uptime/public/apps/index.ts new file mode 100644 index 0000000000000..1f23f23db98c5 --- /dev/null +++ b/x-pack/plugins/uptime/public/apps/index.ts @@ -0,0 +1,17 @@ +/* + * 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 chrome from 'ui/chrome'; +// import { npStart } from 'ui/new_platform'; +// import { UptimePlugin } from './plugin'; +// import 'uiExports/embeddableFactories'; + +export { UptimePlugin } from './plugin'; + +// new UptimePlugin( +// { opaqueId: Symbol('uptime'), env: {} as any, config: { get: () => ({} as any) } }, +// chrome +// ).start(npStart); diff --git a/x-pack/plugins/uptime/public/apps/plugin.ts b/x-pack/plugins/uptime/public/apps/plugin.ts new file mode 100644 index 0000000000000..1e03a0b15066e --- /dev/null +++ b/x-pack/plugins/uptime/public/apps/plugin.ts @@ -0,0 +1,125 @@ +/* + * 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 { + LegacyCoreStart, + PluginInitializerContext, + CoreSetup, + CoreStart, + AppMountParameters, +} from 'src/core/public'; +import { PluginsStart } from 'ui/new_platform/new_platform'; +import { Chrome } from 'ui/chrome'; +import { Plugin } from '../../../../../src/core/public'; +import { UMFrontendLibs } from '../lib/lib'; +import { PLUGIN } from '../../common'; +import { getKibanaFrameworkAdapter } from '../lib/adapters/framework/new_platform_adapter'; +import template from './template.html'; +import { UptimeApp } from '../uptime_app'; +import { createApolloClient } from '../lib/adapters/framework/apollo_client_adapter'; +import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; +import { renderApp } from './render_app'; + +export interface StartObject { + core: LegacyCoreStart; + plugins: PluginsStart; +} + +export class UptimePlugin implements Plugin { + // private el: HTMLElement | undefined; + constructor() // @ts-ignore this is added to satisfy the New Platform typing constraint, + // but we're not leveraging any of its functionality yet. + // private readonly initializerContext: PluginInitializerContext, + // private readonly chrome: Chrome + { + // this.el = undefined; + // this.chrome = chrome; + } + + public async setup(core: CoreSetup, plugins: { home: any }) { + console.log('core setup', core); + + console.log('plugins from setup', plugins); + console.log(plugins.home); + + if (plugins.home) { + plugins.home.featureCatalogue.register({ + id: PLUGIN.ID, + title: PLUGIN.TITLE, + description: PLUGIN.DESCRIPTION, + icon: 'uptimeApp', + path: '/app/uptime#/', + showOnHomePage: true, + category: FeatureCatalogueCategory.DATA, + }); + } + + core.application.register({ + appRoute: '/app/uptime#/', + id: PLUGIN.ID, + euiIconType: 'uptimeApp', + order: 8900, + title: PLUGIN.TITLE, + descrption: PLUGIN.DESCRIPTION, + async mount(params: AppMountParameters) { + const [coreStart] = await core.getStartServices(); + const { element } = params; + const libs: UMFrontendLibs = { + framework: getKibanaFrameworkAdapter(coreStart, plugins.data.autocomplete), + }; + console.log(libs); + console.log('corestart from mount', coreStart); + console.log(Object.keys(plugins.embeddable)); + console.log(plugins.embeddable.registerEmbeddableFactory('')) + libs.framework.render({}, {}, element); + return () => {}; + // return renderApp(element); + console.log('the ele', element); + // this.el = element; + console.log('value after setting el', this.el); + return renderApp(element); + }, + }); + } + + public start(start: CoreStart, plugins: {}): void { + console.log('corestart from start:', start); + // console.log('start', start); + // console.log('plugins', plugins); + // const { + // data: { autocomplete }, + // } = plugins; + // console.log('autocomplete', autocomplete); + // // const { + // // core, + // // plugins: { + // // data: { autocomplete }, + // // }, + // // } = start; + // const libs: UMFrontendLibs = { + // framework: getKibanaFrameworkAdapter(start, autocomplete), + // }; + // console.log('value of el', this.el); + // libs.framework.render(UptimeApp, createApolloClient, this.el); + // // // @ts-ignore improper type description + // // // this.chrome.setRootTemplate(template); + // // const checkForRoot = () => { + // // return new Promise(resolve => { + // // const ready = !!document.getElementById(PLUGIN.APP_ROOT_ID); + // // if (ready) { + // // resolve(); + // // } else { + // // setTimeout(() => resolve(checkForRoot()), 10); + // // } + // // }); + // // }; + // // checkForRoot().then(() => { + // // libs.framework.render(UptimeApp, createApolloClient); + // // }); + } + + public stop() {} +} diff --git a/x-pack/plugins/uptime/public/apps/render_app.tsx b/x-pack/plugins/uptime/public/apps/render_app.tsx new file mode 100644 index 0000000000000..abd7a21b1c5cc --- /dev/null +++ b/x-pack/plugins/uptime/public/apps/render_app.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +import ReactDOM from 'react-dom'; + +export const renderApp = (element: any) => { + ReactDOM.render(
Hi there
, element); + return () => ReactDOM.unmountComponentAtNode(element); +}; diff --git a/x-pack/legacy/plugins/uptime/public/apps/template.html b/x-pack/plugins/uptime/public/apps/template.html similarity index 100% rename from x-pack/legacy/plugins/uptime/public/apps/template.html rename to x-pack/plugins/uptime/public/apps/template.html diff --git a/x-pack/legacy/plugins/uptime/public/badge.ts b/x-pack/plugins/uptime/public/badge.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/badge.ts rename to x-pack/plugins/uptime/public/badge.ts diff --git a/x-pack/legacy/plugins/uptime/public/breadcrumbs.ts b/x-pack/plugins/uptime/public/breadcrumbs.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/breadcrumbs.ts rename to x-pack/plugins/uptime/public/breadcrumbs.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/empty_status_bar.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/empty_status_bar.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/empty_status_bar.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/empty_status_bar.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_group.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_group.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_group.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_group.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_link.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_link.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_link.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_link.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_charts.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_ssl_certificate.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_ssl_certificate.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_ssl_certificate.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_ssl_certificate.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_status.bar.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_status.bar.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_status.bar.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_status.bar.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/overview_page_parsing_error_callout.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/overview_page_parsing_error_callout.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/overview_page_parsing_error_callout.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/overview_page_parsing_error_callout.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot_heading.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot_heading.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot_heading.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/snapshot_heading.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/uptime_date_picker.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/uptime_date_picker.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/__snapshots__/uptime_date_picker.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/uptime_date_picker.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/empty_status_bar.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/empty_status_bar.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/empty_status_bar.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/empty_status_bar.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/integration_group.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/integration_group.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/integration_group.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/integration_group.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/integration_link.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/integration_link.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/integration_link.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/integration_link.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_charts.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/monitor_charts.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_charts.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/monitor_charts.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_ssl_certificate.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/monitor_ssl_certificate.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_ssl_certificate.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/monitor_ssl_certificate.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_status.bar.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/monitor_status.bar.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/monitor_status.bar.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/monitor_status.bar.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/overview_page_parsing_error_callout.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/overview_page_parsing_error_callout.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/overview_page_parsing_error_callout.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/overview_page_parsing_error_callout.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/snapshot.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/snapshot.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/snapshot.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/snapshot.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/snapshot_heading.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/snapshot_heading.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/snapshot_heading.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/snapshot_heading.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/__tests__/uptime_date_picker.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/uptime_date_picker.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/__tests__/uptime_date_picker.test.tsx rename to x-pack/plugins/uptime/public/components/functional/__tests__/uptime_date_picker.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/chart_wrapper.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/chart_wrapper.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/chart_wrapper.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/chart_wrapper.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend_row.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend_row.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend_row.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/donut_chart_legend_row.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/monitor_bar_series.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/monitor_bar_series.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/monitor_bar_series.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/monitor_bar_series.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/snapshot_histogram.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/snapshot_histogram.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/snapshot_histogram.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/snapshot_histogram.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/chart_wrapper.test.tsx b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/chart_wrapper.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/chart_wrapper.test.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/chart_wrapper.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/donut_chart.test.tsx b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/donut_chart.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/donut_chart.test.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/donut_chart.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend.test.tsx b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend.test.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend_row.test.tsx b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend_row.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend_row.test.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/donut_chart_legend_row.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/get_tick_format.test.ts b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/get_tick_format.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/get_tick_format.test.ts rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/get_tick_format.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/monitor_bar_series.test.tsx b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/monitor_bar_series.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/monitor_bar_series.test.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/monitor_bar_series.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/snapshot_histogram.test.tsx b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/snapshot_histogram.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/__tests__/snapshot_histogram.test.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/__tests__/snapshot_histogram.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/chart_wrapper/chart_wrapper.tsx b/x-pack/plugins/uptime/public/components/functional/charts/chart_wrapper/chart_wrapper.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/chart_wrapper/chart_wrapper.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/chart_wrapper/chart_wrapper.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/chart_wrapper/index.ts b/x-pack/plugins/uptime/public/components/functional/charts/chart_wrapper/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/chart_wrapper/index.ts rename to x-pack/plugins/uptime/public/components/functional/charts/chart_wrapper/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/checks_chart.tsx b/x-pack/plugins/uptime/public/components/functional/charts/checks_chart.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/checks_chart.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/checks_chart.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/donut_chart.tsx b/x-pack/plugins/uptime/public/components/functional/charts/donut_chart.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/donut_chart.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/donut_chart.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/donut_chart_legend.tsx b/x-pack/plugins/uptime/public/components/functional/charts/donut_chart_legend.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/donut_chart_legend.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/donut_chart_legend.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/donut_chart_legend_row.tsx b/x-pack/plugins/uptime/public/components/functional/charts/donut_chart_legend_row.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/donut_chart_legend_row.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/donut_chart_legend_row.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_chart.tsx b/x-pack/plugins/uptime/public/components/functional/charts/duration_chart.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_chart.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/duration_chart.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_chart_empty_state.tsx b/x-pack/plugins/uptime/public/components/functional/charts/duration_chart_empty_state.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_chart_empty_state.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/duration_chart_empty_state.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_line_series_list.tsx b/x-pack/plugins/uptime/public/components/functional/charts/duration_line_series_list.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/duration_line_series_list.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/duration_line_series_list.tsx diff --git a/x-pack/plugins/uptime/public/components/functional/charts/get_colors_map.ts b/x-pack/plugins/uptime/public/components/functional/charts/get_colors_map.ts new file mode 100644 index 0000000000000..83d181d91f8da --- /dev/null +++ b/x-pack/plugins/uptime/public/components/functional/charts/get_colors_map.ts @@ -0,0 +1,23 @@ +/* + * 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 { DataSeriesColorsValues, SpecId } from '@elastic/charts'; + +/** + * This is a helper function used to more easily define a basic map + * for color values for use with elastic charts. Support for multiple + * color values can be added in the future if needed. + * @param color a string containing a valid color value + * @param specId an ID generated by the elastic charts library + */ +export const getColorsMap = ( + color: string, + specId: SpecId +): Map => { + const map = new Map(); + map.set({ colorValues: [], specId }, color); + return map; +}; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/get_tick_format.ts b/x-pack/plugins/uptime/public/components/functional/charts/get_tick_format.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/get_tick_format.ts rename to x-pack/plugins/uptime/public/components/functional/charts/get_tick_format.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/index.ts b/x-pack/plugins/uptime/public/components/functional/charts/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/index.ts rename to x-pack/plugins/uptime/public/components/functional/charts/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/monitor_bar_series.tsx b/x-pack/plugins/uptime/public/components/functional/charts/monitor_bar_series.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/monitor_bar_series.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/monitor_bar_series.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/charts/snapshot_histogram.tsx b/x-pack/plugins/uptime/public/components/functional/charts/snapshot_histogram.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/charts/snapshot_histogram.tsx rename to x-pack/plugins/uptime/public/components/functional/charts/snapshot_histogram.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_missing.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_missing.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_missing.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/data_missing.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/__snapshots__/empty_state.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/data_missing.test.tsx b/x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/data_missing.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/data_missing.test.tsx rename to x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/data_missing.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx b/x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx rename to x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/data_missing.tsx b/x-pack/plugins/uptime/public/components/functional/empty_state/data_missing.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/data_missing.tsx rename to x-pack/plugins/uptime/public/components/functional/empty_state/data_missing.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_index.tsx b/x-pack/plugins/uptime/public/components/functional/empty_state/empty_index.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_index.tsx rename to x-pack/plugins/uptime/public/components/functional/empty_state/empty_index.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state.tsx b/x-pack/plugins/uptime/public/components/functional/empty_state/empty_state.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state.tsx rename to x-pack/plugins/uptime/public/components/functional/empty_state/empty_state.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state_error.tsx b/x-pack/plugins/uptime/public/components/functional/empty_state/empty_state_error.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state_error.tsx rename to x-pack/plugins/uptime/public/components/functional/empty_state/empty_state_error.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state_loading.tsx b/x-pack/plugins/uptime/public/components/functional/empty_state/empty_state_loading.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/empty_state_loading.tsx rename to x-pack/plugins/uptime/public/components/functional/empty_state/empty_state_loading.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_state/index.ts b/x-pack/plugins/uptime/public/components/functional/empty_state/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_state/index.ts rename to x-pack/plugins/uptime/public/components/functional/empty_state/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/empty_status_bar.tsx b/x-pack/plugins/uptime/public/components/functional/empty_status_bar.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/empty_status_bar.tsx rename to x-pack/plugins/uptime/public/components/functional/empty_status_bar.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_popover.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_popover.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_popover.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_popover.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_status_button.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_status_button.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_status_button.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/__snapshots__/filter_status_button.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/filter_popover.test.tsx b/x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/filter_popover.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/filter_popover.test.tsx rename to x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/filter_popover.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/filter_status_button.test.tsx b/x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/filter_status_button.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/filter_status_button.test.tsx rename to x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/filter_status_button.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/toggle_selected_item.test.ts b/x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/toggle_selected_item.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/__tests__/toggle_selected_item.test.ts rename to x-pack/plugins/uptime/public/components/functional/filter_group/__tests__/toggle_selected_item.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_group.tsx b/x-pack/plugins/uptime/public/components/functional/filter_group/filter_group.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_group.tsx rename to x-pack/plugins/uptime/public/components/functional/filter_group/filter_group.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_popover.tsx b/x-pack/plugins/uptime/public/components/functional/filter_group/filter_popover.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_popover.tsx rename to x-pack/plugins/uptime/public/components/functional/filter_group/filter_popover.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_status_button.tsx b/x-pack/plugins/uptime/public/components/functional/filter_group/filter_status_button.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/filter_status_button.tsx rename to x-pack/plugins/uptime/public/components/functional/filter_group/filter_status_button.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/index.ts b/x-pack/plugins/uptime/public/components/functional/filter_group/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/index.ts rename to x-pack/plugins/uptime/public/components/functional/filter_group/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/toggle_selected_item.ts b/x-pack/plugins/uptime/public/components/functional/filter_group/toggle_selected_item.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/toggle_selected_item.ts rename to x-pack/plugins/uptime/public/components/functional/filter_group/toggle_selected_item.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/filter_group/uptime_filter_button.tsx b/x-pack/plugins/uptime/public/components/functional/filter_group/uptime_filter_button.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/filter_group/uptime_filter_button.tsx rename to x-pack/plugins/uptime/public/components/functional/filter_group/uptime_filter_button.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/index.ts b/x-pack/plugins/uptime/public/components/functional/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/index.ts rename to x-pack/plugins/uptime/public/components/functional/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/integration_group.tsx b/x-pack/plugins/uptime/public/components/functional/integration_group.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/integration_group.tsx rename to x-pack/plugins/uptime/public/components/functional/integration_group.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/integration_link.tsx b/x-pack/plugins/uptime/public/components/functional/integration_link.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/integration_link.tsx rename to x-pack/plugins/uptime/public/components/functional/integration_link.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/index.tsx b/x-pack/plugins/uptime/public/components/functional/kuery_bar/index.tsx similarity index 98% rename from x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/index.tsx rename to x-pack/plugins/uptime/public/components/functional/kuery_bar/index.tsx index 72e88d2824073..67a57efd6a2f3 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/index.tsx +++ b/x-pack/plugins/uptime/public/components/functional/kuery_bar/index.tsx @@ -19,7 +19,7 @@ import { AutocompleteSuggestion, esKuery, IIndexPattern, -} from '../../../../../../../../src/plugins/data/public'; +} from '../../../../../../../src/plugins/data/public'; const Container = styled.div` margin-bottom: 10px; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/click_outside.js b/x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/click_outside.js similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/click_outside.js rename to x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/click_outside.js diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.d.ts b/x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.d.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.d.ts rename to x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.d.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.js b/x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.js similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.js rename to x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/index.js diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestion.js b/x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestion.js similarity index 97% rename from x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestion.js rename to x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestion.js index 2b5ad9b59e39f..936eae04ffa64 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestion.js +++ b/x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestion.js @@ -14,7 +14,7 @@ import { units, fontSizes, unit, -} from '../../../../../../apm/public/style/variables'; +} from '../../../../../../../legacy/plugins/apm/public/style/variables'; import { tint } from 'polished'; import theme from '@elastic/eui/dist/eui_theme_light.json'; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestions.js b/x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestions.js similarity index 95% rename from x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestions.js rename to x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestions.js index 7fbabe71bcdb5..ac6832050b9d3 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestions.js +++ b/x-pack/plugins/uptime/public/components/functional/kuery_bar/typeahead/suggestions.js @@ -9,7 +9,7 @@ import PropTypes from 'prop-types'; import styled from 'styled-components'; import { isEmpty } from 'lodash'; import Suggestion from './suggestion'; -import { units, px, unit } from '../../../../../../apm/public/style/variables'; +import { units, px, unit } from '../../../../../../../legacy/plugins/apm/public/style/variables'; import { tint } from 'polished'; import theme from '@elastic/eui/dist/eui_theme_light.json'; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/__mocks__/mock.ts b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/__mocks__/mock.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/__mocks__/mock.ts rename to x-pack/plugins/uptime/public/components/functional/location_map/embeddables/__mocks__/mock.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx similarity index 92% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx rename to x-pack/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx index 93de1d478fb83..9bf0c90eb373c 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx +++ b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx @@ -8,10 +8,10 @@ import React, { useEffect, useState } from 'react'; import uuid from 'uuid'; import styled from 'styled-components'; -import { start } from '../../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; +import { start } from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public/legacy'; import * as i18n from './translations'; // @ts-ignore -import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../maps/common/constants'; +import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../../legacy/plugins/maps/common/constants'; import { MapEmbeddable } from './types'; import { getLayerList } from './map_config'; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/low_poly_layer.json b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/low_poly_layer.json similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/low_poly_layer.json rename to x-pack/plugins/uptime/public/components/functional/location_map/embeddables/low_poly_layer.json diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/map_config.test.ts b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/map_config.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/map_config.test.ts rename to x-pack/plugins/uptime/public/components/functional/location_map/embeddables/map_config.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/map_config.ts b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/map_config.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/map_config.ts rename to x-pack/plugins/uptime/public/components/functional/location_map/embeddables/map_config.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/translations.ts b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/translations.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/translations.ts rename to x-pack/plugins/uptime/public/components/functional/location_map/embeddables/translations.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/types.ts b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/types.ts similarity index 81% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/types.ts rename to x-pack/plugins/uptime/public/components/functional/location_map/embeddables/types.ts index 5cac204ffb071..2a975b7eb8ca3 100644 --- a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/embeddables/types.ts +++ b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/types.ts @@ -10,9 +10,9 @@ import { EmbeddableInput, EmbeddableOutput, IEmbeddable, -} from '../../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; +} from '../../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; -import { esFilters } from '../../../../../../../../../src/plugins/data/public'; +import { esFilters } from '../../../../../../../../src/plugins/data/public'; export interface MapEmbeddableInput extends EmbeddableInput { filters: esFilters.Filter[]; diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/index.tsx b/x-pack/plugins/uptime/public/components/functional/location_map/index.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_map/index.tsx rename to x-pack/plugins/uptime/public/components/functional/location_map/index.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_map/location_map.tsx b/x-pack/plugins/uptime/public/components/functional/location_map/location_map.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_map/location_map.tsx rename to x-pack/plugins/uptime/public/components/functional/location_map/location_map.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/location_name.tsx b/x-pack/plugins/uptime/public/components/functional/location_name.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/location_name.tsx rename to x-pack/plugins/uptime/public/components/functional/location_name.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_charts.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_charts.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_charts.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_charts.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_pagination.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_status_column.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_status_column.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_status_column.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_list_status_column.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_page_link.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_page_link.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_page_link.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/__snapshots__/monitor_page_link.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_pagination.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_status_column.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_status_column.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_status_column.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_list_status_column.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_page_link.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_page_link.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_page_link.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/monitor_page_link.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/parse_timestamp.test.ts b/x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/parse_timestamp.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/__tests__/parse_timestamp.test.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_list/__tests__/parse_timestamp.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/index.ts b/x-pack/plugins/uptime/public/components/functional/monitor_list/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/index.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_list/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_actions_popover.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_actions_popover.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_actions_popover.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_actions_popover.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/location_link.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/location_link.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/location_link.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/location_link.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_list_drawer.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_list_drawer.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_list_drawer.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_list_drawer.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_list.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_list.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_list.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_list.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_row.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_row.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_row.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/monitor_status_row.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/most_recent_error.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/most_recent_error.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/most_recent_error.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/most_recent_error.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/data.json b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/data.json similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/data.json rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/data.json diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/location_link.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/location_link.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/location_link.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/location_link.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_row.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_row.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_row.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/monitor_status_row.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/index.ts b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/index.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/location_link.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/location_link.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/location_link.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/location_link.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_list.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_list.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_list.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_list.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_row.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_row.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_row.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/monitor_status_row.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/most_recent_error.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/most_recent_error.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/most_recent_error.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/most_recent_error.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_status_column.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_status_column.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_list_status_column.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_status_column.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_page_link.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_page_link.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/monitor_page_link.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_page_link.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/overview_page_link.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/overview_page_link.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/overview_page_link.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/overview_page_link.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/parse_timestamp.ts b/x-pack/plugins/uptime/public/components/functional/monitor_list/parse_timestamp.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/parse_timestamp.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_list/parse_timestamp.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/translations.ts b/x-pack/plugins/uptime/public/components/functional/monitor_list/translations.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/translations.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_list/translations.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/types.ts b/x-pack/plugins/uptime/public/components/functional/monitor_list/types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_list/types.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_list/types.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_page_title.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_page_title.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_page_title.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_page_title.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_bar/index.ts b/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_bar/index.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_status_bar/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_bar/monitor_ssl_certificate.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/monitor_ssl_certificate.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_bar/monitor_ssl_certificate.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_status_bar/monitor_ssl_certificate.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_bar/monitor_status_bar.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/monitor_status_bar.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_bar/monitor_status_bar.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_status_bar/monitor_status_bar.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_bar/translations.ts b/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/translations.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_bar/translations.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_status_bar/translations.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_details/index.ts b/x-pack/plugins/uptime/public/components/functional/monitor_status_details/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_details/index.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_status_details/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_details/monitor_status_details.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_status_details/monitor_status_details.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_details/monitor_status_details.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_status_details/monitor_status_details.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_details/translations.ts b/x-pack/plugins/uptime/public/components/functional/monitor_status_details/translations.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/monitor_status_details/translations.ts rename to x-pack/plugins/uptime/public/components/functional/monitor_status_details/translations.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/overview_page_parsing_error_callout.tsx b/x-pack/plugins/uptime/public/components/functional/overview_page_parsing_error_callout.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/overview_page_parsing_error_callout.tsx rename to x-pack/plugins/uptime/public/components/functional/overview_page_parsing_error_callout.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/expanded_row.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/expanded_row.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/expanded_row.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/expanded_row.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/ping_list.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/ping_list.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/ping_list.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/ping_list/__tests__/__snapshots__/ping_list.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/ping_list/__tests__/expanded_row.test.tsx b/x-pack/plugins/uptime/public/components/functional/ping_list/__tests__/expanded_row.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/ping_list/__tests__/expanded_row.test.tsx rename to x-pack/plugins/uptime/public/components/functional/ping_list/__tests__/expanded_row.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/ping_list/__tests__/ping_list.test.tsx b/x-pack/plugins/uptime/public/components/functional/ping_list/__tests__/ping_list.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/ping_list/__tests__/ping_list.test.tsx rename to x-pack/plugins/uptime/public/components/functional/ping_list/__tests__/ping_list.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/ping_list/expanded_row.tsx b/x-pack/plugins/uptime/public/components/functional/ping_list/expanded_row.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/ping_list/expanded_row.tsx rename to x-pack/plugins/uptime/public/components/functional/ping_list/expanded_row.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/ping_list/index.tsx b/x-pack/plugins/uptime/public/components/functional/ping_list/index.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/ping_list/index.tsx rename to x-pack/plugins/uptime/public/components/functional/ping_list/index.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/ping_list/ping_list.tsx b/x-pack/plugins/uptime/public/components/functional/ping_list/ping_list.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/ping_list/ping_list.tsx rename to x-pack/plugins/uptime/public/components/functional/ping_list/ping_list.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/search_schema.ts b/x-pack/plugins/uptime/public/components/functional/search_schema.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/search_schema.ts rename to x-pack/plugins/uptime/public/components/functional/search_schema.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/snapshot.tsx b/x-pack/plugins/uptime/public/components/functional/snapshot.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/snapshot.tsx rename to x-pack/plugins/uptime/public/components/functional/snapshot.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/snapshot_heading.tsx b/x-pack/plugins/uptime/public/components/functional/snapshot_heading.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/snapshot_heading.tsx rename to x-pack/plugins/uptime/public/components/functional/snapshot_heading.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/status_panel.tsx b/x-pack/plugins/uptime/public/components/functional/status_panel.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/status_panel.tsx rename to x-pack/plugins/uptime/public/components/functional/status_panel.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/functional/uptime_date_picker.tsx b/x-pack/plugins/uptime/public/components/functional/uptime_date_picker.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/functional/uptime_date_picker.tsx rename to x-pack/plugins/uptime/public/components/functional/uptime_date_picker.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/higher_order/__tests__/__snapshots__/responsive_wrapper.test.tsx.snap b/x-pack/plugins/uptime/public/components/higher_order/__tests__/__snapshots__/responsive_wrapper.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/higher_order/__tests__/__snapshots__/responsive_wrapper.test.tsx.snap rename to x-pack/plugins/uptime/public/components/higher_order/__tests__/__snapshots__/responsive_wrapper.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/components/higher_order/__tests__/responsive_wrapper.test.tsx b/x-pack/plugins/uptime/public/components/higher_order/__tests__/responsive_wrapper.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/higher_order/__tests__/responsive_wrapper.test.tsx rename to x-pack/plugins/uptime/public/components/higher_order/__tests__/responsive_wrapper.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/higher_order/index.ts b/x-pack/plugins/uptime/public/components/higher_order/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/higher_order/index.ts rename to x-pack/plugins/uptime/public/components/higher_order/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/components/higher_order/responsive_wrapper.tsx b/x-pack/plugins/uptime/public/components/higher_order/responsive_wrapper.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/higher_order/responsive_wrapper.tsx rename to x-pack/plugins/uptime/public/components/higher_order/responsive_wrapper.tsx diff --git a/x-pack/legacy/plugins/uptime/public/components/higher_order/uptime_graphql_query.tsx b/x-pack/plugins/uptime/public/components/higher_order/uptime_graphql_query.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/components/higher_order/uptime_graphql_query.tsx rename to x-pack/plugins/uptime/public/components/higher_order/uptime_graphql_query.tsx diff --git a/x-pack/legacy/plugins/uptime/public/contexts/index.ts b/x-pack/plugins/uptime/public/contexts/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/contexts/index.ts rename to x-pack/plugins/uptime/public/contexts/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/contexts/uptime_refresh_context.ts b/x-pack/plugins/uptime/public/contexts/uptime_refresh_context.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/contexts/uptime_refresh_context.ts rename to x-pack/plugins/uptime/public/contexts/uptime_refresh_context.ts diff --git a/x-pack/legacy/plugins/uptime/public/contexts/uptime_settings_context.ts b/x-pack/plugins/uptime/public/contexts/uptime_settings_context.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/contexts/uptime_settings_context.ts rename to x-pack/plugins/uptime/public/contexts/uptime_settings_context.ts diff --git a/x-pack/legacy/plugins/uptime/public/hooks/__tests__/__snapshots__/use_url_params.test.tsx.snap b/x-pack/plugins/uptime/public/hooks/__tests__/__snapshots__/use_url_params.test.tsx.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/hooks/__tests__/__snapshots__/use_url_params.test.tsx.snap rename to x-pack/plugins/uptime/public/hooks/__tests__/__snapshots__/use_url_params.test.tsx.snap diff --git a/x-pack/legacy/plugins/uptime/public/hooks/__tests__/use_url_params.test.tsx b/x-pack/plugins/uptime/public/hooks/__tests__/use_url_params.test.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/hooks/__tests__/use_url_params.test.tsx rename to x-pack/plugins/uptime/public/hooks/__tests__/use_url_params.test.tsx diff --git a/x-pack/legacy/plugins/uptime/public/hooks/index.ts b/x-pack/plugins/uptime/public/hooks/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/hooks/index.ts rename to x-pack/plugins/uptime/public/hooks/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/hooks/use_url_params.ts b/x-pack/plugins/uptime/public/hooks/use_url_params.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/hooks/use_url_params.ts rename to x-pack/plugins/uptime/public/hooks/use_url_params.ts diff --git a/x-pack/legacy/plugins/uptime/public/icons/heartbeat_white.svg b/x-pack/plugins/uptime/public/icons/heartbeat_white.svg similarity index 100% rename from x-pack/legacy/plugins/uptime/public/icons/heartbeat_white.svg rename to x-pack/plugins/uptime/public/icons/heartbeat_white.svg diff --git a/x-pack/plugins/uptime/public/index.ts b/x-pack/plugins/uptime/public/index.ts new file mode 100644 index 0000000000000..ece9207b852e6 --- /dev/null +++ b/x-pack/plugins/uptime/public/index.ts @@ -0,0 +1,10 @@ +/* + * 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 { PluginInitializerContext } from 'kibana/public'; +import { UptimePlugin } from './apps'; + +export const plugin = (_initializerContext: PluginInitializerContext) => new UptimePlugin(); diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts b/x-pack/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts rename to x-pack/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/capabilities_adapter.ts b/x-pack/plugins/uptime/public/lib/adapters/framework/capabilities_adapter.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/framework/capabilities_adapter.ts rename to x-pack/plugins/uptime/public/lib/adapters/framework/capabilities_adapter.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts b/x-pack/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts rename to x-pack/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx similarity index 92% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx rename to x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx index b7ff3b2aa6264..88d2e6cea5a76 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx +++ b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx @@ -80,11 +80,12 @@ export const getKibanaFrameworkAdapter = ( return { // TODO: these parameters satisfy the interface but are no longer needed - render: async (createComponent: BootstrapUptimeApp, cgc: CreateGraphQLClient) => { - const node = await document.getElementById('react-uptime-root'); - if (node) { - ReactDOM.render(, node); - } + render: async ( + createComponent: BootstrapUptimeApp, + cgc: CreateGraphQLClient, + element: HTMLElement + ) => { + ReactDOM.render(, element); }, }; }; diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/index_pattern/__tests__/get_index_pattern.test.ts b/x-pack/plugins/uptime/public/lib/adapters/index_pattern/__tests__/get_index_pattern.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/index_pattern/__tests__/get_index_pattern.test.ts rename to x-pack/plugins/uptime/public/lib/adapters/index_pattern/__tests__/get_index_pattern.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/index_pattern/get_index_pattern.ts b/x-pack/plugins/uptime/public/lib/adapters/index_pattern/get_index_pattern.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/index_pattern/get_index_pattern.ts rename to x-pack/plugins/uptime/public/lib/adapters/index_pattern/get_index_pattern.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/index_pattern/index.ts b/x-pack/plugins/uptime/public/lib/adapters/index_pattern/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/index_pattern/index.ts rename to x-pack/plugins/uptime/public/lib/adapters/index_pattern/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/telemetry/index.ts b/x-pack/plugins/uptime/public/lib/adapters/telemetry/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/telemetry/index.ts rename to x-pack/plugins/uptime/public/lib/adapters/telemetry/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/telemetry/log_monitor.ts b/x-pack/plugins/uptime/public/lib/adapters/telemetry/log_monitor.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/telemetry/log_monitor.ts rename to x-pack/plugins/uptime/public/lib/adapters/telemetry/log_monitor.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/adapters/telemetry/log_overview.ts b/x-pack/plugins/uptime/public/lib/adapters/telemetry/log_overview.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/adapters/telemetry/log_overview.ts rename to x-pack/plugins/uptime/public/lib/adapters/telemetry/log_overview.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap rename to x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_kueries.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_kueries.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_kueries.test.ts.snap rename to x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_kueries.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_url_params.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_url_params.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_url_params.test.ts.snap rename to x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/stringify_url_params.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap rename to x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/combine_filters_and_user_search.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/combine_filters_and_user_search.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/combine_filters_and_user_search.test.ts rename to x-pack/plugins/uptime/public/lib/helper/__tests__/combine_filters_and_user_search.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/convert_measurements.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/convert_measurements.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/convert_measurements.test.ts rename to x-pack/plugins/uptime/public/lib/helper/__tests__/convert_measurements.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/format_error_string.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/format_error_string.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/format_error_string.test.ts rename to x-pack/plugins/uptime/public/lib/helper/__tests__/format_error_string.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/get_api_path.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/get_api_path.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/get_api_path.test.ts rename to x-pack/plugins/uptime/public/lib/helper/__tests__/get_api_path.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/series_has_down_values.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/series_has_down_values.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/series_has_down_values.test.ts rename to x-pack/plugins/uptime/public/lib/helper/__tests__/series_has_down_values.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/stringify_kueries.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/stringify_kueries.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/stringify_kueries.test.ts rename to x-pack/plugins/uptime/public/lib/helper/__tests__/stringify_kueries.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/stringify_url_params.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/stringify_url_params.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/stringify_url_params.test.ts rename to x-pack/plugins/uptime/public/lib/helper/__tests__/stringify_url_params.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts rename to x-pack/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/charts/__tests__/get_label_format.test.ts b/x-pack/plugins/uptime/public/lib/helper/charts/__tests__/get_label_format.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/charts/__tests__/get_label_format.test.ts rename to x-pack/plugins/uptime/public/lib/helper/charts/__tests__/get_label_format.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/charts/__tests__/is_within_current_date.test.ts b/x-pack/plugins/uptime/public/lib/helper/charts/__tests__/is_within_current_date.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/charts/__tests__/is_within_current_date.test.ts rename to x-pack/plugins/uptime/public/lib/helper/charts/__tests__/is_within_current_date.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts b/x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts rename to x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/charts/get_label_format.ts b/x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/charts/get_label_format.ts rename to x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/charts/index.ts b/x-pack/plugins/uptime/public/lib/helper/charts/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/charts/index.ts rename to x-pack/plugins/uptime/public/lib/helper/charts/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/charts/is_within_current_date.ts b/x-pack/plugins/uptime/public/lib/helper/charts/is_within_current_date.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/charts/is_within_current_date.ts rename to x-pack/plugins/uptime/public/lib/helper/charts/is_within_current_date.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/combine_filters_and_user_search.ts b/x-pack/plugins/uptime/public/lib/helper/combine_filters_and_user_search.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/combine_filters_and_user_search.ts rename to x-pack/plugins/uptime/public/lib/helper/combine_filters_and_user_search.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/convert_measurements.ts b/x-pack/plugins/uptime/public/lib/helper/convert_measurements.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/convert_measurements.ts rename to x-pack/plugins/uptime/public/lib/helper/convert_measurements.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/format_error_list.ts b/x-pack/plugins/uptime/public/lib/helper/format_error_list.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/format_error_list.ts rename to x-pack/plugins/uptime/public/lib/helper/format_error_list.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/get_api_path.ts b/x-pack/plugins/uptime/public/lib/helper/get_api_path.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/get_api_path.ts rename to x-pack/plugins/uptime/public/lib/helper/get_api_path.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/get_title.ts b/x-pack/plugins/uptime/public/lib/helper/get_title.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/get_title.ts rename to x-pack/plugins/uptime/public/lib/helper/get_title.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/index.ts b/x-pack/plugins/uptime/public/lib/helper/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/index.ts rename to x-pack/plugins/uptime/public/lib/helper/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/add_base_path.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/add_base_path.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/add_base_path.ts rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/add_base_path.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/build_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/build_href.ts rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/index.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/observability_integration/index.ts rename to x-pack/plugins/uptime/public/lib/helper/observability_integration/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/series_has_down_values.ts b/x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/series_has_down_values.ts rename to x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/stringify_kueries.ts b/x-pack/plugins/uptime/public/lib/helper/stringify_kueries.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/stringify_kueries.ts rename to x-pack/plugins/uptime/public/lib/helper/stringify_kueries.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/stringify_url_params.ts b/x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/stringify_url_params.ts rename to x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/to_static_index_pattern.ts b/x-pack/plugins/uptime/public/lib/helper/to_static_index_pattern.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/to_static_index_pattern.ts rename to x-pack/plugins/uptime/public/lib/helper/to_static_index_pattern.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/__snapshots__/get_supported_url_params.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/__snapshots__/get_supported_url_params.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/__snapshots__/get_supported_url_params.test.ts.snap rename to x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/__snapshots__/get_supported_url_params.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/parse_absolute_date.test.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/parse_absolute_date.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/parse_absolute_date.test.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/parse_absolute_date.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/parse_autorefresh_interval.test.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/parse_autorefresh_interval.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/parse_autorefresh_interval.test.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/parse_autorefresh_interval.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/parse_is_paused.test.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/parse_is_paused.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/parse_is_paused.test.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/parse_is_paused.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/parse_url_int.test.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/parse_url_int.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/__tests__/parse_url_int.test.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/parse_url_int.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/index.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/index.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/parse_absolute_date.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/parse_is_paused.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/parse_is_paused.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/parse_is_paused.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/parse_is_paused.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/helper/url_params/parse_url_int.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/parse_url_int.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/lib/helper/url_params/parse_url_int.ts rename to x-pack/plugins/uptime/public/lib/helper/url_params/parse_url_int.ts diff --git a/x-pack/legacy/plugins/uptime/public/lib/lib.ts b/x-pack/plugins/uptime/public/lib/lib.ts similarity index 88% rename from x-pack/legacy/plugins/uptime/public/lib/lib.ts rename to x-pack/plugins/uptime/public/lib/lib.ts index 0a744bff815c7..a1e7ff663f403 100644 --- a/x-pack/legacy/plugins/uptime/public/lib/lib.ts +++ b/x-pack/plugins/uptime/public/lib/lib.ts @@ -25,5 +25,9 @@ export type UMGraphQLClient = ApolloClient; // | OtherCli export type BootstrapUptimeApp = (props: UptimeAppProps) => React.ReactElement; export interface UMFrameworkAdapter { - render(createComponent: BootstrapUptimeApp, createGraphQLClient: CreateGraphQLClient): void; + render( + createComponent: BootstrapUptimeApp, + createGraphQLClient: CreateGraphQLClient, + element: HTMLElement + ): void; } diff --git a/x-pack/legacy/plugins/uptime/public/pages/index.ts b/x-pack/plugins/uptime/public/pages/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/pages/index.ts rename to x-pack/plugins/uptime/public/pages/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/pages/monitor.tsx b/x-pack/plugins/uptime/public/pages/monitor.tsx similarity index 95% rename from x-pack/legacy/plugins/uptime/public/pages/monitor.tsx rename to x-pack/plugins/uptime/public/pages/monitor.tsx index 8c5649f680fcb..4f23918e96070 100644 --- a/x-pack/legacy/plugins/uptime/public/pages/monitor.tsx +++ b/x-pack/plugins/uptime/public/pages/monitor.tsx @@ -14,7 +14,7 @@ import { UMUpdateBreadcrumbs } from '../lib/lib'; import { UptimeSettingsContext } from '../contexts'; import { useUrlParams } from '../hooks'; import { stringifyUrlParams } from '../lib/helper/stringify_url_params'; -import { useTrackPageview } from '../../../infra/public'; +// import { useTrackPageview } from '../../../../legacy/plugins/infra/public'; import { getTitle } from '../lib/helper/get_title'; import { MonitorStatusDetails } from '../components/functional/monitor_status_details'; @@ -78,8 +78,8 @@ export const MonitorPage = ({ logMonitorPageLoad(); }, [logMonitorPageLoad]); - useTrackPageview({ app: 'uptime', path: 'monitor' }); - useTrackPageview({ app: 'uptime', path: 'monitor', delay: 15000 }); + // useTrackPageview({ app: 'uptime', path: 'monitor' }); + // useTrackPageview({ app: 'uptime', path: 'monitor', delay: 15000 }); return ( diff --git a/x-pack/legacy/plugins/uptime/public/pages/not_found.tsx b/x-pack/plugins/uptime/public/pages/not_found.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/pages/not_found.tsx rename to x-pack/plugins/uptime/public/pages/not_found.tsx diff --git a/x-pack/legacy/plugins/uptime/public/pages/overview.tsx b/x-pack/plugins/uptime/public/pages/overview.tsx similarity index 95% rename from x-pack/legacy/plugins/uptime/public/pages/overview.tsx rename to x-pack/plugins/uptime/public/pages/overview.tsx index 8e72f964ed128..aff507776d8c6 100644 --- a/x-pack/legacy/plugins/uptime/public/pages/overview.tsx +++ b/x-pack/plugins/uptime/public/pages/overview.tsx @@ -21,10 +21,10 @@ import { UMUpdateBreadcrumbs } from '../lib/lib'; import { UptimeSettingsContext } from '../contexts'; import { useUrlParams } from '../hooks'; import { stringifyUrlParams } from '../lib/helper/stringify_url_params'; -import { useTrackPageview } from '../../../infra/public'; +// import { useTrackPageview } from '../../../../legacy/plugins/infra/public'; import { getIndexPattern } from '../lib/adapters/index_pattern'; import { combineFiltersAndUserSearch, stringifyKueries, toStaticIndexPattern } from '../lib/helper'; -import { AutocompleteProviderRegister, esKuery } from '../../../../../../src/plugins/data/public'; +import { AutocompleteProviderRegister, esKuery } from '../../../../../src/plugins/data/public'; interface OverviewPageProps { basePath: string; @@ -87,8 +87,8 @@ export const OverviewPage = ({ } }, [basePath, logOverviewPageLoad, setBreadcrumbs, setHeadingText]); - useTrackPageview({ app: 'uptime', path: 'overview' }); - useTrackPageview({ app: 'uptime', path: 'overview', delay: 15000 }); + // useTrackPageview({ app: 'uptime', path: 'overview' }); + // useTrackPageview({ app: 'uptime', path: 'overview', delay: 15000 }); const filterQueryString = search || ''; let error: any; diff --git a/x-pack/legacy/plugins/uptime/public/queries/doc_count_query.ts b/x-pack/plugins/uptime/public/queries/doc_count_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/queries/doc_count_query.ts rename to x-pack/plugins/uptime/public/queries/doc_count_query.ts diff --git a/x-pack/legacy/plugins/uptime/public/queries/filter_bar_query.ts b/x-pack/plugins/uptime/public/queries/filter_bar_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/queries/filter_bar_query.ts rename to x-pack/plugins/uptime/public/queries/filter_bar_query.ts diff --git a/x-pack/legacy/plugins/uptime/public/queries/index.ts b/x-pack/plugins/uptime/public/queries/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/queries/index.ts rename to x-pack/plugins/uptime/public/queries/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/queries/monitor_charts_query.ts b/x-pack/plugins/uptime/public/queries/monitor_charts_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/queries/monitor_charts_query.ts rename to x-pack/plugins/uptime/public/queries/monitor_charts_query.ts diff --git a/x-pack/legacy/plugins/uptime/public/queries/monitor_page_title_query.ts b/x-pack/plugins/uptime/public/queries/monitor_page_title_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/queries/monitor_page_title_query.ts rename to x-pack/plugins/uptime/public/queries/monitor_page_title_query.ts diff --git a/x-pack/legacy/plugins/uptime/public/queries/monitor_states_query.ts b/x-pack/plugins/uptime/public/queries/monitor_states_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/queries/monitor_states_query.ts rename to x-pack/plugins/uptime/public/queries/monitor_states_query.ts diff --git a/x-pack/legacy/plugins/uptime/public/queries/monitor_status_bar_query.ts b/x-pack/plugins/uptime/public/queries/monitor_status_bar_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/queries/monitor_status_bar_query.ts rename to x-pack/plugins/uptime/public/queries/monitor_status_bar_query.ts diff --git a/x-pack/legacy/plugins/uptime/public/queries/pings_query.ts b/x-pack/plugins/uptime/public/queries/pings_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/queries/pings_query.ts rename to x-pack/plugins/uptime/public/queries/pings_query.ts diff --git a/x-pack/legacy/plugins/uptime/public/queries/snapshot_histogram_query.ts b/x-pack/plugins/uptime/public/queries/snapshot_histogram_query.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/queries/snapshot_histogram_query.ts rename to x-pack/plugins/uptime/public/queries/snapshot_histogram_query.ts diff --git a/x-pack/legacy/plugins/uptime/public/register_feature.ts b/x-pack/plugins/uptime/public/register_feature.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/register_feature.ts rename to x-pack/plugins/uptime/public/register_feature.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/index.ts b/x-pack/plugins/uptime/public/state/actions/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/actions/index.ts rename to x-pack/plugins/uptime/public/state/actions/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/monitor.ts b/x-pack/plugins/uptime/public/state/actions/monitor.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/actions/monitor.ts rename to x-pack/plugins/uptime/public/state/actions/monitor.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/snapshot.ts b/x-pack/plugins/uptime/public/state/actions/snapshot.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/actions/snapshot.ts rename to x-pack/plugins/uptime/public/state/actions/snapshot.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/types.ts b/x-pack/plugins/uptime/public/state/actions/types.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/actions/types.ts rename to x-pack/plugins/uptime/public/state/actions/types.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/actions/ui.ts b/x-pack/plugins/uptime/public/state/actions/ui.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/actions/ui.ts rename to x-pack/plugins/uptime/public/state/actions/ui.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/api/__tests__/__snapshots__/snapshot.test.ts.snap b/x-pack/plugins/uptime/public/state/api/__tests__/__snapshots__/snapshot.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/api/__tests__/__snapshots__/snapshot.test.ts.snap rename to x-pack/plugins/uptime/public/state/api/__tests__/__snapshots__/snapshot.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/state/api/__tests__/snapshot.test.ts b/x-pack/plugins/uptime/public/state/api/__tests__/snapshot.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/api/__tests__/snapshot.test.ts rename to x-pack/plugins/uptime/public/state/api/__tests__/snapshot.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/api/index.ts b/x-pack/plugins/uptime/public/state/api/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/api/index.ts rename to x-pack/plugins/uptime/public/state/api/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/api/monitor.ts b/x-pack/plugins/uptime/public/state/api/monitor.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/api/monitor.ts rename to x-pack/plugins/uptime/public/state/api/monitor.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/api/snapshot.ts b/x-pack/plugins/uptime/public/state/api/snapshot.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/api/snapshot.ts rename to x-pack/plugins/uptime/public/state/api/snapshot.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/index.ts b/x-pack/plugins/uptime/public/state/effects/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/effects/index.ts rename to x-pack/plugins/uptime/public/state/effects/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/monitor.ts b/x-pack/plugins/uptime/public/state/effects/monitor.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/effects/monitor.ts rename to x-pack/plugins/uptime/public/state/effects/monitor.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/effects/snapshot.ts b/x-pack/plugins/uptime/public/state/effects/snapshot.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/effects/snapshot.ts rename to x-pack/plugins/uptime/public/state/effects/snapshot.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/index.ts b/x-pack/plugins/uptime/public/state/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/index.ts rename to x-pack/plugins/uptime/public/state/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/__tests__/__snapshots__/snapshot.test.ts.snap b/x-pack/plugins/uptime/public/state/reducers/__tests__/__snapshots__/snapshot.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/reducers/__tests__/__snapshots__/snapshot.test.ts.snap rename to x-pack/plugins/uptime/public/state/reducers/__tests__/__snapshots__/snapshot.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/__tests__/__snapshots__/ui.test.ts.snap b/x-pack/plugins/uptime/public/state/reducers/__tests__/__snapshots__/ui.test.ts.snap similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/reducers/__tests__/__snapshots__/ui.test.ts.snap rename to x-pack/plugins/uptime/public/state/reducers/__tests__/__snapshots__/ui.test.ts.snap diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/__tests__/snapshot.test.ts b/x-pack/plugins/uptime/public/state/reducers/__tests__/snapshot.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/reducers/__tests__/snapshot.test.ts rename to x-pack/plugins/uptime/public/state/reducers/__tests__/snapshot.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/__tests__/ui.test.ts b/x-pack/plugins/uptime/public/state/reducers/__tests__/ui.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/reducers/__tests__/ui.test.ts rename to x-pack/plugins/uptime/public/state/reducers/__tests__/ui.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/index.ts b/x-pack/plugins/uptime/public/state/reducers/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/reducers/index.ts rename to x-pack/plugins/uptime/public/state/reducers/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/monitor.ts b/x-pack/plugins/uptime/public/state/reducers/monitor.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/reducers/monitor.ts rename to x-pack/plugins/uptime/public/state/reducers/monitor.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/snapshot.ts b/x-pack/plugins/uptime/public/state/reducers/snapshot.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/reducers/snapshot.ts rename to x-pack/plugins/uptime/public/state/reducers/snapshot.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/reducers/ui.ts b/x-pack/plugins/uptime/public/state/reducers/ui.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/reducers/ui.ts rename to x-pack/plugins/uptime/public/state/reducers/ui.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts b/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/selectors/__tests__/index.test.ts rename to x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts diff --git a/x-pack/legacy/plugins/uptime/public/state/selectors/index.ts b/x-pack/plugins/uptime/public/state/selectors/index.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/selectors/index.ts rename to x-pack/plugins/uptime/public/state/selectors/index.ts diff --git a/x-pack/legacy/plugins/uptime/public/uptime_app.tsx b/x-pack/plugins/uptime/public/uptime_app.tsx similarity index 100% rename from x-pack/legacy/plugins/uptime/public/uptime_app.tsx rename to x-pack/plugins/uptime/public/uptime_app.tsx diff --git a/x-pack/legacy/plugins/uptime/scripts/gql_gen.json b/x-pack/plugins/uptime/scripts/gql_gen.json similarity index 100% rename from x-pack/legacy/plugins/uptime/scripts/gql_gen.json rename to x-pack/plugins/uptime/scripts/gql_gen.json diff --git a/x-pack/legacy/plugins/uptime/scripts/infer_graphql_types.js b/x-pack/plugins/uptime/scripts/infer_graphql_types.js similarity index 100% rename from x-pack/legacy/plugins/uptime/scripts/infer_graphql_types.js rename to x-pack/plugins/uptime/scripts/infer_graphql_types.js diff --git a/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts index 713d3f2b6392a..15c008df81852 100644 --- a/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts @@ -6,13 +6,13 @@ import { CreateUMGraphQLResolvers, UMContext } from '../types'; import { UMServerLibs } from '../../lib/lib'; -import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; import { GetMonitorStatesQueryArgs, MonitorSummaryResult, StatesIndexStatus, -} from '../../../../../legacy/plugins/uptime/common/graphql/types'; -import { CONTEXT_DEFAULTS } from '../../../../../legacy/plugins/uptime/common/constants/context_defaults'; + UMResolver, +} from '../../../common'; +import { CONTEXT_DEFAULTS } from '../../../common/constants/context_defaults'; export type UMGetMonitorStatesResolver = UMResolver< MonitorSummaryResult | Promise, diff --git a/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts index 02ad2141e27b8..a149841cb0415 100644 --- a/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts @@ -4,22 +4,22 @@ * you may not use this file except in compliance with the Elastic License. */ -import { UMGqlRange } from '../../../../../legacy/plugins/uptime/common/domain_types'; -import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; import { FilterBar, GetFilterBarQueryArgs, GetLatestMonitorsQueryArgs, GetMonitorChartsDataQueryArgs, GetMonitorPageTitleQueryArgs, + GetSnapshotHistogramQueryArgs, + HistogramResult, MonitorChart, MonitorPageTitle, Ping, - GetSnapshotHistogramQueryArgs, -} from '../../../../../legacy/plugins/uptime/common/graphql/types'; + UMGqlRange, + UMResolver, +} from '../../../common'; import { UMServerLibs } from '../../lib/lib'; import { CreateUMGraphQLResolvers, UMContext } from '../types'; -import { HistogramResult } from '../../../../../legacy/plugins/uptime/common/domain_types'; export type UMMonitorsResolver = UMResolver, any, UMGqlRange, UMContext>; diff --git a/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts b/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts index 13dace5da8f12..6ab897e8995e8 100644 --- a/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts @@ -4,12 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; -import { - AllPingsQueryArgs, - DocCount, - PingResults, -} from '../../../../../legacy/plugins/uptime/common/graphql/types'; +import { AllPingsQueryArgs, DocCount, PingResults, UMResolver } from '../../../common'; import { UMServerLibs } from '../../lib/lib'; import { UMContext } from '../types'; import { CreateUMGraphQLResolvers } from '../types'; diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts index c9f287ad279fd..6cc894f2cc5fe 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/adapter_types.ts @@ -7,11 +7,11 @@ import { MonitorSummary, CursorDirection, + Snapshot, SortOrder, StatesIndexStatus, -} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +} from '../../../../common'; import { UMElasticsearchQueryFn } from '../framework'; -import { Snapshot } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; export interface MonitorStatesParams { dateRangeStart: string; diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts index fcb160e37bf4e..4d7e3a38b43d5 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/elasticsearch_monitor_states_adapter.ts @@ -5,10 +5,7 @@ */ import { UMMonitorStatesAdapter, CursorPagination } from './adapter_types'; -import { - INDEX_NAMES, - CONTEXT_DEFAULTS, -} from '../../../../../../legacy/plugins/uptime/common/constants'; +import { INDEX_NAMES, CONTEXT_DEFAULTS } from '../../../../common'; import { fetchPage } from './search'; import { MonitorGroupIterator } from './search/monitor_group_iterator'; import { getSnapshotCountHelper } from './get_snapshot_helper'; diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts index 95f3c4243f6dc..47ddcf665890b 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/get_snapshot_helper.ts @@ -5,7 +5,7 @@ */ import { MonitorGroups, MonitorGroupIterator } from './search'; -import { Snapshot } from '../../../../../../legacy/plugins/uptime/common/runtime_types'; +import { Snapshot } from '../../../../common'; const reduceItemsToCounts = (items: MonitorGroups[]) => { let down = 0; diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts index 968f2df686ed6..7f3c31a6fd8cb 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/fetch_page.test.ts @@ -12,7 +12,7 @@ import { MonitorGroupsPage, } from '../fetch_page'; import { QueryContext } from '../../elasticsearch_monitor_states_adapter'; -import { MonitorSummary } from '../../../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { MonitorSummary } from '../../../../../../common'; import { nextPagination, prevPagination, simpleQueryContext } from './test_helpers'; const simpleFixture: MonitorGroups[] = [ diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts index 7df0c04f844fe..bccf99543e9b8 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/__tests__/test_helpers.ts @@ -5,10 +5,7 @@ */ import { CursorPagination } from '../../adapter_types'; -import { - CursorDirection, - SortOrder, -} from '../../../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { CursorDirection, SortOrder } from '../../../../../../common'; import { QueryContext } from '../../elasticsearch_monitor_states_adapter'; export const prevPagination = (key: any): CursorPagination => { diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts index 4d4e4616f7e73..d9e8ca3a6690e 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/enrich_monitor_groups.ts @@ -7,14 +7,15 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; import { getHistogramIntervalFormatted } from '../../../helper'; -import { INDEX_NAMES, STATES } from '../../../../../../../legacy/plugins/uptime/common/constants'; import { MonitorSummary, SummaryHistogram, Check, CursorDirection, SortOrder, -} from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; + INDEX_NAMES, + STATES, +} from '../../../../../common'; import { MonitorEnricher } from './fetch_page'; export const enrichMonitorGroups: MonitorEnricher = async ( diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts index f3f30abbd3139..dd912bf8d6837 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/fetch_page.ts @@ -7,12 +7,7 @@ import { flatten } from 'lodash'; import { CursorPagination } from '../adapter_types'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; -import { QUERY } from '../../../../../../../legacy/plugins/uptime/common/constants'; -import { - CursorDirection, - MonitorSummary, - SortOrder, -} from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { CursorDirection, MonitorSummary, SortOrder, QUERY } from '../../../../../common'; import { enrichMonitorGroups } from './enrich_monitor_groups'; import { MonitorGroupIterator } from './monitor_group_iterator'; diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts index fc1567dd0916c..5c8ca1d79a9f6 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/find_potential_matches.ts @@ -6,8 +6,7 @@ import { get, set } from 'lodash'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; -import { CursorDirection } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; -import { INDEX_NAMES } from '../../../../../../../legacy/plugins/uptime/common/constants'; +import { CursorDirection, INDEX_NAMES } from '../../../../../common'; import { makeDateRangeFilter } from '../../../helper/make_date_rate_filter'; // This is the first phase of the query. In it, we find the most recent check groups that matched the given query. diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts index 924a361e0ed1a..b83bd6e4e23ea 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/monitor_group_iterator.ts @@ -7,7 +7,7 @@ import { QueryContext } from '../elasticsearch_monitor_states_adapter'; import { CursorPagination } from '../adapter_types'; import { fetchChunk } from './fetch_chunk'; -import { CursorDirection } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { CursorDirection } from '../../../../../common'; import { MonitorGroups } from './fetch_page'; // Hardcoded chunk size for how many monitors to fetch at a time when querying diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts index 944604c50aa38..a0dff4917046c 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitor_states/search/refine_potential_matches.ts @@ -4,9 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { INDEX_NAMES } from '../../../../../../../legacy/plugins/uptime/common/constants'; import { QueryContext } from '../elasticsearch_monitor_states_adapter'; -import { CursorDirection } from '../../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { CursorDirection, INDEX_NAMES } from '../../../../../common'; import { MonitorGroups, MonitorLocCheckGroup } from './fetch_page'; import { makeDateRangeFilter } from '../../../helper/make_date_rate_filter'; diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts index 988f21db0034a..8a2cbd22311c9 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitors/adapter_types.ts @@ -4,15 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - MonitorChart, - MonitorPageTitle, -} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMElasticsearchQueryFn } from '../framework'; import { + MonitorChart, MonitorDetails, MonitorLocations, -} from '../../../../../../legacy/plugins/uptime/common/runtime_types'; + MonitorPageTitle, +} from '../../../../common'; export interface GetMonitorChartsDataParams { /** @member monitorId ID value for the selected monitor */ diff --git a/x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts index e72834d3245d0..60450ed74d1e3 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/monitors/elasticsearch_monitors_adapter.ts @@ -5,17 +5,15 @@ */ import { get } from 'lodash'; -import { INDEX_NAMES } from '../../../../../../legacy/plugins/uptime/common/constants'; import { MonitorChart, Ping, LocationDurationLine, -} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; -import { getHistogramIntervalFormatted } from '../../helper'; -import { MonitorError, MonitorLocation, -} from '../../../../../../legacy/plugins/uptime/common/runtime_types'; + INDEX_NAMES, +} from '../../../../common'; +import { getHistogramIntervalFormatted } from '../../helper'; import { UMMonitorsAdapter } from './adapter_types'; const formatStatusBuckets = (time: any, buckets: any, docCount: any) => { diff --git a/x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts index ece88a248ed61..e876da9da503c 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/pings/adapter_types.ts @@ -4,12 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { - DocCount, - Ping, - PingResults, -} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; -import { HistogramResult } from '../../../../../../legacy/plugins/uptime/common/domain_types'; +import { DocCount, HistogramResult, Ping, PingResults } from '../../../../common'; import { UMElasticsearchQueryFn } from '../framework'; export interface GetAllParams { diff --git a/x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts index de24737d05acd..348ce7add944d 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/pings/elasticsearch_pings_adapter.ts @@ -5,12 +5,7 @@ */ import { get } from 'lodash'; -import { INDEX_NAMES } from '../../../../../../legacy/plugins/uptime/common/constants'; -import { - HttpBody, - Ping, - PingResults, -} from '../../../../../../legacy/plugins/uptime/common/graphql/types'; +import { HttpBody, Ping, PingResults, INDEX_NAMES } from '../../../../common'; import { parseFilterQuery, getFilterClause, getHistogramIntervalFormatted } from '../../helper'; import { UMPingsAdapter, HistogramQueryResult } from './adapter_types'; import { getHistogramInterval } from '../../helper/get_histogram_interval'; diff --git a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts index f13b44c553569..928bc24a72554 100644 --- a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts +++ b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts @@ -5,7 +5,7 @@ */ import DateMath from '@elastic/datemath'; -import { QUERY } from '../../../../../legacy/plugins/uptime/common/constants'; +import { QUERY } from '../../../common'; export const getHistogramInterval = ( dateRangeStart: string, diff --git a/x-pack/plugins/uptime/server/register_feature.ts b/x-pack/plugins/uptime/server/register_feature.ts index 3562e138aafb3..7a0826d267ac4 100644 --- a/x-pack/plugins/uptime/server/register_feature.ts +++ b/x-pack/plugins/uptime/server/register_feature.ts @@ -6,7 +6,7 @@ import { i18n } from '@kbn/i18n'; import { PluginSetupContract } from '../../features/server'; -import { PLUGIN } from '../../../legacy/plugins/uptime/common/constants'; +import { PLUGIN } from '../common'; export const registerFeature = (features: PluginSetupContract) => { features.registerFeature({ From 824647c2a78304697ec713e914c51a51c35ad646 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Wed, 1 Apr 2020 17:03:00 -0400 Subject: [PATCH 06/36] WIP fixing things. --- .../telemetry/kibana_telemetry_adapter.ts | 203 ++++++++++++++++-- .../plugins/uptime/server/rest_api/index.ts | 20 +- .../index_pattern/get_index_pattern.ts | 28 --- .../server/rest_api/index_pattern/index.ts | 7 - .../rest_api/monitors/monitor_locations.ts | 10 +- .../rest_api/monitors/monitors_details.ts | 10 +- .../uptime/server/rest_api/monitors/status.ts | 18 +- .../overview_filters/get_overview_filters.ts | 10 +- .../uptime/server/rest_api/pings/get_all.ts | 10 +- .../uptime/server/rest_api/pings/index.ts | 2 +- .../rest_api/snapshot/get_snapshot_count.ts | 10 +- .../uptime/server/rest_api/telemetry/index.ts | 3 +- .../rest_api/telemetry/log_monitor_page.ts | 21 -- .../rest_api/telemetry/log_overview_page.ts | 21 -- .../plugins/uptime/server/rest_api/types.ts | 2 + .../server/rest_api/uptime_route_wrapper.ts | 11 +- 16 files changed, 255 insertions(+), 131 deletions(-) delete mode 100644 x-pack/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts delete mode 100644 x-pack/plugins/uptime/server/rest_api/index_pattern/index.ts delete mode 100644 x-pack/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts delete mode 100644 x-pack/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts index 8dec0c1d2d485..3b2696ba23f7c 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/kibana_telemetry_adapter.ts @@ -3,12 +3,13 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; -interface UptimeTelemetry { - overview_page: number; - monitor_page: number; -} +import moment from 'moment'; +import { ISavedObjectsRepository } from 'kibana/server'; +import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; +import { PageViewParams, UptimeTelemetry } from './types'; +import { APICaller } from '../framework'; +import { savedObjectsAdapter } from '../../saved_objects'; interface UptimeTelemetryCollector { [key: number]: UptimeTelemetry; @@ -20,30 +21,180 @@ const BUCKET_SIZE = 3600; const BUCKET_NUMBER = 24; export class KibanaTelemetryAdapter { - public static registerUsageCollector = (usageCollector: UsageCollectionSetup) => { - const collector = KibanaTelemetryAdapter.initUsageCollector(usageCollector); + public static registerUsageCollector = ( + usageCollector: UsageCollectionSetup, + getSavedObjectsClient: () => ISavedObjectsRepository | undefined + ) => { + if (!usageCollector) { + return; + } + const collector = KibanaTelemetryAdapter.initUsageCollector( + usageCollector, + getSavedObjectsClient + ); usageCollector.registerCollector(collector); }; - public static initUsageCollector(usageCollector: UsageCollectionSetup) { + public static initUsageCollector( + usageCollector: UsageCollectionSetup, + getSavedObjectsClient: () => ISavedObjectsRepository | undefined + ) { return usageCollector.makeUsageCollector({ type: 'uptime', - fetch: async () => { + fetch: async (callCluster: APICaller) => { + const savedObjectsClient = getSavedObjectsClient()!; + if (savedObjectsClient) { + this.countNoOfUniqueMonitorAndLocations(callCluster, savedObjectsClient); + } const report = this.getReport(); return { last_24_hours: { hits: { ...report } } }; }, - isReady: () => true, + isReady: () => typeof getSavedObjectsClient() !== 'undefined', }); } - public static countOverview() { - const bucket = this.getBucketToIncrement(); - this.collector[bucket].overview_page += 1; + public static countPageView(pageView: PageViewParams) { + const bucketId = this.getBucketToIncrement(); + const bucket = this.collector[bucketId]; + if (pageView.page === 'Overview') { + bucket.overview_page += 1; + } + if (pageView.page === 'Monitor') { + bucket.monitor_page += 1; + } + if (pageView.page === 'Settings') { + bucket.settings_page += 1; + } + this.updateDateData(pageView, bucket); + return bucket; + } + + public static updateDateData( + { dateStart, dateEnd, autoRefreshEnabled, autorefreshInterval }: PageViewParams, + bucket: UptimeTelemetry + ) { + const prevDateStart = [...bucket.dateRangeStart].pop(); + if (!prevDateStart || prevDateStart !== dateStart) { + bucket.dateRangeStart.push(dateStart); + bucket.dateRangeEnd.push(dateEnd); + } else { + const prevDateEnd = [...bucket.dateRangeEnd].pop(); + if (!prevDateEnd || prevDateEnd !== dateEnd) { + bucket.dateRangeStart.push(dateStart); + bucket.dateRangeEnd.push(dateEnd); + } + } + + const prevAutorefreshInterval = [...bucket.autorefreshInterval].pop(); + if (!prevAutorefreshInterval || prevAutorefreshInterval !== autorefreshInterval) { + bucket.autorefreshInterval.push(autorefreshInterval); + } + bucket.autoRefreshEnabled = autoRefreshEnabled; } - public static countMonitor() { + public static async countNoOfUniqueMonitorAndLocations( + callCluster: APICaller, + savedObjectsClient: ISavedObjectsRepository + ) { + const dynamicSettings = await savedObjectsAdapter.getUptimeDynamicSettings(savedObjectsClient); + const params = { + index: dynamicSettings.heartbeatIndices, + body: { + query: { + bool: { + must: [ + { + range: { + '@timestamp': { + gte: 'now-1d/d', + lt: 'now', + }, + }, + }, + ], + }, + }, + size: 0, + aggs: { + unique_monitors: { + cardinality: { + field: 'monitor.id', + }, + }, + unique_locations: { + cardinality: { + field: 'observer.geo.name', + missing: 'N/A', + }, + }, + monitor_name: { + string_stats: { + field: 'monitor.name', + }, + }, + observer_loc_name: { + string_stats: { + field: 'observer.geo.name', + }, + }, + monitors: { + terms: { + field: 'monitor.id', + size: 1000, + }, + aggs: { + docs: { + top_hits: { + size: 1, + _source: ['monitor.timespan'], + }, + }, + }, + }, + }, + }, + }; + + const result = await callCluster('search', params); + const numberOfUniqueMonitors: number = result?.aggregations?.unique_monitors?.value ?? 0; + const numberOfUniqueLocations: number = result?.aggregations?.unique_locations?.value ?? 0; + const monitorNameStats: any = result?.aggregations?.monitor_name; + const locationNameStats: any = result?.aggregations?.observer_loc_name; + const uniqueMonitors: any = result?.aggregations?.monitors.buckets; const bucket = this.getBucketToIncrement(); - this.collector[bucket].monitor_page += 1; + + this.collector[bucket].no_of_unique_monitors = numberOfUniqueMonitors; + this.collector[bucket].no_of_unique_observer_locations = numberOfUniqueLocations; + this.collector[bucket].no_of_unique_observer_locations = numberOfUniqueLocations; + this.collector[bucket].monitor_name_stats = { + min_length: monitorNameStats?.min_length ?? 0, + max_length: monitorNameStats?.max_length ?? 0, + avg_length: +monitorNameStats?.avg_length.toFixed(2), + }; + + this.collector[bucket].observer_location_name_stats = { + min_length: locationNameStats?.min_length ?? 0, + max_length: locationNameStats?.max_length ?? 0, + avg_length: +(locationNameStats?.avg_length?.toFixed(2) ?? 0), + }; + + this.collector[bucket].monitor_frequency = this.getMonitorsFrequency(uniqueMonitors); + } + + private static getMonitorsFrequency(uniqueMonitors = []) { + const frequencies: number[] = []; + uniqueMonitors + .map((item: any) => item!.docs.hits?.hits?.[0] ?? {}) + .forEach(monitor => { + const timespan = monitor?._source?.monitor?.timespan; + if (timespan) { + const timeDiffSec = moment + .duration(moment(timespan.lt).diff(moment(timespan.gte))) + .asSeconds(); + frequencies.push(timeDiffSec); + } + }); + return frequencies; } private static collector: UptimeTelemetryCollector = {}; @@ -59,10 +210,12 @@ export class KibanaTelemetryAdapter { return Object.values(this.collector).reduce( (acc, cum) => ({ + ...cum, overview_page: acc.overview_page + cum.overview_page, monitor_page: acc.monitor_page + cum.monitor_page, + settings_page: acc.settings_page + cum.settings_page, }), - { overview_page: 0, monitor_page: 0 } + { overview_page: 0, monitor_page: 0, settings_page: 0 } ); } @@ -77,6 +230,24 @@ export class KibanaTelemetryAdapter { this.collector[bucketId] = { overview_page: 0, monitor_page: 0, + no_of_unique_monitors: 0, + settings_page: 0, + monitor_frequency: [], + monitor_name_stats: { + min_length: 0, + max_length: 0, + avg_length: 0, + }, + no_of_unique_observer_locations: 0, + observer_location_name_stats: { + min_length: 0, + max_length: 0, + avg_length: 0, + }, + dateRangeStart: [], + dateRangeEnd: [], + autoRefreshEnabled: false, + autorefreshInterval: [], }; } return bucketId; diff --git a/x-pack/plugins/uptime/server/rest_api/index.ts b/x-pack/plugins/uptime/server/rest_api/index.ts index e64b317e67f98..561997c3567d0 100644 --- a/x-pack/plugins/uptime/server/rest_api/index.ts +++ b/x-pack/plugins/uptime/server/rest_api/index.ts @@ -5,9 +5,9 @@ */ import { createGetOverviewFilters } from './overview_filters'; -import { createGetAllRoute } from './pings'; -import { createGetIndexPatternRoute } from './index_pattern'; -import { createLogMonitorPageRoute, createLogOverviewPageRoute } from './telemetry'; +import { createGetPingsRoute } from './pings'; +import { createGetDynamicSettingsRoute, createPostDynamicSettingsRoute } from './dynamic_settings'; +import { createLogPageViewRoute } from './telemetry'; import { createGetSnapshotCount } from './snapshot'; import { UMRestApiRouteFactory } from './types'; import { @@ -16,19 +16,27 @@ import { createGetMonitorLocationsRoute, createGetStatusBarRoute, } from './monitors'; +import { createGetPingHistogramRoute } from './pings/get_ping_histogram'; +import { createGetMonitorDurationRoute } from './monitors/monitors_durations'; +import { createGetIndexPatternRoute, createGetIndexStatusRoute } from './index_state'; export * from './types'; export { createRouteWithAuth } from './create_route_with_auth'; export { uptimeRouteWrapper } from './uptime_route_wrapper'; + export const restApiRoutes: UMRestApiRouteFactory[] = [ createGetOverviewFilters, - createGetAllRoute, + createGetPingsRoute, createGetIndexPatternRoute, + createGetIndexStatusRoute, + createGetDynamicSettingsRoute, + createPostDynamicSettingsRoute, createGetMonitorRoute, createGetMonitorDetailsRoute, createGetMonitorLocationsRoute, createGetStatusBarRoute, createGetSnapshotCount, - createLogMonitorPageRoute, - createLogOverviewPageRoute, + createLogPageViewRoute, + createGetPingHistogramRoute, + createGetMonitorDurationRoute, ]; diff --git a/x-pack/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts b/x-pack/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts deleted file mode 100644 index f061307807a42..0000000000000 --- a/x-pack/plugins/uptime/server/rest_api/index_pattern/get_index_pattern.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 { UMServerLibs } from '../../lib/lib'; -import { UMRestApiRouteFactory } from '../types'; - -export const createGetIndexPatternRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ - method: 'GET', - path: '/api/uptime/index_pattern', - validate: false, - options: { - tags: ['access:uptime'], - }, - handler: async ({ savedObjectsClient: client }, _context, _request, response): Promise => { - try { - return response.ok({ - body: { - ...(await libs.savedObjects.getUptimeIndexPattern(client, undefined)), - }, - }); - } catch (e) { - return response.internalError({ body: { message: e.message } }); - } - }, -}); diff --git a/x-pack/plugins/uptime/server/rest_api/index_pattern/index.ts b/x-pack/plugins/uptime/server/rest_api/index_pattern/index.ts deleted file mode 100644 index b35e2e7b65a29..0000000000000 --- a/x-pack/plugins/uptime/server/rest_api/index_pattern/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * 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 { createGetIndexPatternRoute } from './get_index_pattern'; diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts index b2356ae0a88bf..73f50a91204c0 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts @@ -7,10 +7,11 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants/rest_api'; export const createGetMonitorLocationsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/monitor/locations', + path: API_URLS.MONITOR_LOCATIONS, validate: { query: schema.object({ monitorId: schema.string(), @@ -19,15 +20,16 @@ export const createGetMonitorLocationsRoute: UMRestApiRouteFactory = (libs: UMSe }), }, options: { - tags: ['access:uptime'], + tags: ['access:uptime-read'], }, - handler: async ({ callES }, _context, request, response): Promise => { + handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => { const { monitorId, dateStart, dateEnd } = request.query; return response.ok({ body: { - ...(await libs.monitors.getMonitorLocations({ + ...(await libs.requests.getMonitorLocations({ callES, + dynamicSettings, monitorId, dateStart, dateEnd, diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts index 9e1bc6f0d6a96..dbcecf1e561d2 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts @@ -7,10 +7,11 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants/rest_api'; export const createGetMonitorDetailsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/monitor/details', + path: API_URLS.MONITOR_DETAILS, validate: { query: schema.object({ monitorId: schema.string(), @@ -19,14 +20,15 @@ export const createGetMonitorDetailsRoute: UMRestApiRouteFactory = (libs: UMServ }), }, options: { - tags: ['access:uptime'], + tags: ['access:uptime-read'], }, - handler: async ({ callES }, _context, request, response): Promise => { + handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => { const { monitorId, dateStart, dateEnd } = request.query; return response.ok({ body: { - ...(await libs.monitors.getMonitorDetails({ + ...(await libs.requests.getMonitorDetails({ callES, + dynamicSettings, monitorId, dateStart, dateEnd, diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/status.ts b/x-pack/plugins/uptime/server/rest_api/monitors/status.ts index 8b1bc04b45110..5a3f893f4329f 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/status.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/status.ts @@ -7,24 +7,25 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common/constants/rest_api'; export const createGetMonitorRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/monitor/selected', + path: API_URLS.MONITOR_SELECTED, validate: { query: schema.object({ monitorId: schema.string(), }), }, options: { - tags: ['access:uptime'], + tags: ['access:uptime-read'], }, - handler: async ({ callES }, _context, request, response): Promise => { + handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => { const { monitorId } = request.query; return response.ok({ body: { - ...(await libs.pings.getMonitor({ callES, monitorId })), + ...(await libs.requests.getMonitor({ callES, dynamicSettings, monitorId })), }, }); }, @@ -32,7 +33,7 @@ export const createGetMonitorRoute: UMRestApiRouteFactory = (libs: UMServerLibs) export const createGetStatusBarRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/monitor/status', + path: API_URLS.MonitorStatus, validate: { query: schema.object({ monitorId: schema.string(), @@ -41,12 +42,13 @@ export const createGetStatusBarRoute: UMRestApiRouteFactory = (libs: UMServerLib }), }, options: { - tags: ['access:uptime'], + tags: ['access:uptime-read'], }, - handler: async ({ callES }, _context, request, response): Promise => { + handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => { const { monitorId, dateStart, dateEnd } = request.query; - const result = await libs.pings.getLatestMonitorStatus({ + const result = await libs.requests.getLatestMonitor({ callES, + dynamicSettings, monitorId, dateStart, dateEnd, diff --git a/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts b/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts index ef93253bb5b70..467ec96cf1711 100644 --- a/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts +++ b/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts @@ -8,6 +8,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; import { objectValuesToArrays } from '../../lib/helper'; +import { API_URLS } from '../../../common/constants/rest_api'; const arrayOrStringType = schema.maybe( schema.oneOf([schema.string(), schema.arrayOf(schema.string())]) @@ -15,7 +16,7 @@ const arrayOrStringType = schema.maybe( export const createGetOverviewFilters: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/filters', + path: API_URLS.FILTERS, validate: { query: schema.object({ dateRangeStart: schema.string(), @@ -29,9 +30,9 @@ export const createGetOverviewFilters: UMRestApiRouteFactory = (libs: UMServerLi }, options: { - tags: ['access:uptime'], + tags: ['access:uptime-read'], }, - handler: async ({ callES }, _context, request, response) => { + handler: async ({ callES, dynamicSettings }, _context, request, response) => { const { dateRangeStart, dateRangeEnd, locations, schemes, search, ports, tags } = request.query; let parsedSearch: Record | undefined; @@ -43,8 +44,9 @@ export const createGetOverviewFilters: UMRestApiRouteFactory = (libs: UMServerLi } } - const filtersResponse = await libs.monitors.getFilterBar({ + const filtersResponse = await libs.requests.getFilterBar({ callES, + dynamicSettings, dateRangeStart, dateRangeEnd, search: parsedSearch, diff --git a/x-pack/plugins/uptime/server/rest_api/pings/get_all.ts b/x-pack/plugins/uptime/server/rest_api/pings/get_all.ts index 824035954ea28..5cf9a7abf8749 100644 --- a/x-pack/plugins/uptime/server/rest_api/pings/get_all.ts +++ b/x-pack/plugins/uptime/server/rest_api/pings/get_all.ts @@ -7,10 +7,11 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common'; export const createGetAllRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/pings', + path: API_URLS.PINGS, validate: { query: schema.object({ dateRangeStart: schema.string(), @@ -23,13 +24,14 @@ export const createGetAllRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => }), }, options: { - tags: ['access:uptime'], + tags: ['access:uptime-read'], }, - handler: async ({ callES }, _context, request, response): Promise => { + handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => { const { dateRangeStart, dateRangeEnd, location, monitorId, size, sort, status } = request.query; - const result = await libs.pings.getAll({ + const result = await libs.requests.getPings({ callES, + dynamicSettings, dateRangeStart, dateRangeEnd, monitorId, diff --git a/x-pack/plugins/uptime/server/rest_api/pings/index.ts b/x-pack/plugins/uptime/server/rest_api/pings/index.ts index 43acf5410c8ed..abb7da26f994f 100644 --- a/x-pack/plugins/uptime/server/rest_api/pings/index.ts +++ b/x-pack/plugins/uptime/server/rest_api/pings/index.ts @@ -4,4 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export { createGetAllRoute } from './get_all'; +export { createGetPingsRoute } from './get_pings'; diff --git a/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts b/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts index 986ac797d63b6..34810aa2c9f3c 100644 --- a/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts +++ b/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts @@ -7,10 +7,11 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; +import { API_URLS } from '../../../common'; export const createGetSnapshotCount: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: '/api/uptime/snapshot/count', + path: API_URLS.SNAPSHOT_COUNT, validate: { query: schema.object({ dateRangeStart: schema.string(), @@ -20,12 +21,13 @@ export const createGetSnapshotCount: UMRestApiRouteFactory = (libs: UMServerLibs }), }, options: { - tags: ['access:uptime'], + tags: ['access:uptime-read'], }, - handler: async ({ callES }, _context, request, response): Promise => { + handler: async ({ callES, dynamicSettings }, _context, request, response): Promise => { const { dateRangeStart, dateRangeEnd, filters, statusFilter } = request.query; - const result = await libs.monitorStates.getSnapshotCount({ + const result = await libs.requests.getSnapshotCount({ callES, + dynamicSettings, dateRangeStart, dateRangeEnd, filters, diff --git a/x-pack/plugins/uptime/server/rest_api/telemetry/index.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/index.ts index 29640d97213a6..f16080296dc67 100644 --- a/x-pack/plugins/uptime/server/rest_api/telemetry/index.ts +++ b/x-pack/plugins/uptime/server/rest_api/telemetry/index.ts @@ -4,5 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -export { createLogMonitorPageRoute } from './log_monitor_page'; -export { createLogOverviewPageRoute } from './log_overview_page'; +export { createLogPageViewRoute } from './log_page_view'; diff --git a/x-pack/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts deleted file mode 100644 index fca1e6c8d5d46..0000000000000 --- a/x-pack/plugins/uptime/server/rest_api/telemetry/log_monitor_page.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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 { KibanaTelemetryAdapter } from '../../lib/adapters/telemetry'; -import { UMRestApiRouteFactory } from '../types'; - -export const createLogMonitorPageRoute: UMRestApiRouteFactory = () => ({ - method: 'POST', - path: '/api/uptime/logMonitor', - validate: false, - handler: async (_customParams, _context, _request, response): Promise => { - await KibanaTelemetryAdapter.countMonitor(); - return response.ok(); - }, - options: { - tags: ['access:uptime'], - }, -}); diff --git a/x-pack/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts deleted file mode 100644 index 37ed2e5ff5c2c..0000000000000 --- a/x-pack/plugins/uptime/server/rest_api/telemetry/log_overview_page.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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 { KibanaTelemetryAdapter } from '../../lib/adapters/telemetry'; -import { UMRestApiRouteFactory } from '../types'; - -export const createLogOverviewPageRoute: UMRestApiRouteFactory = () => ({ - method: 'POST', - path: '/api/uptime/logOverview', - validate: false, - handler: async (_customParams, _context, _request, response): Promise => { - await KibanaTelemetryAdapter.countOverview(); - return response.ok(); - }, - options: { - tags: ['access:uptime'], - }, -}); diff --git a/x-pack/plugins/uptime/server/rest_api/types.ts b/x-pack/plugins/uptime/server/rest_api/types.ts index e0c8ba4a286cf..84208ccecacc8 100644 --- a/x-pack/plugins/uptime/server/rest_api/types.ts +++ b/x-pack/plugins/uptime/server/rest_api/types.ts @@ -16,6 +16,7 @@ import { KibanaResponseFactory, IKibanaResponse, } from 'kibana/server'; +import { DynamicSettings } from '../../common/runtime_types'; import { UMServerLibs } from '../lib/lib'; /** @@ -66,6 +67,7 @@ export interface UMRouteParams { clientParams?: Record, options?: CallAPIOptions | undefined ) => Promise; + dynamicSettings: DynamicSettings; savedObjectsClient: Pick< SavedObjectsClient, | 'errors' diff --git a/x-pack/plugins/uptime/server/rest_api/uptime_route_wrapper.ts b/x-pack/plugins/uptime/server/rest_api/uptime_route_wrapper.ts index fb874edebee60..676aced23a25e 100644 --- a/x-pack/plugins/uptime/server/rest_api/uptime_route_wrapper.ts +++ b/x-pack/plugins/uptime/server/rest_api/uptime_route_wrapper.ts @@ -5,6 +5,7 @@ */ import { UMKibanaRouteWrapper } from './types'; +import { savedObjectsAdapter } from '../lib/saved_objects'; export const uptimeRouteWrapper: UMKibanaRouteWrapper = uptimeRoute => { return { @@ -12,7 +13,15 @@ export const uptimeRouteWrapper: UMKibanaRouteWrapper = uptimeRoute => { handler: async (context, request, response) => { const { callAsCurrentUser: callES } = context.core.elasticsearch.dataClient; const { client: savedObjectsClient } = context.core.savedObjects; - return await uptimeRoute.handler({ callES, savedObjectsClient }, context, request, response); + const dynamicSettings = await savedObjectsAdapter.getUptimeDynamicSettings( + savedObjectsClient + ); + return await uptimeRoute.handler( + { callES, savedObjectsClient, dynamicSettings }, + context, + request, + response + ); }, }; }; From ab9d5c9b6e07123134a6e889a993aa70ce8fc11b Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Wed, 1 Apr 2020 17:08:10 -0400 Subject: [PATCH 07/36] WIP fixing things. --- .../framework/kibana_framework_adapter.ts | 5 +- .../kibana_telemetry_adapter.test.ts.snap | 54 ++++++++++++++- .../kibana_telemetry_adapter.test.ts | 69 +++++++++++++++---- 3 files changed, 109 insertions(+), 19 deletions(-) diff --git a/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts index 8897255ee65ab..04bbbceca22ff 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/kibana_framework_adapter.ts @@ -22,13 +22,12 @@ export class UMKibanaBackendFrameworkAdapter implements UMBackendFrameworkAdapte validate, options, }; - const { router } = this.server; switch (method) { case 'GET': - router.get(routeDefinition, handler); + this.server.router.get(routeDefinition, handler); break; case 'POST': - router.post(routeDefinition, handler); + this.server.router.post(routeDefinition, handler); break; default: throw new Error(`Handler for method ${method} is not defined`); diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap index e88a2cdc50cd9..8c55d5da54ac7 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/__snapshots__/kibana_telemetry_adapter.test.ts.snap @@ -4,8 +4,32 @@ exports[`KibanaTelemetryAdapter collects monitor and overview data 1`] = ` Object { "last_24_hours": Object { "hits": Object { + "autoRefreshEnabled": true, + "autorefreshInterval": Array [ + 30, + ], + "dateRangeEnd": Array [ + "now", + ], + "dateRangeStart": Array [ + "now-15", + ], + "monitor_frequency": Array [], + "monitor_name_stats": Object { + "avg_length": 0, + "max_length": 0, + "min_length": 0, + }, "monitor_page": 1, - "overview_page": 2, + "no_of_unique_monitors": 0, + "no_of_unique_observer_locations": 0, + "observer_location_name_stats": Object { + "avg_length": 0, + "max_length": 0, + "min_length": 0, + }, + "overview_page": 1, + "settings_page": 1, }, }, } @@ -15,8 +39,32 @@ exports[`KibanaTelemetryAdapter drops old buckets and reduces current window 1`] Object { "last_24_hours": Object { "hits": Object { - "monitor_page": 3, - "overview_page": 4, + "autoRefreshEnabled": true, + "autorefreshInterval": Array [ + 30, + ], + "dateRangeEnd": Array [ + "now", + ], + "dateRangeStart": Array [ + "now-15", + ], + "monitor_frequency": Array [], + "monitor_name_stats": Object { + "avg_length": 0, + "max_length": 0, + "min_length": 0, + }, + "monitor_page": 2, + "no_of_unique_monitors": 0, + "no_of_unique_observer_locations": 0, + "observer_location_name_stats": Object { + "avg_length": 0, + "max_length": 0, + "min_length": 0, + }, + "overview_page": 1, + "settings_page": 2, }, }, } diff --git a/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts index 8e4011b4cf0eb..c2437dbf35307 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/telemetry/__tests__/kibana_telemetry_adapter.test.ts @@ -8,6 +8,7 @@ import { KibanaTelemetryAdapter } from '../kibana_telemetry_adapter'; describe('KibanaTelemetryAdapter', () => { let usageCollection: any; + let getSavedObjectsClient: any; let collector: { type: string; fetch: () => Promise; isReady: () => boolean }; beforeEach(() => { usageCollection = { @@ -15,14 +16,35 @@ describe('KibanaTelemetryAdapter', () => { collector = val; }, }; + getSavedObjectsClient = () => { + return {}; + }; }); it('collects monitor and overview data', async () => { expect.assertions(1); - KibanaTelemetryAdapter.initUsageCollector(usageCollection); - KibanaTelemetryAdapter.countMonitor(); - KibanaTelemetryAdapter.countOverview(); - KibanaTelemetryAdapter.countOverview(); + KibanaTelemetryAdapter.initUsageCollector(usageCollection, getSavedObjectsClient); + KibanaTelemetryAdapter.countPageView({ + page: 'Overview', + dateStart: 'now-15', + dateEnd: 'now', + autoRefreshEnabled: true, + autorefreshInterval: 30, + }); + KibanaTelemetryAdapter.countPageView({ + page: 'Monitor', + dateStart: 'now-15', + dateEnd: 'now', + autoRefreshEnabled: true, + autorefreshInterval: 30, + }); + KibanaTelemetryAdapter.countPageView({ + page: 'Settings', + dateStart: 'now-15', + dateEnd: 'now', + autoRefreshEnabled: true, + autorefreshInterval: 30, + }); const result = await collector.fetch(); expect(result).toMatchSnapshot(); }); @@ -31,21 +53,42 @@ describe('KibanaTelemetryAdapter', () => { expect.assertions(1); // give a time of > 24 hours ago Date.now = jest.fn(() => 1559053560000); - KibanaTelemetryAdapter.initUsageCollector(usageCollection); - KibanaTelemetryAdapter.countMonitor(); - KibanaTelemetryAdapter.countOverview(); - // give a time of now + KibanaTelemetryAdapter.initUsageCollector(usageCollection, getSavedObjectsClient); + KibanaTelemetryAdapter.countPageView({ + page: 'Overview', + dateStart: 'now-20', + dateEnd: 'now', + autoRefreshEnabled: true, + autorefreshInterval: 30, + }); + KibanaTelemetryAdapter.countPageView({ + page: 'Monitor', + dateStart: 'now-15', + dateEnd: 'now', + autoRefreshEnabled: true, + autorefreshInterval: 30, + }); // give a time of now Date.now = jest.fn(() => new Date().valueOf()); - KibanaTelemetryAdapter.countMonitor(); - KibanaTelemetryAdapter.countMonitor(); - KibanaTelemetryAdapter.countOverview(); - KibanaTelemetryAdapter.countOverview(); + KibanaTelemetryAdapter.countPageView({ + page: 'Monitor', + dateStart: 'now-15', + dateEnd: 'now', + autoRefreshEnabled: true, + autorefreshInterval: 30, + }); + KibanaTelemetryAdapter.countPageView({ + page: 'Settings', + dateStart: 'now-15', + dateEnd: 'now', + autoRefreshEnabled: true, + autorefreshInterval: 30, + }); const result = await collector.fetch(); expect(result).toMatchSnapshot(); }); it('defaults ready to `true`', async () => { - KibanaTelemetryAdapter.initUsageCollector(usageCollection); + KibanaTelemetryAdapter.initUsageCollector(usageCollection, getSavedObjectsClient); expect(collector.isReady()).toBe(true); }); }); From b322a189cb50aad3899e44a68a0f54ecee97a91d Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Wed, 1 Apr 2020 17:15:57 -0400 Subject: [PATCH 08/36] WIP fixing things. --- .../graphql/monitor_states/schema.gql.ts | 37 +----- .../uptime/server/graphql/monitors/index.ts | 8 -- .../server/graphql/monitors/resolvers.ts | 79 ----------- .../server/graphql/monitors/schema.gql.ts | 124 ------------------ .../uptime/server/graphql/pings/resolvers.ts | 26 ++-- .../uptime/server/graphql/pings/schema.gql.ts | 38 +----- x-pack/plugins/uptime/server/graphql/types.ts | 3 +- .../server/lib/helper/assert_close_to.ts | 5 + .../lib/helper/get_histogram_interval.ts | 29 +++- .../uptime/server/rest_api/monitors/status.ts | 6 +- 10 files changed, 55 insertions(+), 300 deletions(-) delete mode 100644 x-pack/plugins/uptime/server/graphql/monitors/index.ts delete mode 100644 x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts delete mode 100644 x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts diff --git a/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts index 198f97eab9652..4ce52ecf5846f 100644 --- a/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts +++ b/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts @@ -16,7 +16,6 @@ export const monitorStatesSchema = gql` "The number of _down_ documents." down: Int! } - "Monitor status data over time." type SummaryHistogram { "The number of documents used to assemble the histogram." @@ -24,11 +23,9 @@ export const monitorStatesSchema = gql` "The individual histogram data points." points: [SummaryHistogramPoint!]! } - type Agent { id: String! } - type Check { agent: Agent container: StateContainer @@ -37,61 +34,49 @@ export const monitorStatesSchema = gql` observer: CheckObserver timestamp: String! } - type StateContainer { id: String } - type StateKubernetes { pod: StatePod } - type StatePod { uid: String } - type CheckMonitor { ip: String name: String status: String! } - type Location { lat: Float lon: Float } - type CheckGeo { name: String location: Location } - type CheckObserver { geo: CheckGeo } - type StateGeo { name: [String] location: Location } - type StateObserver { geo: StateGeo } - type MonitorState { status: String name: String id: String type: String } - type Summary { up: Int down: Int geo: CheckGeo } - type MonitorSummaryUrl { domain: String fragment: String @@ -104,7 +89,6 @@ export const monitorStatesSchema = gql` scheme: String username: String } - type StateUrl { domain: String full: String @@ -112,7 +96,6 @@ export const monitorStatesSchema = gql` port: Int scheme: String } - "Contains monitor transmission encryption information." type StateTLS { "The date and time after which the certificate is invalid." @@ -121,7 +104,6 @@ export const monitorStatesSchema = gql` certificates: String rtt: RTT } - "Unifies the subsequent data for an uptime monitor." type State { "The agent processing the monitor." @@ -137,7 +119,6 @@ export const monitorStatesSchema = gql` tls: [StateTLS] url: StateUrl } - "Represents the current state and associated data for an Uptime monitor." type MonitorSummary { "The ID assigned by the config or generated by the user." @@ -146,7 +127,6 @@ export const monitorStatesSchema = gql` state: State! histogram: SummaryHistogram } - "The primary object returned for monitor states." type MonitorSummaryResult { "Used to go to the next page of results" @@ -156,27 +136,16 @@ export const monitorStatesSchema = gql` "The objects representing the state of a series of heartbeat monitors." summaries: [MonitorSummary!] "The number of summaries." - totalSummaryCount: DocCount! + totalSummaryCount: Int! } - - "Represents the current status of the uptime index." - type StatesIndexStatus { - "Flag denoting whether the index exists." - indexExists: Boolean! - "The number of documents in the index." - docCount: DocCount - } - enum CursorDirection { AFTER BEFORE } - enum SortOrder { ASC DESC } - extend type Query { "Fetches the current state of Uptime monitors for the given parameters." getMonitorStates( @@ -185,9 +154,7 @@ export const monitorStatesSchema = gql` pagination: String filters: String statusFilter: String + pageSize: Int ): MonitorSummaryResult - - "Fetches details about the uptime index." - getStatesIndexStatus: StatesIndexStatus! } `; diff --git a/x-pack/plugins/uptime/server/graphql/monitors/index.ts b/x-pack/plugins/uptime/server/graphql/monitors/index.ts deleted file mode 100644 index edf04a8acbb8a..0000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitors/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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 { createMonitorsResolvers } from './resolvers'; -export { monitorsSchema } from './schema.gql'; diff --git a/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts deleted file mode 100644 index 66ea7173ab8c8..0000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitors/resolvers.ts +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 { - GetFilterBarQueryArgs, - GetMonitorChartsDataQueryArgs, - GetSnapshotHistogramQueryArgs, - HistogramResult, - MonitorChart, - UMGqlRange, - UMResolver, -} from '../../../common'; -import { UMServerLibs } from '../../lib/lib'; -import { CreateUMGraphQLResolvers, UMContext } from '../types'; - -export type UMMonitorsResolver = UMResolver, any, UMGqlRange, UMContext>; - -export type UMGetMonitorChartsResolver = UMResolver< - any | Promise, - any, - GetMonitorChartsDataQueryArgs, - UMContext ->; - -export type UMGetFilterBarResolver = UMResolver< - any | Promise, - any, - GetFilterBarQueryArgs, - UMContext ->; - -export type UMGetSnapshotHistogram = UMResolver< - HistogramResult | Promise, - any, - GetSnapshotHistogramQueryArgs, - UMContext ->; - -export const createMonitorsResolvers: CreateUMGraphQLResolvers = ( - libs: UMServerLibs -): { - Query: { - getSnapshotHistogram: UMGetSnapshotHistogram; - getMonitorChartsData: UMGetMonitorChartsResolver; - }; -} => ({ - Query: { - async getSnapshotHistogram( - _resolver, - { dateRangeStart, dateRangeEnd, filters, monitorId, statusFilter }, - { APICaller } - ): Promise { - return await libs.pings.getPingHistogram({ - callES: APICaller, - dateRangeStart, - dateRangeEnd, - filters, - monitorId, - statusFilter, - }); - }, - async getMonitorChartsData( - _resolver, - { monitorId, dateRangeStart, dateRangeEnd, location }, - { APICaller } - ): Promise { - return await libs.monitors.getMonitorChartsData({ - callES: APICaller, - monitorId, - dateRangeStart, - dateRangeEnd, - location, - }); - }, - }, -}); diff --git a/x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts deleted file mode 100644 index 8a86d97b4cd8e..0000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitors/schema.gql.ts +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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 gql from 'graphql-tag'; - -export const monitorsSchema = gql` - type HistogramDataPoint { - upCount: Int - downCount: Int - x: UnsignedInteger - x0: UnsignedInteger - y: UnsignedInteger - } - - type DataPoint { - x: UnsignedInteger - y: Float - } - - "Represents a bucket of monitor status information." - type StatusData { - "The timeseries point for this status data." - x: UnsignedInteger! - "The value of up counts for this point." - up: Int - "The value for down counts for this point." - down: Int - "The total down counts for this point." - total: Int - } - - "The data used to populate the monitor charts." - type MonitorChart { - "The average values for the monitor duration." - locationDurationLines: [LocationDurationLine!]! - "The counts of up/down checks for the monitor." - status: [StatusData!]! - "The maximum status doc count in this chart." - statusMaxCount: Int! - "The maximum duration value in this chart." - durationMaxValue: Int! - } - - type LocationDurationLine { - name: String! - line: [MonitorDurationAveragePoint!]! - } - - type MonitorKey { - key: String! - url: String - } - - type MonitorSeriesPoint { - x: UnsignedInteger - y: Int - } - - "Represents a monitor's duration performance in microseconds at a point in time." - type MonitorDurationAreaPoint { - "The timeseries value for this point in time." - x: UnsignedInteger! - "The min duration value in microseconds at this time." - yMin: Float - "The max duration value in microseconds at this point." - yMax: Float - } - - "Represents the average monitor duration ms at a point in time." - type MonitorDurationAveragePoint { - "The timeseries value for this point." - x: UnsignedInteger! - "The average duration ms for the monitor." - y: Float - } - - "Represents the latest recorded information about a monitor." - type LatestMonitor { - "The ID of the monitor represented by this data." - id: MonitorKey! - "Information from the latest document." - ping: Ping - "Buckets of recent up count status data." - upSeries: [MonitorSeriesPoint!] - "Buckets of recent down count status data." - downSeries: [MonitorSeriesPoint!] - } - - type LatestMonitorsResult { - monitors: [LatestMonitor!] - } - - type HistogramResult { - histogram: [HistogramDataPoint]! - interval: UnsignedInteger! - } - - extend type Query { - getMonitors( - dateRangeStart: String! - dateRangeEnd: String! - filters: String - statusFilter: String - ): LatestMonitorsResult - - getSnapshotHistogram( - dateRangeStart: String! - dateRangeEnd: String! - filters: String - statusFilter: String - monitorId: String - ): HistogramResult - - getMonitorChartsData( - monitorId: String! - dateRangeStart: String! - dateRangeEnd: String! - location: String - ): MonitorChart - } -`; diff --git a/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts b/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts index 6ab897e8995e8..2bb1e13bc4b1f 100644 --- a/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/pings/resolvers.ts @@ -4,10 +4,15 @@ * you may not use this file except in compliance with the Elastic License. */ -import { AllPingsQueryArgs, DocCount, PingResults, UMResolver } from '../../../common'; +import { UMResolver } from '../../../../../legacy/plugins/uptime/common/graphql/resolver_types'; +import { + AllPingsQueryArgs, + PingResults, +} from '../../../../../legacy/plugins/uptime/common/graphql/types'; import { UMServerLibs } from '../../lib/lib'; import { UMContext } from '../types'; import { CreateUMGraphQLResolvers } from '../types'; +import { savedObjectsAdapter } from '../../lib/saved_objects'; export type UMAllPingsResolver = UMResolver< PingResults | Promise, @@ -16,11 +21,8 @@ export type UMAllPingsResolver = UMResolver< UMContext >; -export type UMGetDocCountResolver = UMResolver, any, never, UMContext>; - export interface UMPingResolver { allPings: () => PingResults; - getDocCount: () => number; } export const createPingsResolvers: CreateUMGraphQLResolvers = ( @@ -28,17 +30,21 @@ export const createPingsResolvers: CreateUMGraphQLResolvers = ( ): { Query: { allPings: UMAllPingsResolver; - getDocCount: UMGetDocCountResolver; }; } => ({ Query: { async allPings( _resolver, - { monitorId, sort, size, status, dateRangeStart, dateRangeEnd, location }, - { APICaller } + { monitorId, sort, size, status, dateRangeStart, dateRangeEnd, location, page }, + { APICaller, savedObjectsClient } ): Promise { - return await libs.pings.getAll({ + const dynamicSettings = await savedObjectsAdapter.getUptimeDynamicSettings( + savedObjectsClient + ); + + return await libs.requests.getPings({ callES: APICaller, + dynamicSettings, dateRangeStart, dateRangeEnd, monitorId, @@ -46,10 +52,8 @@ export const createPingsResolvers: CreateUMGraphQLResolvers = ( sort, size, location, + page, }); }, - async getDocCount(_resolver, _args, { APICaller }): Promise { - return libs.pings.getDocCount({ callES: APICaller }); - }, }, }); diff --git a/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts index 37c5400ff9d06..5bfa49350fa15 100644 --- a/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts +++ b/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts @@ -10,7 +10,6 @@ export const pingsSchema = gql` schema { query: Query } - type PingResults { "Total number of matching pings" total: UnsignedInteger! @@ -19,7 +18,6 @@ export const pingsSchema = gql` "List of pings " pings: [Ping!]! } - type Query { "Get a list of all recorded pings for all monitors" allPings( @@ -37,33 +35,27 @@ export const pingsSchema = gql` dateRangeEnd: String! "Optional: agent location to filter by." location: String + "Optional: current page." + page: Int ): PingResults! - - "Gets the number of documents in the target index" - getDocCount: DocCount! } - type ContainerImage { name: String tag: String } - type Container { id: String image: ContainerImage name: String runtime: String } - type DocCount { count: UnsignedInteger! } - "The monitor's status for a ping" type Duration { us: UnsignedInteger } - "An agent for recording a beat" type Beat { hostname: String @@ -71,23 +63,19 @@ export const pingsSchema = gql` timezone: String type: String } - type Docker { id: String image: String name: String } - type ECS { version: String } - type Error { code: Int message: String type: String } - type OS { family: String kernel: String @@ -96,7 +84,6 @@ export const pingsSchema = gql` name: String build: String } - "Geolocation data added via processors to enrich events." type Geo { "Name of the city in which the agent is running." @@ -116,7 +103,6 @@ export const pingsSchema = gql` "Name of the region hosting the agent." region_name: String } - type Host { architecture: String id: String @@ -126,7 +112,6 @@ export const pingsSchema = gql` name: String os: OS } - type HttpRTT { content: Duration response_header: Duration @@ -135,7 +120,6 @@ export const pingsSchema = gql` validate_body: Duration write_request: Duration } - type HTTPBody { "Size of HTTP response body in bytes" bytes: UnsignedInteger @@ -146,44 +130,36 @@ export const pingsSchema = gql` "Byte length of the content string, taking into account multibyte chars." content_bytes: UnsignedInteger } - type HTTPResponse { status_code: UnsignedInteger body: HTTPBody } - type HTTP { response: HTTPResponse rtt: HttpRTT url: String } - type ICMP { requests: Int rtt: Int } - type KubernetesContainer { image: String name: String } - type KubernetesNode { name: String } - type KubernetesPod { name: String uid: String } - type Kubernetes { container: KubernetesContainer namespace: String node: KubernetesNode pod: KubernetesPod } - type MetaCloud { availability_zone: String instance_id: String @@ -193,11 +169,9 @@ export const pingsSchema = gql` provider: String region: String } - type Meta { cloud: MetaCloud } - type Monitor { duration: Duration host: String @@ -215,34 +189,28 @@ export const pingsSchema = gql` type: String check_group: String } - "Metadata added by a proccessor, which is specified in its configuration." type Observer { "Geolocation data for the agent." geo: Geo } - type Resolve { host: String ip: String rtt: Duration } - type RTT { connect: Duration handshake: Duration validate: Duration } - type Socks5 { rtt: RTT } - type TCP { port: Int rtt: RTT } - "Contains monitor transmission encryption information." type PingTLS { "The date and time after which the certificate is invalid." @@ -251,7 +219,6 @@ export const pingsSchema = gql` certificates: String rtt: RTT } - type URL { full: String scheme: String @@ -260,7 +227,6 @@ export const pingsSchema = gql` path: String query: String } - "A request sent from a monitor to a host" type Ping { "unique ID for this ping" diff --git a/x-pack/plugins/uptime/server/graphql/types.ts b/x-pack/plugins/uptime/server/graphql/types.ts index 529ab41a62b3b..5f0a6749eb599 100644 --- a/x-pack/plugins/uptime/server/graphql/types.ts +++ b/x-pack/plugins/uptime/server/graphql/types.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { RequestHandlerContext, CallAPIOptions } from 'kibana/server'; +import { RequestHandlerContext, CallAPIOptions, SavedObjectsClient } from 'src/core/server'; import { UMServerLibs } from '../lib/lib'; export type UMContext = RequestHandlerContext & { @@ -13,6 +13,7 @@ export type UMContext = RequestHandlerContext & { clientParams?: Record, options?: CallAPIOptions | undefined ) => Promise; + savedObjectsClient: SavedObjectsClient; }; export interface UMGraphQLResolver { diff --git a/x-pack/plugins/uptime/server/lib/helper/assert_close_to.ts b/x-pack/plugins/uptime/server/lib/helper/assert_close_to.ts index 13b6f3688809c..45b76ba25470b 100644 --- a/x-pack/plugins/uptime/server/lib/helper/assert_close_to.ts +++ b/x-pack/plugins/uptime/server/lib/helper/assert_close_to.ts @@ -8,4 +8,9 @@ export const assertCloseTo = (actual: number, expected: number, precision: numbe if (Math.abs(expected - actual) > precision) { throw new Error(`expected [${expected}] to be within ${precision} of ${actual}`); } + + // if actual is undefined above math condition will be NAN and it will be always false + if (actual === undefined) { + throw new Error(`expected close to [${expected}] but got [${actual}]`); + } }; diff --git a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts index 928bc24a72554..fb44f5727aab3 100644 --- a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts +++ b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts @@ -5,20 +5,41 @@ */ import DateMath from '@elastic/datemath'; -import { QUERY } from '../../../common'; +import { QUERY } from '../../../../../legacy/plugins/uptime/common/constants'; + +export const parseRelativeDate = (dateStr: string, options = {}) => { + // We need this this parsing because if user selects This week or this date + // That represents end date in future, if week or day is still in the middle + // Uptime data can never be collected in future, so we will reset date to now + // in That case. Example case we select this week range will be to='now/w' and from = 'now/w'; + + const parsedDate = DateMath.parse(dateStr, options); + const dateTimestamp = parsedDate?.valueOf() ?? 0; + if (dateTimestamp > Date.now()) { + return DateMath.parse('now'); + } + return parsedDate; +}; export const getHistogramInterval = ( dateRangeStart: string, dateRangeEnd: string, bucketCount?: number ): number => { - const from = DateMath.parse(dateRangeStart); - const to = DateMath.parse(dateRangeEnd); + const from = parseRelativeDate(dateRangeStart); + + // roundUp is required for relative date like now/w to get the end of the week + const to = parseRelativeDate(dateRangeEnd, { roundUp: true }); if (from === undefined) { throw Error('Invalid dateRangeStart value'); } if (to === undefined) { throw Error('Invalid dateRangeEnd value'); } - return Math.round((to.valueOf() - from.valueOf()) / (bucketCount || QUERY.DEFAULT_BUCKET_COUNT)); + const interval = Math.round( + (to.valueOf() - from.valueOf()) / (bucketCount || QUERY.DEFAULT_BUCKET_COUNT) + ); + + // Interval can never be zero, if it's 0 we return at least 1ms interval + return interval > 0 ? interval : 1; }; diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/status.ts b/x-pack/plugins/uptime/server/rest_api/monitors/status.ts index 5a3f893f4329f..e1fcaf54f2824 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/status.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/status.ts @@ -7,11 +7,12 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common/constants/rest_api'; +import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants/rest_api'; export const createGetMonitorRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', path: API_URLS.MONITOR_SELECTED, + validate: { query: schema.object({ monitorId: schema.string(), @@ -33,7 +34,8 @@ export const createGetMonitorRoute: UMRestApiRouteFactory = (libs: UMServerLibs) export const createGetStatusBarRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', - path: API_URLS.MonitorStatus, + path: API_URLS.MONITOR_STATUS, + validate: { query: schema.object({ monitorId: schema.string(), From 9565e6a2acc223c6b28f1ef84c5fc8d3e26d60ca Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Wed, 1 Apr 2020 17:26:13 -0400 Subject: [PATCH 09/36] Finished fixing server. --- x-pack/plugins/uptime/server/graphql/index.ts | 9 +--- .../graphql/monitor_states/resolvers.ts | 41 ++++++++----------- .../lib/helper/get_histogram_interval.ts | 2 +- .../plugins/uptime/server/lib/helper/index.ts | 3 +- .../server/lib/helper/parse_filter_query.ts | 13 ------ .../uptime/server/rest_api/monitors/status.ts | 2 +- 6 files changed, 22 insertions(+), 48 deletions(-) delete mode 100644 x-pack/plugins/uptime/server/lib/helper/parse_filter_query.ts diff --git a/x-pack/plugins/uptime/server/graphql/index.ts b/x-pack/plugins/uptime/server/graphql/index.ts index 007550da3cb62..49ba5583b417b 100644 --- a/x-pack/plugins/uptime/server/graphql/index.ts +++ b/x-pack/plugins/uptime/server/graphql/index.ts @@ -4,7 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -import { createMonitorsResolvers, monitorsSchema } from './monitors'; import { createMonitorStatesResolvers, monitorStatesSchema } from './monitor_states'; import { createPingsResolvers, pingsSchema } from './pings'; import { CreateUMGraphQLResolvers } from './types'; @@ -12,14 +11,8 @@ import { unsignedIntegerResolverFunctions, unsignedIntegerSchema } from './unsig export { DEFAULT_GRAPHQL_PATH } from './constants'; export const resolvers: CreateUMGraphQLResolvers[] = [ - createMonitorsResolvers, createMonitorStatesResolvers, createPingsResolvers, unsignedIntegerResolverFunctions, ]; -export const typeDefs: any[] = [ - pingsSchema, - unsignedIntegerSchema, - monitorsSchema, - monitorStatesSchema, -]; +export const typeDefs: any[] = [pingsSchema, unsignedIntegerSchema, monitorStatesSchema]; diff --git a/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts index fa6495c2e0ccb..a4ee06d13afca 100644 --- a/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts +++ b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts @@ -6,13 +6,10 @@ import { CreateUMGraphQLResolvers, UMContext } from '../types'; import { UMServerLibs } from '../../lib/lib'; -import { - GetMonitorStatesQueryArgs, - MonitorSummaryResult, - StatesIndexStatus, - UMResolver, - CONTEXT_DEFAULTS, -} from '../../../common'; +import { UMResolver } from '../../../common/graphql/resolver_types'; +import { GetMonitorStatesQueryArgs, MonitorSummaryResult } from '../../../common/graphql/types'; +import { CONTEXT_DEFAULTS } from '../../../common/constants'; +import { savedObjectsAdapter } from '../../lib/saved_objects'; export type UMGetMonitorStatesResolver = UMResolver< MonitorSummaryResult | Promise, @@ -21,41 +18,39 @@ export type UMGetMonitorStatesResolver = UMResolver< UMContext >; -export type UMStatesIndexExistsResolver = UMResolver< - StatesIndexStatus | Promise, - any, - {}, - UMContext ->; - export const createMonitorStatesResolvers: CreateUMGraphQLResolvers = ( libs: UMServerLibs ): { Query: { getMonitorStates: UMGetMonitorStatesResolver; - getStatesIndexStatus: UMStatesIndexExistsResolver; }; } => { return { Query: { async getMonitorStates( _resolver, - { dateRangeStart, dateRangeEnd, filters, pagination, statusFilter }, - { APICaller } + { dateRangeStart, dateRangeEnd, filters, pagination, statusFilter, pageSize }, + { APICaller, savedObjectsClient } ): Promise { + const dynamicSettings = await savedObjectsAdapter.getUptimeDynamicSettings( + savedObjectsClient + ); + const decodedPagination = pagination ? JSON.parse(decodeURIComponent(pagination)) : CONTEXT_DEFAULTS.CURSOR_PAGINATION; const [ - totalSummaryCount, + indexStatus, { summaries, nextPagePagination, prevPagePagination }, ] = await Promise.all([ - libs.pings.getDocCount({ callES: APICaller }), - libs.monitorStates.getMonitorStates({ + libs.requests.getIndexStatus({ callES: APICaller, dynamicSettings }), + libs.requests.getMonitorStates({ callES: APICaller, + dynamicSettings, dateRangeStart, dateRangeEnd, pagination: decodedPagination, + pageSize, filters, // this is added to make typescript happy, // this sort of reassignment used to be further downstream but I've moved it here @@ -63,6 +58,9 @@ export const createMonitorStatesResolvers: CreateUMGraphQLResolvers = ( statusFilter: statusFilter || undefined, }), ]); + + const totalSummaryCount = indexStatus?.docCount ?? 0; + return { summaries, nextPagePagination, @@ -70,9 +68,6 @@ export const createMonitorStatesResolvers: CreateUMGraphQLResolvers = ( totalSummaryCount, }; }, - async getStatesIndexStatus(_resolver, {}, { APICaller }): Promise { - return await libs.monitorStates.statesIndexExists({ callES: APICaller }); - }, }, }; }; diff --git a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts index fb44f5727aab3..26515fb4b4c63 100644 --- a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts +++ b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts @@ -5,7 +5,7 @@ */ import DateMath from '@elastic/datemath'; -import { QUERY } from '../../../../../legacy/plugins/uptime/common/constants'; +import { QUERY } from '../../../common/constants'; export const parseRelativeDate = (dateStr: string, options = {}) => { // We need this this parsing because if user selects This week or this date diff --git a/x-pack/plugins/uptime/server/lib/helper/index.ts b/x-pack/plugins/uptime/server/lib/helper/index.ts index f9a8de81332d5..1607c36f1d1b7 100644 --- a/x-pack/plugins/uptime/server/lib/helper/index.ts +++ b/x-pack/plugins/uptime/server/lib/helper/index.ts @@ -5,8 +5,7 @@ */ export { getFilterClause } from './get_filter_clause'; -export { getHistogramInterval } from './get_histogram_interval'; +export { parseRelativeDate } from './get_histogram_interval'; export { getHistogramIntervalFormatted } from './get_histogram_interval_formatted'; -export { parseFilterQuery } from './parse_filter_query'; export { assertCloseTo } from './assert_close_to'; export { objectValuesToArrays } from './object_to_array'; diff --git a/x-pack/plugins/uptime/server/lib/helper/parse_filter_query.ts b/x-pack/plugins/uptime/server/lib/helper/parse_filter_query.ts deleted file mode 100644 index 4c73ec53af9b9..0000000000000 --- a/x-pack/plugins/uptime/server/lib/helper/parse_filter_query.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * 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 const parseFilterQuery = (query?: string | null) => { - try { - return query ? JSON.parse(query) : null; - } catch { - return null; - } -}; diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/status.ts b/x-pack/plugins/uptime/server/rest_api/monitors/status.ts index e1fcaf54f2824..183693f2403b7 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/status.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/status.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants/rest_api'; +import { API_URLS } from '../../../common/constants/rest_api'; export const createGetMonitorRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', From 63002061efa47203d7f11c374dc704afb555232f Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Wed, 1 Apr 2020 17:35:08 -0400 Subject: [PATCH 10/36] Fix alert type registration glitch. --- .../lib/adapters/framework/new_platform_adapter.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx index b602c8017e50e..789c63763035e 100644 --- a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx +++ b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx @@ -40,9 +40,12 @@ export const getKibanaFrameworkAdapter = ( triggers_actions_ui, } = plugins; - alertTypeInitializers.forEach(init => - triggers_actions_ui.alertTypeRegistry.register(init({ autocomplete })) - ); + alertTypeInitializers.forEach(init => { + const alertInitializer = init({ autocomplete }); + if (!triggers_actions_ui.alertTypeRegistry.has(alertInitializer.id)) { + triggers_actions_ui.alertTypeRegistry.register(init({ autocomplete })); + } + }); let breadcrumbs: ChromeBreadcrumb[] = []; core.chrome.getBreadcrumbs$().subscribe((nextBreadcrumbs?: ChromeBreadcrumb[]) => { From c50e9495b9def36263d80b759a95611e838cca73 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 2 Apr 2020 09:37:35 -0400 Subject: [PATCH 11/36] Remove obsolete file. --- x-pack/plugins/uptime/common/constants/constants.ts | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 x-pack/plugins/uptime/common/constants/constants.ts diff --git a/x-pack/plugins/uptime/common/constants/constants.ts b/x-pack/plugins/uptime/common/constants/constants.ts deleted file mode 100644 index 0c35bc9734486..0000000000000 --- a/x-pack/plugins/uptime/common/constants/constants.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * 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 const UNNAMED_LOCATION = 'Unnamed-location'; From 5cd39dc50eb69a0d79a21dee10dea411e8e8c9d8 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 2 Apr 2020 13:43:53 -0400 Subject: [PATCH 12/36] Fix unwanted revisions, uncomment previously un-migrated code, delete accidentally-merged files. --- .../uptime/common/graphql/introspection.json | 4181 ----------------- x-pack/plugins/uptime/common/graphql/types.ts | 52 +- .../plugins/uptime/public/apps/render_app.tsx | 7 - .../empty_status_bar.test.tsx.snap | 29 - .../integration_group.test.tsx.snap | 136 - .../monitor_ssl_certificate.test.tsx.snap | 29 - .../__tests__/empty_status_bar.test.tsx | 21 - .../__tests__/integration_group.test.tsx | 70 - .../monitor_ssl_certificate.test.tsx | 38 - .../__tests__/monitor_status.bar.test.tsx | 67 - .../snapshot_histogram.test.tsx.snap | 7 - .../__tests__/snapshot_histogram.test.tsx | 22 - .../functional/charts/checks_chart.tsx | 124 - .../charts/duration_chart_empty_state.tsx | 33 - .../functional/charts/get_colors_map.ts | 24 - .../functional/charts/snapshot_histogram.tsx | 194 - .../functional/empty_state/index.ts | 7 - .../functional/empty_status_bar.tsx | 31 - .../functional/integration_group.tsx | 258 - .../functional/integration_link.tsx | 52 - .../embeddables/__tests__/__mocks__/mock.ts | 185 - .../location_map/embeddables/types.ts | 31 - .../monitor_list_actions_popover.tsx | 93 - .../integration_link.test.tsx.snap | 56 - .../__tests__/integration_link.test.tsx | 36 - .../functional/monitor_status_bar/index.ts | 7 - .../monitor_ssl_certificate.tsx | 63 - .../monitor_status_details/translations.ts | 49 - .../uptime/public/hooks/use_index_pattern.ts | 21 - .../__tests__/get_index_pattern.test.ts | 50 - .../index_pattern/get_index_pattern.ts | 26 - .../lib/adapters/index_pattern/index.ts | 7 - .../public/lib/adapters/telemetry/index.ts | 11 - .../lib/adapters/telemetry/log_monitor.ts | 18 - .../lib/adapters/telemetry/log_overview.ts | 18 - .../parameterize_values.test.ts.snap | 5 - .../to_static_index_pattern.test.ts.snap | 19 - .../lib/helper/__tests__/get_api_path.test.ts | 24 - .../__tests__/parameterize_values.test.ts | 30 - .../__tests__/to_static_index_pattern.test.ts | 19 - .../uptime/public/lib/helper/get_api_path.ts | 8 - .../public/lib/helper/parameterize_values.ts | 16 - .../public/lib/helper/render_with_router.tsx | 21 - .../lib/helper/to_static_index_pattern.ts | 11 - .../plugins/uptime/public/pages/monitor.tsx | 5 +- .../plugins/uptime/public/pages/overview.tsx | 5 +- .../uptime/public/queries/doc_count_query.ts | 22 - .../uptime/public/queries/filter_bar_query.ts | 23 - .../public/queries/monitor_charts_query.ts | 38 - .../queries/monitor_page_title_query.ts | 20 - .../queries/monitor_status_bar_query.ts | 41 - .../queries/snapshot_histogram_query.ts | 38 - 52 files changed, 29 insertions(+), 6369 deletions(-) delete mode 100644 x-pack/plugins/uptime/common/graphql/introspection.json delete mode 100644 x-pack/plugins/uptime/public/apps/render_app.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/empty_status_bar.test.tsx.snap delete mode 100644 x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_group.test.tsx.snap delete mode 100644 x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_ssl_certificate.test.tsx.snap delete mode 100644 x-pack/plugins/uptime/public/components/functional/__tests__/empty_status_bar.test.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/__tests__/integration_group.test.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/__tests__/monitor_ssl_certificate.test.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/__tests__/monitor_status.bar.test.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/snapshot_histogram.test.tsx.snap delete mode 100644 x-pack/plugins/uptime/public/components/functional/charts/__tests__/snapshot_histogram.test.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/charts/checks_chart.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/charts/duration_chart_empty_state.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/charts/get_colors_map.ts delete mode 100644 x-pack/plugins/uptime/public/components/functional/charts/snapshot_histogram.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/empty_state/index.ts delete mode 100644 x-pack/plugins/uptime/public/components/functional/empty_status_bar.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/integration_group.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/integration_link.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/location_map/embeddables/__tests__/__mocks__/mock.ts delete mode 100644 x-pack/plugins/uptime/public/components/functional/location_map/embeddables/types.ts delete mode 100644 x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_actions_popover.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/integration_link.test.tsx.snap delete mode 100644 x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_link.test.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/monitor_status_bar/index.ts delete mode 100644 x-pack/plugins/uptime/public/components/functional/monitor_status_bar/monitor_ssl_certificate.tsx delete mode 100644 x-pack/plugins/uptime/public/components/functional/monitor_status_details/translations.ts delete mode 100644 x-pack/plugins/uptime/public/hooks/use_index_pattern.ts delete mode 100644 x-pack/plugins/uptime/public/lib/adapters/index_pattern/__tests__/get_index_pattern.test.ts delete mode 100644 x-pack/plugins/uptime/public/lib/adapters/index_pattern/get_index_pattern.ts delete mode 100644 x-pack/plugins/uptime/public/lib/adapters/index_pattern/index.ts delete mode 100644 x-pack/plugins/uptime/public/lib/adapters/telemetry/index.ts delete mode 100644 x-pack/plugins/uptime/public/lib/adapters/telemetry/log_monitor.ts delete mode 100644 x-pack/plugins/uptime/public/lib/adapters/telemetry/log_overview.ts delete mode 100644 x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/parameterize_values.test.ts.snap delete mode 100644 x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap delete mode 100644 x-pack/plugins/uptime/public/lib/helper/__tests__/get_api_path.test.ts delete mode 100644 x-pack/plugins/uptime/public/lib/helper/__tests__/parameterize_values.test.ts delete mode 100644 x-pack/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts delete mode 100644 x-pack/plugins/uptime/public/lib/helper/get_api_path.ts delete mode 100644 x-pack/plugins/uptime/public/lib/helper/parameterize_values.ts delete mode 100644 x-pack/plugins/uptime/public/lib/helper/render_with_router.tsx delete mode 100644 x-pack/plugins/uptime/public/lib/helper/to_static_index_pattern.ts delete mode 100644 x-pack/plugins/uptime/public/queries/doc_count_query.ts delete mode 100644 x-pack/plugins/uptime/public/queries/filter_bar_query.ts delete mode 100644 x-pack/plugins/uptime/public/queries/monitor_charts_query.ts delete mode 100644 x-pack/plugins/uptime/public/queries/monitor_page_title_query.ts delete mode 100644 x-pack/plugins/uptime/public/queries/monitor_status_bar_query.ts delete mode 100644 x-pack/plugins/uptime/public/queries/snapshot_histogram_query.ts diff --git a/x-pack/plugins/uptime/common/graphql/introspection.json b/x-pack/plugins/uptime/common/graphql/introspection.json deleted file mode 100644 index 19d9cf19cc7f8..0000000000000 --- a/x-pack/plugins/uptime/common/graphql/introspection.json +++ /dev/null @@ -1,4181 +0,0 @@ -{ - "__schema": { - "queryType": { "name": "Query" }, - "mutationType": null, - "subscriptionType": null, - "types": [ - { - "kind": "OBJECT", - "name": "Query", - "description": "", - "fields": [ - { - "name": "allPings", - "description": "Get a list of all recorded pings for all monitors", - "args": [ - { - "name": "sort", - "description": "Optional: the direction to sort by. Accepts 'asc' and 'desc'. Defaults to 'desc'.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "size", - "description": "Optional: the number of results to return.", - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "defaultValue": null - }, - { - "name": "monitorId", - "description": "Optional: the monitor ID filter.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "status", - "description": "Optional: the check status to filter by.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "dateRangeStart", - "description": "The lower limit of the date range.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "The upper limit of the date range.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "location", - "description": "Optional: agent location to filter by.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "PingResults", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getDocCount", - "description": "Gets the number of documents in the target index", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "DocCount", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getMonitors", - "description": "", - "args": [ - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "filters", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "statusFilter", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "LatestMonitorsResult", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getSnapshot", - "description": "", - "args": [ - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "filters", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "statusFilter", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "Snapshot", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getSnapshotHistogram", - "description": "", - "args": [ - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "filters", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "statusFilter", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "monitorId", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "HistogramDataPoint", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getMonitorChartsData", - "description": "", - "args": [ - { - "name": "monitorId", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "location", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "MonitorChart", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getLatestMonitors", - "description": "Fetch the most recent event data for a monitor ID, date range, location.", - "args": [ - { - "name": "dateRangeStart", - "description": "The lower limit of the date range.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "The upper limit of the date range.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "monitorId", - "description": "Optional: a specific monitor ID filter.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "location", - "description": "Optional: a specific instance location filter.", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "Ping", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getFilterBar", - "description": "", - "args": [ - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "FilterBar", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getMonitorStates", - "description": "Fetches the current state of Uptime monitors for the given parameters.", - "args": [ - { - "name": "dateRangeStart", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "dateRangeEnd", - "description": "", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "defaultValue": null - }, - { - "name": "pagination", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "filters", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - }, - { - "name": "statusFilter", - "description": "", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": null - } - ], - "type": { "kind": "OBJECT", "name": "MonitorSummaryResult", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "getStatesIndexStatus", - "description": "Fetches details about the uptime index.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "StatesIndexStatus", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1. ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PingResults", - "description": "", - "fields": [ - { - "name": "total", - "description": "Total number of matching pings", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": "Unique list of all locations the query matched", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pings", - "description": "List of pings ", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "Ping", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "UnsignedInteger", - "description": "", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Ping", - "description": "A request sent from a monitor to a host", - "fields": [ - { - "name": "id", - "description": "unique ID for this ping", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timestamp", - "description": "The timestamp of the ping's creation", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "beat", - "description": "The agent that recorded the ping", - "args": [], - "type": { "kind": "OBJECT", "name": "Beat", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "container", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Container", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "docker", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Docker", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ecs", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "ECS", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "error", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Error", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "host", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Host", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "http", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "HTTP", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "icmp", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "ICMP", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "kubernetes", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Kubernetes", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "meta", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Meta", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "monitor", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Monitor", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "observer", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Observer", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "resolve", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Resolve", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "socks5", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Socks5", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "summary", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Summary", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tags", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tcp", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "TCP", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tls", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "PingTLS", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "URL", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Beat", - "description": "An agent for recording a beat", - "fields": [ - { - "name": "hostname", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timezone", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Container", - "description": "", - "fields": [ - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "image", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "ContainerImage", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "runtime", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ContainerImage", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tag", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Docker", - "description": "", - "fields": [ - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "image", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ECS", - "description": "", - "fields": [ - { - "name": "version", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Error", - "description": "", - "fields": [ - { - "name": "code", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "message", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Host", - "description": "", - "fields": [ - { - "name": "architecture", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hostname", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ip", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mac", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "os", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "OS", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OS", - "description": "", - "fields": [ - { - "name": "family", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "kernel", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "platform", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "version", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "build", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HTTP", - "description": "", - "fields": [ - { - "name": "response", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "HTTPResponse", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "HttpRTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HTTPResponse", - "description": "", - "fields": [ - { - "name": "status_code", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "body", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "HTTPBody", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HTTPBody", - "description": "", - "fields": [ - { - "name": "bytes", - "description": "Size of HTTP response body in bytes", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hash", - "description": "Hash of the HTTP response body", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "content", - "description": "Response body of the HTTP Response. May be truncated based on client settings.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "content_bytes", - "description": "Byte length of the content string, taking into account multibyte chars.", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HttpRTT", - "description": "", - "fields": [ - { - "name": "content", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "response_header", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "validate", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "validate_body", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "write_request", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Duration", - "description": "The monitor's status for a ping", - "fields": [ - { - "name": "us", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ICMP", - "description": "", - "fields": [ - { - "name": "requests", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Kubernetes", - "description": "", - "fields": [ - { - "name": "container", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "KubernetesContainer", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "namespace", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "KubernetesNode", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pod", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "KubernetesPod", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "KubernetesContainer", - "description": "", - "fields": [ - { - "name": "image", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "KubernetesNode", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "KubernetesPod", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "uid", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Meta", - "description": "", - "fields": [ - { - "name": "cloud", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "MetaCloud", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MetaCloud", - "description": "", - "fields": [ - { - "name": "availability_zone", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "instance_id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "instance_name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "machine_type", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "project_id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "provider", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "region", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Monitor", - "description": "", - "fields": [ - { - "name": "duration", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "host", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The id of the monitor", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ip", - "description": "The IP pinged by the monitor", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the protocol being monitored", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scheme", - "description": "The protocol scheme of the monitored host", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The status of the monitored host", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "The type of host being monitored", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "check_group", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Observer", - "description": "Metadata added by a proccessor, which is specified in its configuration.", - "fields": [ - { - "name": "geo", - "description": "Geolocation data for the agent.", - "args": [], - "type": { "kind": "OBJECT", "name": "Geo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Geo", - "description": "Geolocation data added via processors to enrich events.", - "fields": [ - { - "name": "city_name", - "description": "Name of the city in which the agent is running.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "continent_name", - "description": "The name of the continent on which the agent is running.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "country_iso_code", - "description": "ISO designation for the agent's country.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "country_name", - "description": "The name of the agent's country.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "location", - "description": "The lat/long of the agent.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "A name for the host's location, e.g. 'us-east-1' or 'LAX'.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "region_iso_code", - "description": "ISO designation of the agent's region.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "region_name", - "description": "Name of the region hosting the agent.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Resolve", - "description": "", - "fields": [ - { - "name": "host", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ip", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Socks5", - "description": "", - "fields": [ - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "RTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RTT", - "description": "", - "fields": [ - { - "name": "connect", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "handshake", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "validate", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Duration", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Summary", - "description": "", - "fields": [ - { - "name": "up", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "down", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "geo", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "CheckGeo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckGeo", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "location", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Location", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Location", - "description": "", - "fields": [ - { - "name": "lat", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "lon", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Float", - "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point). ", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "TCP", - "description": "", - "fields": [ - { - "name": "port", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "RTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PingTLS", - "description": "Contains monitor transmission encryption information.", - "fields": [ - { - "name": "certificate_not_valid_after", - "description": "The date and time after which the certificate is invalid.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "certificate_not_valid_before", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "certificates", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "RTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "URL", - "description": "", - "fields": [ - { - "name": "full", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scheme", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "domain", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "port", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "query", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "DocCount", - "description": "", - "fields": [ - { - "name": "count", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "LatestMonitorsResult", - "description": "", - "fields": [ - { - "name": "monitors", - "description": "", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "LatestMonitor", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "LatestMonitor", - "description": "Represents the latest recorded information about a monitor.", - "fields": [ - { - "name": "id", - "description": "The ID of the monitor represented by this data.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "MonitorKey", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ping", - "description": "Information from the latest document.", - "args": [], - "type": { "kind": "OBJECT", "name": "Ping", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "upSeries", - "description": "Buckets of recent up count status data.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "MonitorSeriesPoint", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "downSeries", - "description": "Buckets of recent down count status data.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "MonitorSeriesPoint", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorKey", - "description": "", - "fields": [ - { - "name": "key", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorSeriesPoint", - "description": "", - "fields": [ - { - "name": "x", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "y", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Snapshot", - "description": "", - "fields": [ - { - "name": "counts", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "SnapshotCount", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SnapshotCount", - "description": "", - "fields": [ - { - "name": "up", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "down", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HistogramDataPoint", - "description": "", - "fields": [ - { - "name": "upCount", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "downCount", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "x", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "x0", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "y", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorChart", - "description": "The data used to populate the monitor charts.", - "fields": [ - { - "name": "locationDurationLines", - "description": "The average values for the monitor duration.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "LocationDurationLine", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "The counts of up/down checks for the monitor.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "StatusData", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "statusMaxCount", - "description": "The maximum status doc count in this chart.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "durationMaxValue", - "description": "The maximum duration value in this chart.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "LocationDurationLine", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "line", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "MonitorDurationAveragePoint", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorDurationAveragePoint", - "description": "Represents the average monitor duration ms at a point in time.", - "fields": [ - { - "name": "x", - "description": "The timeseries value for this point.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "y", - "description": "The average duration ms for the monitor.", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StatusData", - "description": "Represents a bucket of monitor status information.", - "fields": [ - { - "name": "x", - "description": "The timeseries point for this status data.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "up", - "description": "The value of up counts for this point.", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "down", - "description": "The value for down counts for this point.", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "The total down counts for this point.", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "FilterBar", - "description": "The data used to enrich the filter bar.", - "fields": [ - { - "name": "ids", - "description": "A series of monitor IDs in the heartbeat indices.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": "The location values users have configured for the agents.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ports", - "description": "The ports of the monitored endpoints.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "schemes", - "description": "The schemes used by the monitors.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "statuses", - "description": "The possible status values contained in the indices.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "urls", - "description": "The list of URLs", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorSummaryResult", - "description": "The primary object returned for monitor states.", - "fields": [ - { - "name": "prevPagePagination", - "description": "Used to go to the next page of results", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nextPagePagination", - "description": "Used to go to the previous page of results", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "summaries", - "description": "The objects representing the state of a series of heartbeat monitors.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "MonitorSummary", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalSummaryCount", - "description": "The number of summaries.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "DocCount", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorSummary", - "description": "Represents the current state and associated data for an Uptime monitor.", - "fields": [ - { - "name": "monitor_id", - "description": "The ID assigned by the config or generated by the user.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "state", - "description": "The state of the monitor and its associated details.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "State", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "histogram", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "SummaryHistogram", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "State", - "description": "Unifies the subsequent data for an uptime monitor.", - "fields": [ - { - "name": "agent", - "description": "The agent processing the monitor.", - "args": [], - "type": { "kind": "OBJECT", "name": "Agent", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checks", - "description": "There is a check object for each instance of the monitoring agent.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "Check", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "geo", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateGeo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "observer", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateObserver", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "monitor", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "MonitorState", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "summary", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "Summary", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timestamp", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "tls", - "description": "Transport encryption information.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { "kind": "OBJECT", "name": "StateTLS", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateUrl", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Agent", - "description": "", - "fields": [ - { - "name": "id", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Check", - "description": "", - "fields": [ - { - "name": "agent", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Agent", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "container", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateContainer", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "kubernetes", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateKubernetes", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "monitor", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "CheckMonitor", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "observer", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "CheckObserver", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "timestamp", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateContainer", - "description": "", - "fields": [ - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateKubernetes", - "description": "", - "fields": [ - { - "name": "pod", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StatePod", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StatePod", - "description": "", - "fields": [ - { - "name": "uid", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckMonitor", - "description": "", - "fields": [ - { - "name": "ip", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "status", - "description": "", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckObserver", - "description": "", - "fields": [ - { - "name": "geo", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "CheckGeo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateGeo", - "description": "", - "fields": [ - { - "name": "name", - "description": "", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "location", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "Location", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateObserver", - "description": "", - "fields": [ - { - "name": "geo", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "StateGeo", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorState", - "description": "", - "fields": [ - { - "name": "status", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateTLS", - "description": "Contains monitor transmission encryption information.", - "fields": [ - { - "name": "certificate_not_valid_after", - "description": "The date and time after which the certificate is invalid.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "certificate_not_valid_before", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "certificates", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rtt", - "description": "", - "args": [], - "type": { "kind": "OBJECT", "name": "RTT", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StateUrl", - "description": "", - "fields": [ - { - "name": "domain", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "full", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "port", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scheme", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SummaryHistogram", - "description": "Monitor status data over time.", - "fields": [ - { - "name": "count", - "description": "The number of documents used to assemble the histogram.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "points", - "description": "The individual histogram data points.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "SummaryHistogramPoint", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SummaryHistogramPoint", - "description": "Represents a monitor's statuses for a period of time.", - "fields": [ - { - "name": "timestamp", - "description": "The time at which these data were collected.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "up", - "description": "The number of _up_ documents.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "down", - "description": "The number of _down_ documents.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "StatesIndexStatus", - "description": "Represents the current status of the uptime index.", - "fields": [ - { - "name": "indexExists", - "description": "Flag denoting whether the index exists.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "docCount", - "description": "The number of documents in the index.", - "args": [], - "type": { "kind": "OBJECT", "name": "DocCount", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": "The `Boolean` scalar type represents `true` or `false`.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "fields": [ - { - "name": "types", - "description": "A list of all types supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mutationType", - "description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "args": [], - "type": { "kind": "OBJECT", "name": "__Type", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionType", - "description": "If this server support subscription, the type that subscription operations will be rooted at.", - "args": [], - "type": { "kind": "OBJECT", "name": "__Type", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Directive", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "fields": [ - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "ENUM", "name": "__TypeKind", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { "kind": "SCALAR", "name": "Boolean", "ofType": null }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Field", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { "kind": "SCALAR", "name": "Boolean", "ofType": null }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__EnumValue", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "inputFields", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__InputValue", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { "kind": "OBJECT", "name": "__Type", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "An enum describing what kind of type a given `__Type` is.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "Indicates this type is a scalar.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Indicates this type is a union. `possibleTypes` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Indicates this type is an enum. `enumValues` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Indicates this type is an input object. `inputFields` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "Indicates this type is a list. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "Indicates this type is a non-null. `ofType` is a valid field.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__InputValue", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__Type", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "defaultValue", - "description": "A GraphQL-formatted string representing the default value for this input value.", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Directive", - "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "ENUM", "name": "__DirectiveLocation", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "OBJECT", "name": "__InputValue", "ofType": null } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "onOperation", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onFragment", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - }, - { - "name": "onField", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "isDeprecated": true, - "deprecationReason": "Use `locations`." - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": "Location adjacent to a query operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": "Location adjacent to a mutation operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": "Location adjacent to a subscription operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": "Location adjacent to a field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": "Location adjacent to a fragment definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": "Location adjacent to a fragment spread.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": "Location adjacent to an inline fragment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": "Location adjacent to a schema definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": "Location adjacent to a scalar definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Location adjacent to an object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": "Location adjacent to a field definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": "Location adjacent to an argument definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Location adjacent to an interface definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Location adjacent to a union definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Location adjacent to an enum definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": "Location adjacent to an enum value definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Location adjacent to an input object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_FIELD_DEFINITION", - "description": "Location adjacent to an input object field definition.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "DataPoint", - "description": "", - "fields": [ - { - "name": "x", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "y", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorDurationAreaPoint", - "description": "Represents a monitor's duration performance in microseconds at a point in time.", - "fields": [ - { - "name": "x", - "description": "The timeseries value for this point in time.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "UnsignedInteger", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "yMin", - "description": "The min duration value in microseconds at this time.", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "yMax", - "description": "The max duration value in microseconds at this point.", - "args": [], - "type": { "kind": "SCALAR", "name": "Float", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MonitorSummaryUrl", - "description": "", - "fields": [ - { - "name": "domain", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fragment", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "full", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "original", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "password", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "path", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "port", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "Int", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "query", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scheme", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "username", - "description": "", - "args": [], - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "CursorDirection", - "description": "", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { "name": "AFTER", "description": "", "isDeprecated": false, "deprecationReason": null }, - { "name": "BEFORE", "description": "", "isDeprecated": false, "deprecationReason": null } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "SortOrder", - "description": "", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { "name": "ASC", "description": "", "isDeprecated": false, "deprecationReason": null }, - { "name": "DESC", "description": "", "isDeprecated": false, "deprecationReason": null } - ], - "possibleTypes": null - } - ], - "directives": [ - { - "name": "skip", - "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], - "args": [ - { - "name": "if", - "description": "Skipped when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "defaultValue": null - } - ] - }, - { - "name": "include", - "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", - "locations": ["FIELD", "FRAGMENT_SPREAD", "INLINE_FRAGMENT"], - "args": [ - { - "name": "if", - "description": "Included when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null } - }, - "defaultValue": null - } - ] - }, - { - "name": "deprecated", - "description": "Marks an element of a GraphQL schema as no longer supported.", - "locations": ["FIELD_DEFINITION", "ENUM_VALUE"], - "args": [ - { - "name": "reason", - "description": "Explains why this element was deprecated, usually also including a suggestion for how to access supported similar data. Formatted in [Markdown](https://daringfireball.net/projects/markdown/).", - "type": { "kind": "SCALAR", "name": "String", "ofType": null }, - "defaultValue": "\"No longer supported\"" - } - ] - } - ] - } -} diff --git a/x-pack/plugins/uptime/common/graphql/types.ts b/x-pack/plugins/uptime/common/graphql/types.ts index 7adeebe5138b0..7ef05699d121c 100644 --- a/x-pack/plugins/uptime/common/graphql/types.ts +++ b/x-pack/plugins/uptime/common/graphql/types.ts @@ -65,21 +65,7 @@ export interface Ping { socks5?: Socks5 | null; - summary?: { - up?: number | null; - - down?: number | null; - - geo?: { - name?: string | null; - - location?: { - lat?: number | null; - - lon?: number | null; - } | null; - } | null; - } | null; + summary?: Summary | null; tags?: string | null; @@ -313,6 +299,26 @@ export interface Resolve { rtt?: Duration | null; } +export interface Summary { + up?: number | null; + + down?: number | null; + + geo?: CheckGeo | null; +} + +export interface CheckGeo { + name?: string | null; + + location?: Location | null; +} + +export interface Location { + lat?: number | null; + + lon?: number | null; +} + export interface Socks5 { rtt?: Rtt | null; } @@ -467,25 +473,13 @@ export interface CheckMonitor { } export interface CheckObserver { - geo?: { - name?: string | null; - - location?: { - lat?: number | null; - - lon?: number | null; - } | null; - } | null; + geo?: CheckGeo | null; } export interface StateGeo { name?: (string | null)[] | null; - location?: { - lat?: number | null; - - lon?: number | null; - } | null; + location?: Location | null; } export interface StateObserver { diff --git a/x-pack/plugins/uptime/public/apps/render_app.tsx b/x-pack/plugins/uptime/public/apps/render_app.tsx deleted file mode 100644 index abd7a21b1c5cc..0000000000000 --- a/x-pack/plugins/uptime/public/apps/render_app.tsx +++ /dev/null @@ -1,7 +0,0 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; - -export const renderApp = (element: any) => { - ReactDOM.render(
Hi there
, element); - return () => ReactDOM.unmountComponentAtNode(element); -}; diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/empty_status_bar.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/empty_status_bar.test.tsx.snap deleted file mode 100644 index e18846e960122..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/empty_status_bar.test.tsx.snap +++ /dev/null @@ -1,29 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`EmptyStatusBar component renders a default message when no message provided 1`] = ` - - - - No data found for monitor id mon_id - - - -`; - -exports[`EmptyStatusBar component renders a message when provided 1`] = ` - - - - foobarbaz - - - -`; diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_group.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_group.test.tsx.snap deleted file mode 100644 index bab69a6de9708..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_group.test.tsx.snap +++ /dev/null @@ -1,136 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`IntegrationGroup will not display APM links when APM is unavailable 1`] = ` - - - - - - - - - - - - - - - - - - - - -`; - -exports[`IntegrationGroup will not display infra links when infra is unavailable 1`] = ` - - - - - - - - - - - - - - -`; - -exports[`IntegrationGroup will not display logging links when logging is unavailable 1`] = ` - - - - - - - - - - - - - - -`; diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_ssl_certificate.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_ssl_certificate.test.tsx.snap deleted file mode 100644 index 45c24fd11194d..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_ssl_certificate.test.tsx.snap +++ /dev/null @@ -1,29 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`MonitorStatusBar component renders 1`] = ` -Array [ -
, - .c0 { - margin-left: 20px; -} - -
-
-
- SSL certificate expires in 2 months -
-
-
, -] -`; - -exports[`MonitorStatusBar component renders null if invalid date 1`] = `null`; diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/empty_status_bar.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/empty_status_bar.test.tsx deleted file mode 100644 index b815f0e38b8e2..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/empty_status_bar.test.tsx +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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 from 'react'; -import { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { EmptyStatusBar } from '../empty_status_bar'; - -describe('EmptyStatusBar component', () => { - it('renders a message when provided', () => { - const component = shallowWithIntl(); - expect(component).toMatchSnapshot(); - }); - - it('renders a default message when no message provided', () => { - const component = shallowWithIntl(); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/integration_group.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/integration_group.test.tsx deleted file mode 100644 index 98fdc994fc7a8..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/integration_group.test.tsx +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 from 'react'; -import { MonitorSummary } from '../../../../common/graphql/types'; -import { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { IntegrationGroup } from '../integration_group'; - -describe('IntegrationGroup', () => { - let summary: MonitorSummary; - - beforeEach(() => { - summary = { - monitor_id: '12345', - state: { - summary: {}, - checks: [], - timestamp: '123', - }, - }; - }); - - it('will not display APM links when APM is unavailable', () => { - const component = shallowWithIntl( - - ); - expect(component).toMatchSnapshot(); - }); - - it('will not display infra links when infra is unavailable', () => { - const component = shallowWithIntl( - - ); - expect(component).toMatchSnapshot(); - }); - - it('will not display logging links when logging is unavailable', () => { - const component = shallowWithIntl( - - ); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/monitor_ssl_certificate.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/monitor_ssl_certificate.test.tsx deleted file mode 100644 index c4063208d046e..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/monitor_ssl_certificate.test.tsx +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 from 'react'; -import moment from 'moment'; -import { renderWithIntl } from 'test_utils/enzyme_helpers'; -import { PingTls } from '../../../../common/graphql/types'; -import { MonitorSSLCertificate } from '../monitor_status_bar'; - -describe('MonitorStatusBar component', () => { - let monitorTls: PingTls; - - beforeEach(() => { - const dateInTwoMonths = moment() - .add(2, 'month') - .toString(); - - monitorTls = { - certificate_not_valid_after: dateInTwoMonths, - }; - }); - - it('renders', () => { - const component = renderWithIntl(); - expect(component).toMatchSnapshot(); - }); - - it('renders null if invalid date', () => { - monitorTls = { - certificate_not_valid_after: 'i am so invalid date', - }; - const component = renderWithIntl(); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/monitor_status.bar.test.tsx b/x-pack/plugins/uptime/public/components/functional/__tests__/monitor_status.bar.test.tsx deleted file mode 100644 index 545405f91d537..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/monitor_status.bar.test.tsx +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 moment from 'moment'; -import React from 'react'; -import { renderWithIntl } from 'test_utils/enzyme_helpers'; -import { Ping } from '../../../../common/graphql/types'; -import { MonitorStatusBarComponent } from '../monitor_status_details/monitor_status_bar'; - -describe('MonitorStatusBar component', () => { - let monitorStatus: Ping; - let monitorLocations: any; - let dateStart: string; - let dateEnd: string; - - beforeEach(() => { - monitorStatus = { - id: 'id1', - timestamp: moment(new Date()) - .subtract(15, 'm') - .toString(), - monitor: { - duration: { - us: 1234567, - }, - status: 'up', - }, - url: { - full: 'https://www.example.com/', - }, - }; - - monitorLocations = { - monitorId: 'secure-avc', - locations: [ - { - summary: { up: 4, down: 0 }, - geo: { name: 'Berlin', location: { lat: '52.487448', lon: ' 13.394798' } }, - }, - { - summary: { up: 4, down: 0 }, - geo: { name: 'st-paul', location: { lat: '52.487448', lon: ' 13.394798' } }, - }, - ], - }; - - dateStart = moment('01-01-2010').toString(); - dateEnd = moment('10-10-2010').toString(); - }); - - it('renders duration in ms, not us', () => { - const component = renderWithIntl( - - ); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/snapshot_histogram.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/snapshot_histogram.test.tsx.snap deleted file mode 100644 index a725f97d3e0fb..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/charts/__tests__/__snapshots__/snapshot_histogram.test.tsx.snap +++ /dev/null @@ -1,7 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`SnapshotHistogram component renders the component without errors 1`] = ` - - - -`; diff --git a/x-pack/plugins/uptime/public/components/functional/charts/__tests__/snapshot_histogram.test.tsx b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/snapshot_histogram.test.tsx deleted file mode 100644 index db78c063b7ed5..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/charts/__tests__/snapshot_histogram.test.tsx +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 from 'react'; -import { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { SnapshotHistogram, SnapshotHistogramProps } from '../snapshot_histogram'; - -describe('SnapshotHistogram component', () => { - const props: SnapshotHistogramProps = { - absoluteStartDate: 1548697920000, - absoluteEndDate: 1548700920000, - isResponsive: false, - }; - - it('renders the component without errors', () => { - const component = shallowWithIntl(); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/uptime/public/components/functional/charts/checks_chart.tsx b/x-pack/plugins/uptime/public/components/functional/charts/checks_chart.tsx deleted file mode 100644 index a88a9668660f7..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/charts/checks_chart.tsx +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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 { - AreaSeries, - Axis, - Chart, - Position, - Settings, - ScaleType, - timeFormatter, -} from '@elastic/charts'; -import { EuiPanel, EuiTitle } from '@elastic/eui'; -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { StatusData } from '../../../../common/graphql/types'; -import { getChartDateLabel } from '../../../lib/helper'; -import { useUrlParams } from '../../../hooks'; - -interface ChecksChartProps { - /** - * The color that will be used for the area series displaying "Down" checks. - */ - dangerColor: string; - /** - * The timeseries data displayed in the chart. - */ - status: StatusData[]; - /** - * The color that will be used for the area series displaying "Up" checks. - */ - successColor: string; -} - -/** - * Renders a chart that displays the total count of up/down status checks over time - * as a stacked area chart. - * @param props The props values required by this component. - */ -export const ChecksChart = ({ dangerColor, status, successColor }: ChecksChartProps) => { - const upSeriesSpecId = 'Up'; - const downSeriesSpecId = 'Down'; - const [getUrlParams] = useUrlParams(); - const { absoluteDateRangeStart: min, absoluteDateRangeEnd: max } = getUrlParams(); - - const upString = i18n.translate('xpack.uptime.monitorCharts.checkStatus.series.upCountLabel', { - defaultMessage: 'Up count', - }); - const downString = i18n.translate( - 'xpack.uptime.monitorCharts.checkStatus.series.downCountLabel', - { - defaultMessage: 'Down count', - } - ); - - return ( - - -

- -

-
- - - - - Number(d).toFixed(0)} - title={i18n.translate('xpack.uptime.monitorChart.checksChart.leftAxis.title', { - defaultMessage: 'Number of checks', - description: 'The heading of the y-axis of a chart of timeseries data', - })} - /> - ({ - x, - [upString]: up || 0, - }))} - id={upSeriesSpecId} - stackAccessors={['x']} - timeZone="local" - xAccessor="x" - xScaleType={ScaleType.Time} - yAccessors={[upString]} - yScaleType={ScaleType.Linear} - /> - ({ - x, - [downString]: down || 0, - }))} - id={downSeriesSpecId} - stackAccessors={['x']} - timeZone="local" - xAccessor="x" - xScaleType={ScaleType.Time} - yAccessors={[downString]} - yScaleType={ScaleType.Linear} - /> - - -
- ); -}; diff --git a/x-pack/plugins/uptime/public/components/functional/charts/duration_chart_empty_state.tsx b/x-pack/plugins/uptime/public/components/functional/charts/duration_chart_empty_state.tsx deleted file mode 100644 index ef4e70bf65898..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/charts/duration_chart_empty_state.tsx +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 { FormattedMessage } from '@kbn/i18n/react'; -import { EuiEmptyPrompt, EuiTitle } from '@elastic/eui'; -import React from 'react'; - -export const DurationChartEmptyState = () => ( - -
- -
- - } - body={ -

- up }} - /> -

- } - /> -); diff --git a/x-pack/plugins/uptime/public/components/functional/charts/get_colors_map.ts b/x-pack/plugins/uptime/public/components/functional/charts/get_colors_map.ts deleted file mode 100644 index 60da56e1ddf4c..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/charts/get_colors_map.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -// @ts-ignore TODO: this should be resolved before merging -import { DataSeriesColorsValues, SpecId } from '@elastic/charts'; - -/** - * This is a helper function used to more easily define a basic map - * for color values for use with elastic charts. Support for multiple - * color values can be added in the future if needed. - * @param color a string containing a valid color value - * @param specId an ID generated by the elastic charts library - */ -export const getColorsMap = ( - color: string, - specId: SpecId -): Map => { - const map = new Map(); - map.set({ colorValues: [], specId }, color); - return map; -}; diff --git a/x-pack/plugins/uptime/public/components/functional/charts/snapshot_histogram.tsx b/x-pack/plugins/uptime/public/components/functional/charts/snapshot_histogram.tsx deleted file mode 100644 index 92b04534b7331..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/charts/snapshot_histogram.tsx +++ /dev/null @@ -1,194 +0,0 @@ -/* - * 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 { Axis, BarSeries, Chart, Position, timeFormatter, Settings } from '@elastic/charts'; -import { EuiEmptyPrompt, EuiTitle, EuiPanel } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React, { useContext } from 'react'; -import { FormattedMessage } from '@kbn/i18n/react'; -import moment from 'moment'; -import { getChartDateLabel } from '../../../lib/helper'; -import { withUptimeGraphQL, UptimeGraphQLQueryProps } from '../../higher_order'; -import { snapshotHistogramQuery } from '../../../queries/snapshot_histogram_query'; -import { ChartWrapper } from './chart_wrapper'; -import { UptimeThemeContext } from '../../../contexts'; -import { ResponsiveWrapperProps, withResponsiveWrapper } from '../../higher_order'; -import { HistogramResult } from '../../../../common/domain_types'; - -interface HistogramProps { - /** - * The date/time for the start of the timespan. - */ - absoluteStartDate: number; - /** - * The date/time for the end of the timespan. - */ - absoluteEndDate: number; - - /** - * Height is needed, since by default charts takes height of 100% - */ - height?: string; -} - -export type SnapshotHistogramProps = HistogramProps & ResponsiveWrapperProps; - -interface SnapshotHistogramQueryResult { - queryResult?: HistogramResult; -} - -type Props = UptimeGraphQLQueryProps & - SnapshotHistogramProps & - ResponsiveWrapperProps; - -export const SnapshotHistogramComponent: React.FC = ({ - absoluteStartDate, - absoluteEndDate, - data, - loading = false, - height, -}: Props) => { - const { - colors: { danger, gray }, - } = useContext(UptimeThemeContext); - if (!data || !data.queryResult) - /** - * TODO: the Fragment, EuiTitle, and EuiPanel should be extracted to a dumb component - * that we can reuse in the subsequent return statement at the bottom of this function. - */ - return ( - <> - -
- -
-
- - -
- -
- - } - body={ -

- -

- } - /> -
- - ); - const { - queryResult: { histogram, interval }, - } = data; - - const downMonitorsId = i18n.translate('xpack.uptime.snapshotHistogram.downMonitorsId', { - defaultMessage: 'Down Monitors', - }); - const downSpecId = downMonitorsId; - - const upMonitorsId = i18n.translate('xpack.uptime.snapshotHistogram.series.upLabel', { - defaultMessage: 'Up', - }); - const upSpecId = upMonitorsId; - return ( - <> - -

- -

-
- - - - - - [x, downCount || 0])} - id={downSpecId} - name={i18n.translate('xpack.uptime.snapshotHistogram.series.downLabel', { - defaultMessage: 'Down', - })} - stackAccessors={[0]} - timeZone="local" - xAccessor={0} - xScaleType="time" - yAccessors={[1]} - yScaleType="linear" - /> - [x, upCount || 0])} - id={upSpecId} - name={upMonitorsId} - stackAccessors={[0]} - timeZone="local" - xAccessor={0} - xScaleType="time" - yAccessors={[1]} - yScaleType="linear" - /> - - - - ); -}; - -export const SnapshotHistogram = withUptimeGraphQL< - SnapshotHistogramQueryResult, - SnapshotHistogramProps ->(withResponsiveWrapper(SnapshotHistogramComponent), snapshotHistogramQuery); diff --git a/x-pack/plugins/uptime/public/components/functional/empty_state/index.ts b/x-pack/plugins/uptime/public/components/functional/empty_state/index.ts deleted file mode 100644 index 8ee70bf51f006..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/empty_state/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * 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 { EmptyState } from './empty_state'; diff --git a/x-pack/plugins/uptime/public/components/functional/empty_status_bar.tsx b/x-pack/plugins/uptime/public/components/functional/empty_status_bar.tsx deleted file mode 100644 index 748c7350a7f0d..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/empty_status_bar.tsx +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; -import { i18n } from '@kbn/i18n'; -import React from 'react'; - -interface Props { - monitorId: string; - message?: string; -} - -export const EmptyStatusBar = ({ message, monitorId }: Props) => ( - - - - {!message - ? i18n.translate('xpack.uptime.emptyStatusBar.defaultMessage', { - defaultMessage: 'No data found for monitor id {monitorId}', - description: - 'This is the default message we display in a status bar when there is no data available for an uptime monitor.', - values: { monitorId }, - }) - : message} - - - -); diff --git a/x-pack/plugins/uptime/public/components/functional/integration_group.tsx b/x-pack/plugins/uptime/public/components/functional/integration_group.tsx deleted file mode 100644 index da66235e37f1a..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/integration_group.tsx +++ /dev/null @@ -1,258 +0,0 @@ -/* - * 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 { EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; -import React from 'react'; -import { i18n } from '@kbn/i18n'; -import { get } from 'lodash'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { IntegrationLink } from './integration_link'; -import { - getApmHref, - getInfraContainerHref, - getInfraIpHref, - getInfraKubernetesHref, - getLoggingContainerHref, - getLoggingIpHref, - getLoggingKubernetesHref, -} from '../../lib/helper'; -import { MonitorSummary } from '../../../common/graphql/types'; - -interface IntegrationGroupProps { - basePath: string; - dateRangeStart: string; - dateRangeEnd: string; - isApmAvailable: boolean; - isInfraAvailable: boolean; - isLogsAvailable: boolean; - summary: MonitorSummary; -} - -export const IntegrationGroup = ({ - basePath, - dateRangeStart, - dateRangeEnd, - isApmAvailable, - isInfraAvailable, - isLogsAvailable, - summary, -}: IntegrationGroupProps) => { - const domain = get(summary, 'state.url.domain', ''); - const podUid = get(summary, 'state.checks[0].kubernetes.pod.uid', undefined); - const containerId = get(summary, 'state.checks[0].container.id', undefined); - const ip = get(summary, 'state.checks[0].monitor.ip', undefined); - return isApmAvailable || isInfraAvailable || isLogsAvailable ? ( - - {isApmAvailable ? ( - - - - ) : null} - {isInfraAvailable ? ( - - - - - - - - - - - - ) : null} - {isLogsAvailable ? ( - - - - - - - - - - - - ) : null} - - ) : ( - - ); -}; diff --git a/x-pack/plugins/uptime/public/components/functional/integration_link.tsx b/x-pack/plugins/uptime/public/components/functional/integration_link.tsx deleted file mode 100644 index a545cd7c42927..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/integration_link.tsx +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 { EuiFlexGroup, EuiFlexItem, EuiIcon, EuiLink, EuiText, EuiToolTip } from '@elastic/eui'; -import React from 'react'; -import { i18n } from '@kbn/i18n'; - -interface IntegrationLinkProps { - ariaLabel: string; - href: string | undefined; - iconType: 'apmApp' | 'metricsApp' | 'logsApp'; - message: string; - tooltipContent: string; -} - -export const IntegrationLink = ({ - ariaLabel, - href, - iconType, - message, - tooltipContent, -}: IntegrationLinkProps) => - typeof href === 'undefined' ? ( - - - - - - - - {message} - - - ) : ( - - - - - - - - {message} - - - ); diff --git a/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/__tests__/__mocks__/mock.ts b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/__tests__/__mocks__/mock.ts deleted file mode 100644 index 291ab555fbdc6..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/__tests__/__mocks__/mock.ts +++ /dev/null @@ -1,185 +0,0 @@ -/* - * 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 lowPolyLayerFeatures from '../../low_poly_layer.json'; - -export const mockDownPointsLayer = { - id: 'down_points', - label: 'Down Locations', - sourceDescriptor: { - type: 'GEOJSON_FILE', - __featureCollection: { - features: [ - { - type: 'feature', - geometry: { - type: 'Point', - coordinates: [13.399262, 52.487239], - }, - }, - { - type: 'feature', - geometry: { - type: 'Point', - coordinates: [13.399262, 55.487239], - }, - }, - { - type: 'feature', - geometry: { - type: 'Point', - coordinates: [14.399262, 54.487239], - }, - }, - ], - type: 'FeatureCollection', - }, - }, - visible: true, - style: { - type: 'VECTOR', - properties: { - fillColor: { - type: 'STATIC', - options: { - color: '#BC261E', - }, - }, - lineColor: { - type: 'STATIC', - options: { - color: '#fff', - }, - }, - lineWidth: { - type: 'STATIC', - options: { - size: 2, - }, - }, - iconSize: { - type: 'STATIC', - options: { - size: 6, - }, - }, - }, - }, - type: 'VECTOR', -}; - -export const mockUpPointsLayer = { - id: 'up_points', - label: 'Up Locations', - sourceDescriptor: { - type: 'GEOJSON_FILE', - __featureCollection: { - features: [ - { - type: 'feature', - geometry: { - type: 'Point', - coordinates: [13.399262, 52.487239], - }, - }, - { - type: 'feature', - geometry: { - type: 'Point', - coordinates: [13.399262, 55.487239], - }, - }, - { - type: 'feature', - geometry: { - type: 'Point', - coordinates: [14.399262, 54.487239], - }, - }, - ], - type: 'FeatureCollection', - }, - }, - visible: true, - style: { - type: 'VECTOR', - properties: { - fillColor: { - type: 'STATIC', - options: { - color: '#98A2B2', - }, - }, - lineColor: { - type: 'STATIC', - options: { - color: '#fff', - }, - }, - lineWidth: { - type: 'STATIC', - options: { - size: 2, - }, - }, - iconSize: { - type: 'STATIC', - options: { - size: 6, - }, - }, - }, - }, - type: 'VECTOR', -}; - -export const mockLayerList = [ - { - id: 'low_poly_layer', - label: 'World countries', - minZoom: 0, - maxZoom: 24, - alpha: 1, - sourceDescriptor: { - id: 'b7486535-171b-4d3b-bb2e-33c1a0a2854c', - type: 'GEOJSON_FILE', - __featureCollection: lowPolyLayerFeatures, - }, - visible: true, - style: { - type: 'VECTOR', - properties: { - fillColor: { - type: 'STATIC', - options: { - color: '#cad3e4', - }, - }, - lineColor: { - type: 'STATIC', - options: { - color: '#fff', - }, - }, - lineWidth: { - type: 'STATIC', - options: { - size: 0, - }, - }, - iconSize: { - type: 'STATIC', - options: { - size: 6, - }, - }, - }, - }, - type: 'VECTOR', - }, - mockDownPointsLayer, - mockUpPointsLayer, -]; diff --git a/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/types.ts b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/types.ts deleted file mode 100644 index a1df64b713e31..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/types.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 { Query } from 'src/plugins/data/common'; -import { TimeRange } from 'src/plugins/data/public'; -import { - EmbeddableInput, - EmbeddableOutput, - IEmbeddable, -} from '../../../../../../../src/legacy/core_plugins/embeddable_api/public/np_ready/public'; - -import { esFilters } from '../../../../../../../../src/plugins/data/public'; - -export interface MapEmbeddableInput extends EmbeddableInput { - filters: esFilters.Filter[]; - query: Query; - refreshConfig: { - isPaused: boolean; - interval: number; - }; - timeRange?: TimeRange; -} - -export interface CustomProps { - setLayerList: Function; -} - -export type MapEmbeddable = IEmbeddable & CustomProps; diff --git a/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_actions_popover.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_actions_popover.tsx deleted file mode 100644 index af06761f50c83..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_actions_popover.tsx +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 { EuiPopover, EuiButton } from '@elastic/eui'; -import React, { useContext } from 'react'; -import { i18n } from '@kbn/i18n'; -import { get } from 'lodash'; -import { connect } from 'react-redux'; -import { MonitorSummary } from '../../../../common/graphql/types'; -import { IntegrationGroup } from '../integration_group'; -import { UptimeSettingsContext } from '../../../contexts'; -import { isIntegrationsPopupOpen } from '../../../state/selectors'; -import { AppState } from '../../../state'; -import { toggleIntegrationsPopover, PopoverState } from '../../../state/actions'; - -interface MonitorListActionsPopoverProps { - summary: MonitorSummary; - popoverState: PopoverState | null; - togglePopoverIsVisible: typeof toggleIntegrationsPopover; -} - -const MonitorListActionsPopoverComponent = ({ - summary, - popoverState, - togglePopoverIsVisible, -}: MonitorListActionsPopoverProps) => { - const popoverId = `${summary.monitor_id}_popover`; - const { - basePath, - dateRangeStart, - dateRangeEnd, - isApmAvailable, - isInfraAvailable, - isLogsAvailable, - } = useContext(UptimeSettingsContext); - - const monitorUrl: string | undefined = get(summary, 'state.url.full', undefined); - const isPopoverOpen: boolean = - !!popoverState && popoverState.open && popoverState.id === popoverId; - return ( - togglePopoverIsVisible({ id: popoverId, open: true })} - iconType="arrowDown" - iconSide="right" - > - Integrations - - } - closePopover={() => togglePopoverIsVisible({ id: popoverId, open: false })} - id={popoverId} - isOpen={isPopoverOpen} - > - - - ); -}; - -const mapStateToProps = (state: AppState) => ({ - popoverState: isIntegrationsPopupOpen(state), -}); - -const mapDispatchToProps = (dispatch: any) => ({ - togglePopoverIsVisible: (popoverState: PopoverState) => { - return dispatch(toggleIntegrationsPopover(popoverState)); - }, -}); - -export const MonitorListActionsPopover = connect( - mapStateToProps, - mapDispatchToProps -)(MonitorListActionsPopoverComponent); diff --git a/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/integration_link.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/integration_link.test.tsx.snap deleted file mode 100644 index 502af2eb91051..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/integration_link.test.tsx.snap +++ /dev/null @@ -1,56 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`IntegrationLink component renders a disabled link when href is undefined 1`] = ` - - - - - - - - - click for bar - - - -`; - -exports[`IntegrationLink component renders without errors 1`] = ` - - - - - - - - - click for bar - - - -`; diff --git a/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_link.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_link.test.tsx deleted file mode 100644 index ba313f255f13d..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_link.test.tsx +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 from 'react'; -import { IntegrationLink } from '../integration_link'; -import { shallowWithIntl } from 'test_utils/enzyme_helpers'; - -describe('IntegrationLink component', () => { - it('renders without errors', () => { - const component = shallowWithIntl( - - ); - expect(component).toMatchSnapshot(); - }); - it('renders a disabled link when href is undefined', () => { - const component = shallowWithIntl( - - ); - expect(component).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/index.ts b/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/index.ts deleted file mode 100644 index 71fb860e4653f..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * 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 { MonitorSSLCertificate } from './monitor_ssl_certificate'; diff --git a/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/monitor_ssl_certificate.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/monitor_ssl_certificate.tsx deleted file mode 100644 index c50f7f1b00f0d..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/monitor_status_bar/monitor_ssl_certificate.tsx +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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 from 'react'; -import { get } from 'lodash'; -import moment from 'moment'; -import { EuiSpacer, EuiText } from '@elastic/eui'; -import { FormattedMessage } from '@kbn/i18n/react'; -import { i18n } from '@kbn/i18n'; -import styled from 'styled-components'; - -import { PingTls } from '../../../../common/graphql/types'; - -interface Props { - /** - * TLS information coming from monitor in ES heartbeat index - */ - tls: PingTls | null | undefined; -} - -const TextContainer = styled.div` - margin-left: 20px; -`; - -export const MonitorSSLCertificate = ({ tls }: Props) => { - const certificateValidity: string | undefined = get( - tls, - 'certificate_not_valid_after', - undefined - ); - - const validExpiryDate = certificateValidity && !isNaN(new Date(certificateValidity).valueOf()); - - return validExpiryDate && certificateValidity ? ( - <> - - - - - - - - ) : null; -}; diff --git a/x-pack/plugins/uptime/public/components/functional/monitor_status_details/translations.ts b/x-pack/plugins/uptime/public/components/functional/monitor_status_details/translations.ts deleted file mode 100644 index 1c2844f4f6ccf..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/monitor_status_details/translations.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 { i18n } from '@kbn/i18n'; - -export const healthStatusMessageAriaLabel = i18n.translate( - 'xpack.uptime.monitorStatusBar.healthStatusMessageAriaLabel', - { - defaultMessage: 'Monitor status', - } -); - -export const upLabel = i18n.translate('xpack.uptime.monitorStatusBar.healthStatusMessage.upLabel', { - defaultMessage: 'Up', -}); - -export const downLabel = i18n.translate( - 'xpack.uptime.monitorStatusBar.healthStatusMessage.downLabel', - { - defaultMessage: 'Down', - } -); - -export const monitorUrlLinkAriaLabel = i18n.translate( - 'xpack.uptime.monitorStatusBar.monitorUrlLinkAriaLabel', - { - defaultMessage: 'Monitor URL link', - } -); - -export const durationTextAriaLabel = i18n.translate( - 'xpack.uptime.monitorStatusBar.durationTextAriaLabel', - { - defaultMessage: 'Monitor duration in milliseconds', - } -); - -export const timestampFromNowTextAriaLabel = i18n.translate( - 'xpack.uptime.monitorStatusBar.timestampFromNowTextAriaLabel', - { - defaultMessage: 'Time since last check', - } -); - -export const loadingMessage = i18n.translate('xpack.uptime.monitorStatusBar.loadingMessage', { - defaultMessage: 'Loading…', -}); diff --git a/x-pack/plugins/uptime/public/hooks/use_index_pattern.ts b/x-pack/plugins/uptime/public/hooks/use_index_pattern.ts deleted file mode 100644 index 551511f8cf93f..0000000000000 --- a/x-pack/plugins/uptime/public/hooks/use_index_pattern.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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 { useEffect, Dispatch } from 'react'; -import { useKibana } from '../../../../../src/plugins/kibana_react/public'; - -export const useIndexPattern = (setIndexPattern: Dispatch) => { - const core = useKibana(); - useEffect(() => { - const fetch = core.services.http?.fetch; - async function getIndexPattern() { - if (!fetch) throw new Error('Http core services are not defined'); - setIndexPattern(await fetch('/api/uptime/index_pattern', { method: 'GET' })); - } - getIndexPattern(); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [core.services.http]); -}; diff --git a/x-pack/plugins/uptime/public/lib/adapters/index_pattern/__tests__/get_index_pattern.test.ts b/x-pack/plugins/uptime/public/lib/adapters/index_pattern/__tests__/get_index_pattern.test.ts deleted file mode 100644 index 6654def2f944b..0000000000000 --- a/x-pack/plugins/uptime/public/lib/adapters/index_pattern/__tests__/get_index_pattern.test.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 axios, { AxiosRequestConfig } from 'axios'; -import { getIndexPattern } from '../get_index_pattern'; - -describe('getIndexPattern', () => { - let axiosSpy: jest.SpyInstance, [string, (AxiosRequestConfig | undefined)?]>; - beforeEach(() => { - axiosSpy = jest.spyOn(axios, 'get'); - }); - - afterEach(() => { - jest.clearAllMocks(); - }); - - it('returns expected data', async () => { - expect.assertions(3); - axiosSpy.mockReturnValue(new Promise(r => r({ data: { foo: 'bar' } }))); - expect(await getIndexPattern()).toEqual({ foo: 'bar' }); - expect(axiosSpy.mock.calls).toHaveLength(1); - expect(axiosSpy.mock.calls[0]).toEqual(['/api/uptime/index_pattern']); - }); - - it('handles the supplied basePath', async () => { - expect.assertions(2); - await getIndexPattern('foo'); - expect(axiosSpy.mock.calls).toHaveLength(1); - expect(axiosSpy.mock.calls[0]).toEqual(['foo/api/uptime/index_pattern']); - }); - - it('supplies the returned data to the given setter function', async () => { - const mockSetter = jest.fn(); - axiosSpy.mockReturnValue(new Promise(r => r({ data: { foo: 'bar' } }))); - await getIndexPattern(undefined, mockSetter); - expect(mockSetter).toHaveBeenCalled(); - expect(mockSetter).toHaveBeenCalledWith({ foo: 'bar' }); - }); - - it('returns undefined when there is an error fetching', async () => { - expect.assertions(1); - axiosSpy.mockReturnValue( - new Promise((resolve, reject) => reject('Request timeout, server could not be reached')) - ); - expect(await getIndexPattern()).toBeUndefined(); - }); -}); diff --git a/x-pack/plugins/uptime/public/lib/adapters/index_pattern/get_index_pattern.ts b/x-pack/plugins/uptime/public/lib/adapters/index_pattern/get_index_pattern.ts deleted file mode 100644 index fd4161b35f7dd..0000000000000 --- a/x-pack/plugins/uptime/public/lib/adapters/index_pattern/get_index_pattern.ts +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 axios from 'axios'; -import { getApiPath } from '../../helper'; - -/** - * Fetches and returns the uptime index pattern, optionally provides it to - * a given setter function. - * @param basePath - the base path, if any - * @param setter - a callback for use with non-async functions like `useEffect` - */ -export const getIndexPattern = async (basePath?: string, setter?: (data: unknown) => void) => { - try { - const { data } = await axios.get(getApiPath('/api/uptime/index_pattern', basePath)); - if (setter) { - setter(data); - } - return data; - } catch { - return undefined; - } -}; diff --git a/x-pack/plugins/uptime/public/lib/adapters/index_pattern/index.ts b/x-pack/plugins/uptime/public/lib/adapters/index_pattern/index.ts deleted file mode 100644 index 1c84a7bc3b727..0000000000000 --- a/x-pack/plugins/uptime/public/lib/adapters/index_pattern/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * 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 { getIndexPattern } from './get_index_pattern'; diff --git a/x-pack/plugins/uptime/public/lib/adapters/telemetry/index.ts b/x-pack/plugins/uptime/public/lib/adapters/telemetry/index.ts deleted file mode 100644 index 3c3ee2b125896..0000000000000 --- a/x-pack/plugins/uptime/public/lib/adapters/telemetry/index.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * 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 const APP_ICON = 'graphApp'; - -export function createWorkspacePath(id: string) { - return `/app/graph/#/workspace/${id}`; -} diff --git a/x-pack/plugins/uptime/public/lib/adapters/telemetry/log_monitor.ts b/x-pack/plugins/uptime/public/lib/adapters/telemetry/log_monitor.ts deleted file mode 100644 index 20328497d69a8..0000000000000 --- a/x-pack/plugins/uptime/public/lib/adapters/telemetry/log_monitor.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * 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 axios from 'axios'; -import { getApiPath } from '../../helper'; - -/** - * Generates a function to log a page load of the monitor page for Kibana telemetry. - * @returns a function that can log page loads - */ -export const getTelemetryMonitorPageLogger = (xsrf: string, basePath?: string) => async () => { - await axios.post(getApiPath('/api/uptime/logMonitor', basePath), undefined, { - headers: { 'kbn-xsrf': xsrf }, - }); -}; diff --git a/x-pack/plugins/uptime/public/lib/adapters/telemetry/log_overview.ts b/x-pack/plugins/uptime/public/lib/adapters/telemetry/log_overview.ts deleted file mode 100644 index fd9fd773a18b9..0000000000000 --- a/x-pack/plugins/uptime/public/lib/adapters/telemetry/log_overview.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* - * 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 axios from 'axios'; -import { getApiPath } from '../../helper'; - -/** - * Generates a function to log a page load of the overview page for Kibana telemtry. - * @returns a function that can log page loads - */ -export const getTelemetryOverviewPageLogger = (xsrf: string, basePath?: string) => async () => { - await axios.post(getApiPath('/api/uptime/logOverview', basePath), undefined, { - headers: { 'kbn-xsrf': xsrf }, - }); -}; diff --git a/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/parameterize_values.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/parameterize_values.test.ts.snap deleted file mode 100644 index 39c28a87f5e71..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/parameterize_values.test.ts.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`parameterizeValues parameterizes provided values for multiple fields 1`] = `"foo=bar&foo=baz&bar=foo&bar=baz"`; - -exports[`parameterizeValues parameterizes the provided values for a given field name 1`] = `"foo=bar&foo=baz"`; diff --git a/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap deleted file mode 100644 index bc02e1054b6f7..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/to_static_index_pattern.test.ts.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`toStaticIndexPattern provides the required fields 1`] = ` -Object { - "attributes": Object { - "fields": "[{\\"name\\":\\"@timestamp\\",\\"type\\":\\"date\\",\\"scripted\\":false,\\"searchable\\":true}]", - }, - "fields": Array [ - Object { - "name": "@timestamp", - "scripted": false, - "searchable": true, - "type": "date", - }, - ], - "id": "foo", - "title": "foo", -} -`; diff --git a/x-pack/plugins/uptime/public/lib/helper/__tests__/get_api_path.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/get_api_path.test.ts deleted file mode 100644 index c111008fdc3d1..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/__tests__/get_api_path.test.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 { getApiPath } from '../get_api_path'; - -describe('getApiPath', () => { - it('returns a path with basePath when provided', () => { - const result = getApiPath('/api/foo/bar', '/somebasepath'); - expect(result).toEqual('/somebasepath/api/foo/bar'); - }); - - it('returns a valid path when no basePath present', () => { - const result = getApiPath('/api/foo/bar'); - expect(result).toEqual('/api/foo/bar'); - }); - - it('returns a valid path when an empty string is supplied as basePath', () => { - const result = getApiPath('/api/foo/bar', ''); - expect(result).toEqual('/api/foo/bar'); - }); -}); diff --git a/x-pack/plugins/uptime/public/lib/helper/__tests__/parameterize_values.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/parameterize_values.test.ts deleted file mode 100644 index e550a1a6397e3..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/__tests__/parameterize_values.test.ts +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 { parameterizeValues } from '../parameterize_values'; - -describe('parameterizeValues', () => { - let params: URLSearchParams; - - beforeEach(() => { - params = new URLSearchParams(); - }); - - it('parameterizes the provided values for a given field name', () => { - parameterizeValues(params, { foo: ['bar', 'baz'] }); - expect(params.toString()).toMatchSnapshot(); - }); - - it('parameterizes provided values for multiple fields', () => { - parameterizeValues(params, { foo: ['bar', 'baz'], bar: ['foo', 'baz'] }); - expect(params.toString()).toMatchSnapshot(); - }); - - it('returns an empty string when there are no values provided', () => { - parameterizeValues(params, { foo: [] }); - expect(params.toString()).toBe(''); - }); -}); diff --git a/x-pack/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts b/x-pack/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts deleted file mode 100644 index c8015a678c726..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/__tests__/to_static_index_pattern.test.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * 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 { toStaticIndexPattern } from '../to_static_index_pattern'; - -describe('toStaticIndexPattern', () => { - it('provides the required fields', () => { - const pattern = { - attributes: { - fields: '[{"name":"@timestamp","type":"date","scripted":false,"searchable":true}]', - }, - id: 'foo', - }; - expect(toStaticIndexPattern(pattern)).toMatchSnapshot(); - }); -}); diff --git a/x-pack/plugins/uptime/public/lib/helper/get_api_path.ts b/x-pack/plugins/uptime/public/lib/helper/get_api_path.ts deleted file mode 100644 index 398d58f8460ba..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/get_api_path.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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 const getApiPath = (path: string, basePath?: string) => - basePath ? `${basePath}${path}` : path; diff --git a/x-pack/plugins/uptime/public/lib/helper/parameterize_values.ts b/x-pack/plugins/uptime/public/lib/helper/parameterize_values.ts deleted file mode 100644 index 4c9fa6838c2ed..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/parameterize_values.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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 const parameterizeValues = ( - params: URLSearchParams, - obj: Record -): void => { - Object.keys(obj).forEach(key => { - obj[key].forEach(val => { - params.append(key, val); - }); - }); -}; diff --git a/x-pack/plugins/uptime/public/lib/helper/render_with_router.tsx b/x-pack/plugins/uptime/public/lib/helper/render_with_router.tsx deleted file mode 100644 index 5cd9ec23a3587..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/render_with_router.tsx +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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 from 'react'; - -import { Router } from 'react-router-dom'; -import { MemoryHistory } from 'history/createMemoryHistory'; -import { createMemoryHistory } from 'history'; - -export const renderWithRouter = (Component: any, customHistory?: MemoryHistory) => { - if (customHistory) { - return {Component}; - } - const history = createMemoryHistory(); - history.location.key = 'TestKeyForTesting'; - - return {Component}; -}; diff --git a/x-pack/plugins/uptime/public/lib/helper/to_static_index_pattern.ts b/x-pack/plugins/uptime/public/lib/helper/to_static_index_pattern.ts deleted file mode 100644 index b8a12c1e578e3..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/to_static_index_pattern.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * 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 const toStaticIndexPattern = (indexPattern: any) => ({ - ...indexPattern, - fields: JSON.parse(indexPattern.attributes.fields), - title: indexPattern.id, -}); diff --git a/x-pack/plugins/uptime/public/pages/monitor.tsx b/x-pack/plugins/uptime/public/pages/monitor.tsx index 8b8c230541826..fb701d1453792 100644 --- a/x-pack/plugins/uptime/public/pages/monitor.tsx +++ b/x-pack/plugins/uptime/public/pages/monitor.tsx @@ -18,6 +18,7 @@ import { selectSelectedMonitor } from '../state/selectors'; import { getSelectedMonitorAction } from '../state/actions'; import { PageHeader } from './page_header'; import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; +import { useTrackPageview } from '../../../observability/public'; interface StateProps { selectedMonitor: Ping | null; @@ -61,8 +62,8 @@ export const MonitorPageComponent: React.FC = ({ useUptimeTelemetry(UptimePage.Monitor); - // useTrackPageview({ app: 'uptime', path: 'monitor' }); - // useTrackPageview({ app: 'uptime', path: 'monitor', delay: 15000 }); + useTrackPageview({ app: 'uptime', path: 'monitor' }); + useTrackPageview({ app: 'uptime', path: 'monitor', delay: 15000 }); const nameOrId = selectedMonitor?.monitor?.name || selectedMonitor?.monitor?.id || ''; useBreadcrumbs([{ text: nameOrId }]); diff --git a/x-pack/plugins/uptime/public/pages/overview.tsx b/x-pack/plugins/uptime/public/pages/overview.tsx index d2c1eba6b3796..1d0b52ed24e1c 100644 --- a/x-pack/plugins/uptime/public/pages/overview.tsx +++ b/x-pack/plugins/uptime/public/pages/overview.tsx @@ -21,6 +21,7 @@ import { UptimeThemeContext } from '../contexts'; import { EmptyState, FilterGroup, KueryBar } from '../components/connected'; import { useUpdateKueryString } from '../hooks'; import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; +import { useTrackPageview } from '../../../observability/public'; interface OverviewPageProps { autocomplete: DataPublicPluginSetup['autocomplete']; @@ -71,8 +72,8 @@ export const OverviewPageComponent = ({ autocomplete, indexPattern, setEsKueryFi useUptimeTelemetry(UptimePage.Overview); - // useTrackPageview({ app: 'uptime', path: 'overview' }); - // useTrackPageview({ app: 'uptime', path: 'overview', delay: 15000 }); + useTrackPageview({ app: 'uptime', path: 'overview' }); + useTrackPageview({ app: 'uptime', path: 'overview', delay: 15000 }); const [esFilters, error] = useUpdateKueryString(indexPattern, search, urlFilters); diff --git a/x-pack/plugins/uptime/public/queries/doc_count_query.ts b/x-pack/plugins/uptime/public/queries/doc_count_query.ts deleted file mode 100644 index 3067a9d16f050..0000000000000 --- a/x-pack/plugins/uptime/public/queries/doc_count_query.ts +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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 gql from 'graphql-tag'; - -export const docCountQueryString = ` -query GetStateIndexStatus { - statesIndexStatus: getStatesIndexStatus { - docCount { - count - } - indexExists - } -} -`; - -export const docCountQuery = gql` - ${docCountQueryString} -`; diff --git a/x-pack/plugins/uptime/public/queries/filter_bar_query.ts b/x-pack/plugins/uptime/public/queries/filter_bar_query.ts deleted file mode 100644 index a9b7e52c0f793..0000000000000 --- a/x-pack/plugins/uptime/public/queries/filter_bar_query.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 gql from 'graphql-tag'; - -export const filterBarQueryString = ` -query FilterBar($dateRangeStart: String!, $dateRangeEnd: String!) { - filterBar: getFilterBar(dateRangeStart: $dateRangeStart, dateRangeEnd: $dateRangeEnd) { - ids - locations - ports - schemes - urls - } -} -`; - -export const filterBarQuery = gql` - ${filterBarQueryString} -`; diff --git a/x-pack/plugins/uptime/public/queries/monitor_charts_query.ts b/x-pack/plugins/uptime/public/queries/monitor_charts_query.ts deleted file mode 100644 index c7dc8a14c9c44..0000000000000 --- a/x-pack/plugins/uptime/public/queries/monitor_charts_query.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 gql from 'graphql-tag'; - -export const monitorChartsQueryString = ` -query MonitorCharts($dateRangeStart: String!, $dateRangeEnd: String!, $monitorId: String!, $location: String) { - monitorChartsData: getMonitorChartsData( - monitorId: $monitorId - dateRangeStart: $dateRangeStart - dateRangeEnd: $dateRangeEnd - location: $location - ) { - locationDurationLines { - name - line { - x - y - } - } - status { - x - up - down - total - } - statusMaxCount - durationMaxValue - } -} -`; - -export const monitorChartsQuery = gql` - ${monitorChartsQueryString} -`; diff --git a/x-pack/plugins/uptime/public/queries/monitor_page_title_query.ts b/x-pack/plugins/uptime/public/queries/monitor_page_title_query.ts deleted file mode 100644 index 3b59ef80183f7..0000000000000 --- a/x-pack/plugins/uptime/public/queries/monitor_page_title_query.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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 gql from 'graphql-tag'; - -export const monitorPageTitleQueryString = ` -query MonitorPageTitle($monitorId: String!) { - monitorPageTitle: getMonitorPageTitle(monitorId: $monitorId) { - id - url - name - } -}`; - -export const monitorPageTitleQuery = gql` - ${monitorPageTitleQueryString} -`; diff --git a/x-pack/plugins/uptime/public/queries/monitor_status_bar_query.ts b/x-pack/plugins/uptime/public/queries/monitor_status_bar_query.ts deleted file mode 100644 index 1f0eed6bb366a..0000000000000 --- a/x-pack/plugins/uptime/public/queries/monitor_status_bar_query.ts +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 gql from 'graphql-tag'; - -export const monitorStatusBarQueryString = ` -query MonitorStatus($dateRangeStart: String!, $dateRangeEnd: String!, $monitorId: String, $location: String) { - monitorStatus: getLatestMonitors( - dateRangeStart: $dateRangeStart - dateRangeEnd: $dateRangeEnd - monitorId: $monitorId - location: $location - ) { - timestamp - monitor { - status - duration { - us - } - } - observer { - geo { - name - } - } - tls { - certificate_not_valid_after - } - url { - full - } - } -} -`; - -export const monitorStatusBarQuery = gql` - ${monitorStatusBarQueryString} -`; diff --git a/x-pack/plugins/uptime/public/queries/snapshot_histogram_query.ts b/x-pack/plugins/uptime/public/queries/snapshot_histogram_query.ts deleted file mode 100644 index 7eb56ea4e9dd1..0000000000000 --- a/x-pack/plugins/uptime/public/queries/snapshot_histogram_query.ts +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 gql from 'graphql-tag'; - -export const snapshotHistogramQueryString = ` - query SnapshotHistogram( - $dateRangeStart: String! - $dateRangeEnd: String! - $filters: String - $monitorId: String - $statusFilter: String - ) { - queryResult: getSnapshotHistogram( - dateRangeStart: $dateRangeStart - dateRangeEnd: $dateRangeEnd - filters: $filters - statusFilter: $statusFilter - monitorId: $monitorId - ) { - histogram { - upCount - downCount - x - x0 - y - } - interval - } - } -`; - -export const snapshotHistogramQuery = gql` - ${snapshotHistogramQueryString} -`; From 4b35b4e28cf37ab23cb5cded5467302d71f5f56f Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 2 Apr 2020 13:54:23 -0400 Subject: [PATCH 13/36] More cleanup. --- x-pack/plugins/uptime/common/graphql/types.ts | 40 +++++--------- .../monitor_status.bar.test.tsx.snap | 55 ------------------- .../__tests__/chart_empty_state.test.tsx | 35 ++++++++++++ ....snap => monitor_status_bar.test.tsx.snap} | 0 ...r.test.tsx => monitor_status_bar.test.tsx} | 0 5 files changed, 48 insertions(+), 82 deletions(-) delete mode 100644 x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_status.bar.test.tsx.snap create mode 100644 x-pack/plugins/uptime/public/components/functional/charts/__tests__/chart_empty_state.test.tsx rename x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/__snapshots__/{monitor_status.bar.test.tsx.snap => monitor_status_bar.test.tsx.snap} (100%) rename x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/{monitor_status.bar.test.tsx => monitor_status_bar.test.tsx} (100%) diff --git a/x-pack/plugins/uptime/common/graphql/types.ts b/x-pack/plugins/uptime/common/graphql/types.ts index 7ef05699d121c..c8beb91d807d5 100644 --- a/x-pack/plugins/uptime/common/graphql/types.ts +++ b/x-pack/plugins/uptime/common/graphql/types.ts @@ -299,6 +299,18 @@ export interface Resolve { rtt?: Duration | null; } +export interface Socks5 { + rtt?: Rtt | null; +} + +export interface Rtt { + connect?: Duration | null; + + handshake?: Duration | null; + + validate?: Duration | null; +} + export interface Summary { up?: number | null; @@ -319,18 +331,6 @@ export interface Location { lon?: number | null; } -export interface Socks5 { - rtt?: Rtt | null; -} - -export interface Rtt { - connect?: Duration | null; - - handshake?: Duration | null; - - validate?: Duration | null; -} - export interface Tcp { port?: number | null; @@ -411,21 +411,7 @@ export interface State { monitor?: MonitorState | null; - summary: { - up?: number | null; - - down?: number | null; - - geo?: { - name?: string | null; - - location?: { - lat?: number | null; - - lon?: number | null; - } | null; - } | null; - }; + summary: Summary; timestamp: UnsignedInteger; /** Transport encryption information. */ diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_status.bar.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_status.bar.test.tsx.snap deleted file mode 100644 index 17588ae53ed00..0000000000000 --- a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/monitor_status.bar.test.tsx.snap +++ /dev/null @@ -1,55 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`MonitorStatusBar component renders duration in ms, not us 1`] = ` -
-
-
-

- Up in 2 Locations -

-
-
- -
- -

- id1 -

-
-
-
-
-
-`; diff --git a/x-pack/plugins/uptime/public/components/functional/charts/__tests__/chart_empty_state.test.tsx b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/chart_empty_state.test.tsx new file mode 100644 index 0000000000000..2e25dddc0b4ed --- /dev/null +++ b/x-pack/plugins/uptime/public/components/functional/charts/__tests__/chart_empty_state.test.tsx @@ -0,0 +1,35 @@ +/* + * 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 { ChartEmptyState } from '../chart_empty_state'; +import { shallowWithIntl } from 'test_utils/enzyme_helpers'; +import React from 'react'; +import { FormattedMessage } from '@kbn/i18n/react'; + +describe('ChartEmptyState', () => { + it('renders string values', () => { + expect( + shallowWithIntl() + ).toMatchSnapshot(); + }); + + it('renders JSX values', () => { + expect( + shallowWithIntl( + down }} + /> + } + title={} + /> + ) + ).toMatchSnapshot(); + }); +}); diff --git a/x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/__snapshots__/monitor_status.bar.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/__snapshots__/monitor_status_bar.test.tsx.snap similarity index 100% rename from x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/__snapshots__/monitor_status.bar.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/__snapshots__/monitor_status_bar.test.tsx.snap diff --git a/x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/monitor_status.bar.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/monitor_status_bar.test.tsx similarity index 100% rename from x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/monitor_status.bar.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_status_details/__test__/monitor_status_bar.test.tsx From d190e42c745dd64a83e21af7188ef9435ffd8d01 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 2 Apr 2020 14:22:07 -0400 Subject: [PATCH 14/36] Fix all non-maps unit tests. --- .../functional/empty_state/__tests__/empty_state.test.tsx | 4 ++-- .../functional/location_map/embeddables/embedded_map.tsx | 4 ++-- .../__tests__/__snapshots__/integration_link.test.tsx.snap | 0 .../monitor_list_drawer}/__tests__/integration_link.test.tsx | 0 .../monitor_details/ml/__tests__/ml_flyout.test.tsx | 2 +- .../uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx | 2 +- .../uptime/public/state/api/__tests__/snapshot.test.ts | 2 +- .../public/state/effects/__tests__/fetch_effect.test.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) rename x-pack/plugins/uptime/public/components/functional/{ => monitor_list/monitor_list_drawer}/__tests__/__snapshots__/integration_link.test.tsx.snap (100%) rename x-pack/plugins/uptime/public/components/functional/{ => monitor_list/monitor_list_drawer}/__tests__/integration_link.test.tsx (100%) diff --git a/x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx b/x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx index a74ad543c3318..64b7dcdd519cf 100644 --- a/x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx +++ b/x-pack/plugins/uptime/public/components/functional/empty_state/__tests__/empty_state.test.tsx @@ -8,8 +8,8 @@ import React from 'react'; import { mountWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import { EmptyStateComponent } from '../empty_state'; import { StatesIndexStatus } from '../../../../../common/runtime_types'; -import { IHttpFetchError } from '../../../../../../../../../target/types/core/public/http'; -import { HttpFetchError } from '../../../../../../../../../src/core/public/http/http_fetch_error'; +import { IHttpFetchError } from '../../../../../../../../target/types/core/public/http'; +import { HttpFetchError } from '../../../../../../../../src/core/public/http/http_fetch_error'; describe('EmptyState component', () => { let statesIndexStatus: StatesIndexStatus; diff --git a/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx index 4e02e61e8b0bb..2e34b20644dbc 100644 --- a/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx +++ b/x-pack/plugins/uptime/public/components/functional/location_map/embeddables/embedded_map.tsx @@ -10,8 +10,8 @@ import styled from 'styled-components'; import { npStart } from 'ui/new_platform'; import * as i18n from './translations'; -import { MapEmbeddable, MapEmbeddableInput } from '../../../../../../maps/public'; -import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../../plugins/maps/public'; +import { MapEmbeddable, MapEmbeddableInput } from '../../../../../../legacy/plugins/maps/public'; +// import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../../plugins/maps/public'; import { ViewMode } from '../../../../../../../../src/plugins/embeddable/public'; // @ts-ignore import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../../legacy/plugins/maps/common/constants'; diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_link.test.tsx.snap b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/integration_link.test.tsx.snap similarity index 100% rename from x-pack/plugins/uptime/public/components/functional/__tests__/__snapshots__/integration_link.test.tsx.snap rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/__snapshots__/integration_link.test.tsx.snap diff --git a/x-pack/plugins/uptime/public/components/functional/__tests__/integration_link.test.tsx b/x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_link.test.tsx similarity index 100% rename from x-pack/plugins/uptime/public/components/functional/__tests__/integration_link.test.tsx rename to x-pack/plugins/uptime/public/components/functional/monitor_list/monitor_list_drawer/__tests__/integration_link.test.tsx diff --git a/x-pack/plugins/uptime/public/components/monitor_details/ml/__tests__/ml_flyout.test.tsx b/x-pack/plugins/uptime/public/components/monitor_details/ml/__tests__/ml_flyout.test.tsx index c0b02181dcce1..31cdcfac9feef 100644 --- a/x-pack/plugins/uptime/public/components/monitor_details/ml/__tests__/ml_flyout.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor_details/ml/__tests__/ml_flyout.test.tsx @@ -9,7 +9,7 @@ import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import { MLFlyoutView } from '../ml_flyout'; import { UptimeSettingsContext } from '../../../../contexts'; import { CLIENT_DEFAULTS } from '../../../../../common/constants'; -import { License } from '../../../../../../../../plugins/licensing/common/license'; +import { License } from '../../../../../../../plugins/licensing/common/license'; const expiredLicense = new License({ signature: 'test signature', diff --git a/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx b/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx index 85961003fce72..ace06f5f4c205 100644 --- a/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx +++ b/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { Route } from 'react-router-dom'; import { mountWithRouter } from '../../lib'; import { OVERVIEW_ROUTE } from '../../../common/constants'; -import { KibanaContextProvider } from '../../../../../../../src/plugins/kibana_react/public'; +import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; import { UptimeUrlParams, getSupportedUrlParams } from '../../lib/helper'; import { makeBaseBreadcrumb, useBreadcrumbs } from '../../hooks/use_breadcrumbs'; diff --git a/x-pack/plugins/uptime/public/state/api/__tests__/snapshot.test.ts b/x-pack/plugins/uptime/public/state/api/__tests__/snapshot.test.ts index 66b376c3ac36f..ab3acc0226359 100644 --- a/x-pack/plugins/uptime/public/state/api/__tests__/snapshot.test.ts +++ b/x-pack/plugins/uptime/public/state/api/__tests__/snapshot.test.ts @@ -6,7 +6,7 @@ import { fetchSnapshotCount } from '../snapshot'; import { apiService } from '../utils'; -import { HttpFetchError } from '../../../../../../../../src/core/public/http/http_fetch_error'; +import { HttpFetchError } from '../../../../../../../src/core/public/http/http_fetch_error'; describe('snapshot API', () => { let fetchMock: jest.SpyInstance>; diff --git a/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts b/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts index 0354cfeac7b07..0cdf6b2eaabe6 100644 --- a/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts +++ b/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts @@ -7,7 +7,7 @@ import { call, put } from 'redux-saga/effects'; import { fetchEffectFactory } from '../fetch_effect'; import { indexStatusAction } from '../../actions'; -import { HttpFetchError } from '../../../../../../../../src/core/public/http/http_fetch_error'; +import { HttpFetchError } from '../../../../../../../src/core/public/http/http_fetch_error'; import { StatesIndexStatus } from '../../../../common/runtime_types'; import { fetchIndexStatus } from '../../api'; From ce9669493142db61f2f1ee8e87bec53142a0ef0d Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 2 Apr 2020 14:42:11 -0400 Subject: [PATCH 15/36] Get functional tests working. --- .../apis/uptime/feature_controls.ts | 2 +- .../apis/uptime/graphql/monitor_states.ts | 2 +- .../apis/uptime/graphql/ping_list.ts | 4 +- .../apis/uptime/graphql/snapshot_histogram.ts | 88 ------------------- .../apis/uptime/rest/doc_count.ts | 2 +- .../apis/uptime/rest/dynamic_settings.ts | 2 +- .../test/functional/apps/uptime/settings.ts | 2 +- 7 files changed, 7 insertions(+), 95 deletions(-) delete mode 100644 x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts diff --git a/x-pack/test/api_integration/apis/uptime/feature_controls.ts b/x-pack/test/api_integration/apis/uptime/feature_controls.ts index 4c3b7f97c9544..e172e0dc30da2 100644 --- a/x-pack/test/api_integration/apis/uptime/feature_controls.ts +++ b/x-pack/test/api_integration/apis/uptime/feature_controls.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; import { PINGS_DATE_RANGE_END, PINGS_DATE_RANGE_START } from './constants'; -import { API_URLS } from '../../../../legacy/plugins/uptime/common/constants'; +import { API_URLS } from '../../../../plugins/uptime/common/constants'; export default function featureControlsTests({ getService }: FtrProviderContext) { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts b/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts index a293426195d23..11424ac70d74c 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts +++ b/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts @@ -5,7 +5,7 @@ */ import expect from '@kbn/expect'; -import { monitorStatesQueryString } from '../../../../../legacy/plugins/uptime/public/queries/monitor_states_query'; +import { monitorStatesQueryString } from '../../../../../plugins/uptime/public/queries/monitor_states_query'; import { expectFixtureEql } from './helpers/expect_fixture_eql'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { makeChecksWithStatus } from './helpers/make_checks'; diff --git a/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts b/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts index c84b9c382acdd..53438a1846e39 100644 --- a/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts +++ b/x-pack/test/api_integration/apis/uptime/graphql/ping_list.ts @@ -5,9 +5,9 @@ */ import expect from '@kbn/expect'; -import { pingsQueryString } from '../../../../../legacy/plugins/uptime/public/queries'; +import { pingsQueryString } from '../../../../../plugins/uptime/public/queries'; import { expectFixtureEql } from './helpers/expect_fixture_eql'; -import { Ping, PingResults } from '../../../../../legacy/plugins/uptime/common/graphql/types'; +import { Ping, PingResults } from '../../../../../plugins/uptime/common/graphql/types'; const expectPingFixtureEql = (data: { allPings: PingResults }, fixtureName: string) => { expectFixtureEql(data, fixtureName, d => d.allPings.pings.forEach((p: Ping) => delete p.id)); diff --git a/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts b/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts deleted file mode 100644 index 17256574f60b9..0000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/snapshot_histogram.ts +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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 { snapshotHistogramQueryString } from '../../../../../legacy/plugins/uptime/public/queries/snapshot_histogram_query'; -import { expectFixtureEql } from './helpers/expect_fixture_eql'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { assertCloseTo } from '../../../../../plugins/uptime/server/lib/helper'; - -export default function({ getService }: FtrProviderContext) { - describe('snapshotHistogram', () => { - before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); - after('unload heartbeat index', () => getService('esArchiver').unload('uptime/full_heartbeat')); - - const supertest = getService('supertest'); - - it('will fetch histogram data for all monitors', async () => { - const getSnapshotHistogramQuery = { - operationName: 'SnapshotHistogram', - query: snapshotHistogramQueryString, - variables: { - dateRangeStart: '2019-09-11T03:31:04.380Z', - dateRangeEnd: '2019-09-11T03:40:34.410Z', - }, - }; - - const { - body: { data }, - } = await supertest - .post('/api/uptime/graphql') - .set('kbn-xsrf', 'foo') - .send({ ...getSnapshotHistogramQuery }); - // manually testing this value and then removing it to avoid flakiness - const { interval } = data.queryResult; - assertCloseTo(interval, 22801, 100); - delete data.queryResult.interval; - expectFixtureEql(data, 'snapshot_histogram'); - }); - - it('will fetch histogram data for a given monitor id', async () => { - const getSnapshotHistogramQuery = { - operationName: 'SnapshotHistogram', - query: snapshotHistogramQueryString, - variables: { - dateRangeStart: '2019-09-11T03:31:04.380Z', - dateRangeEnd: '2019-09-11T03:40:34.410Z', - }, - }; - - const { - body: { data }, - } = await supertest - .post('/api/uptime/graphql') - .set('kbn-xsrf', 'foo') - .send({ ...getSnapshotHistogramQuery }); - const { interval } = data.queryResult; - assertCloseTo(interval, 22801, 100); - delete data.queryResult.interval; - expectFixtureEql(data, 'snapshot_histogram_by_id'); - }); - - it('will fetch histogram data for a given filter', async () => { - const getSnapshotHistogramQuery = { - operationName: 'SnapshotHistogram', - query: snapshotHistogramQueryString, - variables: { - dateRangeStart: '2019-09-11T03:31:04.380Z', - dateRangeEnd: '2019-09-11T03:40:34.410Z', - filters: - '{"bool":{"must":[{"match":{"monitor.status":{"query":"up","operator":"and"}}}]}}', - }, - }; - - const { - body: { data }, - } = await supertest - .post('/api/uptime/graphql') - .set('kbn-xsrf', 'foo') - .send({ ...getSnapshotHistogramQuery }); - const { interval } = data.queryResult; - assertCloseTo(interval, 22801, 100); - delete data.queryResult.interval; - expectFixtureEql(data, 'snapshot_histogram_by_filter'); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts index 3f42511dd165c..edf7758ed337c 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts @@ -5,7 +5,7 @@ */ import { FtrProviderContext } from '../../../ftr_provider_context'; import { expectFixtureEql } from '../graphql/helpers/expect_fixture_eql'; -import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; export default function({ getService }: FtrProviderContext) { describe('docCount query', () => { diff --git a/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts b/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts index f4dd7c244f8b5..fe1318886c7af 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { defaultDynamicSettings } from '../../../../../legacy/plugins/uptime/common/runtime_types/dynamic_settings'; +import { defaultDynamicSettings } from '../../../../../plugins/uptime/common/runtime_types/dynamic_settings'; export default function({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/functional/apps/uptime/settings.ts b/x-pack/test/functional/apps/uptime/settings.ts index 3294d928b61b3..f545dc939ed6c 100644 --- a/x-pack/test/functional/apps/uptime/settings.ts +++ b/x-pack/test/functional/apps/uptime/settings.ts @@ -9,7 +9,7 @@ import { FtrProviderContext } from '../../ftr_provider_context'; import { defaultDynamicSettings, DynamicSettings, -} from '../../../../legacy/plugins/uptime/common/runtime_types'; +} from '../../../../plugins/uptime/common/runtime_types'; import { makeChecks } from '../../../api_integration/apis/uptime/graphql/helpers/make_checks'; export default ({ getPageObjects, getService }: FtrProviderContext) => { From 805661f306ff1c6c935c7a07a11a9c952ef89bbc Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Thu, 2 Apr 2020 14:42:39 -0400 Subject: [PATCH 16/36] Delete misplaced file. --- .../plugins/uptime/server/register_feature.ts | 69 ------------------- 1 file changed, 69 deletions(-) delete mode 100644 x-pack/plugins/uptime/server/register_feature.ts diff --git a/x-pack/plugins/uptime/server/register_feature.ts b/x-pack/plugins/uptime/server/register_feature.ts deleted file mode 100644 index 57d94fe802e6a..0000000000000 --- a/x-pack/plugins/uptime/server/register_feature.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 { i18n } from '@kbn/i18n'; -import { PluginSetupContract } from '../../features/server'; -import { PLUGIN } from '../common'; -import { umDynamicSettings } from './lib/saved_objects'; - -export const registerFeature = (features: PluginSetupContract) => { - features.registerFeature({ - id: PLUGIN.ID, - name: PLUGIN.NAME, - order: 1000, - navLinkId: PLUGIN.ID, - icon: 'uptimeApp', - app: ['uptime', 'kibana'], - catalogue: ['uptime'], - privileges: { - all: { - app: ['uptime', 'kibana'], - catalogue: ['uptime'], - api: [ - 'uptime-read', - 'uptime-write', - 'actions-read', - 'actions-all', - 'alerting-read', - 'alerting-all', - ], - savedObject: { - all: [umDynamicSettings.name, 'alert', 'action', 'action_task_params'], - read: [], - }, - ui: [ - 'save', - 'configureSettings', - 'show', - 'alerting:show', - 'actions:show', - 'alerting:save', - 'actions:save', - 'alerting:delete', - 'actions:delete', - ], - }, - read: { - app: ['uptime', 'kibana'], - catalogue: ['uptime'], - api: ['uptime-read', 'actions-read', 'actions-all', 'alerting-read', 'alerting-all'], - savedObject: { - all: ['alert', 'action', 'action_task_params'], - read: [umDynamicSettings.name], - }, - ui: [ - 'show', - 'alerting:show', - 'actions:show', - 'alerting:save', - 'actions:save', - 'alerting:delete', - 'actions:delete', - ], - }, - }, - }); -}; From ece7b4c746505250eea81fe7bc6678ec9e17391e Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Wed, 15 Apr 2020 09:25:37 -0400 Subject: [PATCH 17/36] Add uptime CODEOWNERS entry. --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 267f3dde0b66f..c0125dcd033db 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -78,6 +78,7 @@ /x-pack/plugins/infra/ @elastic/logs-metrics-ui /x-pack/plugins/ingest_manager/ @elastic/ingest-management /x-pack/legacy/plugins/ingest_manager/ @elastic/ingest-management +/x-pack/plugins/uptime/ @elastic/uptime /x-pack/plugins/observability/ @elastic/logs-metrics-ui @elastic/apm-ui @elastic/uptime @elastic/ingest-management /x-pack/legacy/plugins/monitoring/ @elastic/stack-monitoring-ui From 55da8c08b7111f18861623537499ac46f28d0545 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Mon, 20 Apr 2020 16:14:09 -0400 Subject: [PATCH 18/36] Get map working in Uptime app on NP. --- x-pack/plugins/uptime/common/graphql/index.ts | 8 - .../uptime/common/graphql/resolver_types.ts | 13 - x-pack/plugins/uptime/common/graphql/types.ts | 0 x-pack/plugins/uptime/common/index.ts | 1 - x-pack/plugins/uptime/public/apps/plugin.ts | 7 +- .../location_map/embeddables/embedded_map.tsx | 179 +++++++------- .../monitor/location_map/location_map.tsx | 4 +- .../monitor_status_details/status_details.tsx | 6 +- .../alerts/toggle_alert_flyout_button.tsx | 1 + .../overview/monitor_list/monitor_list.tsx | 7 +- .../plugins/uptime/public/contexts/index.ts | 4 + .../uptime_startup_plugins_context.tsx | 18 ++ .../framework/new_platform_adapter.tsx | 7 +- x-pack/plugins/uptime/public/uptime_app.tsx | 30 ++- x-pack/plugins/uptime/scripts/gql_gen.json | 11 - .../uptime/scripts/infer_graphql_types.js | 45 ---- .../graphql/monitor_states/resolvers.ts | 73 ------ .../graphql/monitor_states/schema.gql.ts | 161 ------------ .../uptime/server/graphql/pings/schema.gql.ts | 233 ------------------ 19 files changed, 157 insertions(+), 651 deletions(-) delete mode 100644 x-pack/plugins/uptime/common/graphql/index.ts delete mode 100644 x-pack/plugins/uptime/common/graphql/resolver_types.ts delete mode 100644 x-pack/plugins/uptime/common/graphql/types.ts create mode 100644 x-pack/plugins/uptime/public/contexts/uptime_startup_plugins_context.tsx delete mode 100644 x-pack/plugins/uptime/scripts/gql_gen.json delete mode 100644 x-pack/plugins/uptime/scripts/infer_graphql_types.js delete mode 100644 x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts delete mode 100644 x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts delete mode 100644 x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts diff --git a/x-pack/plugins/uptime/common/graphql/index.ts b/x-pack/plugins/uptime/common/graphql/index.ts deleted file mode 100644 index af689fb9c2822..0000000000000 --- a/x-pack/plugins/uptime/common/graphql/index.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* - * 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 * from './resolver_types'; -export * from './types'; diff --git a/x-pack/plugins/uptime/common/graphql/resolver_types.ts b/x-pack/plugins/uptime/common/graphql/resolver_types.ts deleted file mode 100644 index 22df610d2d516..0000000000000 --- a/x-pack/plugins/uptime/common/graphql/resolver_types.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* - * 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. - */ - -type UMResolverResult = Promise | T; - -export type UMResolver = ( - parent: Parent, - args: Args, - context: Context -) => UMResolverResult; diff --git a/x-pack/plugins/uptime/common/graphql/types.ts b/x-pack/plugins/uptime/common/graphql/types.ts deleted file mode 100644 index e69de29bb2d1d..0000000000000 diff --git a/x-pack/plugins/uptime/common/index.ts b/x-pack/plugins/uptime/common/index.ts index 78855d44c1acf..6fcccc7894b8b 100644 --- a/x-pack/plugins/uptime/common/index.ts +++ b/x-pack/plugins/uptime/common/index.ts @@ -6,5 +6,4 @@ export * from './constants'; export * from './domain_types'; -export * from './graphql'; export * from './runtime_types'; diff --git a/x-pack/plugins/uptime/public/apps/plugin.ts b/x-pack/plugins/uptime/public/apps/plugin.ts index 007351694c66b..c27b1e85fff8f 100644 --- a/x-pack/plugins/uptime/public/apps/plugin.ts +++ b/x-pack/plugins/uptime/public/apps/plugin.ts @@ -68,14 +68,13 @@ export class UptimePlugin implements Plugin { title: PLUGIN.TITLE, // description: PLUGIN.DESCRIPTION, async mount(params: AppMountParameters) { - const [coreStart] = await core.getStartServices(); + const [coreStart, b] = await core.getStartServices(); const { element } = params; - // console.log('plugins from mount', plugins); const libs: UMFrontendLibs = { - framework: getKibanaFrameworkAdapter(coreStart, plugins), + framework: getKibanaFrameworkAdapter(coreStart, plugins, b), }; // console.log(libs); - // console.log('corestart from mount', coreStart); + console.log('corestart from mount', coreStart); libs.framework.render(element); return () => {}; // console.log('value after setting el', this.el); diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx index 2d6b8a29fc5a2..eef4eac7753c8 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx @@ -24,7 +24,16 @@ import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../../legacy/plugins/maps/ import { Location } from '../../../../../common/runtime_types'; import { getLayerList } from './map_config'; -import { UptimeThemeContext } from '../../../../contexts'; +import { UptimeThemeContext, UptimeStartupPluginsContext } from '../../../../contexts'; +import { MapEmbeddable, MapEmbeddableInput } from 'x-pack/legacy/plugins/maps/public'; +// import { +// ErrorEmbeddable, +// EmbeddableOutput, +// ViewMode, +// isErrorEmbeddable, +// } from 'src/plugins/embeddable/public'; +// import { npStart } from 'ui/new_platform'; +import { isErrorEmbeddable, ViewMode } from '../../../../../../../../src/plugins/embeddable/public'; export interface EmbeddedMapProps { upPoints: LocationPoint[]; @@ -51,86 +60,88 @@ const EmbeddedPanel = styled.div` } `; -// export const EmbeddedMap = React.memo(({ upPoints, downPoints }: EmbeddedMapProps) => { -// const { colors } = useContext(UptimeThemeContext); -// const [embeddable, setEmbeddable] = useState(); -// const embeddableRoot: React.RefObject = useRef(null); -// const factory = npStart.plugins.embeddable.getEmbeddableFactory< -// MapEmbeddableInput, -// EmbeddableOutput, -// MapEmbeddable -// >(MAP_SAVED_OBJECT_TYPE); - -// const input: MapEmbeddableInput = { -// id: uuid.v4(), -// filters: [], -// hidePanelTitles: true, -// refreshConfig: { -// value: 0, -// pause: false, -// }, -// viewMode: ViewMode.VIEW, -// isLayerTOCOpen: false, -// hideFilterActions: true, -// // Zoom Lat/Lon values are set to make sure map is in center in the panel -// // It wil also omit Greenland/Antarctica etc -// mapCenter: { -// lon: 11, -// lat: 20, -// zoom: 0, -// }, -// disableInteractive: true, -// disableTooltipControl: true, -// hideToolbarOverlay: true, -// hideLayerControl: true, -// hideViewControl: true, -// }; - -// useEffect(() => { -// async function setupEmbeddable() { -// if (!factory) { -// throw new Error('Map embeddable not found.'); -// } -// const embeddableObject = await factory.create({ -// ...input, -// title: i18n.MAP_TITLE, -// }); - -// if (embeddableObject && !isErrorEmbeddable(embeddableObject)) { -// embeddableObject.setLayerList(getLayerList(upPoints, downPoints, colors)); -// } - -// setEmbeddable(embeddableObject); -// } -// setupEmbeddable(); - -// // we want this effect to execute exactly once after the component mounts -// // eslint-disable-next-line react-hooks/exhaustive-deps -// }, []); - -// // update map layers based on points -// useEffect(() => { -// if (embeddable && !isErrorEmbeddable(embeddable)) { -// embeddable.setLayerList(getLayerList(upPoints, downPoints, colors)); -// } -// }, [upPoints, downPoints, embeddable, colors]); - -// // We can only render after embeddable has already initialized -// useEffect(() => { -// if (embeddableRoot.current && embeddable) { -// embeddable.render(embeddableRoot.current); -// } -// }, [embeddable, embeddableRoot]); - -// return ( -// -//
-// -// ); -// }); - -// EmbeddedMap.displayName = 'EmbeddedMap'; +export const EmbeddedMap = React.memo(({ upPoints, downPoints }: EmbeddedMapProps) => { + const { colors } = useContext(UptimeThemeContext); + const [embeddable, setEmbeddable] = useState(); + const embeddableRoot: React.RefObject = useRef(null); + const { embeddable: embeddablePlugin } = useContext(UptimeStartupPluginsContext); + const factory = embeddablePlugin.getEmbeddableFactory('map'); + // const factory = npStart.plugins.embeddable.getEmbeddableFactory< + // MapEmbeddableInput, + // EmbeddableOutput, + // MapEmbeddable + // >(MAP_SAVED_OBJECT_TYPE); + + const input: MapEmbeddableInput = { + id: uuid.v4(), + filters: [], + hidePanelTitles: true, + refreshConfig: { + value: 0, + pause: false, + }, + viewMode: ViewMode.VIEW, + isLayerTOCOpen: false, + hideFilterActions: true, + // Zoom Lat/Lon values are set to make sure map is in center in the panel + // It wil also omit Greenland/Antarctica etc + mapCenter: { + lon: 11, + lat: 20, + zoom: 0, + }, + disableInteractive: true, + disableTooltipControl: true, + hideToolbarOverlay: true, + hideLayerControl: true, + hideViewControl: true, + }; + + useEffect(() => { + async function setupEmbeddable() { + if (!factory) { + throw new Error('Map embeddable not found.'); + } + const embeddableObject = await factory.create({ + ...input, + title: i18n.MAP_TITLE, + }); + + if (embeddableObject && !isErrorEmbeddable(embeddableObject)) { + embeddableObject.setLayerList(getLayerList(upPoints, downPoints, colors)); + } + + setEmbeddable(embeddableObject); + } + setupEmbeddable(); + + // we want this effect to execute exactly once after the component mounts + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + + // update map layers based on points + useEffect(() => { + if (embeddable && !isErrorEmbeddable(embeddable)) { + embeddable.setLayerList(getLayerList(upPoints, downPoints, colors)); + } + }, [upPoints, downPoints, embeddable, colors]); + + // We can only render after embeddable has already initialized + useEffect(() => { + if (embeddableRoot.current && embeddable) { + embeddable.render(embeddableRoot.current); + } + }, [embeddable, embeddableRoot]); + + return ( + +
+ + ); +}); + +EmbeddedMap.displayName = 'EmbeddedMap'; diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx index f0c5229b357ca..27fe3a2274270 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx @@ -7,7 +7,7 @@ import React from 'react'; import styled from 'styled-components'; import { EuiFlexGroup, EuiFlexItem, EuiErrorBoundary, EuiHideFor } from '@elastic/eui'; -// import { LocationStatusTags } from './location_status_tags'; +import { LocationStatusTags } from './location_status_tags'; import { EmbeddedMap, LocationPoint } from './embeddables/embedded_map'; import { MonitorLocations, MonitorLocation } from '../../../../common/runtime_types'; import { UNNAMED_LOCATION } from '../../../../common/constants'; @@ -77,7 +77,7 @@ export const LocationMap = ({ monitorLocations }: LocationMapProps) => { - {/* */} + diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx index 8a20b3acaaec9..ebd16b05ecb4a 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx @@ -7,7 +7,7 @@ import React, { useContext, useEffect, useState } from 'react'; import { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; import styled from 'styled-components'; -// import { LocationMap } from '../location_map'; +import { LocationMap } from '../location_map'; import { UptimeRefreshContext } from '../../../contexts'; import { MonitorLocations } from '../../../../common/runtime_types'; import { MonitorStatusBar } from './monitor_status_bar'; @@ -55,9 +55,9 @@ export const MonitorStatusDetailsComponent = ({ - {/* + - */} + ); diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx index 92fc015a276d3..48194279f70f7 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx @@ -17,6 +17,7 @@ interface Props { export const ToggleAlertFlyoutButtonComponent = ({ setAlertFlyoutVisible }: Props) => { const [isOpen, setIsOpen] = useState(false); const kibana = useKibana(); + console.log('kibana hook output', kibana); return ( = ({ const [getUrlValues] = useUrlParams(); const { dateRangeStart, dateRangeEnd, pagination, statusFilter } = getUrlValues(); + // const { embeddable } = useContext(UptimeStartupPluginsContext); + // const factory = embeddable.getEmbeddableFactory('map'); + // console.log(factory); + useEffect(() => { getMonitorList({ dateRangeStart, diff --git a/x-pack/plugins/uptime/public/contexts/index.ts b/x-pack/plugins/uptime/public/contexts/index.ts index 2b27fcfe907ab..243a25c26901a 100644 --- a/x-pack/plugins/uptime/public/contexts/index.ts +++ b/x-pack/plugins/uptime/public/contexts/index.ts @@ -11,3 +11,7 @@ export { UptimeSettingsContextProvider, } from './uptime_settings_context'; export { UptimeThemeContextProvider, UptimeThemeContext } from './uptime_theme_context'; +export { + UptimeStartupPluginsContext, + UptimeStartupPluginsContextProvider, +} from './uptime_startup_plugins_context'; diff --git a/x-pack/plugins/uptime/public/contexts/uptime_startup_plugins_context.tsx b/x-pack/plugins/uptime/public/contexts/uptime_startup_plugins_context.tsx new file mode 100644 index 0000000000000..ac47ed145def0 --- /dev/null +++ b/x-pack/plugins/uptime/public/contexts/uptime_startup_plugins_context.tsx @@ -0,0 +1,18 @@ +/* + * 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, { createContext } from 'react'; + +interface UptimeStartupPluginsContextValues { + embeddable?: any; +} + +export const UptimeStartupPluginsContext = createContext({}); + +export const UptimeStartupPluginsContextProvider: React.FC = ({ + children, + embeddable, +}) => ; diff --git a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx index 62fe7b5f94888..27944cf7d41d2 100644 --- a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx +++ b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx @@ -22,7 +22,8 @@ import { UMFrameworkAdapter } from '../../lib'; export const getKibanaFrameworkAdapter = ( core: CoreStart, - plugins: PluginsSetup + plugins: PluginsSetup, + startServices: object ): UMFrameworkAdapter => { const { application: { capabilities }, @@ -39,6 +40,9 @@ export const getKibanaFrameworkAdapter = ( triggers_actions_ui, } = plugins; + const { embeddable } = startServices; + console.log('em', embeddable); + alertTypeInitializers.forEach(init => { const alertInitializer = init({ autocomplete }); if (!triggers_actions_ui.alertTypeRegistry.has(alertInitializer.id)) { @@ -63,6 +67,7 @@ export const getKibanaFrameworkAdapter = ( canSave, core, darkMode: core.uiSettings.get(DEFAULT_DARK_MODE), + embeddable, commonlyUsedRanges: core.uiSettings.get(DEFAULT_TIMEPICKER_QUICK_RANGES), i18n, isApmAvailable: apm, diff --git a/x-pack/plugins/uptime/public/uptime_app.tsx b/x-pack/plugins/uptime/public/uptime_app.tsx index 827238994c13e..90963b747f91e 100644 --- a/x-pack/plugins/uptime/public/uptime_app.tsx +++ b/x-pack/plugins/uptime/public/uptime_app.tsx @@ -17,6 +17,8 @@ import { UptimeRefreshContextProvider, UptimeSettingsContextProvider, UptimeThemeContextProvider, + UptimeStartupPluginsContext, + UptimeStartupPluginsContextProvider, } from './contexts'; import { CommonlyUsedRange } from './components/common/uptime_date_picker'; import { store } from './state'; @@ -42,6 +44,7 @@ export interface UptimeAppProps { canSave: boolean; core: CoreStart; darkMode: boolean; + embeddable: any; i18n: I18nStart; isApmAvailable: boolean; isInfraAvailable: boolean; @@ -61,6 +64,7 @@ const Application = (props: UptimeAppProps) => { canSave, core, darkMode, + embeddable, i18n: i18nCore, plugins, renderGlobalHelpControls, @@ -90,6 +94,8 @@ const Application = (props: UptimeAppProps) => { // @ts-ignore store.dispatch(setBasePath(basePath)); + console.log('embeddable from app bootstrap', embeddable); + return ( @@ -99,17 +105,19 @@ const Application = (props: UptimeAppProps) => { - - -
- - -
-
-
+ + + +
+ + +
+
+
+
diff --git a/x-pack/plugins/uptime/scripts/gql_gen.json b/x-pack/plugins/uptime/scripts/gql_gen.json deleted file mode 100644 index 87b8233dd1eeb..0000000000000 --- a/x-pack/plugins/uptime/scripts/gql_gen.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "flattenTypes": true, - "generatorConfig": {}, - "primitives": { - "String": "string", - "Int": "number", - "Float": "number", - "Boolean": "boolean", - "ID": "string" - } -} diff --git a/x-pack/plugins/uptime/scripts/infer_graphql_types.js b/x-pack/plugins/uptime/scripts/infer_graphql_types.js deleted file mode 100644 index 2499e15bf4e23..0000000000000 --- a/x-pack/plugins/uptime/scripts/infer_graphql_types.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -require('../../../../../src/setup_node_env'); - -const { resolve } = require('path'); -// eslint-disable-next-line import/no-extraneous-dependencies, import/no-unresolved -const { generate } = require('graphql-code-generator'); - -const CONFIG_PATH = resolve(__dirname, 'gql_gen.json'); -const OUTPUT_INTROSPECTION_PATH = resolve('common', 'graphql', 'introspection.json'); -const OUTPUT_TYPES_PATH = resolve('common', 'graphql', 'types.ts'); -const SCHEMA_PATH = resolve(__dirname, 'graphql_schemas.ts'); - -async function main() { - await generate( - { - args: [], - config: CONFIG_PATH, - out: OUTPUT_INTROSPECTION_PATH, - overwrite: true, - schema: SCHEMA_PATH, - template: 'graphql-codegen-introspection-template', - }, - true - ); - await generate( - { - args: [], - config: CONFIG_PATH, - out: OUTPUT_TYPES_PATH, - overwrite: true, - schema: SCHEMA_PATH, - template: 'graphql-codegen-typescript-template', - }, - true - ); -} - -if (require.main === module) { - main(); -} diff --git a/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts deleted file mode 100644 index a4ee06d13afca..0000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitor_states/resolvers.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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 { CreateUMGraphQLResolvers, UMContext } from '../types'; -import { UMServerLibs } from '../../lib/lib'; -import { UMResolver } from '../../../common/graphql/resolver_types'; -import { GetMonitorStatesQueryArgs, MonitorSummaryResult } from '../../../common/graphql/types'; -import { CONTEXT_DEFAULTS } from '../../../common/constants'; -import { savedObjectsAdapter } from '../../lib/saved_objects'; - -export type UMGetMonitorStatesResolver = UMResolver< - MonitorSummaryResult | Promise, - any, - GetMonitorStatesQueryArgs, - UMContext ->; - -export const createMonitorStatesResolvers: CreateUMGraphQLResolvers = ( - libs: UMServerLibs -): { - Query: { - getMonitorStates: UMGetMonitorStatesResolver; - }; -} => { - return { - Query: { - async getMonitorStates( - _resolver, - { dateRangeStart, dateRangeEnd, filters, pagination, statusFilter, pageSize }, - { APICaller, savedObjectsClient } - ): Promise { - const dynamicSettings = await savedObjectsAdapter.getUptimeDynamicSettings( - savedObjectsClient - ); - - const decodedPagination = pagination - ? JSON.parse(decodeURIComponent(pagination)) - : CONTEXT_DEFAULTS.CURSOR_PAGINATION; - const [ - indexStatus, - { summaries, nextPagePagination, prevPagePagination }, - ] = await Promise.all([ - libs.requests.getIndexStatus({ callES: APICaller, dynamicSettings }), - libs.requests.getMonitorStates({ - callES: APICaller, - dynamicSettings, - dateRangeStart, - dateRangeEnd, - pagination: decodedPagination, - pageSize, - filters, - // this is added to make typescript happy, - // this sort of reassignment used to be further downstream but I've moved it here - // because this code is going to be decomissioned soon - statusFilter: statusFilter || undefined, - }), - ]); - - const totalSummaryCount = indexStatus?.docCount ?? 0; - - return { - summaries, - nextPagePagination, - prevPagePagination, - totalSummaryCount, - }; - }, - }, - }; -}; diff --git a/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts deleted file mode 100644 index 2d102cff27a42..0000000000000 --- a/x-pack/plugins/uptime/server/graphql/monitor_states/schema.gql.ts +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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 gql from 'graphql-tag'; - -export const monitorStatesSchema = gql` - "Represents a monitor's statuses for a period of time." - type SummaryHistogramPoint { - "The time at which these data were collected." - timestamp: UnsignedInteger! - "The number of _up_ documents." - up: Int! - "The number of _down_ documents." - down: Int! - } - "Monitor status data over time." - type SummaryHistogram { - "The number of documents used to assemble the histogram." - count: Int! - "The individual histogram data points." - points: [SummaryHistogramPoint!]! - } - type Agent { - id: String! - } - type Check { - agent: Agent - container: StateContainer - kubernetes: StateKubernetes - monitor: CheckMonitor! - observer: CheckObserver - timestamp: String! - } - type StateContainer { - id: String - } - type StateKubernetes { - pod: StatePod - } - type StatePod { - uid: String - } - type CheckMonitor { - ip: String - name: String - status: String! - } - type Location { - lat: Float - lon: Float - } - type CheckGeo { - name: String - location: Location - } - type CheckObserver { - geo: CheckGeo - } - type StateGeo { - name: [String] - location: Location - } - type StateObserver { - geo: StateGeo - } - type MonitorState { - status: String - name: String - id: String - type: String - } - type Summary { - up: Int - down: Int - geo: CheckGeo - } - type MonitorSummaryUrl { - domain: String - fragment: String - full: String - original: String - password: String - path: String - port: Int - query: String - scheme: String - username: String - } - type StateUrl { - domain: String - full: String - path: String - port: Int - scheme: String - } - "Contains monitor transmission encryption information." - type StateTLS { - "The date and time after which the certificate is invalid." - certificate_not_valid_after: String - certificate_not_valid_before: String - certificates: String - rtt: RTT - } - "Unifies the subsequent data for an uptime monitor." - type State { - "The agent processing the monitor." - agent: Agent - "There is a check object for each instance of the monitoring agent." - checks: [Check!] - geo: StateGeo - observer: StateObserver - monitor: MonitorState - summary: Summary! - timestamp: UnsignedInteger! - "Transport encryption information." - tls: [StateTLS] - url: StateUrl - } - "Represents the current state and associated data for an Uptime monitor." - type MonitorSummary { - "The ID assigned by the config or generated by the user." - monitor_id: String! - "The state of the monitor and its associated details." - state: State! - histogram: SummaryHistogram - } - "The primary object returned for monitor states." - type MonitorSummaryResult { - "Used to go to the next page of results" - prevPagePagination: String - "Used to go to the previous page of results" - nextPagePagination: String - "The objects representing the state of a series of heartbeat monitors." - summaries: [MonitorSummary!] - "The number of summaries." - totalSummaryCount: Int! - } - enum CursorDirection { - AFTER - BEFORE - } - enum SortOrder { - ASC - DESC - } - - type Query { - "Fetches the current state of Uptime monitors for the given parameters." - getMonitorStates( - dateRangeStart: String! - dateRangeEnd: String! - pagination: String - filters: String - statusFilter: String - pageSize: Int - ): MonitorSummaryResult - } -`; diff --git a/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts b/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts deleted file mode 100644 index 6ae641b5c8d8f..0000000000000 --- a/x-pack/plugins/uptime/server/graphql/pings/schema.gql.ts +++ /dev/null @@ -1,233 +0,0 @@ -/* - * 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 gql from 'graphql-tag'; - -export const pingsSchema = gql` - type PingResults { - "Total number of matching pings" - total: UnsignedInteger! - "Unique list of all locations the query matched" - locations: [String!]! - "List of pings " - pings: [Ping!]! - } - type ContainerImage { - name: String - tag: String - } - type Container { - id: String - image: ContainerImage - name: String - runtime: String - } - type DocCount { - count: UnsignedInteger! - } - "The monitor's status for a ping" - type Duration { - us: UnsignedInteger - } - "An agent for recording a beat" - type Beat { - hostname: String - name: String - timezone: String - type: String - } - type Docker { - id: String - image: String - name: String - } - type ECS { - version: String - } - type Error { - code: Int - message: String - type: String - } - type OS { - family: String - kernel: String - platform: String - version: String - name: String - build: String - } - "Geolocation data added via processors to enrich events." - type Geo { - "Name of the city in which the agent is running." - city_name: String - "The name of the continent on which the agent is running." - continent_name: String - "ISO designation for the agent's country." - country_iso_code: String - "The name of the agent's country." - country_name: String - "The lat/long of the agent." - location: String - "A name for the host's location, e.g. 'us-east-1' or 'LAX'." - name: String - "ISO designation of the agent's region." - region_iso_code: String - "Name of the region hosting the agent." - region_name: String - } - type Host { - architecture: String - id: String - hostname: String - ip: String - mac: String - name: String - os: OS - } - type HttpRTT { - content: Duration - response_header: Duration - total: Duration - validate: Duration - validate_body: Duration - write_request: Duration - } - type HTTPBody { - "Size of HTTP response body in bytes" - bytes: UnsignedInteger - "Hash of the HTTP response body" - hash: String - "Response body of the HTTP Response. May be truncated based on client settings." - content: String - "Byte length of the content string, taking into account multibyte chars." - content_bytes: UnsignedInteger - } - type HTTPResponse { - status_code: UnsignedInteger - body: HTTPBody - } - type HTTP { - response: HTTPResponse - rtt: HttpRTT - url: String - } - type ICMP { - requests: Int - rtt: Int - } - type KubernetesContainer { - image: String - name: String - } - type KubernetesNode { - name: String - } - type KubernetesPod { - name: String - uid: String - } - type Kubernetes { - container: KubernetesContainer - namespace: String - node: KubernetesNode - pod: KubernetesPod - } - type MetaCloud { - availability_zone: String - instance_id: String - instance_name: String - machine_type: String - project_id: String - provider: String - region: String - } - type Meta { - cloud: MetaCloud - } - type Monitor { - duration: Duration - host: String - "The id of the monitor" - id: String - "The IP pinged by the monitor" - ip: String - "The name of the protocol being monitored" - name: String - "The protocol scheme of the monitored host" - scheme: String - "The status of the monitored host" - status: String - "The type of host being monitored" - type: String - check_group: String - } - "Metadata added by a proccessor, which is specified in its configuration." - type Observer { - "Geolocation data for the agent." - geo: Geo - } - type Resolve { - host: String - ip: String - rtt: Duration - } - type RTT { - connect: Duration - handshake: Duration - validate: Duration - } - type Socks5 { - rtt: RTT - } - type TCP { - port: Int - rtt: RTT - } - "Contains monitor transmission encryption information." - type PingTLS { - "The date and time after which the certificate is invalid." - certificate_not_valid_after: String - certificate_not_valid_before: String - certificates: String - rtt: RTT - } - type URL { - full: String - scheme: String - domain: String - port: Int - path: String - query: String - } - "A request sent from a monitor to a host" - type Ping { - "unique ID for this ping" - id: String! - "The timestamp of the ping's creation" - timestamp: String! - "The agent that recorded the ping" - beat: Beat - container: Container - docker: Docker - ecs: ECS - error: Error - host: Host - http: HTTP - icmp: ICMP - kubernetes: Kubernetes - meta: Meta - monitor: Monitor - observer: Observer - resolve: Resolve - socks5: Socks5 - summary: Summary - tags: String - tcp: TCP - tls: PingTLS - url: URL - } -`; From f7c7830372b4692b9840821352fc4dabb4d6d507 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 24 Apr 2020 10:18:49 -0400 Subject: [PATCH 19/36] Update CODEOWNERS to remove legacy entry. --- .github/CODEOWNERS | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index b2d591cd333c2..4e8942d95525e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -81,10 +81,8 @@ /x-pack/plugins/infra/ @elastic/logs-metrics-ui /x-pack/plugins/ingest_manager/ @elastic/ingest-management /x-pack/legacy/plugins/ingest_manager/ @elastic/ingest-management -/x-pack/plugins/uptime/ @elastic/uptime /x-pack/plugins/observability/ @elastic/logs-metrics-ui @elastic/apm-ui @elastic/uptime @elastic/ingest-management /x-pack/legacy/plugins/monitoring/ @elastic/stack-monitoring-ui -/x-pack/legacy/plugins/uptime @elastic/uptime /x-pack/plugins/uptime @elastic/uptime # Machine Learning From 1a75ae0571e5fc3637bfc71ad4d7f0de1598b562 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 24 Apr 2020 14:00:13 -0400 Subject: [PATCH 20/36] Update server imports. --- .../plugins/uptime/server/lib/alerts/status_check.ts | 4 ++-- .../uptime/server/lib/helper/get_histogram_interval.ts | 2 +- .../lib/requests/__tests__/get_monitor_charts.test.ts | 2 +- .../lib/requests/__tests__/get_monitor_status.test.ts | 2 +- .../lib/requests/__tests__/get_ping_histogram.test.ts | 2 +- .../server/lib/requests/__tests__/get_pings.test.ts | 2 +- .../uptime/server/lib/requests/get_filter_bar.ts | 2 +- .../uptime/server/lib/requests/get_index_status.ts | 2 +- .../uptime/server/lib/requests/get_latest_monitor.ts | 2 +- .../uptime/server/lib/requests/get_monitor_details.ts | 2 +- .../server/lib/requests/get_monitor_locations.ts | 3 +-- .../uptime/server/lib/requests/get_ping_histogram.ts | 3 +-- x-pack/plugins/uptime/server/lib/requests/get_pings.ts | 7 +------ .../uptime/server/lib/requests/get_snapshot_counts.ts | 3 +-- .../uptime/server/lib/requests/uptime_requests.ts | 2 +- .../plugins/uptime/server/rest_api/dynamic_settings.ts | 2 +- .../server/rest_api/index_state/get_index_pattern.ts | 2 +- .../server/rest_api/index_state/get_index_status.ts | 2 +- .../server/rest_api/monitors/monitor_locations.ts | 2 +- .../uptime/server/rest_api/monitors/monitor_status.ts | 2 +- .../server/rest_api/monitors/monitors_details.ts | 2 +- .../server/rest_api/monitors/monitors_durations.ts | 2 +- .../rest_api/overview_filters/get_overview_filters.ts | 2 +- .../uptime/server/rest_api/pings/get_ping_histogram.ts | 2 +- .../plugins/uptime/server/rest_api/pings/get_pings.ts | 3 +-- x-pack/plugins/uptime/server/rest_api/types.ts | 2 +- .../api_integration/apis/uptime/feature_controls.ts | 2 +- .../test/api_integration/apis/uptime/rest/doc_count.ts | 7 +------ x-pack/test/functional/apps/uptime/settings.ts | 10 +--------- 29 files changed, 30 insertions(+), 52 deletions(-) diff --git a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts index a40a83849f32e..5bac4b468112e 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts @@ -9,14 +9,14 @@ import { isRight } from 'fp-ts/lib/Either'; import { ThrowReporter } from 'io-ts/lib/ThrowReporter'; import { i18n } from '@kbn/i18n'; import { AlertExecutorOptions } from '../../../../alerting/server'; -import { ACTION_GROUP_DEFINITIONS } from '../../../common/constants'; import { UptimeAlertTypeFactory } from './types'; import { GetMonitorStatusResult } from '../requests'; import { + ACTION_GROUP_DEFINITIONS, StatusCheckExecutorParamsType, StatusCheckAlertStateType, StatusCheckAlertState, -} from '../../../common/runtime_types'; +} from '../../../common'; import { savedObjectsAdapter } from '../saved_objects'; const { MONITOR_STATUS } = ACTION_GROUP_DEFINITIONS; diff --git a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts index 26515fb4b4c63..d10513bccb4f2 100644 --- a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts +++ b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts @@ -5,7 +5,7 @@ */ import DateMath from '@elastic/datemath'; -import { QUERY } from '../../../common/constants'; +import { QUERY } from '../../../common'; export const parseRelativeDate = (dateStr: string, options = {}) => { // We need this this parsing because if user selects This week or this date diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts index 43ae8b3948a9e..b317d14af8b61 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts @@ -7,7 +7,7 @@ import { set } from 'lodash'; import mockChartsData from './monitor_charts_mock.json'; import { getMonitorDurationChart } from '../get_monitor_duration'; -import { defaultDynamicSettings } from '../../../../common/runtime_types'; +import { defaultDynamicSettings } from '../../../../common'; describe('ElasticsearchMonitorsAdapter', () => { it('getMonitorChartsData will provide expected filters', async () => { diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_status.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_status.test.ts index ec264125b6716..4a8058dfa7050 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_status.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_status.test.ts @@ -7,7 +7,7 @@ import { elasticsearchServiceMock } from '../../../../../../../src/core/server/mocks'; import { getMonitorStatus } from '../get_monitor_status'; import { ScopedClusterClient } from 'src/core/server/elasticsearch'; -import { defaultDynamicSettings } from '../../../../common/runtime_types'; +import { defaultDynamicSettings } from '../../../../common'; interface BucketItemCriteria { monitor_id: string; diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts index a294632db96f9..28cc1bd760d38 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts @@ -5,7 +5,7 @@ */ import { getPingHistogram } from '../get_ping_histogram'; -import { defaultDynamicSettings } from '../../../../common/runtime_types'; +import { defaultDynamicSettings } from '../../../../common'; describe('getPingHistogram', () => { const standardMockResponse: any = { diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_pings.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_pings.test.ts index d93c0f875c02e..8a8fa1e48946d 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_pings.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_pings.test.ts @@ -6,7 +6,7 @@ import { getPings } from '../get_pings'; import { set } from 'lodash'; -import { defaultDynamicSettings } from '../../../../common/runtime_types'; +import { defaultDynamicSettings } from '../../../../common'; describe('getAll', () => { let mockEsSearchResult: any; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_filter_bar.ts b/x-pack/plugins/uptime/server/lib/requests/get_filter_bar.ts index dbe71cf689214..389146dee041d 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_filter_bar.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_filter_bar.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { OverviewFilters } from '../../../common/runtime_types'; +import { OverviewFilters } from '../../../common'; import { generateFilterAggs } from './generate_filter_aggs'; export interface GetFilterBarParams { diff --git a/x-pack/plugins/uptime/server/lib/requests/get_index_status.ts b/x-pack/plugins/uptime/server/lib/requests/get_index_status.ts index 7688f04f1acd9..a8ac7875e60aa 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_index_status.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_index_status.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { StatesIndexStatus } from '../../../common/runtime_types'; +import { StatesIndexStatus } from '../../../common'; export const getIndexStatus: UMElasticsearchQueryFn<{}, StatesIndexStatus> = async ({ callES, diff --git a/x-pack/plugins/uptime/server/lib/requests/get_latest_monitor.ts b/x-pack/plugins/uptime/server/lib/requests/get_latest_monitor.ts index 98ce449002f21..9b53f1e6bbea8 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_latest_monitor.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_latest_monitor.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { Ping } from '../../../common/runtime_types'; +import { Ping } from '../../../common'; export interface GetLatestMonitorParams { /** @member dateRangeStart timestamp bounds */ diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts index cf4ffa339ddfc..5ebc4e4db5970 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { MonitorDetails, MonitorError } from '../../../common/runtime_types'; +import { MonitorDetails, MonitorError } from '../../../common'; export interface GetMonitorDetailsParams { monitorId: string; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_locations.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_locations.ts index c0b68f543d0b3..add20509dbc66 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_locations.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_locations.ts @@ -5,8 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { UNNAMED_LOCATION } from '../../../common/constants'; -import { MonitorLocations, MonitorLocation } from '../../../common/runtime_types'; +import { UNNAMED_LOCATION, MonitorLocations, MonitorLocation } from '../../../common'; /** * Fetch data for the monitor page title. diff --git a/x-pack/plugins/uptime/server/lib/requests/get_ping_histogram.ts b/x-pack/plugins/uptime/server/lib/requests/get_ping_histogram.ts index d08d2e65ea0ad..2a14a864e240c 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_ping_histogram.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_ping_histogram.ts @@ -5,9 +5,8 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { QUERY } from '../../../common/constants'; import { getFilterClause } from '../helper'; -import { HistogramResult, HistogramQueryResult } from '../../../common/runtime_types'; +import { QUERY, HistogramResult, HistogramQueryResult } from '../../../common'; export interface GetPingHistogramParams { /** @member dateRangeStart timestamp bounds */ diff --git a/x-pack/plugins/uptime/server/lib/requests/get_pings.ts b/x-pack/plugins/uptime/server/lib/requests/get_pings.ts index a6a0e3c3d6542..dedc0986fdd0c 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_pings.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_pings.ts @@ -5,12 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters/framework'; -import { - GetPingsParams, - HttpResponseBody, - PingsResponse, - Ping, -} from '../../../common/runtime_types'; +import { GetPingsParams, HttpResponseBody, PingsResponse, Ping } from '../../../common'; const DEFAULT_PAGE_SIZE = 25; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_snapshot_counts.ts b/x-pack/plugins/uptime/server/lib/requests/get_snapshot_counts.ts index 6ca50b715e4aa..b9ea82e57f789 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_snapshot_counts.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_snapshot_counts.ts @@ -5,8 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { Snapshot } from '../../../common/runtime_types'; -import { CONTEXT_DEFAULTS } from '../../../common/constants'; +import { CONTEXT_DEFAULTS, Snapshot } from '../../../common'; import { QueryContext } from './search'; export interface GetSnapshotCountParams { diff --git a/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts b/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts index 089bbbe238b3d..6a24fdec6cf05 100644 --- a/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts +++ b/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts @@ -14,6 +14,7 @@ import { Cert, OverviewFilters, MonitorDetails, + MonitorDurationResult, MonitorLocations, Snapshot, StatesIndexStatus, @@ -31,7 +32,6 @@ import { } from '.'; import { GetMonitorStatesResult } from './get_monitor_states'; import { GetSnapshotCountParams } from './get_snapshot_counts'; -import { MonitorDurationResult } from '../../../common/types'; type ESQ = UMElasticsearchQueryFn; diff --git a/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts b/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts index 31833a25ee8ac..fdd82d22fc03b 100644 --- a/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts +++ b/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; import { isRight } from 'fp-ts/lib/Either'; import { PathReporter } from 'io-ts/lib/PathReporter'; import { UMServerLibs } from '../lib/lib'; -import { DynamicSettings, DynamicSettingsType } from '../../common/runtime_types'; +import { DynamicSettings, DynamicSettingsType } from '../../common'; import { UMRestApiRouteFactory } from '.'; import { savedObjectsAdapter } from '../lib/saved_objects'; diff --git a/x-pack/plugins/uptime/server/rest_api/index_state/get_index_pattern.ts b/x-pack/plugins/uptime/server/rest_api/index_state/get_index_pattern.ts index f1854c0a6bcd8..3da0def1c5906 100644 --- a/x-pack/plugins/uptime/server/rest_api/index_state/get_index_pattern.ts +++ b/x-pack/plugins/uptime/server/rest_api/index_state/get_index_pattern.ts @@ -6,7 +6,7 @@ import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common/constants/rest_api'; +import { API_URLS } from '../../../common'; export const createGetIndexPatternRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/index_state/get_index_status.ts b/x-pack/plugins/uptime/server/rest_api/index_state/get_index_status.ts index 9a4280efa98f9..9171ef1b52f4d 100644 --- a/x-pack/plugins/uptime/server/rest_api/index_state/get_index_status.ts +++ b/x-pack/plugins/uptime/server/rest_api/index_state/get_index_status.ts @@ -6,7 +6,7 @@ import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; export const createGetIndexStatusRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts index bcb7461fc181b..945696b7cea07 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common/constants/rest_api'; +import { API_URLS } from '../../../common'; export const createGetMonitorLocationsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_status.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_status.ts index bb002f8a8c286..0f12c33f281b2 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_status.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_status.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; export const createGetStatusBarRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts index 1347b6961845c..893d5f968a199 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common/constants/rest_api'; +import { API_URLS } from '../../../common'; export const createGetMonitorDetailsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts index fdb36ea2119c8..60acd583937be 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common/constants/rest_api'; +import { API_URLS } from '../../../common'; export const createGetMonitorDurationRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts b/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts index f723aaabbd4bb..d1ab44fc33323 100644 --- a/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts +++ b/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; import { objectValuesToArrays } from '../../lib/helper'; -import { API_URLS } from '../../../common/constants/rest_api'; +import { API_URLS } from '../../../common'; const arrayOrStringType = schema.maybe( schema.oneOf([schema.string(), schema.arrayOf(schema.string())]) diff --git a/x-pack/plugins/uptime/server/rest_api/pings/get_ping_histogram.ts b/x-pack/plugins/uptime/server/rest_api/pings/get_ping_histogram.ts index 231893b1b1904..2d2cda5baa7c4 100644 --- a/x-pack/plugins/uptime/server/rest_api/pings/get_ping_histogram.ts +++ b/x-pack/plugins/uptime/server/rest_api/pings/get_ping_histogram.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common/constants/rest_api'; +import { API_URLS } from '../../../common'; export const createGetPingHistogramRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts b/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts index d0cbc138e4659..3bba5cc9e54af 100644 --- a/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts +++ b/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts @@ -9,8 +9,7 @@ import { isLeft } from 'fp-ts/lib/Either'; import { PathReporter } from 'io-ts/lib/PathReporter'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common/constants/rest_api'; -import { GetPingsParamsType } from '../../../common/runtime_types'; +import { API_URLS, GetPingsParamsType } from '../../../common'; export const createGetPingsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/types.ts b/x-pack/plugins/uptime/server/rest_api/types.ts index 8720b9dc60b12..2be6e08d1b4b7 100644 --- a/x-pack/plugins/uptime/server/rest_api/types.ts +++ b/x-pack/plugins/uptime/server/rest_api/types.ts @@ -16,7 +16,7 @@ import { KibanaResponseFactory, IKibanaResponse, } from 'kibana/server'; -import { DynamicSettings } from '../../common/runtime_types'; +import { DynamicSettings } from '../../common'; import { UMServerLibs } from '../lib/lib'; /** diff --git a/x-pack/test/api_integration/apis/uptime/feature_controls.ts b/x-pack/test/api_integration/apis/uptime/feature_controls.ts index 6c566ec7cb23b..7e5d22ad2e198 100644 --- a/x-pack/test/api_integration/apis/uptime/feature_controls.ts +++ b/x-pack/test/api_integration/apis/uptime/feature_controls.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; import { PINGS_DATE_RANGE_END, PINGS_DATE_RANGE_START } from './constants'; -import { API_URLS } from '../../../../plugins/uptime/common/constants'; +import { API_URLS } from '../../../../plugins/uptime/common'; export default function featureControlsTests({ getService }: FtrProviderContext) { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts index 508aacd4decdf..29cbbf0c40994 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts @@ -4,13 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ import { FtrProviderContext } from '../../../ftr_provider_context'; -<<<<<<< HEAD -import { expectFixtureEql } from '../graphql/helpers/expect_fixture_eql'; -import { API_URLS } from '../../../../../plugins/uptime/common/constants'; -======= import { expectFixtureEql } from './helper/expect_fixture_eql'; -import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; ->>>>>>> master +import { API_URLS } from '../../../../../../plugins/uptime/common'; export default function({ getService }: FtrProviderContext) { describe('docCount query', () => { diff --git a/x-pack/test/functional/apps/uptime/settings.ts b/x-pack/test/functional/apps/uptime/settings.ts index 085c62a85aed9..704b815235fce 100644 --- a/x-pack/test/functional/apps/uptime/settings.ts +++ b/x-pack/test/functional/apps/uptime/settings.ts @@ -6,16 +6,8 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { - defaultDynamicSettings, - DynamicSettings, -<<<<<<< HEAD -} from '../../../../plugins/uptime/common/runtime_types'; -import { makeChecks } from '../../../api_integration/apis/uptime/graphql/helpers/make_checks'; -======= -} from '../../../../legacy/plugins/uptime/common/runtime_types'; +import { defaultDynamicSettings, DynamicSettings } from '../../../../plugins/uptime/common'; import { makeChecks } from '../../../api_integration/apis/uptime/rest/helper/make_checks'; ->>>>>>> master export default ({ getPageObjects, getService }: FtrProviderContext) => { const { uptime: uptimePage } = getPageObjects(['uptime']); From 9a72af4c1f6edabd2be210611558697800a9238e Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 24 Apr 2020 14:03:33 -0400 Subject: [PATCH 21/36] Delete and clean up unused or redundant code/comments. --- .../uptime/common/domain_types/index.ts | 7 -- .../uptime/common/domain_types/monitors.ts | 11 --- x-pack/plugins/uptime/common/index.ts | 2 +- x-pack/plugins/uptime/common/types/index.ts | 12 --- x-pack/plugins/uptime/kibana.json | 6 +- x-pack/plugins/uptime/public/apps/index.ts | 23 ----- x-pack/plugins/uptime/public/apps/plugin.ts | 92 ++++--------------- .../location_map/embeddables/embedded_map.tsx | 40 +++----- .../alerts/toggle_alert_flyout_button.tsx | 1 - .../overview/monitor_list/monitor_list.tsx | 13 +-- .../uptime_startup_plugins_context.tsx | 13 +-- .../framework/apollo_client_adapter.ts | 16 ---- .../framework/framework_adapter_types.ts | 12 --- .../framework/new_platform_adapter.tsx | 20 +--- x-pack/plugins/uptime/public/lib/lib.ts | 5 - x-pack/plugins/uptime/public/uptime_app.tsx | 14 +-- 16 files changed, 50 insertions(+), 237 deletions(-) delete mode 100644 x-pack/plugins/uptime/common/domain_types/index.ts delete mode 100644 x-pack/plugins/uptime/common/domain_types/monitors.ts delete mode 100644 x-pack/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts delete mode 100644 x-pack/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts diff --git a/x-pack/plugins/uptime/common/domain_types/index.ts b/x-pack/plugins/uptime/common/domain_types/index.ts deleted file mode 100644 index 1cf72ca2dac0b..0000000000000 --- a/x-pack/plugins/uptime/common/domain_types/index.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * 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 * from './monitors'; diff --git a/x-pack/plugins/uptime/common/domain_types/monitors.ts b/x-pack/plugins/uptime/common/domain_types/monitors.ts deleted file mode 100644 index 9f03357e17dad..0000000000000 --- a/x-pack/plugins/uptime/common/domain_types/monitors.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* - * 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 enum VECTOR_SHAPE_TYPES { - POINT = 'POINT', - LINE = 'LINE', - POLYGON = 'POLYGON', -} diff --git a/x-pack/plugins/uptime/common/index.ts b/x-pack/plugins/uptime/common/index.ts index 6fcccc7894b8b..eab7787488083 100644 --- a/x-pack/plugins/uptime/common/index.ts +++ b/x-pack/plugins/uptime/common/index.ts @@ -5,5 +5,5 @@ */ export * from './constants'; -export * from './domain_types'; export * from './runtime_types'; +export * from './types'; diff --git a/x-pack/plugins/uptime/common/types/index.ts b/x-pack/plugins/uptime/common/types/index.ts index a32eabd49a3e5..71ccd54dd3cdc 100644 --- a/x-pack/plugins/uptime/common/types/index.ts +++ b/x-pack/plugins/uptime/common/types/index.ts @@ -4,18 +4,6 @@ * you may not use this file except in compliance with the Elastic License. */ -/** Represents a bucket of monitor status information. */ -export interface StatusData { - /** The timeseries point for this status data. */ - x: number; - /** The value of up counts for this point. */ - up?: number | null; - /** The value for down counts for this point. */ - down?: number | null; - /** The total down counts for this point. */ - total?: number | null; -} - /** Represents the average monitor duration ms at a point in time. */ export interface MonitorDurationAveragePoint { /** The timeseries value for this point. */ diff --git a/x-pack/plugins/uptime/kibana.json b/x-pack/plugins/uptime/kibana.json index 0779d7fab5a2e..15c13914309f7 100644 --- a/x-pack/plugins/uptime/kibana.json +++ b/x-pack/plugins/uptime/kibana.json @@ -2,14 +2,14 @@ "configPath": ["xpack", "uptime"], "id": "uptime", "kibanaVersion": "kibana", - "optionalPlugins": ["kibana_react", "home", "data", "capabilities"], + "optionalPlugins": ["capabilities", "data", "home", "kibana_react"], "requiredPlugins": [ "alerting", "embeddable", "features", "licensing", - "usageCollection", - "triggers_actions_ui" + "triggers_actions_ui", + "usageCollection" ], "server": true, "ui": true, diff --git a/x-pack/plugins/uptime/public/apps/index.ts b/x-pack/plugins/uptime/public/apps/index.ts index bfd4d9e71e740..65b80d08d4f20 100644 --- a/x-pack/plugins/uptime/public/apps/index.ts +++ b/x-pack/plugins/uptime/public/apps/index.ts @@ -4,27 +4,4 @@ * you may not use this file except in compliance with the Elastic License. */ -// import chrome from 'ui/chrome'; -// import { npStart } from 'ui/new_platform'; -// import { UptimePlugin } from './plugin'; -// import 'uiExports/embeddableFactories'; - export { UptimePlugin } from './plugin'; - -// new UptimePlugin( -// { opaqueId: Symbol('uptime'), env: {} as any, config: { get: () => ({} as any) } }, -// chrome -// ).start(npStart); - -// --------------------------------- - -// import { npSetup } from 'ui/new_platform'; -// import { Plugin } from './plugin'; -// import 'uiExports/embeddableFactories'; - -// const plugin = new Plugin({ -// opaqueId: Symbol('uptime'), -// env: {} as any, -// config: { get: () => ({} as any) }, -// }); -// plugin.setup(npSetup); diff --git a/x-pack/plugins/uptime/public/apps/plugin.ts b/x-pack/plugins/uptime/public/apps/plugin.ts index c27b1e85fff8f..9d98d922c81e4 100644 --- a/x-pack/plugins/uptime/public/apps/plugin.ts +++ b/x-pack/plugins/uptime/public/apps/plugin.ts @@ -3,51 +3,36 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -import { - LegacyCoreStart, - // PluginInitializerContext, - CoreSetup, - CoreStart, - AppMountParameters, -} from 'src/core/public'; -// import { PluginsStart } from '../../../../../src/' 'ui/new_platform/new_platform'; -// import { Chrome } from 'ui/chrome'; -import { Plugin } from '../../../../../src/core/public'; +import { LegacyCoreStart, AppMountParameters } from 'src/core/public'; +import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'kibana/public'; import { UMFrontendLibs } from '../lib/lib'; import { PLUGIN } from '../../common'; -// import { getKibanaFrameworkAdapter } from '../lib/adapters/framework/new_platform_adapter'; -// import template from './template.html'; -// import { UptimeApp } from '../uptime_app'; -// @ts-ignore -import { createApolloClient } from '../lib/adapters/framework/apollo_client_adapter'; -// @ts-ignore import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; import { getKibanaFrameworkAdapter } from '../lib/adapters/framework/new_platform_adapter'; -// import { renderApp } from './render_app'; +import { HomePublicPluginSetup } from '../../../../../src/plugins/home/public'; +import { EmbeddableStart } from '../../../../../src/plugins/embeddable/public'; +import { TriggersAndActionsUIPublicPluginSetup } from '../../../triggers_actions_ui/public'; +import { DataPublicPluginSetup } from '../../../../../src/plugins/data/public'; export interface StartObject { core: LegacyCoreStart; plugins: any; } -console.log('adapter', getKibanaFrameworkAdapter); -export class UptimePlugin implements Plugin { - // private el: HTMLElement | undefined; - constructor() // @ts-ignore this is added to satisfy the New Platform typing constraint, - // but we're not leveraging any of its functionality yet. - // private readonly initializerContext: PluginInitializerContext, - // private readonly chrome: Chrome - { - // this.el = undefined; - // this.chrome = chrome; - } +export interface ClientPluginsSetup { + data: DataPublicPluginSetup; + home: HomePublicPluginSetup; + triggers_actions_ui: TriggersAndActionsUIPublicPluginSetup; +} - public async setup(core: CoreSetup, plugins: { home: any }) { - // console.log('core setup', core); +export interface ClientPluginsStart { + embeddable: EmbeddableStart; +} - // console.log('plugins from setup', plugins); - // console.log(plugins.home); +export class UptimePlugin implements Plugin { + constructor(context: PluginInitializerContext) {} + public async setup(core: CoreSetup, plugins: ClientPluginsSetup) { if (plugins.home) { plugins.home.featureCatalogue.register({ id: PLUGIN.ID, @@ -66,56 +51,19 @@ export class UptimePlugin implements Plugin { euiIconType: 'uptimeApp', order: 8900, title: PLUGIN.TITLE, - // description: PLUGIN.DESCRIPTION, async mount(params: AppMountParameters) { - const [coreStart, b] = await core.getStartServices(); + const [coreStart, corePlugins] = await core.getStartServices(); const { element } = params; const libs: UMFrontendLibs = { - framework: getKibanaFrameworkAdapter(coreStart, plugins, b), + framework: getKibanaFrameworkAdapter(coreStart, plugins, corePlugins), }; - // console.log(libs); - console.log('corestart from mount', coreStart); libs.framework.render(element); return () => {}; - // console.log('value after setting el', this.el); - // return renderApp(element); }, }); } - public start(start: CoreStart, plugins: {}): void { - // console.log('corestart from start:', start); - // const { - // data: { autocomplete }, - // } = plugins; - // console.log('autocomplete', autocomplete); - // // const { - // // core, - // // plugins: { - // // data: { autocomplete }, - // // }, - // // } = start; - // const libs: UMFrontendLibs = { - // framework: getKibanaFrameworkAdapter(start, autocomplete), - // }; - // console.log('value of el', this.el); - // libs.framework.render(UptimeApp, createApolloClient, this.el); - // // // @ts-ignore improper type description - // // // this.chrome.setRootTemplate(template); - // // const checkForRoot = () => { - // // return new Promise(resolve => { - // // const ready = !!document.getElementById(PLUGIN.APP_ROOT_ID); - // // if (ready) { - // // resolve(); - // // } else { - // // setTimeout(() => resolve(checkForRoot()), 10); - // // } - // // }); - // // }; - // // checkForRoot().then(() => { - // // libs.framework.render(UptimeApp, createApolloClient); - // // }); - } + public start(_start: CoreStart, _plugins: {}): void {} public stop() {} } diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx index eef4eac7753c8..9cb6a4430aed1 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx @@ -7,33 +7,17 @@ import React, { useEffect, useState, useContext, useRef } from 'react'; import uuid from 'uuid'; import styled from 'styled-components'; -// import { npStart } from 'ui/new_platform'; - -// import { -// ViewMode, -// EmbeddableOutput, -// ErrorEmbeddable, -// isErrorEmbeddable, -// } from '../../../../../../../../../src/plugins/embeddable/public'; +import { MapEmbeddable, MapEmbeddableInput } from '../../../../../../../legacy/plugins/maps/public'; import * as i18n from './translations'; -// import { MapEmbeddable, MapEmbeddableInput } from '../../../../../../legacy/plugins/maps/public'; -// import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../../plugins/maps/public'; -// import { ViewMode } from '../../../../../../../../src/plugins/embeddable/public'; -// @ts-ignore -import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../../legacy/plugins/maps/common/constants'; import { Location } from '../../../../../common/runtime_types'; - import { getLayerList } from './map_config'; import { UptimeThemeContext, UptimeStartupPluginsContext } from '../../../../contexts'; -import { MapEmbeddable, MapEmbeddableInput } from 'x-pack/legacy/plugins/maps/public'; -// import { -// ErrorEmbeddable, -// EmbeddableOutput, -// ViewMode, -// isErrorEmbeddable, -// } from 'src/plugins/embeddable/public'; -// import { npStart } from 'ui/new_platform'; -import { isErrorEmbeddable, ViewMode } from '../../../../../../../../src/plugins/embeddable/public'; +import { + isErrorEmbeddable, + ViewMode, + ErrorEmbeddable, +} from '../../../../../../../../src/plugins/embeddable/public'; +import { MAP_SAVED_OBJECT_TYPE } from '../../../../../../maps/public'; export interface EmbeddedMapProps { upPoints: LocationPoint[]; @@ -65,12 +49,10 @@ export const EmbeddedMap = React.memo(({ upPoints, downPoints }: EmbeddedMapProp const [embeddable, setEmbeddable] = useState(); const embeddableRoot: React.RefObject = useRef(null); const { embeddable: embeddablePlugin } = useContext(UptimeStartupPluginsContext); - const factory = embeddablePlugin.getEmbeddableFactory('map'); - // const factory = npStart.plugins.embeddable.getEmbeddableFactory< - // MapEmbeddableInput, - // EmbeddableOutput, - // MapEmbeddable - // >(MAP_SAVED_OBJECT_TYPE); + if (!embeddablePlugin) { + throw new Error('Embeddable start plugin not found'); + } + const factory = embeddablePlugin.getEmbeddableFactory(MAP_SAVED_OBJECT_TYPE); const input: MapEmbeddableInput = { id: uuid.v4(), diff --git a/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx b/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx index 48194279f70f7..92fc015a276d3 100644 --- a/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx +++ b/x-pack/plugins/uptime/public/components/overview/alerts/toggle_alert_flyout_button.tsx @@ -17,7 +17,6 @@ interface Props { export const ToggleAlertFlyoutButtonComponent = ({ setAlertFlyoutVisible }: Props) => { const [isOpen, setIsOpen] = useState(false); const kibana = useKibana(); - console.log('kibana hook output', kibana); return ( = ({ const [getUrlValues] = useUrlParams(); const { dateRangeStart, dateRangeEnd, pagination, statusFilter } = getUrlValues(); - // const { embeddable } = useContext(UptimeStartupPluginsContext); - // const factory = embeddable.getEmbeddableFactory('map'); - // console.log(factory); - useEffect(() => { getMonitorList({ dateRangeStart, @@ -207,13 +202,7 @@ export const MonitorListComponent: React.FC = ({ itemId="monitor_id" itemIdToExpandedRowMap={getExpandedRowMap()} items={items} - // TODO: not needed without sorting and pagination - // onChange={onChange} noItemsMessage={!!filters ? labels.NO_MONITOR_ITEM_SELECTED : labels.NO_DATA_MESSAGE} - // TODO: reintegrate pagination in future release - // pagination={pagination} - // TODO: reintegrate sorting in future release - // sorting={sorting} columns={columns} /> diff --git a/x-pack/plugins/uptime/public/contexts/uptime_startup_plugins_context.tsx b/x-pack/plugins/uptime/public/contexts/uptime_startup_plugins_context.tsx index ac47ed145def0..e516ff44aa12a 100644 --- a/x-pack/plugins/uptime/public/contexts/uptime_startup_plugins_context.tsx +++ b/x-pack/plugins/uptime/public/contexts/uptime_startup_plugins_context.tsx @@ -5,14 +5,11 @@ */ import React, { createContext } from 'react'; +import { ClientPluginsStart } from '../apps/plugin'; -interface UptimeStartupPluginsContextValues { - embeddable?: any; -} +export const UptimeStartupPluginsContext = createContext>({}); -export const UptimeStartupPluginsContext = createContext({}); - -export const UptimeStartupPluginsContextProvider: React.FC = ({ +export const UptimeStartupPluginsContextProvider: React.FC> = ({ children, - embeddable, -}) => ; + ...props +}) => ; diff --git a/x-pack/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts b/x-pack/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts deleted file mode 100644 index 2cec0d5fc8c64..0000000000000 --- a/x-pack/plugins/uptime/public/lib/adapters/framework/apollo_client_adapter.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * 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 { InMemoryCache } from 'apollo-cache-inmemory'; -import { ApolloClient } from 'apollo-client'; -import { HttpLink } from 'apollo-link-http'; -import { CreateGraphQLClient } from './framework_adapter_types'; - -export const createApolloClient: CreateGraphQLClient = (uri: string, xsrfHeader: string) => - new ApolloClient({ - link: new HttpLink({ uri, credentials: 'same-origin', headers: { 'kbn-xsrf': xsrfHeader } }), - cache: new InMemoryCache({ dataIdFromObject: () => undefined }), - }); diff --git a/x-pack/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts b/x-pack/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts deleted file mode 100644 index 34cf48514c932..0000000000000 --- a/x-pack/plugins/uptime/public/lib/adapters/framework/framework_adapter_types.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* - * 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 { NormalizedCacheObject } from 'apollo-cache-inmemory'; -import { ApolloClient } from 'apollo-client'; - -export type GraphQLClient = ApolloClient; - -export type CreateGraphQLClient = (url: string, xsrfHeader: string) => GraphQLClient; diff --git a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx index 27944cf7d41d2..f7f9e056f41af 100644 --- a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx +++ b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx @@ -19,11 +19,12 @@ import { DEFAULT_TIMEPICKER_QUICK_RANGES, } from '../../../../common/constants'; import { UMFrameworkAdapter } from '../../lib'; +import { ClientPluginsStart, ClientPluginsSetup } from '../../../apps/plugin'; export const getKibanaFrameworkAdapter = ( core: CoreStart, - plugins: PluginsSetup, - startServices: object + plugins: ClientPluginsSetup, + startPlugins: ClientPluginsStart ): UMFrameworkAdapter => { const { application: { capabilities }, @@ -35,14 +36,9 @@ export const getKibanaFrameworkAdapter = ( const { data: { autocomplete }, - // TODO: after NP migration we can likely fix this typing problem - // @ts-ignore we don't control this type triggers_actions_ui, } = plugins; - const { embeddable } = startServices; - console.log('em', embeddable); - alertTypeInitializers.forEach(init => { const alertInitializer = init({ autocomplete }); if (!triggers_actions_ui.alertTypeRegistry.has(alertInitializer.id)) { @@ -67,7 +63,6 @@ export const getKibanaFrameworkAdapter = ( canSave, core, darkMode: core.uiSettings.get(DEFAULT_DARK_MODE), - embeddable, commonlyUsedRanges: core.uiSettings.get(DEFAULT_TIMEPICKER_QUICK_RANGES), i18n, isApmAvailable: apm, @@ -75,6 +70,7 @@ export const getKibanaFrameworkAdapter = ( isLogsAvailable: logs, kibanaBreadcrumbs: breadcrumbs, plugins, + startPlugins, renderGlobalHelpControls: () => setHelpExtension({ appName: i18nFormatter.translate('xpack.uptime.header.appName', { @@ -97,16 +93,8 @@ export const getKibanaFrameworkAdapter = ( }; return { - // TODO: these parameters satisfy the interface but are no longer needed - // render: async ( - // createComponent: BootstrapUptimeApp, - // cgc: CreateGraphQLClient, - // element: HTMLElement - // ) => { - // ReactDOM.render(, element); render: async (element: any) => { if (element) { - console.log(element); ReactDOM.render(, element); } }, diff --git a/x-pack/plugins/uptime/public/lib/lib.ts b/x-pack/plugins/uptime/public/lib/lib.ts index daf8bdd62bc32..7dd3aa9eed5ce 100644 --- a/x-pack/plugins/uptime/public/lib/lib.ts +++ b/x-pack/plugins/uptime/public/lib/lib.ts @@ -17,10 +17,5 @@ export type UMUpdateBadge = (badge: UMBadge) => void; export type BootstrapUptimeApp = (props: UptimeAppProps) => ReactElement; export interface UMFrameworkAdapter { - // render( - // createComponent: BootstrapUptimeApp, - // createGraphQLClient: CreateGraphQLClient, - // element: HTMLElement - // ): void; render(element: any): void; } diff --git a/x-pack/plugins/uptime/public/uptime_app.tsx b/x-pack/plugins/uptime/public/uptime_app.tsx index 90963b747f91e..0d18f959230d1 100644 --- a/x-pack/plugins/uptime/public/uptime_app.tsx +++ b/x-pack/plugins/uptime/public/uptime_app.tsx @@ -10,14 +10,13 @@ import React, { useEffect } from 'react'; import { Provider as ReduxProvider } from 'react-redux'; import { BrowserRouter as Router } from 'react-router-dom'; import { I18nStart, ChromeBreadcrumb, CoreStart } from 'src/core/public'; -import { PluginsSetup } from 'ui/new_platform/new_platform'; import { KibanaContextProvider } from '../../../../src/plugins/kibana_react/public'; +import { ClientPluginsSetup, ClientPluginsStart } from './apps/plugin'; import { UMUpdateBadge } from './lib/lib'; import { UptimeRefreshContextProvider, UptimeSettingsContextProvider, UptimeThemeContextProvider, - UptimeStartupPluginsContext, UptimeStartupPluginsContextProvider, } from './contexts'; import { CommonlyUsedRange } from './components/common/uptime_date_picker'; @@ -44,13 +43,13 @@ export interface UptimeAppProps { canSave: boolean; core: CoreStart; darkMode: boolean; - embeddable: any; i18n: I18nStart; isApmAvailable: boolean; isInfraAvailable: boolean; isLogsAvailable: boolean; kibanaBreadcrumbs: ChromeBreadcrumb[]; - plugins: PluginsSetup; + plugins: ClientPluginsSetup; + startPlugins: ClientPluginsStart; routerBasename: string; setBadge: UMUpdateBadge; renderGlobalHelpControls(): void; @@ -64,12 +63,12 @@ const Application = (props: UptimeAppProps) => { canSave, core, darkMode, - embeddable, i18n: i18nCore, plugins, renderGlobalHelpControls, routerBasename, setBadge, + startPlugins, } = props; useEffect(() => { @@ -91,11 +90,8 @@ const Application = (props: UptimeAppProps) => { kibanaService.core = core; - // @ts-ignore store.dispatch(setBasePath(basePath)); - console.log('embeddable from app bootstrap', embeddable); - return ( @@ -105,7 +101,7 @@ const Application = (props: UptimeAppProps) => { - +
From ba164cec420db610b2577ef86c28f44302f1759e Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 24 Apr 2020 14:18:56 -0400 Subject: [PATCH 22/36] Move new files from legacy to NP to fix merge error. --- .../plugins/uptime/common/constants/settings_defaults.ts | 0 x-pack/{legacy => }/plugins/uptime/public/pages/translations.ts | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename x-pack/{legacy => }/plugins/uptime/common/constants/settings_defaults.ts (100%) rename x-pack/{legacy => }/plugins/uptime/public/pages/translations.ts (100%) diff --git a/x-pack/legacy/plugins/uptime/common/constants/settings_defaults.ts b/x-pack/plugins/uptime/common/constants/settings_defaults.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/common/constants/settings_defaults.ts rename to x-pack/plugins/uptime/common/constants/settings_defaults.ts diff --git a/x-pack/legacy/plugins/uptime/public/pages/translations.ts b/x-pack/plugins/uptime/public/pages/translations.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/pages/translations.ts rename to x-pack/plugins/uptime/public/pages/translations.ts From d98cafb80856214cd5e9398e4c0ec37b43e802c2 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 24 Apr 2020 16:24:34 -0400 Subject: [PATCH 23/36] Fix broken import. --- .../uptime/server/lib/requests/__tests__/get_certs.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts index b49a6b22ff976..c8a8855066108 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts @@ -5,7 +5,7 @@ */ import { getCerts } from '../get_certs'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../../../legacy/plugins/uptime/common/constants'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; describe('getCerts', () => { let mockHits: any; From 21bdffc796ebf3b975fd245fed84e125583ca817 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 24 Apr 2020 16:27:35 -0400 Subject: [PATCH 24/36] Delete obsolete test snapshots. --- .../format_error_string.test.ts.snap | 7 ------- .../__snapshots__/get_apm_href.test.ts.snap | 5 ----- .../__snapshots__/get_infra_href.test.ts.snap | 19 ------------------- .../get_logging_href.test.ts.snap | 13 ------------- 4 files changed, 44 deletions(-) delete mode 100644 x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap delete mode 100644 x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap delete mode 100644 x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap delete mode 100644 x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap diff --git a/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap deleted file mode 100644 index 8519157e4039e..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/__tests__/__snapshots__/format_error_string.test.ts.snap +++ /dev/null @@ -1,7 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`formatErrorString returns a formatted string containing each error 1`] = ` -"Error: foo is bar -Error: bar is not foo -" -`; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap deleted file mode 100644 index 53d336b52bd24..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_apm_href.test.ts.snap +++ /dev/null @@ -1,5 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`getApmHref creates href with base path when present 1`] = `"foo/app/apm#/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"`; - -exports[`getApmHref does not add a base path or extra slash when base path is empty string 1`] = `"/app/apm#/services?kuery=url.domain:%20%22www.elastic.co%22&rangeFrom=now-15m&rangeTo=now"`; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap deleted file mode 100644 index e79eb50d384a8..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_infra_href.test.ts.snap +++ /dev/null @@ -1,19 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`getInfraHref getInfraContainerHref creates a link for valid parameters 1`] = `"foo/app/metrics/link-to/container-detail/test-container-id"`; - -exports[`getInfraHref getInfraContainerHref does not specify a base path when none is available 1`] = `"/app/metrics/link-to/container-detail/test-container-id"`; - -exports[`getInfraHref getInfraContainerHref returns the first item when multiple container ids are supplied 1`] = `"bar/app/metrics/link-to/container-detail/test-container-id"`; - -exports[`getInfraHref getInfraIpHref creates a link for valid parameters 1`] = `"bar/app/metrics/inventory?waffleFilter=(expression:'host.ip%20%3A%20151.101.202.217',kind:kuery)"`; - -exports[`getInfraHref getInfraIpHref does not specify a base path when none is available 1`] = `"/app/metrics/inventory?waffleFilter=(expression:'host.ip%20%3A%20151.101.202.217',kind:kuery)"`; - -exports[`getInfraHref getInfraIpHref returns a url for ors between multiple ips 1`] = `"foo/app/metrics/inventory?waffleFilter=(expression:'host.ip%20%3A%20152.151.23.192%20or%20host.ip%20%3A%20151.101.202.217',kind:kuery)"`; - -exports[`getInfraHref getInfraKubernetesHref creates a link for valid parameters 1`] = `"foo/app/metrics/link-to/pod-detail/test-pod-uid"`; - -exports[`getInfraHref getInfraKubernetesHref does not specify a base path when none is available 1`] = `"/app/metrics/link-to/pod-detail/test-pod-uid"`; - -exports[`getInfraHref getInfraKubernetesHref selects the first pod uid when there are multiple 1`] = `"/app/metrics/link-to/pod-detail/test-pod-uid"`; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap deleted file mode 100644 index cfac6ce133c8a..0000000000000 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/__snapshots__/get_logging_href.test.ts.snap +++ /dev/null @@ -1,13 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`getLoggingHref creates a container href with base path when present 1`] = `"bar/app/logs?logFilter=(expression:'container.id%20:%20test-container-id',kind:kuery)"`; - -exports[`getLoggingHref creates a container href without a base path if it's an empty string 1`] = `"/app/logs?logFilter=(expression:'container.id%20:%20test-container-id',kind:kuery)"`; - -exports[`getLoggingHref creates a pod href with base path when present 1`] = `"bar/app/logs?logFilter=(expression:'pod.uid%20:%20test-pod-id',kind:kuery)"`; - -exports[`getLoggingHref creates a pod href without a base path when it's an empty string 1`] = `"/app/logs?logFilter=(expression:'pod.uid%20:%20test-pod-id',kind:kuery)"`; - -exports[`getLoggingHref creates an ip href with base path when present 1`] = `"bar/app/logs?logFilter=(expression:'pod.uid%20:%20test-pod-id',kind:kuery)"`; - -exports[`getLoggingHref creates an ip href without a base path when it's an empty string 1`] = `"/app/logs?logFilter=(expression:'host.ip%20%3A%20151.101.202.217',kind:kuery)"`; From 484c3ed667b60b1a574c8dbd37b8c7af37fa3b64 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 24 Apr 2020 18:37:02 -0400 Subject: [PATCH 25/36] Clean up imports and types, delete obsolete code. --- .../location_map/embeddables/embedded_map.tsx | 4 +- .../monitor_duration_container.tsx | 2 +- .../overview/empty_state/empty_state.tsx | 2 +- .../empty_state/empty_state_error.tsx | 2 +- .../contexts/uptime_settings_context.tsx | 2 +- x-pack/plugins/uptime/public/index.ts | 3 +- .../uptime/public/lib/alert_types/index.ts | 4 +- .../public/lib/alert_types/monitor_status.tsx | 11 +- .../plugins/uptime/public/register_feature.ts | 25 -- .../uptime/public/state/actions/ml_anomaly.ts | 6 +- .../public/state/actions/monitor_duration.ts | 2 +- .../uptime/public/state/actions/types.ts | 2 +- .../uptime/public/state/actions/utils.ts | 2 +- .../uptime/public/state/api/ml_anomaly.ts | 6 +- .../plugins/uptime/public/state/api/utils.ts | 2 +- .../public/state/effects/fetch_effect.ts | 2 +- .../public/state/reducers/index_pattern.ts | 2 +- .../public/state/reducers/ml_anomaly.ts | 6 +- .../uptime/public/state/reducers/types.ts | 2 +- .../lib/alerts/__tests__/status_check.test.ts | 6 +- .../__tests__/get_latest_monitor.test.ts | 2 +- .../__tests__/get_monitor_charts.test.ts | 2 +- .../__tests__/get_ping_histogram.test.ts | 2 +- .../uptime/server/lib/requests/get_certs.ts | 2 +- .../lib/requests/get_monitor_duration.ts | 1 - x-pack/plugins/uptime/server/plugin.ts | 9 +- .../apis/uptime/graphql/monitor_states.ts | 245 ------------------ .../api_integration/apis/uptime/rest/certs.ts | 3 +- .../apis/uptime/rest/doc_count.ts | 2 +- .../uptime/rest/monitor_states_generated.ts | 3 +- .../uptime/rest/monitor_states_real_data.ts | 3 +- .../apis/uptime/rest/ping_list.ts | 2 +- .../apis/uptime/rest/telemetry_collectors.ts | 2 +- .../functional/services/uptime/settings.ts | 2 +- 34 files changed, 44 insertions(+), 329 deletions(-) delete mode 100644 x-pack/plugins/uptime/public/register_feature.ts delete mode 100644 x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx index 9cb6a4430aed1..06cdb07bd8bcd 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx @@ -52,7 +52,7 @@ export const EmbeddedMap = React.memo(({ upPoints, downPoints }: EmbeddedMapProp if (!embeddablePlugin) { throw new Error('Embeddable start plugin not found'); } - const factory = embeddablePlugin.getEmbeddableFactory(MAP_SAVED_OBJECT_TYPE); + const factory: any = embeddablePlugin.getEmbeddableFactory(MAP_SAVED_OBJECT_TYPE); const input: MapEmbeddableInput = { id: uuid.v4(), @@ -84,7 +84,7 @@ export const EmbeddedMap = React.memo(({ upPoints, downPoints }: EmbeddedMapProp if (!factory) { throw new Error('Map embeddable not found.'); } - const embeddableObject = await factory.create({ + const embeddableObject: any = await factory.create({ ...input, title: i18n.MAP_TITLE, }); diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx index 7e39b977f1271..52d4f620f84b3 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx @@ -20,7 +20,7 @@ import { } from '../../../state/selectors'; import { UptimeRefreshContext } from '../../../contexts'; import { getMLJobId } from '../../../state/api/ml_anomaly'; -import { JobStat } from '../../../../../../../plugins/ml/common/types/data_recognizer'; +import { JobStat } from '../../../../../ml/common/types/data_recognizer'; import { MonitorDurationComponent } from './monitor_duration'; import { MonitorIdParam } from '../../../../common/types'; diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx index 651103a34bf21..d38f203739cea 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx @@ -10,7 +10,7 @@ import { EmptyStateError } from './empty_state_error'; import { EmptyStateLoading } from './empty_state_loading'; import { DataOrIndexMissing } from './data_or_index_missing'; import { DynamicSettings, StatesIndexStatus } from '../../../../common/runtime_types'; -import { IHttpFetchError } from '../../../../../../../../target/types/core/public/http'; +import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; interface EmptyStateProps { children: JSX.Element[] | JSX.Element; diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state_error.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state_error.tsx index 1135b969018a1..aa4040e319e0f 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state_error.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state_error.tsx @@ -7,7 +7,7 @@ import { EuiEmptyPrompt, EuiPanel, EuiTitle, EuiFlexGroup, EuiFlexItem } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React, { Fragment } from 'react'; -import { IHttpFetchError } from '../../../../../../../../target/types/core/public/http'; +import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; interface EmptyStateErrorProps { errors: IHttpFetchError[]; diff --git a/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx b/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx index 137846de103b4..4fabf3f2ed497 100644 --- a/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx +++ b/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx @@ -9,7 +9,7 @@ import { UptimeAppProps } from '../uptime_app'; import { CLIENT_DEFAULTS, CONTEXT_DEFAULTS } from '../../common/constants'; import { CommonlyUsedRange } from '../components/common/uptime_date_picker'; import { useGetUrlParams } from '../hooks'; -import { ILicense } from '../../../../../plugins/licensing/common/types'; +import { ILicense } from '../../../../plugins/licensing/common/types'; export interface UptimeSettingsContextValues { basePath: string; diff --git a/x-pack/plugins/uptime/public/index.ts b/x-pack/plugins/uptime/public/index.ts index ece9207b852e6..48cf2c90ad07b 100644 --- a/x-pack/plugins/uptime/public/index.ts +++ b/x-pack/plugins/uptime/public/index.ts @@ -7,4 +7,5 @@ import { PluginInitializerContext } from 'kibana/public'; import { UptimePlugin } from './apps'; -export const plugin = (_initializerContext: PluginInitializerContext) => new UptimePlugin(); +export const plugin = (initializerContext: PluginInitializerContext) => + new UptimePlugin(initializerContext); diff --git a/x-pack/plugins/uptime/public/lib/alert_types/index.ts b/x-pack/plugins/uptime/public/lib/alert_types/index.ts index 74160577cb0b1..f7ab254ffe675 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/index.ts +++ b/x-pack/plugins/uptime/public/lib/alert_types/index.ts @@ -4,9 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -// TODO: after NP migration is complete we should be able to remove this lint ignore comment -// eslint-disable-next-line @kbn/eslint/no-restricted-paths -import { AlertTypeModel } from '../../../../../../plugins/triggers_actions_ui/public'; +import { AlertTypeModel } from '../../../../triggers_actions_ui/public'; import { initMonitorStatusAlertType } from './monitor_status'; export type AlertTypeInitializer = (dependenies: { autocomplete: any }) => AlertTypeModel; diff --git a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx index 0624d20b197c0..d6f98a865b264 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx +++ b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx @@ -8,17 +8,12 @@ import { PathReporter } from 'io-ts/lib/PathReporter'; import React from 'react'; import DateMath from '@elastic/datemath'; import { isRight } from 'fp-ts/lib/Either'; -import { - AlertTypeModel, - ValidationResult, - // TODO: this typing issue should be resolved after NP migration - // eslint-disable-next-line @kbn/eslint/no-restricted-paths -} from '../../../../../../plugins/triggers_actions_ui/public/types'; +import { AlertTypeModel } from '../../../../triggers_actions_ui/public'; import { AlertTypeInitializer } from '.'; -import { StatusCheckExecutorParamsType } from '../../../common/runtime_types'; +import { StatusCheckExecutorParamsType } from '../../../common'; import { AlertMonitorStatus } from '../../components/overview/alerts/alerts_containers'; -export const validate = (alertParams: any): ValidationResult => { +export const validate = (alertParams: any) => { const errors: Record = {}; const decoded = StatusCheckExecutorParamsType.decode(alertParams); diff --git a/x-pack/plugins/uptime/public/register_feature.ts b/x-pack/plugins/uptime/public/register_feature.ts deleted file mode 100644 index 2f83fa33ba4bc..0000000000000 --- a/x-pack/plugins/uptime/public/register_feature.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 { i18n } from '@kbn/i18n'; -import { npSetup } from 'ui/new_platform'; -import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; - -const { - plugins: { home }, -} = npSetup; - -home.featureCatalogue.register({ - id: 'uptime', - title: i18n.translate('xpack.uptime.uptimeFeatureCatalogueTitle', { defaultMessage: 'Uptime' }), - description: i18n.translate('xpack.uptime.featureCatalogueDescription', { - defaultMessage: 'Perform endpoint health checks and uptime monitoring.', - }), - icon: 'uptimeApp', - path: `uptime#/`, - showOnHomePage: true, - category: FeatureCatalogueCategory.DATA, -}); diff --git a/x-pack/plugins/uptime/public/state/actions/ml_anomaly.ts b/x-pack/plugins/uptime/public/state/actions/ml_anomaly.ts index 67c75314a7305..441a3cefdf204 100644 --- a/x-pack/plugins/uptime/public/state/actions/ml_anomaly.ts +++ b/x-pack/plugins/uptime/public/state/actions/ml_anomaly.ts @@ -6,15 +6,15 @@ import { createAction } from 'redux-actions'; import { createAsyncAction } from './utils'; -import { MlCapabilitiesResponse } from '../../../../../../plugins/ml/common/types/capabilities'; -import { AnomaliesTableRecord } from '../../../../../../plugins/ml/common/types/anomalies'; +import { MlCapabilitiesResponse } from '../../../../../plugins/ml/common/types/capabilities'; +import { AnomaliesTableRecord } from '../../../../../plugins/ml/common/types/anomalies'; import { CreateMLJobSuccess, DeleteJobResults, MonitorIdParam, HeartbeatIndicesParam, } from './types'; -import { JobExistResult } from '../../../../../../plugins/ml/common/types/data_recognizer'; +import { JobExistResult } from '../../../../../plugins/ml/common/types/data_recognizer'; export const resetMLState = createAction('RESET_ML_STATE'); diff --git a/x-pack/plugins/uptime/public/state/actions/monitor_duration.ts b/x-pack/plugins/uptime/public/state/actions/monitor_duration.ts index 9a2db5be60b12..524044f873687 100644 --- a/x-pack/plugins/uptime/public/state/actions/monitor_duration.ts +++ b/x-pack/plugins/uptime/public/state/actions/monitor_duration.ts @@ -7,7 +7,7 @@ import { createAction } from 'redux-actions'; import { QueryParams } from './types'; import { MonitorDurationResult } from '../../../common/types'; -import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; +import { IHttpFetchError } from '../../../../../../target/types/core/public/http'; type MonitorQueryParams = QueryParams & { monitorId: string }; diff --git a/x-pack/plugins/uptime/public/state/actions/types.ts b/x-pack/plugins/uptime/public/state/actions/types.ts index 41381afd31453..dee2df77707d2 100644 --- a/x-pack/plugins/uptime/public/state/actions/types.ts +++ b/x-pack/plugins/uptime/public/state/actions/types.ts @@ -5,7 +5,7 @@ */ import { Action } from 'redux-actions'; -import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; +import { IHttpFetchError } from '../../../../../../target/types/core/public/http'; export interface AsyncAction { get: (payload: Payload) => Action; diff --git a/x-pack/plugins/uptime/public/state/actions/utils.ts b/x-pack/plugins/uptime/public/state/actions/utils.ts index a5adb96731f33..8ce4cf011406b 100644 --- a/x-pack/plugins/uptime/public/state/actions/utils.ts +++ b/x-pack/plugins/uptime/public/state/actions/utils.ts @@ -6,7 +6,7 @@ import { createAction } from 'redux-actions'; import { AsyncAction, AsyncAction1 } from './types'; -import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; +import { IHttpFetchError } from '../../../../../../target/types/core/public/http'; export function createAsyncAction( actionStr: string diff --git a/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts b/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts index 16b90e9921428..37929cf33c018 100644 --- a/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts +++ b/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts @@ -8,15 +8,15 @@ import moment from 'moment'; import { apiService } from './utils'; import { AnomalyRecords, AnomalyRecordsParams } from '../actions'; import { API_URLS, ML_JOB_ID, ML_MODULE_ID } from '../../../common/constants'; -import { MlCapabilitiesResponse } from '../../../../../../plugins/ml/common/types/capabilities'; +import { MlCapabilitiesResponse } from '../../../../../plugins/ml/common/types/capabilities'; import { CreateMLJobSuccess, DeleteJobResults, MonitorIdParam, HeartbeatIndicesParam, } from '../actions/types'; -import { DataRecognizerConfigResponse } from '../../../../../../plugins/ml/common/types/modules'; -import { JobExistResult } from '../../../../../../plugins/ml/common/types/data_recognizer'; +import { DataRecognizerConfigResponse } from '../../../../../plugins/ml/common/types/modules'; +import { JobExistResult } from '../../../../../plugins/ml/common/types/data_recognizer'; export const getMLJobId = (monitorId: string) => `${monitorId}_${ML_JOB_ID}`.toLowerCase(); diff --git a/x-pack/plugins/uptime/public/state/api/utils.ts b/x-pack/plugins/uptime/public/state/api/utils.ts index e67efa8570c11..acd9bec5a74bc 100644 --- a/x-pack/plugins/uptime/public/state/api/utils.ts +++ b/x-pack/plugins/uptime/public/state/api/utils.ts @@ -6,7 +6,7 @@ import { PathReporter } from 'io-ts/lib/PathReporter'; import { isRight } from 'fp-ts/lib/Either'; -import { HttpFetchQuery, HttpSetup } from '../../../../../../../target/types/core/public'; +import { HttpFetchQuery, HttpSetup } from '../../../../../../target/types/core/public'; class ApiService { private static instance: ApiService; diff --git a/x-pack/plugins/uptime/public/state/effects/fetch_effect.ts b/x-pack/plugins/uptime/public/state/effects/fetch_effect.ts index b0734cb5ccabb..0aa85609fe4f0 100644 --- a/x-pack/plugins/uptime/public/state/effects/fetch_effect.ts +++ b/x-pack/plugins/uptime/public/state/effects/fetch_effect.ts @@ -6,7 +6,7 @@ import { call, put } from 'redux-saga/effects'; import { Action } from 'redux-actions'; -import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; +import { IHttpFetchError } from '../../../../../../target/types/core/public/http'; /** * Factory function for a fetch effect. It expects three action creators, diff --git a/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts b/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts index bc482e2f35c45..b357f5a904ea6 100644 --- a/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts +++ b/x-pack/plugins/uptime/public/state/reducers/index_pattern.ts @@ -5,7 +5,7 @@ */ import { handleActions, Action } from 'redux-actions'; import { getIndexPattern, getIndexPatternSuccess, getIndexPatternFail } from '../actions'; -import { IIndexPattern } from '../../../../../../../src/plugins/data/common/index_patterns'; +import { IIndexPattern } from '../../../../../../src/plugins/data/common/index_patterns'; export interface IndexPatternState { index_pattern: IIndexPattern | null; diff --git a/x-pack/plugins/uptime/public/state/reducers/ml_anomaly.ts b/x-pack/plugins/uptime/public/state/reducers/ml_anomaly.ts index df5e825c3488b..61e03a9592921 100644 --- a/x-pack/plugins/uptime/public/state/reducers/ml_anomaly.ts +++ b/x-pack/plugins/uptime/public/state/reducers/ml_anomaly.ts @@ -15,11 +15,11 @@ import { getMLCapabilitiesAction, } from '../actions'; import { getAsyncInitialState, handleAsyncAction } from './utils'; -import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; +import { IHttpFetchError } from '../../../../../../target/types/core/public/http'; import { AsyncInitialState } from './types'; -import { MlCapabilitiesResponse } from '../../../../../../plugins/ml/common/types/capabilities'; +import { MlCapabilitiesResponse } from '../../../../../plugins/ml/common/types/capabilities'; import { CreateMLJobSuccess, DeleteJobResults } from '../actions/types'; -import { JobExistResult } from '../../../../../../plugins/ml/common/types/data_recognizer'; +import { JobExistResult } from '../../../../../plugins/ml/common/types/data_recognizer'; export interface MLJobState { mlJob: AsyncInitialState; diff --git a/x-pack/plugins/uptime/public/state/reducers/types.ts b/x-pack/plugins/uptime/public/state/reducers/types.ts index 88995a2f5dd70..c81ee6875f305 100644 --- a/x-pack/plugins/uptime/public/state/reducers/types.ts +++ b/x-pack/plugins/uptime/public/state/reducers/types.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; +import { IHttpFetchError } from '../../../../../../target/types/core/public/http'; export interface AsyncInitialState { data: ReduceStateType | null; diff --git a/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts b/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts index f841aedb0ac6b..988cfb4ed285c 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts @@ -16,7 +16,7 @@ import { AlertType } from '../../../../../alerting/server'; import { IRouter } from 'kibana/server'; import { UMServerLibs } from '../../lib'; import { UptimeCoreSetup } from '../../adapters'; -import { DYNAMIC_SETTINGS_DEFAULTS, defaultDynamicSettings } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; import { alertsMock, AlertServicesMock } from '../../../../../alerting/server/mocks'; /** @@ -27,10 +27,10 @@ import { alertsMock, AlertServicesMock } from '../../../../../alerting/server/mo * so we don't have to mock them all for each test. */ const bootstrapDependencies = (customRequests?: any) => { - const route: IRouter = {} as IRouter; + const router: IRouter = {} as IRouter; // these server/libs parameters don't have any functionality, which is fine // because we aren't testing them here - const server: UptimeCoreSetup = { route }; + const server: UptimeCoreSetup = { router }; const libs: UMServerLibs = { requests: {} } as UMServerLibs; libs.requests = { ...libs.requests, ...customRequests }; return { server, libs }; diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_latest_monitor.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_latest_monitor.test.ts index 138eb4a2b1266..061312ce4706a 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_latest_monitor.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_latest_monitor.test.ts @@ -5,7 +5,7 @@ */ import { getLatestMonitor } from '../get_latest_monitor'; -import { DYNAMIC_SETTINGS_DEFAULTS, defaultDynamicSettings } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; describe('getLatestMonitor', () => { let expectedGetLatestSearchParams: any; diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts index 01732db8b3d12..bec14556c647a 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts @@ -7,7 +7,7 @@ import { set } from 'lodash'; import mockChartsData from './monitor_charts_mock.json'; import { getMonitorDurationChart } from '../get_monitor_duration'; -import { DYNAMIC_SETTINGS_DEFAULTS, defaultDynamicSettings } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; describe('ElasticsearchMonitorsAdapter', () => { it('getMonitorChartsData will provide expected filters', async () => { diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts index e9d595744cfd9..a81efc603ac13 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts @@ -5,7 +5,7 @@ */ import { getPingHistogram } from '../get_ping_histogram'; -import { DYNAMIC_SETTINGS_DEFAULTS, defaultDynamicSettings } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; describe('getPingHistogram', () => { const standardMockResponse: any = { diff --git a/x-pack/plugins/uptime/server/lib/requests/get_certs.ts b/x-pack/plugins/uptime/server/lib/requests/get_certs.ts index 4f99fbe94d54c..c3f14fc517730 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_certs.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_certs.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { Cert, GetCertsParams } from '../../../../../legacy/plugins/uptime/common/runtime_types'; +import { Cert, GetCertsParams } from '../../../common'; export const getCerts: UMElasticsearchQueryFn = async ({ callES, diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts index 70a909315875a..4fadf9035dd90 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts @@ -5,7 +5,6 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { getHistogramIntervalFormatted } from '../helper'; import { LocationDurationLine, MonitorDurationResult, QUERY } from '../../../common'; export interface GetMonitorChartsParams { diff --git a/x-pack/plugins/uptime/server/plugin.ts b/x-pack/plugins/uptime/server/plugin.ts index 52dac2cbe6854..13d1ae216f204 100644 --- a/x-pack/plugins/uptime/server/plugin.ts +++ b/x-pack/plugins/uptime/server/plugin.ts @@ -15,11 +15,6 @@ import { initServerWithKibana } from './kibana.index'; import { KibanaTelemetryAdapter, UptimeCorePlugins } from './lib/adapters'; import { umDynamicSettings } from './lib/saved_objects'; -interface UptimePluginsSetup { - features: PluginSetupContract; - usageCollection: UsageCollectionSetup; -} - export class Plugin implements PluginType { private savedObjectsClient?: ISavedObjectsRepository; @@ -34,8 +29,8 @@ export class Plugin implements PluginType { ); } - public start(_core: CoreStart, _plugins: any) { - this.savedObjectsClient = _core.savedObjects.createInternalRepository(); + public start(core: CoreStart, _plugins: any) { + this.savedObjectsClient = core.savedObjects.createInternalRepository(); } public stop() {} diff --git a/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts b/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts deleted file mode 100644 index b529162823998..0000000000000 --- a/x-pack/test/api_integration/apis/uptime/graphql/monitor_states.ts +++ /dev/null @@ -1,245 +0,0 @@ -/* - * 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 expect from '@kbn/expect'; -import { expectFixtureEql } from './helpers/expect_fixture_eql'; -import { FtrProviderContext } from '../../../ftr_provider_context'; -import { makeChecksWithStatus } from './helpers/make_checks'; -import { monitorStatesQueryString } from '../../../../../plugins/uptime/public/queries/monitor_states_query'; -import { MonitorSummary } from '../../../../../plugins/uptime/common/graphql/types'; - -export default function({ getService }: FtrProviderContext) { - const supertest = getService('supertest'); - let dateRangeStart: string; - let dateRangeEnd: string; - - const getMonitorStates = async (variables: { [key: string]: any } = {}) => { - const query = { - operationName: 'MonitorStates', - query: monitorStatesQueryString, - variables: { - dateRangeStart, - dateRangeEnd, - pageSize: 10, - ...variables, - }, - }; - - const { - body: { data }, - } = await supertest - .post('/api/uptime/graphql') - .set('kbn-xsrf', 'foo') - .send({ ...query }); - - return data; - }; - - describe('monitor states', async () => { - describe('with real world data', () => { - before('load heartbeat data', () => getService('esArchiver').load('uptime/full_heartbeat')); - after('unload heartbeat index', () => - getService('esArchiver').unload('uptime/full_heartbeat') - ); - - before('set start/end', () => { - dateRangeStart = '2019-09-11T03:31:04.380Z'; - dateRangeEnd = '2019-09-11T03:40:34.410Z'; - }); - - it('will fetch monitor state data for the given filters and range', async () => { - const data: any = await getMonitorStates({ - statusFilter: 'up', - filters: - '{"bool":{"must":[{"match":{"monitor.id":{"query":"0002-up","operator":"and"}}}]}}', - }); - // await new Promise(r => setTimeout(r, 90000)); - expectFixtureEql(data, 'monitor_states_id_filtered'); - }); - - it('will fetch monitor state data for the given date range', async () => { - expectFixtureEql(await getMonitorStates(), 'monitor_states'); - }); - - it('can navigate forward and backward using pagination', async () => { - const expectedResultsCount = 100; - const expectedPageCount = expectedResultsCount / 10; - - let pagination: string | null = null; - for (let page = 1; page <= expectedPageCount; page++) { - const data: any = await getMonitorStates({ pagination }); - pagination = data.monitorStates.nextPagePagination; - expectFixtureEql(data, `monitor_states_page_${page}`); - - // Test to see if the previous page pagination works on every page (other than the first) - if (page > 1) { - const prevData = await getMonitorStates({ - pagination: data.monitorStates.prevPagePagination, - }); - expectFixtureEql(prevData, `monitor_states_page_${page}_previous`); - } - } - }); - }); - - describe('monitor state scoping', async () => { - const numIps = 4; // Must be > 2 for IP uniqueness checks - - before('load heartbeat data', () => getService('esArchiver').load('uptime/blank')); - after('unload heartbeat index', () => getService('esArchiver').unload('uptime/blank')); - - describe('query document scoping with mismatched check statuses', async () => { - let checks: any[] = []; - let nonSummaryIp: string | null = null; - const testMonitorId = 'scope-test-id'; - const makeApiParams = (monitorId: string, filterClauses: any[] = []): any => { - return { - filters: JSON.stringify({ - bool: { - filter: [{ match: { 'monitor.id': monitorId } }, ...filterClauses], - }, - }), - }; - }; - - before(async () => { - const es = getService('legacyEs'); - dateRangeStart = new Date().toISOString(); - checks = await makeChecksWithStatus(es, testMonitorId, 1, numIps, 1, {}, 'up', d => { - // turn an all up status into having at least one down - if (d.summary) { - d.monitor.status = 'down'; - d.summary.up--; - d.summary.down++; - } - return d; - }); - - dateRangeEnd = new Date().toISOString(); - nonSummaryIp = checks[0][0].monitor.ip; - }); - - it('should return all IPs', async () => { - const res = await getMonitorStates(makeApiParams(testMonitorId)); - - const uniqueIps = new Set(); - res.monitorStates.summaries[0].state.checks.forEach((c: any) => - uniqueIps.add(c.monitor.ip) - ); - - expect(uniqueIps.size).to.eql(4); - }); - - it('should match non summary documents without a status filter', async () => { - const params = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); - - const nonSummaryRes = await getMonitorStates(params); - expect(nonSummaryRes.monitorStates.summaries.length).to.eql(1); - }); - - it('should not match non summary documents if the check status does not match the document status', async () => { - const params = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); - params.statusFilter = 'down'; - - const nonSummaryRes = await getMonitorStates(params); - expect(nonSummaryRes.monitorStates.summaries.length).to.eql(0); - }); - - it('should not non match non summary documents if the check status does not match', async () => { - const params = makeApiParams(testMonitorId, [{ match: { 'monitor.ip': nonSummaryIp } }]); - params.statusFilter = 'up'; - - const nonSummaryRes = await getMonitorStates(params); - expect(nonSummaryRes.monitorStates.summaries.length).to.eql(0); - }); - - describe('matching outside of the date range', async () => { - before('set date range to future', () => { - const futureDate = new Date(); - - // Set dateRangeStart to one day from now - futureDate.setDate(futureDate.getDate() + 1); - dateRangeStart = futureDate.toISOString(); - - // Set dateRangeStart to two days from now - futureDate.setDate(futureDate.getDate() + 1); - dateRangeEnd = futureDate.toISOString(); - }); - - it('should not match any documents', async () => { - const params = makeApiParams(testMonitorId); - params.statusFilter = 'up'; - - const nonSummaryRes = await getMonitorStates(params); - expect(nonSummaryRes.monitorStates.summaries.length).to.eql(0); - }); - }); - }); - }); - - describe(' test status filter', async () => { - const upMonitorId = 'up-test-id'; - const downMonitorId = 'down-test-id'; - const mixMonitorId = 'mix-test-id'; - before('generate three monitors with up, down, mix state', async () => { - await getService('esArchiver').load('uptime/blank'); - - const es = getService('legacyEs'); - - const observer = { - geo: { - name: 'US-East', - location: '40.7128, -74.0060', - }, - }; - - // Generating three monitors each with two geo locations, - // One in a down state , - // One in an up state, - // One in a mix state - - dateRangeStart = new Date().toISOString(); - - await makeChecksWithStatus(es, upMonitorId, 1, 4, 1, {}, 'up'); - await makeChecksWithStatus(es, upMonitorId, 1, 4, 1, { observer }, 'up'); - - await makeChecksWithStatus(es, downMonitorId, 1, 4, 1, {}, 'down'); - await makeChecksWithStatus(es, downMonitorId, 1, 4, 1, { observer }, 'down'); - - await makeChecksWithStatus(es, mixMonitorId, 1, 4, 1, {}, 'up'); - await makeChecksWithStatus(es, mixMonitorId, 1, 4, 1, { observer }, 'down'); - - dateRangeEnd = new Date().toISOString(); - }); - - after('unload heartbeat index', () => getService('esArchiver').unload('uptime/blank')); - - it('should return all monitor when no status filter', async () => { - const { monitorStates } = await getMonitorStates({}); - expect(monitorStates.summaries.length).to.eql(3); - // Summaries are by default sorted by monitor names - expect( - monitorStates.summaries.map((summary: MonitorSummary) => summary.monitor_id) - ).to.eql([downMonitorId, mixMonitorId, upMonitorId]); - }); - - it('should return a monitor with mix state if check status filter is down', async () => { - const { monitorStates } = await getMonitorStates({ statusFilter: 'down' }); - expect(monitorStates.summaries.length).to.eql(2); - monitorStates.summaries.forEach((summary: MonitorSummary) => { - expect(summary.monitor_id).to.not.eql(upMonitorId); - }); - }); - - it('should not return a monitor with mix state if check status filter is up', async () => { - const { monitorStates } = await getMonitorStates({ statusFilter: 'up' }); - - expect(monitorStates.summaries.length).to.eql(1); - expect(monitorStates.summaries[0].monitor_id).to.eql(upMonitorId); - }); - }); - }); -} diff --git a/x-pack/test/api_integration/apis/uptime/rest/certs.ts b/x-pack/test/api_integration/apis/uptime/rest/certs.ts index 7510ea3f34d28..9935962fb65c2 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/certs.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/certs.ts @@ -8,8 +8,7 @@ import expect from '@kbn/expect'; import moment from 'moment'; import { isRight } from 'fp-ts/lib/Either'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; -import { CertType } from '../../../../../legacy/plugins/uptime/common/runtime_types'; +import { API_URLS, CertType } from '../../../../../plugins/uptime/common'; import { makeChecksWithStatus } from './helper/make_checks'; export default function({ getService }: FtrProviderContext) { diff --git a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts index 29cbbf0c40994..eb4f14a0d8a61 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts @@ -5,7 +5,7 @@ */ import { FtrProviderContext } from '../../../ftr_provider_context'; import { expectFixtureEql } from './helper/expect_fixture_eql'; -import { API_URLS } from '../../../../../../plugins/uptime/common'; +import { API_URLS } from '../../../../../plugins/uptime/common'; export default function({ getService }: FtrProviderContext) { describe('docCount query', () => { diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts index 3c17370532f91..ef75969a7a4dc 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts @@ -7,8 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { makeChecksWithStatus } from './helper/make_checks'; -import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; -import { MonitorSummary } from '../../../../../legacy/plugins/uptime/common/runtime_types'; +import { API_URLS, MonitorSummary } from '../../../../../plugins/uptime/common'; export default function({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts index f1e37bff405fd..e8c4b14bae06d 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts @@ -7,8 +7,7 @@ import expect from '@kbn/expect'; import { isRight } from 'fp-ts/lib/Either'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; -import { MonitorSummaryResultType } from '../../../../../legacy/plugins/uptime/common/runtime_types'; +import { API_URLS, MonitorSummaryResultType } from '../../../../../plugins/uptime/common'; interface ExpectedMonitorStatesPage { response: any; diff --git a/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts b/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts index a261763d5991f..783d43ff24222 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { isLeft } from 'fp-ts/lib/Either'; import { PathReporter } from 'io-ts/lib/PathReporter'; -import { PingsResponseType } from '../../../../../legacy/plugins/uptime/common/runtime_types'; +import { PingsResponseType } from '../../../../../plugins/uptime/common'; import { FtrProviderContext } from '../../../ftr_provider_context'; function decodePingsResponseData(response: any) { diff --git a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts index 017ef02afe5ea..7470d99c9e213 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { API_URLS } from '../../../../../legacy/plugins/uptime/common/constants'; +import { API_URLS } from '../../../../../plugins/uptime/common'; import { makeChecksWithStatus } from './helper/make_checks'; export default function({ getService }: FtrProviderContext) { diff --git a/x-pack/test/functional/services/uptime/settings.ts b/x-pack/test/functional/services/uptime/settings.ts index 9719152b62d35..f4b5c475ec206 100644 --- a/x-pack/test/functional/services/uptime/settings.ts +++ b/x-pack/test/functional/services/uptime/settings.ts @@ -5,7 +5,7 @@ */ import { FtrProviderContext } from '../../ftr_provider_context'; -import { DynamicSettings } from '../../../../legacy/plugins/uptime/common/runtime_types'; +import { DynamicSettings } from '../../../../plugins/uptime/common'; export function UptimeSettingsProvider({ getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); From 8794013fbeef776c6abdb504e10da1c17796c651 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Fri, 24 Apr 2020 19:35:01 -0400 Subject: [PATCH 26/36] Clean up redundant common imports. --- .../common/charts/__tests__/duration_charts.test.tsx | 2 +- .../common/charts/__tests__/monitor_bar_series.test.tsx | 2 +- .../public/components/common/charts/duration_chart.tsx | 2 +- .../components/common/charts/duration_line_series_list.tsx | 2 +- .../public/components/common/charts/monitor_bar_series.tsx | 2 +- .../public/components/common/charts/ping_histogram.tsx | 2 +- .../uptime/public/components/common/uptime_date_picker.tsx | 2 +- .../monitor/location_map/__tests__/location_map.test.tsx | 2 +- .../location_map/__tests__/location_status_tags.test.tsx | 2 +- .../monitor/location_map/embeddables/embedded_map.tsx | 2 +- .../public/components/monitor/location_map/location_map.tsx | 3 +-- .../monitor/location_map/location_status_tags.tsx | 3 +-- .../components/monitor/ml/__tests__/ml_flyout.test.tsx | 2 +- .../public/components/monitor/ml/ml_flyout_container.tsx | 2 +- .../monitor/monitor_duration/monitor_duration.tsx | 2 +- .../monitor/monitor_duration/monitor_duration_container.tsx | 2 +- .../__test__/monitor_ssl_certificate.test.tsx | 2 +- .../__test__/monitor_status.bar.test.tsx | 2 +- .../__test__/status_by_location.test.tsx | 2 +- .../monitor_status_bar/ssl_certificate.tsx | 2 +- .../monitor_status_bar/status_bar.tsx | 3 +-- .../monitor_status_bar/status_bar_container.tsx | 2 +- .../monitor_status_bar/status_by_location.tsx | 2 +- .../monitor/monitor_status_details/status_details.tsx | 2 +- .../monitor_status_details/status_details_container.tsx | 2 +- .../monitor/ping_list/__tests__/expanded_row.test.tsx | 2 +- .../monitor/ping_list/__tests__/ping_list.test.tsx | 2 +- .../public/components/monitor/ping_list/expanded_row.tsx | 2 +- .../public/components/monitor/ping_list/ping_list.tsx | 2 +- .../components/monitor/ping_list/ping_list_container.tsx | 2 +- .../public/components/overview/__tests__/snapshot.test.tsx | 2 +- .../overview/empty_state/__tests__/empty_state.test.tsx | 2 +- .../overview/empty_state/data_or_index_missing.tsx | 2 +- .../public/components/overview/empty_state/empty_state.tsx | 2 +- .../components/overview/filter_group/filter_group.tsx | 2 +- .../overview/filter_group/filter_group_container.tsx | 2 +- .../overview/monitor_list/__tests__/monitor_list.test.tsx | 6 +----- .../__tests__/monitor_list_status_column.test.tsx | 3 +-- .../components/overview/monitor_list/monitor_list.tsx | 4 ++-- .../overview/monitor_list/monitor_list_container.tsx | 2 +- .../__tests__/integration_group.test.tsx | 2 +- .../__tests__/monitor_list_drawer.test.tsx | 2 +- .../__tests__/monitor_status_list.test.tsx | 2 +- .../__tests__/most_recent_error.test.tsx | 2 +- .../monitor_list_drawer/actions_popover/actions_popover.tsx | 2 +- .../actions_popover/integration_group.tsx | 2 +- .../monitor_list_drawer/list_drawer_container.tsx | 2 +- .../monitor_list_drawer/monitor_list_drawer.tsx | 2 +- .../monitor_list_drawer/monitor_status_list.tsx | 3 +-- .../monitor_list/monitor_list_drawer/monitor_status_row.tsx | 2 +- .../monitor_list/monitor_list_drawer/most_recent_error.tsx | 2 +- .../overview/monitor_list/monitor_list_status_column.tsx | 4 ++-- .../uptime/public/components/overview/snapshot/snapshot.tsx | 2 +- .../uptime/public/components/settings/certificate_form.tsx | 4 ++-- .../uptime/public/components/settings/indices_form.tsx | 2 +- .../uptime/public/contexts/uptime_settings_context.tsx | 2 +- .../uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx | 2 +- x-pack/plugins/uptime/public/hooks/use_telemetry.ts | 2 +- .../public/lib/adapters/framework/new_platform_adapter.tsx | 2 +- .../uptime/public/lib/helper/charts/get_chart_date_label.ts | 2 +- .../uptime/public/lib/helper/charts/get_label_format.ts | 2 +- .../__tests__/get_apm_href.test.ts | 2 +- .../__tests__/get_infra_href.test.ts | 2 +- .../__tests__/get_logging_href.test.ts | 2 +- .../lib/helper/observability_integration/build_href.ts | 2 +- .../lib/helper/observability_integration/get_apm_href.ts | 2 +- .../lib/helper/observability_integration/get_infra_href.ts | 2 +- .../helper/observability_integration/get_logging_href.ts | 2 +- .../uptime/public/lib/helper/series_has_down_values.ts | 2 +- .../uptime/public/lib/helper/stringify_url_params.ts | 2 +- .../url_params/__tests__/get_supported_url_params.test.ts | 2 +- .../lib/helper/url_params/get_supported_url_params.ts | 2 +- x-pack/plugins/uptime/public/pages/page_header.tsx | 2 +- x-pack/plugins/uptime/public/pages/settings.tsx | 4 ++-- x-pack/plugins/uptime/public/routes.tsx | 2 +- .../plugins/uptime/public/state/actions/dynamic_settings.ts | 2 +- x-pack/plugins/uptime/public/state/actions/index_status.ts | 2 +- x-pack/plugins/uptime/public/state/actions/monitor.ts | 4 ++-- x-pack/plugins/uptime/public/state/actions/monitor_list.ts | 2 +- .../plugins/uptime/public/state/actions/monitor_status.ts | 2 +- .../plugins/uptime/public/state/actions/overview_filters.ts | 2 +- x-pack/plugins/uptime/public/state/actions/ping.ts | 2 +- x-pack/plugins/uptime/public/state/actions/snapshot.ts | 2 +- x-pack/plugins/uptime/public/state/api/dynamic_settings.ts | 2 +- x-pack/plugins/uptime/public/state/api/index_pattern.ts | 2 +- x-pack/plugins/uptime/public/state/api/index_status.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/ml_anomaly.ts | 2 +- x-pack/plugins/uptime/public/state/api/monitor.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/monitor_duration.ts | 2 +- x-pack/plugins/uptime/public/state/api/monitor_list.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/monitor_status.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/overview_filters.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/ping.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/snapshot.ts | 4 ++-- .../public/state/effects/__tests__/fetch_effect.test.ts | 2 +- .../plugins/uptime/public/state/effects/dynamic_settings.ts | 2 +- .../uptime/public/state/reducers/dynamic_settings.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/index_status.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/monitor.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/monitor_list.ts | 2 +- .../plugins/uptime/public/state/reducers/monitor_status.ts | 2 +- .../uptime/public/state/reducers/overview_filters.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/ping.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/ping_list.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/snapshot.ts | 2 +- .../uptime/public/state/selectors/__tests__/index.test.ts | 2 +- x-pack/plugins/uptime/server/kibana.index.ts | 2 +- .../uptime/server/lib/adapters/framework/adapter_types.ts | 2 +- .../uptime/server/lib/requests/get_monitor_states.ts | 2 +- .../server/lib/requests/search/enrich_monitor_groups.ts | 2 +- .../uptime/server/rest_api/telemetry/log_page_view.ts | 2 +- 111 files changed, 123 insertions(+), 132 deletions(-) diff --git a/x-pack/plugins/uptime/public/components/common/charts/__tests__/duration_charts.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/__tests__/duration_charts.test.tsx index 589fbc6bceb45..019306842b48c 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/__tests__/duration_charts.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/__tests__/duration_charts.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import DateMath from '@elastic/datemath'; import { DurationChartComponent } from '../duration_chart'; -import { MonitorDurationResult } from '../../../../../common/types'; +import { MonitorDurationResult } from '../../../../../common'; import { shallowWithRouter } from '../../../../lib'; describe('MonitorCharts component', () => { diff --git a/x-pack/plugins/uptime/public/components/common/charts/__tests__/monitor_bar_series.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/__tests__/monitor_bar_series.test.tsx index 4522f8d633fa6..c43f07b7a1161 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/__tests__/monitor_bar_series.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/__tests__/monitor_bar_series.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MonitorBarSeries, MonitorBarSeriesProps } from '../monitor_bar_series'; import { renderWithRouter, shallowWithRouter } from '../../../../lib'; -import { HistogramPoint } from '../../../../../common/runtime_types'; +import { HistogramPoint } from '../../../../../common'; describe('MonitorBarSeries component', () => { let props: MonitorBarSeriesProps; diff --git a/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx b/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx index c82b2a1cf9fe2..e9903bd8a4005 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx @@ -10,7 +10,7 @@ import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n/react'; import { Axis, Chart, Position, timeFormatter, Settings, SeriesIdentifier } from '@elastic/charts'; import { getChartDateLabel } from '../../../lib/helper'; -import { LocationDurationLine } from '../../../../common/types'; +import { LocationDurationLine } from '../../../../common'; import { DurationLineSeriesList } from './duration_line_series_list'; import { ChartWrapper } from './chart_wrapper'; import { useUrlParams } from '../../../hooks'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/duration_line_series_list.tsx b/x-pack/plugins/uptime/public/components/common/charts/duration_line_series_list.tsx index 4223e918393b6..6e777ccdc089b 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/duration_line_series_list.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/duration_line_series_list.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { LineSeries, CurveType } from '@elastic/charts'; -import { LocationDurationLine } from '../../../../common/types'; +import { LocationDurationLine } from '../../../../common'; import { convertMicrosecondsToMilliseconds as microsToMillis } from '../../../lib/helper'; interface Props { diff --git a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx index 5e11685e36140..87e6574e88a12 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx @@ -18,7 +18,7 @@ import React, { useContext } from 'react'; import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiText, EuiToolTip } from '@elastic/eui'; -import { HistogramPoint } from '../../../../common/runtime_types'; +import { HistogramPoint } from '../../../../common'; import { getChartDateLabel, seriesHasDownValues } from '../../../lib/helper'; import { useUrlParams } from '../../../hooks'; import { UptimeThemeContext } from '../../../contexts'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx b/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx index 66e86d6731236..24b92ad35809c 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx @@ -13,7 +13,7 @@ import moment from 'moment'; import { getChartDateLabel } from '../../../lib/helper'; import { ChartWrapper } from './chart_wrapper'; import { UptimeThemeContext } from '../../../contexts'; -import { HistogramResult } from '../../../../common/runtime_types'; +import { HistogramResult } from '../../../../common'; import { useUrlParams } from '../../../hooks'; import { ChartEmptyState } from './chart_empty_state'; diff --git a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx index 4254004dba4e0..745b3cee98fa1 100644 --- a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx +++ b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx @@ -7,7 +7,7 @@ import React, { useContext } from 'react'; import { EuiSuperDatePicker } from '@elastic/eui'; import { useUrlParams } from '../../hooks'; -import { CLIENT_DEFAULTS } from '../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../common'; import { UptimeRefreshContext, UptimeSettingsContext } from '../../contexts'; // TODO: when EUI exports types for this, this should be replaced diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_map.test.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_map.test.tsx index 1913e677dd674..3e4cfae5fbd1e 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_map.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_map.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import { LocationMap } from '../location_map'; -import { MonitorLocations } from '../../../../../common/runtime_types'; +import { MonitorLocations } from '../../../../../common'; import { LocationMissingWarning } from '../location_missing'; // Note For shallow test, we need absolute time strings diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_status_tags.test.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_status_tags.test.tsx index 7dde38af99fc3..a4ed5418a1a55 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_status_tags.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_status_tags.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import moment from 'moment'; import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { MonitorLocation } from '../../../../../common/runtime_types/monitor'; +import { MonitorLocation } from '../../../../../common'; import { LocationStatusTags } from '../index'; describe('LocationStatusTags component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx index 06cdb07bd8bcd..906a3e0235199 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx @@ -9,7 +9,7 @@ import uuid from 'uuid'; import styled from 'styled-components'; import { MapEmbeddable, MapEmbeddableInput } from '../../../../../../../legacy/plugins/maps/public'; import * as i18n from './translations'; -import { Location } from '../../../../../common/runtime_types'; +import { Location } from '../../../../../common'; import { getLayerList } from './map_config'; import { UptimeThemeContext, UptimeStartupPluginsContext } from '../../../../contexts'; import { diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx index 27fe3a2274270..572cf9aa035b0 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx @@ -9,8 +9,7 @@ import styled from 'styled-components'; import { EuiFlexGroup, EuiFlexItem, EuiErrorBoundary, EuiHideFor } from '@elastic/eui'; import { LocationStatusTags } from './location_status_tags'; import { EmbeddedMap, LocationPoint } from './embeddables/embedded_map'; -import { MonitorLocations, MonitorLocation } from '../../../../common/runtime_types'; -import { UNNAMED_LOCATION } from '../../../../common/constants'; +import { UNNAMED_LOCATION, MonitorLocations, MonitorLocation } from '../../../../common'; import { LocationMissingWarning } from './location_missing'; // These height/width values are used to make sure map is in center of panel diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/location_status_tags.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/location_status_tags.tsx index 7f5f1d5c3b323..401cff2694865 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/location_status_tags.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/location_status_tags.tsx @@ -10,8 +10,7 @@ import styled from 'styled-components'; import { EuiBadge, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { UptimeThemeContext } from '../../../contexts'; -import { MonitorLocation } from '../../../../common/runtime_types'; -import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE } from '../../../../common/constants'; +import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE, MonitorLocation } from '../../../../common'; const TimeStampSpan = styled.span` display: inline-block; diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/ml_flyout.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/ml_flyout.test.tsx index 31cdcfac9feef..17cdea257767f 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/ml_flyout.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/ml_flyout.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import { MLFlyoutView } from '../ml_flyout'; import { UptimeSettingsContext } from '../../../../contexts'; -import { CLIENT_DEFAULTS } from '../../../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../../../common'; import { License } from '../../../../../../../plugins/licensing/common/license'; const expiredLicense = new License({ diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx index 6eec30d405f76..41f055491eca6 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx @@ -21,7 +21,7 @@ import { KibanaReactNotifications, } from '../../../../../../../src/plugins/kibana_react/public'; import { MLFlyoutView } from './ml_flyout'; -import { ML_JOB_ID } from '../../../../common/constants'; +import { ML_JOB_ID } from '../../../../common'; import { UptimeRefreshContext, UptimeSettingsContext } from '../../../contexts'; import { useGetUrlParams } from '../../../hooks'; import { getDynamicSettings } from '../../../state/actions/dynamic_settings'; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx index af1c8dbdc49e3..4d2045d1e0934 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiTitle } from '@elastic/eui'; -import { LocationDurationLine } from '../../../../common/types'; +import { LocationDurationLine } from '../../../../common'; import { MLIntegrationComponent } from '../ml/ml_integeration'; import { AnomalyRecords } from '../../../state/actions'; import { DurationChartComponent } from '../../common/charts'; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx index 52d4f620f84b3..4cc18fb7f2283 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx @@ -22,7 +22,7 @@ import { UptimeRefreshContext } from '../../../contexts'; import { getMLJobId } from '../../../state/api/ml_anomaly'; import { JobStat } from '../../../../../ml/common/types/data_recognizer'; import { MonitorDurationComponent } from './monitor_duration'; -import { MonitorIdParam } from '../../../../common/types'; +import { MonitorIdParam } from '../../../../common'; export const MonitorDuration: React.FC = ({ monitorId }) => { const { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_ssl_certificate.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_ssl_certificate.test.tsx index 57ed09cc30ef1..d3e11ffcaf117 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_ssl_certificate.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_ssl_certificate.test.tsx @@ -9,7 +9,7 @@ import moment from 'moment'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; import { EuiBadge } from '@elastic/eui'; import { renderWithIntl } from 'test_utils/enzyme_helpers'; -import { Tls } from '../../../../../common/runtime_types'; +import { Tls } from '../../../../../common'; import { MonitorSSLCertificate } from '../monitor_status_bar'; describe('MonitorStatusBar component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_status.bar.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_status.bar.test.tsx index 5fd32c808da42..ea4ef572a7d40 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_status.bar.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_status.bar.test.tsx @@ -8,7 +8,7 @@ import moment from 'moment'; import React from 'react'; import { renderWithIntl } from 'test_utils/enzyme_helpers'; import { MonitorStatusBarComponent } from '../monitor_status_bar'; -import { Ping } from '../../../../../common/runtime_types'; +import { Ping } from '../../../../../common'; describe('MonitorStatusBar component', () => { let monitorStatus: Ping; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/status_by_location.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/status_by_location.test.tsx index b2619825311d7..9b01b270d9bae 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/status_by_location.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/status_by_location.test.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { MonitorLocation } from '../../../../../common/runtime_types'; +import { MonitorLocation } from '../../../../../common'; import { StatusByLocations } from '../index'; describe('StatusByLocation component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/ssl_certificate.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/ssl_certificate.tsx index d92534aecd175..b2ed6419ac12b 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/ssl_certificate.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/ssl_certificate.tsx @@ -9,7 +9,7 @@ import moment from 'moment'; import { EuiSpacer, EuiText, EuiBadge } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { Tls } from '../../../../../common/runtime_types'; +import { Tls } from '../../../../../common'; interface Props { /** diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar.tsx index 36159dc29eccd..359e4f5a73e80 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar.tsx @@ -17,8 +17,7 @@ import { import { MonitorSSLCertificate } from './ssl_certificate'; import * as labels from './translations'; import { StatusByLocations } from './status_by_location'; -import { Ping } from '../../../../../common/runtime_types'; -import { MonitorLocations } from '../../../../../common/runtime_types'; +import { MonitorLocations, Ping } from '../../../../../common'; interface MonitorStatusBarProps { monitorId: string; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar_container.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar_container.tsx index 9562295437515..16fa53b028230 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar_container.tsx @@ -11,7 +11,7 @@ import { MonitorStatusBarComponent } from './index'; import { getMonitorStatusAction } from '../../../../state/actions'; import { useGetUrlParams } from '../../../../hooks'; import { UptimeRefreshContext } from '../../../../contexts'; -import { MonitorIdParam } from '../../../../../common/types'; +import { MonitorIdParam } from '../../../../../common'; import { AppState } from '../../../../state'; export const MonitorStatusBar: React.FC = ({ monitorId }) => { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_by_location.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_by_location.tsx index 461ffc10124fd..95cb02d470056 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_by_location.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_by_location.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { MonitorLocation } from '../../../../../common/runtime_types'; +import { MonitorLocation } from '../../../../../common'; interface StatusByLocationsProps { locations: MonitorLocation[]; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx index ebd16b05ecb4a..6bf91a2c155e1 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx @@ -9,7 +9,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; import styled from 'styled-components'; import { LocationMap } from '../location_map'; import { UptimeRefreshContext } from '../../../contexts'; -import { MonitorLocations } from '../../../../common/runtime_types'; +import { MonitorLocations } from '../../../../common'; import { MonitorStatusBar } from './monitor_status_bar'; interface MonitorStatusDetailsProps { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details_container.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details_container.tsx index 251f3562f9d1a..242004fb519a2 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details_container.tsx @@ -12,7 +12,7 @@ import { getMonitorLocationsAction } from '../../../state/actions/monitor'; import { MonitorStatusDetailsComponent } from './index'; import { UptimeRefreshContext } from '../../../contexts'; import { AppState } from '../../../state'; -import { MonitorIdParam } from '../../../../common/types'; +import { MonitorIdParam } from '../../../../common'; export const MonitorStatusDetails: React.FC = ({ monitorId }) => { const { lastRefresh } = useContext(UptimeRefreshContext); diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/expanded_row.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/expanded_row.test.tsx index 2c1434cfd64bd..0b0edaaab6cb5 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/expanded_row.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/expanded_row.test.tsx @@ -7,7 +7,7 @@ import { mountWithIntl, renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import React from 'react'; import { PingListExpandedRowComponent } from '../expanded_row'; -import { Ping } from '../../../../../common/runtime_types'; +import { Ping } from '../../../../../common'; import { DocLinkForBody } from '../doc_link_body'; describe('PingListExpandedRow', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/ping_list.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/ping_list.test.tsx index cb8413ba08a81..4cc80655884b3 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/ping_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/ping_list.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import { PingListComponent, toggleDetails } from '../ping_list'; -import { Ping, PingsResponse } from '../../../../../common/runtime_types'; +import { Ping, PingsResponse } from '../../../../../common'; import { ExpandedRowMap } from '../../../overview/monitor_list/types'; describe('PingList component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.tsx index 28b96fcb1bf7b..80c8037cf7313 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { Ping, HttpResponseBody } from '../../../../common/runtime_types'; +import { Ping, HttpResponseBody } from '../../../../common'; import { DocLinkForBody } from './doc_link_body'; interface Props { diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list.tsx index 5dfc1c0647430..9ba35008b31d3 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list.tsx @@ -23,7 +23,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import moment from 'moment'; import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; -import { Ping, GetPingsParams, DateRange } from '../../../../common/runtime_types'; +import { Ping, GetPingsParams, DateRange } from '../../../../common'; import { convertMicrosecondsToMilliseconds as microsToMillis } from '../../../lib/helper'; import { LocationName } from './location_name'; import { Pagination } from '../../overview/monitor_list'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx index 3c3caab365e3a..03fb237a9dd7c 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx @@ -8,7 +8,7 @@ import { useSelector, useDispatch } from 'react-redux'; import React, { useContext, useCallback } from 'react'; import { selectPingList } from '../../../state/selectors'; import { getPings } from '../../../state/actions'; -import { GetPingsParams } from '../../../../common/runtime_types'; +import { GetPingsParams } from '../../../../common'; import { UptimeSettingsContext } from '../../../contexts'; import { PingListComponent } from './index'; diff --git a/x-pack/plugins/uptime/public/components/overview/__tests__/snapshot.test.tsx b/x-pack/plugins/uptime/public/components/overview/__tests__/snapshot.test.tsx index cfcab673dcb35..6d01a74fb49bf 100644 --- a/x-pack/plugins/uptime/public/components/overview/__tests__/snapshot.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/__tests__/snapshot.test.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { Snapshot } from '../../../../common/runtime_types'; +import { Snapshot } from '../../../../common'; import { SnapshotComponent } from '../snapshot/snapshot'; describe('Snapshot component', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/empty_state.test.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/empty_state.test.tsx index 6328789d03f29..968f6d10622df 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/empty_state.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/empty_state.test.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { EmptyStateComponent } from '../empty_state'; -import { StatesIndexStatus } from '../../../../../common/runtime_types'; +import { StatesIndexStatus } from '../../../../../common'; import { HttpFetchError, IHttpFetchError } from 'src/core/public'; import { mountWithRouter, shallowWithRouter } from '../../../../lib'; diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/data_or_index_missing.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/data_or_index_missing.tsx index 88c0920138f68..f990e68b11f6a 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/data_or_index_missing.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/data_or_index_missing.tsx @@ -16,7 +16,7 @@ import { import { FormattedMessage } from '@kbn/i18n/react'; import React, { useContext } from 'react'; import { UptimeSettingsContext } from '../../../contexts'; -import { DynamicSettings } from '../../../../common/runtime_types'; +import { DynamicSettings } from '../../../../common'; interface DataMissingProps { headingMessage: JSX.Element; diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx index d38f203739cea..ad79825b246dc 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx @@ -9,7 +9,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { EmptyStateError } from './empty_state_error'; import { EmptyStateLoading } from './empty_state_loading'; import { DataOrIndexMissing } from './data_or_index_missing'; -import { DynamicSettings, StatesIndexStatus } from '../../../../common/runtime_types'; +import { DynamicSettings, StatesIndexStatus } from '../../../../common'; import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; interface EmptyStateProps { diff --git a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx index ff73554c8f07c..3dd2917f65201 100644 --- a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx +++ b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx @@ -9,7 +9,7 @@ import { EuiFilterGroup } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FilterPopoverProps, FilterPopover } from './filter_popover'; import { FilterStatusButton } from './filter_status_button'; -import { OverviewFilters } from '../../../../common/runtime_types/overview_filters'; +import { OverviewFilters } from '../../../../common'; interface PresentationalComponentProps { loading: boolean; diff --git a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx index 3612604fdf116..2934525146003 100644 --- a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx @@ -11,7 +11,7 @@ import { parseFiltersMap } from './parse_filter_map'; import { AppState } from '../../../state'; import { fetchOverviewFilters, GetOverviewFiltersPayload } from '../../../state/actions'; import { FilterGroupComponent } from './index'; -import { OverviewFilters } from '../../../../common/runtime_types/overview_filters'; +import { OverviewFilters } from '../../../../common'; import { UptimeRefreshContext } from '../../../contexts'; interface OwnProps { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx index 9b1d799a23e37..c8d23adc8b6a4 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx @@ -5,11 +5,7 @@ */ import React from 'react'; -import { - MonitorSummaryResult, - CursorDirection, - SortOrder, -} from '../../../../../common/runtime_types'; +import { MonitorSummaryResult, CursorDirection, SortOrder } from '../../../../../common'; import { MonitorListComponent } from '../monitor_list'; import { renderWithRouter, shallowWithRouter } from '../../../../lib'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list_status_column.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list_status_column.test.tsx index d765c0b33ea4b..34c5ff47dc54e 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list_status_column.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list_status_column.test.tsx @@ -8,8 +8,7 @@ import React from 'react'; import moment from 'moment'; import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import { getLocationStatus, MonitorListStatusColumn } from '../monitor_list_status_column'; -import { Check } from '../../../../../common/runtime_types'; -import { STATUS } from '../../../../../common/constants'; +import { STATUS, Check } from '../../../../../common'; describe('MonitorListStatusColumn', () => { beforeAll(() => { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx index 7e9536689470e..21199e7f15d48 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx @@ -18,8 +18,8 @@ import { import { FormattedMessage } from '@kbn/i18n/react'; import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; -import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types'; -import { MonitorSummary } from '../../../../common/runtime_types'; +import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common'; +import { MonitorSummary } from '../../../../common'; import { MonitorListStatusColumn } from './monitor_list_status_column'; import { ExpandedRowMap } from './types'; import { MonitorBarSeries } from '../../common/charts'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx index 6fb880e28c734..610a19a6ee3d7 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx @@ -7,7 +7,7 @@ import React, { useCallback } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { getMonitorList } from '../../../state/actions'; -import { FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types'; +import { FetchMonitorStatesQueryArgs } from '../../../../common'; import { monitorListSelector } from '../../../state/selectors'; import { MonitorListComponent } from './monitor_list'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx index 25cf400bcd0fd..fd6ba696814e6 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx @@ -5,7 +5,7 @@ */ import React from 'react'; -import { MonitorSummary } from '../../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../../common'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import { IntegrationGroup } from '../actions_popover/integration_group'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx index 4bc0c3f0a40ba..a68967307f15c 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx @@ -6,7 +6,7 @@ import 'jest'; import React from 'react'; import { MonitorListDrawerComponent } from '../monitor_list_drawer'; -import { Check, MonitorDetails, MonitorSummary } from '../../../../../../common/runtime_types'; +import { Check, MonitorDetails, MonitorSummary } from '../../../../../../common'; import { shallowWithRouter } from '../../../../../lib'; describe('MonitorListDrawer component', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx index c7f3aef4075e1..4d6eb7bf1b6e9 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx @@ -8,7 +8,7 @@ import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import React from 'react'; import moment from 'moment'; import { MonitorStatusList } from '../monitor_status_list'; -import { Check } from '../../../../../../common/runtime_types'; +import { Check } from '../../../../../../common'; describe('MonitorStatusList component', () => { let checks: Check[]; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx index 173809b2d7f73..0dbd24a52cc05 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import moment from 'moment'; import { BrowserRouter as Router } from 'react-router-dom'; import { MostRecentError } from '../most_recent_error'; -import { MonitorDetails, MonitorError } from '../../../../../../common/runtime_types'; +import { MonitorDetails, MonitorError } from '../../../../../../common'; describe('MostRecentError component', () => { let monitorDetails: MonitorDetails; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx index e86e6b309214f..b64197660875b 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { EuiPopover, EuiButton } from '@elastic/eui'; import { IntegrationGroup } from './integration_group'; -import { MonitorSummary } from '../../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../../common'; import { toggleIntegrationsPopover, PopoverState } from '../../../../../state/actions'; interface ActionsPopoverProps { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx index bbcba7238748d..4144742ce7d51 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx @@ -19,7 +19,7 @@ import { getLoggingIpHref, getLoggingKubernetesHref, } from '../../../../../lib/helper'; -import { MonitorSummary } from '../../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../../common'; import { UptimeSettingsContext } from '../../../../../contexts'; interface IntegrationGroupProps { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx index bec32ace27f2b..cf61ece47fffd 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx @@ -12,7 +12,7 @@ import { MonitorDetailsActionPayload } from '../../../../state/actions/types'; import { getMonitorDetailsAction } from '../../../../state/actions/monitor'; import { MonitorListDrawerComponent } from './monitor_list_drawer'; import { useGetUrlParams } from '../../../../hooks'; -import { MonitorDetails, MonitorSummary } from '../../../../../common/runtime_types'; +import { MonitorDetails, MonitorSummary } from '../../../../../common'; interface ContainerProps { summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx index 8e97ce4d692d7..1108320b933f7 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx @@ -9,7 +9,7 @@ import styled from 'styled-components'; import { EuiLink, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText } from '@elastic/eui'; import { MostRecentError } from './most_recent_error'; import { MonitorStatusList } from './monitor_status_list'; -import { MonitorDetails, MonitorSummary } from '../../../../../common/runtime_types'; +import { MonitorDetails, MonitorSummary } from '../../../../../common'; import { ActionsPopover } from './actions_popover/actions_popover_container'; const ContainerDiv = styled.div` diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx index cd1a5a95b8adb..187671c19f207 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx @@ -10,8 +10,7 @@ import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { LocationLink } from '../../../common/location_link'; import { MonitorStatusRow } from './monitor_status_row'; -import { Check } from '../../../../../common/runtime_types'; -import { STATUS, UNNAMED_LOCATION } from '../../../../../common/constants'; +import { STATUS, UNNAMED_LOCATION, Check } from '../../../../../common'; interface MonitorStatusListProps { /** diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx index 50028e1ddea18..fe9fed5a13153 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx @@ -8,7 +8,7 @@ import React, { useContext } from 'react'; import { EuiHealth, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { UptimeThemeContext } from '../../../../contexts'; -import { UNNAMED_LOCATION, STATUS } from '../../../../../common/constants'; +import { UNNAMED_LOCATION, STATUS } from '../../../../../common'; interface MonitorStatusRowProps { /** diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx index 1963a9c852b11..404fa7c5f159d 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { MonitorPageLink } from '../monitor_page_link'; import { useGetUrlParams } from '../../../../hooks'; import { stringifyUrlParams } from '../../../../lib/helper/stringify_url_params'; -import { MonitorError } from '../../../../../common/runtime_types'; +import { MonitorError } from '../../../../../common'; interface MostRecentErrorProps { /** diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_status_column.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_status_column.tsx index 8076fe66cc208..2b89586a886b5 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_status_column.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_status_column.tsx @@ -11,13 +11,13 @@ import { capitalize } from 'lodash'; import styled from 'styled-components'; import { EuiHealth, EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip } from '@elastic/eui'; import { parseTimestamp } from './parse_timestamp'; -import { Check } from '../../../../common/runtime_types'; import { STATUS, SHORT_TIMESPAN_LOCALE, UNNAMED_LOCATION, SHORT_TS_LOCALE, -} from '../../../../common/constants'; + Check, +} from '../../../../common'; import * as labels from './translations'; diff --git a/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.tsx b/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.tsx index 8d6933ad18ced..1e29c7063f7f8 100644 --- a/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.tsx +++ b/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { DonutChart } from '../../common/charts'; import { ChartWrapper } from '../../common/charts/chart_wrapper'; import { SnapshotHeading } from './snapshot_heading'; -import { Snapshot as SnapshotType } from '../../../../common/runtime_types'; +import { Snapshot as SnapshotType } from '../../../../common'; const SNAPSHOT_CHART_WIDTH = 144; const SNAPSHOT_CHART_HEIGHT = 144; diff --git a/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx b/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx index 209e38785e165..e585400f9f421 100644 --- a/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx +++ b/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx @@ -17,8 +17,8 @@ import { EuiFlexGroup, EuiFlexItem, } from '@elastic/eui'; -import { CertStateThresholds } from '../../../common/runtime_types'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants'; +import { CertStateThresholds } from '../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common'; import { SettingsFormProps } from '../../pages/settings'; interface ChangedValues { diff --git a/x-pack/plugins/uptime/public/components/settings/indices_form.tsx b/x-pack/plugins/uptime/public/components/settings/indices_form.tsx index b9a5ca0e730de..0c101662e61bf 100644 --- a/x-pack/plugins/uptime/public/components/settings/indices_form.tsx +++ b/x-pack/plugins/uptime/public/components/settings/indices_form.tsx @@ -14,7 +14,7 @@ import { EuiTitle, EuiSpacer, } from '@elastic/eui'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common'; import { SettingsFormProps } from '../../pages/settings'; export const IndicesForm: React.FC = ({ diff --git a/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx b/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx index 4fabf3f2ed497..9e159cea7c41d 100644 --- a/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx +++ b/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx @@ -6,7 +6,7 @@ import React, { createContext, useMemo } from 'react'; import { UptimeAppProps } from '../uptime_app'; -import { CLIENT_DEFAULTS, CONTEXT_DEFAULTS } from '../../common/constants'; +import { CLIENT_DEFAULTS, CONTEXT_DEFAULTS } from '../../common'; import { CommonlyUsedRange } from '../components/common/uptime_date_picker'; import { useGetUrlParams } from '../hooks'; import { ILicense } from '../../../../plugins/licensing/common/types'; diff --git a/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx b/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx index 306919015fcb1..607ad6220e9a4 100644 --- a/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx +++ b/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx @@ -8,7 +8,7 @@ import { ChromeBreadcrumb } from 'kibana/public'; import React from 'react'; import { Route } from 'react-router-dom'; import { mountWithRouter } from '../../lib'; -import { OVERVIEW_ROUTE } from '../../../common/constants'; +import { OVERVIEW_ROUTE } from '../../../common'; import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; import { UptimeUrlParams, getSupportedUrlParams } from '../../lib/helper'; import { makeBaseBreadcrumb, useBreadcrumbs } from '../use_breadcrumbs'; diff --git a/x-pack/plugins/uptime/public/hooks/use_telemetry.ts b/x-pack/plugins/uptime/public/hooks/use_telemetry.ts index a2012b8ac5636..268cacc119f11 100644 --- a/x-pack/plugins/uptime/public/hooks/use_telemetry.ts +++ b/x-pack/plugins/uptime/public/hooks/use_telemetry.ts @@ -7,7 +7,7 @@ import { useEffect } from 'react'; import { useGetUrlParams } from './use_url_params'; import { apiService } from '../state/api/utils'; -import { API_URLS } from '../../common/constants'; +import { API_URLS } from '../../common'; export enum UptimePage { Overview = 'Overview', diff --git a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx index f7f9e056f41af..36a38e41b6618 100644 --- a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx +++ b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx @@ -17,7 +17,7 @@ import { PLUGIN, DEFAULT_DARK_MODE, DEFAULT_TIMEPICKER_QUICK_RANGES, -} from '../../../../common/constants'; +} from '../../../../common'; import { UMFrameworkAdapter } from '../../lib'; import { ClientPluginsStart, ClientPluginsSetup } from '../../../apps/plugin'; diff --git a/x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts b/x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts index aa5a2b0f60e4f..6aa6e101327cb 100644 --- a/x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts +++ b/x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts @@ -6,7 +6,7 @@ import { isWithinCurrentDate } from './is_within_current_date'; import { getLabelFormat } from './get_label_format'; -import { CHART_FORMAT_LIMITS } from '../../../../common/constants'; +import { CHART_FORMAT_LIMITS } from '../../../../common'; /** * Generates an appropriate date formatting string intended for the y-axis diff --git a/x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts b/x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts index 5957123e9257d..69403dd901a69 100644 --- a/x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts +++ b/x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CHART_FORMAT_LIMITS } from '../../../../common/constants'; +import { CHART_FORMAT_LIMITS } from '../../../../common'; const { EIGHT_MINUTES, diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts index f27ed78d593ac..12345fc396781 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts @@ -5,7 +5,7 @@ */ import { getApmHref } from '../get_apm_href'; -import { MonitorSummary } from '../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../common'; describe('getApmHref', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts index ee5db74af22c2..e44676dd34068 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts @@ -5,7 +5,7 @@ */ import { getInfraContainerHref, getInfraKubernetesHref, getInfraIpHref } from '../get_infra_href'; -import { MonitorSummary } from '../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../common'; describe('getInfraHref', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts index b188a8d1b8ef6..5b82d72d1eb90 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts @@ -9,7 +9,7 @@ import { getLoggingKubernetesHref, getLoggingIpHref, } from '../get_logging_href'; -import { MonitorSummary } from '../../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../../common'; describe('getLoggingHref', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts index 0f830435be89d..f205236b956a4 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts @@ -5,7 +5,7 @@ */ import { get } from 'lodash'; -import { Check } from '../../../../common/runtime_types'; +import { Check } from '../../../../common'; /** * Builds URLs to the designated features by extracting values from the provided diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts index 0ff5a8acb3367..f48c5c251e655 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts @@ -6,7 +6,7 @@ import { get } from 'lodash'; import { addBasePath } from './add_base_path'; -import { MonitorSummary } from '../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../common'; export const getApmHref = ( summary: MonitorSummary, diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts index 384067e4b033b..4ea3a600ff557 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MonitorSummary } from '../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../common'; import { addBasePath } from './add_base_path'; import { buildHref } from './build_href'; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts index 222c7b57c9272..1b87436041cc2 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MonitorSummary } from '../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../common'; import { addBasePath } from './add_base_path'; import { buildHref } from './build_href'; diff --git a/x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts b/x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts index 4ebeb350ed892..4070c5c979436 100644 --- a/x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts +++ b/x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HistogramPoint } from '../../../common/runtime_types'; +import { HistogramPoint } from '../../../common'; export const seriesHasDownValues = (series: HistogramPoint[] | null): boolean => { return series ? series.some(point => !!point.down) : false; diff --git a/x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts b/x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts index a8ce86c4399e2..c91980f6a6173 100644 --- a/x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts +++ b/x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts @@ -6,7 +6,7 @@ import { stringify } from 'query-string'; import { UptimeUrlParams } from './url_params'; -import { CLIENT_DEFAULTS } from '../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../common'; const { AUTOREFRESH_INTERVAL, diff --git a/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts index 483fed28ea6d4..3c7e247b13fda 100644 --- a/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts @@ -6,7 +6,7 @@ import DateMath from '@elastic/datemath'; import { getSupportedUrlParams } from '../get_supported_url_params'; -import { CLIENT_DEFAULTS } from '../../../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../../../common'; describe('getSupportedUrlParams', () => { let dateMathSpy: any; diff --git a/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts index 11dfc3f21b1bf..179fb56532e94 100644 --- a/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts +++ b/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts @@ -6,7 +6,7 @@ import { parseIsPaused } from './parse_is_paused'; import { parseUrlInt } from './parse_url_int'; -import { CLIENT_DEFAULTS } from '../../../../common/constants'; +import { CLIENT_DEFAULTS } from '../../../../common'; import { parseAbsoluteDate } from './parse_absolute_date'; export interface UptimeUrlParams { diff --git a/x-pack/plugins/uptime/public/pages/page_header.tsx b/x-pack/plugins/uptime/public/pages/page_header.tsx index b10bc6ba44f8a..305c005f790f4 100644 --- a/x-pack/plugins/uptime/public/pages/page_header.tsx +++ b/x-pack/plugins/uptime/public/pages/page_header.tsx @@ -9,7 +9,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer, EuiButtonEmpty } from ' import { i18n } from '@kbn/i18n'; import { Link } from 'react-router-dom'; import { UptimeDatePicker } from '../components/common/uptime_date_picker'; -import { SETTINGS_ROUTE } from '../../common/constants'; +import { SETTINGS_ROUTE } from '../../common'; import { ToggleAlertFlyoutButton } from '../components/overview/alerts/alerts_containers'; interface PageHeaderProps { diff --git a/x-pack/plugins/uptime/public/pages/settings.tsx b/x-pack/plugins/uptime/public/pages/settings.tsx index 52096a49435d7..a28570fafafc7 100644 --- a/x-pack/plugins/uptime/public/pages/settings.tsx +++ b/x-pack/plugins/uptime/public/pages/settings.tsx @@ -21,9 +21,9 @@ import { isEqual } from 'lodash'; import { Link } from 'react-router-dom'; import { selectDynamicSettings } from '../state/selectors'; import { getDynamicSettings, setDynamicSettings } from '../state/actions/dynamic_settings'; -import { DynamicSettings } from '../../common/runtime_types'; +import { DynamicSettings } from '../../common'; import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; -import { OVERVIEW_ROUTE } from '../../common/constants'; +import { OVERVIEW_ROUTE } from '../../common'; import { useKibana } from '../../../../../src/plugins/kibana_react/public'; import { UptimePage, useUptimeTelemetry } from '../hooks'; import { IndicesForm } from '../components/settings/indices_form'; diff --git a/x-pack/plugins/uptime/public/routes.tsx b/x-pack/plugins/uptime/public/routes.tsx index eb0587c0417a2..c1c4c74fcb892 100644 --- a/x-pack/plugins/uptime/public/routes.tsx +++ b/x-pack/plugins/uptime/public/routes.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { Route, Switch } from 'react-router-dom'; import { DataPublicPluginSetup } from '../../../../src/plugins/data/public'; import { OverviewPage } from './components/overview/overview_container'; -import { MONITOR_ROUTE, OVERVIEW_ROUTE, SETTINGS_ROUTE } from '../common/constants'; +import { MONITOR_ROUTE, OVERVIEW_ROUTE, SETTINGS_ROUTE } from '../common'; import { MonitorPage, NotFoundPage, SettingsPage } from './pages'; interface RouterProps { diff --git a/x-pack/plugins/uptime/public/state/actions/dynamic_settings.ts b/x-pack/plugins/uptime/public/state/actions/dynamic_settings.ts index 3dbb1aa234621..1aadc8fc8b257 100644 --- a/x-pack/plugins/uptime/public/state/actions/dynamic_settings.ts +++ b/x-pack/plugins/uptime/public/state/actions/dynamic_settings.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { createAction } from 'redux-actions'; -import { DynamicSettings } from '../../../common/runtime_types'; +import { DynamicSettings } from '../../../common'; export const getDynamicSettings = createAction('GET_DYNAMIC_SETTINGS'); export const getDynamicSettingsSuccess = createAction( diff --git a/x-pack/plugins/uptime/public/state/actions/index_status.ts b/x-pack/plugins/uptime/public/state/actions/index_status.ts index 5c964052bb3de..34b9123f63d04 100644 --- a/x-pack/plugins/uptime/public/state/actions/index_status.ts +++ b/x-pack/plugins/uptime/public/state/actions/index_status.ts @@ -5,6 +5,6 @@ */ import { createAsyncAction } from './utils'; -import { StatesIndexStatus } from '../../../common/runtime_types'; +import { StatesIndexStatus } from '../../../common'; export const indexStatusAction = createAsyncAction('GET INDEX STATUS'); diff --git a/x-pack/plugins/uptime/public/state/actions/monitor.ts b/x-pack/plugins/uptime/public/state/actions/monitor.ts index 30ea8e71265e0..38ae1500bd202 100644 --- a/x-pack/plugins/uptime/public/state/actions/monitor.ts +++ b/x-pack/plugins/uptime/public/state/actions/monitor.ts @@ -6,8 +6,8 @@ import { createAction } from 'redux-actions'; import { MonitorDetailsActionPayload } from './types'; -import { MonitorError } from '../../../common/runtime_types'; -import { MonitorLocations } from '../../../common/runtime_types'; +import { MonitorError } from '../../../common'; +import { MonitorLocations } from '../../../common'; import { QueryParams } from './types'; export interface MonitorLocationsPayload extends QueryParams { diff --git a/x-pack/plugins/uptime/public/state/actions/monitor_list.ts b/x-pack/plugins/uptime/public/state/actions/monitor_list.ts index ee2267a9058af..f1a4fc01dd9e3 100644 --- a/x-pack/plugins/uptime/public/state/actions/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/actions/monitor_list.ts @@ -5,7 +5,7 @@ */ import { createAction } from 'redux-actions'; -import { FetchMonitorStatesQueryArgs, MonitorSummaryResult } from '../../../common/runtime_types'; +import { FetchMonitorStatesQueryArgs, MonitorSummaryResult } from '../../../common'; export const getMonitorList = createAction('GET_MONITOR_LIST'); export const getMonitorListSuccess = createAction('GET_MONITOR_LIST_SUCCESS'); diff --git a/x-pack/plugins/uptime/public/state/actions/monitor_status.ts b/x-pack/plugins/uptime/public/state/actions/monitor_status.ts index 3d480e66c9e0b..6a60ac83d9baf 100644 --- a/x-pack/plugins/uptime/public/state/actions/monitor_status.ts +++ b/x-pack/plugins/uptime/public/state/actions/monitor_status.ts @@ -6,7 +6,7 @@ import { createAction } from 'redux-actions'; import { QueryParams } from './types'; -import { Ping } from '../../../common/runtime_types'; +import { Ping } from '../../../common'; export const getMonitorStatusAction = createAction('GET_MONITOR_STATUS'); export const getMonitorStatusActionSuccess = createAction('GET_MONITOR_STATUS_SUCCESS'); diff --git a/x-pack/plugins/uptime/public/state/actions/overview_filters.ts b/x-pack/plugins/uptime/public/state/actions/overview_filters.ts index dbbd01e34b4d4..bf021d4e6e8a7 100644 --- a/x-pack/plugins/uptime/public/state/actions/overview_filters.ts +++ b/x-pack/plugins/uptime/public/state/actions/overview_filters.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { OverviewFilters } from '../../../common/runtime_types'; +import { OverviewFilters } from '../../../common'; export const FETCH_OVERVIEW_FILTERS = 'FETCH_OVERVIEW_FILTERS'; export const FETCH_OVERVIEW_FILTERS_FAIL = 'FETCH_OVERVIEW_FILTERS_FAIL'; diff --git a/x-pack/plugins/uptime/public/state/actions/ping.ts b/x-pack/plugins/uptime/public/state/actions/ping.ts index 70918a4cc70e5..3ee64ea6dc1bb 100644 --- a/x-pack/plugins/uptime/public/state/actions/ping.ts +++ b/x-pack/plugins/uptime/public/state/actions/ping.ts @@ -10,7 +10,7 @@ import { HistogramResult, PingsResponse, GetPingsParams, -} from '../../../common/runtime_types'; +} from '../../../common'; export const getPingHistogram = createAction('GET_PING_HISTOGRAM'); export const getPingHistogramSuccess = createAction('GET_PING_HISTOGRAM_SUCCESS'); diff --git a/x-pack/plugins/uptime/public/state/actions/snapshot.ts b/x-pack/plugins/uptime/public/state/actions/snapshot.ts index e819a553e61f5..2d826e4804b3a 100644 --- a/x-pack/plugins/uptime/public/state/actions/snapshot.ts +++ b/x-pack/plugins/uptime/public/state/actions/snapshot.ts @@ -5,7 +5,7 @@ */ import { createAction } from 'redux-actions'; -import { Snapshot } from '../../../common/runtime_types'; +import { Snapshot } from '../../../common'; export interface GetSnapshotPayload { dateRangeStart: string; diff --git a/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts b/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts index e52e40c53513c..b4e3d39d934b4 100644 --- a/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts +++ b/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts @@ -9,7 +9,7 @@ import { DynamicSettings, DynamicSettingsSaveResponse, DynamicSettingsSaveType, -} from '../../../common/runtime_types'; +} from '../../../common'; import { apiService } from './utils'; const apiPath = '/api/uptime/dynamic_settings'; diff --git a/x-pack/plugins/uptime/public/state/api/index_pattern.ts b/x-pack/plugins/uptime/public/state/api/index_pattern.ts index 1eecbc75c5bf4..a1bf5bb64ac9b 100644 --- a/x-pack/plugins/uptime/public/state/api/index_pattern.ts +++ b/x-pack/plugins/uptime/public/state/api/index_pattern.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; import { apiService } from './utils'; export const fetchIndexPattern = async () => { diff --git a/x-pack/plugins/uptime/public/state/api/index_status.ts b/x-pack/plugins/uptime/public/state/api/index_status.ts index 0e33ab617777a..08dc8659ca6a0 100644 --- a/x-pack/plugins/uptime/public/state/api/index_status.ts +++ b/x-pack/plugins/uptime/public/state/api/index_status.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { API_URLS } from '../../../common/constants'; -import { StatesIndexStatus, StatesIndexStatusType } from '../../../common/runtime_types'; +import { API_URLS } from '../../../common'; +import { StatesIndexStatus, StatesIndexStatusType } from '../../../common'; import { apiService } from './utils'; export const fetchIndexStatus = async (): Promise => { diff --git a/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts b/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts index 37929cf33c018..126b81c8db653 100644 --- a/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts +++ b/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts @@ -7,7 +7,7 @@ import moment from 'moment'; import { apiService } from './utils'; import { AnomalyRecords, AnomalyRecordsParams } from '../actions'; -import { API_URLS, ML_JOB_ID, ML_MODULE_ID } from '../../../common/constants'; +import { API_URLS, ML_JOB_ID, ML_MODULE_ID } from '../../../common'; import { MlCapabilitiesResponse } from '../../../../../plugins/ml/common/types/capabilities'; import { CreateMLJobSuccess, diff --git a/x-pack/plugins/uptime/public/state/api/monitor.ts b/x-pack/plugins/uptime/public/state/api/monitor.ts index c3d0a0180cf51..6900f8b2cfc32 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor.ts @@ -5,10 +5,10 @@ */ import { BaseParams } from './types'; -import { MonitorDetailsType, MonitorLocationsType } from '../../../common/runtime_types'; +import { MonitorDetailsType, MonitorLocationsType } from '../../../common'; import { QueryParams } from '../actions/types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; interface ApiRequest { monitorId: string; diff --git a/x-pack/plugins/uptime/public/state/api/monitor_duration.ts b/x-pack/plugins/uptime/public/state/api/monitor_duration.ts index 91034f1784b15..75114a9bbf26a 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_duration.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_duration.ts @@ -6,7 +6,7 @@ import { BaseParams } from './types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; export const fetchMonitorDuration = async ({ monitorId, dateStart, dateEnd }: BaseParams) => { const queryParams = { diff --git a/x-pack/plugins/uptime/public/state/api/monitor_list.ts b/x-pack/plugins/uptime/public/state/api/monitor_list.ts index 084bcb4bd2a91..121f632380879 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_list.ts @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; import { apiService } from './utils'; import { FetchMonitorStatesQueryArgs, MonitorSummaryResult, MonitorSummaryResultType, -} from '../../../common/runtime_types'; +} from '../../../common'; export const fetchMonitorList = async ( params: FetchMonitorStatesQueryArgs diff --git a/x-pack/plugins/uptime/public/state/api/monitor_status.ts b/x-pack/plugins/uptime/public/state/api/monitor_status.ts index 7c8ab3518b5a0..cfd1ba863acdd 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_status.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_status.ts @@ -5,8 +5,8 @@ */ import { QueryParams } from '../actions/types'; -import { Ping } from '../../../common/runtime_types'; -import { API_URLS } from '../../../common/constants'; +import { Ping } from '../../../common'; +import { API_URLS } from '../../../common'; import { apiService } from './utils'; export const fetchMonitorStatus = async ({ diff --git a/x-pack/plugins/uptime/public/state/api/overview_filters.ts b/x-pack/plugins/uptime/public/state/api/overview_filters.ts index 6330d8a912210..6e98994152a57 100644 --- a/x-pack/plugins/uptime/public/state/api/overview_filters.ts +++ b/x-pack/plugins/uptime/public/state/api/overview_filters.ts @@ -5,9 +5,9 @@ */ import { GetOverviewFiltersPayload } from '../actions'; -import { OverviewFiltersType } from '../../../common/runtime_types'; +import { OverviewFiltersType } from '../../../common'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; export const fetchOverviewFilters = async ({ dateRangeStart, diff --git a/x-pack/plugins/uptime/public/state/api/ping.ts b/x-pack/plugins/uptime/public/state/api/ping.ts index 6de27879a49f5..eb67c7477d081 100644 --- a/x-pack/plugins/uptime/public/state/api/ping.ts +++ b/x-pack/plugins/uptime/public/state/api/ping.ts @@ -11,9 +11,9 @@ import { GetPingsParams, GetPingHistogramParams, HistogramResult, -} from '../../../common/runtime_types'; +} from '../../../common'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; export const fetchPings: APIFn = async ({ dateRange: { from, to }, diff --git a/x-pack/plugins/uptime/public/state/api/snapshot.ts b/x-pack/plugins/uptime/public/state/api/snapshot.ts index 9ee53dd2cbcef..4dd4f705e3ba1 100644 --- a/x-pack/plugins/uptime/public/state/api/snapshot.ts +++ b/x-pack/plugins/uptime/public/state/api/snapshot.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SnapshotType, Snapshot } from '../../../common/runtime_types'; +import { SnapshotType, Snapshot } from '../../../common'; import { apiService } from './utils'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; export interface SnapShotQueryParams { dateRangeStart: string; diff --git a/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts b/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts index 4ec35d8cd6c6f..d47a72f857a8c 100644 --- a/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts +++ b/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts @@ -8,7 +8,7 @@ import { call, put } from 'redux-saga/effects'; import { fetchEffectFactory } from '../fetch_effect'; import { indexStatusAction } from '../../actions'; import { HttpFetchError } from 'src/core/public'; -import { StatesIndexStatus } from '../../../../common/runtime_types'; +import { StatesIndexStatus } from '../../../../common'; import { fetchIndexStatus } from '../../api'; describe('fetch saga effect factory', () => { diff --git a/x-pack/plugins/uptime/public/state/effects/dynamic_settings.ts b/x-pack/plugins/uptime/public/state/effects/dynamic_settings.ts index bee92813aa1f0..2443a467c584b 100644 --- a/x-pack/plugins/uptime/public/state/effects/dynamic_settings.ts +++ b/x-pack/plugins/uptime/public/state/effects/dynamic_settings.ts @@ -20,7 +20,7 @@ import { getDynamicSettings as getDynamicSettingsAPI, setDynamicSettings as setDynamicSettingsAPI, } from '../api'; -import { DynamicSettings } from '../../../common/runtime_types'; +import { DynamicSettings } from '../../../common'; import { kibanaService } from '../kibana_service'; export function* fetchDynamicSettingsEffect() { diff --git a/x-pack/plugins/uptime/public/state/reducers/dynamic_settings.ts b/x-pack/plugins/uptime/public/state/reducers/dynamic_settings.ts index a9ad58e64e552..2ef11dafda6b8 100644 --- a/x-pack/plugins/uptime/public/state/reducers/dynamic_settings.ts +++ b/x-pack/plugins/uptime/public/state/reducers/dynamic_settings.ts @@ -12,7 +12,7 @@ import { setDynamicSettingsSuccess, setDynamicSettingsFail, } from '../actions/dynamic_settings'; -import { DynamicSettings } from '../../../common/runtime_types'; +import { DynamicSettings } from '../../../common'; export interface DynamicSettingsState { settings?: DynamicSettings; diff --git a/x-pack/plugins/uptime/public/state/reducers/index_status.ts b/x-pack/plugins/uptime/public/state/reducers/index_status.ts index 1a93eb43775f3..805a4a70c9868 100644 --- a/x-pack/plugins/uptime/public/state/reducers/index_status.ts +++ b/x-pack/plugins/uptime/public/state/reducers/index_status.ts @@ -8,7 +8,7 @@ import { handleActions } from 'redux-actions'; import { indexStatusAction } from '../actions'; import { getAsyncInitialState, handleAsyncAction } from './utils'; import { AsyncInitialState } from './types'; -import { StatesIndexStatus } from '../../../common/runtime_types'; +import { StatesIndexStatus } from '../../../common'; export interface IndexStatusState { indexStatus: AsyncInitialState; diff --git a/x-pack/plugins/uptime/public/state/reducers/monitor.ts b/x-pack/plugins/uptime/public/state/reducers/monitor.ts index 632f3a270e1a1..0e7fbe1fa4083 100644 --- a/x-pack/plugins/uptime/public/state/reducers/monitor.ts +++ b/x-pack/plugins/uptime/public/state/reducers/monitor.ts @@ -14,7 +14,7 @@ import { getMonitorLocationsActionSuccess, getMonitorLocationsActionFail, } from '../actions/monitor'; -import { MonitorLocations } from '../../../common/runtime_types'; +import { MonitorLocations } from '../../../common'; type MonitorLocationsList = Map; diff --git a/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts b/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts index cf895aebeb755..c7f2f26ddaa33 100644 --- a/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts @@ -6,7 +6,7 @@ import { handleActions, Action } from 'redux-actions'; import { getMonitorList, getMonitorListSuccess, getMonitorListFailure } from '../actions'; -import { MonitorSummaryResult } from '../../../common/runtime_types'; +import { MonitorSummaryResult } from '../../../common'; export interface MonitorList { list: MonitorSummaryResult; diff --git a/x-pack/plugins/uptime/public/state/reducers/monitor_status.ts b/x-pack/plugins/uptime/public/state/reducers/monitor_status.ts index a98e89a27a711..fc57bb924483d 100644 --- a/x-pack/plugins/uptime/public/state/reducers/monitor_status.ts +++ b/x-pack/plugins/uptime/public/state/reducers/monitor_status.ts @@ -9,7 +9,7 @@ import { getMonitorStatusActionSuccess, getMonitorStatusActionFail, } from '../actions'; -import { Ping } from '../../../common/runtime_types'; +import { Ping } from '../../../common'; import { QueryParams } from '../actions/types'; export interface MonitorStatusState { diff --git a/x-pack/plugins/uptime/public/state/reducers/overview_filters.ts b/x-pack/plugins/uptime/public/state/reducers/overview_filters.ts index 0b67d8b0e7689..c0dfbd8964d71 100644 --- a/x-pack/plugins/uptime/public/state/reducers/overview_filters.ts +++ b/x-pack/plugins/uptime/public/state/reducers/overview_filters.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { OverviewFilters } from '../../../common/runtime_types'; +import { OverviewFilters } from '../../../common'; import { FETCH_OVERVIEW_FILTERS, FETCH_OVERVIEW_FILTERS_FAIL, diff --git a/x-pack/plugins/uptime/public/state/reducers/ping.ts b/x-pack/plugins/uptime/public/state/reducers/ping.ts index 4c8715038ce36..7723281d153cf 100644 --- a/x-pack/plugins/uptime/public/state/reducers/ping.ts +++ b/x-pack/plugins/uptime/public/state/reducers/ping.ts @@ -6,7 +6,7 @@ import { handleActions, Action } from 'redux-actions'; import { getPingHistogram, getPingHistogramSuccess, getPingHistogramFail } from '../actions'; -import { HistogramResult } from '../../../common/runtime_types'; +import { HistogramResult } from '../../../common'; export interface PingState { pingHistogram: HistogramResult | null; diff --git a/x-pack/plugins/uptime/public/state/reducers/ping_list.ts b/x-pack/plugins/uptime/public/state/reducers/ping_list.ts index e3ccb1e663eda..64d472ad36176 100644 --- a/x-pack/plugins/uptime/public/state/reducers/ping_list.ts +++ b/x-pack/plugins/uptime/public/state/reducers/ping_list.ts @@ -5,7 +5,7 @@ */ import { handleActions, Action } from 'redux-actions'; -import { PingsResponse } from '../../../common/runtime_types'; +import { PingsResponse } from '../../../common'; import { getPings, getPingsSuccess, getPingsFail } from '../actions'; export interface PingListState { diff --git a/x-pack/plugins/uptime/public/state/reducers/snapshot.ts b/x-pack/plugins/uptime/public/state/reducers/snapshot.ts index 3ba1ef84d41a5..72896956a46da 100644 --- a/x-pack/plugins/uptime/public/state/reducers/snapshot.ts +++ b/x-pack/plugins/uptime/public/state/reducers/snapshot.ts @@ -5,7 +5,7 @@ */ import { Action } from 'redux-actions'; -import { Snapshot } from '../../../common/runtime_types'; +import { Snapshot } from '../../../common'; import { getSnapshotCountAction, getSnapshotCountActionSuccess, diff --git a/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts b/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts index ba5e5abf588b8..580ee78191137 100644 --- a/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts +++ b/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts @@ -6,7 +6,7 @@ import { getBasePath, isIntegrationsPopupOpen } from '../index'; import { AppState } from '../../../state'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; describe('state selectors', () => { const state: AppState = { diff --git a/x-pack/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts index d68bbabe82b86..52c1d7e130cf3 100644 --- a/x-pack/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -5,7 +5,7 @@ */ import { Request, Server } from 'hapi'; -import { PLUGIN } from '../common/constants'; +import { PLUGIN } from '../common'; import { compose } from './lib/compose/kibana'; import { initUptimeServer } from './uptime_server'; import { UptimeCorePlugins, UptimeCoreSetup } from './lib/adapters/framework'; diff --git a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts index f4d1c72770494..1999dda006427 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts @@ -13,7 +13,7 @@ import { } from 'src/core/server'; import { UMKibanaRoute } from '../../../rest_api'; import { PluginSetupContract } from '../../../../../features/server'; -import { DynamicSettings } from '../../../../common/runtime_types'; +import { DynamicSettings } from '../../../../common'; export type APICaller = ( endpoint: string, diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts index 63334db0d22b9..283c7b2ae3f29 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CONTEXT_DEFAULTS } from '../../../common/constants'; +import { CONTEXT_DEFAULTS } from '../../../common'; import { fetchPage } from './search'; import { UMElasticsearchQueryFn } from '../adapters'; import { MonitorSummary, SortOrder, CursorDirection } from '../../../common'; diff --git a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts index b6df453ff6c62..01d377d23cb94 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts @@ -6,7 +6,7 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from './query_context'; -import { QUERY, STATES } from '../../../../common/constants'; +import { QUERY, STATES } from '../../../../common'; import { Check, Histogram, MonitorSummary, CursorDirection, SortOrder } from '../../../../common'; import { MonitorEnricher } from './fetch_page'; diff --git a/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts index d8387e79e9089..e57e54120c368 100644 --- a/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts +++ b/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; import { KibanaTelemetryAdapter } from '../../lib/adapters/telemetry'; import { UMRestApiRouteFactory } from '../types'; import { PageViewParams } from '../../lib/adapters/telemetry/types'; -import { API_URLS } from '../../../common/constants'; +import { API_URLS } from '../../../common'; export const createLogPageViewRoute: UMRestApiRouteFactory = () => ({ method: 'POST', From 1c42cc8f02f83fd4ed60ea6cade35ef259bdf7f3 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Mon, 27 Apr 2020 09:50:12 -0400 Subject: [PATCH 27/36] Delete obsolete translation keys. --- x-pack/.i18nrc.json | 2 +- x-pack/plugins/translations/translations/ja-JP.json | 1 - x-pack/plugins/translations/translations/zh-CN.json | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/x-pack/.i18nrc.json b/x-pack/.i18nrc.json index a8e50e017102f..4a81f39098847 100644 --- a/x-pack/.i18nrc.json +++ b/x-pack/.i18nrc.json @@ -43,7 +43,7 @@ "xpack.transform": "plugins/transform", "xpack.triggersActionsUI": "plugins/triggers_actions_ui", "xpack.upgradeAssistant": "plugins/upgrade_assistant", - "xpack.uptime": ["plugins/uptime", "legacy/plugins/uptime"], + "xpack.uptime": ["plugins/uptime"], "xpack.watcher": "plugins/watcher" }, "translations": [ diff --git a/x-pack/plugins/translations/translations/ja-JP.json b/x-pack/plugins/translations/translations/ja-JP.json index 785a58baa24a8..c805ce0d186ae 100644 --- a/x-pack/plugins/translations/translations/ja-JP.json +++ b/x-pack/plugins/translations/translations/ja-JP.json @@ -16149,7 +16149,6 @@ "xpack.uptime.emptyStateError.notAuthorized": "アップタイムデータの表示が承認されていません。システム管理者にお問い合わせください。", "xpack.uptime.emptyStateError.notFoundPage": "ページが見つかりません", "xpack.uptime.emptyStateError.title": "エラー", - "xpack.uptime.featureCatalogueDescription": "エンドポイントヘルスチェックとアップタイム監視を行います。", "xpack.uptime.featureRegistry.uptimeFeatureName": "アップタイム", "xpack.uptime.filterBar.ariaLabel": "概要ページのインプットフィルター基準", "xpack.uptime.filterBar.filterDownLabel": "ダウン", diff --git a/x-pack/plugins/translations/translations/zh-CN.json b/x-pack/plugins/translations/translations/zh-CN.json index ccee034773fef..a3ac6c8003ef7 100644 --- a/x-pack/plugins/translations/translations/zh-CN.json +++ b/x-pack/plugins/translations/translations/zh-CN.json @@ -16154,7 +16154,6 @@ "xpack.uptime.emptyStateError.notAuthorized": "您无权查看 Uptime 数据,请联系系统管理员。", "xpack.uptime.emptyStateError.notFoundPage": "未找到页面", "xpack.uptime.emptyStateError.title": "错误", - "xpack.uptime.featureCatalogueDescription": "执行终端节点运行状况检查和运行时间监测。", "xpack.uptime.featureRegistry.uptimeFeatureName": "运行时间", "xpack.uptime.filterBar.ariaLabel": "概览页面的输入筛选条件", "xpack.uptime.filterBar.filterDownLabel": "关闭", From 93e421c29d53171ab1c98b8c03ab84101df48285 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Mon, 27 Apr 2020 10:49:03 -0400 Subject: [PATCH 28/36] Add additional explicit typing to plugin class. --- x-pack/plugins/uptime/public/apps/plugin.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/x-pack/plugins/uptime/public/apps/plugin.ts b/x-pack/plugins/uptime/public/apps/plugin.ts index 9d98d922c81e4..be35549138015 100644 --- a/x-pack/plugins/uptime/public/apps/plugin.ts +++ b/x-pack/plugins/uptime/public/apps/plugin.ts @@ -30,9 +30,12 @@ export interface ClientPluginsStart { } export class UptimePlugin implements Plugin { - constructor(context: PluginInitializerContext) {} + constructor(_context: PluginInitializerContext) {} - public async setup(core: CoreSetup, plugins: ClientPluginsSetup) { + public async setup( + core: CoreSetup, + plugins: ClientPluginsSetup + ): Promise { if (plugins.home) { plugins.home.featureCatalogue.register({ id: PLUGIN.ID, @@ -65,5 +68,5 @@ export class UptimePlugin implements Plugin Date: Mon, 27 Apr 2020 10:49:34 -0400 Subject: [PATCH 29/36] Combine redundant common imports. --- .../components/overview/monitor_list/monitor_list.tsx | 3 +-- x-pack/plugins/uptime/public/state/api/monitor.ts | 3 +-- .../plugins/uptime/public/state/api/monitor_list.ts | 2 +- .../plugins/uptime/public/state/api/monitor_status.ts | 3 +-- .../uptime/public/state/api/overview_filters.ts | 3 +-- x-pack/plugins/uptime/public/state/api/ping.ts | 2 +- x-pack/plugins/uptime/public/state/api/snapshot.ts | 3 +-- .../uptime/server/lib/requests/get_monitor_states.ts | 3 +-- .../lib/requests/search/enrich_monitor_groups.ts | 11 +++++++++-- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx index 21199e7f15d48..dedbff0a94902 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx @@ -18,8 +18,7 @@ import { import { FormattedMessage } from '@kbn/i18n/react'; import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; -import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common'; -import { MonitorSummary } from '../../../../common'; +import { HistogramPoint, FetchMonitorStatesQueryArgs, MonitorSummary } from '../../../../common'; import { MonitorListStatusColumn } from './monitor_list_status_column'; import { ExpandedRowMap } from './types'; import { MonitorBarSeries } from '../../common/charts'; diff --git a/x-pack/plugins/uptime/public/state/api/monitor.ts b/x-pack/plugins/uptime/public/state/api/monitor.ts index 6900f8b2cfc32..24b23702dcd6a 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor.ts @@ -5,10 +5,9 @@ */ import { BaseParams } from './types'; -import { MonitorDetailsType, MonitorLocationsType } from '../../../common'; +import { API_URLS, MonitorDetailsType, MonitorLocationsType } from '../../../common'; import { QueryParams } from '../actions/types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common'; interface ApiRequest { monitorId: string; diff --git a/x-pack/plugins/uptime/public/state/api/monitor_list.ts b/x-pack/plugins/uptime/public/state/api/monitor_list.ts index 121f632380879..9d58add6d0de0 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_list.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { API_URLS } from '../../../common'; import { apiService } from './utils'; import { + API_URLS, FetchMonitorStatesQueryArgs, MonitorSummaryResult, MonitorSummaryResultType, diff --git a/x-pack/plugins/uptime/public/state/api/monitor_status.ts b/x-pack/plugins/uptime/public/state/api/monitor_status.ts index cfd1ba863acdd..835bfd1a11768 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_status.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_status.ts @@ -5,8 +5,7 @@ */ import { QueryParams } from '../actions/types'; -import { Ping } from '../../../common'; -import { API_URLS } from '../../../common'; +import { API_URLS, Ping } from '../../../common'; import { apiService } from './utils'; export const fetchMonitorStatus = async ({ diff --git a/x-pack/plugins/uptime/public/state/api/overview_filters.ts b/x-pack/plugins/uptime/public/state/api/overview_filters.ts index 6e98994152a57..6638ef7f47626 100644 --- a/x-pack/plugins/uptime/public/state/api/overview_filters.ts +++ b/x-pack/plugins/uptime/public/state/api/overview_filters.ts @@ -5,9 +5,8 @@ */ import { GetOverviewFiltersPayload } from '../actions'; -import { OverviewFiltersType } from '../../../common'; +import { API_URLS, OverviewFiltersType } from '../../../common'; import { apiService } from './utils'; -import { API_URLS } from '../../../common'; export const fetchOverviewFilters = async ({ dateRangeStart, diff --git a/x-pack/plugins/uptime/public/state/api/ping.ts b/x-pack/plugins/uptime/public/state/api/ping.ts index eb67c7477d081..fd8c66790f9df 100644 --- a/x-pack/plugins/uptime/public/state/api/ping.ts +++ b/x-pack/plugins/uptime/public/state/api/ping.ts @@ -6,6 +6,7 @@ import { APIFn } from './types'; import { + API_URLS, PingsResponseType, PingsResponse, GetPingsParams, @@ -13,7 +14,6 @@ import { HistogramResult, } from '../../../common'; import { apiService } from './utils'; -import { API_URLS } from '../../../common'; export const fetchPings: APIFn = async ({ dateRange: { from, to }, diff --git a/x-pack/plugins/uptime/public/state/api/snapshot.ts b/x-pack/plugins/uptime/public/state/api/snapshot.ts index 4dd4f705e3ba1..f57d77b44b324 100644 --- a/x-pack/plugins/uptime/public/state/api/snapshot.ts +++ b/x-pack/plugins/uptime/public/state/api/snapshot.ts @@ -4,9 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SnapshotType, Snapshot } from '../../../common'; +import { API_URLS, SnapshotType, Snapshot } from '../../../common'; import { apiService } from './utils'; -import { API_URLS } from '../../../common'; export interface SnapShotQueryParams { dateRangeStart: string; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts index 283c7b2ae3f29..8e0701688bc2d 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts @@ -4,10 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CONTEXT_DEFAULTS } from '../../../common'; import { fetchPage } from './search'; import { UMElasticsearchQueryFn } from '../adapters'; -import { MonitorSummary, SortOrder, CursorDirection } from '../../../common'; +import { CONTEXT_DEFAULTS, MonitorSummary, SortOrder, CursorDirection } from '../../../common'; import { QueryContext } from './search'; export interface CursorPagination { diff --git a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts index 01d377d23cb94..234b72162f249 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts @@ -6,8 +6,15 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from './query_context'; -import { QUERY, STATES } from '../../../../common'; -import { Check, Histogram, MonitorSummary, CursorDirection, SortOrder } from '../../../../common'; +import { + QUERY, + STATES, + Check, + Histogram, + MonitorSummary, + CursorDirection, + SortOrder, +} from '../../../../common'; import { MonitorEnricher } from './fetch_page'; export const enrichMonitorGroups: MonitorEnricher = async ( From f9aee041b18ebbc8c3d5e92c8713b38e4fdf9876 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Mon, 27 Apr 2020 10:57:12 -0400 Subject: [PATCH 30/36] Delete unneeded optionalPlugin entry. --- x-pack/plugins/uptime/kibana.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/uptime/kibana.json b/x-pack/plugins/uptime/kibana.json index 15c13914309f7..ce8b64ce07254 100644 --- a/x-pack/plugins/uptime/kibana.json +++ b/x-pack/plugins/uptime/kibana.json @@ -2,7 +2,7 @@ "configPath": ["xpack", "uptime"], "id": "uptime", "kibanaVersion": "kibana", - "optionalPlugins": ["capabilities", "data", "home", "kibana_react"], + "optionalPlugins": ["capabilities", "data", "home"], "requiredPlugins": [ "alerting", "embeddable", From d77978f3dfaaae4cd9f4853febc2f5ef96900df1 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 28 Apr 2020 09:49:36 -0400 Subject: [PATCH 31/36] Revert "Combine redundant common imports." This reverts commit 159e66c349340ba1ede9940c8c3fb980e7be4586. --- .../components/overview/monitor_list/monitor_list.tsx | 3 ++- x-pack/plugins/uptime/public/state/api/monitor.ts | 3 ++- .../plugins/uptime/public/state/api/monitor_list.ts | 2 +- .../plugins/uptime/public/state/api/monitor_status.ts | 3 ++- .../uptime/public/state/api/overview_filters.ts | 3 ++- x-pack/plugins/uptime/public/state/api/ping.ts | 2 +- x-pack/plugins/uptime/public/state/api/snapshot.ts | 3 ++- .../uptime/server/lib/requests/get_monitor_states.ts | 3 ++- .../lib/requests/search/enrich_monitor_groups.ts | 11 ++--------- 9 files changed, 16 insertions(+), 17 deletions(-) diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx index dedbff0a94902..21199e7f15d48 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx @@ -18,7 +18,8 @@ import { import { FormattedMessage } from '@kbn/i18n/react'; import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; -import { HistogramPoint, FetchMonitorStatesQueryArgs, MonitorSummary } from '../../../../common'; +import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common'; +import { MonitorSummary } from '../../../../common'; import { MonitorListStatusColumn } from './monitor_list_status_column'; import { ExpandedRowMap } from './types'; import { MonitorBarSeries } from '../../common/charts'; diff --git a/x-pack/plugins/uptime/public/state/api/monitor.ts b/x-pack/plugins/uptime/public/state/api/monitor.ts index 24b23702dcd6a..6900f8b2cfc32 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor.ts @@ -5,9 +5,10 @@ */ import { BaseParams } from './types'; -import { API_URLS, MonitorDetailsType, MonitorLocationsType } from '../../../common'; +import { MonitorDetailsType, MonitorLocationsType } from '../../../common'; import { QueryParams } from '../actions/types'; import { apiService } from './utils'; +import { API_URLS } from '../../../common'; interface ApiRequest { monitorId: string; diff --git a/x-pack/plugins/uptime/public/state/api/monitor_list.ts b/x-pack/plugins/uptime/public/state/api/monitor_list.ts index 9d58add6d0de0..121f632380879 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_list.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ +import { API_URLS } from '../../../common'; import { apiService } from './utils'; import { - API_URLS, FetchMonitorStatesQueryArgs, MonitorSummaryResult, MonitorSummaryResultType, diff --git a/x-pack/plugins/uptime/public/state/api/monitor_status.ts b/x-pack/plugins/uptime/public/state/api/monitor_status.ts index 835bfd1a11768..cfd1ba863acdd 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_status.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_status.ts @@ -5,7 +5,8 @@ */ import { QueryParams } from '../actions/types'; -import { API_URLS, Ping } from '../../../common'; +import { Ping } from '../../../common'; +import { API_URLS } from '../../../common'; import { apiService } from './utils'; export const fetchMonitorStatus = async ({ diff --git a/x-pack/plugins/uptime/public/state/api/overview_filters.ts b/x-pack/plugins/uptime/public/state/api/overview_filters.ts index 6638ef7f47626..6e98994152a57 100644 --- a/x-pack/plugins/uptime/public/state/api/overview_filters.ts +++ b/x-pack/plugins/uptime/public/state/api/overview_filters.ts @@ -5,8 +5,9 @@ */ import { GetOverviewFiltersPayload } from '../actions'; -import { API_URLS, OverviewFiltersType } from '../../../common'; +import { OverviewFiltersType } from '../../../common'; import { apiService } from './utils'; +import { API_URLS } from '../../../common'; export const fetchOverviewFilters = async ({ dateRangeStart, diff --git a/x-pack/plugins/uptime/public/state/api/ping.ts b/x-pack/plugins/uptime/public/state/api/ping.ts index fd8c66790f9df..eb67c7477d081 100644 --- a/x-pack/plugins/uptime/public/state/api/ping.ts +++ b/x-pack/plugins/uptime/public/state/api/ping.ts @@ -6,7 +6,6 @@ import { APIFn } from './types'; import { - API_URLS, PingsResponseType, PingsResponse, GetPingsParams, @@ -14,6 +13,7 @@ import { HistogramResult, } from '../../../common'; import { apiService } from './utils'; +import { API_URLS } from '../../../common'; export const fetchPings: APIFn = async ({ dateRange: { from, to }, diff --git a/x-pack/plugins/uptime/public/state/api/snapshot.ts b/x-pack/plugins/uptime/public/state/api/snapshot.ts index f57d77b44b324..4dd4f705e3ba1 100644 --- a/x-pack/plugins/uptime/public/state/api/snapshot.ts +++ b/x-pack/plugins/uptime/public/state/api/snapshot.ts @@ -4,8 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { API_URLS, SnapshotType, Snapshot } from '../../../common'; +import { SnapshotType, Snapshot } from '../../../common'; import { apiService } from './utils'; +import { API_URLS } from '../../../common'; export interface SnapShotQueryParams { dateRangeStart: string; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts index 8e0701688bc2d..283c7b2ae3f29 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts @@ -4,9 +4,10 @@ * you may not use this file except in compliance with the Elastic License. */ +import { CONTEXT_DEFAULTS } from '../../../common'; import { fetchPage } from './search'; import { UMElasticsearchQueryFn } from '../adapters'; -import { CONTEXT_DEFAULTS, MonitorSummary, SortOrder, CursorDirection } from '../../../common'; +import { MonitorSummary, SortOrder, CursorDirection } from '../../../common'; import { QueryContext } from './search'; export interface CursorPagination { diff --git a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts index 234b72162f249..01d377d23cb94 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts @@ -6,15 +6,8 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from './query_context'; -import { - QUERY, - STATES, - Check, - Histogram, - MonitorSummary, - CursorDirection, - SortOrder, -} from '../../../../common'; +import { QUERY, STATES } from '../../../../common'; +import { Check, Histogram, MonitorSummary, CursorDirection, SortOrder } from '../../../../common'; import { MonitorEnricher } from './fetch_page'; export const enrichMonitorGroups: MonitorEnricher = async ( From 3b9dfb2826a2d59dd12f2328c4e7d02587d273b7 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 28 Apr 2020 10:11:12 -0400 Subject: [PATCH 32/36] Update a translation description. --- x-pack/plugins/uptime/common/constants/plugin.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/uptime/common/constants/plugin.ts b/x-pack/plugins/uptime/common/constants/plugin.ts index 04ce6f54f2019..6064524872a0a 100644 --- a/x-pack/plugins/uptime/common/constants/plugin.ts +++ b/x-pack/plugins/uptime/common/constants/plugin.ts @@ -10,7 +10,7 @@ export const PLUGIN = { APP_ROOT_ID: 'react-uptime-root', DESCRIPTION: i18n.translate('xpack.uptime.pluginDescription', { defaultMessage: 'Uptime monitoring', - description: 'The description text that will be shown to users in Kibana', + description: 'The description text that will appear in the feature catalogue.', }), ID: 'uptime', LOCAL_STORAGE_KEY: 'xpack.uptime', From 7fff70f42b082b6048ba5fc238b3216d0156def0 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 28 Apr 2020 10:20:24 -0400 Subject: [PATCH 33/36] Revert "Clean up redundant common imports." This reverts commit 8794013fbeef776c6abdb504e10da1c17796c651. --- .../common/charts/__tests__/duration_charts.test.tsx | 2 +- .../common/charts/__tests__/monitor_bar_series.test.tsx | 2 +- .../public/components/common/charts/duration_chart.tsx | 2 +- .../components/common/charts/duration_line_series_list.tsx | 2 +- .../public/components/common/charts/monitor_bar_series.tsx | 2 +- .../public/components/common/charts/ping_histogram.tsx | 2 +- .../uptime/public/components/common/uptime_date_picker.tsx | 2 +- .../monitor/location_map/__tests__/location_map.test.tsx | 2 +- .../location_map/__tests__/location_status_tags.test.tsx | 2 +- .../monitor/location_map/embeddables/embedded_map.tsx | 2 +- .../public/components/monitor/location_map/location_map.tsx | 3 ++- .../monitor/location_map/location_status_tags.tsx | 3 ++- .../components/monitor/ml/__tests__/ml_flyout.test.tsx | 2 +- .../public/components/monitor/ml/ml_flyout_container.tsx | 2 +- .../monitor/monitor_duration/monitor_duration.tsx | 2 +- .../monitor/monitor_duration/monitor_duration_container.tsx | 2 +- .../__test__/monitor_ssl_certificate.test.tsx | 2 +- .../__test__/monitor_status.bar.test.tsx | 2 +- .../__test__/status_by_location.test.tsx | 2 +- .../monitor_status_bar/ssl_certificate.tsx | 2 +- .../monitor_status_bar/status_bar.tsx | 3 ++- .../monitor_status_bar/status_bar_container.tsx | 2 +- .../monitor_status_bar/status_by_location.tsx | 2 +- .../monitor/monitor_status_details/status_details.tsx | 2 +- .../monitor_status_details/status_details_container.tsx | 2 +- .../monitor/ping_list/__tests__/expanded_row.test.tsx | 2 +- .../monitor/ping_list/__tests__/ping_list.test.tsx | 2 +- .../public/components/monitor/ping_list/expanded_row.tsx | 2 +- .../public/components/monitor/ping_list/ping_list.tsx | 2 +- .../components/monitor/ping_list/ping_list_container.tsx | 2 +- .../public/components/overview/__tests__/snapshot.test.tsx | 2 +- .../overview/empty_state/__tests__/empty_state.test.tsx | 2 +- .../overview/empty_state/data_or_index_missing.tsx | 2 +- .../public/components/overview/empty_state/empty_state.tsx | 2 +- .../components/overview/filter_group/filter_group.tsx | 2 +- .../overview/filter_group/filter_group_container.tsx | 2 +- .../overview/monitor_list/__tests__/monitor_list.test.tsx | 6 +++++- .../__tests__/monitor_list_status_column.test.tsx | 3 ++- .../components/overview/monitor_list/monitor_list.tsx | 4 ++-- .../overview/monitor_list/monitor_list_container.tsx | 2 +- .../__tests__/integration_group.test.tsx | 2 +- .../__tests__/monitor_list_drawer.test.tsx | 2 +- .../__tests__/monitor_status_list.test.tsx | 2 +- .../__tests__/most_recent_error.test.tsx | 2 +- .../monitor_list_drawer/actions_popover/actions_popover.tsx | 2 +- .../actions_popover/integration_group.tsx | 2 +- .../monitor_list_drawer/list_drawer_container.tsx | 2 +- .../monitor_list_drawer/monitor_list_drawer.tsx | 2 +- .../monitor_list_drawer/monitor_status_list.tsx | 3 ++- .../monitor_list/monitor_list_drawer/monitor_status_row.tsx | 2 +- .../monitor_list/monitor_list_drawer/most_recent_error.tsx | 2 +- .../overview/monitor_list/monitor_list_status_column.tsx | 4 ++-- .../uptime/public/components/overview/snapshot/snapshot.tsx | 2 +- .../uptime/public/components/settings/certificate_form.tsx | 4 ++-- .../uptime/public/components/settings/indices_form.tsx | 2 +- .../uptime/public/contexts/uptime_settings_context.tsx | 2 +- .../uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx | 2 +- x-pack/plugins/uptime/public/hooks/use_telemetry.ts | 2 +- .../public/lib/adapters/framework/new_platform_adapter.tsx | 2 +- .../uptime/public/lib/helper/charts/get_chart_date_label.ts | 2 +- .../uptime/public/lib/helper/charts/get_label_format.ts | 2 +- .../__tests__/get_apm_href.test.ts | 2 +- .../__tests__/get_infra_href.test.ts | 2 +- .../__tests__/get_logging_href.test.ts | 2 +- .../lib/helper/observability_integration/build_href.ts | 2 +- .../lib/helper/observability_integration/get_apm_href.ts | 2 +- .../lib/helper/observability_integration/get_infra_href.ts | 2 +- .../helper/observability_integration/get_logging_href.ts | 2 +- .../uptime/public/lib/helper/series_has_down_values.ts | 2 +- .../uptime/public/lib/helper/stringify_url_params.ts | 2 +- .../url_params/__tests__/get_supported_url_params.test.ts | 2 +- .../lib/helper/url_params/get_supported_url_params.ts | 2 +- x-pack/plugins/uptime/public/pages/page_header.tsx | 2 +- x-pack/plugins/uptime/public/pages/settings.tsx | 4 ++-- x-pack/plugins/uptime/public/routes.tsx | 2 +- .../plugins/uptime/public/state/actions/dynamic_settings.ts | 2 +- x-pack/plugins/uptime/public/state/actions/index_status.ts | 2 +- x-pack/plugins/uptime/public/state/actions/monitor.ts | 4 ++-- x-pack/plugins/uptime/public/state/actions/monitor_list.ts | 2 +- .../plugins/uptime/public/state/actions/monitor_status.ts | 2 +- .../plugins/uptime/public/state/actions/overview_filters.ts | 2 +- x-pack/plugins/uptime/public/state/actions/ping.ts | 2 +- x-pack/plugins/uptime/public/state/actions/snapshot.ts | 2 +- x-pack/plugins/uptime/public/state/api/dynamic_settings.ts | 2 +- x-pack/plugins/uptime/public/state/api/index_pattern.ts | 2 +- x-pack/plugins/uptime/public/state/api/index_status.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/ml_anomaly.ts | 2 +- x-pack/plugins/uptime/public/state/api/monitor.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/monitor_duration.ts | 2 +- x-pack/plugins/uptime/public/state/api/monitor_list.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/monitor_status.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/overview_filters.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/ping.ts | 4 ++-- x-pack/plugins/uptime/public/state/api/snapshot.ts | 4 ++-- .../public/state/effects/__tests__/fetch_effect.test.ts | 2 +- .../plugins/uptime/public/state/effects/dynamic_settings.ts | 2 +- .../uptime/public/state/reducers/dynamic_settings.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/index_status.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/monitor.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/monitor_list.ts | 2 +- .../plugins/uptime/public/state/reducers/monitor_status.ts | 2 +- .../uptime/public/state/reducers/overview_filters.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/ping.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/ping_list.ts | 2 +- x-pack/plugins/uptime/public/state/reducers/snapshot.ts | 2 +- .../uptime/public/state/selectors/__tests__/index.test.ts | 2 +- x-pack/plugins/uptime/server/kibana.index.ts | 2 +- .../uptime/server/lib/adapters/framework/adapter_types.ts | 2 +- .../uptime/server/lib/requests/get_monitor_states.ts | 2 +- .../server/lib/requests/search/enrich_monitor_groups.ts | 2 +- .../uptime/server/rest_api/telemetry/log_page_view.ts | 2 +- 111 files changed, 132 insertions(+), 123 deletions(-) diff --git a/x-pack/plugins/uptime/public/components/common/charts/__tests__/duration_charts.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/__tests__/duration_charts.test.tsx index 019306842b48c..589fbc6bceb45 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/__tests__/duration_charts.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/__tests__/duration_charts.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import DateMath from '@elastic/datemath'; import { DurationChartComponent } from '../duration_chart'; -import { MonitorDurationResult } from '../../../../../common'; +import { MonitorDurationResult } from '../../../../../common/types'; import { shallowWithRouter } from '../../../../lib'; describe('MonitorCharts component', () => { diff --git a/x-pack/plugins/uptime/public/components/common/charts/__tests__/monitor_bar_series.test.tsx b/x-pack/plugins/uptime/public/components/common/charts/__tests__/monitor_bar_series.test.tsx index c43f07b7a1161..4522f8d633fa6 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/__tests__/monitor_bar_series.test.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/__tests__/monitor_bar_series.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { MonitorBarSeries, MonitorBarSeriesProps } from '../monitor_bar_series'; import { renderWithRouter, shallowWithRouter } from '../../../../lib'; -import { HistogramPoint } from '../../../../../common'; +import { HistogramPoint } from '../../../../../common/runtime_types'; describe('MonitorBarSeries component', () => { let props: MonitorBarSeriesProps; diff --git a/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx b/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx index e9903bd8a4005..c82b2a1cf9fe2 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/duration_chart.tsx @@ -10,7 +10,7 @@ import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n/react'; import { Axis, Chart, Position, timeFormatter, Settings, SeriesIdentifier } from '@elastic/charts'; import { getChartDateLabel } from '../../../lib/helper'; -import { LocationDurationLine } from '../../../../common'; +import { LocationDurationLine } from '../../../../common/types'; import { DurationLineSeriesList } from './duration_line_series_list'; import { ChartWrapper } from './chart_wrapper'; import { useUrlParams } from '../../../hooks'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/duration_line_series_list.tsx b/x-pack/plugins/uptime/public/components/common/charts/duration_line_series_list.tsx index 6e777ccdc089b..4223e918393b6 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/duration_line_series_list.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/duration_line_series_list.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { LineSeries, CurveType } from '@elastic/charts'; -import { LocationDurationLine } from '../../../../common'; +import { LocationDurationLine } from '../../../../common/types'; import { convertMicrosecondsToMilliseconds as microsToMillis } from '../../../lib/helper'; interface Props { diff --git a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx index 87e6574e88a12..5e11685e36140 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/monitor_bar_series.tsx @@ -18,7 +18,7 @@ import React, { useContext } from 'react'; import moment from 'moment'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiText, EuiToolTip } from '@elastic/eui'; -import { HistogramPoint } from '../../../../common'; +import { HistogramPoint } from '../../../../common/runtime_types'; import { getChartDateLabel, seriesHasDownValues } from '../../../lib/helper'; import { useUrlParams } from '../../../hooks'; import { UptimeThemeContext } from '../../../contexts'; diff --git a/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx b/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx index 24b92ad35809c..66e86d6731236 100644 --- a/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx +++ b/x-pack/plugins/uptime/public/components/common/charts/ping_histogram.tsx @@ -13,7 +13,7 @@ import moment from 'moment'; import { getChartDateLabel } from '../../../lib/helper'; import { ChartWrapper } from './chart_wrapper'; import { UptimeThemeContext } from '../../../contexts'; -import { HistogramResult } from '../../../../common'; +import { HistogramResult } from '../../../../common/runtime_types'; import { useUrlParams } from '../../../hooks'; import { ChartEmptyState } from './chart_empty_state'; diff --git a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx index 745b3cee98fa1..4254004dba4e0 100644 --- a/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx +++ b/x-pack/plugins/uptime/public/components/common/uptime_date_picker.tsx @@ -7,7 +7,7 @@ import React, { useContext } from 'react'; import { EuiSuperDatePicker } from '@elastic/eui'; import { useUrlParams } from '../../hooks'; -import { CLIENT_DEFAULTS } from '../../../common'; +import { CLIENT_DEFAULTS } from '../../../common/constants'; import { UptimeRefreshContext, UptimeSettingsContext } from '../../contexts'; // TODO: when EUI exports types for this, this should be replaced diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_map.test.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_map.test.tsx index 3e4cfae5fbd1e..1913e677dd674 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_map.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_map.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import { LocationMap } from '../location_map'; -import { MonitorLocations } from '../../../../../common'; +import { MonitorLocations } from '../../../../../common/runtime_types'; import { LocationMissingWarning } from '../location_missing'; // Note For shallow test, we need absolute time strings diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_status_tags.test.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_status_tags.test.tsx index a4ed5418a1a55..7dde38af99fc3 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_status_tags.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/__tests__/location_status_tags.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import moment from 'moment'; import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { MonitorLocation } from '../../../../../common'; +import { MonitorLocation } from '../../../../../common/runtime_types/monitor'; import { LocationStatusTags } from '../index'; describe('LocationStatusTags component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx index 906a3e0235199..06cdb07bd8bcd 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/embeddables/embedded_map.tsx @@ -9,7 +9,7 @@ import uuid from 'uuid'; import styled from 'styled-components'; import { MapEmbeddable, MapEmbeddableInput } from '../../../../../../../legacy/plugins/maps/public'; import * as i18n from './translations'; -import { Location } from '../../../../../common'; +import { Location } from '../../../../../common/runtime_types'; import { getLayerList } from './map_config'; import { UptimeThemeContext, UptimeStartupPluginsContext } from '../../../../contexts'; import { diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx index 572cf9aa035b0..27fe3a2274270 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/location_map.tsx @@ -9,7 +9,8 @@ import styled from 'styled-components'; import { EuiFlexGroup, EuiFlexItem, EuiErrorBoundary, EuiHideFor } from '@elastic/eui'; import { LocationStatusTags } from './location_status_tags'; import { EmbeddedMap, LocationPoint } from './embeddables/embedded_map'; -import { UNNAMED_LOCATION, MonitorLocations, MonitorLocation } from '../../../../common'; +import { MonitorLocations, MonitorLocation } from '../../../../common/runtime_types'; +import { UNNAMED_LOCATION } from '../../../../common/constants'; import { LocationMissingWarning } from './location_missing'; // These height/width values are used to make sure map is in center of panel diff --git a/x-pack/plugins/uptime/public/components/monitor/location_map/location_status_tags.tsx b/x-pack/plugins/uptime/public/components/monitor/location_map/location_status_tags.tsx index 401cff2694865..7f5f1d5c3b323 100644 --- a/x-pack/plugins/uptime/public/components/monitor/location_map/location_status_tags.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/location_map/location_status_tags.tsx @@ -10,7 +10,8 @@ import styled from 'styled-components'; import { EuiBadge, EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { UptimeThemeContext } from '../../../contexts'; -import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE, MonitorLocation } from '../../../../common'; +import { MonitorLocation } from '../../../../common/runtime_types'; +import { SHORT_TIMESPAN_LOCALE, SHORT_TS_LOCALE } from '../../../../common/constants'; const TimeStampSpan = styled.span` display: inline-block; diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/ml_flyout.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/ml_flyout.test.tsx index 17cdea257767f..31cdcfac9feef 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/ml_flyout.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/__tests__/ml_flyout.test.tsx @@ -8,7 +8,7 @@ import React from 'react'; import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import { MLFlyoutView } from '../ml_flyout'; import { UptimeSettingsContext } from '../../../../contexts'; -import { CLIENT_DEFAULTS } from '../../../../../common'; +import { CLIENT_DEFAULTS } from '../../../../../common/constants'; import { License } from '../../../../../../../plugins/licensing/common/license'; const expiredLicense = new License({ diff --git a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx index 41f055491eca6..6eec30d405f76 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ml/ml_flyout_container.tsx @@ -21,7 +21,7 @@ import { KibanaReactNotifications, } from '../../../../../../../src/plugins/kibana_react/public'; import { MLFlyoutView } from './ml_flyout'; -import { ML_JOB_ID } from '../../../../common'; +import { ML_JOB_ID } from '../../../../common/constants'; import { UptimeRefreshContext, UptimeSettingsContext } from '../../../contexts'; import { useGetUrlParams } from '../../../hooks'; import { getDynamicSettings } from '../../../state/actions/dynamic_settings'; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx index 4d2045d1e0934..af1c8dbdc49e3 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { FormattedMessage } from '@kbn/i18n/react'; import { EuiFlexGroup, EuiFlexItem, EuiPanel, EuiTitle } from '@elastic/eui'; -import { LocationDurationLine } from '../../../../common'; +import { LocationDurationLine } from '../../../../common/types'; import { MLIntegrationComponent } from '../ml/ml_integeration'; import { AnomalyRecords } from '../../../state/actions'; import { DurationChartComponent } from '../../common/charts'; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx index 4cc18fb7f2283..52d4f620f84b3 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_duration/monitor_duration_container.tsx @@ -22,7 +22,7 @@ import { UptimeRefreshContext } from '../../../contexts'; import { getMLJobId } from '../../../state/api/ml_anomaly'; import { JobStat } from '../../../../../ml/common/types/data_recognizer'; import { MonitorDurationComponent } from './monitor_duration'; -import { MonitorIdParam } from '../../../../common'; +import { MonitorIdParam } from '../../../../common/types'; export const MonitorDuration: React.FC = ({ monitorId }) => { const { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_ssl_certificate.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_ssl_certificate.test.tsx index d3e11ffcaf117..57ed09cc30ef1 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_ssl_certificate.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_ssl_certificate.test.tsx @@ -9,7 +9,7 @@ import moment from 'moment'; import { mountWithIntl } from 'test_utils/enzyme_helpers'; import { EuiBadge } from '@elastic/eui'; import { renderWithIntl } from 'test_utils/enzyme_helpers'; -import { Tls } from '../../../../../common'; +import { Tls } from '../../../../../common/runtime_types'; import { MonitorSSLCertificate } from '../monitor_status_bar'; describe('MonitorStatusBar component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_status.bar.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_status.bar.test.tsx index ea4ef572a7d40..5fd32c808da42 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_status.bar.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/monitor_status.bar.test.tsx @@ -8,7 +8,7 @@ import moment from 'moment'; import React from 'react'; import { renderWithIntl } from 'test_utils/enzyme_helpers'; import { MonitorStatusBarComponent } from '../monitor_status_bar'; -import { Ping } from '../../../../../common'; +import { Ping } from '../../../../../common/runtime_types'; describe('MonitorStatusBar component', () => { let monitorStatus: Ping; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/status_by_location.test.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/status_by_location.test.tsx index 9b01b270d9bae..b2619825311d7 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/status_by_location.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/__test__/status_by_location.test.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { MonitorLocation } from '../../../../../common'; +import { MonitorLocation } from '../../../../../common/runtime_types'; import { StatusByLocations } from '../index'; describe('StatusByLocation component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/ssl_certificate.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/ssl_certificate.tsx index b2ed6419ac12b..d92534aecd175 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/ssl_certificate.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/ssl_certificate.tsx @@ -9,7 +9,7 @@ import moment from 'moment'; import { EuiSpacer, EuiText, EuiBadge } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { i18n } from '@kbn/i18n'; -import { Tls } from '../../../../../common'; +import { Tls } from '../../../../../common/runtime_types'; interface Props { /** diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar.tsx index 359e4f5a73e80..36159dc29eccd 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar.tsx @@ -17,7 +17,8 @@ import { import { MonitorSSLCertificate } from './ssl_certificate'; import * as labels from './translations'; import { StatusByLocations } from './status_by_location'; -import { MonitorLocations, Ping } from '../../../../../common'; +import { Ping } from '../../../../../common/runtime_types'; +import { MonitorLocations } from '../../../../../common/runtime_types'; interface MonitorStatusBarProps { monitorId: string; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar_container.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar_container.tsx index 16fa53b028230..9562295437515 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_bar_container.tsx @@ -11,7 +11,7 @@ import { MonitorStatusBarComponent } from './index'; import { getMonitorStatusAction } from '../../../../state/actions'; import { useGetUrlParams } from '../../../../hooks'; import { UptimeRefreshContext } from '../../../../contexts'; -import { MonitorIdParam } from '../../../../../common'; +import { MonitorIdParam } from '../../../../../common/types'; import { AppState } from '../../../../state'; export const MonitorStatusBar: React.FC = ({ monitorId }) => { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_by_location.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_by_location.tsx index 95cb02d470056..461ffc10124fd 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_by_location.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/monitor_status_bar/status_by_location.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { EuiText } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; -import { MonitorLocation } from '../../../../../common'; +import { MonitorLocation } from '../../../../../common/runtime_types'; interface StatusByLocationsProps { locations: MonitorLocation[]; diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx index 6bf91a2c155e1..ebd16b05ecb4a 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details.tsx @@ -9,7 +9,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiPanel } from '@elastic/eui'; import styled from 'styled-components'; import { LocationMap } from '../location_map'; import { UptimeRefreshContext } from '../../../contexts'; -import { MonitorLocations } from '../../../../common'; +import { MonitorLocations } from '../../../../common/runtime_types'; import { MonitorStatusBar } from './monitor_status_bar'; interface MonitorStatusDetailsProps { diff --git a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details_container.tsx b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details_container.tsx index 242004fb519a2..251f3562f9d1a 100644 --- a/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/monitor_status_details/status_details_container.tsx @@ -12,7 +12,7 @@ import { getMonitorLocationsAction } from '../../../state/actions/monitor'; import { MonitorStatusDetailsComponent } from './index'; import { UptimeRefreshContext } from '../../../contexts'; import { AppState } from '../../../state'; -import { MonitorIdParam } from '../../../../common'; +import { MonitorIdParam } from '../../../../common/types'; export const MonitorStatusDetails: React.FC = ({ monitorId }) => { const { lastRefresh } = useContext(UptimeRefreshContext); diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/expanded_row.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/expanded_row.test.tsx index 0b0edaaab6cb5..2c1434cfd64bd 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/expanded_row.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/expanded_row.test.tsx @@ -7,7 +7,7 @@ import { mountWithIntl, renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import React from 'react'; import { PingListExpandedRowComponent } from '../expanded_row'; -import { Ping } from '../../../../../common'; +import { Ping } from '../../../../../common/runtime_types'; import { DocLinkForBody } from '../doc_link_body'; describe('PingListExpandedRow', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/ping_list.test.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/ping_list.test.tsx index 4cc80655884b3..cb8413ba08a81 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/ping_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/__tests__/ping_list.test.tsx @@ -7,7 +7,7 @@ import React from 'react'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import { PingListComponent, toggleDetails } from '../ping_list'; -import { Ping, PingsResponse } from '../../../../../common'; +import { Ping, PingsResponse } from '../../../../../common/runtime_types'; import { ExpandedRowMap } from '../../../overview/monitor_list/types'; describe('PingList component', () => { diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.tsx index 80c8037cf7313..28b96fcb1bf7b 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/expanded_row.tsx @@ -16,7 +16,7 @@ import { } from '@elastic/eui'; import React from 'react'; import { i18n } from '@kbn/i18n'; -import { Ping, HttpResponseBody } from '../../../../common'; +import { Ping, HttpResponseBody } from '../../../../common/runtime_types'; import { DocLinkForBody } from './doc_link_body'; interface Props { diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list.tsx index 9ba35008b31d3..5dfc1c0647430 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list.tsx @@ -23,7 +23,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import moment from 'moment'; import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; -import { Ping, GetPingsParams, DateRange } from '../../../../common'; +import { Ping, GetPingsParams, DateRange } from '../../../../common/runtime_types'; import { convertMicrosecondsToMilliseconds as microsToMillis } from '../../../lib/helper'; import { LocationName } from './location_name'; import { Pagination } from '../../overview/monitor_list'; diff --git a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx index 03fb237a9dd7c..3c3caab365e3a 100644 --- a/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx +++ b/x-pack/plugins/uptime/public/components/monitor/ping_list/ping_list_container.tsx @@ -8,7 +8,7 @@ import { useSelector, useDispatch } from 'react-redux'; import React, { useContext, useCallback } from 'react'; import { selectPingList } from '../../../state/selectors'; import { getPings } from '../../../state/actions'; -import { GetPingsParams } from '../../../../common'; +import { GetPingsParams } from '../../../../common/runtime_types'; import { UptimeSettingsContext } from '../../../contexts'; import { PingListComponent } from './index'; diff --git a/x-pack/plugins/uptime/public/components/overview/__tests__/snapshot.test.tsx b/x-pack/plugins/uptime/public/components/overview/__tests__/snapshot.test.tsx index 6d01a74fb49bf..cfcab673dcb35 100644 --- a/x-pack/plugins/uptime/public/components/overview/__tests__/snapshot.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/__tests__/snapshot.test.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; -import { Snapshot } from '../../../../common'; +import { Snapshot } from '../../../../common/runtime_types'; import { SnapshotComponent } from '../snapshot/snapshot'; describe('Snapshot component', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/empty_state.test.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/empty_state.test.tsx index 968f6d10622df..6328789d03f29 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/empty_state.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/__tests__/empty_state.test.tsx @@ -6,7 +6,7 @@ import React from 'react'; import { EmptyStateComponent } from '../empty_state'; -import { StatesIndexStatus } from '../../../../../common'; +import { StatesIndexStatus } from '../../../../../common/runtime_types'; import { HttpFetchError, IHttpFetchError } from 'src/core/public'; import { mountWithRouter, shallowWithRouter } from '../../../../lib'; diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/data_or_index_missing.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/data_or_index_missing.tsx index f990e68b11f6a..88c0920138f68 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/data_or_index_missing.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/data_or_index_missing.tsx @@ -16,7 +16,7 @@ import { import { FormattedMessage } from '@kbn/i18n/react'; import React, { useContext } from 'react'; import { UptimeSettingsContext } from '../../../contexts'; -import { DynamicSettings } from '../../../../common'; +import { DynamicSettings } from '../../../../common/runtime_types'; interface DataMissingProps { headingMessage: JSX.Element; diff --git a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx index ad79825b246dc..d38f203739cea 100644 --- a/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx +++ b/x-pack/plugins/uptime/public/components/overview/empty_state/empty_state.tsx @@ -9,7 +9,7 @@ import { FormattedMessage } from '@kbn/i18n/react'; import { EmptyStateError } from './empty_state_error'; import { EmptyStateLoading } from './empty_state_loading'; import { DataOrIndexMissing } from './data_or_index_missing'; -import { DynamicSettings, StatesIndexStatus } from '../../../../common'; +import { DynamicSettings, StatesIndexStatus } from '../../../../common/runtime_types'; import { IHttpFetchError } from '../../../../../../../target/types/core/public/http'; interface EmptyStateProps { diff --git a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx index 3dd2917f65201..ff73554c8f07c 100644 --- a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx +++ b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group.tsx @@ -9,7 +9,7 @@ import { EuiFilterGroup } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import { FilterPopoverProps, FilterPopover } from './filter_popover'; import { FilterStatusButton } from './filter_status_button'; -import { OverviewFilters } from '../../../../common'; +import { OverviewFilters } from '../../../../common/runtime_types/overview_filters'; interface PresentationalComponentProps { loading: boolean; diff --git a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx index 2934525146003..3612604fdf116 100644 --- a/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/filter_group/filter_group_container.tsx @@ -11,7 +11,7 @@ import { parseFiltersMap } from './parse_filter_map'; import { AppState } from '../../../state'; import { fetchOverviewFilters, GetOverviewFiltersPayload } from '../../../state/actions'; import { FilterGroupComponent } from './index'; -import { OverviewFilters } from '../../../../common'; +import { OverviewFilters } from '../../../../common/runtime_types/overview_filters'; import { UptimeRefreshContext } from '../../../contexts'; interface OwnProps { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx index c8d23adc8b6a4..9b1d799a23e37 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list.test.tsx @@ -5,7 +5,11 @@ */ import React from 'react'; -import { MonitorSummaryResult, CursorDirection, SortOrder } from '../../../../../common'; +import { + MonitorSummaryResult, + CursorDirection, + SortOrder, +} from '../../../../../common/runtime_types'; import { MonitorListComponent } from '../monitor_list'; import { renderWithRouter, shallowWithRouter } from '../../../../lib'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list_status_column.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list_status_column.test.tsx index 34c5ff47dc54e..d765c0b33ea4b 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list_status_column.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/__tests__/monitor_list_status_column.test.tsx @@ -8,7 +8,8 @@ import React from 'react'; import moment from 'moment'; import { renderWithIntl, shallowWithIntl } from 'test_utils/enzyme_helpers'; import { getLocationStatus, MonitorListStatusColumn } from '../monitor_list_status_column'; -import { STATUS, Check } from '../../../../../common'; +import { Check } from '../../../../../common/runtime_types'; +import { STATUS } from '../../../../../common/constants'; describe('MonitorListStatusColumn', () => { beforeAll(() => { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx index 21199e7f15d48..7e9536689470e 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list.tsx @@ -18,8 +18,8 @@ import { import { FormattedMessage } from '@kbn/i18n/react'; import React, { useState, useEffect } from 'react'; import styled from 'styled-components'; -import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common'; -import { MonitorSummary } from '../../../../common'; +import { HistogramPoint, FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types'; +import { MonitorSummary } from '../../../../common/runtime_types'; import { MonitorListStatusColumn } from './monitor_list_status_column'; import { ExpandedRowMap } from './types'; import { MonitorBarSeries } from '../../common/charts'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx index 610a19a6ee3d7..6fb880e28c734 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_container.tsx @@ -7,7 +7,7 @@ import React, { useCallback } from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { getMonitorList } from '../../../state/actions'; -import { FetchMonitorStatesQueryArgs } from '../../../../common'; +import { FetchMonitorStatesQueryArgs } from '../../../../common/runtime_types'; import { monitorListSelector } from '../../../state/selectors'; import { MonitorListComponent } from './monitor_list'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx index fd6ba696814e6..25cf400bcd0fd 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/integration_group.test.tsx @@ -5,7 +5,7 @@ */ import React from 'react'; -import { MonitorSummary } from '../../../../../../common'; +import { MonitorSummary } from '../../../../../../common/runtime_types'; import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import { IntegrationGroup } from '../actions_popover/integration_group'; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx index a68967307f15c..4bc0c3f0a40ba 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_list_drawer.test.tsx @@ -6,7 +6,7 @@ import 'jest'; import React from 'react'; import { MonitorListDrawerComponent } from '../monitor_list_drawer'; -import { Check, MonitorDetails, MonitorSummary } from '../../../../../../common'; +import { Check, MonitorDetails, MonitorSummary } from '../../../../../../common/runtime_types'; import { shallowWithRouter } from '../../../../../lib'; describe('MonitorListDrawer component', () => { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx index 4d6eb7bf1b6e9..c7f3aef4075e1 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/monitor_status_list.test.tsx @@ -8,7 +8,7 @@ import { shallowWithIntl } from 'test_utils/enzyme_helpers'; import React from 'react'; import moment from 'moment'; import { MonitorStatusList } from '../monitor_status_list'; -import { Check } from '../../../../../../common'; +import { Check } from '../../../../../../common/runtime_types'; describe('MonitorStatusList component', () => { let checks: Check[]; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx index 0dbd24a52cc05..173809b2d7f73 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/__tests__/most_recent_error.test.tsx @@ -9,7 +9,7 @@ import React from 'react'; import moment from 'moment'; import { BrowserRouter as Router } from 'react-router-dom'; import { MostRecentError } from '../most_recent_error'; -import { MonitorDetails, MonitorError } from '../../../../../../common'; +import { MonitorDetails, MonitorError } from '../../../../../../common/runtime_types'; describe('MostRecentError component', () => { let monitorDetails: MonitorDetails; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx index b64197660875b..e86e6b309214f 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/actions_popover.tsx @@ -9,7 +9,7 @@ import { i18n } from '@kbn/i18n'; import React from 'react'; import { EuiPopover, EuiButton } from '@elastic/eui'; import { IntegrationGroup } from './integration_group'; -import { MonitorSummary } from '../../../../../../common'; +import { MonitorSummary } from '../../../../../../common/runtime_types'; import { toggleIntegrationsPopover, PopoverState } from '../../../../../state/actions'; interface ActionsPopoverProps { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx index 4144742ce7d51..bbcba7238748d 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/actions_popover/integration_group.tsx @@ -19,7 +19,7 @@ import { getLoggingIpHref, getLoggingKubernetesHref, } from '../../../../../lib/helper'; -import { MonitorSummary } from '../../../../../../common'; +import { MonitorSummary } from '../../../../../../common/runtime_types'; import { UptimeSettingsContext } from '../../../../../contexts'; interface IntegrationGroupProps { diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx index cf61ece47fffd..bec32ace27f2b 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/list_drawer_container.tsx @@ -12,7 +12,7 @@ import { MonitorDetailsActionPayload } from '../../../../state/actions/types'; import { getMonitorDetailsAction } from '../../../../state/actions/monitor'; import { MonitorListDrawerComponent } from './monitor_list_drawer'; import { useGetUrlParams } from '../../../../hooks'; -import { MonitorDetails, MonitorSummary } from '../../../../../common'; +import { MonitorDetails, MonitorSummary } from '../../../../../common/runtime_types'; interface ContainerProps { summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx index 1108320b933f7..8e97ce4d692d7 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_list_drawer.tsx @@ -9,7 +9,7 @@ import styled from 'styled-components'; import { EuiLink, EuiSpacer, EuiFlexGroup, EuiFlexItem, EuiIcon, EuiText } from '@elastic/eui'; import { MostRecentError } from './most_recent_error'; import { MonitorStatusList } from './monitor_status_list'; -import { MonitorDetails, MonitorSummary } from '../../../../../common'; +import { MonitorDetails, MonitorSummary } from '../../../../../common/runtime_types'; import { ActionsPopover } from './actions_popover/actions_popover_container'; const ContainerDiv = styled.div` diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx index 187671c19f207..cd1a5a95b8adb 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_list.tsx @@ -10,7 +10,8 @@ import { EuiCallOut, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { LocationLink } from '../../../common/location_link'; import { MonitorStatusRow } from './monitor_status_row'; -import { STATUS, UNNAMED_LOCATION, Check } from '../../../../../common'; +import { Check } from '../../../../../common/runtime_types'; +import { STATUS, UNNAMED_LOCATION } from '../../../../../common/constants'; interface MonitorStatusListProps { /** diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx index fe9fed5a13153..50028e1ddea18 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/monitor_status_row.tsx @@ -8,7 +8,7 @@ import React, { useContext } from 'react'; import { EuiHealth, EuiSpacer } from '@elastic/eui'; import { FormattedMessage } from '@kbn/i18n/react'; import { UptimeThemeContext } from '../../../../contexts'; -import { UNNAMED_LOCATION, STATUS } from '../../../../../common'; +import { UNNAMED_LOCATION, STATUS } from '../../../../../common/constants'; interface MonitorStatusRowProps { /** diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx index 404fa7c5f159d..1963a9c852b11 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_drawer/most_recent_error.tsx @@ -10,7 +10,7 @@ import { i18n } from '@kbn/i18n'; import { MonitorPageLink } from '../monitor_page_link'; import { useGetUrlParams } from '../../../../hooks'; import { stringifyUrlParams } from '../../../../lib/helper/stringify_url_params'; -import { MonitorError } from '../../../../../common'; +import { MonitorError } from '../../../../../common/runtime_types'; interface MostRecentErrorProps { /** diff --git a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_status_column.tsx b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_status_column.tsx index 2b89586a886b5..8076fe66cc208 100644 --- a/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_status_column.tsx +++ b/x-pack/plugins/uptime/public/components/overview/monitor_list/monitor_list_status_column.tsx @@ -11,13 +11,13 @@ import { capitalize } from 'lodash'; import styled from 'styled-components'; import { EuiHealth, EuiFlexGroup, EuiFlexItem, EuiText, EuiToolTip } from '@elastic/eui'; import { parseTimestamp } from './parse_timestamp'; +import { Check } from '../../../../common/runtime_types'; import { STATUS, SHORT_TIMESPAN_LOCALE, UNNAMED_LOCATION, SHORT_TS_LOCALE, - Check, -} from '../../../../common'; +} from '../../../../common/constants'; import * as labels from './translations'; diff --git a/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.tsx b/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.tsx index 1e29c7063f7f8..8d6933ad18ced 100644 --- a/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.tsx +++ b/x-pack/plugins/uptime/public/components/overview/snapshot/snapshot.tsx @@ -9,7 +9,7 @@ import React from 'react'; import { DonutChart } from '../../common/charts'; import { ChartWrapper } from '../../common/charts/chart_wrapper'; import { SnapshotHeading } from './snapshot_heading'; -import { Snapshot as SnapshotType } from '../../../../common'; +import { Snapshot as SnapshotType } from '../../../../common/runtime_types'; const SNAPSHOT_CHART_WIDTH = 144; const SNAPSHOT_CHART_HEIGHT = 144; diff --git a/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx b/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx index e585400f9f421..209e38785e165 100644 --- a/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx +++ b/x-pack/plugins/uptime/public/components/settings/certificate_form.tsx @@ -17,8 +17,8 @@ import { EuiFlexGroup, EuiFlexItem, } from '@elastic/eui'; -import { CertStateThresholds } from '../../../common'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common'; +import { CertStateThresholds } from '../../../common/runtime_types'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants'; import { SettingsFormProps } from '../../pages/settings'; interface ChangedValues { diff --git a/x-pack/plugins/uptime/public/components/settings/indices_form.tsx b/x-pack/plugins/uptime/public/components/settings/indices_form.tsx index 0c101662e61bf..b9a5ca0e730de 100644 --- a/x-pack/plugins/uptime/public/components/settings/indices_form.tsx +++ b/x-pack/plugins/uptime/public/components/settings/indices_form.tsx @@ -14,7 +14,7 @@ import { EuiTitle, EuiSpacer, } from '@elastic/eui'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../common/constants'; import { SettingsFormProps } from '../../pages/settings'; export const IndicesForm: React.FC = ({ diff --git a/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx b/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx index 9e159cea7c41d..4fabf3f2ed497 100644 --- a/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx +++ b/x-pack/plugins/uptime/public/contexts/uptime_settings_context.tsx @@ -6,7 +6,7 @@ import React, { createContext, useMemo } from 'react'; import { UptimeAppProps } from '../uptime_app'; -import { CLIENT_DEFAULTS, CONTEXT_DEFAULTS } from '../../common'; +import { CLIENT_DEFAULTS, CONTEXT_DEFAULTS } from '../../common/constants'; import { CommonlyUsedRange } from '../components/common/uptime_date_picker'; import { useGetUrlParams } from '../hooks'; import { ILicense } from '../../../../plugins/licensing/common/types'; diff --git a/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx b/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx index 607ad6220e9a4..306919015fcb1 100644 --- a/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx +++ b/x-pack/plugins/uptime/public/hooks/__tests__/use_breadcrumbs.test.tsx @@ -8,7 +8,7 @@ import { ChromeBreadcrumb } from 'kibana/public'; import React from 'react'; import { Route } from 'react-router-dom'; import { mountWithRouter } from '../../lib'; -import { OVERVIEW_ROUTE } from '../../../common'; +import { OVERVIEW_ROUTE } from '../../../common/constants'; import { KibanaContextProvider } from '../../../../../../src/plugins/kibana_react/public'; import { UptimeUrlParams, getSupportedUrlParams } from '../../lib/helper'; import { makeBaseBreadcrumb, useBreadcrumbs } from '../use_breadcrumbs'; diff --git a/x-pack/plugins/uptime/public/hooks/use_telemetry.ts b/x-pack/plugins/uptime/public/hooks/use_telemetry.ts index 268cacc119f11..a2012b8ac5636 100644 --- a/x-pack/plugins/uptime/public/hooks/use_telemetry.ts +++ b/x-pack/plugins/uptime/public/hooks/use_telemetry.ts @@ -7,7 +7,7 @@ import { useEffect } from 'react'; import { useGetUrlParams } from './use_url_params'; import { apiService } from '../state/api/utils'; -import { API_URLS } from '../../common'; +import { API_URLS } from '../../common/constants'; export enum UptimePage { Overview = 'Overview', diff --git a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx index 36a38e41b6618..f7f9e056f41af 100644 --- a/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx +++ b/x-pack/plugins/uptime/public/lib/adapters/framework/new_platform_adapter.tsx @@ -17,7 +17,7 @@ import { PLUGIN, DEFAULT_DARK_MODE, DEFAULT_TIMEPICKER_QUICK_RANGES, -} from '../../../../common'; +} from '../../../../common/constants'; import { UMFrameworkAdapter } from '../../lib'; import { ClientPluginsStart, ClientPluginsSetup } from '../../../apps/plugin'; diff --git a/x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts b/x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts index 6aa6e101327cb..aa5a2b0f60e4f 100644 --- a/x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts +++ b/x-pack/plugins/uptime/public/lib/helper/charts/get_chart_date_label.ts @@ -6,7 +6,7 @@ import { isWithinCurrentDate } from './is_within_current_date'; import { getLabelFormat } from './get_label_format'; -import { CHART_FORMAT_LIMITS } from '../../../../common'; +import { CHART_FORMAT_LIMITS } from '../../../../common/constants'; /** * Generates an appropriate date formatting string intended for the y-axis diff --git a/x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts b/x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts index 69403dd901a69..5957123e9257d 100644 --- a/x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts +++ b/x-pack/plugins/uptime/public/lib/helper/charts/get_label_format.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CHART_FORMAT_LIMITS } from '../../../../common'; +import { CHART_FORMAT_LIMITS } from '../../../../common/constants'; const { EIGHT_MINUTES, diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts index 12345fc396781..f27ed78d593ac 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_apm_href.test.ts @@ -5,7 +5,7 @@ */ import { getApmHref } from '../get_apm_href'; -import { MonitorSummary } from '../../../../../common'; +import { MonitorSummary } from '../../../../../common/runtime_types'; describe('getApmHref', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts index e44676dd34068..ee5db74af22c2 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_infra_href.test.ts @@ -5,7 +5,7 @@ */ import { getInfraContainerHref, getInfraKubernetesHref, getInfraIpHref } from '../get_infra_href'; -import { MonitorSummary } from '../../../../../common'; +import { MonitorSummary } from '../../../../../common/runtime_types'; describe('getInfraHref', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts index 5b82d72d1eb90..b188a8d1b8ef6 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/__tests__/get_logging_href.test.ts @@ -9,7 +9,7 @@ import { getLoggingKubernetesHref, getLoggingIpHref, } from '../get_logging_href'; -import { MonitorSummary } from '../../../../../common'; +import { MonitorSummary } from '../../../../../common/runtime_types'; describe('getLoggingHref', () => { let summary: MonitorSummary; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts index f205236b956a4..0f830435be89d 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/build_href.ts @@ -5,7 +5,7 @@ */ import { get } from 'lodash'; -import { Check } from '../../../../common'; +import { Check } from '../../../../common/runtime_types'; /** * Builds URLs to the designated features by extracting values from the provided diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts index f48c5c251e655..0ff5a8acb3367 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_apm_href.ts @@ -6,7 +6,7 @@ import { get } from 'lodash'; import { addBasePath } from './add_base_path'; -import { MonitorSummary } from '../../../../common'; +import { MonitorSummary } from '../../../../common/runtime_types'; export const getApmHref = ( summary: MonitorSummary, diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts index 4ea3a600ff557..384067e4b033b 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_infra_href.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MonitorSummary } from '../../../../common'; +import { MonitorSummary } from '../../../../common/runtime_types'; import { addBasePath } from './add_base_path'; import { buildHref } from './build_href'; diff --git a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts index 1b87436041cc2..222c7b57c9272 100644 --- a/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts +++ b/x-pack/plugins/uptime/public/lib/helper/observability_integration/get_logging_href.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { MonitorSummary } from '../../../../common'; +import { MonitorSummary } from '../../../../common/runtime_types'; import { addBasePath } from './add_base_path'; import { buildHref } from './build_href'; diff --git a/x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts b/x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts index 4070c5c979436..4ebeb350ed892 100644 --- a/x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts +++ b/x-pack/plugins/uptime/public/lib/helper/series_has_down_values.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { HistogramPoint } from '../../../common'; +import { HistogramPoint } from '../../../common/runtime_types'; export const seriesHasDownValues = (series: HistogramPoint[] | null): boolean => { return series ? series.some(point => !!point.down) : false; diff --git a/x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts b/x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts index c91980f6a6173..a8ce86c4399e2 100644 --- a/x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts +++ b/x-pack/plugins/uptime/public/lib/helper/stringify_url_params.ts @@ -6,7 +6,7 @@ import { stringify } from 'query-string'; import { UptimeUrlParams } from './url_params'; -import { CLIENT_DEFAULTS } from '../../../common'; +import { CLIENT_DEFAULTS } from '../../../common/constants'; const { AUTOREFRESH_INTERVAL, diff --git a/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts index 3c7e247b13fda..483fed28ea6d4 100644 --- a/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts +++ b/x-pack/plugins/uptime/public/lib/helper/url_params/__tests__/get_supported_url_params.test.ts @@ -6,7 +6,7 @@ import DateMath from '@elastic/datemath'; import { getSupportedUrlParams } from '../get_supported_url_params'; -import { CLIENT_DEFAULTS } from '../../../../../common'; +import { CLIENT_DEFAULTS } from '../../../../../common/constants'; describe('getSupportedUrlParams', () => { let dateMathSpy: any; diff --git a/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts b/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts index 179fb56532e94..11dfc3f21b1bf 100644 --- a/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts +++ b/x-pack/plugins/uptime/public/lib/helper/url_params/get_supported_url_params.ts @@ -6,7 +6,7 @@ import { parseIsPaused } from './parse_is_paused'; import { parseUrlInt } from './parse_url_int'; -import { CLIENT_DEFAULTS } from '../../../../common'; +import { CLIENT_DEFAULTS } from '../../../../common/constants'; import { parseAbsoluteDate } from './parse_absolute_date'; export interface UptimeUrlParams { diff --git a/x-pack/plugins/uptime/public/pages/page_header.tsx b/x-pack/plugins/uptime/public/pages/page_header.tsx index 305c005f790f4..b10bc6ba44f8a 100644 --- a/x-pack/plugins/uptime/public/pages/page_header.tsx +++ b/x-pack/plugins/uptime/public/pages/page_header.tsx @@ -9,7 +9,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiTitle, EuiSpacer, EuiButtonEmpty } from ' import { i18n } from '@kbn/i18n'; import { Link } from 'react-router-dom'; import { UptimeDatePicker } from '../components/common/uptime_date_picker'; -import { SETTINGS_ROUTE } from '../../common'; +import { SETTINGS_ROUTE } from '../../common/constants'; import { ToggleAlertFlyoutButton } from '../components/overview/alerts/alerts_containers'; interface PageHeaderProps { diff --git a/x-pack/plugins/uptime/public/pages/settings.tsx b/x-pack/plugins/uptime/public/pages/settings.tsx index a28570fafafc7..52096a49435d7 100644 --- a/x-pack/plugins/uptime/public/pages/settings.tsx +++ b/x-pack/plugins/uptime/public/pages/settings.tsx @@ -21,9 +21,9 @@ import { isEqual } from 'lodash'; import { Link } from 'react-router-dom'; import { selectDynamicSettings } from '../state/selectors'; import { getDynamicSettings, setDynamicSettings } from '../state/actions/dynamic_settings'; -import { DynamicSettings } from '../../common'; +import { DynamicSettings } from '../../common/runtime_types'; import { useBreadcrumbs } from '../hooks/use_breadcrumbs'; -import { OVERVIEW_ROUTE } from '../../common'; +import { OVERVIEW_ROUTE } from '../../common/constants'; import { useKibana } from '../../../../../src/plugins/kibana_react/public'; import { UptimePage, useUptimeTelemetry } from '../hooks'; import { IndicesForm } from '../components/settings/indices_form'; diff --git a/x-pack/plugins/uptime/public/routes.tsx b/x-pack/plugins/uptime/public/routes.tsx index c1c4c74fcb892..eb0587c0417a2 100644 --- a/x-pack/plugins/uptime/public/routes.tsx +++ b/x-pack/plugins/uptime/public/routes.tsx @@ -8,7 +8,7 @@ import React, { FC } from 'react'; import { Route, Switch } from 'react-router-dom'; import { DataPublicPluginSetup } from '../../../../src/plugins/data/public'; import { OverviewPage } from './components/overview/overview_container'; -import { MONITOR_ROUTE, OVERVIEW_ROUTE, SETTINGS_ROUTE } from '../common'; +import { MONITOR_ROUTE, OVERVIEW_ROUTE, SETTINGS_ROUTE } from '../common/constants'; import { MonitorPage, NotFoundPage, SettingsPage } from './pages'; interface RouterProps { diff --git a/x-pack/plugins/uptime/public/state/actions/dynamic_settings.ts b/x-pack/plugins/uptime/public/state/actions/dynamic_settings.ts index 1aadc8fc8b257..3dbb1aa234621 100644 --- a/x-pack/plugins/uptime/public/state/actions/dynamic_settings.ts +++ b/x-pack/plugins/uptime/public/state/actions/dynamic_settings.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ import { createAction } from 'redux-actions'; -import { DynamicSettings } from '../../../common'; +import { DynamicSettings } from '../../../common/runtime_types'; export const getDynamicSettings = createAction('GET_DYNAMIC_SETTINGS'); export const getDynamicSettingsSuccess = createAction( diff --git a/x-pack/plugins/uptime/public/state/actions/index_status.ts b/x-pack/plugins/uptime/public/state/actions/index_status.ts index 34b9123f63d04..5c964052bb3de 100644 --- a/x-pack/plugins/uptime/public/state/actions/index_status.ts +++ b/x-pack/plugins/uptime/public/state/actions/index_status.ts @@ -5,6 +5,6 @@ */ import { createAsyncAction } from './utils'; -import { StatesIndexStatus } from '../../../common'; +import { StatesIndexStatus } from '../../../common/runtime_types'; export const indexStatusAction = createAsyncAction('GET INDEX STATUS'); diff --git a/x-pack/plugins/uptime/public/state/actions/monitor.ts b/x-pack/plugins/uptime/public/state/actions/monitor.ts index 38ae1500bd202..30ea8e71265e0 100644 --- a/x-pack/plugins/uptime/public/state/actions/monitor.ts +++ b/x-pack/plugins/uptime/public/state/actions/monitor.ts @@ -6,8 +6,8 @@ import { createAction } from 'redux-actions'; import { MonitorDetailsActionPayload } from './types'; -import { MonitorError } from '../../../common'; -import { MonitorLocations } from '../../../common'; +import { MonitorError } from '../../../common/runtime_types'; +import { MonitorLocations } from '../../../common/runtime_types'; import { QueryParams } from './types'; export interface MonitorLocationsPayload extends QueryParams { diff --git a/x-pack/plugins/uptime/public/state/actions/monitor_list.ts b/x-pack/plugins/uptime/public/state/actions/monitor_list.ts index f1a4fc01dd9e3..ee2267a9058af 100644 --- a/x-pack/plugins/uptime/public/state/actions/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/actions/monitor_list.ts @@ -5,7 +5,7 @@ */ import { createAction } from 'redux-actions'; -import { FetchMonitorStatesQueryArgs, MonitorSummaryResult } from '../../../common'; +import { FetchMonitorStatesQueryArgs, MonitorSummaryResult } from '../../../common/runtime_types'; export const getMonitorList = createAction('GET_MONITOR_LIST'); export const getMonitorListSuccess = createAction('GET_MONITOR_LIST_SUCCESS'); diff --git a/x-pack/plugins/uptime/public/state/actions/monitor_status.ts b/x-pack/plugins/uptime/public/state/actions/monitor_status.ts index 6a60ac83d9baf..3d480e66c9e0b 100644 --- a/x-pack/plugins/uptime/public/state/actions/monitor_status.ts +++ b/x-pack/plugins/uptime/public/state/actions/monitor_status.ts @@ -6,7 +6,7 @@ import { createAction } from 'redux-actions'; import { QueryParams } from './types'; -import { Ping } from '../../../common'; +import { Ping } from '../../../common/runtime_types'; export const getMonitorStatusAction = createAction('GET_MONITOR_STATUS'); export const getMonitorStatusActionSuccess = createAction('GET_MONITOR_STATUS_SUCCESS'); diff --git a/x-pack/plugins/uptime/public/state/actions/overview_filters.ts b/x-pack/plugins/uptime/public/state/actions/overview_filters.ts index bf021d4e6e8a7..dbbd01e34b4d4 100644 --- a/x-pack/plugins/uptime/public/state/actions/overview_filters.ts +++ b/x-pack/plugins/uptime/public/state/actions/overview_filters.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { OverviewFilters } from '../../../common'; +import { OverviewFilters } from '../../../common/runtime_types'; export const FETCH_OVERVIEW_FILTERS = 'FETCH_OVERVIEW_FILTERS'; export const FETCH_OVERVIEW_FILTERS_FAIL = 'FETCH_OVERVIEW_FILTERS_FAIL'; diff --git a/x-pack/plugins/uptime/public/state/actions/ping.ts b/x-pack/plugins/uptime/public/state/actions/ping.ts index 3ee64ea6dc1bb..70918a4cc70e5 100644 --- a/x-pack/plugins/uptime/public/state/actions/ping.ts +++ b/x-pack/plugins/uptime/public/state/actions/ping.ts @@ -10,7 +10,7 @@ import { HistogramResult, PingsResponse, GetPingsParams, -} from '../../../common'; +} from '../../../common/runtime_types'; export const getPingHistogram = createAction('GET_PING_HISTOGRAM'); export const getPingHistogramSuccess = createAction('GET_PING_HISTOGRAM_SUCCESS'); diff --git a/x-pack/plugins/uptime/public/state/actions/snapshot.ts b/x-pack/plugins/uptime/public/state/actions/snapshot.ts index 2d826e4804b3a..e819a553e61f5 100644 --- a/x-pack/plugins/uptime/public/state/actions/snapshot.ts +++ b/x-pack/plugins/uptime/public/state/actions/snapshot.ts @@ -5,7 +5,7 @@ */ import { createAction } from 'redux-actions'; -import { Snapshot } from '../../../common'; +import { Snapshot } from '../../../common/runtime_types'; export interface GetSnapshotPayload { dateRangeStart: string; diff --git a/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts b/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts index b4e3d39d934b4..e52e40c53513c 100644 --- a/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts +++ b/x-pack/plugins/uptime/public/state/api/dynamic_settings.ts @@ -9,7 +9,7 @@ import { DynamicSettings, DynamicSettingsSaveResponse, DynamicSettingsSaveType, -} from '../../../common'; +} from '../../../common/runtime_types'; import { apiService } from './utils'; const apiPath = '/api/uptime/dynamic_settings'; diff --git a/x-pack/plugins/uptime/public/state/api/index_pattern.ts b/x-pack/plugins/uptime/public/state/api/index_pattern.ts index a1bf5bb64ac9b..1eecbc75c5bf4 100644 --- a/x-pack/plugins/uptime/public/state/api/index_pattern.ts +++ b/x-pack/plugins/uptime/public/state/api/index_pattern.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; import { apiService } from './utils'; export const fetchIndexPattern = async () => { diff --git a/x-pack/plugins/uptime/public/state/api/index_status.ts b/x-pack/plugins/uptime/public/state/api/index_status.ts index 08dc8659ca6a0..0e33ab617777a 100644 --- a/x-pack/plugins/uptime/public/state/api/index_status.ts +++ b/x-pack/plugins/uptime/public/state/api/index_status.ts @@ -4,8 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { API_URLS } from '../../../common'; -import { StatesIndexStatus, StatesIndexStatusType } from '../../../common'; +import { API_URLS } from '../../../common/constants'; +import { StatesIndexStatus, StatesIndexStatusType } from '../../../common/runtime_types'; import { apiService } from './utils'; export const fetchIndexStatus = async (): Promise => { diff --git a/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts b/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts index 126b81c8db653..37929cf33c018 100644 --- a/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts +++ b/x-pack/plugins/uptime/public/state/api/ml_anomaly.ts @@ -7,7 +7,7 @@ import moment from 'moment'; import { apiService } from './utils'; import { AnomalyRecords, AnomalyRecordsParams } from '../actions'; -import { API_URLS, ML_JOB_ID, ML_MODULE_ID } from '../../../common'; +import { API_URLS, ML_JOB_ID, ML_MODULE_ID } from '../../../common/constants'; import { MlCapabilitiesResponse } from '../../../../../plugins/ml/common/types/capabilities'; import { CreateMLJobSuccess, diff --git a/x-pack/plugins/uptime/public/state/api/monitor.ts b/x-pack/plugins/uptime/public/state/api/monitor.ts index 6900f8b2cfc32..c3d0a0180cf51 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor.ts @@ -5,10 +5,10 @@ */ import { BaseParams } from './types'; -import { MonitorDetailsType, MonitorLocationsType } from '../../../common'; +import { MonitorDetailsType, MonitorLocationsType } from '../../../common/runtime_types'; import { QueryParams } from '../actions/types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; interface ApiRequest { monitorId: string; diff --git a/x-pack/plugins/uptime/public/state/api/monitor_duration.ts b/x-pack/plugins/uptime/public/state/api/monitor_duration.ts index 75114a9bbf26a..91034f1784b15 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_duration.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_duration.ts @@ -6,7 +6,7 @@ import { BaseParams } from './types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const fetchMonitorDuration = async ({ monitorId, dateStart, dateEnd }: BaseParams) => { const queryParams = { diff --git a/x-pack/plugins/uptime/public/state/api/monitor_list.ts b/x-pack/plugins/uptime/public/state/api/monitor_list.ts index 121f632380879..084bcb4bd2a91 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_list.ts @@ -4,13 +4,13 @@ * you may not use this file except in compliance with the Elastic License. */ -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; import { apiService } from './utils'; import { FetchMonitorStatesQueryArgs, MonitorSummaryResult, MonitorSummaryResultType, -} from '../../../common'; +} from '../../../common/runtime_types'; export const fetchMonitorList = async ( params: FetchMonitorStatesQueryArgs diff --git a/x-pack/plugins/uptime/public/state/api/monitor_status.ts b/x-pack/plugins/uptime/public/state/api/monitor_status.ts index cfd1ba863acdd..7c8ab3518b5a0 100644 --- a/x-pack/plugins/uptime/public/state/api/monitor_status.ts +++ b/x-pack/plugins/uptime/public/state/api/monitor_status.ts @@ -5,8 +5,8 @@ */ import { QueryParams } from '../actions/types'; -import { Ping } from '../../../common'; -import { API_URLS } from '../../../common'; +import { Ping } from '../../../common/runtime_types'; +import { API_URLS } from '../../../common/constants'; import { apiService } from './utils'; export const fetchMonitorStatus = async ({ diff --git a/x-pack/plugins/uptime/public/state/api/overview_filters.ts b/x-pack/plugins/uptime/public/state/api/overview_filters.ts index 6e98994152a57..6330d8a912210 100644 --- a/x-pack/plugins/uptime/public/state/api/overview_filters.ts +++ b/x-pack/plugins/uptime/public/state/api/overview_filters.ts @@ -5,9 +5,9 @@ */ import { GetOverviewFiltersPayload } from '../actions'; -import { OverviewFiltersType } from '../../../common'; +import { OverviewFiltersType } from '../../../common/runtime_types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const fetchOverviewFilters = async ({ dateRangeStart, diff --git a/x-pack/plugins/uptime/public/state/api/ping.ts b/x-pack/plugins/uptime/public/state/api/ping.ts index eb67c7477d081..6de27879a49f5 100644 --- a/x-pack/plugins/uptime/public/state/api/ping.ts +++ b/x-pack/plugins/uptime/public/state/api/ping.ts @@ -11,9 +11,9 @@ import { GetPingsParams, GetPingHistogramParams, HistogramResult, -} from '../../../common'; +} from '../../../common/runtime_types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const fetchPings: APIFn = async ({ dateRange: { from, to }, diff --git a/x-pack/plugins/uptime/public/state/api/snapshot.ts b/x-pack/plugins/uptime/public/state/api/snapshot.ts index 4dd4f705e3ba1..9ee53dd2cbcef 100644 --- a/x-pack/plugins/uptime/public/state/api/snapshot.ts +++ b/x-pack/plugins/uptime/public/state/api/snapshot.ts @@ -4,9 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ -import { SnapshotType, Snapshot } from '../../../common'; +import { SnapshotType, Snapshot } from '../../../common/runtime_types'; import { apiService } from './utils'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export interface SnapShotQueryParams { dateRangeStart: string; diff --git a/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts b/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts index d47a72f857a8c..4ec35d8cd6c6f 100644 --- a/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts +++ b/x-pack/plugins/uptime/public/state/effects/__tests__/fetch_effect.test.ts @@ -8,7 +8,7 @@ import { call, put } from 'redux-saga/effects'; import { fetchEffectFactory } from '../fetch_effect'; import { indexStatusAction } from '../../actions'; import { HttpFetchError } from 'src/core/public'; -import { StatesIndexStatus } from '../../../../common'; +import { StatesIndexStatus } from '../../../../common/runtime_types'; import { fetchIndexStatus } from '../../api'; describe('fetch saga effect factory', () => { diff --git a/x-pack/plugins/uptime/public/state/effects/dynamic_settings.ts b/x-pack/plugins/uptime/public/state/effects/dynamic_settings.ts index 2443a467c584b..bee92813aa1f0 100644 --- a/x-pack/plugins/uptime/public/state/effects/dynamic_settings.ts +++ b/x-pack/plugins/uptime/public/state/effects/dynamic_settings.ts @@ -20,7 +20,7 @@ import { getDynamicSettings as getDynamicSettingsAPI, setDynamicSettings as setDynamicSettingsAPI, } from '../api'; -import { DynamicSettings } from '../../../common'; +import { DynamicSettings } from '../../../common/runtime_types'; import { kibanaService } from '../kibana_service'; export function* fetchDynamicSettingsEffect() { diff --git a/x-pack/plugins/uptime/public/state/reducers/dynamic_settings.ts b/x-pack/plugins/uptime/public/state/reducers/dynamic_settings.ts index 2ef11dafda6b8..a9ad58e64e552 100644 --- a/x-pack/plugins/uptime/public/state/reducers/dynamic_settings.ts +++ b/x-pack/plugins/uptime/public/state/reducers/dynamic_settings.ts @@ -12,7 +12,7 @@ import { setDynamicSettingsSuccess, setDynamicSettingsFail, } from '../actions/dynamic_settings'; -import { DynamicSettings } from '../../../common'; +import { DynamicSettings } from '../../../common/runtime_types'; export interface DynamicSettingsState { settings?: DynamicSettings; diff --git a/x-pack/plugins/uptime/public/state/reducers/index_status.ts b/x-pack/plugins/uptime/public/state/reducers/index_status.ts index 805a4a70c9868..1a93eb43775f3 100644 --- a/x-pack/plugins/uptime/public/state/reducers/index_status.ts +++ b/x-pack/plugins/uptime/public/state/reducers/index_status.ts @@ -8,7 +8,7 @@ import { handleActions } from 'redux-actions'; import { indexStatusAction } from '../actions'; import { getAsyncInitialState, handleAsyncAction } from './utils'; import { AsyncInitialState } from './types'; -import { StatesIndexStatus } from '../../../common'; +import { StatesIndexStatus } from '../../../common/runtime_types'; export interface IndexStatusState { indexStatus: AsyncInitialState; diff --git a/x-pack/plugins/uptime/public/state/reducers/monitor.ts b/x-pack/plugins/uptime/public/state/reducers/monitor.ts index 0e7fbe1fa4083..632f3a270e1a1 100644 --- a/x-pack/plugins/uptime/public/state/reducers/monitor.ts +++ b/x-pack/plugins/uptime/public/state/reducers/monitor.ts @@ -14,7 +14,7 @@ import { getMonitorLocationsActionSuccess, getMonitorLocationsActionFail, } from '../actions/monitor'; -import { MonitorLocations } from '../../../common'; +import { MonitorLocations } from '../../../common/runtime_types'; type MonitorLocationsList = Map; diff --git a/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts b/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts index c7f2f26ddaa33..cf895aebeb755 100644 --- a/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts +++ b/x-pack/plugins/uptime/public/state/reducers/monitor_list.ts @@ -6,7 +6,7 @@ import { handleActions, Action } from 'redux-actions'; import { getMonitorList, getMonitorListSuccess, getMonitorListFailure } from '../actions'; -import { MonitorSummaryResult } from '../../../common'; +import { MonitorSummaryResult } from '../../../common/runtime_types'; export interface MonitorList { list: MonitorSummaryResult; diff --git a/x-pack/plugins/uptime/public/state/reducers/monitor_status.ts b/x-pack/plugins/uptime/public/state/reducers/monitor_status.ts index fc57bb924483d..a98e89a27a711 100644 --- a/x-pack/plugins/uptime/public/state/reducers/monitor_status.ts +++ b/x-pack/plugins/uptime/public/state/reducers/monitor_status.ts @@ -9,7 +9,7 @@ import { getMonitorStatusActionSuccess, getMonitorStatusActionFail, } from '../actions'; -import { Ping } from '../../../common'; +import { Ping } from '../../../common/runtime_types'; import { QueryParams } from '../actions/types'; export interface MonitorStatusState { diff --git a/x-pack/plugins/uptime/public/state/reducers/overview_filters.ts b/x-pack/plugins/uptime/public/state/reducers/overview_filters.ts index c0dfbd8964d71..0b67d8b0e7689 100644 --- a/x-pack/plugins/uptime/public/state/reducers/overview_filters.ts +++ b/x-pack/plugins/uptime/public/state/reducers/overview_filters.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { OverviewFilters } from '../../../common'; +import { OverviewFilters } from '../../../common/runtime_types'; import { FETCH_OVERVIEW_FILTERS, FETCH_OVERVIEW_FILTERS_FAIL, diff --git a/x-pack/plugins/uptime/public/state/reducers/ping.ts b/x-pack/plugins/uptime/public/state/reducers/ping.ts index 7723281d153cf..4c8715038ce36 100644 --- a/x-pack/plugins/uptime/public/state/reducers/ping.ts +++ b/x-pack/plugins/uptime/public/state/reducers/ping.ts @@ -6,7 +6,7 @@ import { handleActions, Action } from 'redux-actions'; import { getPingHistogram, getPingHistogramSuccess, getPingHistogramFail } from '../actions'; -import { HistogramResult } from '../../../common'; +import { HistogramResult } from '../../../common/runtime_types'; export interface PingState { pingHistogram: HistogramResult | null; diff --git a/x-pack/plugins/uptime/public/state/reducers/ping_list.ts b/x-pack/plugins/uptime/public/state/reducers/ping_list.ts index 64d472ad36176..e3ccb1e663eda 100644 --- a/x-pack/plugins/uptime/public/state/reducers/ping_list.ts +++ b/x-pack/plugins/uptime/public/state/reducers/ping_list.ts @@ -5,7 +5,7 @@ */ import { handleActions, Action } from 'redux-actions'; -import { PingsResponse } from '../../../common'; +import { PingsResponse } from '../../../common/runtime_types'; import { getPings, getPingsSuccess, getPingsFail } from '../actions'; export interface PingListState { diff --git a/x-pack/plugins/uptime/public/state/reducers/snapshot.ts b/x-pack/plugins/uptime/public/state/reducers/snapshot.ts index 72896956a46da..3ba1ef84d41a5 100644 --- a/x-pack/plugins/uptime/public/state/reducers/snapshot.ts +++ b/x-pack/plugins/uptime/public/state/reducers/snapshot.ts @@ -5,7 +5,7 @@ */ import { Action } from 'redux-actions'; -import { Snapshot } from '../../../common'; +import { Snapshot } from '../../../common/runtime_types'; import { getSnapshotCountAction, getSnapshotCountActionSuccess, diff --git a/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts b/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts index 580ee78191137..ba5e5abf588b8 100644 --- a/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts +++ b/x-pack/plugins/uptime/public/state/selectors/__tests__/index.test.ts @@ -6,7 +6,7 @@ import { getBasePath, isIntegrationsPopupOpen } from '../index'; import { AppState } from '../../../state'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; describe('state selectors', () => { const state: AppState = { diff --git a/x-pack/plugins/uptime/server/kibana.index.ts b/x-pack/plugins/uptime/server/kibana.index.ts index 52c1d7e130cf3..d68bbabe82b86 100644 --- a/x-pack/plugins/uptime/server/kibana.index.ts +++ b/x-pack/plugins/uptime/server/kibana.index.ts @@ -5,7 +5,7 @@ */ import { Request, Server } from 'hapi'; -import { PLUGIN } from '../common'; +import { PLUGIN } from '../common/constants'; import { compose } from './lib/compose/kibana'; import { initUptimeServer } from './uptime_server'; import { UptimeCorePlugins, UptimeCoreSetup } from './lib/adapters/framework'; diff --git a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts index 1999dda006427..f4d1c72770494 100644 --- a/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts +++ b/x-pack/plugins/uptime/server/lib/adapters/framework/adapter_types.ts @@ -13,7 +13,7 @@ import { } from 'src/core/server'; import { UMKibanaRoute } from '../../../rest_api'; import { PluginSetupContract } from '../../../../../features/server'; -import { DynamicSettings } from '../../../../common'; +import { DynamicSettings } from '../../../../common/runtime_types'; export type APICaller = ( endpoint: string, diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts index 283c7b2ae3f29..63334db0d22b9 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CONTEXT_DEFAULTS } from '../../../common'; +import { CONTEXT_DEFAULTS } from '../../../common/constants'; import { fetchPage } from './search'; import { UMElasticsearchQueryFn } from '../adapters'; import { MonitorSummary, SortOrder, CursorDirection } from '../../../common'; diff --git a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts index 01d377d23cb94..b6df453ff6c62 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts @@ -6,7 +6,7 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from './query_context'; -import { QUERY, STATES } from '../../../../common'; +import { QUERY, STATES } from '../../../../common/constants'; import { Check, Histogram, MonitorSummary, CursorDirection, SortOrder } from '../../../../common'; import { MonitorEnricher } from './fetch_page'; diff --git a/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts b/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts index e57e54120c368..d8387e79e9089 100644 --- a/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts +++ b/x-pack/plugins/uptime/server/rest_api/telemetry/log_page_view.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; import { KibanaTelemetryAdapter } from '../../lib/adapters/telemetry'; import { UMRestApiRouteFactory } from '../types'; import { PageViewParams } from '../../lib/adapters/telemetry/types'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const createLogPageViewRoute: UMRestApiRouteFactory = () => ({ method: 'POST', From 04ce6cc3432223b4e4bfc04344b71333330b80ff Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 28 Apr 2020 10:59:09 -0400 Subject: [PATCH 34/36] Remove new common index file and revert imports from only common to more specific paths. --- x-pack/plugins/uptime/common/index.ts | 9 --------- x-pack/plugins/uptime/public/apps/plugin.ts | 2 +- .../uptime/public/lib/alert_types/monitor_status.tsx | 2 +- .../server/lib/alerts/__tests__/status_check.test.ts | 2 +- x-pack/plugins/uptime/server/lib/alerts/status_check.ts | 4 ++-- .../uptime/server/lib/helper/get_histogram_interval.ts | 2 +- .../server/lib/requests/__tests__/get_certs.test.ts | 2 +- .../lib/requests/__tests__/get_latest_monitor.test.ts | 2 +- .../lib/requests/__tests__/get_monitor_charts.test.ts | 2 +- .../lib/requests/__tests__/get_monitor_status.test.ts | 2 +- .../lib/requests/__tests__/get_ping_histogram.test.ts | 2 +- .../server/lib/requests/__tests__/get_pings.test.ts | 2 +- x-pack/plugins/uptime/server/lib/requests/get_certs.ts | 2 +- .../plugins/uptime/server/lib/requests/get_filter_bar.ts | 2 +- .../uptime/server/lib/requests/get_index_status.ts | 2 +- .../uptime/server/lib/requests/get_latest_monitor.ts | 2 +- .../uptime/server/lib/requests/get_monitor_details.ts | 2 +- .../uptime/server/lib/requests/get_monitor_duration.ts | 3 ++- .../uptime/server/lib/requests/get_monitor_locations.ts | 3 ++- .../uptime/server/lib/requests/get_monitor_states.ts | 2 +- .../uptime/server/lib/requests/get_ping_histogram.ts | 3 ++- x-pack/plugins/uptime/server/lib/requests/get_pings.ts | 7 ++++++- .../uptime/server/lib/requests/get_snapshot_counts.ts | 3 ++- .../lib/requests/search/__tests__/fetch_page.test.ts | 2 +- .../lib/requests/search/__tests__/query_context.test.ts | 2 +- .../server/lib/requests/search/__tests__/test_helpers.ts | 2 +- .../server/lib/requests/search/enrich_monitor_groups.ts | 8 +++++++- .../uptime/server/lib/requests/search/fetch_page.ts | 3 ++- .../server/lib/requests/search/find_potential_matches.ts | 2 +- .../server/lib/requests/search/monitor_group_iterator.ts | 2 +- .../lib/requests/search/refine_potential_matches.ts | 2 +- .../plugins/uptime/server/lib/requests/search/types.ts | 2 +- .../uptime/server/lib/requests/uptime_requests.ts | 4 ++-- x-pack/plugins/uptime/server/lib/saved_objects.ts | 3 ++- x-pack/plugins/uptime/server/rest_api/certs.ts | 2 +- .../plugins/uptime/server/rest_api/dynamic_settings.ts | 2 +- .../server/rest_api/index_state/get_index_pattern.ts | 2 +- .../server/rest_api/index_state/get_index_status.ts | 2 +- .../uptime/server/rest_api/monitors/monitor_list.ts | 2 +- .../uptime/server/rest_api/monitors/monitor_locations.ts | 2 +- .../uptime/server/rest_api/monitors/monitor_status.ts | 2 +- .../uptime/server/rest_api/monitors/monitors_details.ts | 2 +- .../server/rest_api/monitors/monitors_durations.ts | 2 +- .../rest_api/overview_filters/get_overview_filters.ts | 2 +- .../uptime/server/rest_api/pings/get_ping_histogram.ts | 2 +- x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts | 3 ++- .../server/rest_api/snapshot/get_snapshot_count.ts | 2 +- x-pack/plugins/uptime/server/rest_api/types.ts | 2 +- 48 files changed, 67 insertions(+), 58 deletions(-) delete mode 100644 x-pack/plugins/uptime/common/index.ts diff --git a/x-pack/plugins/uptime/common/index.ts b/x-pack/plugins/uptime/common/index.ts deleted file mode 100644 index eab7787488083..0000000000000 --- a/x-pack/plugins/uptime/common/index.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * 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 * from './constants'; -export * from './runtime_types'; -export * from './types'; diff --git a/x-pack/plugins/uptime/public/apps/plugin.ts b/x-pack/plugins/uptime/public/apps/plugin.ts index be35549138015..719dac022dada 100644 --- a/x-pack/plugins/uptime/public/apps/plugin.ts +++ b/x-pack/plugins/uptime/public/apps/plugin.ts @@ -6,7 +6,7 @@ import { LegacyCoreStart, AppMountParameters } from 'src/core/public'; import { CoreSetup, CoreStart, Plugin, PluginInitializerContext } from 'kibana/public'; import { UMFrontendLibs } from '../lib/lib'; -import { PLUGIN } from '../../common'; +import { PLUGIN } from '../../common/constants'; import { FeatureCatalogueCategory } from '../../../../../src/plugins/home/public'; import { getKibanaFrameworkAdapter } from '../lib/adapters/framework/new_platform_adapter'; import { HomePublicPluginSetup } from '../../../../../src/plugins/home/public'; diff --git a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx index d6f98a865b264..e7695fb1cbb56 100644 --- a/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx +++ b/x-pack/plugins/uptime/public/lib/alert_types/monitor_status.tsx @@ -10,7 +10,7 @@ import DateMath from '@elastic/datemath'; import { isRight } from 'fp-ts/lib/Either'; import { AlertTypeModel } from '../../../../triggers_actions_ui/public'; import { AlertTypeInitializer } from '.'; -import { StatusCheckExecutorParamsType } from '../../../common'; +import { StatusCheckExecutorParamsType } from '../../../common/runtime_types'; import { AlertMonitorStatus } from '../../components/overview/alerts/alerts_containers'; export const validate = (alertParams: any) => { diff --git a/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts b/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts index 988cfb4ed285c..24da3f3fa4d06 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/__tests__/status_check.test.ts @@ -16,7 +16,7 @@ import { AlertType } from '../../../../../alerting/server'; import { IRouter } from 'kibana/server'; import { UMServerLibs } from '../../lib'; import { UptimeCoreSetup } from '../../adapters'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; import { alertsMock, AlertServicesMock } from '../../../../../alerting/server/mocks'; /** diff --git a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts index 5bac4b468112e..f9df559a3977b 100644 --- a/x-pack/plugins/uptime/server/lib/alerts/status_check.ts +++ b/x-pack/plugins/uptime/server/lib/alerts/status_check.ts @@ -12,11 +12,11 @@ import { AlertExecutorOptions } from '../../../../alerting/server'; import { UptimeAlertTypeFactory } from './types'; import { GetMonitorStatusResult } from '../requests'; import { - ACTION_GROUP_DEFINITIONS, StatusCheckExecutorParamsType, StatusCheckAlertStateType, StatusCheckAlertState, -} from '../../../common'; +} from '../../../common/runtime_types'; +import { ACTION_GROUP_DEFINITIONS } from '../../../common/constants'; import { savedObjectsAdapter } from '../saved_objects'; const { MONITOR_STATUS } = ACTION_GROUP_DEFINITIONS; diff --git a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts index d10513bccb4f2..26515fb4b4c63 100644 --- a/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts +++ b/x-pack/plugins/uptime/server/lib/helper/get_histogram_interval.ts @@ -5,7 +5,7 @@ */ import DateMath from '@elastic/datemath'; -import { QUERY } from '../../../common'; +import { QUERY } from '../../../common/constants'; export const parseRelativeDate = (dateStr: string, options = {}) => { // We need this this parsing because if user selects This week or this date diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts index c8a8855066108..894e2316dc927 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_certs.test.ts @@ -5,7 +5,7 @@ */ import { getCerts } from '../get_certs'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; describe('getCerts', () => { let mockHits: any; diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_latest_monitor.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_latest_monitor.test.ts index 061312ce4706a..75bf5096bd997 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_latest_monitor.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_latest_monitor.test.ts @@ -5,7 +5,7 @@ */ import { getLatestMonitor } from '../get_latest_monitor'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; describe('getLatestMonitor', () => { let expectedGetLatestSearchParams: any; diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts index bec14556c647a..45be1df3e8d3b 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_charts.test.ts @@ -7,7 +7,7 @@ import { set } from 'lodash'; import mockChartsData from './monitor_charts_mock.json'; import { getMonitorDurationChart } from '../get_monitor_duration'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; describe('ElasticsearchMonitorsAdapter', () => { it('getMonitorChartsData will provide expected filters', async () => { diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_status.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_status.test.ts index 9178aab9f3c6b..82e624221c301 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_status.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_monitor_status.test.ts @@ -7,7 +7,7 @@ import { elasticsearchServiceMock } from '../../../../../../../src/core/server/mocks'; import { getMonitorStatus } from '../get_monitor_status'; import { ScopedClusterClient } from 'src/core/server'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; interface BucketItemCriteria { monitor_id: string; diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts index a81efc603ac13..e456670a5e68d 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_ping_histogram.test.ts @@ -5,7 +5,7 @@ */ import { getPingHistogram } from '../get_ping_histogram'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; describe('getPingHistogram', () => { const standardMockResponse: any = { diff --git a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_pings.test.ts b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_pings.test.ts index e006266d66a52..fd890a30cf742 100644 --- a/x-pack/plugins/uptime/server/lib/requests/__tests__/get_pings.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/__tests__/get_pings.test.ts @@ -6,7 +6,7 @@ import { getPings } from '../get_pings'; import { set } from 'lodash'; -import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../common/constants'; describe('getAll', () => { let mockEsSearchResult: any; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_certs.ts b/x-pack/plugins/uptime/server/lib/requests/get_certs.ts index c3f14fc517730..b427e7cae1a7e 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_certs.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_certs.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { Cert, GetCertsParams } from '../../../common'; +import { Cert, GetCertsParams } from '../../../common/runtime_types'; export const getCerts: UMElasticsearchQueryFn = async ({ callES, diff --git a/x-pack/plugins/uptime/server/lib/requests/get_filter_bar.ts b/x-pack/plugins/uptime/server/lib/requests/get_filter_bar.ts index 389146dee041d..dbe71cf689214 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_filter_bar.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_filter_bar.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { OverviewFilters } from '../../../common'; +import { OverviewFilters } from '../../../common/runtime_types'; import { generateFilterAggs } from './generate_filter_aggs'; export interface GetFilterBarParams { diff --git a/x-pack/plugins/uptime/server/lib/requests/get_index_status.ts b/x-pack/plugins/uptime/server/lib/requests/get_index_status.ts index a8ac7875e60aa..7688f04f1acd9 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_index_status.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_index_status.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { StatesIndexStatus } from '../../../common'; +import { StatesIndexStatus } from '../../../common/runtime_types'; export const getIndexStatus: UMElasticsearchQueryFn<{}, StatesIndexStatus> = async ({ callES, diff --git a/x-pack/plugins/uptime/server/lib/requests/get_latest_monitor.ts b/x-pack/plugins/uptime/server/lib/requests/get_latest_monitor.ts index 9b53f1e6bbea8..98ce449002f21 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_latest_monitor.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_latest_monitor.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { Ping } from '../../../common'; +import { Ping } from '../../../common/runtime_types'; export interface GetLatestMonitorParams { /** @member dateRangeStart timestamp bounds */ diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts index 5ebc4e4db5970..cf4ffa339ddfc 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_details.ts @@ -5,7 +5,7 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { MonitorDetails, MonitorError } from '../../../common'; +import { MonitorDetails, MonitorError } from '../../../common/runtime_types'; export interface GetMonitorDetailsParams { monitorId: string; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts index 4fadf9035dd90..ea2a7e790652b 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_duration.ts @@ -5,7 +5,8 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { LocationDurationLine, MonitorDurationResult, QUERY } from '../../../common'; +import { LocationDurationLine, MonitorDurationResult } from '../../../common/types'; +import { QUERY } from '../../../common/constants'; export interface GetMonitorChartsParams { /** @member monitorId ID value for the selected monitor */ diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_locations.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_locations.ts index add20509dbc66..c8d3ca043edc5 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_locations.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_locations.ts @@ -5,7 +5,8 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { UNNAMED_LOCATION, MonitorLocations, MonitorLocation } from '../../../common'; +import { MonitorLocations, MonitorLocation } from '../../../common/runtime_types'; +import { UNNAMED_LOCATION } from '../../../common/constants'; /** * Fetch data for the monitor page title. diff --git a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts index 63334db0d22b9..b1791dd04861c 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_monitor_states.ts @@ -7,7 +7,7 @@ import { CONTEXT_DEFAULTS } from '../../../common/constants'; import { fetchPage } from './search'; import { UMElasticsearchQueryFn } from '../adapters'; -import { MonitorSummary, SortOrder, CursorDirection } from '../../../common'; +import { MonitorSummary, SortOrder, CursorDirection } from '../../../common/runtime_types'; import { QueryContext } from './search'; export interface CursorPagination { diff --git a/x-pack/plugins/uptime/server/lib/requests/get_ping_histogram.ts b/x-pack/plugins/uptime/server/lib/requests/get_ping_histogram.ts index 2a14a864e240c..299913c8dff08 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_ping_histogram.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_ping_histogram.ts @@ -6,7 +6,8 @@ import { UMElasticsearchQueryFn } from '../adapters'; import { getFilterClause } from '../helper'; -import { QUERY, HistogramResult, HistogramQueryResult } from '../../../common'; +import { HistogramResult, HistogramQueryResult } from '../../../common/runtime_types'; +import { QUERY } from '../../../common/constants'; export interface GetPingHistogramParams { /** @member dateRangeStart timestamp bounds */ diff --git a/x-pack/plugins/uptime/server/lib/requests/get_pings.ts b/x-pack/plugins/uptime/server/lib/requests/get_pings.ts index dedc0986fdd0c..a6a0e3c3d6542 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_pings.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_pings.ts @@ -5,7 +5,12 @@ */ import { UMElasticsearchQueryFn } from '../adapters/framework'; -import { GetPingsParams, HttpResponseBody, PingsResponse, Ping } from '../../../common'; +import { + GetPingsParams, + HttpResponseBody, + PingsResponse, + Ping, +} from '../../../common/runtime_types'; const DEFAULT_PAGE_SIZE = 25; diff --git a/x-pack/plugins/uptime/server/lib/requests/get_snapshot_counts.ts b/x-pack/plugins/uptime/server/lib/requests/get_snapshot_counts.ts index b9ea82e57f789..b57bc87d45418 100644 --- a/x-pack/plugins/uptime/server/lib/requests/get_snapshot_counts.ts +++ b/x-pack/plugins/uptime/server/lib/requests/get_snapshot_counts.ts @@ -5,7 +5,8 @@ */ import { UMElasticsearchQueryFn } from '../adapters'; -import { CONTEXT_DEFAULTS, Snapshot } from '../../../common'; +import { CONTEXT_DEFAULTS } from '../../../common/constants'; +import { Snapshot } from '../../../common/runtime_types'; import { QueryContext } from './search'; export interface GetSnapshotCountParams { diff --git a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/fetch_page.test.ts b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/fetch_page.test.ts index 990fa163f6094..d4ad80c85ec3d 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/fetch_page.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/fetch_page.test.ts @@ -12,7 +12,7 @@ import { MonitorGroupsPage, } from '../fetch_page'; import { QueryContext } from '../query_context'; -import { MonitorSummary } from '../../../../../common'; +import { MonitorSummary } from '../../../../../common/runtime_types'; import { nextPagination, prevPagination, simpleQueryContext } from './test_helpers'; const simpleFixture: MonitorGroups[] = [ diff --git a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/query_context.test.ts b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/query_context.test.ts index 4d3f639db252e..e53fff429dd8d 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/query_context.test.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/query_context.test.ts @@ -6,7 +6,7 @@ import { QueryContext } from '../query_context'; import { CursorPagination } from '../types'; -import { CursorDirection, SortOrder } from '../../../../../common'; +import { CursorDirection, SortOrder } from '../../../../../common/runtime_types'; describe(QueryContext, () => { // 10 minute range diff --git a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/test_helpers.ts b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/test_helpers.ts index 3358080a60c46..40775bde1c7f5 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/__tests__/test_helpers.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/__tests__/test_helpers.ts @@ -5,7 +5,7 @@ */ import { CursorPagination } from '../types'; -import { CursorDirection, SortOrder } from '../../../../../common'; +import { CursorDirection, SortOrder } from '../../../../../common/runtime_types'; import { QueryContext } from '../query_context'; export const prevPagination = (key: any): CursorPagination => { diff --git a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts index b6df453ff6c62..d21259fad77a6 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/enrich_monitor_groups.ts @@ -7,7 +7,13 @@ import { get, sortBy } from 'lodash'; import { QueryContext } from './query_context'; import { QUERY, STATES } from '../../../../common/constants'; -import { Check, Histogram, MonitorSummary, CursorDirection, SortOrder } from '../../../../common'; +import { + Check, + Histogram, + MonitorSummary, + CursorDirection, + SortOrder, +} from '../../../../common/runtime_types'; import { MonitorEnricher } from './fetch_page'; export const enrichMonitorGroups: MonitorEnricher = async ( diff --git a/x-pack/plugins/uptime/server/lib/requests/search/fetch_page.ts b/x-pack/plugins/uptime/server/lib/requests/search/fetch_page.ts index a0b2ed4ae5da3..bef8106ad1896 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/fetch_page.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/fetch_page.ts @@ -7,7 +7,8 @@ import { flatten } from 'lodash'; import { CursorPagination } from './types'; import { QueryContext } from './query_context'; -import { CursorDirection, MonitorSummary, SortOrder, QUERY } from '../../../../common'; +import { QUERY } from '../../../../common/constants'; +import { CursorDirection, MonitorSummary, SortOrder } from '../../../../common/runtime_types'; import { enrichMonitorGroups } from './enrich_monitor_groups'; import { MonitorGroupIterator } from './monitor_group_iterator'; diff --git a/x-pack/plugins/uptime/server/lib/requests/search/find_potential_matches.ts b/x-pack/plugins/uptime/server/lib/requests/search/find_potential_matches.ts index d082de1916bc7..e60c52660915a 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/find_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/find_potential_matches.ts @@ -5,7 +5,7 @@ */ import { get, set } from 'lodash'; -import { CursorDirection } from '../../../../common'; +import { CursorDirection } from '../../../../common/runtime_types'; import { QueryContext } from './query_context'; // This is the first phase of the query. In it, we find the most recent check groups that matched the given query. diff --git a/x-pack/plugins/uptime/server/lib/requests/search/monitor_group_iterator.ts b/x-pack/plugins/uptime/server/lib/requests/search/monitor_group_iterator.ts index e8bd3d959c943..2fb9562028258 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/monitor_group_iterator.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/monitor_group_iterator.ts @@ -6,7 +6,7 @@ import { QueryContext } from './query_context'; import { fetchChunk } from './fetch_chunk'; -import { CursorDirection } from '../../../../common'; +import { CursorDirection } from '../../../../common/runtime_types'; import { MonitorGroups } from './fetch_page'; import { CursorPagination } from './types'; diff --git a/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts b/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts index 1b65b8ac4c15b..977c32ad1f984 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/refine_potential_matches.ts @@ -5,7 +5,7 @@ */ import { QueryContext } from './query_context'; -import { CursorDirection } from '../../../../common'; +import { CursorDirection } from '../../../../common/runtime_types'; import { MonitorGroups, MonitorLocCheckGroup } from './fetch_page'; /** diff --git a/x-pack/plugins/uptime/server/lib/requests/search/types.ts b/x-pack/plugins/uptime/server/lib/requests/search/types.ts index 3a13c56d08c42..35e9647196454 100644 --- a/x-pack/plugins/uptime/server/lib/requests/search/types.ts +++ b/x-pack/plugins/uptime/server/lib/requests/search/types.ts @@ -4,7 +4,7 @@ * you may not use this file except in compliance with the Elastic License. */ -import { CursorDirection, SortOrder } from '../../../../common'; +import { CursorDirection, SortOrder } from '../../../../common/runtime_types'; export interface CursorPagination { cursorKey?: any; diff --git a/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts b/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts index 6a24fdec6cf05..69507d2950cd8 100644 --- a/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts +++ b/x-pack/plugins/uptime/server/lib/requests/uptime_requests.ts @@ -14,11 +14,11 @@ import { Cert, OverviewFilters, MonitorDetails, - MonitorDurationResult, MonitorLocations, Snapshot, StatesIndexStatus, -} from '../../../common'; +} from '../../../common/runtime_types'; +import { MonitorDurationResult } from '../../../common/types'; import { GetFilterBarParams, GetLatestMonitorParams, diff --git a/x-pack/plugins/uptime/server/lib/saved_objects.ts b/x-pack/plugins/uptime/server/lib/saved_objects.ts index 5d4b1d62c4201..28b9eaad2cf6f 100644 --- a/x-pack/plugins/uptime/server/lib/saved_objects.ts +++ b/x-pack/plugins/uptime/server/lib/saved_objects.ts @@ -4,7 +4,8 @@ * you may not use this file except in compliance with the Elastic License. */ -import { DYNAMIC_SETTINGS_DEFAULTS, DynamicSettings } from '../../common'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../common/constants'; +import { DynamicSettings } from '../../common/runtime_types'; import { SavedObjectsType, SavedObjectsErrorHelpers } from '../../../../../src/core/server'; import { UMSavedObjectsQueryFn } from './adapters'; diff --git a/x-pack/plugins/uptime/server/rest_api/certs.ts b/x-pack/plugins/uptime/server/rest_api/certs.ts index e4270de148cff..f2e1700b23e7d 100644 --- a/x-pack/plugins/uptime/server/rest_api/certs.ts +++ b/x-pack/plugins/uptime/server/rest_api/certs.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../lib/lib'; import { UMRestApiRouteFactory } from '.'; -import { API_URLS } from '../../common'; +import { API_URLS } from '../../common/constants'; const DEFAULT_INDEX = 0; const DEFAULT_SIZE = 25; diff --git a/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts b/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts index fdd82d22fc03b..31833a25ee8ac 100644 --- a/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts +++ b/x-pack/plugins/uptime/server/rest_api/dynamic_settings.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; import { isRight } from 'fp-ts/lib/Either'; import { PathReporter } from 'io-ts/lib/PathReporter'; import { UMServerLibs } from '../lib/lib'; -import { DynamicSettings, DynamicSettingsType } from '../../common'; +import { DynamicSettings, DynamicSettingsType } from '../../common/runtime_types'; import { UMRestApiRouteFactory } from '.'; import { savedObjectsAdapter } from '../lib/saved_objects'; diff --git a/x-pack/plugins/uptime/server/rest_api/index_state/get_index_pattern.ts b/x-pack/plugins/uptime/server/rest_api/index_state/get_index_pattern.ts index 3da0def1c5906..26715f0ff37b6 100644 --- a/x-pack/plugins/uptime/server/rest_api/index_state/get_index_pattern.ts +++ b/x-pack/plugins/uptime/server/rest_api/index_state/get_index_pattern.ts @@ -6,7 +6,7 @@ import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const createGetIndexPatternRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/index_state/get_index_status.ts b/x-pack/plugins/uptime/server/rest_api/index_state/get_index_status.ts index 9171ef1b52f4d..9a4280efa98f9 100644 --- a/x-pack/plugins/uptime/server/rest_api/index_state/get_index_status.ts +++ b/x-pack/plugins/uptime/server/rest_api/index_state/get_index_status.ts @@ -6,7 +6,7 @@ import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const createGetIndexStatusRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_list.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_list.ts index 31f20154a9c7c..60b3eafaa765e 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_list.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_list.ts @@ -6,7 +6,7 @@ import { schema } from '@kbn/config-schema'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS, CONTEXT_DEFAULTS } from '../../../common'; +import { API_URLS, CONTEXT_DEFAULTS } from '../../../common/constants'; export const createMonitorListRoute: UMRestApiRouteFactory = libs => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts index 945696b7cea07..a110209043a7e 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_locations.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const createGetMonitorLocationsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_status.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_status.ts index 0f12c33f281b2..bb002f8a8c286 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitor_status.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitor_status.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const createGetStatusBarRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts index 893d5f968a199..69e719efb0719 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_details.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const createGetMonitorDetailsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts index 60acd583937be..34313211061b0 100644 --- a/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts +++ b/x-pack/plugins/uptime/server/rest_api/monitors/monitors_durations.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const createGetMonitorDurationRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts b/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts index d1ab44fc33323..00cbaf0d16723 100644 --- a/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts +++ b/x-pack/plugins/uptime/server/rest_api/overview_filters/get_overview_filters.ts @@ -8,7 +8,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; import { objectValuesToArrays } from '../../lib/helper'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; const arrayOrStringType = schema.maybe( schema.oneOf([schema.string(), schema.arrayOf(schema.string())]) diff --git a/x-pack/plugins/uptime/server/rest_api/pings/get_ping_histogram.ts b/x-pack/plugins/uptime/server/rest_api/pings/get_ping_histogram.ts index 2d2cda5baa7c4..41078f735920b 100644 --- a/x-pack/plugins/uptime/server/rest_api/pings/get_ping_histogram.ts +++ b/x-pack/plugins/uptime/server/rest_api/pings/get_ping_histogram.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const createGetPingHistogramRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts b/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts index 3bba5cc9e54af..d97195a7fe2b1 100644 --- a/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts +++ b/x-pack/plugins/uptime/server/rest_api/pings/get_pings.ts @@ -9,7 +9,8 @@ import { isLeft } from 'fp-ts/lib/Either'; import { PathReporter } from 'io-ts/lib/PathReporter'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS, GetPingsParamsType } from '../../../common'; +import { API_URLS } from '../../../common/constants'; +import { GetPingsParamsType } from '../../../common/runtime_types'; export const createGetPingsRoute: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts b/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts index 6e2dced6d87b3..7809e102a499f 100644 --- a/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts +++ b/x-pack/plugins/uptime/server/rest_api/snapshot/get_snapshot_count.ts @@ -7,7 +7,7 @@ import { schema } from '@kbn/config-schema'; import { UMServerLibs } from '../../lib/lib'; import { UMRestApiRouteFactory } from '../types'; -import { API_URLS } from '../../../common'; +import { API_URLS } from '../../../common/constants'; export const createGetSnapshotCount: UMRestApiRouteFactory = (libs: UMServerLibs) => ({ method: 'GET', diff --git a/x-pack/plugins/uptime/server/rest_api/types.ts b/x-pack/plugins/uptime/server/rest_api/types.ts index 2be6e08d1b4b7..8720b9dc60b12 100644 --- a/x-pack/plugins/uptime/server/rest_api/types.ts +++ b/x-pack/plugins/uptime/server/rest_api/types.ts @@ -16,7 +16,7 @@ import { KibanaResponseFactory, IKibanaResponse, } from 'kibana/server'; -import { DynamicSettings } from '../../common'; +import { DynamicSettings } from '../../common/runtime_types'; import { UMServerLibs } from '../lib/lib'; /** From 4db4d9ca9254196345b845c025dd80b938f9a281 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 28 Apr 2020 12:24:02 -0400 Subject: [PATCH 35/36] Fix broken imports in `~/x-pack/test`. --- .../test/api_integration/apis/uptime/feature_controls.ts | 2 +- x-pack/test/api_integration/apis/uptime/rest/certs.ts | 3 ++- x-pack/test/api_integration/apis/uptime/rest/doc_count.ts | 2 +- .../api_integration/apis/uptime/rest/dynamic_settings.ts | 7 ++----- .../apis/uptime/rest/monitor_states_generated.ts | 3 ++- .../apis/uptime/rest/monitor_states_real_data.ts | 3 ++- x-pack/test/api_integration/apis/uptime/rest/ping_list.ts | 2 +- .../apis/uptime/rest/telemetry_collectors.ts | 2 +- x-pack/test/functional/apps/uptime/settings.ts | 3 ++- x-pack/test/functional/services/uptime/settings.ts | 2 +- 10 files changed, 15 insertions(+), 14 deletions(-) diff --git a/x-pack/test/api_integration/apis/uptime/feature_controls.ts b/x-pack/test/api_integration/apis/uptime/feature_controls.ts index 7e5d22ad2e198..6c566ec7cb23b 100644 --- a/x-pack/test/api_integration/apis/uptime/feature_controls.ts +++ b/x-pack/test/api_integration/apis/uptime/feature_controls.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; import { PINGS_DATE_RANGE_END, PINGS_DATE_RANGE_START } from './constants'; -import { API_URLS } from '../../../../plugins/uptime/common'; +import { API_URLS } from '../../../../plugins/uptime/common/constants'; export default function featureControlsTests({ getService }: FtrProviderContext) { const supertest = getService('supertestWithoutAuth'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/certs.ts b/x-pack/test/api_integration/apis/uptime/rest/certs.ts index 9935962fb65c2..a3a15d8f8b014 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/certs.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/certs.ts @@ -8,7 +8,8 @@ import expect from '@kbn/expect'; import moment from 'moment'; import { isRight } from 'fp-ts/lib/Either'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { API_URLS, CertType } from '../../../../../plugins/uptime/common'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; +import { CertType } from '../../../../../plugins/uptime/common/runtime_types'; import { makeChecksWithStatus } from './helper/make_checks'; export default function({ getService }: FtrProviderContext) { diff --git a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts index eb4f14a0d8a61..f343cd1da8788 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/doc_count.ts @@ -5,7 +5,7 @@ */ import { FtrProviderContext } from '../../../ftr_provider_context'; import { expectFixtureEql } from './helper/expect_fixture_eql'; -import { API_URLS } from '../../../../../plugins/uptime/common'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; export default function({ getService }: FtrProviderContext) { describe('docCount query', () => { diff --git a/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts b/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts index 7ed9995c81cbd..95caf50d1ca7a 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/dynamic_settings.ts @@ -7,11 +7,8 @@ import expect from '@kbn/expect'; import { isRight } from 'fp-ts/lib/Either'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { - DYNAMIC_SETTINGS_DEFAULTS, - DynamicSettingsType, -} from '../../../../../plugins/uptime/common'; - +import { DynamicSettingsType } from '../../../../../plugins/uptime/common/runtime_types'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../../plugins/uptime/common/constants'; export default function({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts index ef75969a7a4dc..c3d5849e028ab 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_generated.ts @@ -7,7 +7,8 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; import { makeChecksWithStatus } from './helper/make_checks'; -import { API_URLS, MonitorSummary } from '../../../../../plugins/uptime/common'; +import { MonitorSummary } from '../../../../../plugins/uptime/common/runtime_types'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; export default function({ getService }: FtrProviderContext) { const supertest = getService('supertest'); diff --git a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts index e8c4b14bae06d..c5a691312f525 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/monitor_states_real_data.ts @@ -7,7 +7,8 @@ import expect from '@kbn/expect'; import { isRight } from 'fp-ts/lib/Either'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { API_URLS, MonitorSummaryResultType } from '../../../../../plugins/uptime/common'; +import { MonitorSummaryResultType } from '../../../../../plugins/uptime/common/runtime_types'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; interface ExpectedMonitorStatesPage { response: any; diff --git a/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts b/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts index 783d43ff24222..3d754d89cf9be 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/ping_list.ts @@ -7,7 +7,7 @@ import expect from '@kbn/expect'; import { isLeft } from 'fp-ts/lib/Either'; import { PathReporter } from 'io-ts/lib/PathReporter'; -import { PingsResponseType } from '../../../../../plugins/uptime/common'; +import { PingsResponseType } from '../../../../../plugins/uptime/common/runtime_types'; import { FtrProviderContext } from '../../../ftr_provider_context'; function decodePingsResponseData(response: any) { diff --git a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts index 7470d99c9e213..99e09aa5ce886 100644 --- a/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts +++ b/x-pack/test/api_integration/apis/uptime/rest/telemetry_collectors.ts @@ -6,7 +6,7 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../../ftr_provider_context'; -import { API_URLS } from '../../../../../plugins/uptime/common'; +import { API_URLS } from '../../../../../plugins/uptime/common/constants'; import { makeChecksWithStatus } from './helper/make_checks'; export default function({ getService }: FtrProviderContext) { diff --git a/x-pack/test/functional/apps/uptime/settings.ts b/x-pack/test/functional/apps/uptime/settings.ts index 6c5ead3649cb7..7a813a5cdfb52 100644 --- a/x-pack/test/functional/apps/uptime/settings.ts +++ b/x-pack/test/functional/apps/uptime/settings.ts @@ -6,7 +6,8 @@ import expect from '@kbn/expect'; import { FtrProviderContext } from '../../ftr_provider_context'; -import { DYNAMIC_SETTINGS_DEFAULTS, DynamicSettings } from '../../../../plugins/uptime/common'; +import { DynamicSettings } from '../../../../plugins/uptime/common/runtime_types'; +import { DYNAMIC_SETTINGS_DEFAULTS } from '../../../../plugins/uptime/common/constants'; import { makeChecks } from '../../../api_integration/apis/uptime/rest/helper/make_checks'; export default ({ getPageObjects, getService }: FtrProviderContext) => { diff --git a/x-pack/test/functional/services/uptime/settings.ts b/x-pack/test/functional/services/uptime/settings.ts index f4b5c475ec206..96f5e45ce2ca4 100644 --- a/x-pack/test/functional/services/uptime/settings.ts +++ b/x-pack/test/functional/services/uptime/settings.ts @@ -5,7 +5,7 @@ */ import { FtrProviderContext } from '../../ftr_provider_context'; -import { DynamicSettings } from '../../../../plugins/uptime/common'; +import { DynamicSettings } from '../../../../plugins/uptime/common/runtime_types'; export function UptimeSettingsProvider({ getService }: FtrProviderContext) { const testSubjects = getService('testSubjects'); From b11b4e64936b9e79a578a5b5d5b8a5fbdf1a40b0 Mon Sep 17 00:00:00 2001 From: Justin Kambic Date: Tue, 28 Apr 2020 15:51:02 -0400 Subject: [PATCH 36/36] Move new file from legacy to NP location. --- .../plugins/uptime/public/state/api/__tests__/ml_anomaly.test.ts | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename x-pack/{legacy => }/plugins/uptime/public/state/api/__tests__/ml_anomaly.test.ts (100%) diff --git a/x-pack/legacy/plugins/uptime/public/state/api/__tests__/ml_anomaly.test.ts b/x-pack/plugins/uptime/public/state/api/__tests__/ml_anomaly.test.ts similarity index 100% rename from x-pack/legacy/plugins/uptime/public/state/api/__tests__/ml_anomaly.test.ts rename to x-pack/plugins/uptime/public/state/api/__tests__/ml_anomaly.test.ts