diff --git a/.eslintignore b/.eslintignore
index 357d735e8044b..1f22b6074e76e 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -9,14 +9,14 @@ bower_components
/built_assets
/html_docs
/src/plugins/data/common/es_query/kuery/ast/_generated_/**
-/src/legacy/core_plugins/vis_type_timelion/public/_generated_/**
+/src/plugins/vis_type_timelion/public/_generated_/**
src/legacy/core_plugins/vis_type_vislib/public/vislib/__tests__/lib/fixtures/mock_data
/src/legacy/ui/public/flot-charts
/test/fixtures/scenarios
/src/legacy/core_plugins/console/public/webpackShims
/src/legacy/core_plugins/console/public/tests/webpackShims
/src/legacy/ui/public/utils/decode_geo_hash.js
-/src/legacy/core_plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
+/src/plugins/vis_type_timelion/public/webpackShims/jquery.flot.*
/src/core/lib/kbn_internal_native_observable
/packages/*/target
/packages/eslint-config-kibana
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 632f28efdc37e..ab05b32ab063e 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -9,17 +9,18 @@
/src/legacy/server/sample_data/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/dashboard/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/discover/ @elastic/kibana-app
-/src/legacy/core_plugins/kibana/public/visualize/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/local_application_service/ @elastic/kibana-app
/src/legacy/core_plugins/kibana/public/dev_tools/ @elastic/kibana-app
/src/legacy/core_plugins/vis_type_vislib/ @elastic/kibana-app
/src/plugins/vis_type_xy/ @elastic/kibana-app
/src/plugins/kibana_legacy/ @elastic/kibana-app
-/src/plugins/timelion/ @elastic/kibana-app
+/src/plugins/vis_type_timelion/ @elastic/kibana-app
/src/plugins/dashboard/ @elastic/kibana-app
/src/plugins/discover/ @elastic/kibana-app
+/src/plugins/visualize/ @elastic/kibana-app
/src/plugins/vis_type_timeseries/ @elastic/kibana-app
/src/plugins/vis_type_metric/ @elastic/kibana-app
+/src/plugins/vis_type_markdown/ @elastic/kibana-app
# Core UI
# Exclude tutorials folder for now because they are not owned by Kibana app and most will move out soon
@@ -208,9 +209,12 @@
# Endpoint
/x-pack/plugins/endpoint/ @elastic/endpoint-app-team
/x-pack/test/api_integration/apis/endpoint/ @elastic/endpoint-app-team
+/x-pack/test/endpoint_api_integration_no_ingest/ @elastic/endpoint-app-team
/x-pack/test/functional_endpoint/ @elastic/endpoint-app-team
/x-pack/test/functional_endpoint_ingest_failure/ @elastic/endpoint-app-team
/x-pack/test/functional/es_archives/endpoint/ @elastic/endpoint-app-team
+/x-pack/test/plugin_functional/plugins/resolver_test/ @elastic/endpoint-app-team
+/x-pack/test/plugin_functional/test_suites/resolver/ @elastic/endpoint-app-team
# SIEM
/x-pack/legacy/plugins/siem/ @elastic/siem
diff --git a/.i18nrc.json b/.i18nrc.json
index 2edf178e37bd5..4a516f23ebf05 100644
--- a/.i18nrc.json
+++ b/.i18nrc.json
@@ -43,10 +43,10 @@
"src/plugins/telemetry_management_section"
],
"tileMap": "src/legacy/core_plugins/tile_map",
- "timelion": ["src/legacy/core_plugins/timelion", "src/legacy/core_plugins/vis_type_timelion", "src/plugins/timelion"],
+ "timelion": ["src/legacy/core_plugins/timelion", "src/plugins/vis_type_timelion"],
"uiActions": "src/plugins/ui_actions",
"visDefaultEditor": "src/plugins/vis_default_editor",
- "visTypeMarkdown": "src/legacy/core_plugins/vis_type_markdown",
+ "visTypeMarkdown": "src/plugins/vis_type_markdown",
"visTypeMetric": "src/plugins/vis_type_metric",
"visTypeTable": "src/legacy/core_plugins/vis_type_table",
"visTypeTagCloud": "src/legacy/core_plugins/vis_type_tagcloud",
@@ -54,7 +54,8 @@
"visTypeVega": "src/legacy/core_plugins/vis_type_vega",
"visTypeVislib": "src/legacy/core_plugins/vis_type_vislib",
"visTypeXy": "src/legacy/core_plugins/vis_type_xy",
- "visualizations": "src/plugins/visualizations"
+ "visualizations": "src/plugins/visualizations",
+ "visualize": "src/plugins/visualize"
},
"exclude": [
"src/legacy/ui/ui_render/ui_render_mixin.js"
diff --git a/docs/api/saved-objects/create.asciidoc b/docs/api/saved-objects/create.asciidoc
index dc010c80fd012..571b57a5ef9c2 100644
--- a/docs/api/saved-objects/create.asciidoc
+++ b/docs/api/saved-objects/create.asciidoc
@@ -57,12 +57,12 @@ any data that you send to the API is properly formed.
[source,sh]
--------------------------------------------------
-$ curl -X POST "localhost:5601/api/saved_objects/index-pattern/my-pattern"
+$ curl -X POST "localhost:5601/api/saved_objects/index-pattern/my-pattern" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"attributes": {
"title": "my-pattern-*"
}
-}
+}'
--------------------------------------------------
// KIBANA
diff --git a/docs/api/saved-objects/export.asciidoc b/docs/api/saved-objects/export.asciidoc
index e8c762b9543a1..a992d13ed9b9c 100644
--- a/docs/api/saved-objects/export.asciidoc
+++ b/docs/api/saved-objects/export.asciidoc
@@ -68,10 +68,10 @@ Export all index pattern saved objects:
[source,sh]
--------------------------------------------------
-$ curl -X POST "localhost:5601/api/saved_objects/_export"
+$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"type": "index-pattern"
-}
+}'
--------------------------------------------------
// KIBANA
@@ -79,11 +79,11 @@ Export all index pattern saved objects and exclude the export summary from the s
[source,sh]
--------------------------------------------------
-$ curl -X POST "localhost:5601/api/saved_objects/_export"
+$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"type": "index-pattern",
"excludeExportDetails": true
-}
+}'
--------------------------------------------------
// KIBANA
@@ -91,7 +91,7 @@ Export a specific saved object:
[source,sh]
--------------------------------------------------
-$ curl -X POST "localhost:5601/api/saved_objects/_export"
+$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"objects": [
{
@@ -99,7 +99,7 @@ $ curl -X POST "localhost:5601/api/saved_objects/_export"
"id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
}
]
-}
+}'
--------------------------------------------------
// KIBANA
@@ -107,7 +107,7 @@ Export a specific saved object and it's related objects :
[source,sh]
--------------------------------------------------
-$ curl -X POST "localhost:5601/api/saved_objects/_export"
+$ curl -X POST "localhost:5601/api/saved_objects/_export" -H 'kbn-xsrf: true' -H 'Content-Type: application/json' -d '
{
"objects": [
{
@@ -116,6 +116,6 @@ $ curl -X POST "localhost:5601/api/saved_objects/_export"
}
],
"includeReferencesDeep": true
-}
+}'
--------------------------------------------------
// KIBANA
diff --git a/docs/development/core/server/kibana-plugin-core-server.coresetup.http.md b/docs/development/core/server/kibana-plugin-core-server.coresetup.http.md
index dcc1d754feb7c..a8028827cc0a4 100644
--- a/docs/development/core/server/kibana-plugin-core-server.coresetup.http.md
+++ b/docs/development/core/server/kibana-plugin-core-server.coresetup.http.md
@@ -9,5 +9,7 @@
Signature:
```typescript
-http: HttpServiceSetup;
+http: HttpServiceSetup & {
+ resources: HttpResources;
+ };
```
diff --git a/docs/development/core/server/kibana-plugin-core-server.coresetup.md b/docs/development/core/server/kibana-plugin-core-server.coresetup.md
index c10b460da8b4f..30c054345928b 100644
--- a/docs/development/core/server/kibana-plugin-core-server.coresetup.md
+++ b/docs/development/core/server/kibana-plugin-core-server.coresetup.md
@@ -20,7 +20,7 @@ export interface CoreSetupContextSetup | [ContextSetup](./kibana-plugin-core-server.contextsetup.md) |
| [elasticsearch](./kibana-plugin-core-server.coresetup.elasticsearch.md) | ElasticsearchServiceSetup | [ElasticsearchServiceSetup](./kibana-plugin-core-server.elasticsearchservicesetup.md) |
| [getStartServices](./kibana-plugin-core-server.coresetup.getstartservices.md) | StartServicesAccessor<TPluginsStart, TStart> | [StartServicesAccessor](./kibana-plugin-core-server.startservicesaccessor.md) |
-| [http](./kibana-plugin-core-server.coresetup.http.md) | HttpServiceSetup | [HttpServiceSetup](./kibana-plugin-core-server.httpservicesetup.md) |
+| [http](./kibana-plugin-core-server.coresetup.http.md) | HttpServiceSetup & { resources: HttpResources; } | [HttpServiceSetup](./kibana-plugin-core-server.httpservicesetup.md) |
| [metrics](./kibana-plugin-core-server.coresetup.metrics.md) | MetricsServiceSetup | [MetricsServiceSetup](./kibana-plugin-core-server.metricsservicesetup.md) |
| [savedObjects](./kibana-plugin-core-server.coresetup.savedobjects.md) | SavedObjectsServiceSetup | [SavedObjectsServiceSetup](./kibana-plugin-core-server.savedobjectsservicesetup.md) |
| [status](./kibana-plugin-core-server.coresetup.status.md) | StatusServiceSetup | [StatusServiceSetup](./kibana-plugin-core-server.statusservicesetup.md) |
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresources.md b/docs/development/core/server/kibana-plugin-core-server.httpresources.md
new file mode 100644
index 0000000000000..cb3170e989e17
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresources.md
@@ -0,0 +1,20 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResources](./kibana-plugin-core-server.httpresources.md)
+
+## HttpResources interface
+
+HttpResources service is responsible for serving static & dynamic assets for Kibana application via HTTP. Provides API allowing plug-ins to respond with: - a pre-configured HTML page bootstrapping Kibana client app - custom HTML page - custom JS script file.
+
+Signature:
+
+```typescript
+export interface HttpResources
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [register](./kibana-plugin-core-server.httpresources.register.md) | <P, Q, B>(route: RouteConfig<P, Q, B, 'get'>, handler: HttpResourcesRequestHandler<P, Q, B>) => void | To register a route handler executing passed function to form response. |
+
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresources.register.md b/docs/development/core/server/kibana-plugin-core-server.httpresources.register.md
new file mode 100644
index 0000000000000..fe3803a6ffe52
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresources.register.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResources](./kibana-plugin-core-server.httpresources.md) > [register](./kibana-plugin-core-server.httpresources.register.md)
+
+## HttpResources.register property
+
+To register a route handler executing passed function to form response.
+
+Signature:
+
+```typescript
+register:
(route: RouteConfig
, handler: HttpResourcesRequestHandler
) => void;
+```
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.headers.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.headers.md
new file mode 100644
index 0000000000000..bb6dec504ff42
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.headers.md
@@ -0,0 +1,18 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResourcesRenderOptions](./kibana-plugin-core-server.httpresourcesrenderoptions.md) > [headers](./kibana-plugin-core-server.httpresourcesrenderoptions.headers.md)
+
+## HttpResourcesRenderOptions.headers property
+
+HTTP Headers with additional information about response.
+
+Signature:
+
+```typescript
+headers?: ResponseHeaders;
+```
+
+## Remarks
+
+All HTML pages are already pre-configured with `content-security-policy` header that cannot be overridden.
+
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.md
new file mode 100644
index 0000000000000..6563e3c636a99
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesrenderoptions.md
@@ -0,0 +1,20 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResourcesRenderOptions](./kibana-plugin-core-server.httpresourcesrenderoptions.md)
+
+## HttpResourcesRenderOptions interface
+
+Allows to configure HTTP response parameters
+
+Signature:
+
+```typescript
+export interface HttpResourcesRenderOptions
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [headers](./kibana-plugin-core-server.httpresourcesrenderoptions.headers.md) | ResponseHeaders | HTTP Headers with additional information about response. |
+
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesrequesthandler.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesrequesthandler.md
new file mode 100644
index 0000000000000..20f930382955e
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesrequesthandler.md
@@ -0,0 +1,18 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResourcesRequestHandler](./kibana-plugin-core-server.httpresourcesrequesthandler.md)
+
+## HttpResourcesRequestHandler type
+
+Extended version of [RequestHandler](./kibana-plugin-core-server.requesthandler.md) having access to [HttpResourcesServiceToolkit](./kibana-plugin-core-server.httpresourcesservicetoolkit.md) to respond with HTML or JS resources.
+
+Signature:
+
+```typescript
+export declare type HttpResourcesRequestHandler
= RequestHandler
;
+```
+
+## Example
+
+\`\`\`typescript httpResources.register({ path: '/login', validate: { params: schema.object({ id: schema.string() }), }, }, async (context, request, response) => { //.. return response.renderCoreApp(); });
+
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesresponseoptions.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesresponseoptions.md
new file mode 100644
index 0000000000000..2ea3ea7e58c78
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesresponseoptions.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResourcesResponseOptions](./kibana-plugin-core-server.httpresourcesresponseoptions.md)
+
+## HttpResourcesResponseOptions type
+
+HTTP Resources response parameters
+
+Signature:
+
+```typescript
+export declare type HttpResourcesResponseOptions = HttpResponseOptions;
+```
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.md
new file mode 100644
index 0000000000000..1c221e13f534f
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.md
@@ -0,0 +1,23 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResourcesServiceToolkit](./kibana-plugin-core-server.httpresourcesservicetoolkit.md)
+
+## HttpResourcesServiceToolkit interface
+
+Extended set of [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) helpers used to respond with HTML or JS resource.
+
+Signature:
+
+```typescript
+export interface HttpResourcesServiceToolkit
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [renderAnonymousCoreApp](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderanonymouscoreapp.md) | (options?: HttpResourcesRenderOptions) => Promise<IKibanaResponse> | To respond with HTML page bootstrapping Kibana application without retrieving user-specific information. |
+| [renderCoreApp](./kibana-plugin-core-server.httpresourcesservicetoolkit.rendercoreapp.md) | (options?: HttpResourcesRenderOptions) => Promise<IKibanaResponse> | To respond with HTML page bootstrapping Kibana application. |
+| [renderHtml](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderhtml.md) | (options: HttpResourcesResponseOptions) => IKibanaResponse | To respond with a custom HTML page. |
+| [renderJs](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderjs.md) | (options: HttpResourcesResponseOptions) => IKibanaResponse | To respond with a custom JS script file. |
+
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderanonymouscoreapp.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderanonymouscoreapp.md
new file mode 100644
index 0000000000000..3dce9d88c8036
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderanonymouscoreapp.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResourcesServiceToolkit](./kibana-plugin-core-server.httpresourcesservicetoolkit.md) > [renderAnonymousCoreApp](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderanonymouscoreapp.md)
+
+## HttpResourcesServiceToolkit.renderAnonymousCoreApp property
+
+To respond with HTML page bootstrapping Kibana application without retrieving user-specific information.
+
+Signature:
+
+```typescript
+renderAnonymousCoreApp: (options?: HttpResourcesRenderOptions) => Promise;
+```
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.rendercoreapp.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.rendercoreapp.md
new file mode 100644
index 0000000000000..eb4f095bc19be
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.rendercoreapp.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResourcesServiceToolkit](./kibana-plugin-core-server.httpresourcesservicetoolkit.md) > [renderCoreApp](./kibana-plugin-core-server.httpresourcesservicetoolkit.rendercoreapp.md)
+
+## HttpResourcesServiceToolkit.renderCoreApp property
+
+To respond with HTML page bootstrapping Kibana application.
+
+Signature:
+
+```typescript
+renderCoreApp: (options?: HttpResourcesRenderOptions) => Promise;
+```
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderhtml.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderhtml.md
new file mode 100644
index 0000000000000..325d19625df44
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderhtml.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResourcesServiceToolkit](./kibana-plugin-core-server.httpresourcesservicetoolkit.md) > [renderHtml](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderhtml.md)
+
+## HttpResourcesServiceToolkit.renderHtml property
+
+To respond with a custom HTML page.
+
+Signature:
+
+```typescript
+renderHtml: (options: HttpResourcesResponseOptions) => IKibanaResponse;
+```
diff --git a/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderjs.md b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderjs.md
new file mode 100644
index 0000000000000..f8d4418fc6cba
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderjs.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [HttpResourcesServiceToolkit](./kibana-plugin-core-server.httpresourcesservicetoolkit.md) > [renderJs](./kibana-plugin-core-server.httpresourcesservicetoolkit.renderjs.md)
+
+## HttpResourcesServiceToolkit.renderJs property
+
+To respond with a custom JS script file.
+
+Signature:
+
+```typescript
+renderJs: (options: HttpResourcesResponseOptions) => IKibanaResponse;
+```
diff --git a/docs/development/core/server/kibana-plugin-core-server.irouter.handlelegacyerrors.md b/docs/development/core/server/kibana-plugin-core-server.irouter.handlelegacyerrors.md
index 94cf3c94187b0..35d109975c83a 100644
--- a/docs/development/core/server/kibana-plugin-core-server.irouter.handlelegacyerrors.md
+++ b/docs/development/core/server/kibana-plugin-core-server.irouter.handlelegacyerrors.md
@@ -9,5 +9,5 @@ Wrap a router handler to catch and converts legacy boom errors to proper custom
Signature:
```typescript
-handleLegacyErrors:
(handler: RequestHandler
) => RequestHandler
;
+handleLegacyErrors: RequestHandlerWrapper;
```
diff --git a/docs/development/core/server/kibana-plugin-core-server.irouter.md b/docs/development/core/server/kibana-plugin-core-server.irouter.md
index 073f02f1a4191..4bade638a65a5 100644
--- a/docs/development/core/server/kibana-plugin-core-server.irouter.md
+++ b/docs/development/core/server/kibana-plugin-core-server.irouter.md
@@ -18,7 +18,7 @@ export interface IRouter
| --- | --- | --- |
| [delete](./kibana-plugin-core-server.irouter.delete.md) | RouteRegistrar<'delete'> | Register a route handler for DELETE request. |
| [get](./kibana-plugin-core-server.irouter.get.md) | RouteRegistrar<'get'> | Register a route handler for GET request. |
-| [handleLegacyErrors](./kibana-plugin-core-server.irouter.handlelegacyerrors.md) | <P, Q, B>(handler: RequestHandler<P, Q, B>) => RequestHandler<P, Q, B> | Wrap a router handler to catch and converts legacy boom errors to proper custom errors. |
+| [handleLegacyErrors](./kibana-plugin-core-server.irouter.handlelegacyerrors.md) | RequestHandlerWrapper | Wrap a router handler to catch and converts legacy boom errors to proper custom errors. |
| [patch](./kibana-plugin-core-server.irouter.patch.md) | RouteRegistrar<'patch'> | Register a route handler for PATCH request. |
| [post](./kibana-plugin-core-server.irouter.post.md) | RouteRegistrar<'post'> | Register a route handler for POST request. |
| [put](./kibana-plugin-core-server.irouter.put.md) | RouteRegistrar<'put'> | Register a route handler for PUT request. |
diff --git a/docs/development/core/server/kibana-plugin-core-server.iscopedrenderingclient.md b/docs/development/core/server/kibana-plugin-core-server.iscopedrenderingclient.md
deleted file mode 100644
index 0632b5e5e2297..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.iscopedrenderingclient.md
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IScopedRenderingClient](./kibana-plugin-core-server.iscopedrenderingclient.md)
-
-## IScopedRenderingClient interface
-
-
-Signature:
-
-```typescript
-export interface IScopedRenderingClient
-```
-
-## Methods
-
-| Method | Description |
-| --- | --- |
-| [render(options)](./kibana-plugin-core-server.iscopedrenderingclient.render.md) | Generate a KibanaResponse which renders an HTML page bootstrapped with the core bundle. Intended as a response body for HTTP route handlers. |
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.iscopedrenderingclient.render.md b/docs/development/core/server/kibana-plugin-core-server.iscopedrenderingclient.render.md
deleted file mode 100644
index ca114bed21149..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.iscopedrenderingclient.render.md
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [IScopedRenderingClient](./kibana-plugin-core-server.iscopedrenderingclient.md) > [render](./kibana-plugin-core-server.iscopedrenderingclient.render.md)
-
-## IScopedRenderingClient.render() method
-
-Generate a `KibanaResponse` which renders an HTML page bootstrapped with the `core` bundle. Intended as a response body for HTTP route handlers.
-
-Signature:
-
-```typescript
-render(options?: Pick): Promise;
-```
-
-## Parameters
-
-| Parameter | Type | Description |
-| --- | --- | --- |
-| options | Pick<IRenderOptions, 'includeUserSettings'> | |
-
-Returns:
-
-`Promise`
-
-## Example
-
-
-```ts
-router.get(
- { path: '/', validate: false },
- (context, request, response) =>
- response.ok({
- body: await context.core.rendering.render(),
- headers: {
- 'content-security-policy': context.core.http.csp.header,
- },
- })
-);
-
-```
-
diff --git a/docs/development/core/server/kibana-plugin-core-server.legacyservicesetupdeps.md b/docs/development/core/server/kibana-plugin-core-server.legacyservicesetupdeps.md
index f037b7b3e7cb2..a5c1d59be06d3 100644
--- a/docs/development/core/server/kibana-plugin-core-server.legacyservicesetupdeps.md
+++ b/docs/development/core/server/kibana-plugin-core-server.legacyservicesetupdeps.md
@@ -20,4 +20,5 @@ export interface LegacyServiceSetupDeps
| --- | --- | --- |
| [core](./kibana-plugin-core-server.legacyservicesetupdeps.core.md) | LegacyCoreSetup | |
| [plugins](./kibana-plugin-core-server.legacyservicesetupdeps.plugins.md) | Record<string, unknown> | |
+| [uiPlugins](./kibana-plugin-core-server.legacyservicesetupdeps.uiplugins.md) | UiPlugins | |
diff --git a/docs/development/core/server/kibana-plugin-core-server.legacyservicesetupdeps.uiplugins.md b/docs/development/core/server/kibana-plugin-core-server.legacyservicesetupdeps.uiplugins.md
new file mode 100644
index 0000000000000..d19a7dfcbfcfa
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.legacyservicesetupdeps.uiplugins.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [LegacyServiceSetupDeps](./kibana-plugin-core-server.legacyservicesetupdeps.md) > [uiPlugins](./kibana-plugin-core-server.legacyservicesetupdeps.uiplugins.md)
+
+## LegacyServiceSetupDeps.uiPlugins property
+
+Signature:
+
+```typescript
+uiPlugins: UiPlugins;
+```
diff --git a/docs/development/core/server/kibana-plugin-core-server.md b/docs/development/core/server/kibana-plugin-core-server.md
index 5c0f10cac5179..5450e84417f89 100644
--- a/docs/development/core/server/kibana-plugin-core-server.md
+++ b/docs/development/core/server/kibana-plugin-core-server.md
@@ -80,6 +80,9 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [EnvironmentMode](./kibana-plugin-core-server.environmentmode.md) | |
| [ErrorHttpResponseOptions](./kibana-plugin-core-server.errorhttpresponseoptions.md) | HTTP response parameters |
| [FakeRequest](./kibana-plugin-core-server.fakerequest.md) | Fake request object created manually by Kibana plugins. |
+| [HttpResources](./kibana-plugin-core-server.httpresources.md) | HttpResources service is responsible for serving static & dynamic assets for Kibana application via HTTP. Provides API allowing plug-ins to respond with: - a pre-configured HTML page bootstrapping Kibana client app - custom HTML page - custom JS script file. |
+| [HttpResourcesRenderOptions](./kibana-plugin-core-server.httpresourcesrenderoptions.md) | Allows to configure HTTP response parameters |
+| [HttpResourcesServiceToolkit](./kibana-plugin-core-server.httpresourcesservicetoolkit.md) | Extended set of [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) helpers used to respond with HTML or JS resource. |
| [HttpResponseOptions](./kibana-plugin-core-server.httpresponseoptions.md) | HTTP response parameters |
| [HttpServerInfo](./kibana-plugin-core-server.httpserverinfo.md) | |
| [HttpServiceSetup](./kibana-plugin-core-server.httpservicesetup.md) | Kibana HTTP Service provides own abstraction for work with HTTP stack. Plugins don't have direct access to hapi server and its primitives anymore. Moreover, plugins shouldn't rely on the fact that HTTP Service uses one or another library under the hood. This gives the platform flexibility to upgrade or changing our internal HTTP stack without breaking plugins. If the HTTP Service lacks functionality you need, we are happy to discuss and support your needs. |
@@ -92,7 +95,6 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [IndexSettingsDeprecationInfo](./kibana-plugin-core-server.indexsettingsdeprecationinfo.md) | |
| [IRenderOptions](./kibana-plugin-core-server.irenderoptions.md) | |
| [IRouter](./kibana-plugin-core-server.irouter.md) | Registers route handlers for specified resource path and method. See [RouteConfig](./kibana-plugin-core-server.routeconfig.md) and [RequestHandler](./kibana-plugin-core-server.requesthandler.md) for more information about arguments to route registrations. |
-| [IScopedRenderingClient](./kibana-plugin-core-server.iscopedrenderingclient.md) | |
| [IUiSettingsClient](./kibana-plugin-core-server.iuisettingsclient.md) | Server-side client that provides access to the advanced settings stored in elasticsearch. The settings provide control over the behavior of the Kibana application. For example, a user can specify how to display numeric or date fields. Users can adjust the settings via Management UI. |
| [KibanaRequestEvents](./kibana-plugin-core-server.kibanarequestevents.md) | Request events. |
| [KibanaRequestRoute](./kibana-plugin-core-server.kibanarequestroute.md) | Request specific route information exposed to a handler. |
@@ -118,7 +120,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [PluginConfigDescriptor](./kibana-plugin-core-server.pluginconfigdescriptor.md) | Describes a plugin configuration properties. |
| [PluginInitializerContext](./kibana-plugin-core-server.plugininitializercontext.md) | Context that's available to plugins during initialization stage. |
| [PluginManifest](./kibana-plugin-core-server.pluginmanifest.md) | Describes the set of required and optional properties plugin can define in its mandatory JSON manifest file. |
-| [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md) | Plugin specific context passed to a route handler.Provides the following clients and services: - [rendering](./kibana-plugin-core-server.iscopedrenderingclient.md) - Rendering client which uses the data of the incoming request - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.dataClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.adminClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch admin client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request |
+| [RequestHandlerContext](./kibana-plugin-core-server.requesthandlercontext.md) | Plugin specific context passed to a route handler.Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.dataClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.adminClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch admin client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request |
| [RouteConfig](./kibana-plugin-core-server.routeconfig.md) | Route specific configuration. |
| [RouteConfigOptions](./kibana-plugin-core-server.routeconfigoptions.md) | Additional route options. |
| [RouteConfigOptionsBody](./kibana-plugin-core-server.routeconfigoptionsbody.md) | Additional body options for a route |
@@ -216,6 +218,8 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [HandlerFunction](./kibana-plugin-core-server.handlerfunction.md) | A function that accepts a context object and an optional number of additional arguments. Used for the generic types in [IContextContainer](./kibana-plugin-core-server.icontextcontainer.md) |
| [HandlerParameters](./kibana-plugin-core-server.handlerparameters.md) | Extracts the types of the additional arguments of a [HandlerFunction](./kibana-plugin-core-server.handlerfunction.md), excluding the [HandlerContextType](./kibana-plugin-core-server.handlercontexttype.md). |
| [Headers](./kibana-plugin-core-server.headers.md) | Http request headers to read. |
+| [HttpResourcesRequestHandler](./kibana-plugin-core-server.httpresourcesrequesthandler.md) | Extended version of [RequestHandler](./kibana-plugin-core-server.requesthandler.md) having access to [HttpResourcesServiceToolkit](./kibana-plugin-core-server.httpresourcesservicetoolkit.md) to respond with HTML or JS resources. |
+| [HttpResourcesResponseOptions](./kibana-plugin-core-server.httpresourcesresponseoptions.md) | HTTP Resources response parameters |
| [HttpResponsePayload](./kibana-plugin-core-server.httpresponsepayload.md) | Data send to the client as a response payload. |
| [IBasePath](./kibana-plugin-core-server.ibasepath.md) | Access or manipulate the Kibana base path[BasePath](./kibana-plugin-core-server.basepath.md) |
| [IClusterClient](./kibana-plugin-core-server.iclusterclient.md) | Represents an Elasticsearch cluster API client created by the platform. It allows to call API on behalf of the internal Kibana user and the actual user that is derived from the request headers (via asScoped(...)).See [ClusterClient](./kibana-plugin-core-server.clusterclient.md). |
@@ -245,6 +249,7 @@ The plugin integrates with the core system via lifecycle events: `setup`
| [RequestHandler](./kibana-plugin-core-server.requesthandler.md) | A function executed when route path matched requested resource path. Request handler is expected to return a result of one of [KibanaResponseFactory](./kibana-plugin-core-server.kibanaresponsefactory.md) functions. |
| [RequestHandlerContextContainer](./kibana-plugin-core-server.requesthandlercontextcontainer.md) | An object that handles registration of http request context providers. |
| [RequestHandlerContextProvider](./kibana-plugin-core-server.requesthandlercontextprovider.md) | Context provider for request handler. Extends request context object with provided functionality or data. |
+| [RequestHandlerWrapper](./kibana-plugin-core-server.requesthandlerwrapper.md) | Type-safe wrapper for [RequestHandler](./kibana-plugin-core-server.requesthandler.md) function. |
| [ResponseError](./kibana-plugin-core-server.responseerror.md) | Error message and optional data send to the client in case of error. |
| [ResponseErrorAttributes](./kibana-plugin-core-server.responseerrorattributes.md) | Additional data to provide error details. |
| [ResponseHeaders](./kibana-plugin-core-server.responseheaders.md) | Http response headers to set. |
diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandler.md b/docs/development/core/server/kibana-plugin-core-server.requesthandler.md
index 156f38fab0983..cecef7c923568 100644
--- a/docs/development/core/server/kibana-plugin-core-server.requesthandler.md
+++ b/docs/development/core/server/kibana-plugin-core-server.requesthandler.md
@@ -9,7 +9,7 @@ A function executed when route path matched requested resource path. Request han
Signature:
```typescript
-export declare type RequestHandler
, response: ResponseFactory) => IKibanaResponse | Promise>;
```
## Example
diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md
index 3c6bee114b6ab..0d640e52c3a03 100644
--- a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md
+++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md
@@ -8,7 +8,6 @@
```typescript
core: {
- rendering: IScopedRenderingClient;
savedObjects: {
client: SavedObjectsClientContract;
typeRegistry: ISavedObjectTypeRegistry;
diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md
index b65ae47f0e0c1..0966b91a4ebf2 100644
--- a/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md
+++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md
@@ -6,7 +6,7 @@
Plugin specific context passed to a route handler.
-Provides the following clients and services: - [rendering](./kibana-plugin-core-server.iscopedrenderingclient.md) - Rendering client which uses the data of the incoming request - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.dataClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.adminClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch admin client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request
+Provides the following clients and services: - [savedObjects.client](./kibana-plugin-core-server.savedobjectsclient.md) - Saved Objects client which uses the credentials of the incoming request - [savedObjects.typeRegistry](./kibana-plugin-core-server.isavedobjecttyperegistry.md) - Type registry containing all the registered types. - [elasticsearch.dataClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch data client which uses the credentials of the incoming request - [elasticsearch.adminClient](./kibana-plugin-core-server.scopedclusterclient.md) - Elasticsearch admin client which uses the credentials of the incoming request - [uiSettings.client](./kibana-plugin-core-server.iuisettingsclient.md) - uiSettings client which uses the credentials of the incoming request
Signature:
@@ -18,5 +18,5 @@ export interface RequestHandlerContext
| Property | Type | Description |
| --- | --- | --- |
-| [core](./kibana-plugin-core-server.requesthandlercontext.core.md) | { rendering: IScopedRenderingClient; savedObjects: { client: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; }; elasticsearch: { dataClient: IScopedClusterClient; adminClient: IScopedClusterClient; }; uiSettings: { client: IUiSettingsClient; }; } | |
+| [core](./kibana-plugin-core-server.requesthandlercontext.core.md) | { savedObjects: { client: SavedObjectsClientContract; typeRegistry: ISavedObjectTypeRegistry; }; elasticsearch: { dataClient: IScopedClusterClient; adminClient: IScopedClusterClient; }; uiSettings: { client: IUiSettingsClient; }; } | |
diff --git a/docs/development/core/server/kibana-plugin-core-server.requesthandlerwrapper.md b/docs/development/core/server/kibana-plugin-core-server.requesthandlerwrapper.md
new file mode 100644
index 0000000000000..a9fe188ee2bff
--- /dev/null
+++ b/docs/development/core/server/kibana-plugin-core-server.requesthandlerwrapper.md
@@ -0,0 +1,27 @@
+
+
+[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [RequestHandlerWrapper](./kibana-plugin-core-server.requesthandlerwrapper.md)
+
+## RequestHandlerWrapper type
+
+Type-safe wrapper for [RequestHandler](./kibana-plugin-core-server.requesthandler.md) function.
+
+Signature:
+
+```typescript
+export declare type RequestHandlerWrapper =
(handler: RequestHandler
) => RequestHandler
;
+```
+
+## Example
+
+
+```typescript
+export const wrapper: RequestHandlerWrapper = handler => {
+ return async (context, request, response) => {
+ // do some logic
+ ...
+ };
+}
+
+```
+
diff --git a/docs/development/core/server/kibana-plugin-core-server.responseheaders.md b/docs/development/core/server/kibana-plugin-core-server.responseheaders.md
index 4551d1cab8632..fb7d6a10c6b6c 100644
--- a/docs/development/core/server/kibana-plugin-core-server.responseheaders.md
+++ b/docs/development/core/server/kibana-plugin-core-server.responseheaders.md
@@ -9,9 +9,5 @@ Http response headers to set.
Signature:
```typescript
-export declare type ResponseHeaders = {
- [header in KnownHeaders]?: string | string[];
-} & {
- [header: string]: string | string[];
-};
+export declare type ResponseHeaders = Record | Record;
```
diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md
index d8202545f0eae..a8894286de910 100644
--- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md
+++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.md
@@ -25,6 +25,5 @@ This is only internal for now, and will only be public when we expose the regist
| [mappings](./kibana-plugin-core-server.savedobjectstype.mappings.md) | SavedObjectsTypeMappingDefinition | The [mapping definition](./kibana-plugin-core-server.savedobjectstypemappingdefinition.md) for the type. |
| [migrations](./kibana-plugin-core-server.savedobjectstype.migrations.md) | SavedObjectMigrationMap | An optional map of [migrations](./kibana-plugin-core-server.savedobjectmigrationfn.md) to be used to migrate the type. |
| [name](./kibana-plugin-core-server.savedobjectstype.name.md) | string | The name of the type, which is also used as the internal id. |
-| [namespaceAgnostic](./kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md) | boolean | Is the type global (true), or not (false). |
| [namespaceType](./kibana-plugin-core-server.savedobjectstype.namespacetype.md) | SavedObjectsNamespaceType | The [namespace type](./kibana-plugin-core-server.savedobjectsnamespacetype.md) for the type. |
diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md
deleted file mode 100644
index e347421590482..0000000000000
--- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
-[Home](./index.md) > [kibana-plugin-core-server](./kibana-plugin-core-server.md) > [SavedObjectsType](./kibana-plugin-core-server.savedobjectstype.md) > [namespaceAgnostic](./kibana-plugin-core-server.savedobjectstype.namespaceagnostic.md)
-
-## SavedObjectsType.namespaceAgnostic property
-
-> Warning: This API is now obsolete.
->
-> Use `namespaceType` instead.
->
-
-Is the type global (true), or not (false).
-
-Signature:
-
-```typescript
-namespaceAgnostic?: boolean;
-```
diff --git a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespacetype.md b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespacetype.md
index 69912f9144980..3a3b0f7f3a9a5 100644
--- a/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespacetype.md
+++ b/docs/development/core/server/kibana-plugin-core-server.savedobjectstype.namespacetype.md
@@ -9,5 +9,5 @@ The [namespace type](./kibana-plugin-core-server.savedobjectsnamespacetype.md) f
Signature:
```typescript
-namespaceType?: SavedObjectsNamespaceType;
+namespaceType: SavedObjectsNamespaceType;
```
diff --git a/docs/images/add_remote_cluster.png b/docs/images/add_remote_cluster.png
index 376b1d8392366..160d29b741c62 100755
Binary files a/docs/images/add_remote_cluster.png and b/docs/images/add_remote_cluster.png differ
diff --git a/docs/images/auto_follow_pattern.png b/docs/images/auto_follow_pattern.png
index 3bf86458eddd7..f80de9352280f 100755
Binary files a/docs/images/auto_follow_pattern.png and b/docs/images/auto_follow_pattern.png differ
diff --git a/docs/images/cross-cluster-replication-list-view.png b/docs/images/cross-cluster-replication-list-view.png
new file mode 100755
index 0000000000000..4c45174cff7f1
Binary files /dev/null and b/docs/images/cross-cluster-replication-list-view.png differ
diff --git a/docs/images/follower_indices.png b/docs/images/follower_indices.png
old mode 100644
new mode 100755
index f103bb3cf2acf..505adeb45ae23
Binary files a/docs/images/follower_indices.png and b/docs/images/follower_indices.png differ
diff --git a/docs/images/remote-clusters-list-view.png b/docs/images/remote-clusters-list-view.png
new file mode 100755
index 0000000000000..c28379863b74b
Binary files /dev/null and b/docs/images/remote-clusters-list-view.png differ
diff --git a/docs/ingest_manager/index-templates.asciidoc b/docs/ingest_manager/index-templates.asciidoc
new file mode 100644
index 0000000000000..e19af63c3116f
--- /dev/null
+++ b/docs/ingest_manager/index-templates.asciidoc
@@ -0,0 +1,7 @@
+# Elasticsearch Index Templates
+
+## Generation
+
+* Index templates are generated from `YAML` files contained in the package.
+* There is one index template per dataset.
+* For the generation of an index template, all `yml` files contained in the package subdirectory `dataset/DATASET_NAME/fields/` are used.
diff --git a/docs/ingest_manager/index.asciidoc b/docs/ingest_manager/index.asciidoc
index 22afa88c919e4..866935d1fa580 100644
--- a/docs/ingest_manager/index.asciidoc
+++ b/docs/ingest_manager/index.asciidoc
@@ -199,3 +199,10 @@ The new ingest pipeline is expected to still work with the data coming from olde
In case of a breaking change in the data structure, the new ingest pipeline is also expected to deal with this change. In case there are breaking changes which cannot be dealt with in an ingest pipeline, a new package has to be created.
Each package lists its minimal required agent version. In case there are agents enrolled with an older version, the user is notified to upgrade these agents as otherwise the new configs cannot be rolled out.
+
+=== Generated assets
+
+When a package is installed or upgraded, certain Kibana and Elasticsearch assets are generated from . These follow the naming conventions explained above (see "indexing strategy") and contain configuration for the elastic stack that makes ingesting and displaying data work with as little user interaction as possible.
+
+* link:index-templates.asciidoc[Elasticsearch Index Templates]
+* Kibana Index Patterns
diff --git a/docs/management/managing-ccr.asciidoc b/docs/management/managing-ccr.asciidoc
new file mode 100644
index 0000000000000..b2db5a80cfe7e
--- /dev/null
+++ b/docs/management/managing-ccr.asciidoc
@@ -0,0 +1,73 @@
+[role="xpack"]
+[[managing-cross-cluster-replication]]
+== Cross-Cluster Replication
+
+Use *Cross-Cluster Replication* to reproduce indices in
+remote clusters on a local cluster. {ref}/xpack-ccr.html[Cross-cluster replication]
+is commonly used to provide remote backups for disaster recovery and for
+geo-proximite copies of data.
+
+To get started, go to *Management > Cross-Cluster Replication*.
+
+[role="screenshot"]
+image::images/cross-cluster-replication-list-view.png[][Cross-cluster replication list view]
+
+[float]
+=== Prerequisites
+
+* You must have a {ref}/modules-remote-clusters.html[remote cluster].
+* Leader indices must meet {ref}/ccr-requirements.html[these requirements].
+* The Elasticsearch version of the local cluster must be the same as or newer than the remote cluster.
+Refer to {ref}/ccr-overview.html[this document] for more information.
+
+[float]
+[[configure-replication]]
+=== Configure replication
+
+Replication requires a leader index, the index being replicated, and a
+follower index, which will contain the leader index's replicated data.
+The follower index is passive in that it can read requests and searches,
+but cannot accept direct writes. Only the leader index is active for direct writes.
+
+You can configure follower indices in two ways:
+
+* Create specific follower indices
+* Create follower indices from an auto-follow pattern
+
+[float]
+==== Create specific follower indices
+
+To replicate data from existing indices, or set up local followers on a case-by-case basis,
+go to *Follower indices*. When you create the follower index, you must reference the
+remote cluster and the leader index that you created in the remote cluster.
+
+[role="screenshot"]
+image::images/follower_indices.png[][UI for adding follower indices]
+
+[float]
+==== Create follower indices from an auto-follow pattern
+
+To automatically detect and follow new indices when they are created on a remote cluster,
+go to *Auto-follow patterns*. Creating an auto-follow pattern is useful when you have
+time series data, like event logs, on the remote cluster that is created or rolled over on a daily basis.
+
+When creating the pattern, you must reference the remote cluster that you
+connected to your local cluster. You must also specify a collection of index patterns
+that match the indices you want to automatically follow.
+
+Once you configure an
+auto-follow pattern, any time a new index with a name that matches the pattern is
+created in the remote cluster, a follower index is automatically configured in the local cluster.
+
+[role="screenshot"]
+image::images/auto_follow_pattern.png[UI for adding an auto-follow pattern]
+
+[float]
+[[manage-replication]]
+=== Manage replication
+
+Use the list views in *Cross-Cluster Replication* to monitor whether the replication is active and
+pause and resume replication. You can also edit and remove the follower indices and auto-follow patterns.
+
+For an example of cross-cluster replication,
+refer to https://www.elastic.co/blog/bi-directional-replication-with-elasticsearch-cross-cluster-replication-ccr[Bi-directional replication with Elasticsearch cross-cluster replication].
diff --git a/docs/management/managing-remote-clusters.asciidoc b/docs/management/managing-remote-clusters.asciidoc
index 6b69cfef5b768..00ec5c7d2ddea 100644
--- a/docs/management/managing-remote-clusters.asciidoc
+++ b/docs/management/managing-remote-clusters.asciidoc
@@ -1,67 +1,39 @@
[[working-remote-clusters]]
== Remote Clusters
-{kib} *Management* provides user interfaces for working with data from remote
-clusters and managing the {ccr} process. You can replicate indices from a
-leader remote cluster to a follower index in a local cluster. The local follower indices
-can be used to provide remote backups for disaster recovery or for geo-proximite copies of data.
+Use *Remote Clusters* to establish a unidirectional
+connection from your cluster to other clusters. This functionality is
+required for {ref}/xpack-ccr.html[cross-cluster replication] and
+{ref}/modules-cross-cluster-search.html[cross-cluster search].
-Before using these features, you should be familiar with the following concepts:
+To get started, go to *Management > Remote Clusters*.
-* {ref}/xpack-ccr.html[{ccr-cap}]
-* {ref}/modules-cross-cluster-search.html[{ccs-cap}]
-* {ref}/cross-cluster-configuring.html[Cross-cluster security requirements]
+[role="screenshot"]
+image::images/remote-clusters-list-view.png[Remote Clusters list view, including Add a remote cluster button]
[float]
[[managing-remote-clusters]]
-== Managing remote clusters
-
-*Remote clusters* helps you manage remote clusters for use with
-{ccs} and {ccr}. You can add and remove remote clusters and check their connectivity.
+=== Add a remote cluster
-Before you use this feature, you should be familiar with the concept of
-{ref}/modules-remote-clusters.html[remote clusters].
+A {ref}/modules-remote-clusters.html[remote cluster] connection works by configuring a remote cluster and
+connecting to a limited number of nodes, called {ref}/modules-remote-clusters.html#sniff-mode[seed nodes],
+in that cluster.
+Alternatively, you can define a single proxy address for the remote cluster.
-Go to *Management > Elasticsearch > Remote clusters* to create or manage your remotes.
+By default, a cross-cluster request, such as a cross-cluster search or
+replication request, fails if any cluster in the request is unavailable.
+To skip a cluster when its unavailable,
+set *Skip if unavailable* to true.
-To set up a new remote, click *Add a remote cluster*. Give the cluster a unique name
-and define the seed nodes for cluster discovery. You can edit or remove your remote clusters
-from the *Remote clusters* list view.
+Once you add a remote cluster, you can configure <>
+to reproduce indices in the remote cluster on a local cluster.
[role="screenshot"]
image::images/add_remote_cluster.png[][UI for adding a remote cluster]
-Once a remote cluster is registered, you can use the tools under *{ccr-cap}*
-to add and manage follower indices on the local cluster, and replicate data from
-indices on the remote cluster based on an auto-follow index pattern.
-
[float]
-[[managing-cross-cluster-replication]]
-== [xpack]#Managing {ccr}#
-
-*{ccr-cap}* helps you create and manage the {ccr} process.
-If you want to replicate data from existing indices, or set up
-local followers on a case-by-case basis, go to *Follower indices*.
-If you want to automatically detect and follow new indices when they are created
-on a remote cluster, you can do so from *Auto-follow patterns*.
-
-Creating an auto-follow pattern is useful when you have time-series data, like a logs index, on the
-remote cluster that is created or rolled over on a daily basis. Once you have configured an
-auto-follow pattern, any time a new index with a name that matches the pattern is
-created in the remote cluster, a follower index is automatically configured in the local cluster.
-
-From the same view, you can also see a list of your saved auto-follow patterns for
-a given remote cluster, and monitor whether the replication is active.
+[[manage-remote-clusters]]
+=== Manage remote clusters
-Before you use these features, you should be familiar with the following concepts:
-
-* {ref}/ccr-requirements.html[Requirements for leader indices]
-* {ref}/ccr-auto-follow.html[Automatically following indices]
-
-To get started, go to *Management > Elasticsearch > {ccr-cap}*.
-
-[role="screenshot"]
-image::images/auto_follow_pattern.png[][UI for adding an auto-follow pattern]
-
-[role="screenshot"]
-image::images/follower_indices.png[][UI for adding follower indices]
+From the *Remote Clusters* list view, you can drill down into each cluster and
+view its status. You can also edit and delete a cluster.
diff --git a/docs/redirects.asciidoc b/docs/redirects.asciidoc
index fd835bde83322..a5503969a3ec1 100644
--- a/docs/redirects.asciidoc
+++ b/docs/redirects.asciidoc
@@ -23,7 +23,7 @@ For more {kib} configuration settings, see <>.
[role="exclude",id="uptime-security"]
== Uptime security
-This page has moved. Please see the new section in the {uptime-guide}/uptime-security.html[Uptime Monitoring Guide].
+This page has moved. Please see the new section in the {heartbeat-ref}/securing-heartbeat.html[Uptime Monitoring Guide].
[role="exclude",id="infra-read-only-access"]
== Configure source read-only access
diff --git a/docs/uptime-guide/index.asciidoc b/docs/uptime-guide/index.asciidoc
index 7bbc01bb303f1..09763182fa88f 100644
--- a/docs/uptime-guide/index.asciidoc
+++ b/docs/uptime-guide/index.asciidoc
@@ -12,4 +12,3 @@ include::install.asciidoc[]
include::deployment-arch.asciidoc[]
-include::security.asciidoc[]
diff --git a/docs/uptime-guide/install.asciidoc b/docs/uptime-guide/install.asciidoc
index e7c50bb7604ce..0ed1270ca92ce 100644
--- a/docs/uptime-guide/install.asciidoc
+++ b/docs/uptime-guide/install.asciidoc
@@ -56,6 +56,11 @@ Additional information is available in {heartbeat-ref}/heartbeat-configuration.h
[role="screenshot"]
image::images/uptime-setup.png[Installation instructions on the Uptime page in Kibana]
+[[setup-security]]
+=== Step 4: Setup Security
+
+Secure your installation by following the {heartbeat-ref}/securing-heartbeat.html[Secure Heartbeat] documentation.
+
[float]
==== Important considerations
diff --git a/docs/uptime-guide/security.asciidoc b/docs/uptime-guide/security.asciidoc
deleted file mode 100644
index 0c6fa4c6c4f56..0000000000000
--- a/docs/uptime-guide/security.asciidoc
+++ /dev/null
@@ -1,60 +0,0 @@
-[[uptime-security]]
-== Elasticsearch Security
-
-If you use Elasticsearch security, you'll need to enable certain privileges for users
-that would like to access the Uptime app. For example, create user and support roles to implement the privileges:
-
-[float]
-=== Create a role
-
-You'll need a role that lets you access the Heartbeat indices, which by default are `heartbeat-*`.
-You can create this with the following request:
-
-["source","sh",subs="attributes,callouts"]
----------------------------------------------------------------
-PUT /_security/role/uptime
-{ "indices" : [
- {
- "names" : [
- "heartbeat-*"
- ],
- "privileges" : [
- "read",
- "view_index_metadata"
- ],
- "field_security" : {
- "grant" : [
- "*"
- ]
- },
- "allow_restricted_indices" : false
- }
- ],
- "transient_metadata" : {
- "enabled" : true
- }
-}
----------------------------------------------------------------
-// CONSOLE
-
-[float]
-=== Assign the role to a user
-
-Next, you'll need to create a user with both the `uptime` role, and another role with sufficient {kibana-ref}/kibana-privileges.html[Kibana privileges],
-such as the `kibana_admin` role.
-You can do this with the following request:
-
-["source","sh",subs="attributes,callouts"]
----------------------------------------------------------------
-PUT /_security/user/jacknich
-{
- "password" : "j@rV1s",
- "roles" : [ "uptime", "kibana_admin" ],
- "full_name" : "Jack Nicholson",
- "email" : "jacknich@example.com",
- "metadata" : {
- "intelligence" : 7
- }
-}
----------------------------------------------------------------
-// CONSOLE
diff --git a/docs/uptime/images/alert-flyout.png b/docs/uptime/images/alert-flyout.png
new file mode 100644
index 0000000000000..7fc1e3d9aefe2
Binary files /dev/null and b/docs/uptime/images/alert-flyout.png differ
diff --git a/docs/uptime/images/check-history.png b/docs/uptime/images/check-history.png
index 6418495eee9ed..91565bf59aa7f 100644
Binary files a/docs/uptime/images/check-history.png and b/docs/uptime/images/check-history.png differ
diff --git a/docs/uptime/images/error-list.png b/docs/uptime/images/error-list.png
deleted file mode 100644
index 99f017f2945a5..0000000000000
Binary files a/docs/uptime/images/error-list.png and /dev/null differ
diff --git a/docs/uptime/images/monitor-charts.png b/docs/uptime/images/monitor-charts.png
index dbfa43f47656e..522f34662657e 100644
Binary files a/docs/uptime/images/monitor-charts.png and b/docs/uptime/images/monitor-charts.png differ
diff --git a/docs/uptime/images/observability_integrations.png b/docs/uptime/images/observability_integrations.png
index d5c612c7589ca..6589c0c5565dd 100644
Binary files a/docs/uptime/images/observability_integrations.png and b/docs/uptime/images/observability_integrations.png differ
diff --git a/docs/uptime/images/settings.png b/docs/uptime/images/settings.png
new file mode 100644
index 0000000000000..dd36f0a6d702b
Binary files /dev/null and b/docs/uptime/images/settings.png differ
diff --git a/docs/uptime/images/snapshot-view.png b/docs/uptime/images/snapshot-view.png
index 020396d0f3e4c..1fce2e9592c14 100644
Binary files a/docs/uptime/images/snapshot-view.png and b/docs/uptime/images/snapshot-view.png differ
diff --git a/docs/uptime/images/status-bar.png b/docs/uptime/images/status-bar.png
index e0e9b27555900..8d242789cdccd 100644
Binary files a/docs/uptime/images/status-bar.png and b/docs/uptime/images/status-bar.png differ
diff --git a/docs/uptime/index.asciidoc b/docs/uptime/index.asciidoc
index 785b9f818f5bf..a355f8ecf4843 100644
--- a/docs/uptime/index.asciidoc
+++ b/docs/uptime/index.asciidoc
@@ -12,8 +12,10 @@ To get started with Elastic Uptime, refer to {uptime-guide}/install-uptime.html[
* <>
* <>
+* <>
--
include::overview.asciidoc[]
include::monitor.asciidoc[]
+include::settings.asciidoc[]
diff --git a/docs/uptime/monitor.asciidoc b/docs/uptime/monitor.asciidoc
index d54fd02c7c069..8a4be1f11a721 100644
--- a/docs/uptime/monitor.asciidoc
+++ b/docs/uptime/monitor.asciidoc
@@ -5,21 +5,24 @@
The Monitor page will help you get further insight into the performance
of a specific network endpoint. You'll see a detailed visualization of
the monitor's request duration over time, as well as the `up`/`down`
-status over time.
+status over time. You can also also detect anomalies in response time data
+by configuring Machine Learning jobs on this page.
[float]
-=== Status bar
+=== Status panel
[role="screenshot"]
image::uptime/images/status-bar.png[Status bar]
-The Status bar displays a quick summary of the latest information
+The Status panel displays a quick summary of the latest information
regarding your monitor. You can view its latest status, click a link to
visit the targeted URL, see its most recent request duration, and determine the
amount of time that has elapsed since the last check.
-You can use the Status bar to get a quick summary of current performance,
-beyond simply knowing if the monitor is `up` or `down`.
+When two Heartbeat instances are configured in different geographic locations
+the map will show each location as a pinpoint on the map, along with the
+amount of time elapsed since data was last received from that location.
+
[float]
=== Monitor charts
@@ -32,12 +35,14 @@ date range. These charts can help you gain insight into how quickly requests are
by the targeted endpoint, and give you a sense of how frequently a host or endpoint
was down in your selected timespan.
-The first chart displays request duration information for your monitor.
+The Monitor duration chart displays request duration information for your monitor.
The area surrounding the line is the range of request time for the corresponding
-bucket. The line is the average time.
+bucket. The line is the average time. Anomaly detection using Machine Learning
+can be configured in the upper right hand of this panel. When response times change
+in an unexpected way the time range in which they occurred will be given filled with a color.
-Next, is a graphical representation of the check statuses over time. Hover over
-the charts to display crosshairs with more specific numeric data.
+The pings over time chart is a graphical representation of the check statuses over time.
+Hover over the charts to display crosshairs with more specific numeric data.
[role="screenshot"]
image::uptime/images/crosshair-example.png[Chart crosshair]
@@ -49,6 +54,6 @@ image::uptime/images/crosshair-example.png[Chart crosshair]
image::uptime/images/check-history.png[Check history view]
The Check history displays the total count of this monitor's checks for the selected
-date range. You can additionally filter the checks by `status` to help find recent problems
+date range. You can additionally filter the checks by status and location to help find recent problems
on a per-check basis. This table can help you gain some insight into more granular details
about recent individual data points Heartbeat is logging about your host or endpoint.
diff --git a/docs/uptime/overview.asciidoc b/docs/uptime/overview.asciidoc
index 098ce12a56991..71c09c968e512 100644
--- a/docs/uptime/overview.asciidoc
+++ b/docs/uptime/overview.asciidoc
@@ -21,12 +21,12 @@ This control allows you to use automated filter options, as well as input custom
text to select specific monitors by field, URL, ID, and other attributes.
[float]
-=== Snapshot view
+=== Snapshot panel
[role="screenshot"]
image::uptime/images/snapshot-view.png[Snapshot view]
-This view is intended to quickly give you a sense of the overall
+This panel is intended to quickly give you a sense of the overall
status of the environment you're monitoring, or a subset of those monitors.
Here, you can see the total number of detected monitors within the selected
Uptime date range. In addition to the total, the counts for the number of monitors
@@ -49,6 +49,17 @@ way to navigate to a more in-depth visualization for interesting hosts or endpoi
This table includes information like the most recent status, when the monitor was last checked, its
ID and URL, its IP address, and a dedicated sparkline showing its check status over time.
+[float]
+=== Creating and managing alerts
+
+[role="screenshot"]
+image::uptime/images/alert-flyout.png[Create alert flyout]
+
+To receive alerts when a monitor goes down, use the alerting menu at the top of the
+overview page. Use a query in the alert flyout to determine which monitors to check
+with your alert. If you already have a query in the overview page search bar it will
+be carried over into this box.
+
[float]
=== Observability integrations
@@ -60,14 +71,3 @@ Docker related host information, it will provide links to open the Metrics app o
for this host. Additionally, this feature supplies links to simply filter the other views on the host's
IP address, to help you quickly determine if these other solutions contain data relevant to your current
interest.
-
-[float]
-=== Error list
-
-[role="screenshot"]
-image::uptime/images/error-list.png[Error list]
-
-The Error list displays aggregations of errors that Heartbeat has logged. Errors are
-displayed by Error type, monitor ID, and message. Clicking a monitor's ID will take you
-to the corresponding Monitor view, which can provide you richer information about the individual
-data points that are resulting in the displayed errors.
diff --git a/docs/uptime/settings.asciidoc b/docs/uptime/settings.asciidoc
new file mode 100644
index 0000000000000..55da6e802bec6
--- /dev/null
+++ b/docs/uptime/settings.asciidoc
@@ -0,0 +1,27 @@
+[role="xpack"]
+[[uptime-settings]]
+
+== Settings
+
+[role="screenshot"]
+image::uptime/images/settings.png[Filter bar]
+
+The Uptime settings page lets you change which Heartbeat indices are displayed
+by the uptime app. Users must have the 'all' permission to modify items on this page.
+Uptime settings apply to the current space only. Use different settings in different
+spaces to segment different uptime use cases and domains.
+
+As an example, imagine your organization has one team for internal IT services, and another
+for public services. Each team operates independently and is only responsible for its
+own services. In this scenario, you might set up separate Heartbeat instances for each team,
+writing out to index patterns named `it-heartbeat-\*`, and `external-heartbeat-\*`. You would
+create separate roles and users for each in Elasticsearch, each with access to their own spaces,
+named `it` and `external` respectively. Within each space you would navigate to the settings page
+and set the correct index pattern to match only the indices that space is allowed to access.
+
+Note that the pattern set here only restricts what the Uptime app shows. Users may still be able
+to manually query Elasticsearch for data outside this pattern!
+
+See the <>
+and {heartbeat-ref}/securing-heartbeat.html[Heartbeat security]
+docs for more information.
diff --git a/docs/user/management.asciidoc b/docs/user/management.asciidoc
index fa34802abe2a9..a4ba320e826b1 100644
--- a/docs/user/management.asciidoc
+++ b/docs/user/management.asciidoc
@@ -13,7 +13,7 @@ indices, clusters, licenses, UI settings, index patterns, spaces, and more.
[cols="50, 50"]
|===
-a| <>
+a| <>
Replicate indices on a remote cluster and copy them to a follower index on a local cluster.
This is important for
@@ -85,7 +85,8 @@ set the timespan for notification messages, and much more.
| <>
-Centrally manage your alerts from across {kib}. Create and manage re-usable connectors for triggering actions.
+Centrally manage your alerts across {kib}. Create and manage reusable
+connectors for triggering actions.
| <>
@@ -125,6 +126,8 @@ include::{kib-repo-dir}/management/alerting/connector-management.asciidoc[]
include::{kib-repo-dir}/management/managing-beats.asciidoc[]
+include::{kib-repo-dir}/management/managing-ccr.asciidoc[]
+
include::{kib-repo-dir}/management/index-lifecycle-policies/intro-to-lifecycle-policies.asciidoc[]
include::{kib-repo-dir}/management/index-lifecycle-policies/create-policy.asciidoc[]
diff --git a/examples/embeddable_examples/server/todo_saved_object.ts b/examples/embeddable_examples/server/todo_saved_object.ts
index 0f67c53cfa3e1..58da2014de498 100644
--- a/examples/embeddable_examples/server/todo_saved_object.ts
+++ b/examples/embeddable_examples/server/todo_saved_object.ts
@@ -22,7 +22,7 @@ import { SavedObjectsType } from 'kibana/server';
export const todoSavedObject: SavedObjectsType = {
name: 'todo',
hidden: false,
- namespaceAgnostic: true,
+ namespaceType: 'agnostic',
mappings: {
properties: {
title: {
diff --git a/package.json b/package.json
index c60cf5234c9f7..21e9f67e6206a 100644
--- a/package.json
+++ b/package.json
@@ -119,8 +119,8 @@
"dependencies": {
"@babel/core": "^7.9.0",
"@babel/register": "^7.9.0",
- "@elastic/apm-rum": "^4.6.0",
- "@elastic/charts": "18.2.2",
+ "@elastic/apm-rum": "^5.1.1",
+ "@elastic/charts": "18.3.0",
"@elastic/datemath": "5.0.3",
"@elastic/ems-client": "7.8.0",
"@elastic/eui": "21.0.1",
@@ -377,7 +377,7 @@
"@types/recompose": "^0.30.6",
"@types/redux-actions": "^2.6.1",
"@types/request": "^2.48.2",
- "@types/selenium-webdriver": "^4.0.5",
+ "@types/selenium-webdriver": "^4.0.9",
"@types/semver": "^5.5.0",
"@types/sinon": "^7.0.13",
"@types/strip-ansi": "^3.0.0",
@@ -463,6 +463,7 @@
"load-grunt-config": "^3.0.1",
"mocha": "^7.1.1",
"mock-http-server": "1.3.0",
+ "ms-chromium-edge-driver": "^0.2.3",
"multistream": "^2.1.1",
"murmurhash3js": "3.0.1",
"mutation-observer": "^1.0.3",
@@ -481,7 +482,7 @@
"react-textarea-autosize": "^7.1.2",
"regenerate": "^1.4.0",
"sass-lint": "^1.12.1",
- "selenium-webdriver": "^4.0.0-alpha.5",
+ "selenium-webdriver": "^4.0.0-alpha.7",
"simple-git": "1.116.0",
"simplebar-react": "^2.1.0",
"sinon": "^7.4.2",
diff --git a/packages/kbn-config-schema/src/index.ts b/packages/kbn-config-schema/src/index.ts
index fc3e3c541846a..5d387f327e58f 100644
--- a/packages/kbn-config-schema/src/index.ts
+++ b/packages/kbn-config-schema/src/index.ts
@@ -60,6 +60,7 @@ import {
export { ObjectType, TypeOf, Type };
export { ByteSizeValue } from './byte_size_value';
export { SchemaTypeError, ValidationError } from './errors';
+export { isConfigSchema } from './typeguards';
function any(options?: TypeOptions) {
return new AnyType(options);
diff --git a/src/legacy/core_plugins/vis_type_timelion/public/legacy_imports.ts b/packages/kbn-config-schema/src/typeguards/index.ts
similarity index 87%
rename from src/legacy/core_plugins/vis_type_timelion/public/legacy_imports.ts
rename to packages/kbn-config-schema/src/typeguards/index.ts
index e7612b288fb24..e724878eb33e9 100644
--- a/src/legacy/core_plugins/vis_type_timelion/public/legacy_imports.ts
+++ b/packages/kbn-config-schema/src/typeguards/index.ts
@@ -17,5 +17,4 @@
* under the License.
*/
-export { npSetup, npStart } from 'ui/new_platform';
-export { PluginsStart } from 'ui/new_platform/new_platform';
+export { isConfigSchema } from './is_config_schema';
diff --git a/packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts b/packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts
new file mode 100644
index 0000000000000..e0ef3835ca0a3
--- /dev/null
+++ b/packages/kbn-config-schema/src/typeguards/is_config_schema.test.ts
@@ -0,0 +1,56 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { schema } from '..';
+import { isConfigSchema } from './is_config_schema';
+
+describe('isConfigSchema', () => {
+ it('returns true for every sub classes of `Type`', () => {
+ expect(isConfigSchema(schema.any())).toBe(true);
+ expect(isConfigSchema(schema.arrayOf(schema.string()))).toBe(true);
+ expect(isConfigSchema(schema.boolean())).toBe(true);
+ expect(isConfigSchema(schema.buffer())).toBe(true);
+ expect(isConfigSchema(schema.byteSize())).toBe(true);
+ expect(isConfigSchema(schema.duration())).toBe(true);
+ expect(isConfigSchema(schema.literal(''))).toBe(true);
+ expect(isConfigSchema(schema.mapOf(schema.string(), schema.number()))).toBe(true);
+ expect(isConfigSchema(schema.nullable(schema.string()))).toBe(true);
+ expect(isConfigSchema(schema.number())).toBe(true);
+ expect(isConfigSchema(schema.object({}))).toBe(true);
+ expect(isConfigSchema(schema.oneOf([schema.string()]))).toBe(true);
+ expect(isConfigSchema(schema.recordOf(schema.string(), schema.object({})))).toBe(true);
+ expect(isConfigSchema(schema.string())).toBe(true);
+ expect(isConfigSchema(schema.stream())).toBe(true);
+ });
+
+ it('returns false for every javascript data type', () => {
+ expect(isConfigSchema('foo')).toBe(false);
+ expect(isConfigSchema(42)).toBe(false);
+ expect(isConfigSchema(new Date())).toBe(false);
+ expect(isConfigSchema(null)).toBe(false);
+ expect(isConfigSchema(undefined)).toBe(false);
+ expect(isConfigSchema([1, 2, 3])).toBe(false);
+ expect(isConfigSchema({ foo: 'bar' })).toBe(false);
+ expect(isConfigSchema(function() {})).toBe(false);
+ });
+
+ it('returns true as long as `__isKbnConfigSchemaType` is true', () => {
+ expect(isConfigSchema({ __isKbnConfigSchemaType: true })).toBe(true);
+ });
+});
diff --git a/src/legacy/core_plugins/vis_type_timelion/public/flot.js b/packages/kbn-config-schema/src/typeguards/is_config_schema.ts
similarity index 78%
rename from src/legacy/core_plugins/vis_type_timelion/public/flot.js
rename to packages/kbn-config-schema/src/typeguards/is_config_schema.ts
index d6ca6d96c34ef..20e68ab2ead25 100644
--- a/src/legacy/core_plugins/vis_type_timelion/public/flot.js
+++ b/packages/kbn-config-schema/src/typeguards/is_config_schema.ts
@@ -17,10 +17,8 @@
* under the License.
*/
-require('jquery.flot');
-require('jquery.flot.time');
-require('jquery.flot.symbol');
-require('jquery.flot.crosshair');
-require('jquery.flot.selection');
-require('jquery.flot.stack');
-require('jquery.flot.axislabels');
+import { Type } from '../types';
+
+export function isConfigSchema(obj: any): obj is Type {
+ return obj ? obj.__isKbnConfigSchemaType === true : false;
+}
diff --git a/packages/kbn-config-schema/src/types/type.ts b/packages/kbn-config-schema/src/types/type.ts
index 6d5ddf6b24afb..5ca16c61399e7 100644
--- a/packages/kbn-config-schema/src/types/type.ts
+++ b/packages/kbn-config-schema/src/types/type.ts
@@ -32,6 +32,9 @@ export abstract class Type {
// sets the value to `null` while still keeping the type.
public readonly type: V = null! as V;
+ // used for the `isConfigSchema` typeguard
+ public readonly __isKbnConfigSchemaType = true;
+
/**
* Internal "schema" backed by Joi.
* @type {Schema}
diff --git a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts b/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts
index 66f17ab579ec3..f4b91d154cbb8 100644
--- a/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts
+++ b/packages/kbn-test/src/functional_test_runner/lib/config/schema.ts
@@ -136,7 +136,7 @@ export const schema = Joi.object()
browser: Joi.object()
.keys({
type: Joi.string()
- .valid('chrome', 'firefox', 'ie')
+ .valid('chrome', 'firefox', 'ie', 'msedge')
.default('chrome'),
logPollingMs: Joi.number().default(100),
diff --git a/packages/kbn-ui-shared-deps/package.json b/packages/kbn-ui-shared-deps/package.json
index 7c5d6a62a11ca..c8614b1df9d5d 100644
--- a/packages/kbn-ui-shared-deps/package.json
+++ b/packages/kbn-ui-shared-deps/package.json
@@ -9,7 +9,7 @@
"kbn:watch": "node scripts/build --watch"
},
"dependencies": {
- "@elastic/charts": "18.2.2",
+ "@elastic/charts": "18.3.0",
"@elastic/eui": "21.0.1",
"@kbn/i18n": "1.0.0",
"abortcontroller-polyfill": "^1.4.0",
diff --git a/src/core/MIGRATION.md b/src/core/MIGRATION.md
index 368d1f47e9c3f..80f12dd78214d 100644
--- a/src/core/MIGRATION.md
+++ b/src/core/MIGRATION.md
@@ -1252,26 +1252,27 @@ import { npStart: { plugins } } from 'ui/new_platform';
In server code, `core` can be accessed from either `server.newPlatform` or `kbnServer.newPlatform`. There are not currently very many services available on the server-side:
-| Legacy Platform | New Platform | Notes |
-| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
-| `server.config()` | [`initializerContext.config.create()`](/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.config.md) | Must also define schema. See _[how to configure plugin](#configure-plugin)_ |
-| `server.route` | [`core.http.createRouter`](/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.createrouter.md) | [Examples](./MIGRATION_EXAMPLES.md#route-registration) |
-| `server.renderApp()` / `server.renderAppWithDefaultConfig()` | [`context.rendering.render()`](/docs/development/core/server/kibana-plugin-core-server.iscopedrenderingclient.render.md) | [Examples](./MIGRATION_EXAMPLES.md#render-html-content) |
-| `request.getBasePath()` | [`core.http.basePath.get`](/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.basepath.md) | |
+| Legacy Platform | New Platform | Notes |
+| ----------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------- |
+| `server.config()` | [`initializerContext.config.create()`](/docs/development/core/server/kibana-plugin-core-server.plugininitializercontext.config.md) | Must also define schema. See _[how to configure plugin](#configure-plugin)_ |
+| `server.route` | [`core.http.createRouter`](/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.createrouter.md) | [Examples](./MIGRATION_EXAMPLES.md#route-registration) |
+| `server.renderApp()` | [`response.renderCoreApp()`](docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.rendercoreapp.md) | [Examples](./MIGRATION_EXAMPLES.md#render-html-content) |
+| `server.renderAppWithDefaultConfig()` | [`response.renderAnonymousCoreApp()`](docs/development/core/server/kibana-plugin-core-server.httpresourcesservicetoolkit.renderanonymouscoreapp.md) | [Examples](./MIGRATION_EXAMPLES.md#render-html-content) |
+| `request.getBasePath()` | [`core.http.basePath.get`](/docs/development/core/server/kibana-plugin-core-server.httpservicesetup.basepath.md) | |
| `server.plugins.elasticsearch.getCluster('data')` | [`context.core.elasticsearch.dataClient`](/docs/development/core/server/kibana-plugin-core-server.iscopedclusterclient.md) | |
| `server.plugins.elasticsearch.getCluster('admin')` | [`context.core.elasticsearch.adminClient`](/docs/development/core/server/kibana-plugin-core-server.iscopedclusterclient.md) | |
-| `server.plugins.elasticsearch.createCluster(...)` | [`core.elasticsearch.legacy.createClient`](/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.legacy.md) | |
-| `server.savedObjects.setScopedSavedObjectsClientFactory` | [`core.savedObjects.setClientFactoryProvider`](/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.setclientfactoryprovider.md) | |
-| `server.savedObjects.addScopedSavedObjectsClientWrapperFactory` | [`core.savedObjects.addClientWrapper`](/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.addclientwrapper.md) | |
+| `server.plugins.elasticsearch.createCluster(...)` | [`core.elasticsearch.legacy.createClient`](/docs/development/core/server/kibana-plugin-core-server.elasticsearchservicestart.legacy.md) | |
+| `server.savedObjects.setScopedSavedObjectsClientFactory` | [`core.savedObjects.setClientFactoryProvider`](/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.setclientfactoryprovider.md) | |
+| `server.savedObjects.addScopedSavedObjectsClientWrapperFactory` | [`core.savedObjects.addClientWrapper`](/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.addclientwrapper.md) | |
| `server.savedObjects.getSavedObjectsRepository` | [`core.savedObjects.createInternalRepository`](/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicestart.createinternalrepository.md) [`core.savedObjects.createScopedRepository`](/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicestart.createscopedrepository.md) | |
-| `server.savedObjects.getScopedSavedObjectsClient` | [`core.savedObjects.getScopedClient`](/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicestart.getscopedclient.md) | |
-| `request.getSavedObjectsClient` | [`context.core.savedObjects.client`](/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md) | |
+| `server.savedObjects.getScopedSavedObjectsClient` | [`core.savedObjects.getScopedClient`](/docs/development/core/server/kibana-plugin-core-server.savedobjectsservicestart.getscopedclient.md) | |
+| `request.getSavedObjectsClient` | [`context.core.savedObjects.client`](/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.core.md) | |
| `request.getUiSettingsService` | [`context.core.uiSettings.client`](/docs/development/core/server/kibana-plugin-core-server.iuisettingsclient.md) | |
-| `kibana.Plugin.deprecations` | [Handle plugin configuration deprecations](#handle-plugin-config-deprecations) and [`PluginConfigDescriptor.deprecations`](docs/development/core/server/kibana-plugin-core-server.pluginconfigdescriptor.md) | Deprecations from New Platform are not applied to legacy configuration |
-| `kibana.Plugin.savedObjectSchemas` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) |
-| `kibana.Plugin.mappings` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) |
-| `kibana.Plugin.migrations` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) |
-| `kibana.Plugin.savedObjectsManagement` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) |
+| `kibana.Plugin.deprecations` | [Handle plugin configuration deprecations](#handle-plugin-config-deprecations) and [`PluginConfigDescriptor.deprecations`](docs/development/core/server/kibana-plugin-core-server.pluginconfigdescriptor.md) | Deprecations from New Platform are not applied to legacy configuration |
+| `kibana.Plugin.savedObjectSchemas` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) |
+| `kibana.Plugin.mappings` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) |
+| `kibana.Plugin.migrations` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) |
+| `kibana.Plugin.savedObjectsManagement` | [`core.savedObjects.registerType`](docs/development/core/server/kibana-plugin-core-server.savedobjectsservicesetup.registertype.md) | [Examples](./MIGRATION_EXAMPLES.md#saved-objects-types) |
_See also: [Server's CoreSetup API Docs](/docs/development/core/server/kibana-plugin-core-server.coresetup.md)_
@@ -1494,8 +1495,9 @@ The above example looks in the new platform as
```
The [request handler context](/docs/development/core/server/kibana-plugin-core-server.requesthandlercontext.md) exposed the next scoped **core** services:
-| Legacy Platform | New Platform |
-| --------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------|
+
+| Legacy Platform | New Platform |
+| --------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| `request.getSavedObjectsClient` | [`context.savedObjects.client`](/docs/development/core/server/kibana-plugin-core-server.savedobjectsclient.md) |
| `server.plugins.elasticsearch.getCluster('admin')` | [`context.elasticsearch.adminClient`](/docs/development/core/server/kibana-plugin-core-server.iscopedclusterclient.md) |
| `server.plugins.elasticsearch.getCluster('data')` | [`context.elasticsearch.dataClient`](/docs/development/core/server/kibana-plugin-core-server.iscopedclusterclient.md) |
diff --git a/src/core/MIGRATION_EXAMPLES.md b/src/core/MIGRATION_EXAMPLES.md
index 37d0b9297ed3c..8c5fe4875aaea 100644
--- a/src/core/MIGRATION_EXAMPLES.md
+++ b/src/core/MIGRATION_EXAMPLES.md
@@ -700,21 +700,15 @@ application.register({
## Render HTML Content
You can return a blank HTML page bootstrapped with the core application bundle from an HTTP route handler
-via the `rendering` context. You may wish to do this if you are rendering a chromeless application with a
+via the `httpResources` service. You may wish to do this if you are rendering a chromeless application with a
custom application route or have other custom rendering needs.
-```ts
-router.get(
+```typescript
+httpResources.register(
{ path: '/chromeless', validate: false },
(context, request, response) => {
- const { http, rendering } = context.core;
-
- return response.ok({
- body: await rendering.render(), // generates an HTML document
- headers: {
- 'content-security-policy': http.csp.header,
- },
- });
+ //... some logic
+ return response.renderCoreApp();
}
);
```
@@ -724,18 +718,12 @@ comprises all UI Settings that are *user provided*, then injected into the page.
You may wish to exclude fetching this data if not authorized or to slim the page
size.
-```ts
-router.get(
- { path: '/', validate: false },
+```typescript
+httpResources.register(
+ { path: '/', validate: false, options: { authRequired: false } },
(context, request, response) => {
- const { http, rendering } = context.core;
-
- return response.ok({
- body: await rendering.render({ includeUserSettings: false }),
- headers: {
- 'content-security-policy': http.csp.header,
- },
- });
+ //... some logic
+ return response.renderAnonymousCoreApp();
}
);
```
diff --git a/src/core/server/http/index.ts b/src/core/server/http/index.ts
index a75eb04fa0120..ca9dfde2e71dc 100644
--- a/src/core/server/http/index.ts
+++ b/src/core/server/http/index.ts
@@ -38,6 +38,7 @@ export {
LifecycleResponseFactory,
RedirectResponseOptions,
RequestHandler,
+ RequestHandlerWrapper,
ResponseError,
ResponseErrorAttributes,
ResponseHeaders,
diff --git a/src/core/server/http/lifecycle/on_pre_response.ts b/src/core/server/http/lifecycle/on_pre_response.ts
index 50d3d7b47bf8d..050881472bc80 100644
--- a/src/core/server/http/lifecycle/on_pre_response.ts
+++ b/src/core/server/http/lifecycle/on_pre_response.ts
@@ -148,7 +148,7 @@ function findHeadersIntersection(
log: Logger
) {
Object.keys(headers).forEach(headerName => {
- if (responseHeaders[headerName] !== undefined) {
+ if (Reflect.has(responseHeaders, headerName)) {
log.warn(`onPreResponseHandler rewrote a response header [${headerName}].`);
}
});
diff --git a/src/core/server/http/router/error_wrapper.ts b/src/core/server/http/router/error_wrapper.ts
index 8f895753c38c3..af99812eff4b3 100644
--- a/src/core/server/http/router/error_wrapper.ts
+++ b/src/core/server/http/router/error_wrapper.ts
@@ -18,20 +18,10 @@
*/
import Boom from 'boom';
-import { KibanaRequest } from './request';
-import { KibanaResponseFactory } from './response';
-import { RequestHandler } from './router';
-import { RequestHandlerContext } from '../../../server';
-import { RouteMethod } from './route';
+import { RequestHandlerWrapper } from './router';
-export const wrapErrors =
,
- response: KibanaResponseFactory
- ) => {
+export const wrapErrors: RequestHandlerWrapper = handler => {
+ return async (context, request, response) => {
try {
return await handler(context, request, response);
} catch (e) {
diff --git a/src/core/server/http/router/headers.ts b/src/core/server/http/router/headers.ts
index 19eaee5081996..b79cc0d325f1e 100644
--- a/src/core/server/http/router/headers.ts
+++ b/src/core/server/http/router/headers.ts
@@ -56,9 +56,9 @@ export type Headers = { [header in KnownHeaders]?: string | string[] | undefined
* Http response headers to set.
* @public
*/
-export type ResponseHeaders = { [header in KnownHeaders]?: string | string[] } & {
- [header: string]: string | string[];
-};
+export type ResponseHeaders =
+ | Record
+ | Record;
const normalizeHeaderField = (field: string) => field.trim().toLowerCase();
diff --git a/src/core/server/http/router/index.ts b/src/core/server/http/router/index.ts
index d254f391ca5e4..83ceff4a25d86 100644
--- a/src/core/server/http/router/index.ts
+++ b/src/core/server/http/router/index.ts
@@ -18,7 +18,7 @@
*/
export { Headers, filterHeaders, ResponseHeaders, KnownHeaders } from './headers';
-export { Router, RequestHandler, IRouter, RouteRegistrar } from './router';
+export { Router, RequestHandler, RequestHandlerWrapper, IRouter, RouteRegistrar } from './router';
export {
KibanaRequest,
KibanaRequestEvents,
diff --git a/src/core/server/http/router/router.ts b/src/core/server/http/router/router.ts
index bb56ee3727d1a..69402a74eda5f 100644
--- a/src/core/server/http/router/router.ts
+++ b/src/core/server/http/router/router.ts
@@ -20,7 +20,7 @@
import { Request, ResponseObject, ResponseToolkit } from 'hapi';
import Boom from 'boom';
-import { Type } from '@kbn/config-schema';
+import { isConfigSchema } from '@kbn/config-schema';
import { Logger } from '../../logging';
import { KibanaRequest } from './request';
import { KibanaResponseFactory, kibanaResponseFactory, IKibanaResponse } from './response';
@@ -98,7 +98,7 @@ export interface IRouter {
* Wrap a router handler to catch and converts legacy boom errors to proper custom errors.
* @param handler {@link RequestHandler} - a route handler to wrap
*/
- handleLegacyErrors:
(handler: RequestHandler
) => RequestHandler
;
+ handleLegacyErrors: RequestHandlerWrapper;
/**
* Returns all routes registered with this router.
@@ -139,7 +139,7 @@ function routeSchemasFromRouteConfig
(
if (route.validate !== false) {
Object.entries(route.validate).forEach(([key, schema]) => {
- if (!(schema instanceof Type || typeof schema === 'function')) {
+ if (!(isConfigSchema(schema) || typeof schema === 'function')) {
throw new Error(
`Expected a valid validation logic declared with '@kbn/config-schema' package or a RouteValidationFunction at key: [${key}].`
);
@@ -237,9 +237,7 @@ export class Router implements IRouter {
return [...this.routes];
}
- public handleLegacyErrors
;
+
// @public
export function resolveSavedObjectsImportErrors({ readStream, objectLimit, retries, savedObjectsClient, supportedTypes, namespace, }: SavedObjectsResolveImportErrorsOptions): Promise;
@@ -1542,11 +1558,7 @@ export type ResponseError = string | Error | {
export type ResponseErrorAttributes = Record;
// @public
-export type ResponseHeaders = {
- [header in KnownHeaders]?: string | string[];
-} & {
- [header: string]: string | string[];
-};
+export type ResponseHeaders = Record | Record;
// @public
export interface RouteConfig
{
@@ -2251,9 +2263,7 @@ export interface SavedObjectsType {
mappings: SavedObjectsTypeMappingDefinition;
migrations?: SavedObjectMigrationMap;
name: string;
- // @deprecated
- namespaceAgnostic?: boolean;
- namespaceType?: SavedObjectsNamespaceType;
+ namespaceType: SavedObjectsNamespaceType;
}
// @public
@@ -2458,12 +2468,11 @@ export const validBodyOutput: readonly ["data", "stream"];
// Warnings were encountered during analysis:
//
// src/core/server/http/router/response.ts:316:3 - (ae-forgotten-export) The symbol "KibanaResponse" needs to be exported by the entry point index.d.ts
-// src/core/server/legacy/types.ts:162:3 - (ae-forgotten-export) The symbol "VarsProvider" needs to be exported by the entry point index.d.ts
-// src/core/server/legacy/types.ts:163:3 - (ae-forgotten-export) The symbol "VarsReplacer" needs to be exported by the entry point index.d.ts
-// src/core/server/legacy/types.ts:164:3 - (ae-forgotten-export) The symbol "LegacyNavLinkSpec" needs to be exported by the entry point index.d.ts
-// src/core/server/legacy/types.ts:165:3 - (ae-forgotten-export) The symbol "LegacyAppSpec" needs to be exported by the entry point index.d.ts
-// src/core/server/legacy/types.ts:166:16 - (ae-forgotten-export) The symbol "LegacyPluginSpec" needs to be exported by the entry point index.d.ts
-// src/core/server/plugins/plugins_service.ts:47:5 - (ae-forgotten-export) The symbol "InternalPluginInfo" needs to be exported by the entry point index.d.ts
+// src/core/server/legacy/types.ts:163:3 - (ae-forgotten-export) The symbol "VarsProvider" needs to be exported by the entry point index.d.ts
+// src/core/server/legacy/types.ts:164:3 - (ae-forgotten-export) The symbol "VarsReplacer" needs to be exported by the entry point index.d.ts
+// src/core/server/legacy/types.ts:165:3 - (ae-forgotten-export) The symbol "LegacyNavLinkSpec" needs to be exported by the entry point index.d.ts
+// src/core/server/legacy/types.ts:166:3 - (ae-forgotten-export) The symbol "LegacyAppSpec" needs to be exported by the entry point index.d.ts
+// src/core/server/legacy/types.ts:167:16 - (ae-forgotten-export) The symbol "LegacyPluginSpec" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:230:3 - (ae-forgotten-export) The symbol "KibanaConfigType" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:230:3 - (ae-forgotten-export) The symbol "SharedGlobalConfigKeys" needs to be exported by the entry point index.d.ts
// src/core/server/plugins/types.ts:232:3 - (ae-forgotten-export) The symbol "PathConfigType" needs to be exported by the entry point index.d.ts
diff --git a/src/core/server/server.test.ts b/src/core/server/server.test.ts
index 24c41d511180a..1e3e1638cf2a0 100644
--- a/src/core/server/server.test.ts
+++ b/src/core/server/server.test.ts
@@ -46,7 +46,10 @@ const rawConfigService = rawConfigServiceMock.create({});
beforeEach(() => {
mockConfigService.atPath.mockReturnValue(new BehaviorSubject({ autoListen: true }));
- mockPluginsService.discover.mockResolvedValue(new Map());
+ mockPluginsService.discover.mockResolvedValue({
+ pluginTree: new Map(),
+ uiPlugins: { internal: new Map(), public: new Map(), browserConfigs: new Map() },
+ });
});
afterEach(() => {
@@ -88,7 +91,10 @@ test('injects legacy dependency to context#setup()', async () => {
[pluginA, []],
[pluginB, [pluginA]],
]);
- mockPluginsService.discover.mockResolvedValue(pluginDependencies);
+ mockPluginsService.discover.mockResolvedValue({
+ pluginTree: pluginDependencies,
+ uiPlugins: { internal: new Map(), public: new Map(), browserConfigs: new Map() },
+ });
await server.setup();
diff --git a/src/core/server/server.ts b/src/core/server/server.ts
index 684f50a5666e1..d4c0ebcfb7cf2 100644
--- a/src/core/server/server.ts
+++ b/src/core/server/server.ts
@@ -29,7 +29,8 @@ import {
import { CoreApp } from './core_app';
import { ElasticsearchService } from './elasticsearch';
import { HttpService } from './http';
-import { RenderingService, RenderingServiceSetup } from './rendering';
+import { HttpResourcesService } from './http_resources';
+import { RenderingService } from './rendering';
import { LegacyService, ensureValidConfiguration } from './legacy';
import { Logger, LoggerFactory } from './logging';
import { UiSettingsService } from './ui_settings';
@@ -71,6 +72,7 @@ export class Server {
private readonly uiSettings: UiSettingsService;
private readonly uuid: UuidService;
private readonly metrics: MetricsService;
+ private readonly httpResources: HttpResourcesService;
private readonly status: StatusService;
private readonly coreApp: CoreApp;
@@ -99,13 +101,14 @@ export class Server {
this.metrics = new MetricsService(core);
this.status = new StatusService(core);
this.coreApp = new CoreApp(core);
+ this.httpResources = new HttpResourcesService(core);
}
public async setup() {
this.log.debug('setting up server');
// Discover any plugins before continuing. This allows other systems to utilize the plugin dependency graph.
- const pluginDependencies = await this.plugins.discover();
+ const { pluginTree, uiPlugins } = await this.plugins.discover();
const legacyPlugins = await this.legacy.discoverPlugins();
// Immediately terminate in case of invalid configuration
@@ -117,10 +120,7 @@ export class Server {
// 1) Can access context from any NP plugin
// 2) Can register context providers that will only be available to other legacy plugins and will not leak into
// New Platform plugins.
- pluginDependencies: new Map([
- ...pluginDependencies,
- [this.legacy.legacyId, [...pluginDependencies.keys()]],
- ]),
+ pluginDependencies: new Map([...pluginTree, [this.legacy.legacyId, [...pluginTree.keys()]]]),
});
const uuidSetup = await this.uuid.setup();
@@ -148,6 +148,17 @@ export class Server {
const metricsSetup = await this.metrics.setup({ http: httpSetup });
+ const renderingSetup = await this.rendering.setup({
+ http: httpSetup,
+ legacyPlugins,
+ uiPlugins,
+ });
+
+ const httpResourcesSetup = this.httpResources.setup({
+ http: httpSetup,
+ rendering: renderingSetup,
+ });
+
const statusSetup = this.status.setup({
elasticsearch: elasticsearchServiceSetup,
savedObjects: savedObjectsSetup,
@@ -158,28 +169,25 @@ export class Server {
context: contextServiceSetup,
elasticsearch: elasticsearchServiceSetup,
http: httpSetup,
- metrics: metricsSetup,
savedObjects: savedObjectsSetup,
status: statusSetup,
uiSettings: uiSettingsSetup,
uuid: uuidSetup,
+ metrics: metricsSetup,
+ rendering: renderingSetup,
+ httpResources: httpResourcesSetup,
};
const pluginsSetup = await this.plugins.setup(coreSetup);
this.pluginsInitialized = pluginsSetup.initialized;
- const renderingSetup = await this.rendering.setup({
- http: httpSetup,
- legacyPlugins,
- plugins: pluginsSetup,
- });
-
await this.legacy.setup({
core: { ...coreSetup, plugins: pluginsSetup, rendering: renderingSetup },
plugins: mapToObject(pluginsSetup.contracts),
+ uiPlugins,
});
- this.registerCoreContext(coreSetup, renderingSetup);
+ this.registerCoreContext(coreSetup);
this.coreApp.setup(coreSetup);
return coreSetup;
@@ -212,7 +220,9 @@ export class Server {
});
await this.http.start();
- await this.rendering.start();
+ await this.rendering.start({
+ legacy: this.legacy,
+ });
await this.metrics.start();
return this.coreStart;
@@ -232,7 +242,7 @@ export class Server {
await this.status.stop();
}
- private registerCoreContext(coreSetup: InternalCoreSetup, rendering: RenderingServiceSetup) {
+ private registerCoreContext(coreSetup: InternalCoreSetup) {
coreSetup.http.registerRouteHandlerContext(
coreId,
'core',
@@ -241,13 +251,6 @@ export class Server {
const uiSettingsClient = coreSetup.uiSettings.asScopedToClient(savedObjectsClient);
return {
- rendering: {
- render: async (options = {}) =>
- rendering.render(req, uiSettingsClient, {
- ...options,
- vars: await this.legacy.legacyInternals!.getVars('core', req),
- }),
- },
savedObjects: {
client: savedObjectsClient,
typeRegistry: this.coreStart!.savedObjects.getTypeRegistry(),
diff --git a/src/core/server/ui_settings/saved_objects/ui_settings.ts b/src/core/server/ui_settings/saved_objects/ui_settings.ts
index 031315bec0dab..1bea65ddee924 100644
--- a/src/core/server/ui_settings/saved_objects/ui_settings.ts
+++ b/src/core/server/ui_settings/saved_objects/ui_settings.ts
@@ -22,7 +22,7 @@ import { SavedObjectsType } from '../../saved_objects';
export const uiSettingsType: SavedObjectsType = {
name: 'config',
hidden: false,
- namespaceAgnostic: false,
+ namespaceType: 'single',
mappings: {
// we don't want to allow `true` in the public `SavedObjectsTypeMappingDefinition` type, however
// this is needed for the config that is kinda a special type. To avoid adding additional internal types
diff --git a/src/legacy/core_plugins/kibana/index.js b/src/legacy/core_plugins/kibana/index.js
index 1d643418997f5..989583742acd0 100644
--- a/src/legacy/core_plugins/kibana/index.js
+++ b/src/legacy/core_plugins/kibana/index.js
@@ -54,11 +54,7 @@ export default function(kibana) {
},
uiExports: {
- hacks: [
- 'plugins/kibana/discover/legacy',
- 'plugins/kibana/dev_tools',
- 'plugins/kibana/visualize/legacy',
- ],
+ hacks: ['plugins/kibana/discover/legacy', 'plugins/kibana/dev_tools'],
app: {
id: 'kibana',
title: 'Kibana',
diff --git a/src/legacy/core_plugins/kibana/public/index.scss b/src/legacy/core_plugins/kibana/public/index.scss
index fbfb0a06fabcf..d49c59970f521 100644
--- a/src/legacy/core_plugins/kibana/public/index.scss
+++ b/src/legacy/core_plugins/kibana/public/index.scss
@@ -13,8 +13,10 @@
// Discover styles
@import 'discover/index';
-// Visualize styles
-@import './visualize/index';
+// Visualization styles are imported here for running karma Browser tests
+// should be somehow included through the "visualizations" plugin initialization
+@import '../../../../plugins/visualizations/public/index';
+
// Has to come after visualize because of some
// bad cascading in the Editor layout
@import '../../../../plugins/maps_legacy/public/index';
diff --git a/src/legacy/core_plugins/kibana/public/kibana.js b/src/legacy/core_plugins/kibana/public/kibana.js
index 0a026a5e0c310..20c46765dcb30 100644
--- a/src/legacy/core_plugins/kibana/public/kibana.js
+++ b/src/legacy/core_plugins/kibana/public/kibana.js
@@ -43,7 +43,6 @@ import 'uiExports/interpreter';
import 'ui/autoload/all';
import './discover/legacy';
-import './visualize/legacy';
import './management';
import './dev_tools';
import { showAppRedirectNotification } from '../../../../plugins/kibana_legacy/public';
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.js.snap b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.js.snap
deleted file mode 100644
index 59b275c7708a4..0000000000000
--- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.js.snap
+++ /dev/null
@@ -1,205 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`CreateIndexPatternWizard defaults to the loading state 1`] = `
-
-
-
-
-
-
-
-`;
-
-exports[`CreateIndexPatternWizard renders index pattern step when there are indices 1`] = `
-
-
-
-
-
-
-
-`;
-
-exports[`CreateIndexPatternWizard renders the empty state when there are no indices 1`] = `
-
-
-
-
-
-
-
-`;
-
-exports[`CreateIndexPatternWizard renders time field step when step is set to 2 1`] = `
-
-
-
-
-
-
-
-`;
-
-exports[`CreateIndexPatternWizard renders when there are no indices but there are remote clusters 1`] = `
-
-
-
-
-
-
-
-`;
-
-exports[`CreateIndexPatternWizard shows system indices even if there are no other indices if the include system indices is toggled 1`] = `
-
-
-
-
-
-
-
-`;
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap
new file mode 100644
index 0000000000000..09a06bd8827ce
--- /dev/null
+++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/__snapshots__/create_index_pattern_wizard.test.tsx.snap
@@ -0,0 +1,312 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`CreateIndexPatternWizard defaults to the loading state 1`] = `
+
+
+
+
+
+
+
+`;
+
+exports[`CreateIndexPatternWizard renders index pattern step when there are indices 1`] = `
+
+
+
+
+
+
+
+`;
+
+exports[`CreateIndexPatternWizard renders the empty state when there are no indices 1`] = `
+
+
+
+
+
+
+
+`;
+
+exports[`CreateIndexPatternWizard renders time field step when step is set to 2 1`] = `
+
+
+
+
+
+
+
+`;
+
+exports[`CreateIndexPatternWizard renders when there are no indices but there are remote clusters 1`] = `
+
+
+
+
+
+
+
+`;
+
+exports[`CreateIndexPatternWizard shows system indices even if there are no other indices if the include system indices is toggled 1`] = `
+
+
+
+
+
+
+
+`;
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx
index 648bf7f8f9738..d8f677b7f6089 100644
--- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx
+++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/components/step_index_pattern/step_index_pattern.tsx
@@ -48,7 +48,7 @@ interface StepIndexPatternProps {
esService: DataPublicPluginStart['search']['__LEGACY']['esClient'];
savedObjectsClient: SavedObjectsClient;
indexPatternCreationType: IndexPatternCreationConfig;
- goToNextStep: () => void;
+ goToNextStep: (query: string) => void;
initialQuery?: string;
uiSettings: IUiSettingsClient;
}
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.test.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.test.tsx
similarity index 55%
rename from src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.test.js
rename to src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.test.tsx
index 941f87d4d9fd2..45af98661eda3 100644
--- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.test.js
+++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.test.tsx
@@ -21,17 +21,12 @@ import React from 'react';
import { shallow } from 'enzyme';
import { CreateIndexPatternWizard } from './create_index_pattern_wizard';
-const mockIndexPatternCreationType = {
- getIndexPatternType: () => 'default',
- getIndexPatternName: () => 'name',
- getIsBeta: () => false,
- checkIndicesForErrors: () => false,
- getShowSystemIndices: () => false,
- renderPrompt: () => {},
- getIndexPatternMappings: () => {
- return {};
- },
-};
+import { coreMock } from '../../../../../../../../core/public/mocks';
+import { dataPluginMock } from '../../../../../../../../plugins/data/public/mocks';
+import { IndexPatternCreationConfig } from '../../../../../../../../plugins/index_pattern_management/public';
+import { IndexPattern } from '../../../../../../../../plugins/data/public';
+import { SavedObjectsClient } from '../../../../../../../../core/public';
+
jest.mock('./components/step_index_pattern', () => ({ StepIndexPattern: 'StepIndexPattern' }));
jest.mock('./components/step_time_field', () => ({ StepTimeField: 'StepTimeField' }));
jest.mock('./components/header', () => ({ Header: 'Header' }));
@@ -46,39 +41,36 @@ jest.mock('ui/chrome', () => ({
addBasePath: () => {},
}));
-const loadingDataDocUrl = '';
+const { savedObjects, overlays, uiSettings } = coreMock.createStart();
+const { indexPatterns, search } = dataPluginMock.createStartContract();
+const mockIndexPatternCreationType = new IndexPatternCreationConfig({
+ type: 'default',
+ name: 'name',
+});
+
const initialQuery = '';
const services = {
- es: {},
- indexPatterns: {},
- savedObjectsClient: {},
- config: {},
- changeUrl: () => {},
- scopeApply: () => {},
-
+ es: search.__LEGACY.esClient,
+ indexPatterns,
+ savedObjectsClient: savedObjects.client as SavedObjectsClient,
+ uiSettings,
+ changeUrl: jest.fn(),
+ openConfirm: overlays.openConfirm,
indexPatternCreationType: mockIndexPatternCreationType,
};
describe('CreateIndexPatternWizard', () => {
- it(`defaults to the loading state`, async () => {
+ test(`defaults to the loading state`, () => {
const component = shallow(
-
+
);
expect(component).toMatchSnapshot();
});
- it('renders the empty state when there are no indices', async () => {
+ test('renders the empty state when there are no indices', async () => {
const component = shallow(
-
+
);
component.setState({
@@ -91,13 +83,9 @@ describe('CreateIndexPatternWizard', () => {
expect(component).toMatchSnapshot();
});
- it('renders when there are no indices but there are remote clusters', async () => {
+ test('renders when there are no indices but there are remote clusters', async () => {
const component = shallow(
-
+
);
component.setState({
@@ -110,13 +98,9 @@ describe('CreateIndexPatternWizard', () => {
expect(component).toMatchSnapshot();
});
- it('shows system indices even if there are no other indices if the include system indices is toggled', async () => {
+ test('shows system indices even if there are no other indices if the include system indices is toggled', async () => {
const component = shallow(
-
+
);
component.setState({
@@ -129,13 +113,9 @@ describe('CreateIndexPatternWizard', () => {
expect(component).toMatchSnapshot();
});
- it('renders index pattern step when there are indices', async () => {
+ test('renders index pattern step when there are indices', async () => {
const component = shallow(
-
+
);
component.setState({
@@ -147,13 +127,9 @@ describe('CreateIndexPatternWizard', () => {
expect(component).toMatchSnapshot();
});
- it('renders time field step when step is set to 2', async () => {
+ test('renders time field step when step is set to 2', async () => {
const component = shallow(
-
+
);
component.setState({
@@ -166,37 +142,30 @@ describe('CreateIndexPatternWizard', () => {
expect(component).toMatchSnapshot();
});
- it('invokes the provided services when creating an index pattern', async () => {
- const get = jest.fn();
- const set = jest.fn();
+ test('invokes the provided services when creating an index pattern', async () => {
const create = jest.fn().mockImplementation(() => 'id');
const clear = jest.fn();
- const changeUrl = jest.fn();
-
- const component = shallow(
- ({
- create,
- }),
- clearCache: clear,
- },
- changeUrl,
- indexPatternCreationType: mockIndexPatternCreationType,
- }}
- />
+ services.indexPatterns.clearCache = clear;
+ const indexPattern = ({
+ id: '1',
+ title: 'my-fake-index-pattern',
+ timeFieldName: 'timestamp',
+ fields: [],
+ create,
+ } as unknown) as IndexPattern;
+ services.indexPatterns.make = async () => {
+ return indexPattern;
+ };
+
+ const component = shallow(
+
);
component.setState({ indexPattern: 'foo' });
- await component.instance().createIndexPattern(null, 'id');
- expect(get).toBeCalled();
+ await component.instance().createIndexPattern(undefined, 'id');
+ expect(services.uiSettings.get).toBeCalled();
expect(create).toBeCalled();
expect(clear).toBeCalledWith('id');
- expect(changeUrl).toBeCalledWith(`/management/kibana/index_patterns/id`);
+ expect(services.changeUrl).toBeCalledWith(`/management/kibana/index_patterns/id`);
});
});
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx
similarity index 63%
rename from src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.js
rename to src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx
index 1a93188edd6cc..4166d48349d35 100644
--- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.js
+++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/create_index_pattern_wizard.tsx
@@ -17,11 +17,11 @@
* under the License.
*/
-import React, { Component } from 'react';
-import PropTypes from 'prop-types';
+import React, { ReactElement, Component } from 'react';
-import { EuiGlobalToastList } from '@elastic/eui';
+import { EuiGlobalToastList, EuiGlobalToastListToast } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n/react';
+import { i18n } from '@kbn/i18n';
import { StepIndexPattern } from './components/step_index_pattern';
import { StepTimeField } from './components/step_time_field';
@@ -31,41 +31,61 @@ import { EmptyState } from './components/empty_state';
import { MAX_SEARCH_SIZE } from './constants';
import { ensureMinimumTime, getIndices } from './lib';
-import { i18n } from '@kbn/i18n';
-
-export class CreateIndexPatternWizard extends Component {
- static propTypes = {
- initialQuery: PropTypes.string,
- services: PropTypes.shape({
- es: PropTypes.object.isRequired,
- indexPatterns: PropTypes.object.isRequired,
- savedObjectsClient: PropTypes.object.isRequired,
- indexPatternCreationType: PropTypes.object.isRequired,
- config: PropTypes.object.isRequired,
- changeUrl: PropTypes.func.isRequired,
- openConfirm: PropTypes.func.isRequired,
- }).isRequired,
+import {
+ SavedObjectsClient,
+ IUiSettingsClient,
+ OverlayStart,
+} from '../../../../../../../../core/public';
+import { DataPublicPluginStart } from '../../../../../../../../plugins/data/public';
+import { IndexPatternCreationConfig } from '../../../../../../../../plugins/index_pattern_management/public';
+import { MatchedIndex } from './types';
+
+interface CreateIndexPatternWizardProps {
+ initialQuery: string;
+ services: {
+ indexPatternCreationType: IndexPatternCreationConfig;
+ es: DataPublicPluginStart['search']['__LEGACY']['esClient'];
+ indexPatterns: DataPublicPluginStart['indexPatterns'];
+ savedObjectsClient: SavedObjectsClient;
+ uiSettings: IUiSettingsClient;
+ changeUrl: (url: string) => void;
+ openConfirm: OverlayStart['openConfirm'];
};
+}
- constructor(props) {
- super(props);
- this.indexPatternCreationType = this.props.services.indexPatternCreationType;
- this.state = {
- step: 1,
- indexPattern: '',
- allIndices: [],
- remoteClustersExist: false,
- isInitiallyLoadingIndices: true,
- isIncludingSystemIndices: false,
- toasts: [],
- };
- }
+interface CreateIndexPatternWizardState {
+ step: number;
+ indexPattern: string;
+ allIndices: MatchedIndex[];
+ remoteClustersExist: boolean;
+ isInitiallyLoadingIndices: boolean;
+ isIncludingSystemIndices: boolean;
+ toasts: EuiGlobalToastListToast[];
+}
+
+export class CreateIndexPatternWizard extends Component<
+ CreateIndexPatternWizardProps,
+ CreateIndexPatternWizardState
+> {
+ state = {
+ step: 1,
+ indexPattern: '',
+ allIndices: [],
+ remoteClustersExist: false,
+ isInitiallyLoadingIndices: true,
+ isIncludingSystemIndices: false,
+ toasts: [],
+ };
async UNSAFE_componentWillMount() {
this.fetchData();
}
- catchAndWarn = async (asyncFn, errorValue, errorMsg) => {
+ catchAndWarn = async (
+ asyncFn: Promise,
+ errorValue: [] | string[],
+ errorMsg: ReactElement
+ ) => {
try {
return await asyncFn;
} catch (errors) {
@@ -109,22 +129,26 @@ export class CreateIndexPatternWizard extends Component {
// query local and remote indices, updating state independently
ensureMinimumTime(
this.catchAndWarn(
- getIndices(services.es, this.indexPatternCreationType, `*`, MAX_SEARCH_SIZE),
+ getIndices(services.es, services.indexPatternCreationType, `*`, MAX_SEARCH_SIZE),
[],
indicesFailMsg
)
- ).then(allIndices => this.setState({ allIndices, isInitiallyLoadingIndices: false }));
+ ).then((allIndices: MatchedIndex[]) =>
+ this.setState({ allIndices, isInitiallyLoadingIndices: false })
+ );
this.catchAndWarn(
// if we get an error from remote cluster query, supply fallback value that allows user entry.
// ['a'] is fallback value
- getIndices(services.es, this.indexPatternCreationType, `*:*`, 1),
+ getIndices(services.es, services.indexPatternCreationType, `*:*`, 1),
['a'],
clustersFailMsg
- ).then(remoteIndices => this.setState({ remoteClustersExist: !!remoteIndices.length }));
+ ).then((remoteIndices: string[] | MatchedIndex[]) =>
+ this.setState({ remoteClustersExist: !!remoteIndices.length })
+ );
};
- createIndexPattern = async (timeFieldName, indexPatternId) => {
+ createIndexPattern = async (timeFieldName: string | undefined, indexPatternId: string) => {
const { services } = this.props;
const { indexPattern } = this.state;
@@ -134,13 +158,13 @@ export class CreateIndexPatternWizard extends Component {
id: indexPatternId,
title: indexPattern,
timeFieldName,
- ...this.indexPatternCreationType.getIndexPatternMappings(),
+ ...services.indexPatternCreationType.getIndexPatternMappings(),
});
const createdId = await emptyPattern.create();
if (!createdId) {
const confirmMessage = i18n.translate('kbn.management.indexPattern.titleExistsLabel', {
- values: { title: this.title },
+ values: { title: emptyPattern.title },
defaultMessage: "An index pattern with the title '{title}' already exists.",
});
@@ -157,15 +181,15 @@ export class CreateIndexPatternWizard extends Component {
}
}
- if (!services.config.get('defaultIndex')) {
- await services.config.set('defaultIndex', createdId);
+ if (!services.uiSettings.get('defaultIndex')) {
+ await services.uiSettings.set('defaultIndex', createdId);
}
services.indexPatterns.clearCache(createdId);
services.changeUrl(`/management/kibana/index_patterns/${createdId}`);
};
- goToTimeFieldStep = indexPattern => {
+ goToTimeFieldStep = (indexPattern: string) => {
this.setState({ step: 2, indexPattern });
};
@@ -174,22 +198,23 @@ export class CreateIndexPatternWizard extends Component {
};
onChangeIncludingSystemIndices = () => {
- this.setState(state => ({
- isIncludingSystemIndices: !state.isIncludingSystemIndices,
+ this.setState(prevState => ({
+ isIncludingSystemIndices: !prevState.isIncludingSystemIndices,
}));
};
renderHeader() {
const { isIncludingSystemIndices } = this.state;
+ const { services } = this.props;
return (
);
}
@@ -208,7 +233,7 @@ export class CreateIndexPatternWizard extends Component {
return ;
}
- const hasDataIndices = allIndices.some(({ name }) => !name.startsWith('.'));
+ const hasDataIndices = allIndices.some(({ name }: MatchedIndex) => !name.startsWith('.'));
if (!hasDataIndices && !isIncludingSystemIndices && !remoteClustersExist) {
return ;
}
@@ -222,7 +247,7 @@ export class CreateIndexPatternWizard extends Component {
isIncludingSystemIndices={isIncludingSystemIndices}
esService={services.es}
savedObjectsClient={services.savedObjectsClient}
- indexPatternCreationType={this.indexPatternCreationType}
+ indexPatternCreationType={services.indexPatternCreationType}
goToNextStep={this.goToTimeFieldStep}
uiSettings={services.uiSettings}
/>
@@ -237,7 +262,7 @@ export class CreateIndexPatternWizard extends Component {
indexPatternsService={services.indexPatterns}
goToPreviousStep={this.goToIndexPatternStep}
createIndexPattern={this.createIndexPattern}
- indexPatternCreationType={this.indexPatternCreationType}
+ indexPatternCreationType={services.indexPatternCreationType}
/>
);
}
@@ -245,9 +270,9 @@ export class CreateIndexPatternWizard extends Component {
return null;
}
- removeToast = removedToast => {
+ removeToast = (id: string) => {
this.setState(prevState => ({
- toasts: prevState.toasts.filter(toast => toast.id !== removedToast.id),
+ toasts: prevState.toasts.filter(toast => toast.id !== id),
}));
};
@@ -263,7 +288,9 @@ export class CreateIndexPatternWizard extends Component {
{
+ this.removeToast(id);
+ }}
toastLifeTimeMs={6000}
/>
diff --git a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js
index 47cb773258cb4..ed1fc026c560c 100644
--- a/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js
+++ b/src/legacy/core_plugins/kibana/public/management/sections/index_patterns/create_index_pattern_wizard/index.js
@@ -36,17 +36,15 @@ uiRoutes.when('/management/kibana/index_pattern', {
$routeParams.type
);
const services = {
- config: npStart.core.uiSettings,
+ uiSettings: npStart.core.uiSettings,
es: npStart.plugins.data.search.__LEGACY.esClient,
indexPatterns: npStart.plugins.data.indexPatterns,
- $http: npStart.core.http,
savedObjectsClient: npStart.core.savedObjects.client,
indexPatternCreationType,
changeUrl: url => {
$scope.$evalAsync(() => kbnUrl.changePath(url));
},
openConfirm: npStart.core.overlays.openConfirm,
- uiSettings: npStart.core.uiSettings,
};
const initialQuery = $routeParams.id ? decodeURIComponent($routeParams.id) : undefined;
diff --git a/src/legacy/core_plugins/kibana/public/visualize/_index.scss b/src/legacy/core_plugins/kibana/public/visualize/_index.scss
deleted file mode 100644
index 079d82936bb57..0000000000000
--- a/src/legacy/core_plugins/kibana/public/visualize/_index.scss
+++ /dev/null
@@ -1,5 +0,0 @@
-// Visualize plugin styles
-@import 'np_ready/index';
-
-// should be removed while moving the visualize into NP
-@import '../../../../../plugins/vis_default_editor/public/index'
diff --git a/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts b/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts
deleted file mode 100644
index f6d73b987912d..0000000000000
--- a/src/legacy/core_plugins/kibana/public/visualize/legacy_imports.ts
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-/**
- * The imports in this file are static functions and types which still live in legacy folders and are used
- * within dashboard. To consolidate them all in one place, they are re-exported from this file. Eventually
- * this list should become empty. Imports from the top level of shimmed or moved plugins can be imported
- * directly where they are needed.
- */
-
-export { DashboardConstants } from '../../../../../plugins/dashboard/public';
-export {
- VisSavedObject,
- VISUALIZE_EMBEDDABLE_TYPE,
-} from '../../../../../plugins/visualizations/public/';
-export {
- configureAppAngularModule,
- migrateLegacyQuery,
- subscribeWithScope,
-} from '../../../../../plugins/kibana_legacy/public';
diff --git a/src/legacy/core_plugins/timelion/public/app.js b/src/legacy/core_plugins/timelion/public/app.js
index c15318d29e761..7f5c7d4664af8 100644
--- a/src/legacy/core_plugins/timelion/public/app.js
+++ b/src/legacy/core_plugins/timelion/public/app.js
@@ -27,10 +27,11 @@ import { fatalError, toastNotifications } from 'ui/notify';
import { timefilter } from 'ui/timefilter';
import { npStart } from 'ui/new_platform';
import { getSavedSheetBreadcrumbs, getCreateBreadcrumbs } from './breadcrumbs';
-import { getTimezone } from '../../vis_type_timelion/public';
+import { getTimezone } from '../../../../plugins/vis_type_timelion/public';
import 'uiExports/savedObjectTypes';
+require('ui/i18n');
require('ui/autoload/all');
// TODO: remove ui imports completely (move to plugins)
@@ -57,7 +58,7 @@ require('plugins/timelion/directives/timelion_options_sheet');
document.title = 'Timelion - Kibana';
-const app = require('ui/modules').get('apps/timelion', []);
+const app = require('ui/modules').get('apps/timelion', ['i18n', 'ngSanitize']);
require('ui/routes').enable();
diff --git a/src/legacy/core_plugins/timelion/public/directives/timelion_expression_input.js b/src/legacy/core_plugins/timelion/public/directives/timelion_expression_input.js
index 57262fda55e48..35ac883e5d99c 100644
--- a/src/legacy/core_plugins/timelion/public/directives/timelion_expression_input.js
+++ b/src/legacy/core_plugins/timelion/public/directives/timelion_expression_input.js
@@ -43,7 +43,7 @@
import _ from 'lodash';
import $ from 'jquery';
import PEG from 'pegjs';
-import grammar from 'raw-loader!../../../../../plugins/timelion/common/chain.peg';
+import grammar from 'raw-loader!../../../../../plugins/vis_type_timelion/common/chain.peg';
import timelionExpressionInputTemplate from './timelion_expression_input.html';
import {
SUGGESTION_TYPE,
@@ -52,7 +52,7 @@ import {
insertAtLocation,
} from './timelion_expression_input_helpers';
import { comboBoxKeyCodes } from '@elastic/eui';
-import { getArgValueSuggestions } from '../../../vis_type_timelion/public/helpers/arg_value_suggestions';
+import { npStart } from 'ui/new_platform';
const Parser = PEG.generate(grammar);
@@ -68,7 +68,7 @@ export function TimelionExpInput($http, $timeout) {
replace: true,
template: timelionExpressionInputTemplate,
link: function(scope, elem) {
- const argValueSuggestions = getArgValueSuggestions();
+ const argValueSuggestions = npStart.plugins.visTypeTimelion.getArgValueSuggestions();
const expressionInput = elem.find('[data-expression-input]');
const functionReference = {};
let suggestibleFunctionLocation = {};
diff --git a/src/legacy/core_plugins/timelion/public/panels/timechart/schema.ts b/src/legacy/core_plugins/timelion/public/panels/timechart/schema.ts
index cd40cbfa89ffe..34b389f5ff4ce 100644
--- a/src/legacy/core_plugins/timelion/public/panels/timechart/schema.ts
+++ b/src/legacy/core_plugins/timelion/public/panels/timechart/schema.ts
@@ -17,7 +17,8 @@
* under the License.
*/
-import '../../../../vis_type_timelion/public/flot';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import '../../../../../../plugins/vis_type_timelion/public/flot';
import _ from 'lodash';
import $ from 'jquery';
import moment from 'moment-timezone';
@@ -28,11 +29,14 @@ import {
calculateInterval,
DEFAULT_TIME_FORMAT,
// @ts-ignore
-} from '../../../../../../plugins/timelion/common/lib';
-import { tickFormatters } from '../../../../vis_type_timelion/public/helpers/tick_formatters';
+} from '../../../../../../plugins/vis_type_timelion/common/lib';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import { tickFormatters } from '../../../../../../plugins/vis_type_timelion/public/helpers/tick_formatters';
import { TimelionVisualizationDependencies } from '../../plugin';
-import { xaxisFormatterProvider } from '../../../../vis_type_timelion/public/helpers/xaxis_formatter';
-import { generateTicksProvider } from '../../../../vis_type_timelion/public/helpers/tick_generator';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import { xaxisFormatterProvider } from '../../../../../../plugins/vis_type_timelion/public/helpers/xaxis_formatter';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import { generateTicksProvider } from '../../../../../../plugins/vis_type_timelion/public/helpers/tick_generator';
const DEBOUNCE_DELAY = 50;
diff --git a/src/legacy/core_plugins/vis_type_markdown/index.ts b/src/legacy/core_plugins/vis_type_markdown/index.ts
deleted file mode 100644
index 3c00420e57d55..0000000000000
--- a/src/legacy/core_plugins/vis_type_markdown/index.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { resolve } from 'path';
-import { Legacy } from 'kibana';
-
-import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy/types';
-
-const markdownPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) =>
- new Plugin({
- id: 'markdown_vis',
- require: ['kibana', 'elasticsearch'],
- publicDir: resolve(__dirname, 'public'),
- uiExports: {
- styleSheetPaths: resolve(__dirname, 'public/index.scss'),
- hacks: [resolve(__dirname, 'public/legacy')],
- injectDefaultVars: server => ({}),
- },
- init: (server: Legacy.Server) => ({}),
- config(Joi: any) {
- return Joi.object({
- enabled: Joi.boolean().default(true),
- }).default();
- },
- } as Legacy.PluginSpecOptions);
-
-// eslint-disable-next-line import/no-default-export
-export default markdownPluginInitializer;
diff --git a/src/legacy/core_plugins/vis_type_markdown/package.json b/src/legacy/core_plugins/vis_type_markdown/package.json
deleted file mode 100644
index 5c233d82fe506..0000000000000
--- a/src/legacy/core_plugins/vis_type_markdown/package.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name": "markdown_vis",
- "version": "kibana"
-}
diff --git a/src/legacy/core_plugins/vis_type_markdown/public/legacy.ts b/src/legacy/core_plugins/vis_type_markdown/public/legacy.ts
deleted file mode 100644
index 1cfc583f6e005..0000000000000
--- a/src/legacy/core_plugins/vis_type_markdown/public/legacy.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { PluginInitializerContext } from 'kibana/public';
-import { npSetup, npStart } from 'ui/new_platform';
-import { MarkdownPluginSetupDependencies } from './plugin';
-import { plugin } from '.';
-
-const plugins: Readonly = {
- expressions: npSetup.plugins.expressions,
- visualizations: npSetup.plugins.visualizations,
-};
-
-const pluginInstance = plugin({} as PluginInitializerContext);
-
-export const setup = pluginInstance.setup(npSetup.core, plugins);
-export const start = pluginInstance.start(npStart.core);
diff --git a/src/legacy/core_plugins/vis_type_timelion/index.ts b/src/legacy/core_plugins/vis_type_timelion/index.ts
deleted file mode 100644
index 7bca5154c84fd..0000000000000
--- a/src/legacy/core_plugins/vis_type_timelion/index.ts
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Licensed to Elasticsearch B.V. under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch B.V. licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import { resolve } from 'path';
-import { Legacy } from 'kibana';
-
-import { LegacyPluginApi, LegacyPluginInitializer } from '../../../../src/legacy/types';
-
-const timelionVisPluginInitializer: LegacyPluginInitializer = ({ Plugin }: LegacyPluginApi) =>
- new Plugin({
- id: 'timelion_vis',
- require: ['kibana', 'elasticsearch'],
- publicDir: resolve(__dirname, 'public'),
- uiExports: {
- styleSheetPaths: resolve(__dirname, 'public/index.scss'),
- hacks: [resolve(__dirname, 'public/legacy')],
- injectDefaultVars: server => ({}),
- },
- init: (server: Legacy.Server) => ({}),
- config(Joi: any) {
- return Joi.object({
- enabled: Joi.boolean().default(true),
- }).default();
- },
- });
-
-// eslint-disable-next-line import/no-default-export
-export default timelionVisPluginInitializer;
diff --git a/src/legacy/core_plugins/vis_type_timelion/package.json b/src/legacy/core_plugins/vis_type_timelion/package.json
deleted file mode 100644
index 9b09f98ce6caf..0000000000000
--- a/src/legacy/core_plugins/vis_type_timelion/package.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "name": "timelion_vis",
- "version": "kibana"
-}
diff --git a/src/legacy/core_plugins/vis_type_timelion/public/components/_index.scss b/src/legacy/core_plugins/vis_type_timelion/public/components/_index.scss
deleted file mode 100644
index 1d887f43ff9a1..0000000000000
--- a/src/legacy/core_plugins/vis_type_timelion/public/components/_index.scss
+++ /dev/null
@@ -1,2 +0,0 @@
-@import './panel';
-@import './timelion_expression_input';
diff --git a/src/legacy/server/kbn_server.d.ts b/src/legacy/server/kbn_server.d.ts
index a9b8c29374854..0d2f3528c9019 100644
--- a/src/legacy/server/kbn_server.d.ts
+++ b/src/legacy/server/kbn_server.d.ts
@@ -41,10 +41,11 @@ import {
// eslint-disable-next-line @kbn/eslint/no-restricted-paths
import { LegacyConfig, ILegacyService, ILegacyInternals } from '../../core/server/legacy';
+// eslint-disable-next-line @kbn/eslint/no-restricted-paths
+import { UiPlugins } from '../../core/server/plugins';
import { ApmOssPlugin } from '../core_plugins/apm_oss';
import { CallClusterWithRequest, ElasticsearchPlugin } from '../core_plugins/elasticsearch';
import { UsageCollectionSetup } from '../../plugins/usage_collection/server';
-import { Capabilities } from '../../core/server';
import { UiSettingsServiceFactoryOptions } from '../../legacy/ui/ui_settings/ui_settings_service_factory';
import { HomeServerPluginSetup } from '../../plugins/home/server';
@@ -111,7 +112,7 @@ export interface KibanaCore {
kibanaMigrator: LegacyServiceStartDeps['core']['savedObjects']['migrator'];
legacy: ILegacyInternals;
rendering: LegacyServiceSetupDeps['core']['rendering'];
- uiPlugins: LegacyServiceSetupDeps['core']['plugins']['uiPlugins'];
+ uiPlugins: UiPlugins;
uiSettings: LegacyServiceSetupDeps['core']['uiSettings'];
savedObjectsClientProvider: LegacyServiceStartDeps['core']['savedObjects']['clientProvider'];
};
diff --git a/src/legacy/ui/public/_index.scss b/src/legacy/ui/public/_index.scss
index 87006d9347de4..aaed52f8b120a 100644
--- a/src/legacy/ui/public/_index.scss
+++ b/src/legacy/ui/public/_index.scss
@@ -17,9 +17,3 @@
@import './field_editor/index';
@import './style_compile/index';
@import '../../../plugins/management/public/components/index';
-
-// The following are prefixed with "vis"
-
-// Can't import vis folder here because of cascading issues, it's imported in core_plugins/kibana
-// @import './vis/index';
-@import './visualize/index';
diff --git a/src/legacy/ui/public/new_platform/new_platform.ts b/src/legacy/ui/public/new_platform/new_platform.ts
index 80fb837258d4c..5ae2e2348aaa1 100644
--- a/src/legacy/ui/public/new_platform/new_platform.ts
+++ b/src/legacy/ui/public/new_platform/new_platform.ts
@@ -69,6 +69,7 @@ import {
VisualizationsSetup,
VisualizationsStart,
} from '../../../../plugins/visualizations/public';
+import { VisTypeTimelionPluginStart } from '../../../../plugins/vis_type_timelion/public';
import { MapsLegacyPluginSetup } from '../../../../plugins/maps_legacy/public';
export interface PluginsSetup {
@@ -116,6 +117,7 @@ export interface PluginsStart {
telemetry?: TelemetryPluginStart;
dashboard: DashboardStart;
savedObjectsManagement: SavedObjectsManagementPluginStart;
+ visTypeTimelion: VisTypeTimelionPluginStart;
indexPatternManagement: IndexPatternManagementStart;
}
diff --git a/src/legacy/ui/public/visualize/_index.scss b/src/legacy/ui/public/visualize/_index.scss
deleted file mode 100644
index d9761f741353b..0000000000000
--- a/src/legacy/ui/public/visualize/_index.scss
+++ /dev/null
@@ -1 +0,0 @@
-@import '../../../../plugins/visualizations/public/components/index';
diff --git a/src/plugins/console/server/__tests__/proxy_route/proxy_fallback.test.ts b/src/plugins/console/server/__tests__/proxy_route/proxy_fallback.test.ts
new file mode 100644
index 0000000000000..b226bad11a01a
--- /dev/null
+++ b/src/plugins/console/server/__tests__/proxy_route/proxy_fallback.test.ts
@@ -0,0 +1,64 @@
+/*
+ * Licensed to Elasticsearch B.V. under one or more contributor
+ * license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright
+ * ownership. Elasticsearch B.V. licenses this file to you under
+ * the Apache License, Version 2.0 (the "License"); you may
+ * not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { duration } from 'moment';
+import { getProxyRouteHandlerDeps } from './mocks';
+
+import { kibanaResponseFactory } from '../../../../../core/server';
+import { createHandler } from '../../routes/api/console/proxy/create_handler';
+import * as requestModule from '../../lib/proxy_request';
+
+describe('Console Proxy Route', () => {
+ afterEach(async () => {
+ jest.resetAllMocks();
+ });
+
+ describe('fallback behaviour', () => {
+ it('falls back to all configured endpoints regardless of error', async () => {
+ // Describe a situation where all three configured nodes reject
+ (requestModule.proxyRequest as jest.Mock).mockRejectedValueOnce(new Error('ECONNREFUSED'));
+ (requestModule.proxyRequest as jest.Mock).mockRejectedValueOnce(new Error('EHOSTUNREACH'));
+ (requestModule.proxyRequest as jest.Mock).mockRejectedValueOnce(new Error('ESOCKETTIMEDOUT'));
+
+ const handler = createHandler(
+ getProxyRouteHandlerDeps({
+ readLegacyESConfig: () => ({
+ requestTimeout: duration(30000),
+ customHeaders: {},
+ requestHeadersWhitelist: [],
+ hosts: ['http://localhost:9201', 'http://localhost:9202', 'http://localhost:9203'],
+ }),
+ })
+ );
+
+ const response = await handler(
+ {} as any,
+ {
+ headers: {},
+ query: { method: 'get', path: 'test' },
+ } as any,
+ kibanaResponseFactory
+ );
+
+ expect(response.status).toBe(502);
+ // Return the message from the ES node we attempted last.
+ expect(response.payload.message).toBe('ESOCKETTIMEDOUT');
+ });
+ });
+});
diff --git a/src/plugins/console/server/lib/spec_definitions/json/overrides/cluster.put_settings.json b/src/plugins/console/server/lib/spec_definitions/json/overrides/cluster.put_settings.json
index 408b01c4cb8f5..0da2c130b47cf 100644
--- a/src/plugins/console/server/lib/spec_definitions/json/overrides/cluster.put_settings.json
+++ b/src/plugins/console/server/lib/spec_definitions/json/overrides/cluster.put_settings.json
@@ -59,7 +59,61 @@
}
},
"transient": {
- "__scope_link": ".persistent"
+ "cluster": {
+ "routing": {
+ "allocation.enable": {
+ "__one_of": ["all", "primaries", "new_primaries", "none"]
+ },
+ "allocation.disk.threshold_enabled": { "__one_of": [false, true] },
+ "allocation.disk.watermark.low": "85%",
+ "allocation.disk.watermark.high": "90%",
+ "allocation.disk.reroute_interval": "60s",
+ "allocation.exclude": {
+ "_ip": "",
+ "_name": "",
+ "_host": "",
+ "_id": ""
+ },
+ "allocation.include": {
+ "_ip": "",
+ "_name": "",
+ "_host": "",
+ "_id": ""
+ },
+ "allocation.require": {
+ "_ip": "",
+ "_name": "",
+ "_host": "",
+ "_id": ""
+ },
+ "allocation.awareness.attributes": [],
+ "allocation.awareness.force": {
+ "*": {
+ "values": []
+ }
+ },
+ "allocation.allow_rebalance": {
+ "__one_of": [
+ "always",
+ "indices_primaries_active",
+ "indices_all_active"
+ ]
+ },
+ "allocation.cluster_concurrent_rebalance": 2,
+ "allocation.node_initial_primaries_recoveries": 4,
+ "allocation.node_concurrent_recoveries": 2,
+ "allocation.same_shard.host": { "__one_of": [false, true] }
+ }
+ },
+ "indices": {
+ "breaker": {
+ "total.limit": "70%",
+ "fielddata.limit": "60%",
+ "fielddata.overhead": 1.03,
+ "request.limit": "40%",
+ "request.overhead": 1.0
+ }
+ }
}
}
}
diff --git a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts
index 50a9fcf03c209..9446289ff03ea 100644
--- a/src/plugins/console/server/routes/api/console/proxy/create_handler.ts
+++ b/src/plugins/console/server/routes/api/console/proxy/create_handler.ts
@@ -175,10 +175,9 @@ export const createHandler = ({
break;
} catch (e) {
+ // If we reached here it means we hit a lower level network issue than just, for e.g., a 500.
+ // We try contacting another node in that case.
log.error(e);
- if (e.code !== 'ECONNREFUSED') {
- return response.internalError(e);
- }
if (idx === hosts.length - 1) {
log.warn(`Could not connect to any configured ES node [${hosts.join(', ')}]`);
return response.customError({
diff --git a/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap b/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap
index e71e4f1b15134..7210879c5eacc 100644
--- a/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap
+++ b/src/plugins/dashboard/public/application/__snapshots__/dashboard_empty_screen.test.tsx.snap
@@ -667,14 +667,13 @@ exports[`DashboardEmptyScreen renders correctly with visualize paragraph 1`] = `